diff --git a/public/core/common/CharacterIdMap.test.js b/public/core/common/CharacterIdMap.test.js index 9e0666085..bd7dd7ff7 100644 --- a/public/core/common/CharacterIdMap.test.js +++ b/public/core/common/CharacterIdMap.test.js @@ -34,7 +34,7 @@ describe('CharacterIdMap class', () => { }); it('returns null when trying to convert a character that does not exist in the Map', () => { const characterIdMap = new CharacterIdMap(); - assert.strictEqual(characterIdMap.fromChar('!'), null, 'character was not converted correctly'); + assert.isNull(characterIdMap.fromChar('!'), 'character was not converted correctly'); }); }); //# sourceMappingURL=CharacterIdMap.test.js.map \ No newline at end of file diff --git a/public/core/common/CharacterIdMap.test.js.map b/public/core/common/CharacterIdMap.test.js.map index a83441b6a..b1dbaf9a9 100644 --- a/public/core/common/CharacterIdMap.test.js.map +++ b/public/core/common/CharacterIdMap.test.js.map @@ -1 +1 @@ -{"version":3,"file":"CharacterIdMap.test.js","sourceRoot":"","sources":["../../../../../../front_end/core/common/CharacterIdMap.test.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,KAAK,MAAM,MAAM,aAAa,CAAC;AAEtC,MAAM,cAAc,GAAG,MAAM,CAAC,cAAc,CAAC,cAAc,CAAC;AAE5D,QAAQ,CAAC,sBAAsB,EAAE,GAAG,EAAE;IACpC,EAAE,CAAC,8CAA8C,EAAE,GAAG,EAAE;QACtD,MAAM,WAAW,GAAG,QAAQ,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC;QAChD,MAAM,cAAc,GAAG,IAAI,cAAc,EAAE,CAAC;QAC5C,MAAM,CAAC,WAAW,CAAC,cAAc,CAAC,MAAM,CAAC,WAAW,CAAC,EAAE,GAAG,EAAE,qCAAqC,CAAC,CAAC;IACrG,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,8CAA8C,EAAE,GAAG,EAAE;QACtD,MAAM,WAAW,GAAG,QAAQ,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC;QAChD,MAAM,cAAc,GAAG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ACzF,MAAM,cAAc,GAAG,IAAI,cAAc,EAAE,CAAC;QAC5C,MAAM,CAAC,WAAW,CAAC,cAAc,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,IAAI,EAAE,uCAAuC,CAAC,CAAC;IAClG,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["// Copyright 2019 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport * as Common from './common.js';\n\nconst CharacterIdMap = Common.CharacterIdMap.CharacterIdMap;\n\ndescribe('CharacterIdMap class', () => {\n it('is able to convert an element to a character', () => {\n const testElement = document.createElement('p');\n const characterIdMap = new CharacterIdMap();\n assert.strictEqual(characterIdMap.toChar(testElement), '!', 'element was not converted correctly');\n });\n\n it('is able to convert a character to an element', () => {\n const testElement = document.createElement('p');\n const characterIdMap = new CharacterIdMap();\n assert.strictEqual(characterIdMap.toChar(testElement), '!', 'element was not converted correctly');\n assert.strictEqual(characterIdMap.fromChar('!'), testElement, 'character was not converted correctly');\n });\n\n it('returns the same character when trying to convert an element that was already converted', () => {\n const testElement = document.createElement('p');\n const characterIdMap = new CharacterIdMap();\n assert.strictEqual(characterIdMap.toChar(testElement), '!', 'element was not converted correctly');\n assert.strictEqual(characterIdMap.toChar(testElement), '!', 'element was not converted correctly');\n });\n\n it('throws an error when trying to convert a number when there is no capacity left', () => {\n const upperLimit = 0xFFFF;\n const characterIdMap = new CharacterIdMap();\n assert.throws(() => {\n for (let index = 0; index <= upperLimit; index++) {\n const el = document.createElement('div');\n el.setAttribute('id', 'Div' + index);\n characterIdMap.toChar(el);\n }\n }, 'CharacterIdMap ran out of capacity!');\n });\n\n it('returns null when trying to convert a character that does not exist in the Map', () => {\n const characterIdMap = new CharacterIdMap();\n assert.strictEqual(characterIdMap.fromChar('!'), null, 'character was not converted correctly');\n });\n});\n"]} \ No newline at end of file +{"version":3,"file":"CharacterIdMap.test.js","sourceRoot":"","sources":["../../../../../../front_end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,CAAC,WAAW,CAAC,EAAE,GAAG,EAAE,qCAAqC,CAAC,CAAC;IACrG,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,gFAAgF,EAAE,GAAG,EAAE;QACxF,MAAM,UAAU,GAAG,MAAM,CAAC;QAC1B,MAAM,cAAc,GAAG,IAAI,cAAc,EAAE,CAAC;QAC5C,MAAM,CAAC,MAAM,CAAC,GAAG,EAAE;YACjB,KAAK,IAAI,KAAK,GAAG,CAAC,EAAE,KAAK,IAAI,UAAU,EAAE,KAAK,EAAE,EAAE,CAAC;gBACjD,MAAM,EAAE,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;gBACzC,EAAE,CAAC,YAAY,CAAC,IAAI,EAAE,KAAK,GAAG,KAAK,CAAC,CAAC;gBACrC,cAAc,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;YAC5B,CAAC;QACH,CAAC,EAAE,qCAAqC,CAAC,CAAC;IAC5C,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,iFAAiF,EAAE,GAAG,EAAE;QACzF,MAAM,cAAc,GAAG,IAAI,cAAc,EAAE,CAAC;QAC5C,MAAM,CAAC,MAAM,CAAC,cAAc,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,uCAAuC,CAAC,CAAC;IACvF,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["// Copyright 2019 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport * as Common from './common.js';\n\nconst CharacterIdMap = Common.CharacterIdMap.CharacterIdMap;\n\ndescribe('CharacterIdMap class', () => {\n it('is able to convert an element to a character', () => {\n const testElement = document.createElement('p');\n const characterIdMap = new CharacterIdMap();\n assert.strictEqual(characterIdMap.toChar(testElement), '!', 'element was not converted correctly');\n });\n\n it('is able to convert a character to an element', () => {\n const testElement = document.createElement('p');\n const characterIdMap = new CharacterIdMap();\n assert.strictEqual(characterIdMap.toChar(testElement), '!', 'element was not converted correctly');\n assert.strictEqual(characterIdMap.fromChar('!'), testElement, 'character was not converted correctly');\n });\n\n it('returns the same character when trying to convert an element that was already converted', () => {\n const testElement = document.createElement('p');\n const characterIdMap = new CharacterIdMap();\n assert.strictEqual(characterIdMap.toChar(testElement), '!', 'element was not converted correctly');\n assert.strictEqual(characterIdMap.toChar(testElement), '!', 'element was not converted correctly');\n });\n\n it('throws an error when trying to convert a number when there is no capacity left', () => {\n const upperLimit = 0xFFFF;\n const characterIdMap = new CharacterIdMap();\n assert.throws(() => {\n for (let index = 0; index <= upperLimit; index++) {\n const el = document.createElement('div');\n el.setAttribute('id', 'Div' + index);\n characterIdMap.toChar(el);\n }\n }, 'CharacterIdMap ran out of capacity!');\n });\n\n it('returns null when trying to convert a character that does not exist in the Map', () => {\n const characterIdMap = new CharacterIdMap();\n assert.isNull(characterIdMap.fromChar('!'), 'character was not converted correctly');\n });\n});\n"]} \ No newline at end of file diff --git a/public/core/common/ColorUtils.test.js b/public/core/common/ColorUtils.test.js index 619351748..e115caf2c 100644 --- a/public/core/common/ColorUtils.test.js +++ b/public/core/common/ColorUtils.test.js @@ -84,9 +84,9 @@ describe('ColorUtils', () => { } }); it('is able to find APCA threshold by font size and weight', () => { - assert.deepEqual(Common.ColorUtils.getAPCAThreshold('11px', '100'), null); + assert.isNull(Common.ColorUtils.getAPCAThreshold('11px', '100')); assert.deepEqual(Common.ColorUtils.getAPCAThreshold('121px', '100'), 60); - assert.deepEqual(Common.ColorUtils.getAPCAThreshold('16px', '100'), null); + assert.isNull(Common.ColorUtils.getAPCAThreshold('16px', '100')); assert.deepEqual(Common.ColorUtils.getAPCAThreshold('16px', '400'), 90); assert.deepEqual(Common.ColorUtils.getAPCAThreshold('16px', '900'), 50); }); diff --git a/public/core/common/ColorUtils.test.js.map b/public/core/common/ColorUtils.test.js.map index 68446dc10..b26882798 100644 --- a/public/core/common/ColorUtils.test.js.map +++ b/public/core/common/ColorUtils.test.js.map @@ -1 +1 @@ -{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U,CAAC,oBAAoB,CAAC,MAAM,EAAE,KAAK,CAAC,EAAE,EAAC,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,EAAC,CAAC,CAAC;QAC3F,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,UAAU,CAAC,oBAAoB,CAAC,MAAM,EAAE,KAAK,CAAC,EAAE,EAAC,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,EAAC,CAAC,CAAC;IAC7F,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["// Copyright 2020 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport * as Common from './common.js';\n\ndescribe('ColorUtils', () => {\n it('is able to blend two colors according to alpha blending', () => {\n const firstColor: Common.ColorUtils.Color4D = [1, 0, 0, 1];\n const secondColor: Common.ColorUtils.Color4D = [0, 0, 1, 1];\n const result = Common.ColorUtils.blendColors(firstColor, secondColor);\n assert.deepEqual(result, [1, 0, 0, 1], 'colors were not blended successfully');\n });\n\n it('is able to convert RGBA to HSLA', () => {\n const result = Common.ColorUtils.rgbaToHsla([0.5, 0.5, 0.5, 0.5]);\n assert.deepEqual(result, [0, 0, 0.5, 0.5], 'RGBA color was not converted to HSLA successfully');\n });\n\n it('is able to convert RGBA to HWB', () => {\n const result = Common.ColorUtils.rgbaToHwba([0.5, 0.5, 0.5, 0.5]);\n assert.deepEqual(result, [0, 0.5, 0.5, 0.5], 'RGBA color was not converted to HWB successfully');\n });\n\n it('is able to return the luminance of an RGBA value with the RGB values more than 0.04045', () => {\n const lum = Common.ColorUtils.luminance([0.5, 0.5, 0.5, 0.5]);\n assert.strictEqual(lum, 0.21404114048223255, 'luminance was not calculated correctly');\n });\n\n it('is able to return the luminance of an RGBA value with the RGB values less than 0.04045', () => {\n const lum = Common.ColorUtils.luminance([0.03927, 0.03927, 0.03927, 0.5]);\n assert.strictEqual(lum, 0.003039473684210526, 'luminance was not calculated correctly');\n });\n\n it('is able to calculate the contrast ratio between two colors', () => {\n const firstColor: Common.ColorUtils.Color4D = [1, 0, 0, 1];\n const secondColor: Common.ColorUtils.Color4D = [0, 0, 1, 1];\n assert.strictEqual(\n Common.ColorUtils.contrastRatio(firstColor, secondColor), 2.148936170212766,\n 'contrast ratio was not calculated correctly');\n });\n\n it('is able to calculate the contrast ratio (APCA) between two colors', () => {\n const tests = [\n {\n fgColor: 'red',\n bgColor: 'blue',\n expectedContrast: -20.3,\n },\n {\n fgColor: '#333333',\n bgColor: '#444444',\n expectedContrast: 0.0,\n },\n {\n fgColor: '#888',\n bgColor: '#FFF',\n expectedContrast: 63.1,\n },\n {\n fgColor: '#aaa',\n bgColor: '#000',\n expectedContrast: -56.2,\n },\n {\n fgColor: '#def',\n bgColor: '#123',\n expectedContrast: -93.1,\n },\n {\n fgColor: '#123',\n bgColor: '#234',\n expectedContrast: 0.0,\n },\n {\n fgColor: 'rgb(158 158 158)',\n bgColor: 'white',\n expectedContrast: 52.1,\n },\n {\n fgColor: 'rgba(0 0 0 / 38%)',\n bgColor: 'white',\n expectedContrast: 52.1,\n },\n ];\n for (const test of tests) {\n const fg = Common.Color.parse(test.fgColor)?.asLegacyColor();\n const bg = Common.Color.parse(test.bgColor)?.asLegacyColor();\n if (!fg || !bg) {\n assert.fail(`Failed to parse foreground and/or background color: ${test.fgColor}, ${test.bgColor}`);\n return;\n }\n assert.closeTo(Common.ColorUtils.contrastRatioAPCA(fg.rgba(), bg.rgba()), test.expectedContrast, 0.1);\n }\n });\n\n it('is able to find APCA threshold by font size and weight', () => {\n assert.deepEqual(Common.ColorUtils.getAPCAThreshold('11px', '100'), null);\n assert.deepEqual(Common.ColorUtils.getAPCAThreshold('121px', '100'), 60);\n assert.deepEqual(Common.ColorUtils.getAPCAThreshold('16px', '100'), null);\n assert.deepEqual(Common.ColorUtils.getAPCAThreshold('16px', '400'), 90);\n assert.deepEqual(Common.ColorUtils.getAPCAThreshold('16px', '900'), 50);\n });\n\n it('is able to find AA/AAA thresholds', () => {\n assert.deepEqual(Common.ColorUtils.getContrastThreshold('11px', '100'), {aa: 4.5, aaa: 7});\n assert.deepEqual(Common.ColorUtils.getContrastThreshold('121px', '100'), {aa: 3, aaa: 4.5});\n assert.deepEqual(Common.ColorUtils.getContrastThreshold('16px', '100'), {aa: 4.5, aaa: 7});\n assert.deepEqual(Common.ColorUtils.getContrastThreshold('16px', '400'), {aa: 4.5, aaa: 7});\n assert.deepEqual(Common.ColorUtils.getContrastThreshold('16px', '900'), {aa: 4.5, aaa: 7});\n });\n});\n"]} \ No newline at end of file +{"version":3,"file":"ColorUtils.test.js","sourceRoot":"","sources":["../../../../../../front_end/core/common/ColorUtils.test.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,KAAK,MAAM,MAAM,aAAa,CAAC;AAEtC,QAAQ,CAAC,YAAY,EAAE,GAAG,EAAE;IAC1B,EAAE,CAAC,yDAAyD,EAAE,GAAG,EAAE;QACjE,MAAM,UAAU,GAA8B,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;QAC3D,MAAM,WAAW,GAA8B,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;QAC5D,MAAM,MAAM,GAAG,MAAM,CAAC,UAAU,CAAC,WAAW,CAAC,UAAU,EAAE,WAAW,CAAC,CAAC;QACtE,MAAM,CAAC,SAAS,CAAC,MAAM,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,sCAAsC,CAAC,CAAC;IACjF,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,iCAAiC,EAAE,GAAG,EAAE;QACzC,MAAM,MAAM,GAAG,MAAM,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC;QAClE,MAAM,CAAC,SAA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AC,UAAU,CAAC,oBAAoB,CAAC,OAAO,EAAE,KAAK,CAAC,EAAE,EAAC,EAAE,EAAE,CAAC,EAAE,GAAG,EAAE,GAAG,EAAC,CAAC,CAAC;QAC5F,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,UAAU,CAAC,oBAAoB,CAAC,MAAM,EAAE,KAAK,CAAC,EAAE,EAAC,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,EAAC,CAAC,CAAC;QAC3F,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,UAAU,CAAC,oBAAoB,CAAC,MAAM,EAAE,KAAK,CAAC,EAAE,EAAC,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,EAAC,CAAC,CAAC;QAC3F,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,UAAU,CAAC,oBAAoB,CAAC,MAAM,EAAE,KAAK,CAAC,EAAE,EAAC,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,EAAC,CAAC,CAAC;IAC7F,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["// Copyright 2020 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport * as Common from './common.js';\n\ndescribe('ColorUtils', () => {\n it('is able to blend two colors according to alpha blending', () => {\n const firstColor: Common.ColorUtils.Color4D = [1, 0, 0, 1];\n const secondColor: Common.ColorUtils.Color4D = [0, 0, 1, 1];\n const result = Common.ColorUtils.blendColors(firstColor, secondColor);\n assert.deepEqual(result, [1, 0, 0, 1], 'colors were not blended successfully');\n });\n\n it('is able to convert RGBA to HSLA', () => {\n const result = Common.ColorUtils.rgbaToHsla([0.5, 0.5, 0.5, 0.5]);\n assert.deepEqual(result, [0, 0, 0.5, 0.5], 'RGBA color was not converted to HSLA successfully');\n });\n\n it('is able to convert RGBA to HWB', () => {\n const result = Common.ColorUtils.rgbaToHwba([0.5, 0.5, 0.5, 0.5]);\n assert.deepEqual(result, [0, 0.5, 0.5, 0.5], 'RGBA color was not converted to HWB successfully');\n });\n\n it('is able to return the luminance of an RGBA value with the RGB values more than 0.04045', () => {\n const lum = Common.ColorUtils.luminance([0.5, 0.5, 0.5, 0.5]);\n assert.strictEqual(lum, 0.21404114048223255, 'luminance was not calculated correctly');\n });\n\n it('is able to return the luminance of an RGBA value with the RGB values less than 0.04045', () => {\n const lum = Common.ColorUtils.luminance([0.03927, 0.03927, 0.03927, 0.5]);\n assert.strictEqual(lum, 0.003039473684210526, 'luminance was not calculated correctly');\n });\n\n it('is able to calculate the contrast ratio between two colors', () => {\n const firstColor: Common.ColorUtils.Color4D = [1, 0, 0, 1];\n const secondColor: Common.ColorUtils.Color4D = [0, 0, 1, 1];\n assert.strictEqual(\n Common.ColorUtils.contrastRatio(firstColor, secondColor), 2.148936170212766,\n 'contrast ratio was not calculated correctly');\n });\n\n it('is able to calculate the contrast ratio (APCA) between two colors', () => {\n const tests = [\n {\n fgColor: 'red',\n bgColor: 'blue',\n expectedContrast: -20.3,\n },\n {\n fgColor: '#333333',\n bgColor: '#444444',\n expectedContrast: 0.0,\n },\n {\n fgColor: '#888',\n bgColor: '#FFF',\n expectedContrast: 63.1,\n },\n {\n fgColor: '#aaa',\n bgColor: '#000',\n expectedContrast: -56.2,\n },\n {\n fgColor: '#def',\n bgColor: '#123',\n expectedContrast: -93.1,\n },\n {\n fgColor: '#123',\n bgColor: '#234',\n expectedContrast: 0.0,\n },\n {\n fgColor: 'rgb(158 158 158)',\n bgColor: 'white',\n expectedContrast: 52.1,\n },\n {\n fgColor: 'rgba(0 0 0 / 38%)',\n bgColor: 'white',\n expectedContrast: 52.1,\n },\n ];\n for (const test of tests) {\n const fg = Common.Color.parse(test.fgColor)?.asLegacyColor();\n const bg = Common.Color.parse(test.bgColor)?.asLegacyColor();\n if (!fg || !bg) {\n assert.fail(`Failed to parse foreground and/or background color: ${test.fgColor}, ${test.bgColor}`);\n return;\n }\n assert.closeTo(Common.ColorUtils.contrastRatioAPCA(fg.rgba(), bg.rgba()), test.expectedContrast, 0.1);\n }\n });\n\n it('is able to find APCA threshold by font size and weight', () => {\n assert.isNull(Common.ColorUtils.getAPCAThreshold('11px', '100'));\n assert.deepEqual(Common.ColorUtils.getAPCAThreshold('121px', '100'), 60);\n assert.isNull(Common.ColorUtils.getAPCAThreshold('16px', '100'));\n assert.deepEqual(Common.ColorUtils.getAPCAThreshold('16px', '400'), 90);\n assert.deepEqual(Common.ColorUtils.getAPCAThreshold('16px', '900'), 50);\n });\n\n it('is able to find AA/AAA thresholds', () => {\n assert.deepEqual(Common.ColorUtils.getContrastThreshold('11px', '100'), {aa: 4.5, aaa: 7});\n assert.deepEqual(Common.ColorUtils.getContrastThreshold('121px', '100'), {aa: 3, aaa: 4.5});\n assert.deepEqual(Common.ColorUtils.getContrastThreshold('16px', '100'), {aa: 4.5, aaa: 7});\n assert.deepEqual(Common.ColorUtils.getContrastThreshold('16px', '400'), {aa: 4.5, aaa: 7});\n assert.deepEqual(Common.ColorUtils.getContrastThreshold('16px', '900'), {aa: 4.5, aaa: 7});\n });\n});\n"]} \ No newline at end of file diff --git a/public/core/common/Console.test.js b/public/core/common/Console.test.js index 686b68357..8219b6669 100644 --- a/public/core/common/Console.test.js +++ b/public/core/common/Console.test.js @@ -12,7 +12,7 @@ describe('Console', () => { assert.lengthOf(messages, 1); assert.strictEqual(messages[0].text, 'Foo'); assert.strictEqual(messages[0].level, "info" /* Common.Console.MessageLevel.INFO */); - assert.strictEqual(messages[0].show, true); + assert.isTrue(messages[0].show); }); it('stores messages', () => { const console = Console.instance({ forceNew: true }); @@ -21,7 +21,7 @@ describe('Console', () => { console.addMessage('Bar', "error" /* Common.Console.MessageLevel.ERROR */, true); console.addMessage('Donkey', "info" /* Common.Console.MessageLevel.INFO */, true); const messages = console.messages(); - assert.strictEqual(messages.length, 4); + assert.lengthOf(messages, 4); }); it('dispatches events to listeners', done => { const console = Console.instance({ forceNew: true }); @@ -40,7 +40,7 @@ describe('Console', () => { console.log('Lorem Ipsum'); const messages = console.messages(); assert.lengthOf(messages, 1); - assert.strictEqual(messages[0].show, false); // Infos don't popup the Console panel by default + assert.isFalse(messages[0].show); // Infos don't popup the Console panel by default assert.strictEqual(messages[0].level, "info" /* Common.Console.MessageLevel.INFO */); }); }); @@ -50,7 +50,7 @@ describe('Console', () => { console.warn('Lorem Ipsum'); const messages = console.messages(); assert.lengthOf(messages, 1); - assert.strictEqual(messages[0].show, false); // Warnings don't popup the Console panel by default + assert.isFalse(messages[0].show); // Warnings don't popup the Console panel by default assert.strictEqual(messages[0].level, "warning" /* Common.Console.MessageLevel.WARNING */); }); }); @@ -60,7 +60,7 @@ describe('Console', () => { console.error('Lorem Ipsum'); const messages = console.messages(); assert.lengthOf(messages, 1); - assert.strictEqual(messages[0].show, true); // Errors popup the Console panel by default + assert.isTrue(messages[0].show); // Errors popup the Console panel by default assert.strictEqual(messages[0].level, "error" /* Common.Console.MessageLevel.ERROR */); }); it('can control whether to pop up the Console panel', () => { @@ -69,8 +69,8 @@ describe('Console', () => { console.error('Baz', true); const messages = console.messages(); assert.lengthOf(messages, 2); - assert.strictEqual(messages[0].show, false); - assert.strictEqual(messages[1].show, true); + assert.isFalse(messages[0].show); + assert.isTrue(messages[1].show); }); }); }); diff --git a/public/core/common/Console.test.js.map b/public/core/common/Console.test.js.map index 66058bc2c..18349ba0c 100644 --- a/public/core/common/Console.test.js.map +++ b/public/core/common/Console.test.js.map @@ -1 +1 @@ -{"version":3,"file":"Console.test.js","sourceRoot":"","sources":["../../../../../../front_end/core/common/Console.test.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,KAAK,MAAM,MAAM,aAAa,CAAC;AAEtC,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC;AAEvC,QAAQ,CAAC,SAAS,EAAE,GAAG,EAAE;IACvB,QAAQ,CAAC,YAAY,EAAE,GAAG,EAAE;QAC1B,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,QAAQ,GAAG,OAAO,CAAC,QAAQ,EAAE,CAAC;YACpC,MAAM,CAAC,QAAQ,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC;YAC7B,MAAM,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;YAC5C,MAAM,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;QAC7C,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["// Copyright 2019 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport * as Common from './common.js';\n\nconst Console = Common.Console.Console;\n\ndescribe('Console', () => {\n describe('addMessage', () => {\n it('adds messages', () => {\n const console = Console.instance({forceNew: true});\n console.addMessage('Foo', Common.Console.MessageLevel.INFO, true);\n const messages = console.messages();\n assert.lengthOf(messages, 1);\n assert.strictEqual(messages[0].text, 'Foo');\n assert.strictEqual(messages[0].level, Common.Console.MessageLevel.INFO);\n assert.strictEqual(messages[0].show, true);\n });\n\n it('stores messages', () => {\n const console = Console.instance({forceNew: true});\n console.addMessage('Foo', Common.Console.MessageLevel.INFO, true);\n console.addMessage('Baz', Common.Console.MessageLevel.WARNING, true);\n console.addMessage('Bar', Common.Console.MessageLevel.ERROR, true);\n console.addMessage('Donkey', Common.Console.MessageLevel.INFO, true);\n const messages = console.messages();\n assert.strictEqual(messages.length, 4);\n });\n\n it('dispatches events to listeners', done => {\n const console = Console.instance({forceNew: true});\n const callback = ({data}: Common.EventTarget.EventTargetEvent) => {\n console.removeEventListener(Common.Console.Events.MESSAGE_ADDED, callback);\n assert.strictEqual(data.text, 'Foo');\n done();\n };\n\n console.addEventListener(Common.Console.Events.MESSAGE_ADDED, callback);\n console.addMessage('Foo', Common.Console.MessageLevel.INFO, true);\n });\n });\n\n describe('log', () => {\n it('adds messages with level Info', () => {\n const console = Console.instance({forceNew: true});\n console.log('Lorem Ipsum');\n const messages = console.messages();\n assert.lengthOf(messages, 1);\n assert.strictEqual(messages[0].show, false); // Infos don't popup the Console panel by default\n assert.strictEqual(messages[0].level, Common.Console.MessageLevel.INFO);\n });\n });\n\n describe('warn', () => {\n it('adds messages with level Warning', () => {\n const console = Console.instance({forceNew: true});\n console.warn('Lorem Ipsum');\n const messages = console.messages();\n assert.lengthOf(messages, 1);\n assert.strictEqual(messages[0].show, false); // Warnings don't popup the Console panel by default\n assert.strictEqual(messages[0].level, Common.Console.MessageLevel.WARNING);\n });\n });\n\n describe('error', () => {\n it('adds messages with level Error', () => {\n const console = Console.instance({forceNew: true});\n console.error('Lorem Ipsum');\n const messages = console.messages();\n assert.lengthOf(messages, 1);\n assert.strictEqual(messages[0].show, true); // Errors popup the Console panel by default\n assert.strictEqual(messages[0].level, Common.Console.MessageLevel.ERROR);\n });\n\n it('can control whether to pop up the Console panel', () => {\n const console = Console.instance({forceNew: true});\n console.error('Bar', false);\n console.error('Baz', true);\n const messages = console.messages();\n assert.lengthOf(messages, 2);\n assert.strictEqual(messages[0].show, false);\n assert.strictEqual(messages[1].show, true);\n });\n });\n});\n"]} \ No newline at end of file +{"version":3,"file":"Console.test.js","sourceRoot":"","sources":["../../../../../../front_end/core/common/Console.test.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,KAAK,MAAM,MAAM,aAAa,CAAC;AAEtC,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC;AAEvC,QAAQ,CAAC,SAAS,EAAE,GAAG,EAAE;IACvB,QAAQ,CAAC,YAAY,EAAE,GAAG,EAAE;QAC1B,EAAE,CAAC,eAAe,EAAE,GAAG,EAAE;YACvB,MAAM,OAAO,GAAG,OAAO,CAAC,QAAQ,CAAC,EAAC,QAAQ,EAAE,IAAI,EAAC,CAAC,CAAC;YACnD,OAAO,C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CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;QAClC,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["// Copyright 2019 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport * as Common from './common.js';\n\nconst Console = Common.Console.Console;\n\ndescribe('Console', () => {\n describe('addMessage', () => {\n it('adds messages', () => {\n const console = Console.instance({forceNew: true});\n console.addMessage('Foo', Common.Console.MessageLevel.INFO, true);\n const messages = console.messages();\n assert.lengthOf(messages, 1);\n assert.strictEqual(messages[0].text, 'Foo');\n assert.strictEqual(messages[0].level, Common.Console.MessageLevel.INFO);\n assert.isTrue(messages[0].show);\n });\n\n it('stores messages', () => {\n const console = Console.instance({forceNew: true});\n console.addMessage('Foo', Common.Console.MessageLevel.INFO, true);\n console.addMessage('Baz', Common.Console.MessageLevel.WARNING, true);\n console.addMessage('Bar', Common.Console.MessageLevel.ERROR, true);\n console.addMessage('Donkey', Common.Console.MessageLevel.INFO, true);\n const messages = console.messages();\n assert.lengthOf(messages, 4);\n });\n\n it('dispatches events to listeners', done => {\n const console = Console.instance({forceNew: true});\n const callback = ({data}: Common.EventTarget.EventTargetEvent) => {\n console.removeEventListener(Common.Console.Events.MESSAGE_ADDED, callback);\n assert.strictEqual(data.text, 'Foo');\n done();\n };\n\n console.addEventListener(Common.Console.Events.MESSAGE_ADDED, callback);\n console.addMessage('Foo', Common.Console.MessageLevel.INFO, true);\n });\n });\n\n describe('log', () => {\n it('adds messages with level Info', () => {\n const console = Console.instance({forceNew: true});\n console.log('Lorem Ipsum');\n const messages = console.messages();\n assert.lengthOf(messages, 1);\n assert.isFalse(messages[0].show); // Infos don't popup the Console panel by default\n assert.strictEqual(messages[0].level, Common.Console.MessageLevel.INFO);\n });\n });\n\n describe('warn', () => {\n it('adds messages with level Warning', () => {\n const console = Console.instance({forceNew: true});\n console.warn('Lorem Ipsum');\n const messages = console.messages();\n assert.lengthOf(messages, 1);\n assert.isFalse(messages[0].show); // Warnings don't popup the Console panel by default\n assert.strictEqual(messages[0].level, Common.Console.MessageLevel.WARNING);\n });\n });\n\n describe('error', () => {\n it('adds messages with level Error', () => {\n const console = Console.instance({forceNew: true});\n console.error('Lorem Ipsum');\n const messages = console.messages();\n assert.lengthOf(messages, 1);\n assert.isTrue(messages[0].show); // Errors popup the Console panel by default\n assert.strictEqual(messages[0].level, Common.Console.MessageLevel.ERROR);\n });\n\n it('can control whether to pop up the Console panel', () => {\n const console = Console.instance({forceNew: true});\n console.error('Bar', false);\n console.error('Baz', true);\n const messages = console.messages();\n assert.lengthOf(messages, 2);\n assert.isFalse(messages[0].show);\n assert.isTrue(messages[1].show);\n });\n });\n});\n"]} \ No newline at end of file diff --git a/public/core/common/Lazy.test.js b/public/core/common/Lazy.test.js index 353727d15..58de98185 100644 --- a/public/core/common/Lazy.test.js +++ b/public/core/common/Lazy.test.js @@ -2,26 +2,22 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. import * as Common from './common.js'; -const lazy = Common.Lazy.lazy; describe('lazy', () => { + const { lazy } = Common.Lazy; it('evaluates callback once', () => { - const initializeArrayOnce = lazy(() => []); - const arrayOne = initializeArrayOnce(); - const arrayTwo = initializeArrayOnce(); + const once = lazy(() => []); + const arrayOne = once(); + const arrayTwo = once(); assert.strictEqual(arrayOne, arrayTwo); - assert.notStrictEqual([], arrayOne); }); it('handles callback exceptions', () => { - let callCount = 0; - const exceptionCallback = lazy(() => { - callCount++; - throw Error(); - }); - assert.throws(exceptionCallback, Error); + const fake = sinon.fake.throws('foo'); + const once = lazy(fake); + assert.throws(once, Error); // Subsequent calls of the function should throw an exception without // re-evaluation - assert.throws(exceptionCallback, Error); - assert.strictEqual(callCount, 1); + assert.throws(once, Error); + assert.strictEqual(fake.callCount, 1); }); }); //# sourceMappingURL=Lazy.test.js.map \ No newline at end of file diff --git a/public/core/common/Lazy.test.js.map b/public/core/common/Lazy.test.js.map index 730e6e731..4878b9ddb 100644 --- a/public/core/common/Lazy.test.js.map +++ b/public/core/common/Lazy.test.js.map @@ -1 +1 @@ -{"version":3,"file":"Lazy.test.js","sourceRoot":"","sources":["../../../../../../front_end/core/common/Lazy.test.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,KAAK,MAAM,MAAM,aAAa,CAAC;AAEtC,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC;AAE9B,QAAQ,CAAC,MAAM,EAAE,GAAG,EAAE;IACpB,EAAE,CAAC,yBAAyB,EAAE,GAAG,EAAE;QACjC,MAAM,mBAAmB,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC,EAAE,CAAC,CAAC;QAC3C,MAAM,QAAQ,GAAG,mBAAmB,EAAE,CAAC;QACvC,MAAM,QAAQ,GAAG,mBAAmB,EAAE,CAAC;QAEvC,MAAM,CAAC,WAAW,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;QACvC,MAAM,CAAC,cAAc,CAAC,EAAE,EAAE,QAAQ,CAAC,CAAC;IACtC,CAAC,CAAC,CAAC;IACH,EAAE,CAAC,6BAA6B,EAAE,GAAG,EAAE;QACrC,IAAI,SAAS,GAAG,CAAC,CAAC;QAClB,MAAM,iBAAiB,GAAG,IAAI,CAAC,GAAG,EAAE;YAClC,SAAS,EAAE,CAAC;YACZ,MAAM,KAAK,EAAE,CAAC;QAChB,CAAC,CAAC,CAAC;QACH,MAAM,CAAC,MAAM,CAAC,iBAAiB,EAAE,KAAK,CAAC,CAAC;QACxC,qEAAqE;QACrE,gBAAgB;QAChB,MAAM,CAAC,MAAM,CAAC,iBAAiB,EAAE,KAAK,CAAC,CAAC;QACxC,MAAM,CAAC,WAAW,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC;IACnC,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["// Copyright 2020 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport * as Common from './common.js';\n\nconst lazy = Common.Lazy.lazy;\n\ndescribe('lazy', () => {\n it('evaluates callback once', () => {\n const initializeArrayOnce = lazy(() => []);\n const arrayOne = initializeArrayOnce();\n const arrayTwo = initializeArrayOnce();\n\n assert.strictEqual(arrayOne, arrayTwo);\n assert.notStrictEqual([], arrayOne);\n });\n it('handles callback exceptions', () => {\n let callCount = 0;\n const exceptionCallback = lazy(() => {\n callCount++;\n throw Error();\n });\n assert.throws(exceptionCallback, Error);\n // Subsequent calls of the function should throw an exception without\n // re-evaluation\n assert.throws(exceptionCallback, Error);\n assert.strictEqual(callCount, 1);\n });\n});\n"]} \ No newline at end of file +{"version":3,"file":"Lazy.test.js","sourceRoot":"","sources":["../../../../../../front_end/core/common/Lazy.test.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,KAAK,MAAM,MAAM,aAAa,CAAC;AAEtC,QAAQ,CAAC,MAAM,EAAE,GAAG,EAAE;IACpB,MAAM,EAAC,IAAI,EAAC,GAAG,MAAM,CAAC,IAAI,CAAC;IAE3B,EAAE,CAAC,yBAAyB,EAAE,GAAG,EAAE;QACjC,MAAM,IAAI,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC,EAAE,CAAC,CAAC;QAC5B,MAAM,QAAQ,GAAG,IAAI,EAAE,CAAC;QACxB,MAAM,QAAQ,GAAG,IAAI,EAAE,CAAC;QAExB,MAAM,CAAC,WAAW,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;IACzC,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,6BAA6B,EAAE,GAAG,EAAE;QACrC,MAAM,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QACtC,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC;QAExB,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;QAC3B,qEAAqE;QACrE,gBAAgB;QAChB,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;QAC3B,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC;IACxC,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["// Copyright 2020 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport * as Common from './common.js';\n\ndescribe('lazy', () => {\n const {lazy} = Common.Lazy;\n\n it('evaluates callback once', () => {\n const once = lazy(() => []);\n const arrayOne = once();\n const arrayTwo = once();\n\n assert.strictEqual(arrayOne, arrayTwo);\n });\n\n it('handles callback exceptions', () => {\n const fake = sinon.fake.throws('foo');\n const once = lazy(fake);\n\n assert.throws(once, Error);\n // Subsequent calls of the function should throw an exception without\n // re-evaluation\n assert.throws(once, Error);\n assert.strictEqual(fake.callCount, 1);\n });\n});\n"]} \ No newline at end of file diff --git a/public/core/common/ParsedURL.test.js b/public/core/common/ParsedURL.test.js index 5a064e45c..2611578d4 100644 --- a/public/core/common/ParsedURL.test.js +++ b/public/core/common/ParsedURL.test.js @@ -132,15 +132,15 @@ describe('Parsed URL', () => { }); it('checks that URL is valid', () => { const urlTest = 'http://www.example.com#?test'; - assert.strictEqual(ParsedURL.isValidUrlString(urlTest), true, 'URL validation was incorrect'); + assert.isTrue(ParsedURL.isValidUrlString(urlTest), 'URL validation was incorrect'); }); it('checks that file:// URL is valid', () => { const urlTest = 'file:///usr/lib'; - assert.strictEqual(ParsedURL.isValidUrlString(urlTest), true, 'URL validation was incorrect'); + assert.isTrue(ParsedURL.isValidUrlString(urlTest), 'URL validation was incorrect'); }); it('checks that "://" is not a valid URL', () => { const urlTest = '://'; - assert.strictEqual(ParsedURL.isValidUrlString(urlTest), false, 'URL validation was incorrect'); + assert.isFalse(ParsedURL.isValidUrlString(urlTest), 'URL validation was incorrect'); }); it('converts URL with a hash to a URL without a hash', () => { const urlTest = 'http://www.example.com#?test'; @@ -306,7 +306,7 @@ describe('Parsed URL', () => { const hrefTest = 'www.example.com'; const baseUrlTest = 'www.example.com'; const completeUrl = ParsedURL.completeURL(baseUrlTest, hrefTest); - assert.strictEqual(completeUrl, null, 'complete URL is not returned correctly'); + assert.isNull(completeUrl, 'complete URL is not returned correctly'); }); it('uses the completeURL function to return the href if the base URL is a data URL', () => { const hrefTest = 'www.example.com'; @@ -356,7 +356,7 @@ describe('Parsed URL', () => { const splitResult = ParsedURL.splitLineAndColumn(stringTest); assert.strictEqual(splitResult.url, 'http://www.example.com/foo.js', 'URL is not correct'); assert.strictEqual(splitResult.lineNumber, 14, 'line number is incorrect'); - assert.strictEqual(splitResult.columnNumber, undefined, 'column number is incorrect'); + assert.isUndefined(splitResult.columnNumber, 'column number is incorrect'); }); it('uses the splitLineAndColumn function to return the line and column numbers if the URL contains them', () => { const stringTest = 'http://www.example.com:15:20'; diff --git a/public/core/common/ParsedURL.test.js.map b/public/core/common/ParsedURL.test.js.map index 19d9f9dad..7a4e06f53 100644 --- a/public/core/common/ParsedURL.test.js.map +++ b/public/core/common/ParsedURL.test.js.map @@ -1 +1 @@ -{"version":3,"file":"ParsedURL.test.js","sourceRoot":"","sources":["../../../../../../front_end/core/common/ParsedURL.test.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAI7B,OAAO,KAAK,MAAM,MAAM,aAAa,CAAC;AAEtC,MAAM,SAAS,GAAG,MAAM,CAAC,SAAS,CAAC,SAAS,CAAC;AAE7C,SAAS,0BAA0B,CAAC,MAA4C,EAAE,QAAgB,EAAE,OAAgB;IAClH,MAAM,CAAC,WAAW,CAAC,MAAM,EAAE,QAA2C,EAAE,OAAO,CAAC,CAAC;AACnF,CAAC;AAED,QAAQ,CAAC,YAAY,EAAE,GAAG,EA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,EAAE;QAC3E,MAAM,OAAO,GAAG,gDAAmF,CAAC;QACpG,MAAM,YAAY,GAAG,SAAS,CAAC,kBAAkB,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;QAClE,MAAM,CAAC,WAAW,CAAC,YAAY,EAAE,qCAAqC,EAAE,oCAAoC,CAAC,CAAC;IAChH,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,qEAAqE,EAAE,GAAG,EAAE;QAC7E,MAAM,OAAO,GAAG,kCAAyE,CAAC;QAC1F,MAAM,YAAY,GAAG,SAAS,CAAC,kBAAkB,CAAC,OAAO,CAAC,CAAC;QAC3D,MAAM,CAAC,WAAW,CACd,YAAY,EAAE,4CAA4C,EAAE,oCAAoC,CAAC,CAAC;IACxG,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,oGAAoG,EAAE,GAAG,EAAE;QAC5G,MAAM,gBAAgB,GAClB,4BAAmE,CAAC,CAAE,yBAAyB;QACnG,MAAM,OAAO,GAAG,yCACmB,CAAC,CAAE,kDAAkD;QACxF,MAAM,CAAC,WAAW,CAAC,SAAS,CAAC,kBAAkB,CAAC,gBAAgB,CAAC,EAAE,OAAO,CAAC,CAAC;QAC5E,MAAM,CAAC,WAAW,CAAC,SAAS,CAAC,kBAAkB,CAAC,OAAO,CAAC,EAAE,gBAAgB,CAAC,CAAC;IAC9E,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["// Copyright 2019 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport type * as Platform from '../platform/platform.js';\n\nimport * as Common from './common.js';\n\nconst ParsedURL = Common.ParsedURL.ParsedURL;\n\nfunction assertEqualUrlStringString(actual: Platform.DevToolsPath.UrlString|null, expected: string, message?: string) {\n assert.strictEqual(actual, expected as Platform.DevToolsPath.UrlString, message);\n}\n\ndescribe('Parsed URL', () => {\n describe('with path normalization', () => {\n const cases = [\n {path: '', expected: ''},\n {path: '.', expected: '/'},\n {path: './', expected: '/'},\n {path: '..', expected: '/'},\n {path: '../', expected: '/'},\n {path: 'a/../g', expected: 'g'},\n {path: '../..', expected: '/'},\n {path: '../../', expected: '/'},\n {path: 'a/b/c/../../g', expected: 'a/g'},\n {path: 'a/b/c/d/../../../g', expected: 'a/g'},\n {path: 'a/b/c/d/e/../../../../g', expected: 'a/g'},\n {path: '/./g', expected: '/g'},\n {path: '/.//g', expected: '//g'},\n {path: '/../g', expected: '/g'},\n {path: 'g.', expected: 'g.'},\n {path: '.g', expected: '.g'},\n {path: 'g..', expected: 'g..'},\n {path: '..g', expected: '..g'},\n {path: 'a/b/./../g', expected: 'a/g'},\n {path: './g/.', expected: 'g/'},\n {path: 'g/./h', expected: 'g/h'},\n {path: 'g/../h', expected: 'h'},\n {path: './h/g/', expected: 'h/g/'},\n {path: 'g///h.ts', expected: 'g///h.ts'},\n {path: '/b/c/./', expected: '/b/c/'},\n {path: '///', expected: '///'},\n ];\n\n for (const {path, expected} of cases) {\n it(`can normalize \"${path}\"`, () => {\n assert.strictEqual(Common.ParsedURL.normalizePath(path), expected);\n });\n }\n });\n\n it('recognizes valid URLs', () => {\n const parsedUrl = new ParsedURL('http://www.example.com/');\n assert.isTrue(parsedUrl.isValid, 'the URL should be valid');\n });\n\n it('recognizes the URL elements', () => {\n const parsedUrl = new ParsedURL('http://username@www.example.com:8080/testing/test?isTest=true#testFragment');\n assert.isTrue(parsedUrl.isValid, 'the URL should be valid');\n assert.strictEqual(\n parsedUrl.url, 'http://username@www.example.com:8080/testing/test?isTest=true#testFragment',\n 'URL value is incorrect');\n assert.strictEqual(parsedUrl.scheme, 'http', 'URL scheme is incorrect');\n assert.strictEqual(parsedUrl.user, 'username', 'URL user is incorrect');\n assert.strictEqual(parsedUrl.host, 'www.example.com', 'URL host is incorrect');\n assert.strictEqual(parsedUrl.port, '8080', 'URL port is incorrect');\n assert.strictEqual(parsedUrl.path, '/testing/test', 'URL path is incorrect');\n assert.strictEqual(parsedUrl.queryParams, 'isTest=true', 'URL query params are incorrect');\n assert.strictEqual(parsedUrl.fragment, 'testFragment', 'URL fragment is incorrect');\n assert.strictEqual(parsedUrl.folderPathComponents, '/testing', 'URL folder path components are incorrect');\n assert.strictEqual(parsedUrl.lastPathComponent, 'test', 'URL last path component is incorrect');\n });\n\n it('recognizes a valid IPv6 localhost URL', () => {\n const parsedUrl = new ParsedURL('http://[::]/?queryParam1=value1&queryParam2=value2#fragmentWith/Many//Slashes');\n assert.isTrue(parsedUrl.isValid, 'the URL should be valid');\n assert.strictEqual(\n parsedUrl.url, 'http://[::]/?queryParam1=value1&queryParam2=value2#fragmentWith/Many//Slashes',\n 'URL value is incorrect');\n assert.strictEqual(parsedUrl.scheme, 'http', 'URL scheme is incorrect');\n assert.strictEqual(parsedUrl.user, '', 'URL user is incorrect');\n assert.strictEqual(parsedUrl.host, '[::]', 'URL host is incorrect');\n assert.strictEqual(parsedUrl.port, '', 'URL port is incorrect');\n assert.strictEqual(parsedUrl.path, '/', 'URL path is incorrect');\n assert.strictEqual(\n parsedUrl.queryParams, 'queryParam1=value1&queryParam2=value2', 'URL query params are incorrect');\n assert.strictEqual(parsedUrl.fragment, 'fragmentWith/Many//Slashes', 'URL fragment is incorrect');\n assert.strictEqual(parsedUrl.folderPathComponents, '', 'URL folder path components are incorrect');\n assert.strictEqual(parsedUrl.lastPathComponent, '', 'URL last path component is incorrect');\n });\n\n it('recognizes a valid blob URL', () => {\n const parsedUrl = new ParsedURL('blob:http://www.example.com/');\n assert.isTrue(parsedUrl.isValid, 'the URL should be valid');\n assert.strictEqual(parsedUrl.scheme, 'blob', 'the URL scheme is not blob');\n assert.strictEqual(parsedUrl.blobInnerScheme, 'http', 'the URL inner scheme is not http');\n });\n\n it('parses a URL with no path', () => {\n const parsedUrl = new ParsedURL('http://www.example.com');\n assert.isTrue(parsedUrl.isValid, 'the URL should be valid');\n assert.strictEqual(parsedUrl.path, '/', 'path is not a single slash (\"/\")');\n });\n\n it('parses a data URL', () => {\n const parsedUrl = new ParsedURL('data:test');\n assert.isFalse(parsedUrl.isValid, 'the URL should not be valid');\n assert.strictEqual(parsedUrl.scheme, 'data', 'the URL scheme is not data');\n });\n\n it('recognizes an invalid blob URL', () => {\n const parsedUrl = new ParsedURL('blob:test');\n assert.isFalse(parsedUrl.isValid, 'the URL should not be valid');\n assert.strictEqual(parsedUrl.scheme, 'blob', 'the URL scheme is not blob');\n });\n\n it('recognizes an invalid blank URL', () => {\n const parsedUrl = new ParsedURL('about:blank');\n assert.isFalse(parsedUrl.isValid, 'the URL should not be valid');\n assert.strictEqual(parsedUrl.scheme, 'about', 'the URL scheme is not blob');\n });\n\n it('recognizes an invalid URL', () => {\n const parsedUrl = new ParsedURL('abc');\n assert.isFalse(parsedUrl.isValid, 'the URL should not be valid');\n assert.strictEqual(parsedUrl.url, 'abc', 'URL value is incorrect');\n });\n\n it('converts platform path to a URL that does not start with \"file://\"', () => {\n const platformPathTest = 'usr/lib' as Platform.DevToolsPath.RawPathString;\n const convertedUrl = ParsedURL.rawPathToUrlString(platformPathTest);\n assert.strictEqual(convertedUrl, 'file:///usr/lib', 'URL was not converted correctly');\n });\n\n it('converts platform path to a URL that does not start with \"file://\" but starts with a slash (\"/\")', () => {\n const platformPathTest = '/usr/lib' as Platform.DevToolsPath.RawPathString;\n const convertedUrl = ParsedURL.rawPathToUrlString(platformPathTest);\n assert.strictEqual(convertedUrl, 'file:///usr/lib', 'URL was not converted correctly');\n });\n\n it('converts platform path to a URL that starts with \"file://\"', () => {\n const platformPathTest = 'file://usr/lib' as Platform.DevToolsPath.RawPathString;\n const convertedUrl = ParsedURL.rawPathToUrlString(platformPathTest);\n assert.strictEqual(convertedUrl, 'file://usr/lib', 'URL was not converted correctly');\n });\n\n it('converts path that starts with \"file://\" to a platform path', () => {\n const pathTest = 'file://usr/lib' as Platform.DevToolsPath.UrlString;\n const convertedPath = ParsedURL.urlToRawPathString(pathTest);\n assert.strictEqual(convertedPath, 'usr/lib', 'URL was not converted successfully');\n });\n\n it('converts path that starts with \"file:///\" to a platform path on Windows', () => {\n const pathTest = 'file:///usr/lib' as Platform.DevToolsPath.UrlString;\n const convertedPath = ParsedURL.urlToRawPathString(pathTest, true);\n assert.strictEqual(convertedPath, 'usr\\\\lib', 'URL was not converted successfully');\n });\n\n it('checks that URL is valid', () => {\n const urlTest = 'http://www.example.com#?test';\n assert.strictEqual(ParsedURL.isValidUrlString(urlTest), true, 'URL validation was incorrect');\n });\n\n it('checks that file:// URL is valid', () => {\n const urlTest = 'file:///usr/lib';\n assert.strictEqual(ParsedURL.isValidUrlString(urlTest), true, 'URL validation was incorrect');\n });\n\n it('checks that \"://\" is not a valid URL', () => {\n const urlTest = '://';\n assert.strictEqual(ParsedURL.isValidUrlString(urlTest), false, 'URL validation was incorrect');\n });\n\n it('converts URL with a hash to a URL without a hash', () => {\n const urlTest = 'http://www.example.com#?test';\n const convertedUrl = ParsedURL.urlWithoutHash(urlTest);\n assert.strictEqual(convertedUrl, 'http://www.example.com', 'URL was not converted successfully');\n });\n\n it('returns URL without a hash as it is', () => {\n const urlTest = 'http://www.example.com';\n const convertedUrl = ParsedURL.urlWithoutHash(urlTest);\n assert.strictEqual(convertedUrl, urlTest, 'URL was changed');\n });\n\n it('returns URL with a question mark but without a hash as it is', () => {\n const urlTest = 'http://www.example.com?hello';\n const convertedUrl = ParsedURL.urlWithoutHash(urlTest);\n assert.strictEqual(convertedUrl, urlTest, 'URL was changed');\n });\n\n it('extracts the path from a valid URL', () => {\n const urlTest = 'http://www.example.com/test/path' as Platform.DevToolsPath.UrlString;\n const extractedPath = ParsedURL.extractPath(urlTest);\n assert.strictEqual(extractedPath, '/test/path', 'path extracted incorrectly');\n });\n\n it('returns an empty string as a path if the URL is not valid', () => {\n const urlTest = 'www.example.com/test/path' as Platform.DevToolsPath.UrlString;\n const extractedPath = ParsedURL.extractPath(urlTest);\n assert.strictEqual(extractedPath, '', 'did not return an empty path');\n });\n\n it('extracts the origin from a valid URL', () => {\n const urlTest = 'http://www.example.com/test/path' as Platform.DevToolsPath.UrlString;\n const extractedOrigin = ParsedURL.extractOrigin(urlTest);\n assert.strictEqual(extractedOrigin, 'http://www.example.com', 'origin extracted incorrectly');\n });\n\n it('returns an empty string as a origin if the URL is not valid', () => {\n const urlTest = 'www.example.com/test/path';\n const extractedOrigin = ParsedURL.extractOrigin(urlTest as Platform.DevToolsPath.UrlString);\n assert.strictEqual(extractedOrigin, '', 'did not return an empty path');\n });\n\n it('extracts the extension from a valid URL with a hash', () => {\n const urlTest = 'http://www.example.com/test/testFile.html#testHash';\n const extractedExt = ParsedURL.extractExtension(urlTest);\n assert.strictEqual(extractedExt, 'html', 'extension extracted incorrectly');\n });\n\n it('extracts the extension from a valid URL with a question mark', () => {\n const urlTest = 'http://www.example.com/test/testFile.html?testParam=t';\n const extractedExt = ParsedURL.extractExtension(urlTest);\n assert.strictEqual(extractedExt, 'html', 'extension extracted incorrectly');\n });\n\n it('extracts the extension from a valid URL that does not have slashes', () => {\n const urlTest = 'testFile.html';\n const extractedExt = ParsedURL.extractExtension(urlTest);\n assert.strictEqual(extractedExt, 'html', 'extension extracted incorrectly');\n });\n\n it('extracts the extension from a valid URL that has a percent sign', () => {\n const urlTest = 'http://www.example.com/test/path.html%20';\n const extractedExt = ParsedURL.extractExtension(urlTest);\n assert.strictEqual(extractedExt, 'html', 'extension extracted incorrectly');\n });\n\n it('returns an empty string when trying to extract extension from an invalid URL', () => {\n const urlTest = 'http://html';\n const extractedExt = ParsedURL.extractExtension(urlTest);\n assert.strictEqual(extractedExt, '', 'extension extracted incorrectly');\n });\n\n it('is able to extract name from a valid URL', () => {\n const urlTest = 'http://www.example.com/test/path.html';\n const extractedName = ParsedURL.extractName(urlTest);\n assert.strictEqual(extractedName, 'path.html', 'name extracted incorrectly');\n });\n\n it('is able to extract name from a string without a slash', () => {\n const urlTest = 'path.html';\n const extractedName = ParsedURL.extractName(urlTest);\n assert.strictEqual(extractedName, 'path.html', 'name extracted incorrectly');\n });\n\n it('is able to extract name from a valid URL with a query', () => {\n const urlTest = 'http://www.example.com/test/path.html?testParam=t';\n const extractedName = ParsedURL.extractName(urlTest);\n assert.strictEqual(extractedName, 'path.html', 'name extracted incorrectly');\n });\n\n it('is able to extract name from a string without a slash and with a query', () => {\n const urlTest = 'path.html?testParam=t';\n const extractedName = ParsedURL.extractName(urlTest);\n assert.strictEqual(extractedName, 'path.html', 'name extracted incorrectly');\n });\n\n it('uses the completeURL function to return a data URL as it is', () => {\n const hrefTest = 'data:http://www.example.com';\n const baseUrlTest = 'www.example.com' as Platform.DevToolsPath.UrlString;\n const completeUrl = ParsedURL.completeURL(baseUrlTest, hrefTest);\n assertEqualUrlStringString(completeUrl, hrefTest, 'complete URL is not returned correctly');\n });\n\n it('uses the completeURL function to return a blob URL as it is', () => {\n const hrefTest = 'blob:http://www.example.com';\n const baseUrlTest = 'www.example.com' as Platform.DevToolsPath.UrlString;\n const completeUrl = ParsedURL.completeURL(baseUrlTest, hrefTest);\n assertEqualUrlStringString(completeUrl, hrefTest, 'complete URL is not returned correctly');\n });\n\n it('uses the completeURL function to return a javascript URL as it is', () => {\n const hrefTest = 'javascript:http://www.example.com';\n const baseUrlTest = 'www.example.com' as Platform.DevToolsPath.UrlString;\n const completeUrl = ParsedURL.completeURL(baseUrlTest, hrefTest);\n assertEqualUrlStringString(completeUrl, hrefTest, 'complete URL is not returned correctly');\n });\n\n it('uses the completeURL function to return a mailto URL as it is', () => {\n const hrefTest = 'mailto:http://www.example.com';\n const baseUrlTest = 'www.example.com' as Platform.DevToolsPath.UrlString;\n const completeUrl = ParsedURL.completeURL(baseUrlTest, hrefTest);\n assertEqualUrlStringString(completeUrl, hrefTest, 'complete URL is not returned correctly');\n });\n\n describe('completeURL with absolute URLs', () => {\n const cases = [\n {href: 'http://www.example.com', expected: 'http://www.example.com/'},\n {href: 'http://a/b/c/g', expected: 'http://a/b/c/g'},\n {href: 'http://a/b/c/./g', expected: 'http://a/b/c/g'},\n {href: 'http://a/b/c/g/', expected: 'http://a/b/c/g/'},\n {href: 'http://a/b/c/d;p?y', expected: 'http://a/b/c/d;p?y'},\n {href: 'http://a/b/c/g?y', expected: 'http://a/b/c/g?y'},\n {href: 'http://a/b/c/d;p?q#s', expected: 'http://a/b/c/d;p?q#s'},\n {href: 'http://a/b/c/g#s', expected: 'http://a/b/c/g#s'},\n {href: 'http://a/b/c/g?y#s', expected: 'http://a/b/c/g?y#s'},\n {href: 'http://a/b/c/;x', expected: 'http://a/b/c/;x'},\n {href: 'http://a/b/c/g;x', expected: 'http://a/b/c/g;x'},\n {href: 'http://a/b/c/g;x?y#s', expected: 'http://a/b/c/g;x?y#s'},\n {href: 'http://a/b/c/d;p?q', expected: 'http://a/b/c/d;p?q'},\n {href: 'http://a/b/c/.', expected: 'http://a/b/c/'},\n {href: 'http://a/b/c/./', expected: 'http://a/b/c/'},\n {href: 'http://a/b/c/..', expected: 'http://a/b/'},\n {href: 'http://a/b/c/../', expected: 'http://a/b/'},\n {href: 'http://a/b/c/../g', expected: 'http://a/b/g'},\n {href: 'http://a/b/c/../..', expected: 'http://a/'},\n {href: 'http://a/b/c/../../', expected: 'http://a/'},\n {href: 'http://a/b/c/../../g', expected: 'http://a/g'},\n {href: 'http://a/b/c/../../../g', expected: 'http://a/g'},\n {href: 'http://a/b/c/../../../../g', expected: 'http://a/g'},\n {href: 'http://a/b/c/g.', expected: 'http://a/b/c/g.'},\n {href: 'http://a/b/c/.g', expected: 'http://a/b/c/.g'},\n {href: 'http://a/b/c/g..', expected: 'http://a/b/c/g..'},\n {href: 'http://a/b/c/..g', expected: 'http://a/b/c/..g'},\n {href: 'http://a/b/c/./../g', expected: 'http://a/b/g'},\n {href: 'http://a/b/c/./g/.', expected: 'http://a/b/c/g/'},\n {href: 'http://a/b/c/g/./h', expected: 'http://a/b/c/g/h'},\n {href: 'http://a/b/c/g/../h', expected: 'http://a/b/c/h'},\n {href: 'http://a/b/c/g;x=1/./y', expected: 'http://a/b/c/g;x=1/y'},\n {href: 'http://a/b/c/g;x=1/../y', expected: 'http://a/b/c/y'},\n {href: 'http://a/b/c/g?y/./x', expected: 'http://a/b/c/g?y/./x'},\n {href: 'http://a/b/c/g?y/../x', expected: 'http://a/b/c/g?y/../x'},\n {href: 'http://a/b/c/g#s/./x', expected: 'http://a/b/c/g#s/./x'},\n {href: 'http://a/b/c/g#s/../x', expected: 'http://a/b/c/g#s/../x'},\n {\n href: 'http://user:password@host:8080/dir/../file.ts?rev=100',\n expected: 'http://host:8080/file.ts?rev=100',\n },\n {\n href: 'webpack://@scope/chrome-devtool-sourcemap-issue/./main.ts',\n expected: 'webpack://scope/chrome-devtool-sourcemap-issue/main.ts',\n },\n ];\n\n for (const {href, expected} of cases) {\n it(`can use completeURL to normalize \"${href}\"`, () => {\n const baseUrlTest = 'www.example.com' as Platform.DevToolsPath.UrlString;\n const completeUrl = ParsedURL.completeURL(baseUrlTest, href);\n assertEqualUrlStringString(completeUrl, expected, 'complete URL is not returned correctly');\n });\n }\n });\n\n it('uses the completeURL function to return null for invalid href and invalid base URL', () => {\n const hrefTest = 'www.example.com';\n const baseUrlTest = 'www.example.com' as Platform.DevToolsPath.UrlString;\n const completeUrl = ParsedURL.completeURL(baseUrlTest, hrefTest);\n assert.strictEqual(completeUrl, null, 'complete URL is not returned correctly');\n });\n\n it('uses the completeURL function to return the href if the base URL is a data URL', () => {\n const hrefTest = 'www.example.com';\n const baseUrlTest = 'data://www.example.com' as Platform.DevToolsPath.UrlString;\n const completeUrl = ParsedURL.completeURL(baseUrlTest, hrefTest);\n assertEqualUrlStringString(completeUrl, hrefTest, 'complete URL is not returned correctly');\n });\n\n it('uses the completeURL function to return the href with scheme if the base URL was valid and the href scheme was dropped',\n () => {\n const hrefTest = '//www.example.com';\n const baseUrlTest = 'http://www.example.com/' as Platform.DevToolsPath.UrlString;\n const completeUrl = ParsedURL.completeURL(baseUrlTest, hrefTest);\n assertEqualUrlStringString(completeUrl, 'http:' + hrefTest, 'complete URL is not returned correctly');\n });\n\n it('uses the completeURL function to resolve an empty href to a base URL without fragment', () => {\n const hrefTest = '';\n const baseUrlTest = 'http://www.example.com/?testParam=t' as Platform.DevToolsPath.UrlString;\n const completeUrl = ParsedURL.completeURL(baseUrlTest, hrefTest);\n assertEqualUrlStringString(completeUrl, baseUrlTest, 'complete URL is not returned correctly');\n });\n\n it('uses the completeURL function to resolve a fragment href to a base URL with fragment', () => {\n const hrefTest = '#testFragment';\n const baseUrlTest = 'http://www.example.com/?testParam=t' as Platform.DevToolsPath.UrlString;\n const completeUrl = ParsedURL.completeURL(baseUrlTest, hrefTest);\n assertEqualUrlStringString(completeUrl, baseUrlTest + hrefTest, 'complete URL is not returned correctly');\n });\n\n it('uses the completeURL function to resolve a parameters href to a base URL with the parameters from the href while the base URL has parameters',\n () => {\n const hrefTest = '?hrefParams=t';\n const baseUrlTest = 'http://www.example.com/?testParam=t' as Platform.DevToolsPath.UrlString;\n const completeUrl = ParsedURL.completeURL(baseUrlTest, hrefTest);\n assertEqualUrlStringString(\n completeUrl, 'http://www.example.com/' + hrefTest, 'complete URL is not returned correctly');\n });\n\n it('uses the completeURL function to resolve a parameters href to a base URL with the parameters from the href while the base URL does not have parameters',\n () => {\n const hrefTest = '?hrefParams=t';\n const baseUrlTest = 'http://www.example.com/' as Platform.DevToolsPath.UrlString;\n const completeUrl = ParsedURL.completeURL(baseUrlTest, hrefTest);\n assertEqualUrlStringString(completeUrl, baseUrlTest + hrefTest, 'complete URL is not returned correctly');\n });\n\n it('uses the splitLineAndColumn function to return undefined line and column numbers if the URL does not contain any',\n () => {\n const stringTest = 'http://www.example.com';\n const splitResult = ParsedURL.splitLineAndColumn(stringTest);\n assert.strictEqual(splitResult.url, 'http://www.example.com', 'URL is not correct');\n assert.isUndefined(splitResult.lineNumber, 'line number is not undefined');\n assert.isUndefined(splitResult.columnNumber, 'column number is not undefined');\n });\n\n it('uses the splitLineAndColumn function to return the line number if the URL contains one', () => {\n const stringTest = 'http://www.example.com/foo.js:15';\n const splitResult = ParsedURL.splitLineAndColumn(stringTest);\n assert.strictEqual(splitResult.url, 'http://www.example.com/foo.js', 'URL is not correct');\n assert.strictEqual(splitResult.lineNumber, 14, 'line number is incorrect');\n assert.strictEqual(splitResult.columnNumber, undefined, 'column number is incorrect');\n });\n\n it('uses the splitLineAndColumn function to return the line and column numbers if the URL contains them', () => {\n const stringTest = 'http://www.example.com:15:20';\n const splitResult = ParsedURL.splitLineAndColumn(stringTest);\n assert.strictEqual(splitResult.url, 'http://www.example.com', 'URL is not correct');\n assert.strictEqual(splitResult.lineNumber, 14, 'line number is incorrect');\n assert.strictEqual(splitResult.columnNumber, 19, 'column number is incorrect');\n });\n\n it('uses the splitLineAndColumn function to return the line and column numbers if the URL contains them and has a port number',\n () => {\n const stringTest = 'http://www.example.com:8080:15:20';\n const splitResult = ParsedURL.splitLineAndColumn(stringTest);\n assert.strictEqual(splitResult.url, 'http://www.example.com:8080', 'URL is not correct');\n assert.strictEqual(splitResult.lineNumber, 14, 'line number is incorrect');\n assert.strictEqual(splitResult.columnNumber, 19, 'column number is incorrect');\n });\n\n it('uses the removeWasmFunctionInfoFromURL function to return unmodified URL if not pointing to a wasm source',\n () => {\n const stringTest = 'http://www.example.com:15:20';\n const url = ParsedURL.removeWasmFunctionInfoFromURL(stringTest);\n assert.strictEqual(url, 'http://www.example.com:15:20', 'URL is not correct');\n });\n\n it('uses the removeWasmFunctionInfoFromURL function to return the wasm unmodified URL if it points to a wasm source',\n () => {\n const stringTest = 'http://www.example.com/example.wasm:wasm-function[0]:0x3e';\n const url = ParsedURL.removeWasmFunctionInfoFromURL(stringTest);\n assert.strictEqual(url, 'http://www.example.com/example.wasm', 'URL is not correct');\n });\n\n it('uses the removeWasmFunctionInfoFromURL function to return the wasm unmodified URL if it points to a wasm source with port number',\n () => {\n const stringTest = 'http://www.example.com:8080/example.wasm:wasm-function[0]:0x3e';\n const url = ParsedURL.removeWasmFunctionInfoFromURL(stringTest);\n assert.strictEqual(url, 'http://www.example.com:8080/example.wasm', 'URL is not correct');\n });\n\n it('uses the isRelativeURL function to return true if the URL is relative', () => {\n assert.isTrue(ParsedURL.isRelativeURL('/test/path'));\n assert.isTrue(ParsedURL.isRelativeURL('C:/'));\n assert.isTrue(ParsedURL.isRelativeURL('C'));\n });\n\n it('uses the isRelativeURL function to return false if the URL is not relative', () => {\n assert.isFalse(ParsedURL.isRelativeURL('http://www.example.com/test/path'));\n assert.isFalse(ParsedURL.isRelativeURL('about:blank'));\n assert.isFalse(ParsedURL.isRelativeURL('file:///C:/'));\n });\n\n it('uses the displayName function to return the name if it exists for a URL', () => {\n const parsedUrl = new ParsedURL('http://www.example.com');\n assert.strictEqual(parsedUrl.displayName, 'www.example.com/', 'name returned is incorrect');\n });\n\n it('uses the displayName function to return the name for a data URL', () => {\n const parsedUrl = new ParsedURL('data:www.example.com');\n assert.strictEqual(parsedUrl.displayName, 'data:www.example.com', 'name returned is incorrect');\n });\n\n it('uses the displayName function to return the name for a blob URL', () => {\n const parsedUrl = new ParsedURL('blob:www.example.com');\n assert.strictEqual(parsedUrl.displayName, 'blob:www.example.com', 'name returned is incorrect');\n });\n\n it('uses the displayName function to return the name for an about:blank URL', () => {\n const parsedUrl = new ParsedURL('about:blank');\n assert.strictEqual(parsedUrl.displayName, 'about:blank', 'name returned is incorrect');\n });\n\n it('uses the displayName function to return the name for a URL with a last path component', () => {\n const parsedUrl = new ParsedURL('http://www.example.com/test');\n assert.strictEqual(parsedUrl.displayName, 'test', 'name returned is incorrect');\n });\n\n it('uses the displayName function to return the name for a a slash', () => {\n const parsedUrl = new ParsedURL('/');\n assert.strictEqual(parsedUrl.displayName, '/', 'name returned is incorrect');\n });\n\n it('uses the displayName function to return the name for a URL that already has a display name set', () => {\n const parsedUrl = new ParsedURL('http://www.example.com');\n assert.strictEqual(parsedUrl.displayName, 'www.example.com/', 'name returned is incorrect');\n assert.strictEqual(parsedUrl.displayName, 'www.example.com/', 'name returned is incorrect');\n });\n\n it('uses the dataURLDisplayName function to return data URL display name if it is not already set', () => {\n const parsedUrl = new ParsedURL('http://www.example.com');\n assert.strictEqual(parsedUrl.dataURLDisplayName(), '', 'data URL display name is returned incorrectly');\n });\n\n it('uses the dataURLDisplayName function to return data URL display name if it is already set', () => {\n const parsedUrl = new ParsedURL('data:http://www.example.com');\n assert.strictEqual(\n parsedUrl.dataURLDisplayName(), 'data:http://www.exa…', 'data URL display name is returned incorrectly');\n assert.strictEqual(\n parsedUrl.dataURLDisplayName(), 'data:http://www.exa…', 'data URL display name is returned incorrectly');\n });\n\n it('uses the lastPathComponentWithFragment function to return for a URL without a path', () => {\n const parsedUrl = new ParsedURL('http://www.example.com');\n assert.strictEqual(\n parsedUrl.lastPathComponentWithFragment(), '', 'last path component with fragmen returned is incorrect');\n });\n\n it('uses the lastPathComponentWithFragment function to return for a URL with a path', () => {\n const parsedUrl = new ParsedURL('http://www.example.com/test/path');\n assert.strictEqual(\n parsedUrl.lastPathComponentWithFragment(), 'path', 'last path component with fragmen returned is incorrect');\n });\n\n it('uses the lastPathComponentWithFragment function to return for a URL with a path and trailing slash', () => {\n const parsedUrl = new ParsedURL('http://www.example.com/test/path/');\n assert.strictEqual(\n parsedUrl.lastPathComponentWithFragment(), 'path/', 'last path component with fragmen returned is incorrect');\n });\n\n it('uses the lastPathComponentWithFragment function to return for a URL with a path and a fragment', () => {\n const parsedUrl = new ParsedURL('http://www.example.com/test/path#testFragment');\n assert.strictEqual(\n parsedUrl.lastPathComponentWithFragment(), 'path#testFragment',\n 'last path component with fragmen returned is incorrect');\n });\n\n it('returns the domain for a data URL', () => {\n const parsedUrl = new ParsedURL('data:http://www.example.com');\n assert.strictEqual(parsedUrl.domain(), 'data:', 'domain returned was incorrect');\n });\n\n it('returns the domain for an http URL without a port', () => {\n const parsedUrl = new ParsedURL('http://www.example.com');\n assert.strictEqual(parsedUrl.domain(), 'www.example.com', 'domain returned was incorrect');\n });\n\n it('returns the domain for an http URL with a port', () => {\n const parsedUrl = new ParsedURL('http://www.example.com:8080');\n assert.strictEqual(parsedUrl.domain(), 'www.example.com:8080', 'domain returned was incorrect');\n });\n\n it('returns the security origin for a data URL', () => {\n const parsedUrl = new ParsedURL('data:http://www.example.com');\n assert.strictEqual(parsedUrl.securityOrigin(), 'data:', 'security origin returned was incorrect');\n });\n\n it('returns the security origin for a blob URL', () => {\n const parsedUrl = new ParsedURL('blob:http://www.example.com');\n assert.strictEqual(parsedUrl.securityOrigin(), 'http://www.example.com', 'security origin returned was incorrect');\n });\n\n it('returns the security origin for an http URL', () => {\n const parsedUrl = new ParsedURL('http://www.example.com');\n assert.strictEqual(parsedUrl.securityOrigin(), 'http://www.example.com', 'security origin returned was incorrect');\n });\n\n it('returns the url without scheme for a URL that has a scheme', () => {\n const parsedUrl = new ParsedURL('http://www.example.com');\n assert.strictEqual(parsedUrl.urlWithoutScheme(), 'www.example.com', 'URL without scheme returned was incorrect');\n });\n\n it('returns the url without scheme for a URL that does not have a scheme', () => {\n const parsedUrl = new ParsedURL('www.example.com');\n assert.strictEqual(parsedUrl.urlWithoutScheme(), 'www.example.com', 'URL without scheme returned was incorrect');\n });\n\n it('returns the correct results for all ported web_tests unit tests', () => {\n assertEqualUrlStringString(\n ParsedURL.completeURL(\n 'http://example.com/script.js' as Platform.DevToolsPath.UrlString, 'http://example.com/map.json'),\n 'http://example.com/map.json');\n assertEqualUrlStringString(\n ParsedURL.completeURL('http://example.com/script.js' as Platform.DevToolsPath.UrlString, '/map.json'),\n 'http://example.com/map.json');\n assertEqualUrlStringString(\n ParsedURL.completeURL(\n 'http://example.com/scripts/script.js' as Platform.DevToolsPath.UrlString, '../maps/map.json'),\n 'http://example.com/maps/map.json');\n\n const baseURL = 'http://a/b/c/d;p?q' as Platform.DevToolsPath.UrlString;\n\n assertEqualUrlStringString(ParsedURL.completeURL(baseURL, 'http://h'),\n 'http://h/'); // modified from RFC3986\n assertEqualUrlStringString(ParsedURL.completeURL(baseURL, 'g'), 'http://a/b/c/g');\n assertEqualUrlStringString(ParsedURL.completeURL(baseURL, './g'), 'http://a/b/c/g');\n assertEqualUrlStringString(ParsedURL.completeURL(baseURL, 'g/'), 'http://a/b/c/g/');\n assertEqualUrlStringString(ParsedURL.completeURL(baseURL, '/g'), 'http://a/g');\n assertEqualUrlStringString(ParsedURL.completeURL(baseURL, '//g'), 'http://g');\n assertEqualUrlStringString(ParsedURL.completeURL(baseURL, '?y'), 'http://a/b/c/d;p?y');\n assertEqualUrlStringString(ParsedURL.completeURL(baseURL, 'g?y'), 'http://a/b/c/g?y');\n assertEqualUrlStringString(ParsedURL.completeURL(baseURL, '#s'), 'http://a/b/c/d;p?q#s');\n assertEqualUrlStringString(ParsedURL.completeURL(baseURL, 'g#s'), 'http://a/b/c/g#s');\n assertEqualUrlStringString(ParsedURL.completeURL(baseURL, 'g?y#s'), 'http://a/b/c/g?y#s');\n assertEqualUrlStringString(ParsedURL.completeURL(baseURL, ';x'), 'http://a/b/c/;x');\n assertEqualUrlStringString(ParsedURL.completeURL(baseURL, 'g;x'), 'http://a/b/c/g;x');\n assertEqualUrlStringString(ParsedURL.completeURL(baseURL, 'g;x?y#s'), 'http://a/b/c/g;x?y#s');\n assertEqualUrlStringString(ParsedURL.completeURL(baseURL, 'g;x=1/./y'), 'http://a/b/c/g;x=1/y');\n assertEqualUrlStringString(ParsedURL.completeURL(baseURL, 'g;x=1/../y'), 'http://a/b/c/y');\n assertEqualUrlStringString(ParsedURL.completeURL(baseURL, 'g?y/./x'), 'http://a/b/c/g?y/./x');\n assertEqualUrlStringString(ParsedURL.completeURL(baseURL, 'g?y/../x'), 'http://a/b/c/g?y/../x');\n assertEqualUrlStringString(ParsedURL.completeURL(baseURL, 'g#s/./x'), 'http://a/b/c/g#s/./x');\n assertEqualUrlStringString(ParsedURL.completeURL(baseURL, 'g#s/../x'), 'http://a/b/c/g#s/../x');\n\n assertEqualUrlStringString(\n ParsedURL.completeURL('http://a/b/c/d;p?q' as Platform.DevToolsPath.UrlString, '//secure.com/moo'),\n 'http://secure.com/moo');\n assertEqualUrlStringString(\n ParsedURL.completeURL('http://a/b/c/d;p?q' as Platform.DevToolsPath.UrlString, 'cat.jpeg'),\n 'http://a/b/c/cat.jpeg');\n assertEqualUrlStringString(\n ParsedURL.completeURL('http://example.com/path.css?query#fragment' as Platform.DevToolsPath.UrlString, ''),\n 'http://example.com/path.css?query');\n });\n\n it('encodes partial path', () => {\n const pathTest = 'path/with%20escape/and spaces' as Platform.DevToolsPath.RawPathString;\n const encodedPath = 'path/with%2520escape/and%20spaces';\n const convertedPath = ParsedURL.rawPathToEncodedPathString(pathTest);\n assert.strictEqual(convertedPath, encodedPath, 'path was not converted successfully');\n });\n\n it('decodes partial path', () => {\n const pathTest = 'path/with%20escape/and spaces';\n const encodedPath = 'path/with%2520escape/and%20spaces' as Platform.DevToolsPath.EncodedPathString;\n const convertedPath = ParsedURL.encodedPathToRawPathString(encodedPath);\n assert.strictEqual(convertedPath, pathTest, 'path was not converted successfully');\n });\n\n it('encodes, decodes partial path with email address', () => {\n const pathTest = 'username:password@example.com' as Platform.DevToolsPath.RawPathString; // valid filename on unix\n const encodedPath = ParsedURL.rawPathToEncodedPathString(pathTest);\n assert.strictEqual(pathTest, encodedPath as string, 'changed during escaping');\n const convertedPath = ParsedURL.encodedPathToRawPathString(encodedPath);\n assert.strictEqual(convertedPath, pathTest, 'path was not converted successfully');\n });\n\n it('encodes, decodes partial path', () => {\n const pathTest = 'C:/Program%20Files/Google' as Platform.DevToolsPath.RawPathString;\n const encodedPath = ParsedURL.rawPathToEncodedPathString(pathTest);\n const convertedPath = ParsedURL.encodedPathToRawPathString(encodedPath);\n assert.strictEqual(convertedPath, pathTest, 'path was not converted successfully');\n });\n\n it('encodes, decodes partial path with whitespace', () => {\n const pathTest = 'C:/Program Files/Google' as Platform.DevToolsPath.RawPathString;\n const encodedPath = ParsedURL.rawPathToEncodedPathString(pathTest);\n const convertedPath = ParsedURL.encodedPathToRawPathString(encodedPath);\n assert.strictEqual(convertedPath, pathTest, 'path was not converted successfully');\n });\n\n it('encodes, decodes absolute path', () => {\n const pathTest = '/C:/Program%20Files/Google' as Platform.DevToolsPath.RawPathString;\n const encodedPath = ParsedURL.rawPathToEncodedPathString(pathTest);\n const convertedPath = ParsedURL.encodedPathToRawPathString(encodedPath);\n assert.strictEqual(convertedPath, pathTest, 'path was not converted successfully');\n });\n\n it('encodes, decodes absolute path with whitespace', () => {\n const pathTest = '/C:/Program Files/Google' as Platform.DevToolsPath.RawPathString;\n const encodedPath = ParsedURL.rawPathToEncodedPathString(pathTest);\n const convertedPath = ParsedURL.encodedPathToRawPathString(encodedPath);\n assert.strictEqual(convertedPath, pathTest, 'path was not converted successfully');\n });\n\n it('converts relative platform path and base URL to URL', () => {\n const baseUrl = 'http://localhost:8080/my%20folder/old%20path' as Platform.DevToolsPath.UrlString;\n const relativePath = 'new spaced%20name' as Platform.DevToolsPath.RawPathString;\n const convertedUrl = ParsedURL.relativePathToUrlString(relativePath, baseUrl);\n assert.strictEqual(convertedUrl, 'http://localhost:8080/my%20folder/new%20spaced%2520name');\n });\n\n it('converts URL to a platform path that includes drive letter and spaces on Windows', () => {\n const urlTest = 'file:///C:/Program%20Files/Google' as Platform.DevToolsPath.UrlString;\n const convertedUrl = ParsedURL.urlToRawPathString(urlTest, true);\n assert.strictEqual(convertedUrl, 'C:\\\\Program Files\\\\Google', 'URL was not converted successfully');\n });\n\n it('converts URL to a platform path that includes spaces and percents', () => {\n const urlTest = 'file:///home/user/with%20space/with%2520escape' as Platform.DevToolsPath.UrlString;\n const convertedUrl = ParsedURL.urlToRawPathString(urlTest, false);\n assert.strictEqual(convertedUrl, '/home/user/with space/with%20escape', 'URL was not converted successfully');\n });\n\n it('converts Windows platform path with spaces and percents to file url', () => {\n const urlTest = 'C:\\\\Program Files\\\\with%20escape' as Platform.DevToolsPath.RawPathString;\n const convertedUrl = ParsedURL.rawPathToUrlString(urlTest);\n assert.strictEqual(\n convertedUrl, 'file:///C:/Program%20Files/with%2520escape', 'URL was not converted successfully');\n });\n\n it('converts platform path with variety of special characters to URL and back consistently with Chrome', () => {\n const platformPathTest =\n '/home/a:b@c(d, e+f)=&g;#h$' as Platform.DevToolsPath.RawPathString; // Valid filename on unix\n const urlTest = 'file:///home/a:b@c(d,%20e+f)=&g%3B%23h$' as\n Platform.DevToolsPath.UrlString; // URL in Chrome address bar if you open that file\n assert.strictEqual(ParsedURL.rawPathToUrlString(platformPathTest), urlTest);\n assert.strictEqual(ParsedURL.urlToRawPathString(urlTest), platformPathTest);\n });\n});\n"]} \ No newline at end of file +{"version":3,"file":"ParsedURL.test.js","sourceRoot":"","sources":["../../../../../../front_end/core/common/ParsedURL.test.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAI7B,OAAO,KAAK,MAAM,MAAM,aAAa,CAAC;AAEtC,MAAM,SAAS,GAAG,MAAM,CAAC,SAAS,CAAC,SAAS,CAAC;AAE7C,SAAS,0BAA0B,CAAC,MAA4C,EAAE,QAAgB,EAAE,OAAgB;IAClH,MAAM,CAAC,WAAW,CAAC,MAAM,EAAE,QAA2C,EAAE,OAAO,CAAC,CAAC;AACnF,CAAC;AAED,QAAQ,CAAC,YAAY,EAAE,GAAG,EAAE;IAC1B,QAAQ,CAAC,yBAAyB,EAAE,GAAG,EAAE;QACvC,MAAM,KAAK,GAAG;YACZ,EAAC,IAAI,EAAE,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAC;YACxB,EAAC,IAAI,EAAE,GAAG,EAAE,QAAQ,EAAE,GAAG,EAAC;YAC1B,EAAC,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,EAAC;YAC3B,EAAC,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,EAAC;YAC3B,EAAC,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE,GAAG,EAAC;YAC5B,EAAC,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAAG,EAAC;YAC/B,EAAC,IAAI,EAAE,OAAO,EAAE,QAAQ,EAA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4BAAmE,CAAC,CAAE,yBAAyB;QACnG,MAAM,OAAO,GAAG,yCACmB,CAAC,CAAE,kDAAkD;QACxF,MAAM,CAAC,WAAW,CAAC,SAAS,CAAC,kBAAkB,CAAC,gBAAgB,CAAC,EAAE,OAAO,CAAC,CAAC;QAC5E,MAAM,CAAC,WAAW,CAAC,SAAS,CAAC,kBAAkB,CAAC,OAAO,CAAC,EAAE,gBAAgB,CAAC,CAAC;IAC9E,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["// Copyright 2019 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport type * as Platform from '../platform/platform.js';\n\nimport * as Common from './common.js';\n\nconst ParsedURL = Common.ParsedURL.ParsedURL;\n\nfunction assertEqualUrlStringString(actual: Platform.DevToolsPath.UrlString|null, expected: string, message?: string) {\n assert.strictEqual(actual, expected as Platform.DevToolsPath.UrlString, message);\n}\n\ndescribe('Parsed URL', () => {\n describe('with path normalization', () => {\n const cases = [\n {path: '', expected: ''},\n {path: '.', expected: '/'},\n {path: './', expected: '/'},\n {path: '..', expected: '/'},\n {path: '../', expected: '/'},\n {path: 'a/../g', expected: 'g'},\n {path: '../..', expected: '/'},\n {path: '../../', expected: '/'},\n {path: 'a/b/c/../../g', expected: 'a/g'},\n {path: 'a/b/c/d/../../../g', expected: 'a/g'},\n {path: 'a/b/c/d/e/../../../../g', expected: 'a/g'},\n {path: '/./g', expected: '/g'},\n {path: '/.//g', expected: '//g'},\n {path: '/../g', expected: '/g'},\n {path: 'g.', expected: 'g.'},\n {path: '.g', expected: '.g'},\n {path: 'g..', expected: 'g..'},\n {path: '..g', expected: '..g'},\n {path: 'a/b/./../g', expected: 'a/g'},\n {path: './g/.', expected: 'g/'},\n {path: 'g/./h', expected: 'g/h'},\n {path: 'g/../h', expected: 'h'},\n {path: './h/g/', expected: 'h/g/'},\n {path: 'g///h.ts', expected: 'g///h.ts'},\n {path: '/b/c/./', expected: '/b/c/'},\n {path: '///', expected: '///'},\n ];\n\n for (const {path, expected} of cases) {\n it(`can normalize \"${path}\"`, () => {\n assert.strictEqual(Common.ParsedURL.normalizePath(path), expected);\n });\n }\n });\n\n it('recognizes valid URLs', () => {\n const parsedUrl = new ParsedURL('http://www.example.com/');\n assert.isTrue(parsedUrl.isValid, 'the URL should be valid');\n });\n\n it('recognizes the URL elements', () => {\n const parsedUrl = new ParsedURL('http://username@www.example.com:8080/testing/test?isTest=true#testFragment');\n assert.isTrue(parsedUrl.isValid, 'the URL should be valid');\n assert.strictEqual(\n parsedUrl.url, 'http://username@www.example.com:8080/testing/test?isTest=true#testFragment',\n 'URL value is incorrect');\n assert.strictEqual(parsedUrl.scheme, 'http', 'URL scheme is incorrect');\n assert.strictEqual(parsedUrl.user, 'username', 'URL user is incorrect');\n assert.strictEqual(parsedUrl.host, 'www.example.com', 'URL host is incorrect');\n assert.strictEqual(parsedUrl.port, '8080', 'URL port is incorrect');\n assert.strictEqual(parsedUrl.path, '/testing/test', 'URL path is incorrect');\n assert.strictEqual(parsedUrl.queryParams, 'isTest=true', 'URL query params are incorrect');\n assert.strictEqual(parsedUrl.fragment, 'testFragment', 'URL fragment is incorrect');\n assert.strictEqual(parsedUrl.folderPathComponents, '/testing', 'URL folder path components are incorrect');\n assert.strictEqual(parsedUrl.lastPathComponent, 'test', 'URL last path component is incorrect');\n });\n\n it('recognizes a valid IPv6 localhost URL', () => {\n const parsedUrl = new ParsedURL('http://[::]/?queryParam1=value1&queryParam2=value2#fragmentWith/Many//Slashes');\n assert.isTrue(parsedUrl.isValid, 'the URL should be valid');\n assert.strictEqual(\n parsedUrl.url, 'http://[::]/?queryParam1=value1&queryParam2=value2#fragmentWith/Many//Slashes',\n 'URL value is incorrect');\n assert.strictEqual(parsedUrl.scheme, 'http', 'URL scheme is incorrect');\n assert.strictEqual(parsedUrl.user, '', 'URL user is incorrect');\n assert.strictEqual(parsedUrl.host, '[::]', 'URL host is incorrect');\n assert.strictEqual(parsedUrl.port, '', 'URL port is incorrect');\n assert.strictEqual(parsedUrl.path, '/', 'URL path is incorrect');\n assert.strictEqual(\n parsedUrl.queryParams, 'queryParam1=value1&queryParam2=value2', 'URL query params are incorrect');\n assert.strictEqual(parsedUrl.fragment, 'fragmentWith/Many//Slashes', 'URL fragment is incorrect');\n assert.strictEqual(parsedUrl.folderPathComponents, '', 'URL folder path components are incorrect');\n assert.strictEqual(parsedUrl.lastPathComponent, '', 'URL last path component is incorrect');\n });\n\n it('recognizes a valid blob URL', () => {\n const parsedUrl = new ParsedURL('blob:http://www.example.com/');\n assert.isTrue(parsedUrl.isValid, 'the URL should be valid');\n assert.strictEqual(parsedUrl.scheme, 'blob', 'the URL scheme is not blob');\n assert.strictEqual(parsedUrl.blobInnerScheme, 'http', 'the URL inner scheme is not http');\n });\n\n it('parses a URL with no path', () => {\n const parsedUrl = new ParsedURL('http://www.example.com');\n assert.isTrue(parsedUrl.isValid, 'the URL should be valid');\n assert.strictEqual(parsedUrl.path, '/', 'path is not a single slash (\"/\")');\n });\n\n it('parses a data URL', () => {\n const parsedUrl = new ParsedURL('data:test');\n assert.isFalse(parsedUrl.isValid, 'the URL should not be valid');\n assert.strictEqual(parsedUrl.scheme, 'data', 'the URL scheme is not data');\n });\n\n it('recognizes an invalid blob URL', () => {\n const parsedUrl = new ParsedURL('blob:test');\n assert.isFalse(parsedUrl.isValid, 'the URL should not be valid');\n assert.strictEqual(parsedUrl.scheme, 'blob', 'the URL scheme is not blob');\n });\n\n it('recognizes an invalid blank URL', () => {\n const parsedUrl = new ParsedURL('about:blank');\n assert.isFalse(parsedUrl.isValid, 'the URL should not be valid');\n assert.strictEqual(parsedUrl.scheme, 'about', 'the URL scheme is not blob');\n });\n\n it('recognizes an invalid URL', () => {\n const parsedUrl = new ParsedURL('abc');\n assert.isFalse(parsedUrl.isValid, 'the URL should not be valid');\n assert.strictEqual(parsedUrl.url, 'abc', 'URL value is incorrect');\n });\n\n it('converts platform path to a URL that does not start with \"file://\"', () => {\n const platformPathTest = 'usr/lib' as Platform.DevToolsPath.RawPathString;\n const convertedUrl = ParsedURL.rawPathToUrlString(platformPathTest);\n assert.strictEqual(convertedUrl, 'file:///usr/lib', 'URL was not converted correctly');\n });\n\n it('converts platform path to a URL that does not start with \"file://\" but starts with a slash (\"/\")', () => {\n const platformPathTest = '/usr/lib' as Platform.DevToolsPath.RawPathString;\n const convertedUrl = ParsedURL.rawPathToUrlString(platformPathTest);\n assert.strictEqual(convertedUrl, 'file:///usr/lib', 'URL was not converted correctly');\n });\n\n it('converts platform path to a URL that starts with \"file://\"', () => {\n const platformPathTest = 'file://usr/lib' as Platform.DevToolsPath.RawPathString;\n const convertedUrl = ParsedURL.rawPathToUrlString(platformPathTest);\n assert.strictEqual(convertedUrl, 'file://usr/lib', 'URL was not converted correctly');\n });\n\n it('converts path that starts with \"file://\" to a platform path', () => {\n const pathTest = 'file://usr/lib' as Platform.DevToolsPath.UrlString;\n const convertedPath = ParsedURL.urlToRawPathString(pathTest);\n assert.strictEqual(convertedPath, 'usr/lib', 'URL was not converted successfully');\n });\n\n it('converts path that starts with \"file:///\" to a platform path on Windows', () => {\n const pathTest = 'file:///usr/lib' as Platform.DevToolsPath.UrlString;\n const convertedPath = ParsedURL.urlToRawPathString(pathTest, true);\n assert.strictEqual(convertedPath, 'usr\\\\lib', 'URL was not converted successfully');\n });\n\n it('checks that URL is valid', () => {\n const urlTest = 'http://www.example.com#?test';\n assert.isTrue(ParsedURL.isValidUrlString(urlTest), 'URL validation was incorrect');\n });\n\n it('checks that file:// URL is valid', () => {\n const urlTest = 'file:///usr/lib';\n assert.isTrue(ParsedURL.isValidUrlString(urlTest), 'URL validation was incorrect');\n });\n\n it('checks that \"://\" is not a valid URL', () => {\n const urlTest = '://';\n assert.isFalse(ParsedURL.isValidUrlString(urlTest), 'URL validation was incorrect');\n });\n\n it('converts URL with a hash to a URL without a hash', () => {\n const urlTest = 'http://www.example.com#?test';\n const convertedUrl = ParsedURL.urlWithoutHash(urlTest);\n assert.strictEqual(convertedUrl, 'http://www.example.com', 'URL was not converted successfully');\n });\n\n it('returns URL without a hash as it is', () => {\n const urlTest = 'http://www.example.com';\n const convertedUrl = ParsedURL.urlWithoutHash(urlTest);\n assert.strictEqual(convertedUrl, urlTest, 'URL was changed');\n });\n\n it('returns URL with a question mark but without a hash as it is', () => {\n const urlTest = 'http://www.example.com?hello';\n const convertedUrl = ParsedURL.urlWithoutHash(urlTest);\n assert.strictEqual(convertedUrl, urlTest, 'URL was changed');\n });\n\n it('extracts the path from a valid URL', () => {\n const urlTest = 'http://www.example.com/test/path' as Platform.DevToolsPath.UrlString;\n const extractedPath = ParsedURL.extractPath(urlTest);\n assert.strictEqual(extractedPath, '/test/path', 'path extracted incorrectly');\n });\n\n it('returns an empty string as a path if the URL is not valid', () => {\n const urlTest = 'www.example.com/test/path' as Platform.DevToolsPath.UrlString;\n const extractedPath = ParsedURL.extractPath(urlTest);\n assert.strictEqual(extractedPath, '', 'did not return an empty path');\n });\n\n it('extracts the origin from a valid URL', () => {\n const urlTest = 'http://www.example.com/test/path' as Platform.DevToolsPath.UrlString;\n const extractedOrigin = ParsedURL.extractOrigin(urlTest);\n assert.strictEqual(extractedOrigin, 'http://www.example.com', 'origin extracted incorrectly');\n });\n\n it('returns an empty string as a origin if the URL is not valid', () => {\n const urlTest = 'www.example.com/test/path';\n const extractedOrigin = ParsedURL.extractOrigin(urlTest as Platform.DevToolsPath.UrlString);\n assert.strictEqual(extractedOrigin, '', 'did not return an empty path');\n });\n\n it('extracts the extension from a valid URL with a hash', () => {\n const urlTest = 'http://www.example.com/test/testFile.html#testHash';\n const extractedExt = ParsedURL.extractExtension(urlTest);\n assert.strictEqual(extractedExt, 'html', 'extension extracted incorrectly');\n });\n\n it('extracts the extension from a valid URL with a question mark', () => {\n const urlTest = 'http://www.example.com/test/testFile.html?testParam=t';\n const extractedExt = ParsedURL.extractExtension(urlTest);\n assert.strictEqual(extractedExt, 'html', 'extension extracted incorrectly');\n });\n\n it('extracts the extension from a valid URL that does not have slashes', () => {\n const urlTest = 'testFile.html';\n const extractedExt = ParsedURL.extractExtension(urlTest);\n assert.strictEqual(extractedExt, 'html', 'extension extracted incorrectly');\n });\n\n it('extracts the extension from a valid URL that has a percent sign', () => {\n const urlTest = 'http://www.example.com/test/path.html%20';\n const extractedExt = ParsedURL.extractExtension(urlTest);\n assert.strictEqual(extractedExt, 'html', 'extension extracted incorrectly');\n });\n\n it('returns an empty string when trying to extract extension from an invalid URL', () => {\n const urlTest = 'http://html';\n const extractedExt = ParsedURL.extractExtension(urlTest);\n assert.strictEqual(extractedExt, '', 'extension extracted incorrectly');\n });\n\n it('is able to extract name from a valid URL', () => {\n const urlTest = 'http://www.example.com/test/path.html';\n const extractedName = ParsedURL.extractName(urlTest);\n assert.strictEqual(extractedName, 'path.html', 'name extracted incorrectly');\n });\n\n it('is able to extract name from a string without a slash', () => {\n const urlTest = 'path.html';\n const extractedName = ParsedURL.extractName(urlTest);\n assert.strictEqual(extractedName, 'path.html', 'name extracted incorrectly');\n });\n\n it('is able to extract name from a valid URL with a query', () => {\n const urlTest = 'http://www.example.com/test/path.html?testParam=t';\n const extractedName = ParsedURL.extractName(urlTest);\n assert.strictEqual(extractedName, 'path.html', 'name extracted incorrectly');\n });\n\n it('is able to extract name from a string without a slash and with a query', () => {\n const urlTest = 'path.html?testParam=t';\n const extractedName = ParsedURL.extractName(urlTest);\n assert.strictEqual(extractedName, 'path.html', 'name extracted incorrectly');\n });\n\n it('uses the completeURL function to return a data URL as it is', () => {\n const hrefTest = 'data:http://www.example.com';\n const baseUrlTest = 'www.example.com' as Platform.DevToolsPath.UrlString;\n const completeUrl = ParsedURL.completeURL(baseUrlTest, hrefTest);\n assertEqualUrlStringString(completeUrl, hrefTest, 'complete URL is not returned correctly');\n });\n\n it('uses the completeURL function to return a blob URL as it is', () => {\n const hrefTest = 'blob:http://www.example.com';\n const baseUrlTest = 'www.example.com' as Platform.DevToolsPath.UrlString;\n const completeUrl = ParsedURL.completeURL(baseUrlTest, hrefTest);\n assertEqualUrlStringString(completeUrl, hrefTest, 'complete URL is not returned correctly');\n });\n\n it('uses the completeURL function to return a javascript URL as it is', () => {\n const hrefTest = 'javascript:http://www.example.com';\n const baseUrlTest = 'www.example.com' as Platform.DevToolsPath.UrlString;\n const completeUrl = ParsedURL.completeURL(baseUrlTest, hrefTest);\n assertEqualUrlStringString(completeUrl, hrefTest, 'complete URL is not returned correctly');\n });\n\n it('uses the completeURL function to return a mailto URL as it is', () => {\n const hrefTest = 'mailto:http://www.example.com';\n const baseUrlTest = 'www.example.com' as Platform.DevToolsPath.UrlString;\n const completeUrl = ParsedURL.completeURL(baseUrlTest, hrefTest);\n assertEqualUrlStringString(completeUrl, hrefTest, 'complete URL is not returned correctly');\n });\n\n describe('completeURL with absolute URLs', () => {\n const cases = [\n {href: 'http://www.example.com', expected: 'http://www.example.com/'},\n {href: 'http://a/b/c/g', expected: 'http://a/b/c/g'},\n {href: 'http://a/b/c/./g', expected: 'http://a/b/c/g'},\n {href: 'http://a/b/c/g/', expected: 'http://a/b/c/g/'},\n {href: 'http://a/b/c/d;p?y', expected: 'http://a/b/c/d;p?y'},\n {href: 'http://a/b/c/g?y', expected: 'http://a/b/c/g?y'},\n {href: 'http://a/b/c/d;p?q#s', expected: 'http://a/b/c/d;p?q#s'},\n {href: 'http://a/b/c/g#s', expected: 'http://a/b/c/g#s'},\n {href: 'http://a/b/c/g?y#s', expected: 'http://a/b/c/g?y#s'},\n {href: 'http://a/b/c/;x', expected: 'http://a/b/c/;x'},\n {href: 'http://a/b/c/g;x', expected: 'http://a/b/c/g;x'},\n {href: 'http://a/b/c/g;x?y#s', expected: 'http://a/b/c/g;x?y#s'},\n {href: 'http://a/b/c/d;p?q', expected: 'http://a/b/c/d;p?q'},\n {href: 'http://a/b/c/.', expected: 'http://a/b/c/'},\n {href: 'http://a/b/c/./', expected: 'http://a/b/c/'},\n {href: 'http://a/b/c/..', expected: 'http://a/b/'},\n {href: 'http://a/b/c/../', expected: 'http://a/b/'},\n {href: 'http://a/b/c/../g', expected: 'http://a/b/g'},\n {href: 'http://a/b/c/../..', expected: 'http://a/'},\n {href: 'http://a/b/c/../../', expected: 'http://a/'},\n {href: 'http://a/b/c/../../g', expected: 'http://a/g'},\n {href: 'http://a/b/c/../../../g', expected: 'http://a/g'},\n {href: 'http://a/b/c/../../../../g', expected: 'http://a/g'},\n {href: 'http://a/b/c/g.', expected: 'http://a/b/c/g.'},\n {href: 'http://a/b/c/.g', expected: 'http://a/b/c/.g'},\n {href: 'http://a/b/c/g..', expected: 'http://a/b/c/g..'},\n {href: 'http://a/b/c/..g', expected: 'http://a/b/c/..g'},\n {href: 'http://a/b/c/./../g', expected: 'http://a/b/g'},\n {href: 'http://a/b/c/./g/.', expected: 'http://a/b/c/g/'},\n {href: 'http://a/b/c/g/./h', expected: 'http://a/b/c/g/h'},\n {href: 'http://a/b/c/g/../h', expected: 'http://a/b/c/h'},\n {href: 'http://a/b/c/g;x=1/./y', expected: 'http://a/b/c/g;x=1/y'},\n {href: 'http://a/b/c/g;x=1/../y', expected: 'http://a/b/c/y'},\n {href: 'http://a/b/c/g?y/./x', expected: 'http://a/b/c/g?y/./x'},\n {href: 'http://a/b/c/g?y/../x', expected: 'http://a/b/c/g?y/../x'},\n {href: 'http://a/b/c/g#s/./x', expected: 'http://a/b/c/g#s/./x'},\n {href: 'http://a/b/c/g#s/../x', expected: 'http://a/b/c/g#s/../x'},\n {\n href: 'http://user:password@host:8080/dir/../file.ts?rev=100',\n expected: 'http://host:8080/file.ts?rev=100',\n },\n {\n href: 'webpack://@scope/chrome-devtool-sourcemap-issue/./main.ts',\n expected: 'webpack://scope/chrome-devtool-sourcemap-issue/main.ts',\n },\n ];\n\n for (const {href, expected} of cases) {\n it(`can use completeURL to normalize \"${href}\"`, () => {\n const baseUrlTest = 'www.example.com' as Platform.DevToolsPath.UrlString;\n const completeUrl = ParsedURL.completeURL(baseUrlTest, href);\n assertEqualUrlStringString(completeUrl, expected, 'complete URL is not returned correctly');\n });\n }\n });\n\n it('uses the completeURL function to return null for invalid href and invalid base URL', () => {\n const hrefTest = 'www.example.com';\n const baseUrlTest = 'www.example.com' as Platform.DevToolsPath.UrlString;\n const completeUrl = ParsedURL.completeURL(baseUrlTest, hrefTest);\n assert.isNull(completeUrl, 'complete URL is not returned correctly');\n });\n\n it('uses the completeURL function to return the href if the base URL is a data URL', () => {\n const hrefTest = 'www.example.com';\n const baseUrlTest = 'data://www.example.com' as Platform.DevToolsPath.UrlString;\n const completeUrl = ParsedURL.completeURL(baseUrlTest, hrefTest);\n assertEqualUrlStringString(completeUrl, hrefTest, 'complete URL is not returned correctly');\n });\n\n it('uses the completeURL function to return the href with scheme if the base URL was valid and the href scheme was dropped',\n () => {\n const hrefTest = '//www.example.com';\n const baseUrlTest = 'http://www.example.com/' as Platform.DevToolsPath.UrlString;\n const completeUrl = ParsedURL.completeURL(baseUrlTest, hrefTest);\n assertEqualUrlStringString(completeUrl, 'http:' + hrefTest, 'complete URL is not returned correctly');\n });\n\n it('uses the completeURL function to resolve an empty href to a base URL without fragment', () => {\n const hrefTest = '';\n const baseUrlTest = 'http://www.example.com/?testParam=t' as Platform.DevToolsPath.UrlString;\n const completeUrl = ParsedURL.completeURL(baseUrlTest, hrefTest);\n assertEqualUrlStringString(completeUrl, baseUrlTest, 'complete URL is not returned correctly');\n });\n\n it('uses the completeURL function to resolve a fragment href to a base URL with fragment', () => {\n const hrefTest = '#testFragment';\n const baseUrlTest = 'http://www.example.com/?testParam=t' as Platform.DevToolsPath.UrlString;\n const completeUrl = ParsedURL.completeURL(baseUrlTest, hrefTest);\n assertEqualUrlStringString(completeUrl, baseUrlTest + hrefTest, 'complete URL is not returned correctly');\n });\n\n it('uses the completeURL function to resolve a parameters href to a base URL with the parameters from the href while the base URL has parameters',\n () => {\n const hrefTest = '?hrefParams=t';\n const baseUrlTest = 'http://www.example.com/?testParam=t' as Platform.DevToolsPath.UrlString;\n const completeUrl = ParsedURL.completeURL(baseUrlTest, hrefTest);\n assertEqualUrlStringString(\n completeUrl, 'http://www.example.com/' + hrefTest, 'complete URL is not returned correctly');\n });\n\n it('uses the completeURL function to resolve a parameters href to a base URL with the parameters from the href while the base URL does not have parameters',\n () => {\n const hrefTest = '?hrefParams=t';\n const baseUrlTest = 'http://www.example.com/' as Platform.DevToolsPath.UrlString;\n const completeUrl = ParsedURL.completeURL(baseUrlTest, hrefTest);\n assertEqualUrlStringString(completeUrl, baseUrlTest + hrefTest, 'complete URL is not returned correctly');\n });\n\n it('uses the splitLineAndColumn function to return undefined line and column numbers if the URL does not contain any',\n () => {\n const stringTest = 'http://www.example.com';\n const splitResult = ParsedURL.splitLineAndColumn(stringTest);\n assert.strictEqual(splitResult.url, 'http://www.example.com', 'URL is not correct');\n assert.isUndefined(splitResult.lineNumber, 'line number is not undefined');\n assert.isUndefined(splitResult.columnNumber, 'column number is not undefined');\n });\n\n it('uses the splitLineAndColumn function to return the line number if the URL contains one', () => {\n const stringTest = 'http://www.example.com/foo.js:15';\n const splitResult = ParsedURL.splitLineAndColumn(stringTest);\n assert.strictEqual(splitResult.url, 'http://www.example.com/foo.js', 'URL is not correct');\n assert.strictEqual(splitResult.lineNumber, 14, 'line number is incorrect');\n assert.isUndefined(splitResult.columnNumber, 'column number is incorrect');\n });\n\n it('uses the splitLineAndColumn function to return the line and column numbers if the URL contains them', () => {\n const stringTest = 'http://www.example.com:15:20';\n const splitResult = ParsedURL.splitLineAndColumn(stringTest);\n assert.strictEqual(splitResult.url, 'http://www.example.com', 'URL is not correct');\n assert.strictEqual(splitResult.lineNumber, 14, 'line number is incorrect');\n assert.strictEqual(splitResult.columnNumber, 19, 'column number is incorrect');\n });\n\n it('uses the splitLineAndColumn function to return the line and column numbers if the URL contains them and has a port number',\n () => {\n const stringTest = 'http://www.example.com:8080:15:20';\n const splitResult = ParsedURL.splitLineAndColumn(stringTest);\n assert.strictEqual(splitResult.url, 'http://www.example.com:8080', 'URL is not correct');\n assert.strictEqual(splitResult.lineNumber, 14, 'line number is incorrect');\n assert.strictEqual(splitResult.columnNumber, 19, 'column number is incorrect');\n });\n\n it('uses the removeWasmFunctionInfoFromURL function to return unmodified URL if not pointing to a wasm source',\n () => {\n const stringTest = 'http://www.example.com:15:20';\n const url = ParsedURL.removeWasmFunctionInfoFromURL(stringTest);\n assert.strictEqual(url, 'http://www.example.com:15:20', 'URL is not correct');\n });\n\n it('uses the removeWasmFunctionInfoFromURL function to return the wasm unmodified URL if it points to a wasm source',\n () => {\n const stringTest = 'http://www.example.com/example.wasm:wasm-function[0]:0x3e';\n const url = ParsedURL.removeWasmFunctionInfoFromURL(stringTest);\n assert.strictEqual(url, 'http://www.example.com/example.wasm', 'URL is not correct');\n });\n\n it('uses the removeWasmFunctionInfoFromURL function to return the wasm unmodified URL if it points to a wasm source with port number',\n () => {\n const stringTest = 'http://www.example.com:8080/example.wasm:wasm-function[0]:0x3e';\n const url = ParsedURL.removeWasmFunctionInfoFromURL(stringTest);\n assert.strictEqual(url, 'http://www.example.com:8080/example.wasm', 'URL is not correct');\n });\n\n it('uses the isRelativeURL function to return true if the URL is relative', () => {\n assert.isTrue(ParsedURL.isRelativeURL('/test/path'));\n assert.isTrue(ParsedURL.isRelativeURL('C:/'));\n assert.isTrue(ParsedURL.isRelativeURL('C'));\n });\n\n it('uses the isRelativeURL function to return false if the URL is not relative', () => {\n assert.isFalse(ParsedURL.isRelativeURL('http://www.example.com/test/path'));\n assert.isFalse(ParsedURL.isRelativeURL('about:blank'));\n assert.isFalse(ParsedURL.isRelativeURL('file:///C:/'));\n });\n\n it('uses the displayName function to return the name if it exists for a URL', () => {\n const parsedUrl = new ParsedURL('http://www.example.com');\n assert.strictEqual(parsedUrl.displayName, 'www.example.com/', 'name returned is incorrect');\n });\n\n it('uses the displayName function to return the name for a data URL', () => {\n const parsedUrl = new ParsedURL('data:www.example.com');\n assert.strictEqual(parsedUrl.displayName, 'data:www.example.com', 'name returned is incorrect');\n });\n\n it('uses the displayName function to return the name for a blob URL', () => {\n const parsedUrl = new ParsedURL('blob:www.example.com');\n assert.strictEqual(parsedUrl.displayName, 'blob:www.example.com', 'name returned is incorrect');\n });\n\n it('uses the displayName function to return the name for an about:blank URL', () => {\n const parsedUrl = new ParsedURL('about:blank');\n assert.strictEqual(parsedUrl.displayName, 'about:blank', 'name returned is incorrect');\n });\n\n it('uses the displayName function to return the name for a URL with a last path component', () => {\n const parsedUrl = new ParsedURL('http://www.example.com/test');\n assert.strictEqual(parsedUrl.displayName, 'test', 'name returned is incorrect');\n });\n\n it('uses the displayName function to return the name for a a slash', () => {\n const parsedUrl = new ParsedURL('/');\n assert.strictEqual(parsedUrl.displayName, '/', 'name returned is incorrect');\n });\n\n it('uses the displayName function to return the name for a URL that already has a display name set', () => {\n const parsedUrl = new ParsedURL('http://www.example.com');\n assert.strictEqual(parsedUrl.displayName, 'www.example.com/', 'name returned is incorrect');\n assert.strictEqual(parsedUrl.displayName, 'www.example.com/', 'name returned is incorrect');\n });\n\n it('uses the dataURLDisplayName function to return data URL display name if it is not already set', () => {\n const parsedUrl = new ParsedURL('http://www.example.com');\n assert.strictEqual(parsedUrl.dataURLDisplayName(), '', 'data URL display name is returned incorrectly');\n });\n\n it('uses the dataURLDisplayName function to return data URL display name if it is already set', () => {\n const parsedUrl = new ParsedURL('data:http://www.example.com');\n assert.strictEqual(\n parsedUrl.dataURLDisplayName(), 'data:http://www.exa…', 'data URL display name is returned incorrectly');\n assert.strictEqual(\n parsedUrl.dataURLDisplayName(), 'data:http://www.exa…', 'data URL display name is returned incorrectly');\n });\n\n it('uses the lastPathComponentWithFragment function to return for a URL without a path', () => {\n const parsedUrl = new ParsedURL('http://www.example.com');\n assert.strictEqual(\n parsedUrl.lastPathComponentWithFragment(), '', 'last path component with fragmen returned is incorrect');\n });\n\n it('uses the lastPathComponentWithFragment function to return for a URL with a path', () => {\n const parsedUrl = new ParsedURL('http://www.example.com/test/path');\n assert.strictEqual(\n parsedUrl.lastPathComponentWithFragment(), 'path', 'last path component with fragmen returned is incorrect');\n });\n\n it('uses the lastPathComponentWithFragment function to return for a URL with a path and trailing slash', () => {\n const parsedUrl = new ParsedURL('http://www.example.com/test/path/');\n assert.strictEqual(\n parsedUrl.lastPathComponentWithFragment(), 'path/', 'last path component with fragmen returned is incorrect');\n });\n\n it('uses the lastPathComponentWithFragment function to return for a URL with a path and a fragment', () => {\n const parsedUrl = new ParsedURL('http://www.example.com/test/path#testFragment');\n assert.strictEqual(\n parsedUrl.lastPathComponentWithFragment(), 'path#testFragment',\n 'last path component with fragmen returned is incorrect');\n });\n\n it('returns the domain for a data URL', () => {\n const parsedUrl = new ParsedURL('data:http://www.example.com');\n assert.strictEqual(parsedUrl.domain(), 'data:', 'domain returned was incorrect');\n });\n\n it('returns the domain for an http URL without a port', () => {\n const parsedUrl = new ParsedURL('http://www.example.com');\n assert.strictEqual(parsedUrl.domain(), 'www.example.com', 'domain returned was incorrect');\n });\n\n it('returns the domain for an http URL with a port', () => {\n const parsedUrl = new ParsedURL('http://www.example.com:8080');\n assert.strictEqual(parsedUrl.domain(), 'www.example.com:8080', 'domain returned was incorrect');\n });\n\n it('returns the security origin for a data URL', () => {\n const parsedUrl = new ParsedURL('data:http://www.example.com');\n assert.strictEqual(parsedUrl.securityOrigin(), 'data:', 'security origin returned was incorrect');\n });\n\n it('returns the security origin for a blob URL', () => {\n const parsedUrl = new ParsedURL('blob:http://www.example.com');\n assert.strictEqual(parsedUrl.securityOrigin(), 'http://www.example.com', 'security origin returned was incorrect');\n });\n\n it('returns the security origin for an http URL', () => {\n const parsedUrl = new ParsedURL('http://www.example.com');\n assert.strictEqual(parsedUrl.securityOrigin(), 'http://www.example.com', 'security origin returned was incorrect');\n });\n\n it('returns the url without scheme for a URL that has a scheme', () => {\n const parsedUrl = new ParsedURL('http://www.example.com');\n assert.strictEqual(parsedUrl.urlWithoutScheme(), 'www.example.com', 'URL without scheme returned was incorrect');\n });\n\n it('returns the url without scheme for a URL that does not have a scheme', () => {\n const parsedUrl = new ParsedURL('www.example.com');\n assert.strictEqual(parsedUrl.urlWithoutScheme(), 'www.example.com', 'URL without scheme returned was incorrect');\n });\n\n it('returns the correct results for all ported web_tests unit tests', () => {\n assertEqualUrlStringString(\n ParsedURL.completeURL(\n 'http://example.com/script.js' as Platform.DevToolsPath.UrlString, 'http://example.com/map.json'),\n 'http://example.com/map.json');\n assertEqualUrlStringString(\n ParsedURL.completeURL('http://example.com/script.js' as Platform.DevToolsPath.UrlString, '/map.json'),\n 'http://example.com/map.json');\n assertEqualUrlStringString(\n ParsedURL.completeURL(\n 'http://example.com/scripts/script.js' as Platform.DevToolsPath.UrlString, '../maps/map.json'),\n 'http://example.com/maps/map.json');\n\n const baseURL = 'http://a/b/c/d;p?q' as Platform.DevToolsPath.UrlString;\n\n assertEqualUrlStringString(ParsedURL.completeURL(baseURL, 'http://h'),\n 'http://h/'); // modified from RFC3986\n assertEqualUrlStringString(ParsedURL.completeURL(baseURL, 'g'), 'http://a/b/c/g');\n assertEqualUrlStringString(ParsedURL.completeURL(baseURL, './g'), 'http://a/b/c/g');\n assertEqualUrlStringString(ParsedURL.completeURL(baseURL, 'g/'), 'http://a/b/c/g/');\n assertEqualUrlStringString(ParsedURL.completeURL(baseURL, '/g'), 'http://a/g');\n assertEqualUrlStringString(ParsedURL.completeURL(baseURL, '//g'), 'http://g');\n assertEqualUrlStringString(ParsedURL.completeURL(baseURL, '?y'), 'http://a/b/c/d;p?y');\n assertEqualUrlStringString(ParsedURL.completeURL(baseURL, 'g?y'), 'http://a/b/c/g?y');\n assertEqualUrlStringString(ParsedURL.completeURL(baseURL, '#s'), 'http://a/b/c/d;p?q#s');\n assertEqualUrlStringString(ParsedURL.completeURL(baseURL, 'g#s'), 'http://a/b/c/g#s');\n assertEqualUrlStringString(ParsedURL.completeURL(baseURL, 'g?y#s'), 'http://a/b/c/g?y#s');\n assertEqualUrlStringString(ParsedURL.completeURL(baseURL, ';x'), 'http://a/b/c/;x');\n assertEqualUrlStringString(ParsedURL.completeURL(baseURL, 'g;x'), 'http://a/b/c/g;x');\n assertEqualUrlStringString(ParsedURL.completeURL(baseURL, 'g;x?y#s'), 'http://a/b/c/g;x?y#s');\n assertEqualUrlStringString(ParsedURL.completeURL(baseURL, 'g;x=1/./y'), 'http://a/b/c/g;x=1/y');\n assertEqualUrlStringString(ParsedURL.completeURL(baseURL, 'g;x=1/../y'), 'http://a/b/c/y');\n assertEqualUrlStringString(ParsedURL.completeURL(baseURL, 'g?y/./x'), 'http://a/b/c/g?y/./x');\n assertEqualUrlStringString(ParsedURL.completeURL(baseURL, 'g?y/../x'), 'http://a/b/c/g?y/../x');\n assertEqualUrlStringString(ParsedURL.completeURL(baseURL, 'g#s/./x'), 'http://a/b/c/g#s/./x');\n assertEqualUrlStringString(ParsedURL.completeURL(baseURL, 'g#s/../x'), 'http://a/b/c/g#s/../x');\n\n assertEqualUrlStringString(\n ParsedURL.completeURL('http://a/b/c/d;p?q' as Platform.DevToolsPath.UrlString, '//secure.com/moo'),\n 'http://secure.com/moo');\n assertEqualUrlStringString(\n ParsedURL.completeURL('http://a/b/c/d;p?q' as Platform.DevToolsPath.UrlString, 'cat.jpeg'),\n 'http://a/b/c/cat.jpeg');\n assertEqualUrlStringString(\n ParsedURL.completeURL('http://example.com/path.css?query#fragment' as Platform.DevToolsPath.UrlString, ''),\n 'http://example.com/path.css?query');\n });\n\n it('encodes partial path', () => {\n const pathTest = 'path/with%20escape/and spaces' as Platform.DevToolsPath.RawPathString;\n const encodedPath = 'path/with%2520escape/and%20spaces';\n const convertedPath = ParsedURL.rawPathToEncodedPathString(pathTest);\n assert.strictEqual(convertedPath, encodedPath, 'path was not converted successfully');\n });\n\n it('decodes partial path', () => {\n const pathTest = 'path/with%20escape/and spaces';\n const encodedPath = 'path/with%2520escape/and%20spaces' as Platform.DevToolsPath.EncodedPathString;\n const convertedPath = ParsedURL.encodedPathToRawPathString(encodedPath);\n assert.strictEqual(convertedPath, pathTest, 'path was not converted successfully');\n });\n\n it('encodes, decodes partial path with email address', () => {\n const pathTest = 'username:password@example.com' as Platform.DevToolsPath.RawPathString; // valid filename on unix\n const encodedPath = ParsedURL.rawPathToEncodedPathString(pathTest);\n assert.strictEqual(pathTest, encodedPath as string, 'changed during escaping');\n const convertedPath = ParsedURL.encodedPathToRawPathString(encodedPath);\n assert.strictEqual(convertedPath, pathTest, 'path was not converted successfully');\n });\n\n it('encodes, decodes partial path', () => {\n const pathTest = 'C:/Program%20Files/Google' as Platform.DevToolsPath.RawPathString;\n const encodedPath = ParsedURL.rawPathToEncodedPathString(pathTest);\n const convertedPath = ParsedURL.encodedPathToRawPathString(encodedPath);\n assert.strictEqual(convertedPath, pathTest, 'path was not converted successfully');\n });\n\n it('encodes, decodes partial path with whitespace', () => {\n const pathTest = 'C:/Program Files/Google' as Platform.DevToolsPath.RawPathString;\n const encodedPath = ParsedURL.rawPathToEncodedPathString(pathTest);\n const convertedPath = ParsedURL.encodedPathToRawPathString(encodedPath);\n assert.strictEqual(convertedPath, pathTest, 'path was not converted successfully');\n });\n\n it('encodes, decodes absolute path', () => {\n const pathTest = '/C:/Program%20Files/Google' as Platform.DevToolsPath.RawPathString;\n const encodedPath = ParsedURL.rawPathToEncodedPathString(pathTest);\n const convertedPath = ParsedURL.encodedPathToRawPathString(encodedPath);\n assert.strictEqual(convertedPath, pathTest, 'path was not converted successfully');\n });\n\n it('encodes, decodes absolute path with whitespace', () => {\n const pathTest = '/C:/Program Files/Google' as Platform.DevToolsPath.RawPathString;\n const encodedPath = ParsedURL.rawPathToEncodedPathString(pathTest);\n const convertedPath = ParsedURL.encodedPathToRawPathString(encodedPath);\n assert.strictEqual(convertedPath, pathTest, 'path was not converted successfully');\n });\n\n it('converts relative platform path and base URL to URL', () => {\n const baseUrl = 'http://localhost:8080/my%20folder/old%20path' as Platform.DevToolsPath.UrlString;\n const relativePath = 'new spaced%20name' as Platform.DevToolsPath.RawPathString;\n const convertedUrl = ParsedURL.relativePathToUrlString(relativePath, baseUrl);\n assert.strictEqual(convertedUrl, 'http://localhost:8080/my%20folder/new%20spaced%2520name');\n });\n\n it('converts URL to a platform path that includes drive letter and spaces on Windows', () => {\n const urlTest = 'file:///C:/Program%20Files/Google' as Platform.DevToolsPath.UrlString;\n const convertedUrl = ParsedURL.urlToRawPathString(urlTest, true);\n assert.strictEqual(convertedUrl, 'C:\\\\Program Files\\\\Google', 'URL was not converted successfully');\n });\n\n it('converts URL to a platform path that includes spaces and percents', () => {\n const urlTest = 'file:///home/user/with%20space/with%2520escape' as Platform.DevToolsPath.UrlString;\n const convertedUrl = ParsedURL.urlToRawPathString(urlTest, false);\n assert.strictEqual(convertedUrl, '/home/user/with space/with%20escape', 'URL was not converted successfully');\n });\n\n it('converts Windows platform path with spaces and percents to file url', () => {\n const urlTest = 'C:\\\\Program Files\\\\with%20escape' as Platform.DevToolsPath.RawPathString;\n const convertedUrl = ParsedURL.rawPathToUrlString(urlTest);\n assert.strictEqual(\n convertedUrl, 'file:///C:/Program%20Files/with%2520escape', 'URL was not converted successfully');\n });\n\n it('converts platform path with variety of special characters to URL and back consistently with Chrome', () => {\n const platformPathTest =\n '/home/a:b@c(d, e+f)=&g;#h$' as Platform.DevToolsPath.RawPathString; // Valid filename on unix\n const urlTest = 'file:///home/a:b@c(d,%20e+f)=&g%3B%23h$' as\n Platform.DevToolsPath.UrlString; // URL in Chrome address bar if you open that file\n assert.strictEqual(ParsedURL.rawPathToUrlString(platformPathTest), urlTest);\n assert.strictEqual(ParsedURL.urlToRawPathString(urlTest), platformPathTest);\n });\n});\n"]} \ No newline at end of file diff --git a/public/core/common/Progress.test.js b/public/core/common/Progress.test.js index ac6299f14..6dc8d61f3 100644 --- a/public/core/common/Progress.test.js +++ b/public/core/common/Progress.test.js @@ -49,7 +49,7 @@ describe('Composite Progress Bar', () => { const indicator = new MockProgressIndicator(); const composite = new CompositeProgress(indicator); const subProgress = composite.createSubProgress(); - assert.strictEqual(indicator.getTitle, undefined); + assert.isUndefined(indicator.getTitle); assert.strictEqual(indicator.getWorkCompleted, 0); assert.strictEqual(indicator.getTotalWork, 1); subProgress.setTitle('cuckooing'); @@ -77,7 +77,7 @@ describe('Composite Progress Bar', () => { const subProgress1 = composite.createSubProgress(); // Creates a sub progress with the weight of 3 const subProgress2 = composite.createSubProgress(3); - assert.strictEqual(indicator.getTitle, undefined); + assert.isUndefined(indicator.getTitle); assert.strictEqual(indicator.getWorkCompleted, 0); assert.strictEqual(indicator.getTotalWork, 1); subProgress1.setTitle('cuckooing'); @@ -123,15 +123,15 @@ describe('Composite Progress Bar', () => { const subProgress01 = composite0.createSubProgress(); const composite1 = new CompositeProgress(subProgress01); const subProgress11 = composite1.createSubProgress(10); // Weight should have no effect - assert.strictEqual(indicator.getTitle, undefined); + assert.isUndefined(indicator.getTitle); assert.strictEqual(indicator.getWorkCompleted, 0); assert.strictEqual(indicator.getTotalWork, 1); subProgress11.setWorked(10); - assert.strictEqual(indicator.getTitle, undefined); + assert.isUndefined(indicator.getTitle); assert.strictEqual(indicator.getWorkCompleted, 0); assert.strictEqual(indicator.getTotalWork, 1); subProgress11.setTotalWork(100); - assert.strictEqual(indicator.getTitle, undefined); + assert.isUndefined(indicator.getTitle); assert.strictEqual(indicator.getWorkCompleted, 0.1); assert.strictEqual(indicator.getTotalWork, 1); subProgress11.setWorked(50, 'meowing'); @@ -150,12 +150,12 @@ describe('Composite Progress Bar', () => { const indicator = new MockProgressIndicator(); const composite = new CompositeProgress(indicator); const subProgress = composite.createSubProgress(); - assert.strictEqual(indicator.getTitle, undefined); + assert.isUndefined(indicator.getTitle); assert.strictEqual(indicator.getWorkCompleted, 0); assert.strictEqual(indicator.getTotalWork, 1); assert.strictEqual(subProgress.getWorked(), 0); subProgress.incrementWorked(); - assert.strictEqual(indicator.getTitle, undefined); + assert.isUndefined(indicator.getTitle); assert.strictEqual(indicator.getWorkCompleted, 0); assert.strictEqual(indicator.getTotalWork, 1); assert.strictEqual(subProgress.getWorked(), 1); diff --git a/public/core/common/Progress.test.js.map b/public/core/common/Progress.test.js.map index 19181a774..7c19d0b94 100644 --- a/public/core/common/Progress.test.js.map +++ b/public/core/common/Progress.test.js.map @@ -1 +1 @@ -{"version":3,"file":"Progress.test.js","sourceRoot":"","sources":["../../../../../../front_end/core/common/Progress.test.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,KAAK,MAAM,MAAM,aAAa,CAAC;AAEtC,MAAM,iBAAiB,GAAG,MAAM,CAAC,QAAQ,CAAC,iBAAiB,CAAC;AAC5D,MAAM,aAAa,GAAG,MAAM,CAAC,QAAQ,CAAC,aAAa,CAAC;AAEpD,MAAM,qBAAqB;IACjB,kBAAkB,GAAG,KAAK,CAAC;IAC3B,SAAS,GAAG,CAAC,CAAC;IACd,aAAa,GAAG,CAAC,CAAC;IAClB,KAAK,CAAoB;IAEjC,IAAI,QAAQ;QACV,OAAO,IAAI,CAAC,KAAK,CAAC;IACpB,CAAC;IAED,IAAI,gBAAgB;QAClB,OAAO,IAAI,CAAC,aAAa,CAAC;IAC5B,CAAC;IAED,IAAI,YAAY;QACd,OAAO,IAAI,CAAC,SAAS,CAAC;IACxB,CAAC;IAED,UAAU;QACR,OAAO,IAAI,CAAC,kBAAkB,CAAC;IACjC,CAAC;IAED,IAAI;QACF,OAAO,0BAA0B,CAAC;IACpC,CAAC;IAED,YAAY,CAAC,SAAiB;QAC5B,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;IAC7B,CAAC;IAED,SAAS,CAAC,MAAc,EAAE,KAAa;QACrC,IAAI,CAAC,aAAa,GAAG,MAAM,CAAC;QAC5B,IAAI,OAAO,KAAK,KAAK,WAAW,EAAE,CAAC;YACjC,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACrB,CAAC;IACH,CAAC;IAED,QAAQ,CAAC,KAAa;QACpB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACrB,CAAC;IAED,eAAe,CAAC,MAAc;QAC5B,IAAI,CAAC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AC;QACnD,MAAM,WAAW,GAAG,SAAS,CAAC,iBAAiB,EAAE,CAAC;QAClD,MAAM,aAAa,GAAG,IAAI,aAAa,CAAC,WAAW,CAAC,CAAC;QAErD,aAAa,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC;QACjC,MAAM,CAAC,WAAW,CAAC,WAAW,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC,CAAC;IACjD,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["// Copyright 2019 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport * as Common from './common.js';\n\nconst CompositeProgress = Common.Progress.CompositeProgress;\nconst ProgressProxy = Common.Progress.ProgressProxy;\n\nclass MockProgressIndicator implements Common.Progress.Progress {\n private isCanceledInternal = false;\n private totalWork = 0;\n private workCompleted = 0;\n private title!: string|undefined;\n\n get getTitle(): string|undefined {\n return this.title;\n }\n\n get getWorkCompleted(): number {\n return this.workCompleted;\n }\n\n get getTotalWork(): number {\n return this.totalWork;\n }\n\n isCanceled() {\n return this.isCanceledInternal;\n }\n\n done() {\n return 'progress indicator: done';\n }\n\n setTotalWork(totalWork: number) {\n this.totalWork = totalWork;\n }\n\n setWorked(worked: number, title: string) {\n this.workCompleted = worked;\n if (typeof title !== 'undefined') {\n this.title = title;\n }\n }\n\n setTitle(title: string) {\n this.title = title;\n }\n\n incrementWorked(worked: number) {\n this.totalWork += worked;\n }\n\n // Test methods.\n cancel() {\n this.isCanceledInternal = true;\n }\n}\n\ndescribe('Composite Progress Bar', () => {\n it('works correctly with a single subprogress', () => {\n const indicator = new MockProgressIndicator();\n const composite = new CompositeProgress(indicator);\n const subProgress = composite.createSubProgress();\n\n assert.strictEqual(indicator.getTitle, undefined);\n assert.strictEqual(indicator.getWorkCompleted, 0);\n assert.strictEqual(indicator.getTotalWork, 1);\n\n subProgress.setTitle('cuckooing');\n subProgress.setWorked(10);\n assert.strictEqual(indicator.getTitle, 'cuckooing');\n assert.strictEqual(indicator.getWorkCompleted, 0);\n assert.strictEqual(indicator.getTotalWork, 1);\n\n subProgress.setTotalWork(100);\n assert.strictEqual(indicator.getTitle, 'cuckooing');\n assert.strictEqual(indicator.getWorkCompleted, 0.1);\n assert.strictEqual(indicator.getTotalWork, 1);\n\n subProgress.setWorked(20, 'meowing');\n assert.strictEqual(indicator.getTitle, 'meowing');\n assert.strictEqual(indicator.getWorkCompleted, 0.2);\n assert.strictEqual(indicator.getTotalWork, 1);\n\n subProgress.done();\n assert.strictEqual(indicator.getTitle, 'meowing');\n assert.strictEqual(indicator.getWorkCompleted, 1);\n assert.strictEqual(indicator.getTotalWork, 1);\n });\n\n it('works correctly with multiple subprogresses', () => {\n const indicator = new MockProgressIndicator();\n const composite = new CompositeProgress(indicator);\n // Creates a sub progress with the default weight of 1\n const subProgress1 = composite.createSubProgress();\n // Creates a sub progress with the weight of 3\n const subProgress2 = composite.createSubProgress(3);\n\n assert.strictEqual(indicator.getTitle, undefined);\n assert.strictEqual(indicator.getWorkCompleted, 0);\n assert.strictEqual(indicator.getTotalWork, 1);\n\n subProgress1.setTitle('cuckooing');\n subProgress1.setTotalWork(100);\n subProgress1.setWorked(20);\n assert.strictEqual(indicator.getTitle, 'cuckooing');\n assert.strictEqual(indicator.getWorkCompleted, 0.05);\n assert.strictEqual(indicator.getTotalWork, 1);\n\n subProgress2.setWorked(10);\n assert.strictEqual(indicator.getTitle, 'cuckooing');\n assert.strictEqual(indicator.getWorkCompleted, 0.05);\n assert.strictEqual(indicator.getTotalWork, 1);\n\n subProgress2.setTotalWork(10);\n subProgress2.setWorked(3, 'barking');\n assert.strictEqual(indicator.getTitle, 'barking');\n assert.strictEqual(indicator.getWorkCompleted, 0.275);\n assert.strictEqual(indicator.getTotalWork, 1);\n\n subProgress1.setWorked(50, 'meowing');\n subProgress2.setWorked(5);\n assert.strictEqual(indicator.getTitle, 'meowing');\n assert.strictEqual(indicator.getWorkCompleted, 0.5);\n assert.strictEqual(indicator.getTotalWork, 1);\n\n subProgress2.done();\n assert.strictEqual(indicator.getTitle, 'meowing');\n assert.strictEqual(indicator.getWorkCompleted, 0.875);\n assert.strictEqual(indicator.getTotalWork, 1);\n\n subProgress1.done();\n assert.strictEqual(indicator.getTitle, 'meowing');\n assert.strictEqual(indicator.getWorkCompleted, 1);\n assert.strictEqual(indicator.getTotalWork, 1);\n });\n\n it('returns the correct cancellation status', () => {\n const indicator = new MockProgressIndicator();\n const composite = new CompositeProgress(indicator);\n const subProgress = composite.createSubProgress();\n\n assert.isFalse(subProgress.isCanceled(), 'progress should not be canceled');\n indicator.cancel();\n assert.isTrue(subProgress.isCanceled(), 'progress should be canceled');\n });\n\n it('works correctly with nested subprogresses', () => {\n const indicator = new MockProgressIndicator();\n const composite0 = new CompositeProgress(indicator);\n const subProgress01 = composite0.createSubProgress();\n const composite1 = new CompositeProgress(subProgress01);\n const subProgress11 = composite1.createSubProgress(10); // Weight should have no effect\n\n assert.strictEqual(indicator.getTitle, undefined);\n assert.strictEqual(indicator.getWorkCompleted, 0);\n assert.strictEqual(indicator.getTotalWork, 1);\n\n subProgress11.setWorked(10);\n assert.strictEqual(indicator.getTitle, undefined);\n assert.strictEqual(indicator.getWorkCompleted, 0);\n assert.strictEqual(indicator.getTotalWork, 1);\n\n subProgress11.setTotalWork(100);\n assert.strictEqual(indicator.getTitle, undefined);\n assert.strictEqual(indicator.getWorkCompleted, 0.1);\n assert.strictEqual(indicator.getTotalWork, 1);\n\n subProgress11.setWorked(50, 'meowing');\n assert.strictEqual(indicator.getTitle, 'meowing');\n assert.strictEqual(indicator.getWorkCompleted, 0.5);\n assert.strictEqual(indicator.getTotalWork, 1);\n\n assert.isFalse(subProgress11.isCanceled(), 'progress should not be canceled');\n indicator.cancel();\n assert.isTrue(subProgress11.isCanceled(), 'progress should be canceled');\n\n subProgress11.done();\n assert.strictEqual(indicator.getTitle, 'meowing');\n assert.strictEqual(indicator.getWorkCompleted, 1);\n assert.strictEqual(indicator.getTotalWork, 1);\n });\n\n it('can set sub progress to be worked', () => {\n const indicator = new MockProgressIndicator();\n const composite = new CompositeProgress(indicator);\n const subProgress = composite.createSubProgress();\n\n assert.strictEqual(indicator.getTitle, undefined);\n assert.strictEqual(indicator.getWorkCompleted, 0);\n assert.strictEqual(indicator.getTotalWork, 1);\n assert.strictEqual(subProgress.getWorked(), 0);\n\n subProgress.incrementWorked();\n\n assert.strictEqual(indicator.getTitle, undefined);\n assert.strictEqual(indicator.getWorkCompleted, 0);\n assert.strictEqual(indicator.getTotalWork, 1);\n assert.strictEqual(subProgress.getWorked(), 1);\n });\n\n it('returns the correct cancellation status for a progress proxy with no delegate', () => {\n const progressProxy = new ProgressProxy();\n assert.isFalse(progressProxy.isCanceled());\n });\n\n it('returns the correct cancellation status for a progress proxy with delegate', () => {\n const indicator = new MockProgressIndicator();\n const composite = new CompositeProgress(indicator);\n const subProgress = composite.createSubProgress();\n const progressProxy = new ProgressProxy(subProgress);\n\n assert.isFalse(progressProxy.isCanceled(), 'progress should not be canceled');\n indicator.cancel();\n assert.isTrue(progressProxy.isCanceled(), 'progress should be canceled');\n });\n\n it('returns the correct title for a progress proxy with no delegate', () => {\n const indicator = new MockProgressIndicator();\n const progressProxy = new ProgressProxy();\n\n progressProxy.setTitle('test proxy');\n assert.isUndefined(indicator.getTitle);\n });\n\n it('returns the correct title for a progress proxy with delegate', () => {\n const indicator = new MockProgressIndicator();\n const composite = new CompositeProgress(indicator);\n const subProgress = composite.createSubProgress();\n const progressProxy = new ProgressProxy(subProgress);\n\n progressProxy.setTitle('test proxy');\n assert.strictEqual(indicator.getTitle, 'test proxy');\n });\n\n it('marks a progress proxy as done', () => {\n const indicator = new MockProgressIndicator();\n const composite = new CompositeProgress(indicator);\n const subProgress = composite.createSubProgress();\n const progressProxy = new ProgressProxy(subProgress);\n\n progressProxy.setTotalWork(1);\n progressProxy.done();\n assert.strictEqual(subProgress.getWorked(), 1);\n });\n\n it('able to set worked with title for a progress proxy', () => {\n const indicator = new MockProgressIndicator();\n const composite = new CompositeProgress(indicator);\n const subProgress = composite.createSubProgress();\n const progressProxy = new ProgressProxy(subProgress);\n\n progressProxy.setWorked(1, 'test proxy');\n assert.strictEqual(subProgress.getWorked(), 1);\n assert.strictEqual(indicator.getTitle, 'test proxy');\n });\n\n it('able to set worked without title for a progress proxy', () => {\n const indicator = new MockProgressIndicator();\n const composite = new CompositeProgress(indicator);\n const subProgress = composite.createSubProgress();\n const progressProxy = new ProgressProxy(subProgress);\n\n progressProxy.incrementWorked(1);\n assert.strictEqual(subProgress.getWorked(), 1);\n });\n});\n"]} \ No newline at end of file +{"version":3,"file":"Progress.test.js","sourceRoot":"","sources":["../../../../../../front_end/core/common/Progress.test.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,KAAK,MAAM,MAAM,aAAa,CAAC;AAEtC,MAAM,iBAAiB,GAAG,MAAM,CAAC,QAAQ,CAAC,iBAAiB,CAAC;AAC5D,MAAM,aAAa,GAAG,MAAM,CAAC,QAAQ,CAAC,aAAa,CAAC;AAEpD,MAAM,qBAAqB;IACjB,kBAAkB,GAAG,KAAK,CAAC;IAC3B,SAAS,GAAG,CAAC,CAAC;IACd,aAAa,GAAG,CAAC,CAAC;IAClB,KAAK,CAAoB;IAEjC,IAAI,QAAQ;QACV,OAAO,IAAI,CAAC,KAAK,CAAC;IACpB,CAAC;IAED,IAAI,gBAAgB;QAClB,OAAO,IAAI,CAAC,aAAa,CAAC;IAC5B,CAAC;IAED,IAAI,YAAY;QACd,OAAO,IAAI,CAAC,SAAS,CAAC;IACxB,CAAC;IAED,UAAU;QACR,OAAO,IAAI,CAAC,kBAAkB,CAAC;IACjC,CAAC;IAED,IAAI;QACF,OAAO,0BAA0B,CAAC;IACpC,CAAC;IAED,YAAY,CAAC,SAAiB;QAC5B,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;IAC7B,CAAC;IAED,SAAS,CAAC,MAAc,EAAE,KA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Y,CAAC,CAAC;IACvD,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,uDAAuD,EAAE,GAAG,EAAE;QAC/D,MAAM,SAAS,GAAG,IAAI,qBAAqB,EAAE,CAAC;QAC9C,MAAM,SAAS,GAAG,IAAI,iBAAiB,CAAC,SAAS,CAAC,CAAC;QACnD,MAAM,WAAW,GAAG,SAAS,CAAC,iBAAiB,EAAE,CAAC;QAClD,MAAM,aAAa,GAAG,IAAI,aAAa,CAAC,WAAW,CAAC,CAAC;QAErD,aAAa,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC;QACjC,MAAM,CAAC,WAAW,CAAC,WAAW,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC,CAAC;IACjD,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["// Copyright 2019 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport * as Common from './common.js';\n\nconst CompositeProgress = Common.Progress.CompositeProgress;\nconst ProgressProxy = Common.Progress.ProgressProxy;\n\nclass MockProgressIndicator implements Common.Progress.Progress {\n private isCanceledInternal = false;\n private totalWork = 0;\n private workCompleted = 0;\n private title!: string|undefined;\n\n get getTitle(): string|undefined {\n return this.title;\n }\n\n get getWorkCompleted(): number {\n return this.workCompleted;\n }\n\n get getTotalWork(): number {\n return this.totalWork;\n }\n\n isCanceled() {\n return this.isCanceledInternal;\n }\n\n done() {\n return 'progress indicator: done';\n }\n\n setTotalWork(totalWork: number) {\n this.totalWork = totalWork;\n }\n\n setWorked(worked: number, title: string) {\n this.workCompleted = worked;\n if (typeof title !== 'undefined') {\n this.title = title;\n }\n }\n\n setTitle(title: string) {\n this.title = title;\n }\n\n incrementWorked(worked: number) {\n this.totalWork += worked;\n }\n\n // Test methods.\n cancel() {\n this.isCanceledInternal = true;\n }\n}\n\ndescribe('Composite Progress Bar', () => {\n it('works correctly with a single subprogress', () => {\n const indicator = new MockProgressIndicator();\n const composite = new CompositeProgress(indicator);\n const subProgress = composite.createSubProgress();\n\n assert.isUndefined(indicator.getTitle);\n assert.strictEqual(indicator.getWorkCompleted, 0);\n assert.strictEqual(indicator.getTotalWork, 1);\n\n subProgress.setTitle('cuckooing');\n subProgress.setWorked(10);\n assert.strictEqual(indicator.getTitle, 'cuckooing');\n assert.strictEqual(indicator.getWorkCompleted, 0);\n assert.strictEqual(indicator.getTotalWork, 1);\n\n subProgress.setTotalWork(100);\n assert.strictEqual(indicator.getTitle, 'cuckooing');\n assert.strictEqual(indicator.getWorkCompleted, 0.1);\n assert.strictEqual(indicator.getTotalWork, 1);\n\n subProgress.setWorked(20, 'meowing');\n assert.strictEqual(indicator.getTitle, 'meowing');\n assert.strictEqual(indicator.getWorkCompleted, 0.2);\n assert.strictEqual(indicator.getTotalWork, 1);\n\n subProgress.done();\n assert.strictEqual(indicator.getTitle, 'meowing');\n assert.strictEqual(indicator.getWorkCompleted, 1);\n assert.strictEqual(indicator.getTotalWork, 1);\n });\n\n it('works correctly with multiple subprogresses', () => {\n const indicator = new MockProgressIndicator();\n const composite = new CompositeProgress(indicator);\n // Creates a sub progress with the default weight of 1\n const subProgress1 = composite.createSubProgress();\n // Creates a sub progress with the weight of 3\n const subProgress2 = composite.createSubProgress(3);\n\n assert.isUndefined(indicator.getTitle);\n assert.strictEqual(indicator.getWorkCompleted, 0);\n assert.strictEqual(indicator.getTotalWork, 1);\n\n subProgress1.setTitle('cuckooing');\n subProgress1.setTotalWork(100);\n subProgress1.setWorked(20);\n assert.strictEqual(indicator.getTitle, 'cuckooing');\n assert.strictEqual(indicator.getWorkCompleted, 0.05);\n assert.strictEqual(indicator.getTotalWork, 1);\n\n subProgress2.setWorked(10);\n assert.strictEqual(indicator.getTitle, 'cuckooing');\n assert.strictEqual(indicator.getWorkCompleted, 0.05);\n assert.strictEqual(indicator.getTotalWork, 1);\n\n subProgress2.setTotalWork(10);\n subProgress2.setWorked(3, 'barking');\n assert.strictEqual(indicator.getTitle, 'barking');\n assert.strictEqual(indicator.getWorkCompleted, 0.275);\n assert.strictEqual(indicator.getTotalWork, 1);\n\n subProgress1.setWorked(50, 'meowing');\n subProgress2.setWorked(5);\n assert.strictEqual(indicator.getTitle, 'meowing');\n assert.strictEqual(indicator.getWorkCompleted, 0.5);\n assert.strictEqual(indicator.getTotalWork, 1);\n\n subProgress2.done();\n assert.strictEqual(indicator.getTitle, 'meowing');\n assert.strictEqual(indicator.getWorkCompleted, 0.875);\n assert.strictEqual(indicator.getTotalWork, 1);\n\n subProgress1.done();\n assert.strictEqual(indicator.getTitle, 'meowing');\n assert.strictEqual(indicator.getWorkCompleted, 1);\n assert.strictEqual(indicator.getTotalWork, 1);\n });\n\n it('returns the correct cancellation status', () => {\n const indicator = new MockProgressIndicator();\n const composite = new CompositeProgress(indicator);\n const subProgress = composite.createSubProgress();\n\n assert.isFalse(subProgress.isCanceled(), 'progress should not be canceled');\n indicator.cancel();\n assert.isTrue(subProgress.isCanceled(), 'progress should be canceled');\n });\n\n it('works correctly with nested subprogresses', () => {\n const indicator = new MockProgressIndicator();\n const composite0 = new CompositeProgress(indicator);\n const subProgress01 = composite0.createSubProgress();\n const composite1 = new CompositeProgress(subProgress01);\n const subProgress11 = composite1.createSubProgress(10); // Weight should have no effect\n\n assert.isUndefined(indicator.getTitle);\n assert.strictEqual(indicator.getWorkCompleted, 0);\n assert.strictEqual(indicator.getTotalWork, 1);\n\n subProgress11.setWorked(10);\n assert.isUndefined(indicator.getTitle);\n assert.strictEqual(indicator.getWorkCompleted, 0);\n assert.strictEqual(indicator.getTotalWork, 1);\n\n subProgress11.setTotalWork(100);\n assert.isUndefined(indicator.getTitle);\n assert.strictEqual(indicator.getWorkCompleted, 0.1);\n assert.strictEqual(indicator.getTotalWork, 1);\n\n subProgress11.setWorked(50, 'meowing');\n assert.strictEqual(indicator.getTitle, 'meowing');\n assert.strictEqual(indicator.getWorkCompleted, 0.5);\n assert.strictEqual(indicator.getTotalWork, 1);\n\n assert.isFalse(subProgress11.isCanceled(), 'progress should not be canceled');\n indicator.cancel();\n assert.isTrue(subProgress11.isCanceled(), 'progress should be canceled');\n\n subProgress11.done();\n assert.strictEqual(indicator.getTitle, 'meowing');\n assert.strictEqual(indicator.getWorkCompleted, 1);\n assert.strictEqual(indicator.getTotalWork, 1);\n });\n\n it('can set sub progress to be worked', () => {\n const indicator = new MockProgressIndicator();\n const composite = new CompositeProgress(indicator);\n const subProgress = composite.createSubProgress();\n\n assert.isUndefined(indicator.getTitle);\n assert.strictEqual(indicator.getWorkCompleted, 0);\n assert.strictEqual(indicator.getTotalWork, 1);\n assert.strictEqual(subProgress.getWorked(), 0);\n\n subProgress.incrementWorked();\n\n assert.isUndefined(indicator.getTitle);\n assert.strictEqual(indicator.getWorkCompleted, 0);\n assert.strictEqual(indicator.getTotalWork, 1);\n assert.strictEqual(subProgress.getWorked(), 1);\n });\n\n it('returns the correct cancellation status for a progress proxy with no delegate', () => {\n const progressProxy = new ProgressProxy();\n assert.isFalse(progressProxy.isCanceled());\n });\n\n it('returns the correct cancellation status for a progress proxy with delegate', () => {\n const indicator = new MockProgressIndicator();\n const composite = new CompositeProgress(indicator);\n const subProgress = composite.createSubProgress();\n const progressProxy = new ProgressProxy(subProgress);\n\n assert.isFalse(progressProxy.isCanceled(), 'progress should not be canceled');\n indicator.cancel();\n assert.isTrue(progressProxy.isCanceled(), 'progress should be canceled');\n });\n\n it('returns the correct title for a progress proxy with no delegate', () => {\n const indicator = new MockProgressIndicator();\n const progressProxy = new ProgressProxy();\n\n progressProxy.setTitle('test proxy');\n assert.isUndefined(indicator.getTitle);\n });\n\n it('returns the correct title for a progress proxy with delegate', () => {\n const indicator = new MockProgressIndicator();\n const composite = new CompositeProgress(indicator);\n const subProgress = composite.createSubProgress();\n const progressProxy = new ProgressProxy(subProgress);\n\n progressProxy.setTitle('test proxy');\n assert.strictEqual(indicator.getTitle, 'test proxy');\n });\n\n it('marks a progress proxy as done', () => {\n const indicator = new MockProgressIndicator();\n const composite = new CompositeProgress(indicator);\n const subProgress = composite.createSubProgress();\n const progressProxy = new ProgressProxy(subProgress);\n\n progressProxy.setTotalWork(1);\n progressProxy.done();\n assert.strictEqual(subProgress.getWorked(), 1);\n });\n\n it('able to set worked with title for a progress proxy', () => {\n const indicator = new MockProgressIndicator();\n const composite = new CompositeProgress(indicator);\n const subProgress = composite.createSubProgress();\n const progressProxy = new ProgressProxy(subProgress);\n\n progressProxy.setWorked(1, 'test proxy');\n assert.strictEqual(subProgress.getWorked(), 1);\n assert.strictEqual(indicator.getTitle, 'test proxy');\n });\n\n it('able to set worked without title for a progress proxy', () => {\n const indicator = new MockProgressIndicator();\n const composite = new CompositeProgress(indicator);\n const subProgress = composite.createSubProgress();\n const progressProxy = new ProgressProxy(subProgress);\n\n progressProxy.incrementWorked(1);\n assert.strictEqual(subProgress.getWorked(), 1);\n });\n});\n"]} \ No newline at end of file diff --git a/public/core/common/ResolverBase.test.js b/public/core/common/ResolverBase.test.js index 1ba1768de..ff8bdd01a 100644 --- a/public/core/common/ResolverBase.test.js +++ b/public/core/common/ResolverBase.test.js @@ -50,14 +50,14 @@ describe('ResolverBase', () => { throw new Error('This should not get called'); }); resolver.assertIsListening(); - assert.strictEqual(obj, null); + assert.isNull(obj); resolver.clear(); }); it('should resolve a previously unknown object when it becomes available', async () => { const resolver = new ResolverTestImpl(); const waitForCall = new Promise(resolve => { const obj = resolver.tryGet(id, resolve); - assert.strictEqual(obj, null); + assert.isNull(obj); }); resolver.assertIsListening(); resolver.onResolve(id, testObj); diff --git a/public/core/common/ResolverBase.test.js.map b/public/core/common/ResolverBase.test.js.map index 424ca6c11..ea410b92f 100644 --- a/public/core/common/ResolverBase.test.js.map +++ b/public/core/common/ResolverBase.test.js.map @@ -1 +1 @@ -{"version":3,"file":"ResolverBase.test.js","sourceRoot":"","sources":["../../../../../../front_end/core/common/ResolverBase.test.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,KAAK,MA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GAAG,GAAG,MAAM,UAAU,CAAC;YAC7B,QAAQ,CAAC,oBAAoB,EAAE,CAAC;YAChC,MAAM,CAAC,WAAW,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;QAC/B,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["// Copyright 2021 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport * as Common from './common.js';\n\nclass TestClass {}\n\nexport class ResolverTestImpl extends Common.ResolverBase.ResolverBase {\n items = new Map();\n currentlyListening = false;\n\n constructor(id?: string, obj?: TestClass) {\n super();\n if (id !== undefined && obj !== undefined) {\n this.items.set(id, obj);\n }\n }\n\n protected getForId(id: string): TestClass|null {\n return this.items.get(id) || null;\n }\n\n protected override startListening(): void {\n this.currentlyListening = true;\n }\n\n protected override stopListening(): void {\n this.currentlyListening = false;\n }\n\n assertIsListening(): void {\n assert.isTrue(this.currentlyListening, 'Expected to be listening');\n }\n\n assertIsNotListening(): void {\n assert.isFalse(this.currentlyListening, 'Expected to be listening');\n }\n\n override onResolve(id: string, obj: TestClass) {\n super.onResolve(id, obj);\n }\n}\n\ndescribe('ResolverBase', () => {\n const id = 'foo';\n const testObj = new TestClass();\n\n describe('tryGet', () => {\n it('should resolve a known object', () => {\n const resolver = new ResolverTestImpl(id, testObj);\n const obj = resolver.tryGet(id, () => {\n throw new Error('This should not get called');\n });\n resolver.assertIsNotListening();\n assert.strictEqual(obj, testObj);\n });\n\n it('should not resolve an unknown object', () => {\n const resolver = new ResolverTestImpl();\n const obj = resolver.tryGet(id, () => {\n throw new Error('This should not get called');\n });\n resolver.assertIsListening();\n assert.strictEqual(obj, null);\n resolver.clear();\n });\n\n it('should resolve a previously unknown object when it becomes available', async () => {\n const resolver = new ResolverTestImpl();\n const waitForCall = new Promise(resolve => {\n const obj = resolver.tryGet(id, resolve);\n assert.strictEqual(obj, null);\n });\n resolver.assertIsListening();\n resolver.onResolve(id, testObj);\n const obj = await waitForCall;\n resolver.assertIsNotListening();\n assert.strictEqual(obj, testObj);\n });\n });\n\n describe('waitFor', () => {\n it('should resolve an existing object', async () => {\n const resolver = new ResolverTestImpl(id, testObj);\n const obj = await resolver.waitFor(id);\n resolver.assertIsNotListening();\n assert.strictEqual(obj, testObj);\n });\n\n it('should reject the promise after `clear` has been called', async () => {\n const resolver = new ResolverTestImpl();\n const obj = resolver.waitFor(id);\n resolver.assertIsListening();\n resolver.clear();\n resolver.assertIsNotListening();\n try {\n await obj;\n } catch (e) {\n return;\n }\n assert.fail('Expected `await obj` to throw.');\n });\n\n it('should resolve a previously unknown object when it becomes available', async () => {\n const resolver = new ResolverTestImpl();\n const objPromise = resolver.waitFor(id);\n resolver.assertIsListening();\n resolver.onResolve(id, testObj);\n const obj = await objPromise;\n resolver.assertIsNotListening();\n assert.strictEqual(obj, obj);\n });\n });\n});\n"]} \ No newline at end of file +{"version":3,"file":"ResolverBase.test.js","sourceRoot":"","sources":["../../../../../../front_end/core/common/ResolverBase.test.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,KAAK,MAAM,MAAM,aAAa,CAAC;AAEtC,MAAM,SAAS;CAAG;AAElB,MAAM,OAAO,gBAAiB,SAAQ,MAAM,CAAC,YAAY,CAAC,YAA+B;IACvF,KAAK,GAAG,IAAI,GAAG,EAAqB,CAAC;IACrC,kBAAkB,GAAG,KAAK,CAAC;IAE3B,YAAY,EAAW,EAAE,GAAe;QACtC,KAAK,EAAE,CAAC;QACR,IAAI,EAAE,KAAK,SAAS,IAAI,GAAG,KAAK,SAAS,EAAE,CAAC;YAC1C,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,EAAE,GAAG,CAAC,CAAC;QAC1B,CAAC;IACH,CAAC;IAES,QAAQ,CAAC,EAAU;QAC3B,OAAO,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC,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K,IAAI,EAAE;YACvE,MAAM,QAAQ,GAAG,IAAI,gBAAgB,EAAE,CAAC;YACxC,MAAM,GAAG,GAAG,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;YACjC,QAAQ,CAAC,iBAAiB,EAAE,CAAC;YAC7B,QAAQ,CAAC,KAAK,EAAE,CAAC;YACjB,QAAQ,CAAC,oBAAoB,EAAE,CAAC;YAChC,IAAI,CAAC;gBACH,MAAM,GAAG,CAAC;YACZ,CAAC;YAAC,OAAO,CAAC,EAAE,CAAC;gBACX,OAAO;YACT,CAAC;YACD,MAAM,CAAC,IAAI,CAAC,gCAAgC,CAAC,CAAC;QAChD,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,sEAAsE,EAAE,KAAK,IAAI,EAAE;YACpF,MAAM,QAAQ,GAAG,IAAI,gBAAgB,EAAE,CAAC;YACxC,MAAM,UAAU,GAAG,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;YACxC,QAAQ,CAAC,iBAAiB,EAAE,CAAC;YAC7B,QAAQ,CAAC,SAAS,CAAC,EAAE,EAAE,OAAO,CAAC,CAAC;YAChC,MAAM,GAAG,GAAG,MAAM,UAAU,CAAC;YAC7B,QAAQ,CAAC,oBAAoB,EAAE,CAAC;YAChC,MAAM,CAAC,WAAW,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;QAC/B,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["// Copyright 2021 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport * as Common from './common.js';\n\nclass TestClass {}\n\nexport class ResolverTestImpl extends Common.ResolverBase.ResolverBase {\n items = new Map();\n currentlyListening = false;\n\n constructor(id?: string, obj?: TestClass) {\n super();\n if (id !== undefined && obj !== undefined) {\n this.items.set(id, obj);\n }\n }\n\n protected getForId(id: string): TestClass|null {\n return this.items.get(id) || null;\n }\n\n protected override startListening(): void {\n this.currentlyListening = true;\n }\n\n protected override stopListening(): void {\n this.currentlyListening = false;\n }\n\n assertIsListening(): void {\n assert.isTrue(this.currentlyListening, 'Expected to be listening');\n }\n\n assertIsNotListening(): void {\n assert.isFalse(this.currentlyListening, 'Expected to be listening');\n }\n\n override onResolve(id: string, obj: TestClass) {\n super.onResolve(id, obj);\n }\n}\n\ndescribe('ResolverBase', () => {\n const id = 'foo';\n const testObj = new TestClass();\n\n describe('tryGet', () => {\n it('should resolve a known object', () => {\n const resolver = new ResolverTestImpl(id, testObj);\n const obj = resolver.tryGet(id, () => {\n throw new Error('This should not get called');\n });\n resolver.assertIsNotListening();\n assert.strictEqual(obj, testObj);\n });\n\n it('should not resolve an unknown object', () => {\n const resolver = new ResolverTestImpl();\n const obj = resolver.tryGet(id, () => {\n throw new Error('This should not get called');\n });\n resolver.assertIsListening();\n assert.isNull(obj);\n resolver.clear();\n });\n\n it('should resolve a previously unknown object when it becomes available', async () => {\n const resolver = new ResolverTestImpl();\n const waitForCall = new Promise(resolve => {\n const obj = resolver.tryGet(id, resolve);\n assert.isNull(obj);\n });\n resolver.assertIsListening();\n resolver.onResolve(id, testObj);\n const obj = await waitForCall;\n resolver.assertIsNotListening();\n assert.strictEqual(obj, testObj);\n });\n });\n\n describe('waitFor', () => {\n it('should resolve an existing object', async () => {\n const resolver = new ResolverTestImpl(id, testObj);\n const obj = await resolver.waitFor(id);\n resolver.assertIsNotListening();\n assert.strictEqual(obj, testObj);\n });\n\n it('should reject the promise after `clear` has been called', async () => {\n const resolver = new ResolverTestImpl();\n const obj = resolver.waitFor(id);\n resolver.assertIsListening();\n resolver.clear();\n resolver.assertIsNotListening();\n try {\n await obj;\n } catch (e) {\n return;\n }\n assert.fail('Expected `await obj` to throw.');\n });\n\n it('should resolve a previously unknown object when it becomes available', async () => {\n const resolver = new ResolverTestImpl();\n const objPromise = resolver.waitFor(id);\n resolver.assertIsListening();\n resolver.onResolve(id, testObj);\n const obj = await objPromise;\n resolver.assertIsNotListening();\n assert.strictEqual(obj, obj);\n });\n });\n});\n"]} \ No newline at end of file diff --git a/public/core/common/ResourceType.test.js b/public/core/common/ResourceType.test.js index 8beb81428..55b60ff6b 100644 --- a/public/core/common/ResourceType.test.js +++ b/public/core/common/ResourceType.test.js @@ -26,7 +26,7 @@ describeWithEnvironment('ResourceType class', () => { assert.strictEqual(resourceType.title(), 'Type Test Title', 'title was not set correctly'); assert.strictEqual(resourceType.category().title(), 'Category Test Title', 'category title was not set correctly'); assert.strictEqual(resourceType.category().shortTitle(), 'Category Test Short Title', 'category short title was not set correctly'); - assert.strictEqual(resourceType.isTextType(), true, 'resource type was not set correctly'); + assert.isTrue(resourceType.isTextType(), 'resource type was not set correctly'); }); it('is able to return a document resource from the string "text/html"', () => { const result = ResourceType.fromMimeType('text/html'); @@ -331,12 +331,12 @@ describeWithEnvironment('ResourceType class', () => { }); it('treats a Ping as Other', () => { const resourceType = resourceTypes.Ping; - assert.strictEqual(resourceType.isTextType(), false, 'A ping is not a text type'); + assert.isFalse(resourceType.isTextType(), 'A ping is not a text type'); assert.strictEqual(resourceType.canonicalMimeType(), '', 'A ping does not have an associated mime type'); }); it('treats a CSPViolationsReport as Other', () => { const resourceType = resourceTypes.CSPViolationReport; - assert.strictEqual(resourceType.isTextType(), false, 'A ping is not a text type'); + assert.isFalse(resourceType.isTextType(), 'A ping is not a text type'); assert.strictEqual(resourceType.canonicalMimeType(), '', 'A ping does not have an associated mime type'); }); }); diff --git a/public/core/common/ResourceType.test.js.map b/public/core/common/ResourceType.test.js.map index 734e84fe8..01aba5c8c 100644 --- a/public/core/common/ResourceType.test.js.map +++ b/public/core/common/ResourceType.test.js.map @@ -1 +1 @@ -{"version":3,"file":"ResourceType.test.js","sourceRoot":"","sources":["../../../../../../front_end/core/common/ResourceType.test.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,EAAC,uBAAuB,EAAC,MAAM,qCAAqC,C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AAE,kBAAkB,CAAC,CAAC;QACxE,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["// Copyright 2019 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport {describeWithEnvironment} from '../../testing/EnvironmentHelpers.js';\nimport type * as Platform from '../platform/platform.js';\n\nimport * as Common from './common.js';\n\nconst ResourceType = Common.ResourceType.ResourceType;\nconst ResourceCategory = Common.ResourceType.ResourceCategory;\nconst resourceTypes = Common.ResourceType.resourceTypes;\nconst testTitle = () => 'Test Title' as Platform.UIString.LocalizedString;\nconst testShortTitle = () => 'Test Short Title' as Platform.UIString.LocalizedString;\nconst categoryTestTitle = () => 'Category Test Title' as Platform.UIString.LocalizedString;\nconst categoryTestShortTitle = () => 'Category Test Short Title' as Platform.UIString.LocalizedString;\nconst typeTestTitle = () => 'Type Test Title' as Platform.UIString.LocalizedString;\n\ndescribe('ResourceCategory class', () => {\n it('is able to be instantiated successfully', () => {\n const resourceCategory = new ResourceCategory('category name', testTitle, testShortTitle);\n assert.strictEqual(resourceCategory.title(), 'Test Title', 'title is not correct');\n assert.strictEqual(resourceCategory.shortTitle(), 'Test Short Title', 'short title is not correct');\n });\n});\n\ndescribeWithEnvironment('ResourceType class', () => {\n it('is able to be instantiated successfully', () => {\n const testResourceCategory = new ResourceCategory('category name', categoryTestTitle, categoryTestShortTitle);\n const resourceType = new ResourceType('Type Test Name', typeTestTitle, testResourceCategory, true);\n assert.strictEqual(resourceType.name(), 'Type Test Name', 'name was not set correctly');\n assert.strictEqual(resourceType.title(), 'Type Test Title', 'title was not set correctly');\n assert.strictEqual(resourceType.category().title(), 'Category Test Title', 'category title was not set correctly');\n assert.strictEqual(\n resourceType.category().shortTitle(), 'Category Test Short Title',\n 'category short title was not set correctly');\n assert.strictEqual(resourceType.isTextType(), true, 'resource type was not set correctly');\n });\n\n it('is able to return a document resource from the string \"text/html\"', () => {\n const result = ResourceType.fromMimeType('text/html');\n assert.instanceOf(result, ResourceType, 'result type is incorrect');\n assert.strictEqual(result.name(), 'document', 'name was not set correctly');\n assert.strictEqual(result.title(), 'Document', 'title was not set correctly');\n assert.strictEqual(result.category().title(), 'Document', 'category title was not set correctly');\n assert.strictEqual(result.category().shortTitle(), 'Doc', 'category short title was not set correctly');\n assert.isTrue(result.isTextType(), 'resource type was not set correctly');\n });\n\n it('is able to return a stylesheet resource from the string \"text/css\"', () => {\n const result = ResourceType.fromMimeType('text/css');\n assert.instanceOf(result, ResourceType, 'result type is incorrect');\n assert.strictEqual(result.name(), 'stylesheet', 'name was not set correctly');\n assert.strictEqual(result.title(), 'Stylesheet', 'title was not set correctly');\n assert.strictEqual(result.category().title(), 'CSS', 'category title was not set correctly');\n assert.strictEqual(result.category().shortTitle(), 'CSS', 'category short title was not set correctly');\n assert.isTrue(result.isTextType(), 'resource type was not set correctly');\n });\n\n it('is able to return an image resource from the string \"image/\"', () => {\n const result = ResourceType.fromMimeType('image/');\n assert.instanceOf(result, ResourceType, 'result type is incorrect');\n assert.strictEqual(result.name(), 'image', 'name was not set correctly');\n assert.strictEqual(result.title(), 'Image', 'title was not set correctly');\n assert.strictEqual(result.category().title(), 'Image', 'category title was not set correctly');\n assert.strictEqual(result.category().shortTitle(), 'Img', 'category short title was not set correctly');\n assert.isFalse(result.isTextType(), 'resource type was not set correctly');\n });\n\n it('is able to return a script resource from the string \"text/\"', () => {\n const result = ResourceType.fromMimeType('text/');\n assert.instanceOf(result, ResourceType, 'result type is incorrect');\n assert.strictEqual(result.name(), 'script', 'name was not set correctly');\n assert.strictEqual(result.title(), 'Script', 'title was not set correctly');\n assert.strictEqual(result.category().title(), 'JavaScript', 'category title was not set correctly');\n assert.strictEqual(result.category().shortTitle(), 'JS', 'category short title was not set correctly');\n assert.isTrue(result.isTextType(), 'resource type was not set correctly');\n });\n\n it('is able to return a font resource from the string \"font\"', () => {\n const result = ResourceType.fromMimeType('font');\n assert.instanceOf(result, ResourceType, 'result type is incorrect');\n assert.strictEqual(result.name(), 'font', 'name was not set correctly');\n assert.strictEqual(result.title(), 'Font', 'title was not set correctly');\n assert.strictEqual(result.category().title(), 'Font', 'category title was not set correctly');\n assert.strictEqual(result.category().shortTitle(), 'Font', 'category short title was not set correctly');\n assert.isFalse(result.isTextType(), 'resource type was not set correctly');\n });\n\n it('is able to return a script resource from the string \"script\"', () => {\n const result = ResourceType.fromMimeType('script');\n assert.instanceOf(result, ResourceType, 'result type is incorrect');\n assert.strictEqual(result.name(), 'script', 'name was not set correctly');\n assert.strictEqual(result.title(), 'Script', 'title was not set correctly');\n assert.strictEqual(result.category().title(), 'JavaScript', 'category title was not set correctly');\n assert.strictEqual(result.category().shortTitle(), 'JS', 'category short title was not set correctly');\n assert.isTrue(result.isTextType(), 'resource type was not set correctly');\n });\n\n it('is able to return an octet resource from the string \"octet\"', () => {\n const result = ResourceType.fromMimeType('octet');\n assert.instanceOf(result, ResourceType, 'result type is incorrect');\n assert.strictEqual(result.name(), 'other', 'name was not set correctly');\n assert.strictEqual(result.title(), 'Other', 'title was not set correctly');\n assert.strictEqual(result.category().title(), 'Other', 'category title was not set correctly');\n assert.strictEqual(result.category().shortTitle(), 'Other', 'category short title was not set correctly');\n assert.isFalse(result.isTextType(), 'resource type was not set correctly');\n });\n\n it('is able to return an application resource from the string \"application\"', () => {\n const result = ResourceType.fromMimeType('application');\n assert.instanceOf(result, ResourceType, 'result type is incorrect');\n assert.strictEqual(result.name(), 'script', 'name was not set correctly');\n assert.strictEqual(result.title(), 'Script', 'title was not set correctly');\n assert.strictEqual(result.category().title(), 'JavaScript', 'category title was not set correctly');\n assert.strictEqual(result.category().shortTitle(), 'JS', 'category short title was not set correctly');\n assert.isTrue(result.isTextType(), 'resource type was not set correctly');\n });\n\n it('is able to return an wasm resource from the string \"application/wasm\"', () => {\n const result = ResourceType.fromMimeTypeOverride('application/wasm');\n assert.instanceOf(result, ResourceType, 'result type is incorrect');\n assert.strictEqual(result!.name(), 'wasm', 'name was not set correctly');\n assert.strictEqual(result!.title(), 'Wasm', 'title was not set correctly');\n assert.strictEqual(result!.category().title(), 'WebAssembly', 'category title was not set correctly');\n assert.strictEqual(result!.category().shortTitle(), 'Wasm', 'category short title was not set correctly');\n assert.isFalse(result!.isTextType(), 'resource type was not set correctly');\n });\n\n it('is able to return an web bundle resource from the string \"application/webbundle\"', () => {\n const result = ResourceType.fromMimeTypeOverride('application/webbundle');\n assert.instanceOf(result, ResourceType, 'result type is incorrect');\n assert.strictEqual(result!.name(), 'webbundle', 'name was not set correctly');\n assert.strictEqual(result!.title(), 'WebBundle', 'title was not set correctly');\n assert.strictEqual(result!.category().title(), 'Other', 'category title was not set correctly');\n assert.strictEqual(result!.category().shortTitle(), 'Other', 'category short title was not set correctly');\n assert.isFalse(result!.isTextType(), 'resource type was not set correctly');\n });\n\n it('is able to return a resource of type other from the string \"test/resource\"', () => {\n const result = ResourceType.fromMimeType('test/resource');\n assert.instanceOf(result, ResourceType, 'result type is incorrect');\n assert.strictEqual(result.name(), 'other', 'name was not set correctly');\n assert.strictEqual(result.title(), 'Other', 'title was not set correctly');\n assert.strictEqual(result.category().title(), 'Other', 'category title was not set correctly');\n assert.strictEqual(result.category().shortTitle(), 'Other', 'category short title was not set correctly');\n assert.isFalse(result.isTextType(), 'resource type was not set correctly');\n });\n\n it('is able to return a resource type from a URL that contains a mapped extension', () => {\n const result = ResourceType.fromURL('http://www.example.com/test/testFile.js');\n assert.instanceOf(result, ResourceType, 'result type is incorrect');\n assert.strictEqual(result!.name(), 'script', 'name was not set correctly');\n assert.strictEqual(result!.title(), 'Script', 'title was not set correctly');\n assert.strictEqual(result!.category().title(), 'JavaScript', 'category title was not set correctly');\n assert.strictEqual(result!.category().shortTitle(), 'JS', 'category short title was not set correctly');\n assert.isTrue(result!.isTextType(), 'resource type was not set correctly');\n });\n\n it('is able to return a resource type from a URL that ends in .avif', () => {\n const result = ResourceType.fromURL('https://host.example/image.avif');\n assert.instanceOf(result, ResourceType, 'result type is incorrect');\n assert.strictEqual(result!.name(), 'image', 'name was not set correctly');\n assert.strictEqual(result!.title(), 'Image', 'title was not set correctly');\n assert.strictEqual(result!.category().title(), 'Image', 'category title was not set correctly');\n assert.strictEqual(result!.category().shortTitle(), 'Img', 'category short title was not set correctly');\n assert.isTrue(result!.isImage(), 'resource type was not set correctly');\n });\n\n it('is able to return a resource type from a URL that ends in .jxl', () => {\n const result = ResourceType.fromURL('https://host.example/image.jxl');\n assert.instanceOf(result, ResourceType, 'result type is incorrect');\n assert.strictEqual(result!.name(), 'image', 'name was not set correctly');\n assert.strictEqual(result!.title(), 'Image', 'title was not set correctly');\n assert.strictEqual(result!.category().title(), 'Image', 'category title was not set correctly');\n assert.strictEqual(result!.category().shortTitle(), 'Img', 'category short title was not set correctly');\n assert.isTrue(result!.isImage(), 'resource type was not set correctly');\n });\n\n it('is able to return a resource type from a URL that ends in .woff2', () => {\n const result = ResourceType.fromURL('https://host.example/image.woff2');\n assert.instanceOf(result, ResourceType, 'result type is incorrect');\n assert.strictEqual(result!.name(), 'font', 'name was not set correctly');\n assert.strictEqual(result!.title(), 'Font', 'title was not set correctly');\n assert.strictEqual(result!.category().title(), 'Font', 'category title was not set correctly');\n assert.strictEqual(result!.category().shortTitle(), 'Font', 'category short title was not set correctly');\n assert.isFalse(result!.isTextType(), 'resource type was not set correctly');\n });\n\n it('is able to return null from a URL that contains an unmapped extension', () => {\n const result = ResourceType.fromURL('http://www.example.com/test/testFile.testExt');\n assert.isNull(result, 'result is not null');\n });\n\n it('is able to return a resource type from a mapped name', () => {\n const result = ResourceType.fromName('script');\n assert.instanceOf(result, ResourceType, 'result type is incorrect');\n assert.strictEqual(result!.name(), 'script', 'name was not set correctly');\n assert.strictEqual(result!.title(), 'Script', 'title was not set correctly');\n assert.strictEqual(result!.category().title(), 'JavaScript', 'category title was not set correctly');\n assert.strictEqual(result!.category().shortTitle(), 'JS', 'category short title was not set correctly');\n assert.isTrue(result!.isTextType(), 'resource type was not set correctly');\n });\n\n it('is able to return null from an unmapped name', () => {\n const result = ResourceType.fromName('testName');\n assert.isNull(result, 'result is not null');\n });\n\n it('is able to return a mime from URL that contains a mapped extension', () => {\n const result = ResourceType.mimeFromURL('http://www.example.com/test/path.html' as Platform.DevToolsPath.UrlString);\n assert.strictEqual(result, 'text/html', 'mime returned was not correct');\n });\n\n it('is able to return a mime from URL that contains an unmapped extension', () => {\n const result =\n ResourceType.mimeFromURL('http://www.example.com/test/path.testExt' as Platform.DevToolsPath.UrlString);\n assert.isUndefined(result, 'mime returned was not correct');\n });\n\n it('is able to return a mime from URL that contains a mapped name', () => {\n const result = ResourceType.mimeFromURL('http://www.example.com/test/Cakefile' as Platform.DevToolsPath.UrlString);\n assert.strictEqual(result, 'text/x-coffeescript', 'mime returned was not correct');\n });\n\n it('is able to return a mime from a mapped extension', () => {\n const result = ResourceType.mimeFromExtension('html');\n assert.strictEqual(result, 'text/html', 'mime returned was not correct');\n });\n\n it('is able to return a mime from an unmapped extension', () => {\n const result = ResourceType.mimeFromExtension('testExt');\n assert.isUndefined(result, 'mime returned was not correct');\n });\n\n it('is able to return its title successfully', () => {\n const testResourceCategory = new ResourceCategory('category name', categoryTestTitle, categoryTestShortTitle);\n const resourceType = new ResourceType('Type Test Name', typeTestTitle, testResourceCategory, true);\n assert.strictEqual(resourceType.title(), 'Type Test Title', 'title was not returned correctly');\n });\n\n it('is able to return its isTextType value successfully', () => {\n const testResourceCategory = new ResourceCategory('category name', categoryTestTitle, categoryTestShortTitle);\n const resourceType = new ResourceType('Type Test Name', typeTestTitle, testResourceCategory, true);\n assert.isTrue(resourceType.isTextType(), 'isTextType was not returned correctly');\n });\n\n it('is able to return whether or not its a script if its name equals the value \"script\"', () => {\n const testResourceCategory = new ResourceCategory('category name', categoryTestTitle, categoryTestShortTitle);\n const resourceType = new ResourceType('script', typeTestTitle, testResourceCategory, true);\n assert.isTrue(resourceType.isScript(), 'the resource should be considered as a script');\n });\n\n it('is able to return whether or not its a script if its name equals the value \"sm-script\"', () => {\n const testResourceCategory = new ResourceCategory('category name', categoryTestTitle, categoryTestShortTitle);\n const resourceType = new ResourceType('sm-script', typeTestTitle, testResourceCategory, true);\n assert.isTrue(resourceType.isScript(), 'the resource should be considered as a script');\n });\n\n it('is able to return whether or not its a script if its name is not equal to the values \"script\" or \"sm-script\"',\n () => {\n const testResourceCategory = new ResourceCategory('category name', categoryTestTitle, categoryTestShortTitle);\n const resourceType = new ResourceType('Type Test Name', typeTestTitle, testResourceCategory, true);\n assert.isFalse(resourceType.isScript(), 'the resource should not be considered as a script');\n });\n\n it('is able to return whether or not its a document if its name equals the value \"document\"', () => {\n const testResourceCategory = new ResourceCategory('category name', categoryTestTitle, categoryTestShortTitle);\n const resourceType = new ResourceType('document', typeTestTitle, testResourceCategory, true);\n assert.isTrue(resourceType.isDocument(), 'the resource should be considered as a document');\n });\n\n it('is able to return whether or not its a document if its name does not equal the value \"document\"', () => {\n const testResourceCategory = new ResourceCategory('category name', categoryTestTitle, categoryTestShortTitle);\n const resourceType = new ResourceType('Type Test Name', typeTestTitle, testResourceCategory, true);\n assert.isFalse(resourceType.isDocument(), 'the resource should not be considered as a document');\n });\n\n it('is able to determine if a resource has scripts if it is a script', () => {\n const testResourceCategory = new ResourceCategory('category name', categoryTestTitle, categoryTestShortTitle);\n const resourceType = new ResourceType('script', typeTestTitle, testResourceCategory, true);\n assert.isTrue(resourceType.hasScripts(), 'the resource should be considered as a having scripts');\n });\n\n it('is able to determine if a resource has scripts if it is a document', () => {\n const testResourceCategory = new ResourceCategory('category name', categoryTestTitle, categoryTestShortTitle);\n const resourceType = new ResourceType('document', typeTestTitle, testResourceCategory, true);\n assert.isTrue(resourceType.hasScripts(), 'the resource should be considered as a having scripts');\n });\n\n it('is able to determine if a resource has scripts if it is not a script or a document', () => {\n const testResourceCategory = new ResourceCategory('category name', categoryTestTitle, categoryTestShortTitle);\n const resourceType = new ResourceType('Type Test Name', typeTestTitle, testResourceCategory, true);\n assert.isFalse(resourceType.hasScripts(), 'the resource should not be considered as a having scripts');\n });\n\n it('is able to return whether or not its a stylesheet if its name equals the value \"stylesheet\"', () => {\n const testResourceCategory = new ResourceCategory('category name', categoryTestTitle, categoryTestShortTitle);\n const resourceType = new ResourceType('stylesheet', typeTestTitle, testResourceCategory, true);\n assert.isTrue(resourceType.isStyleSheet(), 'the resource should be considered as a stylesheet');\n });\n\n it('is able to return whether or not its a stylesheet if its name equals the value \"sm-stylesheet\"', () => {\n const testResourceCategory = new ResourceCategory('category name', categoryTestTitle, categoryTestShortTitle);\n const resourceType = new ResourceType('sm-stylesheet', typeTestTitle, testResourceCategory, true);\n assert.isTrue(resourceType.isStyleSheet(), 'the resource should be considered as a stylesheet');\n });\n\n it('is able to return whether or not its a stylesheet if its name is not equal to the values \"stylesheet\" or \"sm-stylesheet\"',\n () => {\n const testResourceCategory = new ResourceCategory('category name', categoryTestTitle, categoryTestShortTitle);\n const resourceType = new ResourceType('Type Test Name', typeTestTitle, testResourceCategory, true);\n assert.isFalse(resourceType.isStyleSheet(), 'the resource should not be considered as a stylesheet');\n });\n\n it('is able to return whether it is a document, a script or a stylesheet if it was a document', () => {\n const testResourceCategory = new ResourceCategory('category name', categoryTestTitle, categoryTestShortTitle);\n const resourceType = new ResourceType('document', typeTestTitle, testResourceCategory, true);\n assert.isTrue(resourceType.isDocumentOrScriptOrStyleSheet(), 'the resource should be considered as a document');\n });\n\n it('is able to return whether it is a document, a script or a stylesheet if it was a script', () => {\n const testResourceCategory = new ResourceCategory('category name', categoryTestTitle, categoryTestShortTitle);\n const resourceType = new ResourceType('script', typeTestTitle, testResourceCategory, true);\n assert.isTrue(resourceType.isDocumentOrScriptOrStyleSheet(), 'the resource should be considered as a script');\n });\n\n it('is able to return whether it is a document, a script or a stylesheet if it was a stylesheet', () => {\n const testResourceCategory = new ResourceCategory('category name', categoryTestTitle, categoryTestShortTitle);\n const resourceType = new ResourceType('stylesheet', typeTestTitle, testResourceCategory, true);\n assert.isTrue(resourceType.isDocumentOrScriptOrStyleSheet(), 'the resource should be considered as a stylesheet');\n });\n\n it('is able to return whether it is a document, a script or a stylesheet if it was none of those things', () => {\n const testResourceCategory = new ResourceCategory('category name', categoryTestTitle, categoryTestShortTitle);\n const resourceType = new ResourceType('Type Test Name', typeTestTitle, testResourceCategory, true);\n assert.isFalse(\n resourceType.isDocumentOrScriptOrStyleSheet(),\n 'the resource should be considered as a doucment, a script or a stylesheet');\n });\n\n it('is able to determine if it is from source map if it began with \"sm-\"', () => {\n const testResourceCategory = new ResourceCategory('category name', categoryTestTitle, categoryTestShortTitle);\n const resourceType = new ResourceType('sm-Type Test Name', typeTestTitle, testResourceCategory, true);\n assert.isTrue(resourceType.isFromSourceMap(), 'the resource should be considered to be from source map');\n });\n\n it('is able to determine if it is from source map if it did not begin with \"sm-\"', () => {\n const testResourceCategory = new ResourceCategory('category name', categoryTestTitle, categoryTestShortTitle);\n const resourceType = new ResourceType('Type Test Name', typeTestTitle, testResourceCategory, true);\n assert.isFalse(resourceType.isFromSourceMap(), 'the resource should not be considered to be from source map');\n });\n\n it('is able to be converted to a string by returning its name', () => {\n const testResourceCategory = new ResourceCategory('category name', categoryTestTitle, categoryTestShortTitle);\n const resourceType = new ResourceType('Type Test Name', typeTestTitle, testResourceCategory, true);\n assert.strictEqual(\n resourceType.toString(), 'Type Test Name', 'the resource type was not converted to a string correctly');\n });\n\n it('is able to return the canonical mime type of a document', () => {\n const testResourceCategory = new ResourceCategory('category name', categoryTestTitle, categoryTestShortTitle);\n const resourceType = new ResourceType('document', typeTestTitle, testResourceCategory, true);\n assert.strictEqual(\n resourceType.canonicalMimeType(), 'text/html', 'the canonical mime type was not returned correctly');\n });\n\n it('is able to return the canonical mime type of a script', () => {\n const testResourceCategory = new ResourceCategory('category name', categoryTestTitle, categoryTestShortTitle);\n const resourceType = new ResourceType('script', typeTestTitle, testResourceCategory, true);\n assert.strictEqual(\n resourceType.canonicalMimeType(), 'text/javascript', 'the canonical mime type was not returned correctly');\n });\n\n it('is able to return the canonical mime type of a stylesheet', () => {\n const testResourceCategory = new ResourceCategory('category name', categoryTestTitle, categoryTestShortTitle);\n const resourceType = new ResourceType('stylesheet', typeTestTitle, testResourceCategory, true);\n assert.strictEqual(\n resourceType.canonicalMimeType(), 'text/css', 'the canonical mime type was not returned correctly');\n });\n\n it('returns an empty string as a canonical mime type if it was not a document, a script or a stylesheet', () => {\n const testResourceCategory = new ResourceCategory('category name', categoryTestTitle, categoryTestShortTitle);\n const resourceType = new ResourceType('Type Test Name', typeTestTitle, testResourceCategory, true);\n assert.strictEqual(resourceType.canonicalMimeType(), '', 'the canonical mime type was not returned correctly');\n });\n\n it('is able to return the simplified content type of a json subtype', () => {\n assert.strictEqual(\n ResourceType.simplifyContentType('application/sparql-results+json'), 'application/json',\n 'the simplified content type was not returned correctly');\n\n assert.strictEqual(\n ResourceType.simplifyContentType('application/hal+json'), 'application/json',\n 'the simplified content type was not returned correctly');\n\n assert.strictEqual(\n ResourceType.simplifyContentType('application/json+protobuf'), 'application/json',\n 'the simplified content type was not returned correctly');\n });\n\n it('simplifyContentType() does not affect other content types than json subtypes', () => {\n assert.strictEqual(\n ResourceType.simplifyContentType('text/javascript'), 'text/javascript',\n 'the simplified content type was not returned correctly');\n\n assert.strictEqual(\n ResourceType.simplifyContentType('application/json'), 'application/json',\n 'the simplified content type was not returned correctly');\n });\n\n it('treats a Ping as Other', () => {\n const resourceType = resourceTypes.Ping;\n assert.strictEqual(resourceType.isTextType(), false, 'A ping is not a text type');\n assert.strictEqual(resourceType.canonicalMimeType(), '', 'A ping does not have an associated mime type');\n });\n\n it('treats a CSPViolationsReport as Other', () => {\n const resourceType = resourceTypes.CSPViolationReport;\n assert.strictEqual(resourceType.isTextType(), false, 'A ping is not a text type');\n assert.strictEqual(resourceType.canonicalMimeType(), '', 'A ping does not have an associated mime type');\n });\n});\n\ndescribe('ResourceType', () => {\n describe('hasStyleSheet', () => {\n it('holds true for documents', () => {\n assert.isTrue(resourceTypes.Document.hasStyleSheets());\n });\n\n it('holds true for stylesheets', () => {\n assert.isTrue(resourceTypes.Stylesheet.hasStyleSheets());\n });\n });\n\n describe('mimeFromExtension', () => {\n it('returns correct MIME type for .dart files', () => {\n assert.strictEqual(ResourceType.mimeFromExtension('dart'), 'application/vnd.dart');\n });\n\n it('returns correct MIME type for Go files', () => {\n assert.strictEqual(ResourceType.mimeFromExtension('go'), 'text/x-go');\n });\n\n it('returns correct MIME type for .gss files', () => {\n assert.strictEqual(ResourceType.mimeFromExtension('gss'), 'text/x-gss');\n });\n\n it('returns correct MIME type for .kt files', () => {\n assert.strictEqual(ResourceType.mimeFromExtension('kt'), 'text/x-kotlin');\n });\n\n it('returns correct MIME type for .less files', () => {\n assert.strictEqual(ResourceType.mimeFromExtension('less'), 'text/x-less');\n });\n\n it('returns correct MIME type for .php files', () => {\n assert.strictEqual(ResourceType.mimeFromExtension('php'), 'application/x-httpd-php');\n });\n\n it('returns correct MIME type for SASS files', () => {\n assert.strictEqual(ResourceType.mimeFromExtension('sass'), 'text/x-sass');\n assert.strictEqual(ResourceType.mimeFromExtension('scss'), 'text/x-scss');\n });\n\n it('returns correct MIME type for Scala files', () => {\n assert.strictEqual(ResourceType.mimeFromExtension('scala'), 'text/x-scala');\n });\n\n it('returns correct MIME type for .component.html files', () => {\n assert.strictEqual(ResourceType.mimeFromExtension('component.html'), 'text/x.angular');\n });\n\n it('returns correct MIME type for .svelte files', () => {\n assert.strictEqual(ResourceType.mimeFromExtension('svelte'), 'text/x.svelte');\n });\n\n it('returns correct MIME type for .vue files', () => {\n assert.strictEqual(ResourceType.mimeFromExtension('vue'), 'text/x.vue');\n });\n\n it('returns correct MIME type for .webmanifest files', () => {\n assert.strictEqual(ResourceType.mimeFromExtension('webmanifest'), 'application/manifest+json');\n });\n\n it('returns correct MIME type for source maps', () => {\n assert.strictEqual(ResourceType.mimeFromExtension('map'), 'application/json');\n });\n });\n\n describe('mimeFromURL', () => {\n it('returns correct MIME type for .dart files', () => {\n const url = 'http://localhost/example.dart' as Platform.DevToolsPath.UrlString;\n assert.strictEqual(ResourceType.mimeFromURL(url), 'application/vnd.dart');\n });\n\n it('returns correct MIME type for Go files', () => {\n const url = 'https://staging.server.com/main.go' as Platform.DevToolsPath.UrlString;\n assert.strictEqual(ResourceType.mimeFromURL(url), 'text/x-go');\n });\n\n it('returns correct MIME type for .gss files', () => {\n const url = 'https://staging.server.com/styles.gss' as Platform.DevToolsPath.UrlString;\n assert.strictEqual(ResourceType.mimeFromURL(url), 'text/x-gss');\n });\n\n it('returns correct MIME type for .kt files', () => {\n const url = 'https://staging.server.com/Main.kt' as Platform.DevToolsPath.UrlString;\n assert.strictEqual(ResourceType.mimeFromURL(url), 'text/x-kotlin');\n });\n\n it('returns correct MIME type for .less files', () => {\n const url = 'https://staging.server.com/styles.less' as Platform.DevToolsPath.UrlString;\n assert.strictEqual(ResourceType.mimeFromURL(url), 'text/x-less');\n });\n\n it('returns correct MIME type for .php files', () => {\n const url = 'http://localhost/file.php' as Platform.DevToolsPath.UrlString;\n assert.strictEqual(ResourceType.mimeFromURL(url), 'application/x-httpd-php');\n });\n\n it('returns correct MIME type for SASS files', () => {\n assert.strictEqual(\n ResourceType.mimeFromURL('https://staging.server.com/styles.sass' as Platform.DevToolsPath.UrlString),\n 'text/x-sass');\n assert.strictEqual(\n ResourceType.mimeFromURL('https://staging.server.com/styles.scss' as Platform.DevToolsPath.UrlString),\n 'text/x-scss');\n });\n\n it('returns correct MIME type for Scala files', () => {\n const url = 'http://localhost/App.scala' as Platform.DevToolsPath.UrlString;\n assert.strictEqual(ResourceType.mimeFromURL(url), 'text/x-scala');\n });\n\n it('returns correct MIME type for Angular component templates', () => {\n const url = 'http://localhost/src/app/app.component.html' as Platform.DevToolsPath.UrlString;\n assert.strictEqual(ResourceType.mimeFromURL(url), 'text/x.angular');\n });\n\n it('returns correct MIME type for .svelte files', () => {\n const url = 'http://localhost/App.svelte' as Platform.DevToolsPath.UrlString;\n assert.strictEqual(ResourceType.mimeFromURL(url), 'text/x.svelte');\n });\n\n it('returns correct MIME type for .vue files', () => {\n const url = 'http://localhost/App.vue' as Platform.DevToolsPath.UrlString;\n assert.strictEqual(ResourceType.mimeFromURL(url), 'text/x.vue');\n });\n\n it('returns correct MIME type for .webmanifest files', () => {\n const url = 'http://localhost/app.webmanifest' as Platform.DevToolsPath.UrlString;\n assert.strictEqual(ResourceType.mimeFromURL(url), 'application/manifest+json');\n });\n\n it('returns correct MIME type for source maps', () => {\n const url = 'http://localhost/bundle.min.js.map' as Platform.DevToolsPath.UrlString;\n assert.strictEqual(ResourceType.mimeFromURL(url), 'application/json');\n });\n });\n});\n"]} \ No newline at end of file +{"version":3,"file":"ResourceType.test.js","sourceRoot":"","sources":["../../../../../../front_end/core/common/ResourceType.test.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,EAAC,uBAAuB,EAAC,MAAM,qCAAqC,CAAC;AAG5E,OAAO,KAAK,MAAM,MAAM,aAAa,CAAC;AAEtC,MAAM,YAAY,GAAG,MAAM,CAAC,YAAY,CAAC,YAAY,CAAC;AACtD,MAAM,gBAAgB,GAAG,MAAM,CAAC,YAAY,CAAC,gBAAgB,CAAC;AAC9D,MAAM,aAAa,GAAG,MAAM,CAAC,YAAY,CAAC,aAAa,CAAC;AACxD,MAAM,SAAS,GAAG,GAAG,EAAE,CAAC,YAAiD,CAAC;AAC1E,MAAM,cAAc,GAAG,GAAG,EAAE,CAAC,kBAAuD,CAAC;AACrF,MAAM,iBAAiB,GAAG,GAAG,EAAE,CAAC,qBAA0D,CAAC;AAC3F,MAAM,sBAAsB,GAAG,GAAG,EAAE,CAAC,2BAAgE,CAAC;AACtG,MAAM,aAAa,GAAG,GAAG,EAAE,CAAC,iBAAsD,CAAC;AAEnF,QAAQ,CAAC,wBAAwB,EAAE,GAAG,EAAE;IACtC,EAAE,CAAC,yCAAyC,EAAE,GAAG,EAAE;QACjD,MAAM,gBAAgB,GAA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AAC;QAEH,EAAE,CAAC,0CAA0C,EAAE,GAAG,EAAE;YAClD,MAAM,GAAG,GAAG,0BAA6D,CAAC;YAC1E,MAAM,CAAC,WAAW,CAAC,YAAY,CAAC,WAAW,CAAC,GAAG,CAAC,EAAE,YAAY,CAAC,CAAC;QAClE,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,kDAAkD,EAAE,GAAG,EAAE;YAC1D,MAAM,GAAG,GAAG,kCAAqE,CAAC;YAClF,MAAM,CAAC,WAAW,CAAC,YAAY,CAAC,WAAW,CAAC,GAAG,CAAC,EAAE,2BAA2B,CAAC,CAAC;QACjF,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,2CAA2C,EAAE,GAAG,EAAE;YACnD,MAAM,GAAG,GAAG,oCAAuE,CAAC;YACpF,MAAM,CAAC,WAAW,CAAC,YAAY,CAAC,WAAW,CAAC,GAAG,CAAC,EAAE,kBAAkB,CAAC,CAAC;QACxE,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["// Copyright 2019 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport {describeWithEnvironment} from '../../testing/EnvironmentHelpers.js';\nimport type * as Platform from '../platform/platform.js';\n\nimport * as Common from './common.js';\n\nconst ResourceType = Common.ResourceType.ResourceType;\nconst ResourceCategory = Common.ResourceType.ResourceCategory;\nconst resourceTypes = Common.ResourceType.resourceTypes;\nconst testTitle = () => 'Test Title' as Platform.UIString.LocalizedString;\nconst testShortTitle = () => 'Test Short Title' as Platform.UIString.LocalizedString;\nconst categoryTestTitle = () => 'Category Test Title' as Platform.UIString.LocalizedString;\nconst categoryTestShortTitle = () => 'Category Test Short Title' as Platform.UIString.LocalizedString;\nconst typeTestTitle = () => 'Type Test Title' as Platform.UIString.LocalizedString;\n\ndescribe('ResourceCategory class', () => {\n it('is able to be instantiated successfully', () => {\n const resourceCategory = new ResourceCategory('category name', testTitle, testShortTitle);\n assert.strictEqual(resourceCategory.title(), 'Test Title', 'title is not correct');\n assert.strictEqual(resourceCategory.shortTitle(), 'Test Short Title', 'short title is not correct');\n });\n});\n\ndescribeWithEnvironment('ResourceType class', () => {\n it('is able to be instantiated successfully', () => {\n const testResourceCategory = new ResourceCategory('category name', categoryTestTitle, categoryTestShortTitle);\n const resourceType = new ResourceType('Type Test Name', typeTestTitle, testResourceCategory, true);\n assert.strictEqual(resourceType.name(), 'Type Test Name', 'name was not set correctly');\n assert.strictEqual(resourceType.title(), 'Type Test Title', 'title was not set correctly');\n assert.strictEqual(resourceType.category().title(), 'Category Test Title', 'category title was not set correctly');\n assert.strictEqual(\n resourceType.category().shortTitle(), 'Category Test Short Title',\n 'category short title was not set correctly');\n assert.isTrue(resourceType.isTextType(), 'resource type was not set correctly');\n });\n\n it('is able to return a document resource from the string \"text/html\"', () => {\n const result = ResourceType.fromMimeType('text/html');\n assert.instanceOf(result, ResourceType, 'result type is incorrect');\n assert.strictEqual(result.name(), 'document', 'name was not set correctly');\n assert.strictEqual(result.title(), 'Document', 'title was not set correctly');\n assert.strictEqual(result.category().title(), 'Document', 'category title was not set correctly');\n assert.strictEqual(result.category().shortTitle(), 'Doc', 'category short title was not set correctly');\n assert.isTrue(result.isTextType(), 'resource type was not set correctly');\n });\n\n it('is able to return a stylesheet resource from the string \"text/css\"', () => {\n const result = ResourceType.fromMimeType('text/css');\n assert.instanceOf(result, ResourceType, 'result type is incorrect');\n assert.strictEqual(result.name(), 'stylesheet', 'name was not set correctly');\n assert.strictEqual(result.title(), 'Stylesheet', 'title was not set correctly');\n assert.strictEqual(result.category().title(), 'CSS', 'category title was not set correctly');\n assert.strictEqual(result.category().shortTitle(), 'CSS', 'category short title was not set correctly');\n assert.isTrue(result.isTextType(), 'resource type was not set correctly');\n });\n\n it('is able to return an image resource from the string \"image/\"', () => {\n const result = ResourceType.fromMimeType('image/');\n assert.instanceOf(result, ResourceType, 'result type is incorrect');\n assert.strictEqual(result.name(), 'image', 'name was not set correctly');\n assert.strictEqual(result.title(), 'Image', 'title was not set correctly');\n assert.strictEqual(result.category().title(), 'Image', 'category title was not set correctly');\n assert.strictEqual(result.category().shortTitle(), 'Img', 'category short title was not set correctly');\n assert.isFalse(result.isTextType(), 'resource type was not set correctly');\n });\n\n it('is able to return a script resource from the string \"text/\"', () => {\n const result = ResourceType.fromMimeType('text/');\n assert.instanceOf(result, ResourceType, 'result type is incorrect');\n assert.strictEqual(result.name(), 'script', 'name was not set correctly');\n assert.strictEqual(result.title(), 'Script', 'title was not set correctly');\n assert.strictEqual(result.category().title(), 'JavaScript', 'category title was not set correctly');\n assert.strictEqual(result.category().shortTitle(), 'JS', 'category short title was not set correctly');\n assert.isTrue(result.isTextType(), 'resource type was not set correctly');\n });\n\n it('is able to return a font resource from the string \"font\"', () => {\n const result = ResourceType.fromMimeType('font');\n assert.instanceOf(result, ResourceType, 'result type is incorrect');\n assert.strictEqual(result.name(), 'font', 'name was not set correctly');\n assert.strictEqual(result.title(), 'Font', 'title was not set correctly');\n assert.strictEqual(result.category().title(), 'Font', 'category title was not set correctly');\n assert.strictEqual(result.category().shortTitle(), 'Font', 'category short title was not set correctly');\n assert.isFalse(result.isTextType(), 'resource type was not set correctly');\n });\n\n it('is able to return a script resource from the string \"script\"', () => {\n const result = ResourceType.fromMimeType('script');\n assert.instanceOf(result, ResourceType, 'result type is incorrect');\n assert.strictEqual(result.name(), 'script', 'name was not set correctly');\n assert.strictEqual(result.title(), 'Script', 'title was not set correctly');\n assert.strictEqual(result.category().title(), 'JavaScript', 'category title was not set correctly');\n assert.strictEqual(result.category().shortTitle(), 'JS', 'category short title was not set correctly');\n assert.isTrue(result.isTextType(), 'resource type was not set correctly');\n });\n\n it('is able to return an octet resource from the string \"octet\"', () => {\n const result = ResourceType.fromMimeType('octet');\n assert.instanceOf(result, ResourceType, 'result type is incorrect');\n assert.strictEqual(result.name(), 'other', 'name was not set correctly');\n assert.strictEqual(result.title(), 'Other', 'title was not set correctly');\n assert.strictEqual(result.category().title(), 'Other', 'category title was not set correctly');\n assert.strictEqual(result.category().shortTitle(), 'Other', 'category short title was not set correctly');\n assert.isFalse(result.isTextType(), 'resource type was not set correctly');\n });\n\n it('is able to return an application resource from the string \"application\"', () => {\n const result = ResourceType.fromMimeType('application');\n assert.instanceOf(result, ResourceType, 'result type is incorrect');\n assert.strictEqual(result.name(), 'script', 'name was not set correctly');\n assert.strictEqual(result.title(), 'Script', 'title was not set correctly');\n assert.strictEqual(result.category().title(), 'JavaScript', 'category title was not set correctly');\n assert.strictEqual(result.category().shortTitle(), 'JS', 'category short title was not set correctly');\n assert.isTrue(result.isTextType(), 'resource type was not set correctly');\n });\n\n it('is able to return an wasm resource from the string \"application/wasm\"', () => {\n const result = ResourceType.fromMimeTypeOverride('application/wasm');\n assert.instanceOf(result, ResourceType, 'result type is incorrect');\n assert.strictEqual(result!.name(), 'wasm', 'name was not set correctly');\n assert.strictEqual(result!.title(), 'Wasm', 'title was not set correctly');\n assert.strictEqual(result!.category().title(), 'WebAssembly', 'category title was not set correctly');\n assert.strictEqual(result!.category().shortTitle(), 'Wasm', 'category short title was not set correctly');\n assert.isFalse(result!.isTextType(), 'resource type was not set correctly');\n });\n\n it('is able to return an web bundle resource from the string \"application/webbundle\"', () => {\n const result = ResourceType.fromMimeTypeOverride('application/webbundle');\n assert.instanceOf(result, ResourceType, 'result type is incorrect');\n assert.strictEqual(result!.name(), 'webbundle', 'name was not set correctly');\n assert.strictEqual(result!.title(), 'WebBundle', 'title was not set correctly');\n assert.strictEqual(result!.category().title(), 'Other', 'category title was not set correctly');\n assert.strictEqual(result!.category().shortTitle(), 'Other', 'category short title was not set correctly');\n assert.isFalse(result!.isTextType(), 'resource type was not set correctly');\n });\n\n it('is able to return a resource of type other from the string \"test/resource\"', () => {\n const result = ResourceType.fromMimeType('test/resource');\n assert.instanceOf(result, ResourceType, 'result type is incorrect');\n assert.strictEqual(result.name(), 'other', 'name was not set correctly');\n assert.strictEqual(result.title(), 'Other', 'title was not set correctly');\n assert.strictEqual(result.category().title(), 'Other', 'category title was not set correctly');\n assert.strictEqual(result.category().shortTitle(), 'Other', 'category short title was not set correctly');\n assert.isFalse(result.isTextType(), 'resource type was not set correctly');\n });\n\n it('is able to return a resource type from a URL that contains a mapped extension', () => {\n const result = ResourceType.fromURL('http://www.example.com/test/testFile.js');\n assert.instanceOf(result, ResourceType, 'result type is incorrect');\n assert.strictEqual(result!.name(), 'script', 'name was not set correctly');\n assert.strictEqual(result!.title(), 'Script', 'title was not set correctly');\n assert.strictEqual(result!.category().title(), 'JavaScript', 'category title was not set correctly');\n assert.strictEqual(result!.category().shortTitle(), 'JS', 'category short title was not set correctly');\n assert.isTrue(result!.isTextType(), 'resource type was not set correctly');\n });\n\n it('is able to return a resource type from a URL that ends in .avif', () => {\n const result = ResourceType.fromURL('https://host.example/image.avif');\n assert.instanceOf(result, ResourceType, 'result type is incorrect');\n assert.strictEqual(result!.name(), 'image', 'name was not set correctly');\n assert.strictEqual(result!.title(), 'Image', 'title was not set correctly');\n assert.strictEqual(result!.category().title(), 'Image', 'category title was not set correctly');\n assert.strictEqual(result!.category().shortTitle(), 'Img', 'category short title was not set correctly');\n assert.isTrue(result!.isImage(), 'resource type was not set correctly');\n });\n\n it('is able to return a resource type from a URL that ends in .jxl', () => {\n const result = ResourceType.fromURL('https://host.example/image.jxl');\n assert.instanceOf(result, ResourceType, 'result type is incorrect');\n assert.strictEqual(result!.name(), 'image', 'name was not set correctly');\n assert.strictEqual(result!.title(), 'Image', 'title was not set correctly');\n assert.strictEqual(result!.category().title(), 'Image', 'category title was not set correctly');\n assert.strictEqual(result!.category().shortTitle(), 'Img', 'category short title was not set correctly');\n assert.isTrue(result!.isImage(), 'resource type was not set correctly');\n });\n\n it('is able to return a resource type from a URL that ends in .woff2', () => {\n const result = ResourceType.fromURL('https://host.example/image.woff2');\n assert.instanceOf(result, ResourceType, 'result type is incorrect');\n assert.strictEqual(result!.name(), 'font', 'name was not set correctly');\n assert.strictEqual(result!.title(), 'Font', 'title was not set correctly');\n assert.strictEqual(result!.category().title(), 'Font', 'category title was not set correctly');\n assert.strictEqual(result!.category().shortTitle(), 'Font', 'category short title was not set correctly');\n assert.isFalse(result!.isTextType(), 'resource type was not set correctly');\n });\n\n it('is able to return null from a URL that contains an unmapped extension', () => {\n const result = ResourceType.fromURL('http://www.example.com/test/testFile.testExt');\n assert.isNull(result, 'result is not null');\n });\n\n it('is able to return a resource type from a mapped name', () => {\n const result = ResourceType.fromName('script');\n assert.instanceOf(result, ResourceType, 'result type is incorrect');\n assert.strictEqual(result!.name(), 'script', 'name was not set correctly');\n assert.strictEqual(result!.title(), 'Script', 'title was not set correctly');\n assert.strictEqual(result!.category().title(), 'JavaScript', 'category title was not set correctly');\n assert.strictEqual(result!.category().shortTitle(), 'JS', 'category short title was not set correctly');\n assert.isTrue(result!.isTextType(), 'resource type was not set correctly');\n });\n\n it('is able to return null from an unmapped name', () => {\n const result = ResourceType.fromName('testName');\n assert.isNull(result, 'result is not null');\n });\n\n it('is able to return a mime from URL that contains a mapped extension', () => {\n const result = ResourceType.mimeFromURL('http://www.example.com/test/path.html' as Platform.DevToolsPath.UrlString);\n assert.strictEqual(result, 'text/html', 'mime returned was not correct');\n });\n\n it('is able to return a mime from URL that contains an unmapped extension', () => {\n const result =\n ResourceType.mimeFromURL('http://www.example.com/test/path.testExt' as Platform.DevToolsPath.UrlString);\n assert.isUndefined(result, 'mime returned was not correct');\n });\n\n it('is able to return a mime from URL that contains a mapped name', () => {\n const result = ResourceType.mimeFromURL('http://www.example.com/test/Cakefile' as Platform.DevToolsPath.UrlString);\n assert.strictEqual(result, 'text/x-coffeescript', 'mime returned was not correct');\n });\n\n it('is able to return a mime from a mapped extension', () => {\n const result = ResourceType.mimeFromExtension('html');\n assert.strictEqual(result, 'text/html', 'mime returned was not correct');\n });\n\n it('is able to return a mime from an unmapped extension', () => {\n const result = ResourceType.mimeFromExtension('testExt');\n assert.isUndefined(result, 'mime returned was not correct');\n });\n\n it('is able to return its title successfully', () => {\n const testResourceCategory = new ResourceCategory('category name', categoryTestTitle, categoryTestShortTitle);\n const resourceType = new ResourceType('Type Test Name', typeTestTitle, testResourceCategory, true);\n assert.strictEqual(resourceType.title(), 'Type Test Title', 'title was not returned correctly');\n });\n\n it('is able to return its isTextType value successfully', () => {\n const testResourceCategory = new ResourceCategory('category name', categoryTestTitle, categoryTestShortTitle);\n const resourceType = new ResourceType('Type Test Name', typeTestTitle, testResourceCategory, true);\n assert.isTrue(resourceType.isTextType(), 'isTextType was not returned correctly');\n });\n\n it('is able to return whether or not its a script if its name equals the value \"script\"', () => {\n const testResourceCategory = new ResourceCategory('category name', categoryTestTitle, categoryTestShortTitle);\n const resourceType = new ResourceType('script', typeTestTitle, testResourceCategory, true);\n assert.isTrue(resourceType.isScript(), 'the resource should be considered as a script');\n });\n\n it('is able to return whether or not its a script if its name equals the value \"sm-script\"', () => {\n const testResourceCategory = new ResourceCategory('category name', categoryTestTitle, categoryTestShortTitle);\n const resourceType = new ResourceType('sm-script', typeTestTitle, testResourceCategory, true);\n assert.isTrue(resourceType.isScript(), 'the resource should be considered as a script');\n });\n\n it('is able to return whether or not its a script if its name is not equal to the values \"script\" or \"sm-script\"',\n () => {\n const testResourceCategory = new ResourceCategory('category name', categoryTestTitle, categoryTestShortTitle);\n const resourceType = new ResourceType('Type Test Name', typeTestTitle, testResourceCategory, true);\n assert.isFalse(resourceType.isScript(), 'the resource should not be considered as a script');\n });\n\n it('is able to return whether or not its a document if its name equals the value \"document\"', () => {\n const testResourceCategory = new ResourceCategory('category name', categoryTestTitle, categoryTestShortTitle);\n const resourceType = new ResourceType('document', typeTestTitle, testResourceCategory, true);\n assert.isTrue(resourceType.isDocument(), 'the resource should be considered as a document');\n });\n\n it('is able to return whether or not its a document if its name does not equal the value \"document\"', () => {\n const testResourceCategory = new ResourceCategory('category name', categoryTestTitle, categoryTestShortTitle);\n const resourceType = new ResourceType('Type Test Name', typeTestTitle, testResourceCategory, true);\n assert.isFalse(resourceType.isDocument(), 'the resource should not be considered as a document');\n });\n\n it('is able to determine if a resource has scripts if it is a script', () => {\n const testResourceCategory = new ResourceCategory('category name', categoryTestTitle, categoryTestShortTitle);\n const resourceType = new ResourceType('script', typeTestTitle, testResourceCategory, true);\n assert.isTrue(resourceType.hasScripts(), 'the resource should be considered as a having scripts');\n });\n\n it('is able to determine if a resource has scripts if it is a document', () => {\n const testResourceCategory = new ResourceCategory('category name', categoryTestTitle, categoryTestShortTitle);\n const resourceType = new ResourceType('document', typeTestTitle, testResourceCategory, true);\n assert.isTrue(resourceType.hasScripts(), 'the resource should be considered as a having scripts');\n });\n\n it('is able to determine if a resource has scripts if it is not a script or a document', () => {\n const testResourceCategory = new ResourceCategory('category name', categoryTestTitle, categoryTestShortTitle);\n const resourceType = new ResourceType('Type Test Name', typeTestTitle, testResourceCategory, true);\n assert.isFalse(resourceType.hasScripts(), 'the resource should not be considered as a having scripts');\n });\n\n it('is able to return whether or not its a stylesheet if its name equals the value \"stylesheet\"', () => {\n const testResourceCategory = new ResourceCategory('category name', categoryTestTitle, categoryTestShortTitle);\n const resourceType = new ResourceType('stylesheet', typeTestTitle, testResourceCategory, true);\n assert.isTrue(resourceType.isStyleSheet(), 'the resource should be considered as a stylesheet');\n });\n\n it('is able to return whether or not its a stylesheet if its name equals the value \"sm-stylesheet\"', () => {\n const testResourceCategory = new ResourceCategory('category name', categoryTestTitle, categoryTestShortTitle);\n const resourceType = new ResourceType('sm-stylesheet', typeTestTitle, testResourceCategory, true);\n assert.isTrue(resourceType.isStyleSheet(), 'the resource should be considered as a stylesheet');\n });\n\n it('is able to return whether or not its a stylesheet if its name is not equal to the values \"stylesheet\" or \"sm-stylesheet\"',\n () => {\n const testResourceCategory = new ResourceCategory('category name', categoryTestTitle, categoryTestShortTitle);\n const resourceType = new ResourceType('Type Test Name', typeTestTitle, testResourceCategory, true);\n assert.isFalse(resourceType.isStyleSheet(), 'the resource should not be considered as a stylesheet');\n });\n\n it('is able to return whether it is a document, a script or a stylesheet if it was a document', () => {\n const testResourceCategory = new ResourceCategory('category name', categoryTestTitle, categoryTestShortTitle);\n const resourceType = new ResourceType('document', typeTestTitle, testResourceCategory, true);\n assert.isTrue(resourceType.isDocumentOrScriptOrStyleSheet(), 'the resource should be considered as a document');\n });\n\n it('is able to return whether it is a document, a script or a stylesheet if it was a script', () => {\n const testResourceCategory = new ResourceCategory('category name', categoryTestTitle, categoryTestShortTitle);\n const resourceType = new ResourceType('script', typeTestTitle, testResourceCategory, true);\n assert.isTrue(resourceType.isDocumentOrScriptOrStyleSheet(), 'the resource should be considered as a script');\n });\n\n it('is able to return whether it is a document, a script or a stylesheet if it was a stylesheet', () => {\n const testResourceCategory = new ResourceCategory('category name', categoryTestTitle, categoryTestShortTitle);\n const resourceType = new ResourceType('stylesheet', typeTestTitle, testResourceCategory, true);\n assert.isTrue(resourceType.isDocumentOrScriptOrStyleSheet(), 'the resource should be considered as a stylesheet');\n });\n\n it('is able to return whether it is a document, a script or a stylesheet if it was none of those things', () => {\n const testResourceCategory = new ResourceCategory('category name', categoryTestTitle, categoryTestShortTitle);\n const resourceType = new ResourceType('Type Test Name', typeTestTitle, testResourceCategory, true);\n assert.isFalse(\n resourceType.isDocumentOrScriptOrStyleSheet(),\n 'the resource should be considered as a doucment, a script or a stylesheet');\n });\n\n it('is able to determine if it is from source map if it began with \"sm-\"', () => {\n const testResourceCategory = new ResourceCategory('category name', categoryTestTitle, categoryTestShortTitle);\n const resourceType = new ResourceType('sm-Type Test Name', typeTestTitle, testResourceCategory, true);\n assert.isTrue(resourceType.isFromSourceMap(), 'the resource should be considered to be from source map');\n });\n\n it('is able to determine if it is from source map if it did not begin with \"sm-\"', () => {\n const testResourceCategory = new ResourceCategory('category name', categoryTestTitle, categoryTestShortTitle);\n const resourceType = new ResourceType('Type Test Name', typeTestTitle, testResourceCategory, true);\n assert.isFalse(resourceType.isFromSourceMap(), 'the resource should not be considered to be from source map');\n });\n\n it('is able to be converted to a string by returning its name', () => {\n const testResourceCategory = new ResourceCategory('category name', categoryTestTitle, categoryTestShortTitle);\n const resourceType = new ResourceType('Type Test Name', typeTestTitle, testResourceCategory, true);\n assert.strictEqual(\n resourceType.toString(), 'Type Test Name', 'the resource type was not converted to a string correctly');\n });\n\n it('is able to return the canonical mime type of a document', () => {\n const testResourceCategory = new ResourceCategory('category name', categoryTestTitle, categoryTestShortTitle);\n const resourceType = new ResourceType('document', typeTestTitle, testResourceCategory, true);\n assert.strictEqual(\n resourceType.canonicalMimeType(), 'text/html', 'the canonical mime type was not returned correctly');\n });\n\n it('is able to return the canonical mime type of a script', () => {\n const testResourceCategory = new ResourceCategory('category name', categoryTestTitle, categoryTestShortTitle);\n const resourceType = new ResourceType('script', typeTestTitle, testResourceCategory, true);\n assert.strictEqual(\n resourceType.canonicalMimeType(), 'text/javascript', 'the canonical mime type was not returned correctly');\n });\n\n it('is able to return the canonical mime type of a stylesheet', () => {\n const testResourceCategory = new ResourceCategory('category name', categoryTestTitle, categoryTestShortTitle);\n const resourceType = new ResourceType('stylesheet', typeTestTitle, testResourceCategory, true);\n assert.strictEqual(\n resourceType.canonicalMimeType(), 'text/css', 'the canonical mime type was not returned correctly');\n });\n\n it('returns an empty string as a canonical mime type if it was not a document, a script or a stylesheet', () => {\n const testResourceCategory = new ResourceCategory('category name', categoryTestTitle, categoryTestShortTitle);\n const resourceType = new ResourceType('Type Test Name', typeTestTitle, testResourceCategory, true);\n assert.strictEqual(resourceType.canonicalMimeType(), '', 'the canonical mime type was not returned correctly');\n });\n\n it('is able to return the simplified content type of a json subtype', () => {\n assert.strictEqual(\n ResourceType.simplifyContentType('application/sparql-results+json'), 'application/json',\n 'the simplified content type was not returned correctly');\n\n assert.strictEqual(\n ResourceType.simplifyContentType('application/hal+json'), 'application/json',\n 'the simplified content type was not returned correctly');\n\n assert.strictEqual(\n ResourceType.simplifyContentType('application/json+protobuf'), 'application/json',\n 'the simplified content type was not returned correctly');\n });\n\n it('simplifyContentType() does not affect other content types than json subtypes', () => {\n assert.strictEqual(\n ResourceType.simplifyContentType('text/javascript'), 'text/javascript',\n 'the simplified content type was not returned correctly');\n\n assert.strictEqual(\n ResourceType.simplifyContentType('application/json'), 'application/json',\n 'the simplified content type was not returned correctly');\n });\n\n it('treats a Ping as Other', () => {\n const resourceType = resourceTypes.Ping;\n assert.isFalse(resourceType.isTextType(), 'A ping is not a text type');\n assert.strictEqual(resourceType.canonicalMimeType(), '', 'A ping does not have an associated mime type');\n });\n\n it('treats a CSPViolationsReport as Other', () => {\n const resourceType = resourceTypes.CSPViolationReport;\n assert.isFalse(resourceType.isTextType(), 'A ping is not a text type');\n assert.strictEqual(resourceType.canonicalMimeType(), '', 'A ping does not have an associated mime type');\n });\n});\n\ndescribe('ResourceType', () => {\n describe('hasStyleSheet', () => {\n it('holds true for documents', () => {\n assert.isTrue(resourceTypes.Document.hasStyleSheets());\n });\n\n it('holds true for stylesheets', () => {\n assert.isTrue(resourceTypes.Stylesheet.hasStyleSheets());\n });\n });\n\n describe('mimeFromExtension', () => {\n it('returns correct MIME type for .dart files', () => {\n assert.strictEqual(ResourceType.mimeFromExtension('dart'), 'application/vnd.dart');\n });\n\n it('returns correct MIME type for Go files', () => {\n assert.strictEqual(ResourceType.mimeFromExtension('go'), 'text/x-go');\n });\n\n it('returns correct MIME type for .gss files', () => {\n assert.strictEqual(ResourceType.mimeFromExtension('gss'), 'text/x-gss');\n });\n\n it('returns correct MIME type for .kt files', () => {\n assert.strictEqual(ResourceType.mimeFromExtension('kt'), 'text/x-kotlin');\n });\n\n it('returns correct MIME type for .less files', () => {\n assert.strictEqual(ResourceType.mimeFromExtension('less'), 'text/x-less');\n });\n\n it('returns correct MIME type for .php files', () => {\n assert.strictEqual(ResourceType.mimeFromExtension('php'), 'application/x-httpd-php');\n });\n\n it('returns correct MIME type for SASS files', () => {\n assert.strictEqual(ResourceType.mimeFromExtension('sass'), 'text/x-sass');\n assert.strictEqual(ResourceType.mimeFromExtension('scss'), 'text/x-scss');\n });\n\n it('returns correct MIME type for Scala files', () => {\n assert.strictEqual(ResourceType.mimeFromExtension('scala'), 'text/x-scala');\n });\n\n it('returns correct MIME type for .component.html files', () => {\n assert.strictEqual(ResourceType.mimeFromExtension('component.html'), 'text/x.angular');\n });\n\n it('returns correct MIME type for .svelte files', () => {\n assert.strictEqual(ResourceType.mimeFromExtension('svelte'), 'text/x.svelte');\n });\n\n it('returns correct MIME type for .vue files', () => {\n assert.strictEqual(ResourceType.mimeFromExtension('vue'), 'text/x.vue');\n });\n\n it('returns correct MIME type for .webmanifest files', () => {\n assert.strictEqual(ResourceType.mimeFromExtension('webmanifest'), 'application/manifest+json');\n });\n\n it('returns correct MIME type for source maps', () => {\n assert.strictEqual(ResourceType.mimeFromExtension('map'), 'application/json');\n });\n });\n\n describe('mimeFromURL', () => {\n it('returns correct MIME type for .dart files', () => {\n const url = 'http://localhost/example.dart' as Platform.DevToolsPath.UrlString;\n assert.strictEqual(ResourceType.mimeFromURL(url), 'application/vnd.dart');\n });\n\n it('returns correct MIME type for Go files', () => {\n const url = 'https://staging.server.com/main.go' as Platform.DevToolsPath.UrlString;\n assert.strictEqual(ResourceType.mimeFromURL(url), 'text/x-go');\n });\n\n it('returns correct MIME type for .gss files', () => {\n const url = 'https://staging.server.com/styles.gss' as Platform.DevToolsPath.UrlString;\n assert.strictEqual(ResourceType.mimeFromURL(url), 'text/x-gss');\n });\n\n it('returns correct MIME type for .kt files', () => {\n const url = 'https://staging.server.com/Main.kt' as Platform.DevToolsPath.UrlString;\n assert.strictEqual(ResourceType.mimeFromURL(url), 'text/x-kotlin');\n });\n\n it('returns correct MIME type for .less files', () => {\n const url = 'https://staging.server.com/styles.less' as Platform.DevToolsPath.UrlString;\n assert.strictEqual(ResourceType.mimeFromURL(url), 'text/x-less');\n });\n\n it('returns correct MIME type for .php files', () => {\n const url = 'http://localhost/file.php' as Platform.DevToolsPath.UrlString;\n assert.strictEqual(ResourceType.mimeFromURL(url), 'application/x-httpd-php');\n });\n\n it('returns correct MIME type for SASS files', () => {\n assert.strictEqual(\n ResourceType.mimeFromURL('https://staging.server.com/styles.sass' as Platform.DevToolsPath.UrlString),\n 'text/x-sass');\n assert.strictEqual(\n ResourceType.mimeFromURL('https://staging.server.com/styles.scss' as Platform.DevToolsPath.UrlString),\n 'text/x-scss');\n });\n\n it('returns correct MIME type for Scala files', () => {\n const url = 'http://localhost/App.scala' as Platform.DevToolsPath.UrlString;\n assert.strictEqual(ResourceType.mimeFromURL(url), 'text/x-scala');\n });\n\n it('returns correct MIME type for Angular component templates', () => {\n const url = 'http://localhost/src/app/app.component.html' as Platform.DevToolsPath.UrlString;\n assert.strictEqual(ResourceType.mimeFromURL(url), 'text/x.angular');\n });\n\n it('returns correct MIME type for .svelte files', () => {\n const url = 'http://localhost/App.svelte' as Platform.DevToolsPath.UrlString;\n assert.strictEqual(ResourceType.mimeFromURL(url), 'text/x.svelte');\n });\n\n it('returns correct MIME type for .vue files', () => {\n const url = 'http://localhost/App.vue' as Platform.DevToolsPath.UrlString;\n assert.strictEqual(ResourceType.mimeFromURL(url), 'text/x.vue');\n });\n\n it('returns correct MIME type for .webmanifest files', () => {\n const url = 'http://localhost/app.webmanifest' as Platform.DevToolsPath.UrlString;\n assert.strictEqual(ResourceType.mimeFromURL(url), 'application/manifest+json');\n });\n\n it('returns correct MIME type for source maps', () => {\n const url = 'http://localhost/bundle.min.js.map' as Platform.DevToolsPath.UrlString;\n assert.strictEqual(ResourceType.mimeFromURL(url), 'application/json');\n });\n });\n});\n"]} \ No newline at end of file diff --git a/public/core/common/SettingRegistration.test.js b/public/core/common/SettingRegistration.test.js index 1187ef778..0c7124bdb 100644 --- a/public/core/common/SettingRegistration.test.js +++ b/public/core/common/SettingRegistration.test.js @@ -53,8 +53,8 @@ describe('SettingRegistration', () => { command.category === Common.Settings.getLocalizedSettingsCategory(settingCategory)); const enableSettingCommands = allCommands.filter(command => command.title === enableTitle && command.category === Common.Settings.getLocalizedSettingsCategory(settingCategory)); - assert.strictEqual(disableSettingCommands.length, 1, 'Commands for changing a setting\'s value were not added correctly'); - assert.strictEqual(enableSettingCommands.length, 1, 'Commands for changing a setting\'s value were not added correctly'); + assert.lengthOf(disableSettingCommands, 1, 'Commands for changing a setting\'s value were not added correctly'); + assert.lengthOf(enableSettingCommands, 1, 'Commands for changing a setting\'s value were not added correctly'); }); it('triggers a setting\'s change listener when a setting is set', () => { const preRegisteredSetting = Common.Settings.Settings.instance().moduleSetting(settingName); diff --git a/public/core/common/SettingRegistration.test.js.map b/public/core/common/SettingRegistration.test.js.map index dd13e05dc..cbc6f84ad 100644 --- a/public/core/common/SettingRegistration.test.js.map +++ b/public/core/common/SettingRegistration.test.js.map @@ -1 +1 @@ -{"version":3,"file":"SettingRegistration.test.js","sourceRoot":"","sources":["../../../../../../front_end/core/common/SettingRegistration.test.ts"],"names":[],"mappings":"AAAA,gEAAgE;AAChE,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,EACL,sBAAsB,EACtB,oBAAoB,GACrB,MAAM,qCAAqC,CAAC;AAC7C,OAAO,KAAK,SAAS,MAAM,qDAAqD,CAAC;AACjF,OAAO,KAAK,IAAI,MAAM,iBAAiB,CAAC;AAGxC,OAAO,KAAK,MAAM,MAAM,aAAa,CAAC;AAEtC,MAAM,WAAW,GAAG,cAAc,CAAC;AACnC,MAAM,YAAY,GAAG,cAAc,CAAC;AACpC,MAAM,WAAW,GAAG,qBAAqB,CAAC;AAC1C,MAAM,YAAY,GAAG,sBAAsB,CAAC;AAE5C,QAAQ,CAAC,qBAAqB,EAAE,GAAG,EAAE;IACnC,2EAA2E;IAC3E,wBAAwB;IACxB,MAAM,eAAe,0DAA0C,CAAC;IAEhE,MAAM,CAAC,KAAK,IAAI,EAAE;QAChB,MAAM,CAAC,QAAQ,CAAC,uBAAuB,CACnC,CAAC;gBACC,QAAQ,EAAE,eAAe;gBACzB,KAAK,EAAE,IAAI,CAAC,IAAI,CAAC,gBAAgB,CAAC,YAAY,CAAC;gBAC/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AAE;gBACN,uBAAuB,EAAE;oBACvB,OAAO,EAAE,WAAW;oBACpB,WAAW,EAAE,CAAC,CAAC;oBACf,OAAO,EAAE,IAAI;iBACd;aACyB;SAC7B,CAAC,CAAC;QACH,MAAM,OAAO,GAAG,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,QAAQ,EAAE,CAAC,aAAa,CAAC,iBAAiB,CAAC,CAAC;QACrF,MAAM,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;QAC1B,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC;IAChC,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["// Copyright (c) 2020 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport {\n deinitializeGlobalVars,\n initializeGlobalVars,\n} from '../../testing/EnvironmentHelpers.js';\nimport * as QuickOpen from '../../ui/legacy/components/quick_open/quick_open.js';\nimport * as i18n from '../i18n/i18n.js';\nimport type * as Root from '../root/root.js';\n\nimport * as Common from './common.js';\n\nconst settingName = 'mock-setting';\nconst settingTitle = 'Mock setting';\nconst enableTitle = 'Enable mock setting';\nconst disableTitle = 'Disable mock setting';\n\ndescribe('SettingRegistration', () => {\n // const enum `SettingCategory` not available in top level scope, thats why\n // its initialized here.\n const settingCategory = Common.Settings.SettingCategory.CONSOLE;\n\n before(async () => {\n Common.Settings.registerSettingsForTest(\n [{\n category: settingCategory,\n title: i18n.i18n.lockedLazyString(settingTitle),\n settingType: Common.Settings.SettingType.BOOLEAN,\n settingName,\n defaultValue: false,\n options: [\n {\n value: true,\n title: i18n.i18n.lockedLazyString(enableTitle),\n },\n {\n value: false,\n title: i18n.i18n.lockedLazyString(disableTitle),\n },\n ],\n }],\n true);\n await initializeGlobalVars({reset: false});\n });\n\n after(async () => {\n await deinitializeGlobalVars();\n });\n\n it('retrieves a registered setting', () => {\n try {\n const preRegisteredSetting =\n Common.Settings.Settings.instance().moduleSetting(settingName) as Common.Settings.Setting;\n assert.strictEqual(preRegisteredSetting.title(), settingTitle, 'Setting title is not returned correctly');\n assert.strictEqual(\n preRegisteredSetting.category(), settingCategory, 'Setting category is not returned correctly');\n assert.isNotTrue(preRegisteredSetting.get(), 'Setting value is not returned correctly');\n } catch (error) {\n assert.fail('Failed to find setting registration');\n }\n });\n\n it('adds commands for changing a setting\\'s value', () => {\n const allCommands = QuickOpen.CommandMenu.CommandMenu.instance({forceNew: true}).commands();\n const disableSettingCommands = allCommands.filter(\n command => command.title === disableTitle &&\n command.category === Common.Settings.getLocalizedSettingsCategory(settingCategory));\n const enableSettingCommands = allCommands.filter(\n command => command.title === enableTitle &&\n command.category === Common.Settings.getLocalizedSettingsCategory(settingCategory));\n assert.strictEqual(\n disableSettingCommands.length, 1, 'Commands for changing a setting\\'s value were not added correctly');\n assert.strictEqual(\n enableSettingCommands.length, 1, 'Commands for changing a setting\\'s value were not added correctly');\n });\n\n it('triggers a setting\\'s change listener when a setting is set', () => {\n const preRegisteredSetting = Common.Settings.Settings.instance().moduleSetting(settingName);\n let settingChanged = false;\n preRegisteredSetting.addChangeListener(() => {\n settingChanged = true;\n });\n preRegisteredSetting.set(true);\n assert.isTrue(settingChanged, 'Setting\\'s change listener was not triggered after the setting was set');\n });\n\n it('throws an error when trying to register a duplicated setting name', () => {\n assert.throws(() => {\n Common.Settings.registerSettingExtension({\n settingName,\n settingType: Common.Settings.SettingType.BOOLEAN,\n defaultValue: false,\n });\n });\n });\n\n it('deletes a registered setting using its name', () => {\n const removalResult = Common.Settings.maybeRemoveSettingExtension(settingName);\n assert.isTrue(removalResult);\n assert.doesNotThrow(() => {\n Common.Settings.registerSettingExtension({\n settingName,\n settingType: Common.Settings.SettingType.BOOLEAN,\n defaultValue: false,\n });\n });\n });\n\n it('can handle settings with condition which depends on host config', () => {\n const configSettingName = 'mock-setting-with-host-config';\n Common.Settings.registerSettingExtension({\n settingName: configSettingName,\n settingType: Common.Settings.SettingType.BOOLEAN,\n defaultValue: false,\n condition: config => {\n return config?.devToolsConsoleInsights?.enabled === true;\n },\n });\n assert.throws(() => Common.Settings.Settings.instance().moduleSetting(configSettingName));\n\n const dummyStorage = new Common.Settings.SettingsStorage({});\n Common.Settings.Settings.instance({\n forceNew: true,\n syncedStorage: dummyStorage,\n globalStorage: dummyStorage,\n localStorage: dummyStorage,\n config: {\n devToolsConsoleInsights: {\n modelId: 'mockModel',\n temperature: -1,\n enabled: true,\n },\n } as Root.Runtime.HostConfig,\n });\n const setting = Common.Settings.Settings.instance().moduleSetting(configSettingName);\n assert.isNotNull(setting);\n assert.isFalse(setting.get());\n });\n});\n"]} \ No newline at end of file +{"version":3,"file":"SettingRegistration.test.js","sourceRoot":"","sources":["../../../../../../front_end/core/common/SettingRegistration.test.ts"],"names":[],"mappings":"AAAA,gEAAgE;AAChE,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,EACL,sBAAsB,EACtB,oBAAoB,GACrB,MAAM,qCAAqC,CAAC;AAC7C,OAAO,KAAK,SAAS,MAAM,qDAAqD,CAAC;AACjF,OAAO,KAAK,IAAI,MAAM,iBAAiB,CAAC;AAGxC,OAAO,KAAK,MAAM,MAAM,aAAa,CAAC;AAEtC,MAAM,WAAW,GAAG,cAAc,CAAC;AACnC,MAAM,YAAY,GAAG,cAAc,CAAC;AACpC,MAAM,WAAW,GAAG,qBAAqB,CAAC;AAC1C,MAAM,YAAY,GAAG,sBAAsB,CAAC;AAE5C,QAAQ,CAAC,qBAAqB,EAAE,GAAG,EAAE;IACnC,2EAA2E;IAC3E,wBAAwB;IACxB,MAAM,eAAe,0DAA0C,CAAC;IAEhE,MAAM,CAAC,KAAK,IAAI,EAAE;QAChB,MAAM,CAAC,QAAQ,CAAC,uBAAuB,CACnC,CAAC;gBACC,QAAQ,EAAE,eAAe;gBACzB,KAAK,EAAE,IAAI,CAAC,IAAI,CAAC,gBAAgB,CAAC,YAAY,CAAC;gBAC/C,WAAW,qDAAqC;gBAChD,W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AW;oBACpB,WAAW,EAAE,CAAC,CAAC;oBACf,OAAO,EAAE,IAAI;iBACd;aACyB;SAC7B,CAAC,CAAC;QACH,MAAM,OAAO,GAAG,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,QAAQ,EAAE,CAAC,aAAa,CAAC,iBAAiB,CAAC,CAAC;QACrF,MAAM,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;QAC1B,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC;IAChC,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["// Copyright (c) 2020 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport {\n deinitializeGlobalVars,\n initializeGlobalVars,\n} from '../../testing/EnvironmentHelpers.js';\nimport * as QuickOpen from '../../ui/legacy/components/quick_open/quick_open.js';\nimport * as i18n from '../i18n/i18n.js';\nimport type * as Root from '../root/root.js';\n\nimport * as Common from './common.js';\n\nconst settingName = 'mock-setting';\nconst settingTitle = 'Mock setting';\nconst enableTitle = 'Enable mock setting';\nconst disableTitle = 'Disable mock setting';\n\ndescribe('SettingRegistration', () => {\n // const enum `SettingCategory` not available in top level scope, thats why\n // its initialized here.\n const settingCategory = Common.Settings.SettingCategory.CONSOLE;\n\n before(async () => {\n Common.Settings.registerSettingsForTest(\n [{\n category: settingCategory,\n title: i18n.i18n.lockedLazyString(settingTitle),\n settingType: Common.Settings.SettingType.BOOLEAN,\n settingName,\n defaultValue: false,\n options: [\n {\n value: true,\n title: i18n.i18n.lockedLazyString(enableTitle),\n },\n {\n value: false,\n title: i18n.i18n.lockedLazyString(disableTitle),\n },\n ],\n }],\n true);\n await initializeGlobalVars({reset: false});\n });\n\n after(async () => {\n await deinitializeGlobalVars();\n });\n\n it('retrieves a registered setting', () => {\n try {\n const preRegisteredSetting =\n Common.Settings.Settings.instance().moduleSetting(settingName) as Common.Settings.Setting;\n assert.strictEqual(preRegisteredSetting.title(), settingTitle, 'Setting title is not returned correctly');\n assert.strictEqual(\n preRegisteredSetting.category(), settingCategory, 'Setting category is not returned correctly');\n assert.isNotTrue(preRegisteredSetting.get(), 'Setting value is not returned correctly');\n } catch (error) {\n assert.fail('Failed to find setting registration');\n }\n });\n\n it('adds commands for changing a setting\\'s value', () => {\n const allCommands = QuickOpen.CommandMenu.CommandMenu.instance({forceNew: true}).commands();\n const disableSettingCommands = allCommands.filter(\n command => command.title === disableTitle &&\n command.category === Common.Settings.getLocalizedSettingsCategory(settingCategory));\n const enableSettingCommands = allCommands.filter(\n command => command.title === enableTitle &&\n command.category === Common.Settings.getLocalizedSettingsCategory(settingCategory));\n assert.lengthOf(disableSettingCommands, 1, 'Commands for changing a setting\\'s value were not added correctly');\n assert.lengthOf(enableSettingCommands, 1, 'Commands for changing a setting\\'s value were not added correctly');\n });\n\n it('triggers a setting\\'s change listener when a setting is set', () => {\n const preRegisteredSetting = Common.Settings.Settings.instance().moduleSetting(settingName);\n let settingChanged = false;\n preRegisteredSetting.addChangeListener(() => {\n settingChanged = true;\n });\n preRegisteredSetting.set(true);\n assert.isTrue(settingChanged, 'Setting\\'s change listener was not triggered after the setting was set');\n });\n\n it('throws an error when trying to register a duplicated setting name', () => {\n assert.throws(() => {\n Common.Settings.registerSettingExtension({\n settingName,\n settingType: Common.Settings.SettingType.BOOLEAN,\n defaultValue: false,\n });\n });\n });\n\n it('deletes a registered setting using its name', () => {\n const removalResult = Common.Settings.maybeRemoveSettingExtension(settingName);\n assert.isTrue(removalResult);\n assert.doesNotThrow(() => {\n Common.Settings.registerSettingExtension({\n settingName,\n settingType: Common.Settings.SettingType.BOOLEAN,\n defaultValue: false,\n });\n });\n });\n\n it('can handle settings with condition which depends on host config', () => {\n const configSettingName = 'mock-setting-with-host-config';\n Common.Settings.registerSettingExtension({\n settingName: configSettingName,\n settingType: Common.Settings.SettingType.BOOLEAN,\n defaultValue: false,\n condition: config => {\n return config?.devToolsConsoleInsights?.enabled === true;\n },\n });\n assert.throws(() => Common.Settings.Settings.instance().moduleSetting(configSettingName));\n\n const dummyStorage = new Common.Settings.SettingsStorage({});\n Common.Settings.Settings.instance({\n forceNew: true,\n syncedStorage: dummyStorage,\n globalStorage: dummyStorage,\n localStorage: dummyStorage,\n config: {\n devToolsConsoleInsights: {\n modelId: 'mockModel',\n temperature: -1,\n enabled: true,\n },\n } as Root.Runtime.HostConfig,\n });\n const setting = Common.Settings.Settings.instance().moduleSetting(configSettingName);\n assert.isNotNull(setting);\n assert.isFalse(setting.get());\n });\n});\n"]} \ No newline at end of file diff --git a/public/core/dom_extension/DOMExtension.js b/public/core/dom_extension/DOMExtension.js index 73d2a64c6..e7ccb714a 100644 --- a/public/core/dom_extension/DOMExtension.js +++ b/public/core/dom_extension/DOMExtension.js @@ -154,15 +154,14 @@ self.createTextNode = function (data) { self.createDocumentFragment = function () { return document.createDocumentFragment(); }; -Element.prototype.createChild = function (elementName, className, customElementType) { - const element = document.createElement(elementName, { is: customElementType }); +DocumentFragment.prototype.createChild = Element.prototype.createChild = function (elementName, className) { + const element = document.createElement(elementName); if (className) { element.className = className; } this.appendChild(element); return element; }; -DocumentFragment.prototype.createChild = Element.prototype.createChild; self.AnchorBox = class { constructor(x, y, width, height) { this.x = x || 0; diff --git a/public/core/dom_extension/DOMExtension.js.map b/public/core/dom_extension/DOMExtension.js.map index 200fa26fa..22318e9b5 100644 --- a/public/core/dom_extension/DOMExtension.js.map +++ b/public/core/dom_extension/DOMExtension.js.map @@ -1 +1 @@ -{"version":3,"file":"DOMExtension.js","sourceRoot":"","sources":["../../../../../../front_end/core/dom_extension/DOMExtension.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAEH,8FAA8F;AAE9F,OAAO,KAAK,QAAQ,MAAM,yBAAyB,CAAC;AAEpD,IAAI,CAAC,SAAS,CAAC,oBAAoB,GAA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,CAAC,CAAC;AACF,CAAC,CAAC,EAAE,CAAC","sourcesContent":["// Copyright 2021 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\n/*\n * Copyright (C) 2007 Apple Inc. All rights reserved.\n * Copyright (C) 2012 Google Inc. All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n *\n * 1. Redistributions of source code must retain the above copyright\n * notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n * notice, this list of conditions and the following disclaimer in the\n * documentation and/or other materials provided with the distribution.\n * 3. Neither the name of Apple Computer, Inc. (\"Apple\") nor the names of\n * its contributors may be used to endorse or promote products derived\n * from this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *\n * Contains diff method based on Javascript Diff Algorithm By John Resig\n * http://ejohn.org/files/jsdiff.js (released under the MIT license).\n */\n\n// @ts-nocheck This file is not checked by TypeScript Compiler as it has a lot of legacy code.\n\nimport * as Platform from '../platform/platform.js';\n\nNode.prototype.traverseNextTextNode = function(stayWithin?: Node): Node|null {\n let node = this.traverseNextNode(stayWithin);\n if (!node) {\n return null;\n }\n const nonTextTags = {STYLE: 1, SCRIPT: 1, '#document-fragment': 1};\n while (node && (node.nodeType !== Node.TEXT_NODE || nonTextTags[node.parentNode ? node.parentNode.nodeName : ''])) {\n node = node.traverseNextNode(stayWithin);\n }\n\n return node;\n};\n\nElement.prototype.positionAt = function(x: number|undefined, y: number|undefined, relativeTo?: Element): void {\n let shift: AnchorBox|{\n x: number,\n y: number,\n } = {x: 0, y: 0};\n if (relativeTo) {\n shift = relativeTo.boxInWindow(this.ownerDocument.defaultView);\n }\n\n if (typeof x === 'number') {\n this.style.setProperty('left', (shift.x + x) + 'px');\n } else {\n this.style.removeProperty('left');\n }\n\n if (typeof y === 'number') {\n this.style.setProperty('top', (shift.y + y) + 'px');\n } else {\n this.style.removeProperty('top');\n }\n\n if (typeof x === 'number' || typeof y === 'number') {\n this.style.setProperty('position', 'absolute');\n } else {\n this.style.removeProperty('position');\n }\n};\n\nNode.prototype.enclosingNodeOrSelfWithClass = function(className: string, stayWithin?: Element): Element|null {\n return this.enclosingNodeOrSelfWithClassList([className], stayWithin);\n};\nNode.prototype.enclosingNodeOrSelfWithClassList = function(classNames: string[], stayWithin: Node): Element|null {\n for (let node: Node|null = this; node && node !== stayWithin && node !== this.ownerDocument;\n node = node.parentNodeOrShadowHost()) {\n if (node.nodeType === Node.ELEMENT_NODE) {\n let containsAll = true;\n for (let i = 0; i < classNames.length && containsAll; ++i) {\n if (!node.classList.contains(classNames[i])) {\n containsAll = false;\n }\n }\n if (containsAll) {\n return node as Element;\n }\n }\n }\n return null;\n};\n\nNode.prototype.parentElementOrShadowHost = function(): Element|null {\n if (this.nodeType === Node.DOCUMENT_FRAGMENT_NODE && this.host) {\n return this.host as Element;\n }\n const node = this.parentNode;\n if (!node) {\n return null;\n }\n if (node.nodeType === Node.ELEMENT_NODE) {\n return node as Element;\n }\n if (node.nodeType === Node.DOCUMENT_FRAGMENT_NODE) {\n return node.host as Element;\n }\n return null;\n};\n\nNode.prototype.parentNodeOrShadowHost = function(): Node|null {\n if (this.parentNode) {\n return this.parentNode;\n }\n if (this.nodeType === Node.DOCUMENT_FRAGMENT_NODE && this.host) {\n return this.host;\n }\n return null;\n};\n\nNode.prototype.getComponentSelection = function(): Selection|null {\n let parent: ((Node & ParentNode)|null) = this.parentNode;\n while (parent && parent.nodeType !== Node.DOCUMENT_FRAGMENT_NODE) {\n parent = parent.parentNode;\n }\n return parent instanceof ShadowRoot ? parent.getSelection() : this.window().getSelection();\n};\n\nNode.prototype.hasSelection = function(): boolean {\n // TODO(luoe): use contains(node, {includeShadow: true}) when it is fixed for shadow dom.\n if (this instanceof Element) {\n const slots = this.querySelectorAll('slot');\n for (const slot of slots) {\n if (Array.prototype.some.call(slot.assignedNodes(), node => node.hasSelection())) {\n return true;\n }\n }\n }\n\n const selection = this.getComponentSelection();\n if (selection.type !== 'Range') {\n return false;\n }\n return selection.containsNode(this, true) || selection.anchorNode.isSelfOrDescendant(this) ||\n selection.focusNode.isSelfOrDescendant(this);\n};\nNode.prototype.window = function(): Window {\n return this.ownerDocument.defaultView as Window;\n};\n\nElement.prototype.removeChildren = function(): void {\n if (this.firstChild) {\n this.textContent = '';\n }\n};\n\nself.createElement = function(tagName: string, customElementType?: string): Element {\n return document.createElement(tagName, {is: customElementType});\n};\n\nself.createTextNode = function(data: string|number): Text {\n return document.createTextNode(data);\n};\n\nself.createDocumentFragment = function(): DocumentFragment {\n return document.createDocumentFragment();\n};\n\nElement.prototype.createChild = function(elementName: string, className?: string, customElementType?: string): Element {\n const element = document.createElement(elementName, {is: customElementType});\n if (className) {\n element.className = className;\n }\n this.appendChild(element);\n return element;\n};\n\nDocumentFragment.prototype.createChild = Element.prototype.createChild;\n\nself.AnchorBox = class {\n constructor(x?: number, y?: number, width?: number, height?: number) {\n this.x = x || 0;\n this.y = y || 0;\n this.width = width || 0;\n this.height = height || 0;\n }\n\n contains(x: number, y: number): boolean {\n return x >= this.x && x <= this.x + this.width && y >= this.y && y <= this.y + this.height;\n }\n\n relativeTo(box: AnchorBox): AnchorBox {\n return new AnchorBox(this.x - box.x, this.y - box.y, this.width, this.height);\n }\n\n relativeToElement(element: Element): AnchorBox {\n return this.relativeTo(element.boxInWindow(element.ownerDocument.defaultView));\n }\n\n equals(anchorBox: AnchorBox|null): boolean {\n return Boolean(anchorBox) && this.x === anchorBox.x && this.y === anchorBox.y && this.width === anchorBox.width &&\n this.height === anchorBox.height;\n }\n};\n\nElement.prototype.boxInWindow = function(targetWindow?: Window|null): AnchorBox {\n targetWindow = targetWindow || this.ownerDocument.defaultView;\n\n const anchorBox = new AnchorBox();\n let curElement: Element = this;\n let curWindow: Window|((Window & typeof globalThis) | null) = this.ownerDocument.defaultView;\n while (curWindow && curElement) {\n anchorBox.x += curElement.getBoundingClientRect().left;\n anchorBox.y += curElement.getBoundingClientRect().top;\n if (curWindow === targetWindow) {\n break;\n }\n curElement = curWindow.frameElement;\n curWindow = curWindow.parent;\n }\n\n anchorBox.width = Math.min(this.offsetWidth, targetWindow.innerWidth - anchorBox.x);\n anchorBox.height = Math.min(this.offsetHeight, targetWindow.innerHeight - anchorBox.y);\n return anchorBox;\n};\n\nEvent.prototype.consume = function(preventDefault?: boolean): void {\n this.stopImmediatePropagation();\n if (preventDefault) {\n this.preventDefault();\n }\n this.handled = true;\n};\n\nNode.prototype.deepTextContent = function(): string {\n return this.childTextNodes()\n .map(function(node) {\n return node.textContent;\n })\n .join('');\n};\n\nNode.prototype.childTextNodes = function(): Node[] {\n let node = this.traverseNextTextNode(this);\n const result = [];\n const nonTextTags = {STYLE: 1, SCRIPT: 1, '#document-fragment': 1};\n while (node) {\n if (!nonTextTags[node.parentNode ? node.parentNode.nodeName : '']) {\n result.push(node);\n }\n node = node.traverseNextTextNode(this);\n }\n return result;\n};\n\nNode.prototype.isAncestor = function(node: Node|null): boolean {\n if (!node) {\n return false;\n }\n\n let currentNode = node.parentNodeOrShadowHost();\n while (currentNode) {\n if (this === currentNode) {\n return true;\n }\n currentNode = currentNode.parentNodeOrShadowHost();\n }\n return false;\n};\n\nNode.prototype.isDescendant = function(descendant: Node|null): boolean {\n return Boolean(descendant) && descendant.isAncestor(this);\n};\n\nNode.prototype.isSelfOrAncestor = function(node: Node|null): boolean {\n return Boolean(node) && (node === this || this.isAncestor(node));\n};\n\nNode.prototype.isSelfOrDescendant = function(node: Node|null): boolean {\n return Boolean(node) && (node === this || this.isDescendant(node));\n};\n\nNode.prototype.traverseNextNode = function(stayWithin?: Node, skipShadowRoot: boolean = false): Node|null {\n if (!skipShadowRoot && this.shadowRoot) {\n return this.shadowRoot;\n }\n\n const distributedNodes = this instanceof HTMLSlotElement ? this.assignedNodes() : [];\n\n if (distributedNodes.length) {\n return distributedNodes[0];\n }\n\n if (this.firstChild) {\n return this.firstChild;\n }\n\n let node: Node = this;\n while (node) {\n if (stayWithin && node === stayWithin) {\n return null;\n }\n\n const sibling = nextSibling(node);\n if (sibling) {\n return sibling;\n }\n\n node = node.assignedSlot || node.parentNodeOrShadowHost();\n }\n\n function nextSibling(node: Node): Node|null {\n if (!node.assignedSlot) {\n return node.nextSibling;\n }\n const distributedNodes = node.assignedSlot.assignedNodes();\n\n const position = Array.prototype.indexOf.call(distributedNodes, node);\n if (position + 1 < distributedNodes.length) {\n return distributedNodes[position + 1];\n }\n return null;\n }\n\n return null;\n};\n\nNode.prototype.traversePreviousNode = function(stayWithin?: Node): Node|null {\n if (stayWithin && this === stayWithin) {\n return null;\n }\n let node: ChildNode|(ChildNode | null) = this.previousSibling;\n while (node && node.lastChild) {\n node = node.lastChild;\n }\n if (node) {\n return node;\n }\n return this.parentNodeOrShadowHost();\n};\n\nNode.prototype.setTextContentTruncatedIfNeeded = function(text: string|Node, placeholder?: string): boolean {\n // Huge texts in the UI reduce rendering performance drastically.\n // Moreover, Blink/WebKit uses internally for storing text content\n // length, so texts longer than 65535 are inherently displayed incorrectly.\n const maxTextContentLength = 10000;\n\n if (typeof text === 'string' && text.length > maxTextContentLength) {\n this.textContent =\n typeof placeholder === 'string' ? placeholder : Platform.StringUtilities.trimMiddle(text, maxTextContentLength);\n return true;\n }\n\n this.textContent = text;\n return false;\n};\n\nElement.prototype.hasFocus = function(): boolean {\n const root = this.getComponentRoot();\n return Boolean(root) && this.isSelfOrAncestor(root.activeElement);\n};\nNode.prototype.getComponentRoot = function(): Document|DocumentFragment|null {\n let node: ((Node & ParentNode)|null)|Node = this;\n while (node && node.nodeType !== Node.DOCUMENT_FRAGMENT_NODE && node.nodeType !== Node.DOCUMENT_NODE) {\n node = node.parentNode;\n }\n return node as Document | DocumentFragment | null;\n};\n\nself.onInvokeElement = function(element: Element, callback: (arg0: Event) => void): void {\n element.addEventListener('keydown', event => {\n if (Platform.KeyboardUtilities.isEnterOrSpaceKey(event)) {\n callback(event);\n }\n });\n element.addEventListener('click', event => callback(event));\n};\n\n// DevTools front-end still assumes that\n// classList.toggle('a', undefined) works as\n// classList.toggle('a', false) rather than as\n// classList.toggle('a');\n(function(): void {\nconst originalToggle = DOMTokenList.prototype.toggle;\nDOMTokenList.prototype['toggle'] = function(token: string, force: boolean|undefined): boolean {\n if (arguments.length === 1) {\n force = !this.contains(token);\n }\n return originalToggle.call(this, token, Boolean(force));\n};\n})();\n"]} \ No newline at end of file +{"version":3,"file":"DOMExtension.js","sourceRoot":"","sources":["../../../../../../front_end/core/dom_extension/DOMExtension.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAEH,8FAA8F;AAE9F,OAAO,KAAK,QAAQ,MAAM,yBAAyB,CAAC;AAEpD,IAAI,CAAC,SAAS,CAAC,oBAAoB,GAAG,UAAS,UAAiB;IAC9D,IAAI,IAAI,GAAG,IAAI,CAAC,gBAAgB,CAAC,UAAU,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D,OAAO,IAAI,IAAI,IAAI,CAAC,QAAQ,KAAK,IAAI,CAAC,sBAAsB,IAAI,IAAI,CAAC,QAAQ,KAAK,IAAI,CAAC,aAAa,EAAE,CAAC;QACrG,IAAI,GAAG,IAAI,CAAC,UAAU,CAAC;IACzB,CAAC;IACD,OAAO,IAA0C,CAAC;AACpD,CAAC,CAAC;AAEF,IAAI,CAAC,eAAe,GAAG,UAAS,OAAgB,EAAE,QAA+B;IAC/E,OAAO,CAAC,gBAAgB,CAAC,SAAS,EAAE,KAAK,CAAC,EAAE;QAC1C,IAAI,QAAQ,CAAC,iBAAiB,CAAC,iBAAiB,CAAC,KAAK,CAAC,EAAE,CAAC;YACxD,QAAQ,CAAC,KAAK,CAAC,CAAC;QAClB,CAAC;IACH,CAAC,CAAC,CAAC;IACH,OAAO,CAAC,gBAAgB,CAAC,OAAO,EAAE,KAAK,CAAC,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC;AAC9D,CAAC,CAAC;AAEF,wCAAwC;AACxC,8CAA8C;AAC9C,gDAAgD;AAChD,2BAA2B;AAC3B,CAAC;IACD,MAAM,cAAc,GAAG,YAAY,CAAC,SAAS,CAAC,MAAM,CAAC;IACrD,YAAY,CAAC,SAAS,CAAC,QAAQ,CAAC,GAAG,UAAS,KAAa,EAAE,KAAwB;QACjF,IAAI,SAAS,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YAC3B,KAAK,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;QAChC,CAAC;QACD,OAAO,cAAc,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC;IAC1D,CAAC,CAAC;AACF,CAAC,CAAC,EAAE,CAAC","sourcesContent":["// Copyright 2021 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\n/*\n * Copyright (C) 2007 Apple Inc. All rights reserved.\n * Copyright (C) 2012 Google Inc. All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n *\n * 1. Redistributions of source code must retain the above copyright\n * notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n * notice, this list of conditions and the following disclaimer in the\n * documentation and/or other materials provided with the distribution.\n * 3. Neither the name of Apple Computer, Inc. (\"Apple\") nor the names of\n * its contributors may be used to endorse or promote products derived\n * from this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *\n * Contains diff method based on Javascript Diff Algorithm By John Resig\n * http://ejohn.org/files/jsdiff.js (released under the MIT license).\n */\n\n// @ts-nocheck This file is not checked by TypeScript Compiler as it has a lot of legacy code.\n\nimport * as Platform from '../platform/platform.js';\n\nNode.prototype.traverseNextTextNode = function(stayWithin?: Node): Node|null {\n let node = this.traverseNextNode(stayWithin);\n if (!node) {\n return null;\n }\n const nonTextTags = {STYLE: 1, SCRIPT: 1, '#document-fragment': 1};\n while (node && (node.nodeType !== Node.TEXT_NODE || nonTextTags[node.parentNode ? node.parentNode.nodeName : ''])) {\n node = node.traverseNextNode(stayWithin);\n }\n\n return node;\n};\n\nElement.prototype.positionAt = function(x: number|undefined, y: number|undefined, relativeTo?: Element): void {\n let shift: AnchorBox|{\n x: number,\n y: number,\n } = {x: 0, y: 0};\n if (relativeTo) {\n shift = relativeTo.boxInWindow(this.ownerDocument.defaultView);\n }\n\n if (typeof x === 'number') {\n this.style.setProperty('left', (shift.x + x) + 'px');\n } else {\n this.style.removeProperty('left');\n }\n\n if (typeof y === 'number') {\n this.style.setProperty('top', (shift.y + y) + 'px');\n } else {\n this.style.removeProperty('top');\n }\n\n if (typeof x === 'number' || typeof y === 'number') {\n this.style.setProperty('position', 'absolute');\n } else {\n this.style.removeProperty('position');\n }\n};\n\nNode.prototype.enclosingNodeOrSelfWithClass = function(className: string, stayWithin?: Element): Element|null {\n return this.enclosingNodeOrSelfWithClassList([className], stayWithin);\n};\nNode.prototype.enclosingNodeOrSelfWithClassList = function(classNames: string[], stayWithin: Node): Element|null {\n for (let node: Node|null = this; node && node !== stayWithin && node !== this.ownerDocument;\n node = node.parentNodeOrShadowHost()) {\n if (node.nodeType === Node.ELEMENT_NODE) {\n let containsAll = true;\n for (let i = 0; i < classNames.length && containsAll; ++i) {\n if (!node.classList.contains(classNames[i])) {\n containsAll = false;\n }\n }\n if (containsAll) {\n return node as Element;\n }\n }\n }\n return null;\n};\n\nNode.prototype.parentElementOrShadowHost = function(): Element|null {\n if (this.nodeType === Node.DOCUMENT_FRAGMENT_NODE && this.host) {\n return this.host as Element;\n }\n const node = this.parentNode;\n if (!node) {\n return null;\n }\n if (node.nodeType === Node.ELEMENT_NODE) {\n return node as Element;\n }\n if (node.nodeType === Node.DOCUMENT_FRAGMENT_NODE) {\n return node.host as Element;\n }\n return null;\n};\n\nNode.prototype.parentNodeOrShadowHost = function(): Node|null {\n if (this.parentNode) {\n return this.parentNode;\n }\n if (this.nodeType === Node.DOCUMENT_FRAGMENT_NODE && this.host) {\n return this.host;\n }\n return null;\n};\n\nNode.prototype.getComponentSelection = function(): Selection|null {\n let parent: ((Node & ParentNode)|null) = this.parentNode;\n while (parent && parent.nodeType !== Node.DOCUMENT_FRAGMENT_NODE) {\n parent = parent.parentNode;\n }\n return parent instanceof ShadowRoot ? parent.getSelection() : this.window().getSelection();\n};\n\nNode.prototype.hasSelection = function(): boolean {\n // TODO(luoe): use contains(node, {includeShadow: true}) when it is fixed for shadow dom.\n if (this instanceof Element) {\n const slots = this.querySelectorAll('slot');\n for (const slot of slots) {\n if (Array.prototype.some.call(slot.assignedNodes(), node => node.hasSelection())) {\n return true;\n }\n }\n }\n\n const selection = this.getComponentSelection();\n if (selection.type !== 'Range') {\n return false;\n }\n return selection.containsNode(this, true) || selection.anchorNode.isSelfOrDescendant(this) ||\n selection.focusNode.isSelfOrDescendant(this);\n};\nNode.prototype.window = function(): Window {\n return this.ownerDocument.defaultView as Window;\n};\n\nElement.prototype.removeChildren = function(): void {\n if (this.firstChild) {\n this.textContent = '';\n }\n};\n\nself.createElement = function(tagName: string, customElementType?: string): Element {\n return document.createElement(tagName, {is: customElementType});\n};\n\nself.createTextNode = function(data: string|number): Text {\n return document.createTextNode(data);\n};\n\nself.createDocumentFragment = function(): DocumentFragment {\n return document.createDocumentFragment();\n};\n\nDocumentFragment.prototype.createChild = Element.prototype.createChild = function(\n elementName: string,\n className?: string,\n ): Element {\n const element = document.createElement(elementName);\n if (className) {\n element.className = className;\n }\n this.appendChild(element);\n return element;\n};\n\nself.AnchorBox = class {\n constructor(x?: number, y?: number, width?: number, height?: number) {\n this.x = x || 0;\n this.y = y || 0;\n this.width = width || 0;\n this.height = height || 0;\n }\n\n contains(x: number, y: number): boolean {\n return x >= this.x && x <= this.x + this.width && y >= this.y && y <= this.y + this.height;\n }\n\n relativeTo(box: AnchorBox): AnchorBox {\n return new AnchorBox(this.x - box.x, this.y - box.y, this.width, this.height);\n }\n\n relativeToElement(element: Element): AnchorBox {\n return this.relativeTo(element.boxInWindow(element.ownerDocument.defaultView));\n }\n\n equals(anchorBox: AnchorBox|null): boolean {\n return Boolean(anchorBox) && this.x === anchorBox.x && this.y === anchorBox.y && this.width === anchorBox.width &&\n this.height === anchorBox.height;\n }\n};\n\nElement.prototype.boxInWindow = function(targetWindow?: Window|null): AnchorBox {\n targetWindow = targetWindow || this.ownerDocument.defaultView;\n\n const anchorBox = new AnchorBox();\n let curElement: Element = this;\n let curWindow: Window|((Window & typeof globalThis) | null) = this.ownerDocument.defaultView;\n while (curWindow && curElement) {\n anchorBox.x += curElement.getBoundingClientRect().left;\n anchorBox.y += curElement.getBoundingClientRect().top;\n if (curWindow === targetWindow) {\n break;\n }\n curElement = curWindow.frameElement;\n curWindow = curWindow.parent;\n }\n\n anchorBox.width = Math.min(this.offsetWidth, targetWindow.innerWidth - anchorBox.x);\n anchorBox.height = Math.min(this.offsetHeight, targetWindow.innerHeight - anchorBox.y);\n return anchorBox;\n};\n\nEvent.prototype.consume = function(preventDefault?: boolean): void {\n this.stopImmediatePropagation();\n if (preventDefault) {\n this.preventDefault();\n }\n this.handled = true;\n};\n\nNode.prototype.deepTextContent = function(): string {\n return this.childTextNodes()\n .map(function(node) {\n return node.textContent;\n })\n .join('');\n};\n\nNode.prototype.childTextNodes = function(): Node[] {\n let node = this.traverseNextTextNode(this);\n const result = [];\n const nonTextTags = {STYLE: 1, SCRIPT: 1, '#document-fragment': 1};\n while (node) {\n if (!nonTextTags[node.parentNode ? node.parentNode.nodeName : '']) {\n result.push(node);\n }\n node = node.traverseNextTextNode(this);\n }\n return result;\n};\n\nNode.prototype.isAncestor = function(node: Node|null): boolean {\n if (!node) {\n return false;\n }\n\n let currentNode = node.parentNodeOrShadowHost();\n while (currentNode) {\n if (this === currentNode) {\n return true;\n }\n currentNode = currentNode.parentNodeOrShadowHost();\n }\n return false;\n};\n\nNode.prototype.isDescendant = function(descendant: Node|null): boolean {\n return Boolean(descendant) && descendant.isAncestor(this);\n};\n\nNode.prototype.isSelfOrAncestor = function(node: Node|null): boolean {\n return Boolean(node) && (node === this || this.isAncestor(node));\n};\n\nNode.prototype.isSelfOrDescendant = function(node: Node|null): boolean {\n return Boolean(node) && (node === this || this.isDescendant(node));\n};\n\nNode.prototype.traverseNextNode = function(stayWithin?: Node, skipShadowRoot: boolean = false): Node|null {\n if (!skipShadowRoot && this.shadowRoot) {\n return this.shadowRoot;\n }\n\n const distributedNodes = this instanceof HTMLSlotElement ? this.assignedNodes() : [];\n\n if (distributedNodes.length) {\n return distributedNodes[0];\n }\n\n if (this.firstChild) {\n return this.firstChild;\n }\n\n let node: Node = this;\n while (node) {\n if (stayWithin && node === stayWithin) {\n return null;\n }\n\n const sibling = nextSibling(node);\n if (sibling) {\n return sibling;\n }\n\n node = node.assignedSlot || node.parentNodeOrShadowHost();\n }\n\n function nextSibling(node: Node): Node|null {\n if (!node.assignedSlot) {\n return node.nextSibling;\n }\n const distributedNodes = node.assignedSlot.assignedNodes();\n\n const position = Array.prototype.indexOf.call(distributedNodes, node);\n if (position + 1 < distributedNodes.length) {\n return distributedNodes[position + 1];\n }\n return null;\n }\n\n return null;\n};\n\nNode.prototype.traversePreviousNode = function(stayWithin?: Node): Node|null {\n if (stayWithin && this === stayWithin) {\n return null;\n }\n let node: ChildNode|(ChildNode | null) = this.previousSibling;\n while (node && node.lastChild) {\n node = node.lastChild;\n }\n if (node) {\n return node;\n }\n return this.parentNodeOrShadowHost();\n};\n\nNode.prototype.setTextContentTruncatedIfNeeded = function(text: string|Node, placeholder?: string): boolean {\n // Huge texts in the UI reduce rendering performance drastically.\n // Moreover, Blink/WebKit uses internally for storing text content\n // length, so texts longer than 65535 are inherently displayed incorrectly.\n const maxTextContentLength = 10000;\n\n if (typeof text === 'string' && text.length > maxTextContentLength) {\n this.textContent =\n typeof placeholder === 'string' ? placeholder : Platform.StringUtilities.trimMiddle(text, maxTextContentLength);\n return true;\n }\n\n this.textContent = text;\n return false;\n};\n\nElement.prototype.hasFocus = function(): boolean {\n const root = this.getComponentRoot();\n return Boolean(root) && this.isSelfOrAncestor(root.activeElement);\n};\nNode.prototype.getComponentRoot = function(): Document|DocumentFragment|null {\n let node: ((Node & ParentNode)|null)|Node = this;\n while (node && node.nodeType !== Node.DOCUMENT_FRAGMENT_NODE && node.nodeType !== Node.DOCUMENT_NODE) {\n node = node.parentNode;\n }\n return node as Document | DocumentFragment | null;\n};\n\nself.onInvokeElement = function(element: Element, callback: (arg0: Event) => void): void {\n element.addEventListener('keydown', event => {\n if (Platform.KeyboardUtilities.isEnterOrSpaceKey(event)) {\n callback(event);\n }\n });\n element.addEventListener('click', event => callback(event));\n};\n\n// DevTools front-end still assumes that\n// classList.toggle('a', undefined) works as\n// classList.toggle('a', false) rather than as\n// classList.toggle('a');\n(function(): void {\nconst originalToggle = DOMTokenList.prototype.toggle;\nDOMTokenList.prototype['toggle'] = function(token: string, force: boolean|undefined): boolean {\n if (arguments.length === 1) {\n force = !this.contains(token);\n }\n return originalToggle.call(this, token, Boolean(force));\n};\n})();\n"]} \ No newline at end of file diff --git a/public/core/dom_extension/DOMExtension.test.d.ts b/public/core/dom_extension/DOMExtension.test.d.ts index d54fa27ae..64c33ebfa 100644 --- a/public/core/dom_extension/DOMExtension.test.d.ts +++ b/public/core/dom_extension/DOMExtension.test.d.ts @@ -2,6 +2,7 @@ import './dom_extension.js'; declare global { interface HTMLElement { traverseNextNode(node: HTMLElement): HTMLElement; + createChild(tagName: K, className?: string, content?: string): HTMLElementTagNameMap[K]; createChild(tagName: string, className?: string, content?: string): HTMLElement; } } diff --git a/public/core/dom_extension/DOMExtension.test.js b/public/core/dom_extension/DOMExtension.test.js index 354f7f338..72fde4eaa 100644 --- a/public/core/dom_extension/DOMExtension.test.js +++ b/public/core/dom_extension/DOMExtension.test.js @@ -34,7 +34,7 @@ describe('DataGrid', () => { * */ let node = component1; - assert.strictEqual(node.nodeValue, null, 'root node value is incorrect'); + assert.isNull(node.nodeValue, 'root node value is incorrect'); assert.strictEqual(node.nodeName, 'DIV', 'root node name is incorrect'); assert.strictEqual(node.className, 'component1', 'root node class is incorrect'); node = node.traverseNextNode(component1); diff --git a/public/core/dom_extension/DOMExtension.test.js.map b/public/core/dom_extension/DOMExtension.test.js.map index 1d6e0b323..0fdea4d2b 100644 --- a/public/core/dom_extension/DOMExtension.test.js.map +++ b/public/core/dom_extension/DOMExtension.test.js.map @@ -1 +1 @@ -{"version":3,"file":"DOMExtension.test.js","sourceRoot":"","sources":["../../../../../../front_end/core/dom_extension/DOMExtension.test.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,oBAAoB,CAAC;AAS5B,SAAS,UAAU,CAAC,MAAmB,EAAE,IAAa;IACpD,MAAM,IAAI,GAAG,MAAM,CAAC,WAAW,CAAC,MAAM,CAAoB,CAAC;IAC3D,IAAI,IAAI,EAAE,CAAC;QACT,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAED,SAAS,WAAW,CAAC,MAAmB,EAAE,OAAe,EAAE,IAAa,EAAE,IAAI,GAAG,EAAE;IACjF,MAAM,KAAK,GAAG,MAAM,CAAC,WAAW,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;IAChD,IAAI,IAAI,EAAE,CAAC;QACT,KAAK,CAAC,IAAI,GAAG,IAAI,CAAC;IACpB,CAAC;IACD,KAAK,CAAC,WAAW,GAAG,IAAI,CAAC;IACzB,OAAO,KAAK,CAAC;AACf,CAAC;AAED,QAAQ,CAAC,UAAU,EAAE,GAAG,EAAE;IACxB,EAAE,CAAC,6BAA6B,EAAE,GAAG,EAAE;QACrC,MAAM,UAAU,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;QACjD,UAAU,CAAC,SAAS,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;QACvC,WAAW,CAAC,UAAU,EAAE,KAAK,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AAC,CAAC;QAE1C,IAAI,GAAG,IAAI,CAAC,gBAAgB,CAAC,UAAU,CAAC,CAAC;QACzC,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;QAE1C,IAAI,GAAG,IAAI,CAAC,gBAAgB,CAAC,UAAU,CAAC,CAAC;QACzC,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC;QACzC,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,SAAS,EAAE,oBAAoB,CAAC,CAAC;QAEzD,IAAI,GAAG,IAAI,CAAC,gBAAgB,CAAC,UAAU,CAAC,CAAC;QACzC,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,SAAS,EAAE,2BAA2B,CAAC,CAAC;QAChE,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;IAC7C,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["// Copyright 2019 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport './dom_extension.js';\n\ndeclare global {\n interface HTMLElement {\n traverseNextNode(node: HTMLElement): HTMLElement;\n createChild(tagName: string, className?: string, content?: string): HTMLElement;\n }\n}\n\nfunction createSlot(parent: HTMLElement, name?: string) {\n const slot = parent.createChild('slot') as HTMLSlotElement;\n if (name) {\n slot.name = name;\n }\n return slot;\n}\n\nfunction createChild(parent: HTMLElement, tagName: string, name?: string, text = '') {\n const child = parent.createChild(tagName, name);\n if (name) {\n child.slot = name;\n }\n child.textContent = text;\n return child;\n}\n\ndescribe('DataGrid', () => {\n it('Traverse Node with Children', () => {\n const component1 = document.createElement('div');\n component1.classList.add('component1');\n createChild(component1, 'div', 'component1-content', 'text 1');\n createChild(component1, 'div', 'component2-content', 'text 2');\n createChild(component1, 'span', undefined, 'text 3');\n createChild(component1, 'span', 'component1-content', 'text 4');\n\n // Now we have:\n /*\n *
\n *
text 1
\n *
text 2
\n * text 3text 4\n *
\n */\n\n let node: HTMLElement = component1;\n assert.strictEqual(node.nodeValue, null, 'root node value is incorrect');\n assert.strictEqual(node.nodeName, 'DIV', 'root node name is incorrect');\n assert.strictEqual(node.className, 'component1', 'root node class is incorrect');\n\n node = node.traverseNextNode(component1);\n assert.strictEqual(node.nodeName, 'DIV', 'first child node name is incorrect');\n assert.strictEqual(node.className, 'component1-content', 'first child class is incorrect');\n\n node = node.traverseNextNode(component1);\n assert.strictEqual(node.nodeValue, 'text 1', 'second child node value is incorrect');\n\n node = node.traverseNextNode(component1);\n assert.strictEqual(node.nodeName, 'DIV', 'second child node name is incorrect');\n assert.strictEqual(node.className, 'component2-content', 'second child class is incorrect');\n\n node = node.traverseNextNode(component1);\n assert.strictEqual(node.nodeValue, 'text 2', 'second child node value is incorrect');\n\n node = node.traverseNextNode(component1);\n assert.strictEqual(node.nodeName, 'SPAN', 'third child node name is incorrect');\n assert.strictEqual(node.className, '', 'third child class is incorrect');\n\n node = node.traverseNextNode(component1);\n assert.strictEqual(node.nodeValue, 'text 3', 'third child node value is incorrect');\n\n node = node.traverseNextNode(component1);\n assert.strictEqual(node.nodeName, 'SPAN', 'forth child node name is incorrect');\n assert.strictEqual(node.className, 'component1-content', 'forth child class is incorrect');\n\n node = node.traverseNextNode(component1);\n assert.strictEqual(node.nodeValue, 'text 4', 'forth child node value is incorrect');\n });\n\n it('Traverse Node with Shadows', () => {\n const component1 = document.createElement('div');\n component1.classList.add('component1');\n const shadow1 = component1.attachShadow({mode: 'open'});\n const shadow1Content = document.createElement('div');\n shadow1Content.classList.add('shadow-component1');\n shadow1.appendChild(shadow1Content);\n const component2 = shadow1Content.createChild('div', 'component2');\n const shadow2 = component2.attachShadow({mode: 'open'});\n const shadow2Content = document.createElement('div');\n shadow2Content.classList.add('shadow-component1');\n shadow2.appendChild(shadow2Content);\n const midDiv = createChild(shadow2Content, 'div', 'mid-div');\n createChild(midDiv, 'div', undefined, 'component2-text');\n\n // Now we have:\n /*\n *
\n *
\n *
component2-text
\n */\n\n let node: HTMLElement = component1;\n assert.strictEqual(node.nodeName, 'DIV', 'root node name is incorrect');\n assert.strictEqual(node.className, 'component1', 'root node class is incorrect');\n\n node = node.traverseNextNode(component1);\n assert.strictEqual(node.nodeName, '#document-fragment', 'first document fragment node name is incorrect');\n\n node = node.traverseNextNode(component1);\n assert.strictEqual(node.nodeName, 'DIV', 'first document fragment child node name is incorrect');\n assert.strictEqual(node.className, 'shadow-component1', 'first document fragment child node name is incorrect');\n\n node = node.traverseNextNode(component1);\n assert.strictEqual(node.nodeName, 'DIV');\n assert.strictEqual(node.className, 'component2');\n\n node = node.traverseNextNode(component1);\n assert.strictEqual(node.nodeName, '#document-fragment');\n\n node = node.traverseNextNode(component1);\n assert.strictEqual(node.nodeName, 'DIV');\n assert.strictEqual(node.className, 'shadow-component1');\n\n node = node.traverseNextNode(component1);\n assert.strictEqual(node.nodeName, 'DIV');\n assert.strictEqual(node.className, 'mid-div');\n\n node = node.traverseNextNode(component1);\n assert.strictEqual(node.nodeName, 'DIV');\n assert.strictEqual(node.className, '');\n\n node = node.traverseNextNode(component1);\n assert.strictEqual(node.nodeName, '#text');\n assert.strictEqual(node.nodeValue, 'component2-text');\n });\n\n it('Traverse Node with Slots', () => {\n const component1 = document.createElement('div');\n component1.classList.add('component1');\n const shadow1 = component1.attachShadow({mode: 'open'});\n const shadow1Content = document.createElement('div');\n shadow1Content.classList.add('shadow-component1');\n shadow1.appendChild(shadow1Content);\n createSlot(shadow1Content, 'component1-content');\n createSlot(shadow1Content);\n const component2 = shadow1Content.createChild('div', 'component2');\n const shadow2 = component2.attachShadow({mode: 'open'});\n createSlot(component2, 'component2-content');\n createChild(component2, 'div', 'component2-content', 'component2 light dom text');\n const shadow2Content = document.createElement('div');\n shadow2Content.classList.add('shadow-component1');\n shadow2.appendChild(shadow2Content);\n const midDiv = createChild(shadow2Content, 'div', 'mid-div');\n createChild(midDiv, 'div', undefined, 'component2-text');\n createSlot(midDiv);\n createSlot(midDiv, 'component2-content');\n\n // Now we have:\n /*\n *
\n *
\n * \n * \n *
\n * \n *
component2 light dom text
\n *
\n *
\n *
\n *
\n *
component2-text
\n * \n * \n *
\n *
\n */\n\n let node: HTMLElement = component1;\n assert.strictEqual(node.nodeName, 'DIV', 'root node name is incorrect');\n assert.strictEqual(node.className, 'component1', 'root node class is incorrect');\n\n node = node.traverseNextNode(component1);\n assert.strictEqual(node.nodeName, '#document-fragment', 'first document fragment node name is incorrect');\n\n node = node.traverseNextNode(component1);\n assert.strictEqual(node.nodeName, 'DIV', 'first document fragment child node name is incorrect');\n assert.strictEqual(node.className, 'shadow-component1', 'first document fragment child node name is incorrect');\n\n node = node.traverseNextNode(component1);\n assert.strictEqual(node.nodeName, 'SLOT', 'first slot node name is incorrect');\n\n node = node.traverseNextNode(component1);\n assert.strictEqual(node.nodeName, 'SLOT', 'second slot node name is incorrect');\n\n node = node.traverseNextNode(component1);\n assert.strictEqual(node.nodeName, 'DIV');\n assert.strictEqual(node.className, 'component2');\n\n node = node.traverseNextNode(component1);\n assert.strictEqual(node.nodeName, '#document-fragment');\n\n node = node.traverseNextNode(component1);\n assert.strictEqual(node.nodeName, 'DIV');\n assert.strictEqual(node.className, 'shadow-component1');\n\n node = node.traverseNextNode(component1);\n assert.strictEqual(node.nodeName, 'DIV');\n assert.strictEqual(node.className, 'mid-div');\n\n node = node.traverseNextNode(component1);\n assert.strictEqual(node.nodeName, 'DIV');\n assert.strictEqual(node.className, '');\n\n node = node.traverseNextNode(component1);\n assert.strictEqual(node.nodeValue, 'component2-text');\n assert.strictEqual(node.nodeName, '#text');\n\n node = node.traverseNextNode(component1);\n assert.strictEqual(node.nodeName, 'SLOT');\n\n node = node.traverseNextNode(component1);\n assert.strictEqual(node.nodeName, 'SLOT');\n\n node = node.traverseNextNode(component1);\n assert.strictEqual(node.nodeName, 'SLOT');\n\n node = node.traverseNextNode(component1);\n assert.strictEqual(node.nodeName, 'DIV');\n assert.strictEqual(node.className, 'component2-content');\n\n node = node.traverseNextNode(component1);\n assert.strictEqual(node.nodeValue, 'component2 light dom text');\n assert.strictEqual(node.nodeName, '#text');\n });\n});\n"]} \ No newline at end of file +{"version":3,"file":"DOMExtension.test.js","sourceRoot":"","sources":["../../../../../../front_end/core/dom_extension/DOMExtension.test.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,oBAAoB,CAAC;AAW5B,SAAS,UAAU,CAAC,MAAmB,EAAE,IAAa;IACpD,MAAM,IAAI,GAAG,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;IACxC,IAAI,IAAI,EAAE,CAAC;QACT,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAED,SAAS,WAAW,CAAC,MAAmB,EAAE,OAAe,EAAE,IAAa,EAAE,IAAI,GAAG,EAAE;IACjF,MAAM,KAAK,GAAG,MAAM,CAAC,WAAW,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;IAChD,IAAI,IAAI,EAAE,CAAC;QACT,KAAK,CAAC,IAAI,GAAG,IAAI,CAAC;IACpB,CAAC;IACD,KAAK,CAAC,WAAW,GAAG,IAAI,CAAC;IACzB,OAAO,KAAK,CAAC;AACf,CAAC;AAED,QAAQ,CAAC,UAAU,EAAE,GAAG,EAAE;IACxB,EAAE,CAAC,6BAA6B,EAAE,GAAG,EAAE;QACrC,MAAM,UAAU,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;QACjD,UAAU,CAAC,SAAS,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;QACvC,WAAW,CAAC,UAAU,EAAE,KAAK,EAAE,oBAAoB,EAAE,QAAQ,CAAC,CAAC;QAC/D,WAAW,CAAC,UAAU,EAAE,KAAK,EAAE,oBAAoB,EAAE,QAAQ,CAAC,CAAC;QAC/D,WAAW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C,CAAC;QAE1C,IAAI,GAAG,IAAI,CAAC,gBAAgB,CAAC,UAAU,CAAC,CAAC;QACzC,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC;QACzC,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,SAAS,EAAE,oBAAoB,CAAC,CAAC;QAEzD,IAAI,GAAG,IAAI,CAAC,gBAAgB,CAAC,UAAU,CAAC,CAAC;QACzC,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,SAAS,EAAE,2BAA2B,CAAC,CAAC;QAChE,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;IAC7C,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["// Copyright 2019 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport './dom_extension.js';\n\ndeclare global {\n interface HTMLElement {\n traverseNextNode(node: HTMLElement): HTMLElement;\n createChild(tagName: K, className?: string, content?: string):\n HTMLElementTagNameMap[K];\n createChild(tagName: string, className?: string, content?: string): HTMLElement;\n }\n}\n\nfunction createSlot(parent: HTMLElement, name?: string) {\n const slot = parent.createChild('slot');\n if (name) {\n slot.name = name;\n }\n return slot;\n}\n\nfunction createChild(parent: HTMLElement, tagName: string, name?: string, text = '') {\n const child = parent.createChild(tagName, name);\n if (name) {\n child.slot = name;\n }\n child.textContent = text;\n return child;\n}\n\ndescribe('DataGrid', () => {\n it('Traverse Node with Children', () => {\n const component1 = document.createElement('div');\n component1.classList.add('component1');\n createChild(component1, 'div', 'component1-content', 'text 1');\n createChild(component1, 'div', 'component2-content', 'text 2');\n createChild(component1, 'span', undefined, 'text 3');\n createChild(component1, 'span', 'component1-content', 'text 4');\n\n // Now we have:\n /*\n *
\n *
text 1
\n *
text 2
\n * text 3text 4\n *
\n */\n\n let node: HTMLElement = component1;\n assert.isNull(node.nodeValue, 'root node value is incorrect');\n assert.strictEqual(node.nodeName, 'DIV', 'root node name is incorrect');\n assert.strictEqual(node.className, 'component1', 'root node class is incorrect');\n\n node = node.traverseNextNode(component1);\n assert.strictEqual(node.nodeName, 'DIV', 'first child node name is incorrect');\n assert.strictEqual(node.className, 'component1-content', 'first child class is incorrect');\n\n node = node.traverseNextNode(component1);\n assert.strictEqual(node.nodeValue, 'text 1', 'second child node value is incorrect');\n\n node = node.traverseNextNode(component1);\n assert.strictEqual(node.nodeName, 'DIV', 'second child node name is incorrect');\n assert.strictEqual(node.className, 'component2-content', 'second child class is incorrect');\n\n node = node.traverseNextNode(component1);\n assert.strictEqual(node.nodeValue, 'text 2', 'second child node value is incorrect');\n\n node = node.traverseNextNode(component1);\n assert.strictEqual(node.nodeName, 'SPAN', 'third child node name is incorrect');\n assert.strictEqual(node.className, '', 'third child class is incorrect');\n\n node = node.traverseNextNode(component1);\n assert.strictEqual(node.nodeValue, 'text 3', 'third child node value is incorrect');\n\n node = node.traverseNextNode(component1);\n assert.strictEqual(node.nodeName, 'SPAN', 'forth child node name is incorrect');\n assert.strictEqual(node.className, 'component1-content', 'forth child class is incorrect');\n\n node = node.traverseNextNode(component1);\n assert.strictEqual(node.nodeValue, 'text 4', 'forth child node value is incorrect');\n });\n\n it('Traverse Node with Shadows', () => {\n const component1 = document.createElement('div');\n component1.classList.add('component1');\n const shadow1 = component1.attachShadow({mode: 'open'});\n const shadow1Content = document.createElement('div');\n shadow1Content.classList.add('shadow-component1');\n shadow1.appendChild(shadow1Content);\n const component2 = shadow1Content.createChild('div', 'component2');\n const shadow2 = component2.attachShadow({mode: 'open'});\n const shadow2Content = document.createElement('div');\n shadow2Content.classList.add('shadow-component1');\n shadow2.appendChild(shadow2Content);\n const midDiv = createChild(shadow2Content, 'div', 'mid-div');\n createChild(midDiv, 'div', undefined, 'component2-text');\n\n // Now we have:\n /*\n *
\n *
\n *
component2-text
\n */\n\n let node: HTMLElement = component1;\n assert.strictEqual(node.nodeName, 'DIV', 'root node name is incorrect');\n assert.strictEqual(node.className, 'component1', 'root node class is incorrect');\n\n node = node.traverseNextNode(component1);\n assert.strictEqual(node.nodeName, '#document-fragment', 'first document fragment node name is incorrect');\n\n node = node.traverseNextNode(component1);\n assert.strictEqual(node.nodeName, 'DIV', 'first document fragment child node name is incorrect');\n assert.strictEqual(node.className, 'shadow-component1', 'first document fragment child node name is incorrect');\n\n node = node.traverseNextNode(component1);\n assert.strictEqual(node.nodeName, 'DIV');\n assert.strictEqual(node.className, 'component2');\n\n node = node.traverseNextNode(component1);\n assert.strictEqual(node.nodeName, '#document-fragment');\n\n node = node.traverseNextNode(component1);\n assert.strictEqual(node.nodeName, 'DIV');\n assert.strictEqual(node.className, 'shadow-component1');\n\n node = node.traverseNextNode(component1);\n assert.strictEqual(node.nodeName, 'DIV');\n assert.strictEqual(node.className, 'mid-div');\n\n node = node.traverseNextNode(component1);\n assert.strictEqual(node.nodeName, 'DIV');\n assert.strictEqual(node.className, '');\n\n node = node.traverseNextNode(component1);\n assert.strictEqual(node.nodeName, '#text');\n assert.strictEqual(node.nodeValue, 'component2-text');\n });\n\n it('Traverse Node with Slots', () => {\n const component1 = document.createElement('div');\n component1.classList.add('component1');\n const shadow1 = component1.attachShadow({mode: 'open'});\n const shadow1Content = document.createElement('div');\n shadow1Content.classList.add('shadow-component1');\n shadow1.appendChild(shadow1Content);\n createSlot(shadow1Content, 'component1-content');\n createSlot(shadow1Content);\n const component2 = shadow1Content.createChild('div', 'component2');\n const shadow2 = component2.attachShadow({mode: 'open'});\n createSlot(component2, 'component2-content');\n createChild(component2, 'div', 'component2-content', 'component2 light dom text');\n const shadow2Content = document.createElement('div');\n shadow2Content.classList.add('shadow-component1');\n shadow2.appendChild(shadow2Content);\n const midDiv = createChild(shadow2Content, 'div', 'mid-div');\n createChild(midDiv, 'div', undefined, 'component2-text');\n createSlot(midDiv);\n createSlot(midDiv, 'component2-content');\n\n // Now we have:\n /*\n *
\n *
\n * \n * \n *
\n * \n *
component2 light dom text
\n *
\n *
\n *
\n *
\n *
component2-text
\n * \n * \n *
\n *
\n */\n\n let node: HTMLElement = component1;\n assert.strictEqual(node.nodeName, 'DIV', 'root node name is incorrect');\n assert.strictEqual(node.className, 'component1', 'root node class is incorrect');\n\n node = node.traverseNextNode(component1);\n assert.strictEqual(node.nodeName, '#document-fragment', 'first document fragment node name is incorrect');\n\n node = node.traverseNextNode(component1);\n assert.strictEqual(node.nodeName, 'DIV', 'first document fragment child node name is incorrect');\n assert.strictEqual(node.className, 'shadow-component1', 'first document fragment child node name is incorrect');\n\n node = node.traverseNextNode(component1);\n assert.strictEqual(node.nodeName, 'SLOT', 'first slot node name is incorrect');\n\n node = node.traverseNextNode(component1);\n assert.strictEqual(node.nodeName, 'SLOT', 'second slot node name is incorrect');\n\n node = node.traverseNextNode(component1);\n assert.strictEqual(node.nodeName, 'DIV');\n assert.strictEqual(node.className, 'component2');\n\n node = node.traverseNextNode(component1);\n assert.strictEqual(node.nodeName, '#document-fragment');\n\n node = node.traverseNextNode(component1);\n assert.strictEqual(node.nodeName, 'DIV');\n assert.strictEqual(node.className, 'shadow-component1');\n\n node = node.traverseNextNode(component1);\n assert.strictEqual(node.nodeName, 'DIV');\n assert.strictEqual(node.className, 'mid-div');\n\n node = node.traverseNextNode(component1);\n assert.strictEqual(node.nodeName, 'DIV');\n assert.strictEqual(node.className, '');\n\n node = node.traverseNextNode(component1);\n assert.strictEqual(node.nodeValue, 'component2-text');\n assert.strictEqual(node.nodeName, '#text');\n\n node = node.traverseNextNode(component1);\n assert.strictEqual(node.nodeName, 'SLOT');\n\n node = node.traverseNextNode(component1);\n assert.strictEqual(node.nodeName, 'SLOT');\n\n node = node.traverseNextNode(component1);\n assert.strictEqual(node.nodeName, 'SLOT');\n\n node = node.traverseNextNode(component1);\n assert.strictEqual(node.nodeName, 'DIV');\n assert.strictEqual(node.className, 'component2-content');\n\n node = node.traverseNextNode(component1);\n assert.strictEqual(node.nodeValue, 'component2 light dom text');\n assert.strictEqual(node.nodeName, '#text');\n });\n});\n"]} \ No newline at end of file diff --git a/public/core/i18n/locales/en-US.json b/public/core/i18n/locales/en-US.json index 05b677e60..486fccda3 100644 --- a/public/core/i18n/locales/en-US.json +++ b/public/core/i18n/locales/en-US.json @@ -1 +1 @@ -{"core/common/ResourceType.ts | cspviolationreport":{"message":"CSPViolationReport"},"core/common/ResourceType.ts | css":{"message":"CSS"},"core/common/ResourceType.ts | doc":{"message":"Doc"},"core/common/ResourceType.ts | document":{"message":"Document"},"core/common/ResourceType.ts | eventsource":{"message":"EventSource"},"core/common/ResourceType.ts | fetch":{"message":"Fetch"},"core/common/ResourceType.ts | fetchAndXHR":{"message":"Fetch and XHR"},"core/common/ResourceType.ts | font":{"message":"Font"},"core/common/ResourceType.ts | image":{"message":"Image"},"core/common/ResourceType.ts | img":{"message":"Img"},"core/common/ResourceType.ts | javascript":{"message":"JavaScript"},"core/common/ResourceType.ts | js":{"message":"JS"},"core/common/ResourceType.ts | manifest":{"message":"Manifest"},"core/common/ResourceType.ts | media":{"message":"Media"},"core/common/ResourceType.ts | other":{"message":"Other"},"core/common/ResourceType.ts | ping":{"message":"Ping"},"core/common/ResourceType.ts | preflight":{"message":"Preflight"},"core/common/ResourceType.ts | script":{"message":"Script"},"core/common/ResourceType.ts | signedexchange":{"message":"SignedExchange"},"core/common/ResourceType.ts | stylesheet":{"message":"Stylesheet"},"core/common/ResourceType.ts | texttrack":{"message":"TextTrack"},"core/common/ResourceType.ts | wasm":{"message":"Wasm"},"core/common/ResourceType.ts | webassembly":{"message":"WebAssembly"},"core/common/ResourceType.ts | webbundle":{"message":"WebBundle"},"core/common/ResourceType.ts | websocket":{"message":"WebSocket"},"core/common/ResourceType.ts | webtransport":{"message":"WebTransport"},"core/common/ResourceType.ts | ws":{"message":"WS"},"core/common/Revealer.ts | animationsPanel":{"message":"Animations panel"},"core/common/Revealer.ts | applicationPanel":{"message":"Application panel"},"core/common/Revealer.ts | changesDrawer":{"message":"Changes drawer"},"core/common/Revealer.ts | developerResourcesPanel":{"message":"Developer Resources panel"},"core/common/Revealer.ts | elementsPanel":{"message":"Elements panel"},"core/common/Revealer.ts | issuesView":{"message":"Issues view"},"core/common/Revealer.ts | memoryInspectorPanel":{"message":"Memory inspector panel"},"core/common/Revealer.ts | networkPanel":{"message":"Network panel"},"core/common/Revealer.ts | sourcesPanel":{"message":"Sources panel"},"core/common/Revealer.ts | stylesSidebar":{"message":"styles sidebar"},"core/common/Revealer.ts | timelinePanel":{"message":"Performance panel"},"core/common/SettingRegistration.ts | adorner":{"message":"Adorner"},"core/common/SettingRegistration.ts | appearance":{"message":"Appearance"},"core/common/SettingRegistration.ts | console":{"message":"Console"},"core/common/SettingRegistration.ts | debugger":{"message":"Debugger"},"core/common/SettingRegistration.ts | elements":{"message":"Elements"},"core/common/SettingRegistration.ts | extension":{"message":"Extension"},"core/common/SettingRegistration.ts | global":{"message":"Global"},"core/common/SettingRegistration.ts | grid":{"message":"Grid"},"core/common/SettingRegistration.ts | memory":{"message":"Memory"},"core/common/SettingRegistration.ts | mobile":{"message":"Mobile"},"core/common/SettingRegistration.ts | network":{"message":"Network"},"core/common/SettingRegistration.ts | performance":{"message":"Performance"},"core/common/SettingRegistration.ts | persistence":{"message":"Persistence"},"core/common/SettingRegistration.ts | privacy":{"message":"Privacy"},"core/common/SettingRegistration.ts | rendering":{"message":"Rendering"},"core/common/SettingRegistration.ts | sources":{"message":"Sources"},"core/common/SettingRegistration.ts | sync":{"message":"Sync"},"core/host/InspectorFrontendHost.ts | devtoolsS":{"message":"DevTools - {PH1}"},"core/host/ResourceLoader.ts | cacheError":{"message":"Cache error"},"core/host/ResourceLoader.ts | certificateError":{"message":"Certificate error"},"core/host/ResourceLoader.ts | certificateManagerError":{"message":"Certificate manager error"},"core/host/ResourceLoader.ts | connectionError":{"message":"Connection error"},"core/host/ResourceLoader.ts | decodingDataUrlFailed":{"message":"Decoding Data URL failed"},"core/host/ResourceLoader.ts | dnsResolverError":{"message":"DNS resolver error"},"core/host/ResourceLoader.ts | ftpError":{"message":"FTP error"},"core/host/ResourceLoader.ts | httpError":{"message":"HTTP error"},"core/host/ResourceLoader.ts | httpErrorStatusCodeSS":{"message":"HTTP error: status code {PH1}, {PH2}"},"core/host/ResourceLoader.ts | invalidUrl":{"message":"Invalid URL"},"core/host/ResourceLoader.ts | signedExchangeError":{"message":"Signed Exchange error"},"core/host/ResourceLoader.ts | systemError":{"message":"System error"},"core/host/ResourceLoader.ts | unknownError":{"message":"Unknown error"},"core/sdk/ChildTargetManager.ts | main":{"message":"Main"},"core/sdk/CompilerSourceMappingContentProvider.ts | couldNotLoadContentForSS":{"message":"Could not load content for {PH1} ({PH2})"},"core/sdk/ConsoleModel.ts | bfcacheNavigation":{"message":"Navigation to {PH1} was restored from back/forward cache (see https://web.dev/bfcache/)"},"core/sdk/ConsoleModel.ts | failedToSaveToTempVariable":{"message":"Failed to save to temp variable."},"core/sdk/ConsoleModel.ts | navigatedToS":{"message":"Navigated to {PH1}"},"core/sdk/ConsoleModel.ts | profileSFinished":{"message":"Profile ''{PH1}'' finished."},"core/sdk/ConsoleModel.ts | profileSStarted":{"message":"Profile ''{PH1}'' started."},"core/sdk/CPUProfilerModel.ts | profileD":{"message":"Profile {PH1}"},"core/sdk/CSSStyleSheetHeader.ts | couldNotFindTheOriginalStyle":{"message":"Could not find the original style sheet."},"core/sdk/CSSStyleSheetHeader.ts | thereWasAnErrorRetrievingThe":{"message":"There was an error retrieving the source styles."},"core/sdk/DebuggerModel.ts | block":{"message":"Block"},"core/sdk/DebuggerModel.ts | catchBlock":{"message":"Catch block"},"core/sdk/DebuggerModel.ts | closure":{"message":"Closure"},"core/sdk/DebuggerModel.ts | exception":{"message":"Exception"},"core/sdk/DebuggerModel.ts | expression":{"message":"Expression"},"core/sdk/DebuggerModel.ts | global":{"message":"Global"},"core/sdk/DebuggerModel.ts | local":{"message":"Local"},"core/sdk/DebuggerModel.ts | module":{"message":"Module"},"core/sdk/DebuggerModel.ts | returnValue":{"message":"Return value"},"core/sdk/DebuggerModel.ts | script":{"message":"Script"},"core/sdk/DebuggerModel.ts | withBlock":{"message":"With block"},"core/sdk/NetworkManager.ts | fast4G":{"message":"Fast 4G"},"core/sdk/NetworkManager.ts | fastG":{"message":"Slow 4G"},"core/sdk/NetworkManager.ts | noContentForPreflight":{"message":"No content available for preflight request"},"core/sdk/NetworkManager.ts | noContentForRedirect":{"message":"No content available because this request was redirected"},"core/sdk/NetworkManager.ts | noContentForWebSocket":{"message":"Content for WebSockets is currently not supported"},"core/sdk/NetworkManager.ts | noThrottling":{"message":"No throttling"},"core/sdk/NetworkManager.ts | offline":{"message":"Offline"},"core/sdk/NetworkManager.ts | requestWasBlockedByDevtoolsS":{"message":"Request was blocked by DevTools: \"{PH1}\""},"core/sdk/NetworkManager.ts | sFailedLoadingSS":{"message":"{PH1} failed loading: {PH2} \"{PH3}\"."},"core/sdk/NetworkManager.ts | sFinishedLoadingSS":{"message":"{PH1} finished loading: {PH2} \"{PH3}\"."},"core/sdk/NetworkManager.ts | slowG":{"message":"3G"},"core/sdk/NetworkRequest.ts | anUnknownErrorWasEncounteredWhenTrying":{"message":"An unknown error was encountered when trying to store this cookie."},"core/sdk/NetworkRequest.ts | binary":{"message":"(binary)"},"core/sdk/NetworkRequest.ts | blockedReasonInvalidDomain":{"message":"This attempt to set a cookie via a Set-Cookie header was blocked because its Domain attribute was invalid with regards to the current host url."},"core/sdk/NetworkRequest.ts | blockedReasonInvalidPrefix":{"message":"This attempt to set a cookie via a Set-Cookie header was blocked because it used the \"__Secure-\" or \"__Host-\" prefix in its name and broke the additional rules applied to cookies with these prefixes as defined in https://tools.ietf.org/html/draft-west-cookie-prefixes-05."},"core/sdk/NetworkRequest.ts | blockedReasonOverwriteSecure":{"message":"This attempt to set a cookie via a Set-Cookie header was blocked because it was not sent over a secure connection and would have overwritten a cookie with the Secure attribute."},"core/sdk/NetworkRequest.ts | blockedReasonSameSiteNoneInsecure":{"message":"This attempt to set a cookie via a Set-Cookie header was blocked because it had the \"SameSite=None\" attribute but did not have the \"Secure\" attribute, which is required in order to use \"SameSite=None\"."},"core/sdk/NetworkRequest.ts | blockedReasonSameSiteStrictLax":{"message":"This attempt to set a cookie via a Set-Cookie header was blocked because it had the \"{PH1}\" attribute but came from a cross-site response which was not the response to a top-level navigation."},"core/sdk/NetworkRequest.ts | blockedReasonSameSiteUnspecifiedTreatedAsLax":{"message":"This Set-Cookie header didn't specify a \"SameSite\" attribute and was defaulted to \"SameSite=Lax,\" and was blocked because it came from a cross-site response which was not the response to a top-level navigation. The Set-Cookie had to have been set with \"SameSite=None\" to enable cross-site usage."},"core/sdk/NetworkRequest.ts | blockedReasonSecureOnly":{"message":"This attempt to set a cookie via a Set-Cookie header was blocked because it had the \"Secure\" attribute but was not received over a secure connection."},"core/sdk/NetworkRequest.ts | domainMismatch":{"message":"This cookie was blocked because neither did the request URL's domain exactly match the cookie's domain, nor was the request URL's domain a subdomain of the cookie's Domain attribute value."},"core/sdk/NetworkRequest.ts | exemptionReasonEnterprisePolicy":{"message":"This cookie is allowed by Chrome Enterprise policy. Learn more: goo.gle/ce-3pc"},"core/sdk/NetworkRequest.ts | exemptionReasonScheme":{"message":"This cookie is allowed by the top-level url scheme"},"core/sdk/NetworkRequest.ts | exemptionReasonStorageAccessAPI":{"message":"This cookie is allowed by the Storage Access API. Learn more: goo.gle/saa"},"core/sdk/NetworkRequest.ts | exemptionReasonTopLevelStorageAccessAPI":{"message":"This cookie is allowed by the top-level Storage Access API. Learn more: goo.gle/saa-top"},"core/sdk/NetworkRequest.ts | exemptionReasonTopLevelTPCDDeprecationTrial":{"message":"This cookie is allowed by top-level third-party cookie deprecation trial. Learn more: goo.gle/ps-dt."},"core/sdk/NetworkRequest.ts | exemptionReasonTPCDDeprecationTrial":{"message":"This cookie is allowed by third-party cookie deprecation trial. Learn more: goo.gle/ps-dt."},"core/sdk/NetworkRequest.ts | exemptionReasonTPCDHeuristics":{"message":"This cookie is allowed by third-party cookie heuristics. Learn more: goo.gle/hbe"},"core/sdk/NetworkRequest.ts | exemptionReasonTPCDMetadata":{"message":"This cookie is allowed by a third-party cookie deprecation trial grace period. Learn more: goo.gle/dt-grace."},"core/sdk/NetworkRequest.ts | exemptionReasonUserSetting":{"message":"This cookie is allowed by user preference."},"core/sdk/NetworkRequest.ts | nameValuePairExceedsMaxSize":{"message":"This cookie was blocked because it was too large. The combined size of the name and value must be less than or equal to 4096 characters."},"core/sdk/NetworkRequest.ts | notOnPath":{"message":"This cookie was blocked because its path was not an exact match for or a superdirectory of the request url's path."},"core/sdk/NetworkRequest.ts | samePartyFromCrossPartyContext":{"message":"This cookie was blocked because it had the \"SameParty\" attribute but the request was cross-party. The request was considered cross-party because the domain of the resource's URL and the domains of the resource's enclosing frames/documents are neither owners nor members in the same First-Party Set."},"core/sdk/NetworkRequest.ts | sameSiteLax":{"message":"This cookie was blocked because it had the \"SameSite=Lax\" attribute and the request was made from a different site and was not initiated by a top-level navigation."},"core/sdk/NetworkRequest.ts | sameSiteNoneInsecure":{"message":"This cookie was blocked because it had the \"SameSite=None\" attribute but was not marked \"Secure\". Cookies without SameSite restrictions must be marked \"Secure\" and sent over a secure connection."},"core/sdk/NetworkRequest.ts | sameSiteStrict":{"message":"This cookie was blocked because it had the \"SameSite=Strict\" attribute and the request was made from a different site. This includes top-level navigation requests initiated by other sites."},"core/sdk/NetworkRequest.ts | sameSiteUnspecifiedTreatedAsLax":{"message":"This cookie didn't specify a \"SameSite\" attribute when it was stored and was defaulted to \"SameSite=Lax,\" and was blocked because the request was made from a different site and was not initiated by a top-level navigation. The cookie had to have been set with \"SameSite=None\" to enable cross-site usage."},"core/sdk/NetworkRequest.ts | schemefulSameSiteLax":{"message":"This cookie was blocked because it had the \"SameSite=Lax\" attribute but the request was cross-site and was not initiated by a top-level navigation. This request is considered cross-site because the URL has a different scheme than the current site."},"core/sdk/NetworkRequest.ts | schemefulSameSiteStrict":{"message":"This cookie was blocked because it had the \"SameSite=Strict\" attribute but the request was cross-site. This includes top-level navigation requests initiated by other sites. This request is considered cross-site because the URL has a different scheme than the current site."},"core/sdk/NetworkRequest.ts | schemefulSameSiteUnspecifiedTreatedAsLax":{"message":"This cookie didn't specify a \"SameSite\" attribute when it was stored, was defaulted to \"SameSite=Lax\", and was blocked because the request was cross-site and was not initiated by a top-level navigation. This request is considered cross-site because the URL has a different scheme than the current site."},"core/sdk/NetworkRequest.ts | secureOnly":{"message":"This cookie was blocked because it had the \"Secure\" attribute and the connection was not secure."},"core/sdk/NetworkRequest.ts | setcookieHeaderIsIgnoredIn":{"message":"Set-Cookie header is ignored in response from url: {PH1}. The combined size of the name and value must be less than or equal to 4096 characters."},"core/sdk/NetworkRequest.ts | theSchemeOfThisConnectionIsNot":{"message":"The scheme of this connection is not allowed to store cookies."},"core/sdk/NetworkRequest.ts | thirdPartyPhaseout":{"message":"This cookie was blocked either because of Chrome flags or browser configuration. Learn more in the Issues panel."},"core/sdk/NetworkRequest.ts | thisSetcookieDidntSpecifyASamesite":{"message":"This Set-Cookie header didn't specify a \"SameSite\" attribute, was defaulted to \"SameSite=Lax\", and was blocked because it came from a cross-site response which was not the response to a top-level navigation. This response is considered cross-site because the URL has a different scheme than the current site."},"core/sdk/NetworkRequest.ts | thisSetcookieHadADisallowedCharacter":{"message":"This Set-Cookie header contained a disallowed character (a forbidden ASCII control character, or the tab character if it appears in the middle of the cookie name, value, an attribute name, or an attribute value)."},"core/sdk/NetworkRequest.ts | thisSetcookieHadInvalidSyntax":{"message":"This Set-Cookie header had invalid syntax."},"core/sdk/NetworkRequest.ts | thisSetcookieWasBlockedBecauseItHadTheSameparty":{"message":"This attempt to set a cookie via a Set-Cookie header was blocked because it had the \"SameParty\" attribute but the request was cross-party. The request was considered cross-party because the domain of the resource's URL and the domains of the resource's enclosing frames/documents are neither owners nor members in the same First-Party Set."},"core/sdk/NetworkRequest.ts | thisSetcookieWasBlockedBecauseItHadTheSamepartyAttribute":{"message":"This attempt to set a cookie via a Set-Cookie header was blocked because it had the \"SameParty\" attribute but also had other conflicting attributes. Chrome requires cookies that use the \"SameParty\" attribute to also have the \"Secure\" attribute, and to not be restricted to \"SameSite=Strict\"."},"core/sdk/NetworkRequest.ts | thisSetcookieWasBlockedBecauseItHadTheSamesiteStrictLax":{"message":"This attempt to set a cookie via a Set-Cookie header was blocked because it had the \"{PH1}\" attribute but came from a cross-site response which was not the response to a top-level navigation. This response is considered cross-site because the URL has a different scheme than the current site."},"core/sdk/NetworkRequest.ts | thisSetcookieWasBlockedBecauseTheNameValuePairExceedsMaxSize":{"message":"This attempt to set a cookie via a Set-Cookie header was blocked because the cookie was too large. The combined size of the name and value must be less than or equal to 4096 characters."},"core/sdk/NetworkRequest.ts | thisSetcookieWasBlockedDueThirdPartyPhaseout":{"message":"Setting this cookie was blocked either because of Chrome flags or browser configuration. Learn more in the Issues panel."},"core/sdk/NetworkRequest.ts | thisSetcookieWasBlockedDueToUser":{"message":"This attempt to set a cookie via a Set-Cookie header was blocked due to user preferences."},"core/sdk/NetworkRequest.ts | unknownError":{"message":"An unknown error was encountered when trying to send this cookie."},"core/sdk/NetworkRequest.ts | userPreferences":{"message":"This cookie was blocked due to user preferences."},"core/sdk/OverlayModel.ts | pausedInDebugger":{"message":"Paused in debugger"},"core/sdk/PageResourceLoader.ts | loadCanceledDueToReloadOf":{"message":"Load canceled due to reload of inspected page"},"core/sdk/RehydratingConnection.ts | errorLoadingLog":{"message":"Error loading log"},"core/sdk/RehydratingConnection.ts | noHostWindow":{"message":"Can not find host window"},"core/sdk/RehydratingConnection.ts | noSourceText":{"message":"No source text available"},"core/sdk/Script.ts | scriptRemovedOrDeleted":{"message":"Script removed or deleted."},"core/sdk/Script.ts | unableToFetchScriptSource":{"message":"Unable to fetch script source."},"core/sdk/sdk-meta.ts | achromatopsia":{"message":"Achromatopsia (no color)"},"core/sdk/sdk-meta.ts | blurredVision":{"message":"Blurred vision"},"core/sdk/sdk-meta.ts | captureAsyncStackTraces":{"message":"Capture async stack traces"},"core/sdk/sdk-meta.ts | customFormatters":{"message":"Custom formatters"},"core/sdk/sdk-meta.ts | deuteranopia":{"message":"Deuteranopia (no green)"},"core/sdk/sdk-meta.ts | disableAsyncStackTraces":{"message":"Disable async stack traces"},"core/sdk/sdk-meta.ts | disableAvifFormat":{"message":"Disable AVIF format"},"core/sdk/sdk-meta.ts | disableCache":{"message":"Disable cache while DevTools is open"},"core/sdk/sdk-meta.ts | disableJavascript":{"message":"Disable JavaScript"},"core/sdk/sdk-meta.ts | disableLocalFonts":{"message":"Disable local fonts"},"core/sdk/sdk-meta.ts | disableNetworkRequestBlocking":{"message":"Disable network request blocking"},"core/sdk/sdk-meta.ts | disableWebpFormat":{"message":"Disable WebP format"},"core/sdk/sdk-meta.ts | doNotCaptureAsyncStackTraces":{"message":"Do not capture async stack traces"},"core/sdk/sdk-meta.ts | doNotEmulateAFocusedPage":{"message":"Do not emulate a focused page"},"core/sdk/sdk-meta.ts | doNotEmulateAnyVisionDeficiency":{"message":"Do not emulate any vision deficiency"},"core/sdk/sdk-meta.ts | doNotEmulateCss":{"message":"Do not emulate CSS {PH1}"},"core/sdk/sdk-meta.ts | doNotEmulateCssMediaType":{"message":"Do not emulate CSS media type"},"core/sdk/sdk-meta.ts | doNotExtendGridLines":{"message":"Do not extend grid lines"},"core/sdk/sdk-meta.ts | doNotHighlightAdFrames":{"message":"Do not highlight ad frames"},"core/sdk/sdk-meta.ts | doNotPauseOnExceptions":{"message":"Do not pause on exceptions"},"core/sdk/sdk-meta.ts | doNotPreserveLogUponNavigation":{"message":"Do not preserve log upon navigation"},"core/sdk/sdk-meta.ts | doNotShowGridNamedAreas":{"message":"Do not show grid named areas"},"core/sdk/sdk-meta.ts | doNotShowGridTrackSizes":{"message":"Do not show grid track sizes"},"core/sdk/sdk-meta.ts | doNotShowRulersOnHover":{"message":"Do not show rulers on hover"},"core/sdk/sdk-meta.ts | emulateAchromatopsia":{"message":"Emulate achromatopsia (no color)"},"core/sdk/sdk-meta.ts | emulateAFocusedPage":{"message":"Emulate a focused page"},"core/sdk/sdk-meta.ts | emulateAutoDarkMode":{"message":"Emulate auto dark mode"},"core/sdk/sdk-meta.ts | emulateBlurredVision":{"message":"Emulate blurred vision"},"core/sdk/sdk-meta.ts | emulateCss":{"message":"Emulate CSS {PH1}"},"core/sdk/sdk-meta.ts | emulateCssMediaFeature":{"message":"Emulate CSS media feature {PH1}"},"core/sdk/sdk-meta.ts | emulateCssMediaType":{"message":"Emulate CSS media type"},"core/sdk/sdk-meta.ts | emulateCssPrintMediaType":{"message":"Emulate CSS print media type"},"core/sdk/sdk-meta.ts | emulateCssScreenMediaType":{"message":"Emulate CSS screen media type"},"core/sdk/sdk-meta.ts | emulateDeuteranopia":{"message":"Emulate deuteranopia (no green)"},"core/sdk/sdk-meta.ts | emulateProtanopia":{"message":"Emulate protanopia (no red)"},"core/sdk/sdk-meta.ts | emulateReducedContrast":{"message":"Emulate reduced contrast"},"core/sdk/sdk-meta.ts | emulateTritanopia":{"message":"Emulate tritanopia (no blue)"},"core/sdk/sdk-meta.ts | emulateVisionDeficiencies":{"message":"Emulate vision deficiencies"},"core/sdk/sdk-meta.ts | enableAvifFormat":{"message":"Enable AVIF format"},"core/sdk/sdk-meta.ts | enableCache":{"message":"Enable cache"},"core/sdk/sdk-meta.ts | enableJavascript":{"message":"Enable JavaScript"},"core/sdk/sdk-meta.ts | enableLocalFonts":{"message":"Enable local fonts"},"core/sdk/sdk-meta.ts | enableNetworkRequestBlocking":{"message":"Enable network request blocking"},"core/sdk/sdk-meta.ts | enableRemoteFileLoading":{"message":"Allow DevTools to load resources, such as source maps, from remote file paths. Disabled by default for security reasons."},"core/sdk/sdk-meta.ts | enableWebpFormat":{"message":"Enable WebP format"},"core/sdk/sdk-meta.ts | extendGridLines":{"message":"Extend grid lines"},"core/sdk/sdk-meta.ts | hideFramesPerSecondFpsMeter":{"message":"Hide frames per second (FPS) meter"},"core/sdk/sdk-meta.ts | hideLayerBorders":{"message":"Hide layer borders"},"core/sdk/sdk-meta.ts | hideLayoutShiftRegions":{"message":"Hide layout shift regions"},"core/sdk/sdk-meta.ts | hideLineLabels":{"message":"Hide line labels"},"core/sdk/sdk-meta.ts | hidePaintFlashingRectangles":{"message":"Hide paint flashing rectangles"},"core/sdk/sdk-meta.ts | hideScrollPerformanceBottlenecks":{"message":"Hide scroll performance bottlenecks"},"core/sdk/sdk-meta.ts | highlightAdFrames":{"message":"Highlight ad frames"},"core/sdk/sdk-meta.ts | networkCacheExplanation":{"message":"Disabling the network cache will simulate a network experience similar to a first time visitor."},"core/sdk/sdk-meta.ts | networkRequestBlocking":{"message":"Network request blocking"},"core/sdk/sdk-meta.ts | noEmulation":{"message":"No emulation"},"core/sdk/sdk-meta.ts | pauseOnExceptions":{"message":"Pause on exceptions"},"core/sdk/sdk-meta.ts | preserveLogUponNavigation":{"message":"Preserve log upon navigation"},"core/sdk/sdk-meta.ts | print":{"message":"print"},"core/sdk/sdk-meta.ts | protanopia":{"message":"Protanopia (no red)"},"core/sdk/sdk-meta.ts | query":{"message":"query"},"core/sdk/sdk-meta.ts | reducedContrast":{"message":"Reduced contrast"},"core/sdk/sdk-meta.ts | screen":{"message":"screen"},"core/sdk/sdk-meta.ts | showAreaNames":{"message":"Show area names"},"core/sdk/sdk-meta.ts | showFramesPerSecondFpsMeter":{"message":"Show frames per second (FPS) meter"},"core/sdk/sdk-meta.ts | showGridNamedAreas":{"message":"Show grid named areas"},"core/sdk/sdk-meta.ts | showGridTrackSizes":{"message":"Show grid track sizes"},"core/sdk/sdk-meta.ts | showLayerBorders":{"message":"Show layer borders"},"core/sdk/sdk-meta.ts | showLayoutShiftRegions":{"message":"Show layout shift regions"},"core/sdk/sdk-meta.ts | showLineLabels":{"message":"Show line labels"},"core/sdk/sdk-meta.ts | showLineNames":{"message":"Show line names"},"core/sdk/sdk-meta.ts | showLineNumbers":{"message":"Show line numbers"},"core/sdk/sdk-meta.ts | showPaintFlashingRectangles":{"message":"Show paint flashing rectangles"},"core/sdk/sdk-meta.ts | showRulersOnHover":{"message":"Show rulers on hover"},"core/sdk/sdk-meta.ts | showScrollPerformanceBottlenecks":{"message":"Show scroll performance bottlenecks"},"core/sdk/sdk-meta.ts | showTrackSizes":{"message":"Show track sizes"},"core/sdk/sdk-meta.ts | tritanopia":{"message":"Tritanopia (no blue)"},"core/sdk/ServerTiming.ts | deprecatedSyntaxFoundPleaseUse":{"message":"Deprecated syntax found. Please use: ;dur=;desc="},"core/sdk/ServerTiming.ts | duplicateParameterSIgnored":{"message":"Duplicate parameter \"{PH1}\" ignored."},"core/sdk/ServerTiming.ts | extraneousTrailingCharacters":{"message":"Extraneous trailing characters."},"core/sdk/ServerTiming.ts | noValueFoundForParameterS":{"message":"No value found for parameter \"{PH1}\"."},"core/sdk/ServerTiming.ts | unableToParseSValueS":{"message":"Unable to parse \"{PH1}\" value \"{PH2}\"."},"core/sdk/ServerTiming.ts | unrecognizedParameterS":{"message":"Unrecognized parameter \"{PH1}\"."},"core/sdk/ServiceWorkerCacheModel.ts | serviceworkercacheagentError":{"message":"ServiceWorkerCacheAgent error deleting cache entry {PH1} in cache: {PH2}"},"core/sdk/ServiceWorkerManager.ts | activated":{"message":"activated"},"core/sdk/ServiceWorkerManager.ts | activating":{"message":"activating"},"core/sdk/ServiceWorkerManager.ts | installed":{"message":"installed"},"core/sdk/ServiceWorkerManager.ts | installing":{"message":"installing"},"core/sdk/ServiceWorkerManager.ts | new":{"message":"new"},"core/sdk/ServiceWorkerManager.ts | redundant":{"message":"redundant"},"core/sdk/ServiceWorkerManager.ts | running":{"message":"running"},"core/sdk/ServiceWorkerManager.ts | sSS":{"message":"{PH1} #{PH2} ({PH3})"},"core/sdk/ServiceWorkerManager.ts | starting":{"message":"starting"},"core/sdk/ServiceWorkerManager.ts | stopped":{"message":"stopped"},"core/sdk/ServiceWorkerManager.ts | stopping":{"message":"stopping"},"core/sdk/SourceMapScopeChainEntry.ts | block":{"message":"Block"},"core/sdk/SourceMapScopeChainEntry.ts | closure":{"message":"Closure"},"core/sdk/SourceMapScopeChainEntry.ts | global":{"message":"Global"},"core/sdk/SourceMapScopeChainEntry.ts | local":{"message":"Local"},"core/sdk/SourceMapScopeChainEntry.ts | returnValue":{"message":"Return value"},"entrypoints/inspector_main/inspector_main-meta.ts | autoOpenDevTools":{"message":"Auto-open DevTools for popups"},"entrypoints/inspector_main/inspector_main-meta.ts | blockAds":{"message":"Block ads on this site"},"entrypoints/inspector_main/inspector_main-meta.ts | colorVisionDeficiency":{"message":"color vision deficiency"},"entrypoints/inspector_main/inspector_main-meta.ts | cssMediaFeature":{"message":"CSS media feature"},"entrypoints/inspector_main/inspector_main-meta.ts | cssMediaType":{"message":"CSS media type"},"entrypoints/inspector_main/inspector_main-meta.ts | disablePaused":{"message":"Disable paused state overlay"},"entrypoints/inspector_main/inspector_main-meta.ts | doNotAutoOpen":{"message":"Do not auto-open DevTools for popups"},"entrypoints/inspector_main/inspector_main-meta.ts | forceAdBlocking":{"message":"Force ad blocking on this site"},"entrypoints/inspector_main/inspector_main-meta.ts | fps":{"message":"fps"},"entrypoints/inspector_main/inspector_main-meta.ts | hardReloadPage":{"message":"Hard reload page"},"entrypoints/inspector_main/inspector_main-meta.ts | layout":{"message":"layout"},"entrypoints/inspector_main/inspector_main-meta.ts | paint":{"message":"paint"},"entrypoints/inspector_main/inspector_main-meta.ts | reloadPage":{"message":"Reload page"},"entrypoints/inspector_main/inspector_main-meta.ts | rendering":{"message":"Rendering"},"entrypoints/inspector_main/inspector_main-meta.ts | showAds":{"message":"Show ads on this site, if allowed"},"entrypoints/inspector_main/inspector_main-meta.ts | showRendering":{"message":"Show Rendering"},"entrypoints/inspector_main/inspector_main-meta.ts | toggleCssPrefersColorSchemeMedia":{"message":"Toggle CSS media feature prefers-color-scheme"},"entrypoints/inspector_main/inspector_main-meta.ts | visionDeficiency":{"message":"vision deficiency"},"entrypoints/inspector_main/InspectorMain.ts | javascriptIsDisabled":{"message":"JavaScript is disabled"},"entrypoints/inspector_main/InspectorMain.ts | main":{"message":"Main"},"entrypoints/inspector_main/InspectorMain.ts | openDedicatedTools":{"message":"Open dedicated DevTools for Node.js"},"entrypoints/inspector_main/InspectorMain.ts | tab":{"message":"Tab"},"entrypoints/inspector_main/OutermostTargetSelector.ts | targetNotSelected":{"message":"Page: Not selected"},"entrypoints/inspector_main/OutermostTargetSelector.ts | targetS":{"message":"Page: {PH1}"},"entrypoints/inspector_main/RenderingOptions.ts | disableAvifImageFormat":{"message":"Disable AVIF image format"},"entrypoints/inspector_main/RenderingOptions.ts | disableLocalFonts":{"message":"Disable local fonts"},"entrypoints/inspector_main/RenderingOptions.ts | disablesLocalSourcesInFontface":{"message":"Disables local() sources in @font-face rules. Requires a page reload to apply."},"entrypoints/inspector_main/RenderingOptions.ts | disableWebpImageFormat":{"message":"Disable WebP image format"},"entrypoints/inspector_main/RenderingOptions.ts | emulateAFocusedPage":{"message":"Emulate a focused page"},"entrypoints/inspector_main/RenderingOptions.ts | emulateAutoDarkMode":{"message":"Enable automatic dark mode"},"entrypoints/inspector_main/RenderingOptions.ts | emulatesAFocusedPage":{"message":"Keep page focused. Commonly used for debugging disappearing elements."},"entrypoints/inspector_main/RenderingOptions.ts | emulatesAutoDarkMode":{"message":"Enables automatic dark mode and sets prefers-color-scheme to dark."},"entrypoints/inspector_main/RenderingOptions.ts | forcesCssColorgamutMediaFeature":{"message":"Forces CSS color-gamut media feature"},"entrypoints/inspector_main/RenderingOptions.ts | forcesCssForcedColors":{"message":"Forces CSS forced-colors media feature"},"entrypoints/inspector_main/RenderingOptions.ts | forcesCssPreferscolorschemeMedia":{"message":"Forces CSS prefers-color-scheme media feature"},"entrypoints/inspector_main/RenderingOptions.ts | forcesCssPreferscontrastMedia":{"message":"Forces CSS prefers-contrast media feature"},"entrypoints/inspector_main/RenderingOptions.ts | forcesCssPrefersreduceddataMedia":{"message":"Forces CSS prefers-reduced-data media feature"},"entrypoints/inspector_main/RenderingOptions.ts | forcesCssPrefersreducedmotion":{"message":"Forces CSS prefers-reduced-motion media feature"},"entrypoints/inspector_main/RenderingOptions.ts | forcesCssPrefersreducedtransparencyMedia":{"message":"Forces CSS prefers-reduced-transparency media feature"},"entrypoints/inspector_main/RenderingOptions.ts | forcesMediaTypeForTestingPrint":{"message":"Forces media type for testing print and screen styles"},"entrypoints/inspector_main/RenderingOptions.ts | forcesVisionDeficiencyEmulation":{"message":"Forces vision deficiency emulation"},"entrypoints/inspector_main/RenderingOptions.ts | frameRenderingStats":{"message":"Frame Rendering Stats"},"entrypoints/inspector_main/RenderingOptions.ts | highlightAdFrames":{"message":"Highlight ad frames"},"entrypoints/inspector_main/RenderingOptions.ts | highlightsAreasOfThePageBlueThat":{"message":"Highlights areas of the page (blue) that were shifted. May not be suitable for people prone to photosensitive epilepsy."},"entrypoints/inspector_main/RenderingOptions.ts | highlightsAreasOfThePageGreen":{"message":"Highlights areas of the page (green) that need to be repainted. May not be suitable for people prone to photosensitive epilepsy."},"entrypoints/inspector_main/RenderingOptions.ts | highlightsElementsTealThatCan":{"message":"Highlights elements (teal) that can slow down scrolling, including touch & wheel event handlers and other main-thread scrolling situations."},"entrypoints/inspector_main/RenderingOptions.ts | highlightsFramesRedDetectedToBe":{"message":"Highlights frames (red) detected to be ads."},"entrypoints/inspector_main/RenderingOptions.ts | layerBorders":{"message":"Layer borders"},"entrypoints/inspector_main/RenderingOptions.ts | layoutShiftRegions":{"message":"Layout shift regions"},"entrypoints/inspector_main/RenderingOptions.ts | paintFlashing":{"message":"Paint flashing"},"entrypoints/inspector_main/RenderingOptions.ts | plotsFrameThroughputDropped":{"message":"Plots frame throughput, dropped frames distribution, and GPU memory."},"entrypoints/inspector_main/RenderingOptions.ts | requiresAPageReloadToApplyAnd":{"message":"Requires a page reload to apply and disables caching for image requests."},"entrypoints/inspector_main/RenderingOptions.ts | scrollingPerformanceIssues":{"message":"Scrolling performance issues"},"entrypoints/inspector_main/RenderingOptions.ts | showsLayerBordersOrangeoliveAnd":{"message":"Shows layer borders (orange/olive) and tiles (cyan)."},"entrypoints/js_app/js_app.ts | main":{"message":"Main"},"entrypoints/js_app/js_app.ts | networkTitle":{"message":"Scripts"},"entrypoints/js_app/js_app.ts | showNode":{"message":"Show Scripts"},"entrypoints/main/main-meta.ts | auto":{"message":"auto"},"entrypoints/main/main-meta.ts | autoTheme":{"message":"Auto"},"entrypoints/main/main-meta.ts | bottom":{"message":"Bottom"},"entrypoints/main/main-meta.ts | browserLanguage":{"message":"Browser UI language"},"entrypoints/main/main-meta.ts | cancelSearch":{"message":"Cancel search"},"entrypoints/main/main-meta.ts | darkCapital":{"message":"Dark"},"entrypoints/main/main-meta.ts | darkLower":{"message":"dark"},"entrypoints/main/main-meta.ts | devtoolsDefault":{"message":"DevTools (Default)"},"entrypoints/main/main-meta.ts | dockToBottom":{"message":"Dock to bottom"},"entrypoints/main/main-meta.ts | dockToLeft":{"message":"Dock to left"},"entrypoints/main/main-meta.ts | dockToRight":{"message":"Dock to right"},"entrypoints/main/main-meta.ts | dontMatchChromeColorSchemeCommand":{"message":"Don't match Chrome color scheme"},"entrypoints/main/main-meta.ts | enableCtrlShortcutToSwitchPanels":{"message":"Enable Ctrl + 1-9 shortcut to switch panels"},"entrypoints/main/main-meta.ts | enableShortcutToSwitchPanels":{"message":"Enable ⌘ + 1-9 shortcut to switch panels"},"entrypoints/main/main-meta.ts | enableSync":{"message":"Enable settings sync"},"entrypoints/main/main-meta.ts | findNextResult":{"message":"Find next result"},"entrypoints/main/main-meta.ts | findPreviousResult":{"message":"Find previous result"},"entrypoints/main/main-meta.ts | focusDebuggee":{"message":"Focus page"},"entrypoints/main/main-meta.ts | horizontal":{"message":"horizontal"},"entrypoints/main/main-meta.ts | language":{"message":"Language:"},"entrypoints/main/main-meta.ts | left":{"message":"Left"},"entrypoints/main/main-meta.ts | lightCapital":{"message":"Light"},"entrypoints/main/main-meta.ts | lightLower":{"message":"light"},"entrypoints/main/main-meta.ts | matchChromeColorScheme":{"message":"Match Chrome color scheme"},"entrypoints/main/main-meta.ts | matchChromeColorSchemeCommand":{"message":"Match Chrome color scheme"},"entrypoints/main/main-meta.ts | matchChromeColorSchemeDocumentation":{"message":"Match DevTools colors to your customized Chrome theme (when enabled)"},"entrypoints/main/main-meta.ts | nextPanel":{"message":"Next panel"},"entrypoints/main/main-meta.ts | panelLayout":{"message":"Panel layout:"},"entrypoints/main/main-meta.ts | previousPanel":{"message":"Previous panel"},"entrypoints/main/main-meta.ts | reloadDevtools":{"message":"Reload DevTools"},"entrypoints/main/main-meta.ts | resetZoomLevel":{"message":"Reset zoom level"},"entrypoints/main/main-meta.ts | restoreLastDockPosition":{"message":"Restore last dock position"},"entrypoints/main/main-meta.ts | right":{"message":"Right"},"entrypoints/main/main-meta.ts | searchAsYouTypeCommand":{"message":"Enable search as you type"},"entrypoints/main/main-meta.ts | searchAsYouTypeSetting":{"message":"Search as you type"},"entrypoints/main/main-meta.ts | searchInPanel":{"message":"Search in panel"},"entrypoints/main/main-meta.ts | searchOnEnterCommand":{"message":"Disable search as you type (press Enter to search)"},"entrypoints/main/main-meta.ts | switchToBrowserPreferredTheme":{"message":"Switch to browser's preferred theme"},"entrypoints/main/main-meta.ts | switchToDarkTheme":{"message":"Switch to dark theme"},"entrypoints/main/main-meta.ts | switchToLightTheme":{"message":"Switch to light theme"},"entrypoints/main/main-meta.ts | theme":{"message":"Theme:"},"entrypoints/main/main-meta.ts | toggleDrawer":{"message":"Toggle drawer"},"entrypoints/main/main-meta.ts | undocked":{"message":"Undocked"},"entrypoints/main/main-meta.ts | undockIntoSeparateWindow":{"message":"Undock into separate window"},"entrypoints/main/main-meta.ts | useAutomaticPanelLayout":{"message":"Use automatic panel layout"},"entrypoints/main/main-meta.ts | useHorizontalPanelLayout":{"message":"Use horizontal panel layout"},"entrypoints/main/main-meta.ts | useVerticalPanelLayout":{"message":"Use vertical panel layout"},"entrypoints/main/main-meta.ts | vertical":{"message":"vertical"},"entrypoints/main/main-meta.ts | zoomIn":{"message":"Zoom in"},"entrypoints/main/main-meta.ts | zoomOut":{"message":"Zoom out"},"entrypoints/main/MainImpl.ts | customizeAndControlDevtools":{"message":"Customize and control DevTools"},"entrypoints/main/MainImpl.ts | dockSide":{"message":"Dock side"},"entrypoints/main/MainImpl.ts | dockSideNaviation":{"message":"Use left and right arrow keys to navigate the options"},"entrypoints/main/MainImpl.ts | dockToBottom":{"message":"Dock to bottom"},"entrypoints/main/MainImpl.ts | dockToLeft":{"message":"Dock to left"},"entrypoints/main/MainImpl.ts | dockToRight":{"message":"Dock to right"},"entrypoints/main/MainImpl.ts | focusDebuggee":{"message":"Focus page"},"entrypoints/main/MainImpl.ts | help":{"message":"Help"},"entrypoints/main/MainImpl.ts | hideConsoleDrawer":{"message":"Hide console drawer"},"entrypoints/main/MainImpl.ts | moreTools":{"message":"More tools"},"entrypoints/main/MainImpl.ts | placementOfDevtoolsRelativeToThe":{"message":"Placement of DevTools relative to the page. ({PH1} to restore last position)"},"entrypoints/main/MainImpl.ts | showConsoleDrawer":{"message":"Show console drawer"},"entrypoints/main/MainImpl.ts | undockIntoSeparateWindow":{"message":"Undock into separate window"},"entrypoints/node_app/node_app.ts | connection":{"message":"Connection"},"entrypoints/node_app/node_app.ts | networkTitle":{"message":"Node"},"entrypoints/node_app/node_app.ts | node":{"message":"node"},"entrypoints/node_app/node_app.ts | showConnection":{"message":"Show Connection"},"entrypoints/node_app/node_app.ts | showNode":{"message":"Show Node"},"entrypoints/node_app/NodeConnectionsPanel.ts | addConnection":{"message":"Add connection"},"entrypoints/node_app/NodeConnectionsPanel.ts | networkAddressEgLocalhost":{"message":"Network address (e.g. localhost:9229)"},"entrypoints/node_app/NodeConnectionsPanel.ts | noConnectionsSpecified":{"message":"No connections specified"},"entrypoints/node_app/NodeConnectionsPanel.ts | nodejsDebuggingGuide":{"message":"Node.js debugging guide"},"entrypoints/node_app/NodeConnectionsPanel.ts | specifyNetworkEndpointAnd":{"message":"Specify network endpoint and DevTools will connect to it automatically. Read {PH1} to learn more."},"entrypoints/node_app/NodeMain.ts | main":{"message":"Main"},"entrypoints/node_app/NodeMain.ts | nodejsS":{"message":"Node.js: {PH1}"},"entrypoints/node_app/NodeMain.ts | NodejsTitleS":{"message":"DevTools - Node.js: {PH1}"},"entrypoints/worker_app/WorkerMain.ts | main":{"message":"Main"},"generated/Deprecation.ts | AuthorizationCoveredByWildcard":{"message":"Authorization will not be covered by the wildcard symbol (*) in CORS Access-Control-Allow-Headers handling."},"generated/Deprecation.ts | CanRequestURLHTTPContainingNewline":{"message":"Resource requests whose URLs contained both removed whitespace \\(n|r|t) characters and less-than characters (<) are blocked. Please remove newlines and encode less-than characters from places like element attribute values in order to load these resources."},"generated/Deprecation.ts | ChromeLoadTimesConnectionInfo":{"message":"chrome.loadTimes() is deprecated, instead use standardized API: Navigation Timing 2."},"generated/Deprecation.ts | ChromeLoadTimesFirstPaintAfterLoadTime":{"message":"chrome.loadTimes() is deprecated, instead use standardized API: Paint Timing."},"generated/Deprecation.ts | ChromeLoadTimesWasAlternateProtocolAvailable":{"message":"chrome.loadTimes() is deprecated, instead use standardized API: nextHopProtocol in Navigation Timing 2."},"generated/Deprecation.ts | CookieWithTruncatingChar":{"message":"Cookies containing a \\(0|r|n) character will be rejected instead of truncated."},"generated/Deprecation.ts | CrossOriginAccessBasedOnDocumentDomain":{"message":"Relaxing the same-origin policy by setting document.domain is deprecated, and will be disabled by default. This deprecation warning is for a cross-origin access that was enabled by setting document.domain."},"generated/Deprecation.ts | CrossOriginWindowAlert":{"message":"Triggering window.alert from cross origin iframes has been deprecated and will be removed in the future."},"generated/Deprecation.ts | CrossOriginWindowConfirm":{"message":"Triggering window.confirm from cross origin iframes has been deprecated and will be removed in the future."},"generated/Deprecation.ts | CSSCustomStateDeprecatedSyntax":{"message":":--customstatename is deprecated. Please use the :state(customstatename) syntax instead."},"generated/Deprecation.ts | CSSSelectorInternalMediaControlsOverlayCastButton":{"message":"The disableRemotePlayback attribute should be used in order to disable the default Cast integration instead of using -internal-media-controls-overlay-cast-button selector."},"generated/Deprecation.ts | CSSValueAppearanceSliderVertical":{"message":"CSS appearance value slider-vertical is not standardized and will be removed."},"generated/Deprecation.ts | DataUrlInSvgUse":{"message":"Support for data: URLs in SVGUseElement is deprecated and it will be removed in the future."},"generated/Deprecation.ts | DOMMutationEvents":{"message":"DOM Mutation Events, including DOMSubtreeModified, DOMNodeInserted, DOMNodeRemoved, DOMNodeRemovedFromDocument, DOMNodeInsertedIntoDocument, and DOMCharacterDataModified are deprecated (https://w3c.github.io/uievents/#legacy-event-types) and will be removed. Please use MutationObserver instead."},"generated/Deprecation.ts | GeolocationInsecureOrigin":{"message":"getCurrentPosition() and watchPosition() no longer work on insecure origins. To use this feature, you should consider switching your application to a secure origin, such as HTTPS. See https://goo.gle/chrome-insecure-origins for more details."},"generated/Deprecation.ts | GeolocationInsecureOriginDeprecatedNotRemoved":{"message":"getCurrentPosition() and watchPosition() are deprecated on insecure origins. To use this feature, you should consider switching your application to a secure origin, such as HTTPS. See https://goo.gle/chrome-insecure-origins for more details."},"generated/Deprecation.ts | GetUserMediaInsecureOrigin":{"message":"getUserMedia() no longer works on insecure origins. To use this feature, you should consider switching your application to a secure origin, such as HTTPS. See https://goo.gle/chrome-insecure-origins for more details."},"generated/Deprecation.ts | HostCandidateAttributeGetter":{"message":"RTCPeerConnectionIceErrorEvent.hostCandidate is deprecated. Please use RTCPeerConnectionIceErrorEvent.address or RTCPeerConnectionIceErrorEvent.port instead."},"generated/Deprecation.ts | IdentityInCanMakePaymentEvent":{"message":"The merchant origin and arbitrary data from the canmakepayment service worker event are deprecated and will be removed: topOrigin, paymentRequestOrigin, methodData, modifiers."},"generated/Deprecation.ts | InsecurePrivateNetworkSubresourceRequest":{"message":"The website requested a subresource from a network that it could only access because of its users' privileged network position. These requests expose non-public devices and servers to the internet, increasing the risk of a cross-site request forgery (CSRF) attack, and/or information leakage. To mitigate these risks, Chrome deprecates requests to non-public subresources when initiated from non-secure contexts, and will start blocking them."},"generated/Deprecation.ts | InterestGroupDailyUpdateUrl":{"message":"The dailyUpdateUrl field of InterestGroups passed to joinAdInterestGroup() has been renamed to updateUrl, to more accurately reflect its behavior."},"generated/Deprecation.ts | LocalCSSFileExtensionRejected":{"message":"CSS cannot be loaded from file: URLs unless they end in a .css file extension."},"generated/Deprecation.ts | MediaSourceAbortRemove":{"message":"Using SourceBuffer.abort() to abort remove()'s asynchronous range removal is deprecated due to specification change. Support will be removed in the future. You should listen to the updateend event instead. abort() is intended to only abort an asynchronous media append or reset parser state."},"generated/Deprecation.ts | MediaSourceDurationTruncatingBuffered":{"message":"Setting MediaSource.duration below the highest presentation timestamp of any buffered coded frames is deprecated due to specification change. Support for implicit removal of truncated buffered media will be removed in the future. You should instead perform explicit remove(newDuration, oldDuration) on all sourceBuffers, where newDuration < oldDuration."},"generated/Deprecation.ts | NoSysexWebMIDIWithoutPermission":{"message":"Web MIDI will ask a permission to use even if the sysex is not specified in the MIDIOptions."},"generated/Deprecation.ts | NotificationInsecureOrigin":{"message":"The Notification API may no longer be used from insecure origins. You should consider switching your application to a secure origin, such as HTTPS. See https://goo.gle/chrome-insecure-origins for more details."},"generated/Deprecation.ts | NotificationPermissionRequestedIframe":{"message":"Permission for the Notification API may no longer be requested from a cross-origin iframe. You should consider requesting permission from a top-level frame or opening a new window instead."},"generated/Deprecation.ts | ObsoleteCreateImageBitmapImageOrientationNone":{"message":"Option imageOrientation: 'none' in createImageBitmap is deprecated. Please use createImageBitmap with option {imageOrientation: 'from-image'} instead."},"generated/Deprecation.ts | ObsoleteWebRtcCipherSuite":{"message":"Your partner is negotiating an obsolete (D)TLS version. Please check with your partner to have this fixed."},"generated/Deprecation.ts | OverflowVisibleOnReplacedElement":{"message":"Specifying overflow: visible on img, video and canvas tags may cause them to produce visual content outside of the element bounds. See https://github.com/WICG/shared-element-transitions/blob/main/debugging_overflow_on_images.md."},"generated/Deprecation.ts | PaymentInstruments":{"message":"paymentManager.instruments is deprecated. Please use just-in-time install for payment handlers instead."},"generated/Deprecation.ts | PaymentRequestCSPViolation":{"message":"Your PaymentRequest call bypassed Content-Security-Policy (CSP) connect-src directive. This bypass is deprecated. Please add the payment method identifier from the PaymentRequest API (in supportedMethods field) to your CSP connect-src directive."},"generated/Deprecation.ts | PersistentQuotaType":{"message":"StorageType.persistent is deprecated. Please use standardized navigator.storage instead."},"generated/Deprecation.ts | PictureSourceSrc":{"message":" with a parent is invalid and therefore ignored. Please use instead."},"generated/Deprecation.ts | PrefixedCancelAnimationFrame":{"message":"webkitCancelAnimationFrame is vendor-specific. Please use the standard cancelAnimationFrame instead."},"generated/Deprecation.ts | PrefixedRequestAnimationFrame":{"message":"webkitRequestAnimationFrame is vendor-specific. Please use the standard requestAnimationFrame instead."},"generated/Deprecation.ts | PrefixedVideoDisplayingFullscreen":{"message":"HTMLVideoElement.webkitDisplayingFullscreen is deprecated. Please use Document.fullscreenElement instead."},"generated/Deprecation.ts | PrefixedVideoEnterFullscreen":{"message":"HTMLVideoElement.webkitEnterFullscreen() is deprecated. Please use Element.requestFullscreen() instead."},"generated/Deprecation.ts | PrefixedVideoEnterFullScreen":{"message":"HTMLVideoElement.webkitEnterFullScreen() is deprecated. Please use Element.requestFullscreen() instead."},"generated/Deprecation.ts | PrefixedVideoExitFullscreen":{"message":"HTMLVideoElement.webkitExitFullscreen() is deprecated. Please use Document.exitFullscreen() instead."},"generated/Deprecation.ts | PrefixedVideoExitFullScreen":{"message":"HTMLVideoElement.webkitExitFullScreen() is deprecated. Please use Document.exitFullscreen() instead."},"generated/Deprecation.ts | PrefixedVideoSupportsFullscreen":{"message":"HTMLVideoElement.webkitSupportsFullscreen is deprecated. Please use Document.fullscreenEnabled instead."},"generated/Deprecation.ts | PrivacySandboxExtensionsAPI":{"message":"We're deprecating the API chrome.privacy.websites.privacySandboxEnabled, though it will remain active for backward compatibility until release M113. Instead, please use chrome.privacy.websites.topicsEnabled, chrome.privacy.websites.fledgeEnabled and chrome.privacy.websites.adMeasurementEnabled. See https://developer.chrome.com/docs/extensions/reference/privacy/#property-websites-privacySandboxEnabled."},"generated/Deprecation.ts | RangeExpand":{"message":"Range.expand() is deprecated. Please use Selection.modify() instead."},"generated/Deprecation.ts | RequestedSubresourceWithEmbeddedCredentials":{"message":"Subresource requests whose URLs contain embedded credentials (e.g. https://user:pass@host/) are blocked."},"generated/Deprecation.ts | RTCConstraintEnableDtlsSrtpFalse":{"message":"The constraint DtlsSrtpKeyAgreement is removed. You have specified a false value for this constraint, which is interpreted as an attempt to use the removed SDES key negotiation method. This functionality is removed; use a service that supports DTLS key negotiation instead."},"generated/Deprecation.ts | RTCConstraintEnableDtlsSrtpTrue":{"message":"The constraint DtlsSrtpKeyAgreement is removed. You have specified a true value for this constraint, which had no effect, but you can remove this constraint for tidiness."},"generated/Deprecation.ts | RTCPeerConnectionGetStatsLegacyNonCompliant":{"message":"The callback-based getStats() is deprecated and will be removed. Use the spec-compliant getStats() instead."},"generated/Deprecation.ts | RtcpMuxPolicyNegotiate":{"message":"The rtcpMuxPolicy option is deprecated and will be removed."},"generated/Deprecation.ts | SharedArrayBufferConstructedWithoutIsolation":{"message":"SharedArrayBuffer will require cross-origin isolation. See https://developer.chrome.com/blog/enabling-shared-array-buffer/ for more details."},"generated/Deprecation.ts | TextToSpeech_DisallowedByAutoplay":{"message":"speechSynthesis.speak() without user activation is deprecated and will be removed."},"generated/Deprecation.ts | UnloadHandler":{"message":"Unload event listeners are deprecated and will be removed."},"generated/Deprecation.ts | V8SharedArrayBufferConstructedInExtensionWithoutIsolation":{"message":"Extensions should opt into cross-origin isolation to continue using SharedArrayBuffer. See https://developer.chrome.com/docs/extensions/mv3/cross-origin-isolation/."},"generated/Deprecation.ts | WebGPULimitMaxInterStageShaderComponents":{"message":"The WebGPU limit maxInterStageShaderComponents is deprecated, instead use the WebGPU limit maxInterStageShaderVariables."},"generated/Deprecation.ts | WebSQL":{"message":"Web SQL is deprecated. Please use SQLite WebAssembly or Indexed Database"},"generated/Deprecation.ts | XHRJSONEncodingDetection":{"message":"UTF-16 is not supported by response json in XMLHttpRequest"},"generated/Deprecation.ts | XMLHttpRequestSynchronousInNonWorkerOutsideBeforeUnload":{"message":"Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user's experience. For more help, check https://xhr.spec.whatwg.org/."},"generated/Deprecation.ts | XRSupportsSession":{"message":"supportsSession() is deprecated. Please use isSessionSupported() and check the resolved boolean value instead."},"models/bindings/ContentProviderBasedProject.ts | unknownErrorLoadingFile":{"message":"Unknown error loading file"},"models/bindings/DebuggerLanguagePlugins.ts | debugSymbolsIncomplete":{"message":"The debug information for function {PH1} is incomplete"},"models/bindings/DebuggerLanguagePlugins.ts | errorInDebuggerLanguagePlugin":{"message":"Error in debugger language plugin: {PH1}"},"models/bindings/DebuggerLanguagePlugins.ts | failedToLoadDebugSymbolsFor":{"message":"[{PH1}] Failed to load debug symbols for {PH2} ({PH3})"},"models/bindings/DebuggerLanguagePlugins.ts | failedToLoadDebugSymbolsForFunction":{"message":"No debug information for function \"{PH1}\""},"models/bindings/DebuggerLanguagePlugins.ts | loadedDebugSymbolsForButDidnt":{"message":"[{PH1}] Loaded debug symbols for {PH2}, but didn't find any source files"},"models/bindings/DebuggerLanguagePlugins.ts | loadedDebugSymbolsForFound":{"message":"[{PH1}] Loaded debug symbols for {PH2}, found {PH3} source file(s)"},"models/bindings/DebuggerLanguagePlugins.ts | loadingDebugSymbolsFor":{"message":"[{PH1}] Loading debug symbols for {PH2}..."},"models/bindings/DebuggerLanguagePlugins.ts | loadingDebugSymbolsForVia":{"message":"[{PH1}] Loading debug symbols for {PH2} (via {PH3})..."},"models/bindings/IgnoreListManager.ts | addAllAnonymousScriptsToIgnoreList":{"message":"Add all anonymous scripts to ignore list"},"models/bindings/IgnoreListManager.ts | addAllContentScriptsToIgnoreList":{"message":"Add all extension scripts to ignore list"},"models/bindings/IgnoreListManager.ts | addAllThirdPartyScriptsToIgnoreList":{"message":"Add all third-party scripts to ignore list"},"models/bindings/IgnoreListManager.ts | addDirectoryToIgnoreList":{"message":"Add directory to ignore list"},"models/bindings/IgnoreListManager.ts | addScriptToIgnoreList":{"message":"Add script to ignore list"},"models/bindings/IgnoreListManager.ts | removeFromIgnoreList":{"message":"Remove from ignore list"},"models/bindings/ResourceScriptMapping.ts | liveEditCompileFailed":{"message":"LiveEdit compile failed: {PH1}"},"models/bindings/ResourceScriptMapping.ts | liveEditFailed":{"message":"LiveEdit failed: {PH1}"},"models/crux-manager/CrUXManager.ts | fieldOverrideWarning":{"message":"Field data is configured for a different URL than the current page."},"models/emulation/DeviceModeModel.ts | devicePixelRatioMustBeANumberOr":{"message":"Device pixel ratio must be a number or blank."},"models/emulation/DeviceModeModel.ts | devicePixelRatioMustBeGreater":{"message":"Device pixel ratio must be greater than or equal to {PH1}."},"models/emulation/DeviceModeModel.ts | devicePixelRatioMustBeLessThanOr":{"message":"Device pixel ratio must be less than or equal to {PH1}."},"models/emulation/DeviceModeModel.ts | heightCannotBeEmpty":{"message":"Height cannot be empty."},"models/emulation/DeviceModeModel.ts | heightMustBeANumber":{"message":"Height must be a number."},"models/emulation/DeviceModeModel.ts | heightMustBeGreaterThanOrEqualTo":{"message":"Height must be greater than or equal to {PH1}."},"models/emulation/DeviceModeModel.ts | heightMustBeLessThanOrEqualToS":{"message":"Height must be less than or equal to {PH1}."},"models/emulation/DeviceModeModel.ts | widthCannotBeEmpty":{"message":"Width cannot be empty."},"models/emulation/DeviceModeModel.ts | widthMustBeANumber":{"message":"Width must be a number."},"models/emulation/DeviceModeModel.ts | widthMustBeGreaterThanOrEqualToS":{"message":"Width must be greater than or equal to {PH1}."},"models/emulation/DeviceModeModel.ts | widthMustBeLessThanOrEqualToS":{"message":"Width must be less than or equal to {PH1}."},"models/emulation/EmulatedDevices.ts | laptopWithHiDPIScreen":{"message":"Laptop with HiDPI screen"},"models/emulation/EmulatedDevices.ts | laptopWithMDPIScreen":{"message":"Laptop with MDPI screen"},"models/emulation/EmulatedDevices.ts | laptopWithTouch":{"message":"Laptop with touch"},"models/har/Writer.ts | collectingContent":{"message":"Collecting content…"},"models/har/Writer.ts | writingFile":{"message":"Writing file…"},"models/issues_manager/BounceTrackingIssue.ts | bounceTrackingMitigations":{"message":"Bounce tracking mitigations"},"models/issues_manager/ClientHintIssue.ts | clientHintsInfrastructure":{"message":"Client Hints Infrastructure"},"models/issues_manager/ContentSecurityPolicyIssue.ts | contentSecurityPolicyEval":{"message":"Content Security Policy - Eval"},"models/issues_manager/ContentSecurityPolicyIssue.ts | contentSecurityPolicyInlineCode":{"message":"Content Security Policy - Inline Code"},"models/issues_manager/ContentSecurityPolicyIssue.ts | contentSecurityPolicySource":{"message":"Content Security Policy - Source Allowlists"},"models/issues_manager/ContentSecurityPolicyIssue.ts | trustedTypesFixViolations":{"message":"Trusted Types - Fix violations"},"models/issues_manager/ContentSecurityPolicyIssue.ts | trustedTypesPolicyViolation":{"message":"Trusted Types - Policy violation"},"models/issues_manager/CookieDeprecationMetadataIssue.ts | thirdPartyPhaseoutExplained":{"message":"Changes to Chrome's treatment of third-party cookies"},"models/issues_manager/CookieIssue.ts | anInsecure":{"message":"an insecure"},"models/issues_manager/CookieIssue.ts | aSecure":{"message":"a secure"},"models/issues_manager/CookieIssue.ts | consoleTpcdErrorMessage":{"message":"Third-party cookie is blocked in Chrome either because of Chrome flags or browser configuration."},"models/issues_manager/CookieIssue.ts | consoleTpcdWarningMessage":{"message":"Chrome is moving towards a new experience that allows users to choose to browse without third-party cookies."},"models/issues_manager/CookieIssue.ts | fileCrosSiteRedirectBug":{"message":"File a bug"},"models/issues_manager/CookieIssue.ts | firstPartySetsExplained":{"message":"First-Party Sets and the SameParty attribute"},"models/issues_manager/CookieIssue.ts | howSchemefulSamesiteWorks":{"message":"How Schemeful Same-Site Works"},"models/issues_manager/CookieIssue.ts | samesiteCookiesExplained":{"message":"SameSite cookies explained"},"models/issues_manager/CookieIssue.ts | thirdPartyPhaseoutExplained":{"message":"Changes to Chrome's treatment of third-party cookies"},"models/issues_manager/CorsIssue.ts | CORS":{"message":"Cross-Origin Resource Sharing (CORS)"},"models/issues_manager/CorsIssue.ts | corsPrivateNetworkAccess":{"message":"Private Network Access"},"models/issues_manager/CrossOriginEmbedderPolicyIssue.ts | coopAndCoep":{"message":"COOP and COEP"},"models/issues_manager/CrossOriginEmbedderPolicyIssue.ts | samesiteAndSameorigin":{"message":"Same-Site and Same-Origin"},"models/issues_manager/DeprecationIssue.ts | feature":{"message":"Check the feature status page for more details."},"models/issues_manager/DeprecationIssue.ts | milestone":{"message":"This change will go into effect with milestone {milestone}."},"models/issues_manager/DeprecationIssue.ts | title":{"message":"Deprecated feature used"},"models/issues_manager/FederatedAuthRequestIssue.ts | fedCm":{"message":"Federated Credential Management API"},"models/issues_manager/FederatedAuthUserInfoRequestIssue.ts | fedCmUserInfo":{"message":"Federated Credential Management User Info API"},"models/issues_manager/GenericIssue.ts | autocompleteAttributePageTitle":{"message":"HTML attribute: autocomplete"},"models/issues_manager/GenericIssue.ts | corbExplainerPageTitle":{"message":"CORB explainer"},"models/issues_manager/GenericIssue.ts | howDoesAutofillWorkPageTitle":{"message":"How does autofill work?"},"models/issues_manager/GenericIssue.ts | inputFormElementPageTitle":{"message":"The form input element"},"models/issues_manager/GenericIssue.ts | labelFormlementsPageTitle":{"message":"The label elements"},"models/issues_manager/HeavyAdIssue.ts | handlingHeavyAdInterventions":{"message":"Handling Heavy Ad Interventions"},"models/issues_manager/Issue.ts | breakingChangeIssue":{"message":"A breaking change issue: the page may stop working in an upcoming version of Chrome"},"models/issues_manager/Issue.ts | breakingChanges":{"message":"Breaking Changes"},"models/issues_manager/Issue.ts | improvementIssue":{"message":"An improvement issue: there is an opportunity to improve the page"},"models/issues_manager/Issue.ts | improvements":{"message":"Improvements"},"models/issues_manager/Issue.ts | pageErrorIssue":{"message":"A page error issue: the page is not working correctly"},"models/issues_manager/Issue.ts | pageErrors":{"message":"Page Errors"},"models/issues_manager/LowTextContrastIssue.ts | colorAndContrastAccessibility":{"message":"Color and contrast accessibility"},"models/issues_manager/MixedContentIssue.ts | preventingMixedContent":{"message":"Preventing mixed content"},"models/issues_manager/QuirksModeIssue.ts | documentCompatibilityMode":{"message":"Document compatibility mode"},"models/issues_manager/SharedArrayBufferIssue.ts | enablingSharedArrayBuffer":{"message":"Enabling SharedArrayBuffer"},"models/issues_manager/SharedDictionaryIssue.ts | compressionDictionaryTransport":{"message":"Compression Dictionary Transport"},"models/live-metrics/LiveMetrics.ts | lcpEmulationWarning":{"message":"Simulating a new device after the page loads can affect LCP. Reload the page after simulating a new device for accurate LCP data."},"models/logs/logs-meta.ts | clear":{"message":"clear"},"models/logs/logs-meta.ts | doNotPreserveLogOnPageReload":{"message":"Do not preserve log on page reload / navigation"},"models/logs/logs-meta.ts | preserve":{"message":"preserve"},"models/logs/logs-meta.ts | preserveLog":{"message":"Preserve log"},"models/logs/logs-meta.ts | preserveLogOnPageReload":{"message":"Preserve log on page reload / navigation"},"models/logs/logs-meta.ts | recordNetworkLog":{"message":"Record network log"},"models/logs/logs-meta.ts | reset":{"message":"reset"},"models/logs/NetworkLog.ts | anonymous":{"message":""},"models/persistence/EditFileSystemView.ts | add":{"message":"Add folder"},"models/persistence/EditFileSystemView.ts | enterAPath":{"message":"Enter a path"},"models/persistence/EditFileSystemView.ts | enterAUniquePath":{"message":"Enter a unique path"},"models/persistence/EditFileSystemView.ts | excludedFolders":{"message":"Excluded sub-folders"},"models/persistence/EditFileSystemView.ts | folderPath":{"message":"Folder path"},"models/persistence/EditFileSystemView.ts | none":{"message":"None"},"models/persistence/EditFileSystemView.ts | sViaDevtools":{"message":"{PH1} (via .devtools)"},"models/persistence/EditFileSystemView.ts | url":{"message":"URL"},"models/persistence/IsolatedFileSystem.ts | blobCouldNotBeLoaded":{"message":"Blob could not be loaded."},"models/persistence/IsolatedFileSystem.ts | cantReadFileSS":{"message":"Can't read file: {PH1}: {PH2}"},"models/persistence/IsolatedFileSystem.ts | fileSystemErrorS":{"message":"File system error: {PH1}"},"models/persistence/IsolatedFileSystem.ts | linkedToS":{"message":"Linked to {PH1}"},"models/persistence/IsolatedFileSystemManager.ts | unableToAddFilesystemS":{"message":"Unable to add filesystem: {PH1}"},"models/persistence/persistence-meta.ts | disableOverrideNetworkRequests":{"message":"Disable override network requests"},"models/persistence/persistence-meta.ts | enableLocalOverrides":{"message":"Enable Local Overrides"},"models/persistence/persistence-meta.ts | enableOverrideNetworkRequests":{"message":"Enable override network requests"},"models/persistence/persistence-meta.ts | interception":{"message":"interception"},"models/persistence/persistence-meta.ts | network":{"message":"network"},"models/persistence/persistence-meta.ts | override":{"message":"override"},"models/persistence/persistence-meta.ts | request":{"message":"request"},"models/persistence/persistence-meta.ts | rewrite":{"message":"rewrite"},"models/persistence/persistence-meta.ts | showWorkspace":{"message":"Show Workspace settings"},"models/persistence/persistence-meta.ts | workspace":{"message":"Workspace"},"models/persistence/PersistenceActions.ts | openInContainingFolder":{"message":"Open in containing folder"},"models/persistence/PersistenceActions.ts | overrideContent":{"message":"Override content"},"models/persistence/PersistenceActions.ts | overrideSourceMappedFileExplanation":{"message":"‘{PH1}’ is a source mapped file and cannot be overridden."},"models/persistence/PersistenceActions.ts | overrideSourceMappedFileWarning":{"message":"Override ‘{PH1}’ instead?"},"models/persistence/PersistenceActions.ts | saveAs":{"message":"Save as..."},"models/persistence/PersistenceActions.ts | saveImage":{"message":"Save image"},"models/persistence/PersistenceActions.ts | saveWasmFailed":{"message":"Unable to save WASM module to disk. Most likely the module is too large."},"models/persistence/PersistenceActions.ts | showOverrides":{"message":"Show all overrides"},"models/persistence/PersistenceUtils.ts | linkedToS":{"message":"Linked to {PH1}"},"models/persistence/PersistenceUtils.ts | linkedToSourceMapS":{"message":"Linked to source map: {PH1}"},"models/persistence/PlatformFileSystem.ts | unableToReadFilesWithThis":{"message":"PlatformFileSystem cannot read files."},"models/persistence/WorkspaceSettingsTab.ts | addFolder":{"message":"Add folder"},"models/persistence/WorkspaceSettingsTab.ts | folderExcludePattern":{"message":"Exclude from workspace"},"models/persistence/WorkspaceSettingsTab.ts | mappingsAreInferredAutomatically":{"message":"Mappings are inferred automatically."},"models/persistence/WorkspaceSettingsTab.ts | remove":{"message":"Remove"},"models/persistence/WorkspaceSettingsTab.ts | workspace":{"message":"Workspace"},"models/trace/insights/CLSCulprits.ts | description":{"message":"Layout shifts occur when elements move absent any user interaction. [Investigate the causes of layout shifts](https://web.dev/articles/optimize-cls), such as elements being added, removed, or their fonts changing as the page loads."},"models/trace/insights/CLSCulprits.ts | title":{"message":"Layout shift culprits"},"models/trace/insights/DocumentLatency.ts | description":{"message":"Your first network request is the most important. Reduce its latency by avoiding redirects, ensuring a fast server response, and enabling text compression."},"models/trace/insights/DocumentLatency.ts | title":{"message":"Document request latency"},"models/trace/insights/DOMSize.ts | description":{"message":"A large DOM will increase memory usage, cause longer style calculations, and produce costly layout reflows which impact page responsiveness. [Learn how to avoid an excessive DOM size](https://developer.chrome.com/docs/lighthouse/performance/dom-size/)."},"models/trace/insights/DOMSize.ts | title":{"message":"Optimize DOM size"},"models/trace/insights/FontDisplay.ts | description":{"message":"Consider setting [font-display](https://developer.chrome.com/blog/font-display) to swap or optional to ensure text is consistently visible. swap can be further optimized to mitigate layout shifts with [font metric overrides](https://developer.chrome.com/blog/font-fallbacks)."},"models/trace/insights/FontDisplay.ts | title":{"message":"Font display"},"models/trace/insights/ImageDelivery.ts | description":{"message":"Reducing the download time of images can improve the perceived load time of the page and LCP. [Learn more about optimizing image size](https://developer.chrome.com/docs/lighthouse/performance/uses-optimized-images/)"},"models/trace/insights/ImageDelivery.ts | title":{"message":"Improve image delivery"},"models/trace/insights/ImageDelivery.ts | useCompression":{"message":"Increasing the image compression factor could improve this image's download size. (Est {PH1})"},"models/trace/insights/ImageDelivery.ts | useModernFormat":{"message":"Using a modern image format (WebP, AVIF) or increasing the image compression could improve this image's download size. (Est {PH1})"},"models/trace/insights/ImageDelivery.ts | useResponsiveSize":{"message":"This image file is larger than it needs to be ({PH2}) for its displayed dimensions ({PH3}). Use responsive images to reduce the image download size. (Est {PH1})"},"models/trace/insights/ImageDelivery.ts | useVideoFormat":{"message":"Using video formats instead of GIFs can improve the download size of animated content. (Est {PH1})"},"models/trace/insights/InteractionToNextPaint.ts | description":{"message":"Start investigating with the longest phase. [Delays can be minimized](https://web.dev/articles/optimize-inp#optimize_interactions). To reduce processing duration, [optimize the main-thread costs](https://web.dev/articles/optimize-long-tasks), often JS."},"models/trace/insights/InteractionToNextPaint.ts | title":{"message":"INP by phase"},"models/trace/insights/LCPDiscovery.ts | description":{"message":"Optimize LCP by making the LCP image [discoverable](https://web.dev/articles/optimize-lcp#1_eliminate_resource_load_delay) from the HTML immediately, and [avoiding lazy-loading](https://web.dev/articles/lcp-lazy-loading)"},"models/trace/insights/LCPDiscovery.ts | title":{"message":"LCP request discovery"},"models/trace/insights/LCPPhases.ts | description":{"message":"Each [phase has specific improvement strategies](https://web.dev/articles/optimize-lcp#lcp-breakdown). Ideally, most of the LCP time should be spent on loading the resources, not within delays."},"models/trace/insights/LCPPhases.ts | title":{"message":"LCP by phase"},"models/trace/insights/RenderBlocking.ts | description":{"message":"Requests are blocking the page's initial render, which may delay LCP. [Deferring or inlining](https://web.dev/learn/performance/understanding-the-critical-path#render-blocking_resources/) can move these network requests out of the critical path."},"models/trace/insights/RenderBlocking.ts | title":{"message":"Render blocking requests"},"models/trace/insights/SlowCSSSelector.ts | description":{"message":"If Recalculate Style costs remain high, selector optimization can reduce them. [Optimize the selectors](https://developer.chrome.com/docs/devtools/performance/selector-stats) with both high elapsed time and high slow-path %. Simpler selectors, fewer selectors, a smaller DOM, and a shallower DOM will all reduce matching costs."},"models/trace/insights/SlowCSSSelector.ts | title":{"message":"CSS Selector costs"},"models/trace/insights/ThirdParties.ts | description":{"message":"Third party code can significantly impact load performance. [Reduce and defer loading of third party code](https://developers.google.com/web/fundamentals/performance/optimizing-content-efficiency/loading-third-party-javascript/) to prioritize your page's content."},"models/trace/insights/ThirdParties.ts | title":{"message":"Third parties"},"models/trace/insights/Viewport.ts | description":{"message":"Tap interactions may be [delayed by up to 300 ms](https://developer.chrome.com/blog/300ms-tap-delay-gone-away/) if the viewport is not optimized for mobile."},"models/trace/insights/Viewport.ts | title":{"message":"Optimize viewport for mobile"},"models/workspace/UISourceCode.ts | index":{"message":"(index)"},"models/workspace/UISourceCode.ts | thisFileWasChangedExternally":{"message":"This file was changed externally. Would you like to reload it?"},"panels/accessibility/accessibility-meta.ts | accessibility":{"message":"Accessibility"},"panels/accessibility/accessibility-meta.ts | shoAccessibility":{"message":"Show Accessibility"},"panels/accessibility/AccessibilityNodeView.ts | accessibilityNodeNotExposed":{"message":"Accessibility node not exposed"},"panels/accessibility/AccessibilityNodeView.ts | ancestorChildrenAreAll":{"message":"Ancestor's children are all presentational: "},"panels/accessibility/AccessibilityNodeView.ts | computedProperties":{"message":"Computed Properties"},"panels/accessibility/AccessibilityNodeView.ts | elementHasEmptyAltText":{"message":"Element has empty alt text."},"panels/accessibility/AccessibilityNodeView.ts | elementHasPlaceholder":{"message":"Element has {PH1}."},"panels/accessibility/AccessibilityNodeView.ts | elementIsHiddenBy":{"message":"Element is hidden by active modal dialog: "},"panels/accessibility/AccessibilityNodeView.ts | elementIsHiddenByChildTree":{"message":"Element is hidden by child tree: "},"panels/accessibility/AccessibilityNodeView.ts | elementIsInAnInertSubTree":{"message":"Element is in an inert subtree from "},"panels/accessibility/AccessibilityNodeView.ts | elementIsInert":{"message":"Element is inert."},"panels/accessibility/AccessibilityNodeView.ts | elementIsNotRendered":{"message":"Element is not rendered."},"panels/accessibility/AccessibilityNodeView.ts | elementIsNotVisible":{"message":"Element is not visible."},"panels/accessibility/AccessibilityNodeView.ts | elementIsPlaceholder":{"message":"Element is {PH1}."},"panels/accessibility/AccessibilityNodeView.ts | elementIsPresentational":{"message":"Element is presentational."},"panels/accessibility/AccessibilityNodeView.ts | elementNotInteresting":{"message":"Element not interesting for accessibility."},"panels/accessibility/AccessibilityNodeView.ts | elementsInheritsPresentational":{"message":"Element inherits presentational role from "},"panels/accessibility/AccessibilityNodeView.ts | invalidSource":{"message":"Invalid source."},"panels/accessibility/AccessibilityNodeView.ts | labelFor":{"message":"Label for "},"panels/accessibility/AccessibilityNodeView.ts | noAccessibilityNode":{"message":"No accessibility node"},"panels/accessibility/AccessibilityNodeView.ts | noNodeWithThisId":{"message":"No node with this ID."},"panels/accessibility/AccessibilityNodeView.ts | noTextContent":{"message":"No text content."},"panels/accessibility/AccessibilityNodeView.ts | notSpecified":{"message":"Not specified"},"panels/accessibility/AccessibilityNodeView.ts | partOfLabelElement":{"message":"Part of label element: "},"panels/accessibility/AccessibilityNodeView.ts | placeholderIsPlaceholderOnAncestor":{"message":"{PH1} is {PH2} on ancestor: "},"panels/accessibility/AccessibilityStrings.ts | activeDescendant":{"message":"Active descendant"},"panels/accessibility/AccessibilityStrings.ts | aHumanreadableVersionOfTheValue":{"message":"A human-readable version of the value of a range widget (where necessary)."},"panels/accessibility/AccessibilityStrings.ts | atomicLiveRegions":{"message":"Atomic (live regions)"},"panels/accessibility/AccessibilityStrings.ts | busyLiveRegions":{"message":"Busy (live regions)"},"panels/accessibility/AccessibilityStrings.ts | canSetValue":{"message":"Can set value"},"panels/accessibility/AccessibilityStrings.ts | checked":{"message":"Checked"},"panels/accessibility/AccessibilityStrings.ts | contents":{"message":"Contents"},"panels/accessibility/AccessibilityStrings.ts | controls":{"message":"Controls"},"panels/accessibility/AccessibilityStrings.ts | describedBy":{"message":"Described by"},"panels/accessibility/AccessibilityStrings.ts | description":{"message":"Description"},"panels/accessibility/AccessibilityStrings.ts | disabled":{"message":"Disabled"},"panels/accessibility/AccessibilityStrings.ts | editable":{"message":"Editable"},"panels/accessibility/AccessibilityStrings.ts | elementOrElementsWhichFormThe":{"message":"Element or elements which form the description of this element."},"panels/accessibility/AccessibilityStrings.ts | elementOrElementsWhichMayFormThe":{"message":"Element or elements which may form the name of this element."},"panels/accessibility/AccessibilityStrings.ts | elementOrElementsWhichShouldBe":{"message":"Element or elements which should be considered descendants of this element, despite not being descendants in the DOM."},"panels/accessibility/AccessibilityStrings.ts | elementOrElementsWhoseContentOr":{"message":"Element or elements whose content or presence is/are controlled by this widget."},"panels/accessibility/AccessibilityStrings.ts | elementToWhichTheUserMayChooseTo":{"message":"Element to which the user may choose to navigate after this one, instead of the next element in the DOM order."},"panels/accessibility/AccessibilityStrings.ts | expanded":{"message":"Expanded"},"panels/accessibility/AccessibilityStrings.ts | focusable":{"message":"Focusable"},"panels/accessibility/AccessibilityStrings.ts | focused":{"message":"Focused"},"panels/accessibility/AccessibilityStrings.ts | forARangeWidgetTheMaximumAllowed":{"message":"For a range widget, the maximum allowed value."},"panels/accessibility/AccessibilityStrings.ts | forARangeWidgetTheMinimumAllowed":{"message":"For a range widget, the minimum allowed value."},"panels/accessibility/AccessibilityStrings.ts | fromAttribute":{"message":"From attribute"},"panels/accessibility/AccessibilityStrings.ts | fromCaption":{"message":"From caption"},"panels/accessibility/AccessibilityStrings.ts | fromDescription":{"message":"From description"},"panels/accessibility/AccessibilityStrings.ts | fromLabel":{"message":"From label"},"panels/accessibility/AccessibilityStrings.ts | fromLabelFor":{"message":"From label (for= attribute)"},"panels/accessibility/AccessibilityStrings.ts | fromLabelWrapped":{"message":"From label (wrapped)"},"panels/accessibility/AccessibilityStrings.ts | fromLegend":{"message":"From legend"},"panels/accessibility/AccessibilityStrings.ts | fromNativeHtml":{"message":"From native HTML"},"panels/accessibility/AccessibilityStrings.ts | fromPlaceholderAttribute":{"message":"From placeholder attribute"},"panels/accessibility/AccessibilityStrings.ts | fromRubyAnnotation":{"message":"From ruby annotation"},"panels/accessibility/AccessibilityStrings.ts | fromStyle":{"message":"From style"},"panels/accessibility/AccessibilityStrings.ts | fromTitle":{"message":"From title"},"panels/accessibility/AccessibilityStrings.ts | hasAutocomplete":{"message":"Has autocomplete"},"panels/accessibility/AccessibilityStrings.ts | hasPopup":{"message":"Has popup"},"panels/accessibility/AccessibilityStrings.ts | help":{"message":"Help"},"panels/accessibility/AccessibilityStrings.ts | ifAndHowThisElementCanBeEdited":{"message":"If and how this element can be edited."},"panels/accessibility/AccessibilityStrings.ts | ifThisElementMayReceiveLive":{"message":"If this element may receive live updates, whether the entire live region should be presented to the user on changes, or only changed nodes."},"panels/accessibility/AccessibilityStrings.ts | ifThisElementMayReceiveLiveUpdates":{"message":"If this element may receive live updates, what type of updates should trigger a notification."},"panels/accessibility/AccessibilityStrings.ts | ifThisElementMayReceiveLiveUpdatesThe":{"message":"If this element may receive live updates, the root element of the containing live region."},"panels/accessibility/AccessibilityStrings.ts | ifTrueThisElementCanReceiveFocus":{"message":"If true, this element can receive focus."},"panels/accessibility/AccessibilityStrings.ts | ifTrueThisElementCurrentlyCannot":{"message":"If true, this element currently cannot be interacted with."},"panels/accessibility/AccessibilityStrings.ts | ifTrueThisElementCurrentlyHas":{"message":"If true, this element currently has focus."},"panels/accessibility/AccessibilityStrings.ts | ifTrueThisElementMayBeInteracted":{"message":"If true, this element may be interacted with, but its value cannot be changed."},"panels/accessibility/AccessibilityStrings.ts | ifTrueThisElementsUserentered":{"message":"If true, this element's user-entered value does not conform to validation requirement."},"panels/accessibility/AccessibilityStrings.ts | implicit":{"message":"Implicit"},"panels/accessibility/AccessibilityStrings.ts | implicitValue":{"message":"Implicit value."},"panels/accessibility/AccessibilityStrings.ts | indicatesThePurposeOfThisElement":{"message":"Indicates the purpose of this element, such as a user interface idiom for a widget, or structural role within a document."},"panels/accessibility/AccessibilityStrings.ts | invalidUserEntry":{"message":"Invalid user entry"},"panels/accessibility/AccessibilityStrings.ts | labeledBy":{"message":"Labeled by"},"panels/accessibility/AccessibilityStrings.ts | level":{"message":"Level"},"panels/accessibility/AccessibilityStrings.ts | liveRegion":{"message":"Live region"},"panels/accessibility/AccessibilityStrings.ts | liveRegionRoot":{"message":"Live region root"},"panels/accessibility/AccessibilityStrings.ts | maximumValue":{"message":"Maximum value"},"panels/accessibility/AccessibilityStrings.ts | minimumValue":{"message":"Minimum value"},"panels/accessibility/AccessibilityStrings.ts | multiline":{"message":"Multi-line"},"panels/accessibility/AccessibilityStrings.ts | multiselectable":{"message":"Multi-selectable"},"panels/accessibility/AccessibilityStrings.ts | orientation":{"message":"Orientation"},"panels/accessibility/AccessibilityStrings.ts | pressed":{"message":"Pressed"},"panels/accessibility/AccessibilityStrings.ts | readonlyString":{"message":"Read-only"},"panels/accessibility/AccessibilityStrings.ts | relatedElement":{"message":"Related element"},"panels/accessibility/AccessibilityStrings.ts | relevantLiveRegions":{"message":"Relevant (live regions)"},"panels/accessibility/AccessibilityStrings.ts | requiredString":{"message":"Required"},"panels/accessibility/AccessibilityStrings.ts | role":{"message":"Role"},"panels/accessibility/AccessibilityStrings.ts | selectedString":{"message":"Selected"},"panels/accessibility/AccessibilityStrings.ts | theAccessibleDescriptionForThis":{"message":"The accessible description for this element."},"panels/accessibility/AccessibilityStrings.ts | theComputedHelpTextForThis":{"message":"The computed help text for this element."},"panels/accessibility/AccessibilityStrings.ts | theComputedNameOfThisElement":{"message":"The computed name of this element."},"panels/accessibility/AccessibilityStrings.ts | theDescendantOfThisElementWhich":{"message":"The descendant of this element which is active; i.e. the element to which focus should be delegated."},"panels/accessibility/AccessibilityStrings.ts | theHierarchicalLevelOfThis":{"message":"The hierarchical level of this element."},"panels/accessibility/AccessibilityStrings.ts | theValueOfThisElementThisMayBe":{"message":"The value of this element; this may be user-provided or developer-provided, depending on the element."},"panels/accessibility/AccessibilityStrings.ts | value":{"message":"Value"},"panels/accessibility/AccessibilityStrings.ts | valueDescription":{"message":"Value description"},"panels/accessibility/AccessibilityStrings.ts | valueFromAttribute":{"message":"Value from attribute."},"panels/accessibility/AccessibilityStrings.ts | valueFromDescriptionElement":{"message":"Value from description element."},"panels/accessibility/AccessibilityStrings.ts | valueFromElementContents":{"message":"Value from element contents."},"panels/accessibility/AccessibilityStrings.ts | valueFromFigcaptionElement":{"message":"Value from figcaption element."},"panels/accessibility/AccessibilityStrings.ts | valueFromLabelElement":{"message":"Value from label element."},"panels/accessibility/AccessibilityStrings.ts | valueFromLabelElementWithFor":{"message":"Value from label element with for= attribute."},"panels/accessibility/AccessibilityStrings.ts | valueFromLabelElementWrapped":{"message":"Value from a wrapping label element."},"panels/accessibility/AccessibilityStrings.ts | valueFromLegendElement":{"message":"Value from legend element."},"panels/accessibility/AccessibilityStrings.ts | valueFromNativeHtmlRuby":{"message":"Value from plain HTML ruby annotation."},"panels/accessibility/AccessibilityStrings.ts | valueFromNativeHtmlUnknownSource":{"message":"Value from native HTML (unknown source)."},"panels/accessibility/AccessibilityStrings.ts | valueFromPlaceholderAttribute":{"message":"Value from placeholder attribute."},"panels/accessibility/AccessibilityStrings.ts | valueFromRelatedElement":{"message":"Value from related element."},"panels/accessibility/AccessibilityStrings.ts | valueFromStyle":{"message":"Value from style."},"panels/accessibility/AccessibilityStrings.ts | valueFromTableCaption":{"message":"Value from table caption."},"panels/accessibility/AccessibilityStrings.ts | valueFromTitleAttribute":{"message":"Value from title attribute."},"panels/accessibility/AccessibilityStrings.ts | whetherAndWhatPriorityOfLive":{"message":"Whether and what priority of live updates may be expected for this element."},"panels/accessibility/AccessibilityStrings.ts | whetherAndWhatTypeOfAutocomplete":{"message":"Whether and what type of autocomplete suggestions are currently provided by this element."},"panels/accessibility/AccessibilityStrings.ts | whetherAUserMaySelectMoreThanOne":{"message":"Whether a user may select more than one option from this widget."},"panels/accessibility/AccessibilityStrings.ts | whetherTheOptionRepresentedBy":{"message":"Whether the option represented by this element is currently selected."},"panels/accessibility/AccessibilityStrings.ts | whetherTheValueOfThisElementCan":{"message":"Whether the value of this element can be set."},"panels/accessibility/AccessibilityStrings.ts | whetherThisCheckboxRadioButtonOr":{"message":"Whether this checkbox, radio button or tree item is checked, unchecked, or mixed (e.g. has both checked and un-checked children)."},"panels/accessibility/AccessibilityStrings.ts | whetherThisElementHasCausedSome":{"message":"Whether this element has caused some kind of pop-up (such as a menu) to appear."},"panels/accessibility/AccessibilityStrings.ts | whetherThisElementIsARequired":{"message":"Whether this element is a required field in a form."},"panels/accessibility/AccessibilityStrings.ts | whetherThisElementOrAnother":{"message":"Whether this element, or another grouping element it controls, is expanded."},"panels/accessibility/AccessibilityStrings.ts | whetherThisElementOrItsSubtree":{"message":"Whether this element or its subtree are currently being updated (and thus may be in an inconsistent state)."},"panels/accessibility/AccessibilityStrings.ts | whetherThisLinearElements":{"message":"Whether this linear element's orientation is horizontal or vertical."},"panels/accessibility/AccessibilityStrings.ts | whetherThisTextBoxMayHaveMore":{"message":"Whether this text box may have more than one line."},"panels/accessibility/AccessibilityStrings.ts | whetherThisToggleButtonIs":{"message":"Whether this toggle button is currently in a pressed state."},"panels/accessibility/ARIAAttributesView.ts | ariaAttributes":{"message":"ARIA Attributes"},"panels/accessibility/ARIAAttributesView.ts | noAriaAttributes":{"message":"No ARIA attributes"},"panels/accessibility/AXBreadcrumbsPane.ts | accessibilityTree":{"message":"Accessibility Tree"},"panels/accessibility/AXBreadcrumbsPane.ts | fullTreeExperimentDescription":{"message":"The accessibility tree moved to the top right corner of the DOM tree."},"panels/accessibility/AXBreadcrumbsPane.ts | fullTreeExperimentName":{"message":"Enable full-page accessibility tree"},"panels/accessibility/AXBreadcrumbsPane.ts | ignored":{"message":"Ignored"},"panels/accessibility/AXBreadcrumbsPane.ts | reloadRequired":{"message":"Reload required before the change takes effect."},"panels/accessibility/AXBreadcrumbsPane.ts | scrollIntoView":{"message":"Scroll into view"},"panels/accessibility/SourceOrderView.ts | noSourceOrderInformation":{"message":"No source order information available"},"panels/accessibility/SourceOrderView.ts | showSourceOrder":{"message":"Show source order"},"panels/accessibility/SourceOrderView.ts | sourceOrderViewer":{"message":"Source Order Viewer"},"panels/accessibility/SourceOrderView.ts | thereMayBeADelayInDisplaying":{"message":"There may be a delay in displaying source order for elements with many children"},"panels/ai_assistance/ai_assistance-meta.ts | aiAssistance":{"message":"AI assistance"},"panels/ai_assistance/ai_assistance-meta.ts | askAi":{"message":"Ask AI"},"panels/ai_assistance/ai_assistance-meta.ts | enableAiAssistance":{"message":"Enable AI assistance"},"panels/ai_assistance/ai_assistance-meta.ts | geoRestricted":{"message":"This feature is unavailable in your region."},"panels/ai_assistance/ai_assistance-meta.ts | policyRestricted":{"message":"This setting is managed by your administrator."},"panels/ai_assistance/ai_assistance-meta.ts | showAiAssistance":{"message":"Show AI assistance"},"panels/ai_assistance/ai_assistance-meta.ts | wrongLocale":{"message":"To use this feature, set your language preference to English in DevTools settings."},"panels/ai_assistance/AiAssistancePanel.ts | chatDeleted":{"message":"Chat deleted"},"panels/ai_assistance/AiAssistancePanel.ts | clearChatHistory":{"message":"Clear local chats"},"panels/ai_assistance/AiAssistancePanel.ts | deleteChat":{"message":"Delete local chat"},"panels/ai_assistance/AiAssistancePanel.ts | help":{"message":"Help"},"panels/ai_assistance/AiAssistancePanel.ts | history":{"message":"History"},"panels/ai_assistance/AiAssistancePanel.ts | newChat":{"message":"New chat"},"panels/ai_assistance/AiAssistancePanel.ts | newChatCreated":{"message":"New chat created"},"panels/ai_assistance/AiAssistancePanel.ts | noPastConversations":{"message":"No past conversations"},"panels/ai_assistance/AiAssistancePanel.ts | sendFeedback":{"message":"Send feedback"},"panels/ai_assistance/AiAssistancePanel.ts | settings":{"message":"Settings"},"panels/ai_assistance/components/ChatView.ts | followTheSteps":{"message":"Follow the steps above to ask a question"},"panels/ai_assistance/components/ChatView.ts | inputDisclaimerForEmptyState":{"message":"This is an experimental AI feature and won't always get it right."},"panels/ai_assistance/components/ChatView.ts | learnAbout":{"message":"Learn about AI in DevTools"},"panels/ai_assistance/components/ChatView.ts | notLoggedIn":{"message":"This feature is only available when you are signed into Chrome with your Google account"},"panels/ai_assistance/components/ChatView.ts | offline":{"message":"Check your internet connection and try again"},"panels/ai_assistance/components/ChatView.ts | settingsLink":{"message":"AI assistance in Settings"},"panels/ai_assistance/components/ChatView.ts | turnOnForStyles":{"message":"Turn on {PH1} to get help with understanding CSS styles"},"panels/ai_assistance/components/ChatView.ts | turnOnForStylesAndRequests":{"message":"Turn on {PH1} to get help with styles and network requests"},"panels/ai_assistance/components/ChatView.ts | turnOnForStylesRequestsAndFiles":{"message":"Turn on {PH1} to get help with styles, network requests, and files"},"panels/ai_assistance/components/ChatView.ts | turnOnForStylesRequestsPerformanceAndFiles":{"message":"Turn on {PH1} to get help with styles, network requests, performance, and files"},"panels/animation/animation-meta.ts | animations":{"message":"Animations"},"panels/animation/animation-meta.ts | showAnimations":{"message":"Show Animations"},"panels/animation/AnimationTimeline.ts | animationPreviews":{"message":"Animation previews"},"panels/animation/AnimationTimeline.ts | animationPreviewS":{"message":"Animation Preview {PH1}"},"panels/animation/AnimationTimeline.ts | clearAll":{"message":"Clear all"},"panels/animation/AnimationTimeline.ts | pause":{"message":"Pause"},"panels/animation/AnimationTimeline.ts | pauseAll":{"message":"Pause all"},"panels/animation/AnimationTimeline.ts | pauseTimeline":{"message":"Pause timeline"},"panels/animation/AnimationTimeline.ts | playbackRatePlaceholder":{"message":"{PH1}%"},"panels/animation/AnimationTimeline.ts | playbackRates":{"message":"Playback rates"},"panels/animation/AnimationTimeline.ts | playTimeline":{"message":"Play timeline"},"panels/animation/AnimationTimeline.ts | replayTimeline":{"message":"Replay timeline"},"panels/animation/AnimationTimeline.ts | resumeAll":{"message":"Resume all"},"panels/animation/AnimationTimeline.ts | selectAnEffectAboveToInspectAnd":{"message":"Select an effect above to inspect and modify."},"panels/animation/AnimationTimeline.ts | setSpeedToS":{"message":"Set speed to {PH1}"},"panels/animation/AnimationTimeline.ts | waitingForAnimations":{"message":"Waiting for animations..."},"panels/animation/AnimationUI.ts | animationEndpointSlider":{"message":"Animation Endpoint slider"},"panels/animation/AnimationUI.ts | animationKeyframeSlider":{"message":"Animation Keyframe slider"},"panels/animation/AnimationUI.ts | sSlider":{"message":"{PH1} slider"},"panels/application/application-meta.ts | application":{"message":"Application"},"panels/application/application-meta.ts | clearSiteData":{"message":"Clear site data"},"panels/application/application-meta.ts | clearSiteDataIncludingThirdparty":{"message":"Clear site data (including third-party cookies)"},"panels/application/application-meta.ts | pwa":{"message":"pwa"},"panels/application/application-meta.ts | showApplication":{"message":"Show Application"},"panels/application/application-meta.ts | startRecordingEvents":{"message":"Start recording events"},"panels/application/application-meta.ts | stopRecordingEvents":{"message":"Stop recording events"},"panels/application/ApplicationPanelSidebar.ts | application":{"message":"Application"},"panels/application/ApplicationPanelSidebar.ts | applicationSidebarPanel":{"message":"Application panel sidebar"},"panels/application/ApplicationPanelSidebar.ts | appManifest":{"message":"App Manifest"},"panels/application/ApplicationPanelSidebar.ts | backgroundServices":{"message":"Background services"},"panels/application/ApplicationPanelSidebar.ts | beforeInvokeAlert":{"message":"{PH1}: Invoke to scroll to this section in manifest"},"panels/application/ApplicationPanelSidebar.ts | clear":{"message":"Clear"},"panels/application/ApplicationPanelSidebar.ts | cookies":{"message":"Cookies"},"panels/application/ApplicationPanelSidebar.ts | cookiesUsedByFramesFromS":{"message":"Cookies used by frames from {PH1}"},"panels/application/ApplicationPanelSidebar.ts | documentNotAvailable":{"message":"Document not available"},"panels/application/ApplicationPanelSidebar.ts | extensionLocalStorage":{"message":"Local"},"panels/application/ApplicationPanelSidebar.ts | extensionManagedStorage":{"message":"Managed"},"panels/application/ApplicationPanelSidebar.ts | extensionSessionStorage":{"message":"Session"},"panels/application/ApplicationPanelSidebar.ts | extensionStorage":{"message":"Extension storage"},"panels/application/ApplicationPanelSidebar.ts | extensionSyncStorage":{"message":"Sync"},"panels/application/ApplicationPanelSidebar.ts | frames":{"message":"Frames"},"panels/application/ApplicationPanelSidebar.ts | indexeddb":{"message":"IndexedDB"},"panels/application/ApplicationPanelSidebar.ts | keyPathS":{"message":"Key path: {PH1}"},"panels/application/ApplicationPanelSidebar.ts | localFiles":{"message":"Local Files"},"panels/application/ApplicationPanelSidebar.ts | localStorage":{"message":"Local storage"},"panels/application/ApplicationPanelSidebar.ts | manifest":{"message":"Manifest"},"panels/application/ApplicationPanelSidebar.ts | noManifestDetected":{"message":"No manifest detected"},"panels/application/ApplicationPanelSidebar.ts | onInvokeAlert":{"message":"Scrolled to {PH1}"},"panels/application/ApplicationPanelSidebar.ts | onInvokeManifestAlert":{"message":"Manifest: Invoke to scroll to the top of manifest"},"panels/application/ApplicationPanelSidebar.ts | openedWindows":{"message":"Opened Windows"},"panels/application/ApplicationPanelSidebar.ts | refreshIndexeddb":{"message":"Refresh IndexedDB"},"panels/application/ApplicationPanelSidebar.ts | sessionStorage":{"message":"Session storage"},"panels/application/ApplicationPanelSidebar.ts | storage":{"message":"Storage"},"panels/application/ApplicationPanelSidebar.ts | theContentOfThisDocumentHasBeen":{"message":"The content of this document has been generated dynamically via 'document.write()'."},"panels/application/ApplicationPanelSidebar.ts | thirdPartyPhaseout":{"message":"Cookies from {PH1} may have been blocked due to third-party cookie phaseout."},"panels/application/ApplicationPanelSidebar.ts | versionS":{"message":"Version: {PH1}"},"panels/application/ApplicationPanelSidebar.ts | versionSEmpty":{"message":"Version: {PH1} (empty)"},"panels/application/ApplicationPanelSidebar.ts | webWorkers":{"message":"Web Workers"},"panels/application/ApplicationPanelSidebar.ts | windowWithoutTitle":{"message":"Window without title"},"panels/application/ApplicationPanelSidebar.ts | worker":{"message":"worker"},"panels/application/AppManifestView.ts | actualHeightSpxOfSSDoesNotMatch":{"message":"Actual height ({PH1}px) of {PH2} {PH3} does not match specified height ({PH4}px)"},"panels/application/AppManifestView.ts | actualSizeSspxOfSSDoesNotMatch":{"message":"Actual size ({PH1}×{PH2})px of {PH3} {PH4} does not match specified size ({PH5}×{PH6}px)"},"panels/application/AppManifestView.ts | actualWidthSpxOfSSDoesNotMatch":{"message":"Actual width ({PH1}px) of {PH2} {PH3} does not match specified width ({PH4}px)"},"panels/application/AppManifestView.ts | appIdExplainer":{"message":"This is used by the browser to know whether the manifest should be updating an existing application, or whether it refers to a new web app that can be installed."},"panels/application/AppManifestView.ts | appIdNote":{"message":"{PH1} {PH2} is not specified in the manifest, {PH3} is used instead. To specify an App ID that matches the current identity, set the {PH4} field to {PH5} {PH6}."},"panels/application/AppManifestView.ts | aUrlInTheManifestContainsA":{"message":"A URL in the manifest contains a username, password, or port"},"panels/application/AppManifestView.ts | avoidPurposeAnyAndMaskable":{"message":"Declaring an icon with 'purpose' of 'any maskable' is discouraged. It is likely to look incorrect on some platforms due to too much or too little padding."},"panels/application/AppManifestView.ts | backgroundColor":{"message":"Background color"},"panels/application/AppManifestView.ts | computedAppId":{"message":"Computed App ID"},"panels/application/AppManifestView.ts | copiedToClipboard":{"message":"Copied suggested ID {PH1} to clipboard"},"panels/application/AppManifestView.ts | copyToClipboard":{"message":"Copy suggested ID to clipboard"},"panels/application/AppManifestView.ts | couldNotCheckServiceWorker":{"message":"Could not check service worker without a 'start_url' field in the manifest"},"panels/application/AppManifestView.ts | couldNotDownloadARequiredIcon":{"message":"Could not download a required icon from the manifest"},"panels/application/AppManifestView.ts | customizePwaTitleBar":{"message":"Customize the window controls overlay of your PWA's title bar"},"panels/application/AppManifestView.ts | description":{"message":"Description"},"panels/application/AppManifestView.ts | descriptionMayBeTruncated":{"message":"Description may be truncated."},"panels/application/AppManifestView.ts | display":{"message":"Display"},"panels/application/AppManifestView.ts | documentationOnMaskableIcons":{"message":"documentation on maskable icons"},"panels/application/AppManifestView.ts | downloadedIconWasEmptyOr":{"message":"Downloaded icon was empty or corrupted"},"panels/application/AppManifestView.ts | errorsAndWarnings":{"message":"Errors and warnings"},"panels/application/AppManifestView.ts | formFactor":{"message":"Form factor"},"panels/application/AppManifestView.ts | icon":{"message":"Icon"},"panels/application/AppManifestView.ts | icons":{"message":"Icons"},"panels/application/AppManifestView.ts | identity":{"message":"Identity"},"panels/application/AppManifestView.ts | imageFromS":{"message":"Image from {PH1}"},"panels/application/AppManifestView.ts | installability":{"message":"Installability"},"panels/application/AppManifestView.ts | label":{"message":"Label"},"panels/application/AppManifestView.ts | learnMore":{"message":"Learn more"},"panels/application/AppManifestView.ts | manifestContainsDisplayoverride":{"message":"Manifest contains 'display_override' field, and the first supported display mode must be one of 'standalone', 'fullscreen', or 'minimal-ui'"},"panels/application/AppManifestView.ts | manifestCouldNotBeFetchedIsEmpty":{"message":"Manifest could not be fetched, is empty, or could not be parsed"},"panels/application/AppManifestView.ts | manifestDisplayPropertyMustBeOne":{"message":"Manifest 'display' property must be one of 'standalone', 'fullscreen', or 'minimal-ui'"},"panels/application/AppManifestView.ts | manifestDoesNotContainANameOr":{"message":"Manifest does not contain a 'name' or 'short_name' field"},"panels/application/AppManifestView.ts | manifestDoesNotContainASuitable":{"message":"Manifest does not contain a suitable icon—PNG, SVG, or WebP format of at least {PH1}px is required, the 'sizes' attribute must be set, and the 'purpose' attribute, if set, must include 'any'."},"panels/application/AppManifestView.ts | manifestSpecifies":{"message":"Manifest specifies 'prefer_related_applications: true'"},"panels/application/AppManifestView.ts | manifestStartUrlIsNotValid":{"message":"Manifest 'start_url' is not valid"},"panels/application/AppManifestView.ts | name":{"message":"Name"},"panels/application/AppManifestView.ts | needHelpReadOurS":{"message":"Need help? Read the {PH1}."},"panels/application/AppManifestView.ts | newNoteUrl":{"message":"New note URL"},"panels/application/AppManifestView.ts | noPlayStoreIdProvided":{"message":"No Play store ID provided"},"panels/application/AppManifestView.ts | noScreenshotsForRicherPWAInstallOnDesktop":{"message":"Richer PWA Install UI won’t be available on desktop. Please add at least one screenshot with the form_factor set to wide."},"panels/application/AppManifestView.ts | noScreenshotsForRicherPWAInstallOnMobile":{"message":"Richer PWA Install UI won’t be available on mobile. Please add at least one screenshot for which form_factor is not set or set to a value other than wide."},"panels/application/AppManifestView.ts | noSuppliedIconIsAtLeastSpxSquare":{"message":"No supplied icon is at least {PH1} pixels square in PNG, SVG, or WebP format, with the purpose attribute unset or set to 'any'."},"panels/application/AppManifestView.ts | note":{"message":"Note:"},"panels/application/AppManifestView.ts | orientation":{"message":"Orientation"},"panels/application/AppManifestView.ts | pageDoesNotWorkOffline":{"message":"Page does not work offline"},"panels/application/AppManifestView.ts | pageDoesNotWorkOfflineThePage":{"message":"Page does not work offline. Starting in Chrome 93, the installability criteria are changing, and this site will not be installable. See {PH1} for more information."},"panels/application/AppManifestView.ts | pageHasNoManifestLinkUrl":{"message":"Page has no manifest URL"},"panels/application/AppManifestView.ts | pageIsLoadedInAnIncognitoWindow":{"message":"Page is loaded in an incognito window"},"panels/application/AppManifestView.ts | pageIsNotLoadedInTheMainFrame":{"message":"Page is not loaded in the main frame"},"panels/application/AppManifestView.ts | pageIsNotServedFromASecureOrigin":{"message":"Page is not served from a secure origin"},"panels/application/AppManifestView.ts | platform":{"message":"Platform"},"panels/application/AppManifestView.ts | preferrelatedapplicationsIsOnly":{"message":"'prefer_related_applications' is only supported on Chrome Beta and Stable channels on Android."},"panels/application/AppManifestView.ts | presentation":{"message":"Presentation"},"panels/application/AppManifestView.ts | protocolHandlers":{"message":"Protocol Handlers"},"panels/application/AppManifestView.ts | screenshot":{"message":"Screenshot"},"panels/application/AppManifestView.ts | screenshotPixelSize":{"message":"Screenshot {url} should specify a pixel size [width]x[height] instead of any as first size."},"panels/application/AppManifestView.ts | screenshotS":{"message":"Screenshot #{PH1}"},"panels/application/AppManifestView.ts | screenshotsMustHaveSameAspectRatio":{"message":"All screenshots with the same form_factor must have the same aspect ratio as the first screenshot with that form_factor. Some screenshots will be ignored."},"panels/application/AppManifestView.ts | selectWindowControlsOverlayEmulationOs":{"message":"Emulate the Window Controls Overlay on"},"panels/application/AppManifestView.ts | shortcutS":{"message":"Shortcut #{PH1}"},"panels/application/AppManifestView.ts | shortcutsMayBeNotAvailable":{"message":"The maximum number of shortcuts is platform dependent. Some shortcuts may be not available."},"panels/application/AppManifestView.ts | shortcutSShouldIncludeAXPixel":{"message":"Shortcut #{PH1} should include a 96×96 pixel icon"},"panels/application/AppManifestView.ts | shortName":{"message":"Short name"},"panels/application/AppManifestView.ts | showOnlyTheMinimumSafeAreaFor":{"message":"Show only the minimum safe area for maskable icons"},"panels/application/AppManifestView.ts | sSDoesNotSpecifyItsSizeInThe":{"message":"{PH1} {PH2} does not specify its size in the manifest"},"panels/application/AppManifestView.ts | sSFailedToLoad":{"message":"{PH1} {PH2} failed to load"},"panels/application/AppManifestView.ts | sSHeightDoesNotComplyWithRatioRequirement":{"message":"{PH1} {PH2} height can't be more than 2.3 times as long as the width"},"panels/application/AppManifestView.ts | sSrcIsNotSet":{"message":"{PH1} 'src' is not set"},"panels/application/AppManifestView.ts | sSShouldHaveSquareIcon":{"message":"Most operating systems require square icons. Please include at least one square icon in the array."},"panels/application/AppManifestView.ts | sSShouldSpecifyItsSizeAs":{"message":"{PH1} {PH2} should specify its size as [width]x[height]"},"panels/application/AppManifestView.ts | sSSizeShouldBeAtLeast320":{"message":"{PH1} {PH2} size should be at least 320×320"},"panels/application/AppManifestView.ts | sSSizeShouldBeAtMost3840":{"message":"{PH1} {PH2} size should be at most 3840×3840"},"panels/application/AppManifestView.ts | sSWidthDoesNotComplyWithRatioRequirement":{"message":"{PH1} {PH2} width can't be more than 2.3 times as long as the height"},"panels/application/AppManifestView.ts | startUrl":{"message":"Start URL"},"panels/application/AppManifestView.ts | sUrlSFailedToParse":{"message":"{PH1} URL ''{PH2}'' failed to parse"},"panels/application/AppManifestView.ts | theAppIsAlreadyInstalled":{"message":"The app is already installed"},"panels/application/AppManifestView.ts | themeColor":{"message":"Theme color"},"panels/application/AppManifestView.ts | thePlayStoreAppUrlAndPlayStoreId":{"message":"The Play Store app URL and Play Store ID do not match"},"panels/application/AppManifestView.ts | theSpecifiedApplicationPlatform":{"message":"The specified application platform is not supported on Android"},"panels/application/AppManifestView.ts | tooManyScreenshotsForDesktop":{"message":"No more than 8 screenshots will be displayed on desktop. The rest will be ignored."},"panels/application/AppManifestView.ts | tooManyScreenshotsForMobile":{"message":"No more than 5 screenshots will be displayed on mobile. The rest will be ignored."},"panels/application/AppManifestView.ts | url":{"message":"URL"},"panels/application/AppManifestView.ts | wcoFound":{"message":"Chrome has successfully found the {PH1} value for the {PH2} field in the {PH3}."},"panels/application/AppManifestView.ts | wcoNeedHelpReadMore":{"message":"Need help? Read {PH1}."},"panels/application/AppManifestView.ts | wcoNotFound":{"message":"Define {PH1} in the manifest to use the Window Controls Overlay API and customize your app's title bar."},"panels/application/AppManifestView.ts | windowControlsOverlay":{"message":"Window Controls Overlay"},"panels/application/BackForwardCacheTreeElement.ts | backForwardCache":{"message":"Back/forward cache"},"panels/application/BackgroundServiceView.ts | backgroundFetch":{"message":"Background fetch"},"panels/application/BackgroundServiceView.ts | backgroundServices":{"message":"Background services"},"panels/application/BackgroundServiceView.ts | backgroundSync":{"message":"Background sync"},"panels/application/BackgroundServiceView.ts | clear":{"message":"Clear"},"panels/application/BackgroundServiceView.ts | clickTheRecordButtonSOrHitSTo":{"message":"Click the record button {PH1} or hit {PH2} to start recording."},"panels/application/BackgroundServiceView.ts | devtoolsWillRecordAllSActivity":{"message":"DevTools will record all {PH1} activity for up to 3 days, even when closed."},"panels/application/BackgroundServiceView.ts | empty":{"message":"empty"},"panels/application/BackgroundServiceView.ts | event":{"message":"Event"},"panels/application/BackgroundServiceView.ts | instanceId":{"message":"Instance ID"},"panels/application/BackgroundServiceView.ts | learnMore":{"message":"Learn more"},"panels/application/BackgroundServiceView.ts | noMetadataForThisEvent":{"message":"No metadata for this event"},"panels/application/BackgroundServiceView.ts | notifications":{"message":"Notifications"},"panels/application/BackgroundServiceView.ts | origin":{"message":"Origin"},"panels/application/BackgroundServiceView.ts | paymentHandler":{"message":"Payment handler"},"panels/application/BackgroundServiceView.ts | periodicBackgroundSync":{"message":"Periodic background sync"},"panels/application/BackgroundServiceView.ts | pushMessaging":{"message":"Push messaging"},"panels/application/BackgroundServiceView.ts | recordingSActivity":{"message":"Recording {PH1} activity..."},"panels/application/BackgroundServiceView.ts | saveEvents":{"message":"Save events"},"panels/application/BackgroundServiceView.ts | selectAnEntryToViewMetadata":{"message":"Select an entry to view metadata"},"panels/application/BackgroundServiceView.ts | showEventsForOtherStorageKeys":{"message":"Show events from other storage partitions"},"panels/application/BackgroundServiceView.ts | showEventsFromOtherDomains":{"message":"Show events from other domains"},"panels/application/BackgroundServiceView.ts | startRecordingEvents":{"message":"Start recording events"},"panels/application/BackgroundServiceView.ts | stopRecordingEvents":{"message":"Stop recording events"},"panels/application/BackgroundServiceView.ts | storageKey":{"message":"Storage Key"},"panels/application/BackgroundServiceView.ts | swScope":{"message":"Service Worker Scope"},"panels/application/BackgroundServiceView.ts | timestamp":{"message":"Timestamp"},"panels/application/BounceTrackingMitigationsTreeElement.ts | bounceTrackingMitigations":{"message":"Bounce tracking mitigations"},"panels/application/components/BackForwardCacheStrings.ts | appBanner":{"message":"Pages that requested an AppBanner are not currently eligible for back/forward cache."},"panels/application/components/BackForwardCacheStrings.ts | backForwardCacheDisabled":{"message":"Back/forward cache is disabled by flags. Visit chrome://flags/#back-forward-cache to enable it locally on this device."},"panels/application/components/BackForwardCacheStrings.ts | backForwardCacheDisabledByCommandLine":{"message":"Back/forward cache is disabled by the command line."},"panels/application/components/BackForwardCacheStrings.ts | backForwardCacheDisabledByLowMemory":{"message":"Back/forward cache is disabled due to insufficient memory."},"panels/application/components/BackForwardCacheStrings.ts | backForwardCacheDisabledForDelegate":{"message":"Back/forward cache is not supported by delegate."},"panels/application/components/BackForwardCacheStrings.ts | backForwardCacheDisabledForPrerender":{"message":"Back/forward cache is disabled for prerenderer."},"panels/application/components/BackForwardCacheStrings.ts | broadcastChannel":{"message":"The page cannot be cached because it has a BroadcastChannel instance with registered listeners."},"panels/application/components/BackForwardCacheStrings.ts | cacheControlNoStore":{"message":"Pages with cache-control:no-store header cannot enter back/forward cache."},"panels/application/components/BackForwardCacheStrings.ts | cacheFlushed":{"message":"The cache was intentionally cleared."},"panels/application/components/BackForwardCacheStrings.ts | cacheLimit":{"message":"The page was evicted from the cache to allow another page to be cached."},"panels/application/components/BackForwardCacheStrings.ts | containsPlugins":{"message":"Pages containing plugins are not currently eligible for back/forward cache."},"panels/application/components/BackForwardCacheStrings.ts | contentDiscarded":{"message":"Undefined"},"panels/application/components/BackForwardCacheStrings.ts | contentFileChooser":{"message":"Pages that use FileChooser API are not eligible for back/forward cache."},"panels/application/components/BackForwardCacheStrings.ts | contentFileSystemAccess":{"message":"Pages that use File System Access API are not eligible for back/forward cache."},"panels/application/components/BackForwardCacheStrings.ts | contentMediaDevicesDispatcherHost":{"message":"Pages that use Media Device Dispatcher are not eligible for back/forward cache."},"panels/application/components/BackForwardCacheStrings.ts | contentMediaPlay":{"message":"A media player was playing upon navigating away."},"panels/application/components/BackForwardCacheStrings.ts | contentMediaSession":{"message":"Pages that use MediaSession API and set a playback state are not eligible for back/forward cache."},"panels/application/components/BackForwardCacheStrings.ts | contentMediaSessionService":{"message":"Pages that use MediaSession API and set action handlers are not eligible for back/forward cache."},"panels/application/components/BackForwardCacheStrings.ts | contentScreenReader":{"message":"Back/forward cache is disabled due to screen reader."},"panels/application/components/BackForwardCacheStrings.ts | contentSecurityHandler":{"message":"Pages that use SecurityHandler are not eligible for back/forward cache."},"panels/application/components/BackForwardCacheStrings.ts | contentSerial":{"message":"Pages that use Serial API are not eligible for back/forward cache."},"panels/application/components/BackForwardCacheStrings.ts | contentWebAuthenticationAPI":{"message":"Pages that use WebAuthetication API are not eligible for back/forward cache."},"panels/application/components/BackForwardCacheStrings.ts | contentWebBluetooth":{"message":"Pages that use WebBluetooth API are not eligible for back/forward cache."},"panels/application/components/BackForwardCacheStrings.ts | contentWebUSB":{"message":"Pages that use WebUSB API are not eligible for back/forward cache."},"panels/application/components/BackForwardCacheStrings.ts | cookieDisabled":{"message":"Back/forward cache is disabled because cookies are disabled on a page that uses Cache-Control: no-store."},"panels/application/components/BackForwardCacheStrings.ts | dedicatedWorkerOrWorklet":{"message":"Pages that use a dedicated worker or worklet are not currently eligible for back/forward cache."},"panels/application/components/BackForwardCacheStrings.ts | documentLoaded":{"message":"The document did not finish loading before navigating away."},"panels/application/components/BackForwardCacheStrings.ts | embedderAppBannerManager":{"message":"App Banner was present upon navigating away."},"panels/application/components/BackForwardCacheStrings.ts | embedderChromePasswordManagerClientBindCredentialManager":{"message":"Chrome Password Manager was present upon navigating away."},"panels/application/components/BackForwardCacheStrings.ts | embedderDomDistillerSelfDeletingRequestDelegate":{"message":"DOM distillation was in progress upon navigating away."},"panels/application/components/BackForwardCacheStrings.ts | embedderDomDistillerViewerSource":{"message":"DOM Distiller Viewer was present upon navigating away."},"panels/application/components/BackForwardCacheStrings.ts | embedderExtensionMessaging":{"message":"Back/forward cache is disabled due to extensions using messaging API."},"panels/application/components/BackForwardCacheStrings.ts | embedderExtensionMessagingForOpenPort":{"message":"Extensions with long-lived connection should close the connection before entering back/forward cache."},"panels/application/components/BackForwardCacheStrings.ts | embedderExtensions":{"message":"Back/forward cache is disabled due to extensions."},"panels/application/components/BackForwardCacheStrings.ts | embedderExtensionSentMessageToCachedFrame":{"message":"Extensions with long-lived connection attempted to send messages to frames in back/forward cache."},"panels/application/components/BackForwardCacheStrings.ts | embedderModalDialog":{"message":"Modal dialog such as form resubmission or http password dialog was shown for the page upon navigating away."},"panels/application/components/BackForwardCacheStrings.ts | embedderOfflinePage":{"message":"The offline page was shown upon navigating away."},"panels/application/components/BackForwardCacheStrings.ts | embedderOomInterventionTabHelper":{"message":"Out-Of-Memory Intervention bar was present upon navigating away."},"panels/application/components/BackForwardCacheStrings.ts | embedderPermissionRequestManager":{"message":"There were permission requests upon navigating away."},"panels/application/components/BackForwardCacheStrings.ts | embedderPopupBlockerTabHelper":{"message":"Popup blocker was present upon navigating away."},"panels/application/components/BackForwardCacheStrings.ts | embedderSafeBrowsingThreatDetails":{"message":"Safe Browsing details were shown upon navigating away."},"panels/application/components/BackForwardCacheStrings.ts | embedderSafeBrowsingTriggeredPopupBlocker":{"message":"Safe Browsing considered this page to be abusive and blocked popup."},"panels/application/components/BackForwardCacheStrings.ts | enteredBackForwardCacheBeforeServiceWorkerHostAdded":{"message":"A service worker was activated while the page was in back/forward cache."},"panels/application/components/BackForwardCacheStrings.ts | errorDocument":{"message":"Back/forward cache is disabled due to a document error."},"panels/application/components/BackForwardCacheStrings.ts | fencedFramesEmbedder":{"message":"Pages using FencedFrames cannot be stored in bfcache."},"panels/application/components/BackForwardCacheStrings.ts | foregroundCacheLimit":{"message":"The page was evicted from the cache to allow another page to be cached."},"panels/application/components/BackForwardCacheStrings.ts | grantedMediaStreamAccess":{"message":"Pages that have granted media stream access are not currently eligible for back/forward cache."},"panels/application/components/BackForwardCacheStrings.ts | haveInnerContents":{"message":"Pages that have certain kinds of embedded content (e.g. PDFs) are not currently eligible for back/forward cache."},"panels/application/components/BackForwardCacheStrings.ts | HTTPMethodNotGET":{"message":"Only pages loaded via a GET request are eligible for back/forward cache."},"panels/application/components/BackForwardCacheStrings.ts | HTTPStatusNotOK":{"message":"Only pages with a status code of 2XX can be cached."},"panels/application/components/BackForwardCacheStrings.ts | idleManager":{"message":"Pages that use IdleManager are not currently eligible for back/forward cache."},"panels/application/components/BackForwardCacheStrings.ts | indexedDBConnection":{"message":"Pages that have an open IndexedDB connection are not currently eligible for back/forward cache."},"panels/application/components/BackForwardCacheStrings.ts | indexedDBEvent":{"message":"Back/forward cache is disabled due to an IndexedDB event."},"panels/application/components/BackForwardCacheStrings.ts | ineligibleAPI":{"message":"Ineligible APIs were used."},"panels/application/components/BackForwardCacheStrings.ts | injectedJavascript":{"message":"Pages that JavaScript is injected into by extensions are not currently eligible for back/forward cache."},"panels/application/components/BackForwardCacheStrings.ts | injectedStyleSheet":{"message":"Pages that a StyleSheet is injected into by extensions are not currently eligible for back/forward cache."},"panels/application/components/BackForwardCacheStrings.ts | internalError":{"message":"Internal error."},"panels/application/components/BackForwardCacheStrings.ts | JavaScriptExecution":{"message":"Chrome detected an attempt to execute JavaScript while in the cache."},"panels/application/components/BackForwardCacheStrings.ts | jsNetworkRequestReceivedCacheControlNoStoreResource":{"message":"Back/forward cache is disabled because some JavaScript network request received resource with Cache-Control: no-store header."},"panels/application/components/BackForwardCacheStrings.ts | keepaliveRequest":{"message":"Back/forward cache is disabled due to a keepalive request."},"panels/application/components/BackForwardCacheStrings.ts | keyboardLock":{"message":"Pages that use Keyboard lock are not currently eligible for back/forward cache."},"panels/application/components/BackForwardCacheStrings.ts | loading":{"message":"The page did not finish loading before navigating away."},"panels/application/components/BackForwardCacheStrings.ts | mainResourceHasCacheControlNoCache":{"message":"Pages whose main resource has cache-control:no-cache cannot enter back/forward cache."},"panels/application/components/BackForwardCacheStrings.ts | mainResourceHasCacheControlNoStore":{"message":"Pages whose main resource has cache-control:no-store cannot enter back/forward cache."},"panels/application/components/BackForwardCacheStrings.ts | navigationCancelledWhileRestoring":{"message":"Navigation was cancelled before the page could be restored from back/forward cache."},"panels/application/components/BackForwardCacheStrings.ts | networkExceedsBufferLimit":{"message":"The page was evicted from the cache because an active network connection received too much data. Chrome limits the amount of data that a page may receive while cached."},"panels/application/components/BackForwardCacheStrings.ts | networkRequestDatapipeDrainedAsBytesConsumer":{"message":"Pages that have inflight fetch() or XHR are not currently eligible for back/forward cache."},"panels/application/components/BackForwardCacheStrings.ts | networkRequestRedirected":{"message":"The page was evicted from back/forward cache because an active network request involved a redirect."},"panels/application/components/BackForwardCacheStrings.ts | networkRequestTimeout":{"message":"The page was evicted from the cache because a network connection was open too long. Chrome limits the amount of time that a page may receive data while cached."},"panels/application/components/BackForwardCacheStrings.ts | noResponseHead":{"message":"Pages that do not have a valid response head cannot enter back/forward cache."},"panels/application/components/BackForwardCacheStrings.ts | notMainFrame":{"message":"Navigation happened in a frame other than the main frame."},"panels/application/components/BackForwardCacheStrings.ts | outstandingIndexedDBTransaction":{"message":"Page with ongoing indexed DB transactions are not currently eligible for back/forward cache."},"panels/application/components/BackForwardCacheStrings.ts | outstandingNetworkRequestDirectSocket":{"message":"Pages with an in-flight network request are not currently eligible for back/forward cache."},"panels/application/components/BackForwardCacheStrings.ts | outstandingNetworkRequestFetch":{"message":"Pages with an in-flight fetch network request are not currently eligible for back/forward cache."},"panels/application/components/BackForwardCacheStrings.ts | outstandingNetworkRequestOthers":{"message":"Pages with an in-flight network request are not currently eligible for back/forward cache."},"panels/application/components/BackForwardCacheStrings.ts | outstandingNetworkRequestXHR":{"message":"Pages with an in-flight XHR network request are not currently eligible for back/forward cache."},"panels/application/components/BackForwardCacheStrings.ts | paymentManager":{"message":"Pages that use PaymentManager are not currently eligible for back/forward cache."},"panels/application/components/BackForwardCacheStrings.ts | pictureInPicture":{"message":"Pages that use Picture-in-Picture are not currently eligible for back/forward cache."},"panels/application/components/BackForwardCacheStrings.ts | printing":{"message":"Pages that show Printing UI are not currently eligible for back/forward cache."},"panels/application/components/BackForwardCacheStrings.ts | relatedActiveContentsExist":{"message":"The page was opened using 'window.open()' and another tab has a reference to it, or the page opened a window."},"panels/application/components/BackForwardCacheStrings.ts | rendererProcessCrashed":{"message":"The renderer process for the page in back/forward cache crashed."},"panels/application/components/BackForwardCacheStrings.ts | rendererProcessKilled":{"message":"The renderer process for the page in back/forward cache was killed."},"panels/application/components/BackForwardCacheStrings.ts | requestedAudioCapturePermission":{"message":"Pages that have requested audio capture permissions are not currently eligible for back/forward cache."},"panels/application/components/BackForwardCacheStrings.ts | requestedBackForwardCacheBlockedSensors":{"message":"Pages that have requested sensor permissions are not currently eligible for back/forward cache."},"panels/application/components/BackForwardCacheStrings.ts | requestedBackgroundWorkPermission":{"message":"Pages that have requested background sync or fetch permissions are not currently eligible for back/forward cache."},"panels/application/components/BackForwardCacheStrings.ts | requestedMIDIPermission":{"message":"Pages that have requested MIDI permissions are not currently eligible for back/forward cache."},"panels/application/components/BackForwardCacheStrings.ts | requestedNotificationsPermission":{"message":"Pages that have requested notifications permissions are not currently eligible for back/forward cache."},"panels/application/components/BackForwardCacheStrings.ts | requestedStorageAccessGrant":{"message":"Pages that have requested storage access are not currently eligible for back/forward cache."},"panels/application/components/BackForwardCacheStrings.ts | requestedVideoCapturePermission":{"message":"Pages that have requested video capture permissions are not currently eligible for back/forward cache."},"panels/application/components/BackForwardCacheStrings.ts | schemeNotHTTPOrHTTPS":{"message":"Only pages whose URL scheme is HTTP / HTTPS can be cached."},"panels/application/components/BackForwardCacheStrings.ts | serviceWorkerClaim":{"message":"The page was claimed by a service worker while it is in back/forward cache."},"panels/application/components/BackForwardCacheStrings.ts | serviceWorkerPostMessage":{"message":"A service worker attempted to send the page in back/forward cache a MessageEvent."},"panels/application/components/BackForwardCacheStrings.ts | serviceWorkerUnregistration":{"message":"ServiceWorker was unregistered while a page was in back/forward cache."},"panels/application/components/BackForwardCacheStrings.ts | serviceWorkerVersionActivation":{"message":"The page was evicted from back/forward cache due to a service worker activation."},"panels/application/components/BackForwardCacheStrings.ts | sessionRestored":{"message":"Chrome restarted and cleared the back/forward cache entries."},"panels/application/components/BackForwardCacheStrings.ts | sharedWorker":{"message":"Pages that use SharedWorker are not currently eligible for back/forward cache."},"panels/application/components/BackForwardCacheStrings.ts | speechRecognizer":{"message":"Pages that use SpeechRecognizer are not currently eligible for back/forward cache."},"panels/application/components/BackForwardCacheStrings.ts | speechSynthesis":{"message":"Pages that use SpeechSynthesis are not currently eligible for back/forward cache."},"panels/application/components/BackForwardCacheStrings.ts | subframeIsNavigating":{"message":"An iframe on the page started a navigation that did not complete."},"panels/application/components/BackForwardCacheStrings.ts | subresourceHasCacheControlNoCache":{"message":"Pages whose subresource has cache-control:no-cache cannot enter back/forward cache."},"panels/application/components/BackForwardCacheStrings.ts | subresourceHasCacheControlNoStore":{"message":"Pages whose subresource has cache-control:no-store cannot enter back/forward cache."},"panels/application/components/BackForwardCacheStrings.ts | timeout":{"message":"The page exceeded the maximum time in back/forward cache and was expired."},"panels/application/components/BackForwardCacheStrings.ts | timeoutPuttingInCache":{"message":"The page timed out entering back/forward cache (likely due to long-running pagehide handlers)."},"panels/application/components/BackForwardCacheStrings.ts | unloadHandlerExistsInMainFrame":{"message":"The page has an unload handler in the main frame."},"panels/application/components/BackForwardCacheStrings.ts | unloadHandlerExistsInSubFrame":{"message":"The page has an unload handler in a sub frame."},"panels/application/components/BackForwardCacheStrings.ts | userAgentOverrideDiffers":{"message":"Browser has changed the user agent override header."},"panels/application/components/BackForwardCacheStrings.ts | wasGrantedMediaAccess":{"message":"Pages that have granted access to record video or audio are not currently eligible for back/forward cache."},"panels/application/components/BackForwardCacheStrings.ts | webDatabase":{"message":"Pages that use WebDatabase are not currently eligible for back/forward cache."},"panels/application/components/BackForwardCacheStrings.ts | webHID":{"message":"Pages that use WebHID are not currently eligible for back/forward cache."},"panels/application/components/BackForwardCacheStrings.ts | webLocks":{"message":"Pages that use WebLocks are not currently eligible for back/forward cache."},"panels/application/components/BackForwardCacheStrings.ts | webNfc":{"message":"Pages that use WebNfc are not currently eligible for back/forwad cache."},"panels/application/components/BackForwardCacheStrings.ts | webOTPService":{"message":"Pages that use WebOTPService are not currently eligible for bfcache."},"panels/application/components/BackForwardCacheStrings.ts | webRTC":{"message":"Pages with WebRTC cannot enter back/forward cache."},"panels/application/components/BackForwardCacheStrings.ts | webRTCSticky":{"message":"Back/forward cache is disabled because WebRTC has been used."},"panels/application/components/BackForwardCacheStrings.ts | webShare":{"message":"Pages that use WebShare are not currently eligible for back/forwad cache."},"panels/application/components/BackForwardCacheStrings.ts | webSocket":{"message":"Pages with WebSocket cannot enter back/forward cache."},"panels/application/components/BackForwardCacheStrings.ts | webSocketSticky":{"message":"Back/forward cache is disabled because WebSocket has been used."},"panels/application/components/BackForwardCacheStrings.ts | webTransport":{"message":"Pages with WebTransport cannot enter back/forward cache."},"panels/application/components/BackForwardCacheStrings.ts | webTransportSticky":{"message":"Back/forward cache is disabled because WebTransport has been used."},"panels/application/components/BackForwardCacheStrings.ts | webXR":{"message":"Pages that use WebXR are not currently eligible for back/forward cache."},"panels/application/components/BackForwardCacheView.ts | backForwardCacheTitle":{"message":"Back/forward cache"},"panels/application/components/BackForwardCacheView.ts | blankURLTitle":{"message":"Blank URL [{PH1}]"},"panels/application/components/BackForwardCacheView.ts | blockingExtensionId":{"message":"Extension id: "},"panels/application/components/BackForwardCacheView.ts | circumstantial":{"message":"Not Actionable"},"panels/application/components/BackForwardCacheView.ts | circumstantialExplanation":{"message":"These reasons are not actionable i.e. caching was prevented by something outside of the direct control of the page."},"panels/application/components/BackForwardCacheView.ts | filesPerIssue":{"message":"{n, plural, =1 {# file} other {# files}}"},"panels/application/components/BackForwardCacheView.ts | framesPerIssue":{"message":"{n, plural, =1 {# frame} other {# frames}}"},"panels/application/components/BackForwardCacheView.ts | framesTitle":{"message":"Frames"},"panels/application/components/BackForwardCacheView.ts | issuesInMultipleFrames":{"message":"{n, plural, =1 {# issue found in {m} frames.} other {# issues found in {m} frames.}}"},"panels/application/components/BackForwardCacheView.ts | issuesInSingleFrame":{"message":"{n, plural, =1 {# issue found in 1 frame.} other {# issues found in 1 frame.}}"},"panels/application/components/BackForwardCacheView.ts | learnMore":{"message":"Learn more: back/forward cache eligibility"},"panels/application/components/BackForwardCacheView.ts | mainFrame":{"message":"Main Frame"},"panels/application/components/BackForwardCacheView.ts | neverUseUnload":{"message":"Learn more: Never use unload handler"},"panels/application/components/BackForwardCacheView.ts | normalNavigation":{"message":"Not served from back/forward cache: to trigger back/forward cache, use Chrome's back/forward buttons, or use the test button below to automatically navigate away and back."},"panels/application/components/BackForwardCacheView.ts | pageSupportNeeded":{"message":"Actionable"},"panels/application/components/BackForwardCacheView.ts | pageSupportNeededExplanation":{"message":"These reasons are actionable i.e. they can be cleaned up to make the page eligible for back/forward cache."},"panels/application/components/BackForwardCacheView.ts | restoredFromBFCache":{"message":"Successfully served from back/forward cache."},"panels/application/components/BackForwardCacheView.ts | runningTest":{"message":"Running test"},"panels/application/components/BackForwardCacheView.ts | runTest":{"message":"Test back/forward cache"},"panels/application/components/BackForwardCacheView.ts | supportPending":{"message":"Pending Support"},"panels/application/components/BackForwardCacheView.ts | supportPendingExplanation":{"message":"Chrome support for these reasons is pending i.e. they will not prevent the page from being eligible for back/forward cache in a future version of Chrome."},"panels/application/components/BackForwardCacheView.ts | unavailable":{"message":"unavailable"},"panels/application/components/BackForwardCacheView.ts | unknown":{"message":"Unknown Status"},"panels/application/components/BackForwardCacheView.ts | url":{"message":"URL:"},"panels/application/components/BounceTrackingMitigationsView.ts | bounceTrackingMitigationsTitle":{"message":"Bounce tracking mitigations"},"panels/application/components/BounceTrackingMitigationsView.ts | checkingPotentialTrackers":{"message":"Checking for potential bounce tracking sites."},"panels/application/components/BounceTrackingMitigationsView.ts | featureDisabled":{"message":"Bounce tracking mitigations are disabled. To enable them, set the flag at {PH1} to \"Enabled With Deletion\"."},"panels/application/components/BounceTrackingMitigationsView.ts | featureFlag":{"message":"Bounce Tracking Mitigations Feature Flag"},"panels/application/components/BounceTrackingMitigationsView.ts | forceRun":{"message":"Force run"},"panels/application/components/BounceTrackingMitigationsView.ts | learnMore":{"message":"Learn more: Bounce Tracking Mitigations"},"panels/application/components/BounceTrackingMitigationsView.ts | noPotentialBounceTrackersIdentified":{"message":"State was not cleared for any potential bounce tracking sites. Either none were identified or third-party cookies are not blocked."},"panels/application/components/BounceTrackingMitigationsView.ts | runningMitigations":{"message":"Running"},"panels/application/components/BounceTrackingMitigationsView.ts | stateDeletedFor":{"message":"State was deleted for the following sites:"},"panels/application/components/EndpointsGrid.ts | noEndpointsToDisplay":{"message":"No endpoints to display"},"panels/application/components/FrameDetailsView.ts | additionalInformation":{"message":"Additional Information"},"panels/application/components/FrameDetailsView.ts | adStatus":{"message":"Ad Status"},"panels/application/components/FrameDetailsView.ts | aFrameAncestorIsAnInsecure":{"message":"A frame ancestor is an insecure context"},"panels/application/components/FrameDetailsView.ts | apiAvailability":{"message":"API availability"},"panels/application/components/FrameDetailsView.ts | availabilityOfCertainApisDepends":{"message":"Availability of certain APIs depends on the document being cross-origin isolated."},"panels/application/components/FrameDetailsView.ts | available":{"message":"available"},"panels/application/components/FrameDetailsView.ts | availableNotTransferable":{"message":"available, not transferable"},"panels/application/components/FrameDetailsView.ts | availableTransferable":{"message":"available, transferable"},"panels/application/components/FrameDetailsView.ts | child":{"message":"child"},"panels/application/components/FrameDetailsView.ts | childDescription":{"message":"This frame has been identified as a child frame of an ad"},"panels/application/components/FrameDetailsView.ts | clickToOpenInElementsPanel":{"message":"Click to open in Elements panel"},"panels/application/components/FrameDetailsView.ts | clickToOpenInNetworkPanel":{"message":"Click to open in Network panel"},"panels/application/components/FrameDetailsView.ts | clickToOpenInNetworkPanelMight":{"message":"Click to open in Network panel (might require page reload)"},"panels/application/components/FrameDetailsView.ts | clickToOpenInSourcesPanel":{"message":"Click to open in Sources panel"},"panels/application/components/FrameDetailsView.ts | contentSecurityPolicy":{"message":"Content Security Policy (CSP)"},"panels/application/components/FrameDetailsView.ts | createdByAdScriptExplanation":{"message":"There was an ad script in the (async) stack when this frame was created. Examining the creation stack trace of this frame might provide more insight."},"panels/application/components/FrameDetailsView.ts | creationStackTrace":{"message":"Frame Creation Stack Trace"},"panels/application/components/FrameDetailsView.ts | creationStackTraceExplanation":{"message":"This frame was created programmatically. The stack trace shows where this happened."},"panels/application/components/FrameDetailsView.ts | creatorAdScript":{"message":"Creator Ad Script"},"panels/application/components/FrameDetailsView.ts | crossoriginIsolated":{"message":"Cross-Origin Isolated"},"panels/application/components/FrameDetailsView.ts | document":{"message":"Document"},"panels/application/components/FrameDetailsView.ts | frameId":{"message":"Frame ID"},"panels/application/components/FrameDetailsView.ts | learnMore":{"message":"Learn more"},"panels/application/components/FrameDetailsView.ts | localhostIsAlwaysASecureContext":{"message":"Localhost is always a secure context"},"panels/application/components/FrameDetailsView.ts | matchedBlockingRuleExplanation":{"message":"This frame is considered an ad frame because its current (or previous) main document is an ad resource."},"panels/application/components/FrameDetailsView.ts | measureMemory":{"message":"Measure Memory"},"panels/application/components/FrameDetailsView.ts | no":{"message":"No"},"panels/application/components/FrameDetailsView.ts | none":{"message":"None"},"panels/application/components/FrameDetailsView.ts | origin":{"message":"Origin"},"panels/application/components/FrameDetailsView.ts | originTrialsExplanation":{"message":"Origin trials give you access to a new or experimental feature."},"panels/application/components/FrameDetailsView.ts | ownerElement":{"message":"Owner Element"},"panels/application/components/FrameDetailsView.ts | parentIsAdExplanation":{"message":"This frame is considered an ad frame because its parent frame is an ad frame."},"panels/application/components/FrameDetailsView.ts | reportingTo":{"message":"reporting to"},"panels/application/components/FrameDetailsView.ts | requiresCrossoriginIsolated":{"message":"requires cross-origin isolated context"},"panels/application/components/FrameDetailsView.ts | root":{"message":"root"},"panels/application/components/FrameDetailsView.ts | rootDescription":{"message":"This frame has been identified as the root frame of an ad"},"panels/application/components/FrameDetailsView.ts | secureContext":{"message":"Secure Context"},"panels/application/components/FrameDetailsView.ts | securityIsolation":{"message":"Security & Isolation"},"panels/application/components/FrameDetailsView.ts | sharedarraybufferConstructorIs":{"message":"SharedArrayBuffer constructor is available and SABs can be transferred via postMessage"},"panels/application/components/FrameDetailsView.ts | sharedarraybufferConstructorIsAvailable":{"message":"SharedArrayBuffer constructor is available but SABs cannot be transferred via postMessage"},"panels/application/components/FrameDetailsView.ts | theFramesSchemeIsInsecure":{"message":"The frame's scheme is insecure"},"panels/application/components/FrameDetailsView.ts | thePerformanceAPI":{"message":"The performance.measureUserAgentSpecificMemory() API is available"},"panels/application/components/FrameDetailsView.ts | thePerformancemeasureuseragentspecificmemory":{"message":"The performance.measureUserAgentSpecificMemory() API is not available"},"panels/application/components/FrameDetailsView.ts | thisAdditionalDebugging":{"message":"This additional (debugging) information is shown because the 'Protocol Monitor' experiment is enabled."},"panels/application/components/FrameDetailsView.ts | transferRequiresCrossoriginIsolatedPermission":{"message":"SharedArrayBuffer transfer requires enabling the permission policy:"},"panels/application/components/FrameDetailsView.ts | unavailable":{"message":"unavailable"},"panels/application/components/FrameDetailsView.ts | unreachableUrl":{"message":"Unreachable URL"},"panels/application/components/FrameDetailsView.ts | url":{"message":"URL"},"panels/application/components/FrameDetailsView.ts | willRequireCrossoriginIsolated":{"message":"⚠️ will require cross-origin isolated context in the future"},"panels/application/components/FrameDetailsView.ts | yes":{"message":"Yes"},"panels/application/components/InterestGroupAccessGrid.ts | allInterestGroupStorageEvents":{"message":"All interest group storage events."},"panels/application/components/InterestGroupAccessGrid.ts | eventTime":{"message":"Event Time"},"panels/application/components/InterestGroupAccessGrid.ts | eventType":{"message":"Access Type"},"panels/application/components/InterestGroupAccessGrid.ts | groupName":{"message":"Name"},"panels/application/components/InterestGroupAccessGrid.ts | groupOwner":{"message":"Owner"},"panels/application/components/InterestGroupAccessGrid.ts | noEvents":{"message":"No interest group events recorded."},"panels/application/components/OriginTrialTreeView.ts | expiryTime":{"message":"Expiry Time"},"panels/application/components/OriginTrialTreeView.ts | isThirdParty":{"message":"Third Party"},"panels/application/components/OriginTrialTreeView.ts | matchSubDomains":{"message":"Subdomain Matching"},"panels/application/components/OriginTrialTreeView.ts | noTrialTokens":{"message":"No trial tokens"},"panels/application/components/OriginTrialTreeView.ts | origin":{"message":"Origin"},"panels/application/components/OriginTrialTreeView.ts | rawTokenText":{"message":"Raw Token"},"panels/application/components/OriginTrialTreeView.ts | status":{"message":"Token Status"},"panels/application/components/OriginTrialTreeView.ts | token":{"message":"Token"},"panels/application/components/OriginTrialTreeView.ts | tokens":{"message":"{PH1} tokens"},"panels/application/components/OriginTrialTreeView.ts | trialName":{"message":"Trial Name"},"panels/application/components/OriginTrialTreeView.ts | usageRestriction":{"message":"Usage Restriction"},"panels/application/components/PermissionsPolicySection.ts | allowedFeatures":{"message":"Allowed Features"},"panels/application/components/PermissionsPolicySection.ts | clickToShowHeader":{"message":"Click to reveal the request whose \"Permissions-Policy\" HTTP header disables this feature."},"panels/application/components/PermissionsPolicySection.ts | clickToShowIframe":{"message":"Click to reveal the top-most iframe which does not allow this feature in the elements panel."},"panels/application/components/PermissionsPolicySection.ts | disabledByFencedFrame":{"message":"disabled inside a fencedframe"},"panels/application/components/PermissionsPolicySection.ts | disabledByHeader":{"message":"disabled by \"Permissions-Policy\" header"},"panels/application/components/PermissionsPolicySection.ts | disabledByIframe":{"message":"missing in iframe \"allow\" attribute"},"panels/application/components/PermissionsPolicySection.ts | disabledFeatures":{"message":"Disabled Features"},"panels/application/components/PermissionsPolicySection.ts | hideDetails":{"message":"Hide details"},"panels/application/components/PermissionsPolicySection.ts | showDetails":{"message":"Show details"},"panels/application/components/ProtocolHandlersView.ts | dropdownLabel":{"message":"Select protocol handler"},"panels/application/components/ProtocolHandlersView.ts | manifest":{"message":"manifest"},"panels/application/components/ProtocolHandlersView.ts | needHelpReadOur":{"message":"Need help? Read {PH1}."},"panels/application/components/ProtocolHandlersView.ts | protocolDetected":{"message":"Found valid protocol handler registration in the {PH1}. With the app installed, test the registered protocols."},"panels/application/components/ProtocolHandlersView.ts | protocolHandlerRegistrations":{"message":"URL protocol handler registration for PWAs"},"panels/application/components/ProtocolHandlersView.ts | protocolNotDetected":{"message":"Define protocol handlers in the {PH1} to register your app as a handler for custom protocols when your app is installed."},"panels/application/components/ProtocolHandlersView.ts | testProtocol":{"message":"Test protocol"},"panels/application/components/ProtocolHandlersView.ts | textboxLabel":{"message":"Query parameter or endpoint for protocol handler"},"panels/application/components/ProtocolHandlersView.ts | textboxPlaceholder":{"message":"Enter URL"},"panels/application/components/ReportsGrid.ts | destination":{"message":"Destination"},"panels/application/components/ReportsGrid.ts | generatedAt":{"message":"Generated at"},"panels/application/components/ReportsGrid.ts | noReportsToDisplay":{"message":"No reports to display"},"panels/application/components/ReportsGrid.ts | status":{"message":"Status"},"panels/application/components/SharedStorageAccessGrid.ts | allSharedStorageEvents":{"message":"All shared storage events for this page."},"panels/application/components/SharedStorageAccessGrid.ts | eventParams":{"message":"Optional Event Params"},"panels/application/components/SharedStorageAccessGrid.ts | eventTime":{"message":"Event Time"},"panels/application/components/SharedStorageAccessGrid.ts | eventType":{"message":"Access Type"},"panels/application/components/SharedStorageAccessGrid.ts | mainFrameId":{"message":"Main Frame ID"},"panels/application/components/SharedStorageAccessGrid.ts | noEvents":{"message":"No shared storage events recorded."},"panels/application/components/SharedStorageAccessGrid.ts | ownerOrigin":{"message":"Owner Origin"},"panels/application/components/SharedStorageAccessGrid.ts | sharedStorage":{"message":"Shared storage"},"panels/application/components/SharedStorageMetadataView.ts | budgetExplanation":{"message":"Remaining data leakage allowed within a 24-hour period for this origin in bits of entropy"},"panels/application/components/SharedStorageMetadataView.ts | creation":{"message":"Creation Time"},"panels/application/components/SharedStorageMetadataView.ts | entropyBudget":{"message":"Entropy Budget for Fenced Frames"},"panels/application/components/SharedStorageMetadataView.ts | notYetCreated":{"message":"Not yet created"},"panels/application/components/SharedStorageMetadataView.ts | numBytesUsed":{"message":"Number of Bytes Used"},"panels/application/components/SharedStorageMetadataView.ts | numEntries":{"message":"Number of Entries"},"panels/application/components/SharedStorageMetadataView.ts | resetBudget":{"message":"Reset Budget"},"panels/application/components/SharedStorageMetadataView.ts | sharedStorage":{"message":"Shared storage"},"panels/application/components/StackTrace.ts | cannotRenderStackTrace":{"message":"Cannot render stack trace"},"panels/application/components/StackTrace.ts | creationStackTrace":{"message":"Frame Creation Stack Trace"},"panels/application/components/StackTrace.ts | showLess":{"message":"Show less"},"panels/application/components/StackTrace.ts | showSMoreFrames":{"message":"{n, plural, =1 {Show # more frame} other {Show # more frames}}"},"panels/application/components/StorageMetadataView.ts | bucketName":{"message":"Bucket name"},"panels/application/components/StorageMetadataView.ts | confirmBucketDeletion":{"message":"Delete the \"{PH1}\" bucket?"},"panels/application/components/StorageMetadataView.ts | defaultBucket":{"message":"Default bucket"},"panels/application/components/StorageMetadataView.ts | deleteBucket":{"message":"Delete bucket"},"panels/application/components/StorageMetadataView.ts | durability":{"message":"Durability"},"panels/application/components/StorageMetadataView.ts | expiration":{"message":"Expiration"},"panels/application/components/StorageMetadataView.ts | isOpaque":{"message":"Is opaque"},"panels/application/components/StorageMetadataView.ts | isThirdParty":{"message":"Is third-party"},"panels/application/components/StorageMetadataView.ts | loading":{"message":"Loading…"},"panels/application/components/StorageMetadataView.ts | no":{"message":"No"},"panels/application/components/StorageMetadataView.ts | none":{"message":"None"},"panels/application/components/StorageMetadataView.ts | opaque":{"message":"(opaque)"},"panels/application/components/StorageMetadataView.ts | origin":{"message":"Origin"},"panels/application/components/StorageMetadataView.ts | persistent":{"message":"Is persistent"},"panels/application/components/StorageMetadataView.ts | quota":{"message":"Quota"},"panels/application/components/StorageMetadataView.ts | topLevelSite":{"message":"Top-level site"},"panels/application/components/StorageMetadataView.ts | yes":{"message":"Yes"},"panels/application/components/StorageMetadataView.ts | yesBecauseAncestorChainHasCrossSite":{"message":"Yes, because the ancestry chain contains a third-party origin"},"panels/application/components/StorageMetadataView.ts | yesBecauseKeyIsOpaque":{"message":"Yes, because the storage key is opaque"},"panels/application/components/StorageMetadataView.ts | yesBecauseOriginNotInTopLevelSite":{"message":"Yes, because the origin is outside of the top-level site"},"panels/application/components/StorageMetadataView.ts | yesBecauseTopLevelIsOpaque":{"message":"Yes, because the top-level site is opaque"},"panels/application/components/TrustTokensView.ts | allStoredTrustTokensAvailableIn":{"message":"All stored private state tokens available in this browser instance."},"panels/application/components/TrustTokensView.ts | deleteTrustTokens":{"message":"Delete all stored private state tokens issued by {PH1}."},"panels/application/components/TrustTokensView.ts | issuer":{"message":"Issuer"},"panels/application/components/TrustTokensView.ts | noTrustTokensStored":{"message":"No private state tokens are currently stored."},"panels/application/components/TrustTokensView.ts | storedTokenCount":{"message":"Stored token count"},"panels/application/components/TrustTokensView.ts | trustTokens":{"message":"Private state tokens"},"panels/application/CookieItemsView.ts | clearAllCookies":{"message":"Clear all cookies"},"panels/application/CookieItemsView.ts | clearFilteredCookies":{"message":"Clear filtered cookies"},"panels/application/CookieItemsView.ts | cookies":{"message":"Cookies"},"panels/application/CookieItemsView.ts | numberOfCookiesShownInTableS":{"message":"Number of cookies shown in table: {PH1}"},"panels/application/CookieItemsView.ts | onlyShowCookiesWhichHaveAn":{"message":"Only show cookies that have an associated issue"},"panels/application/CookieItemsView.ts | onlyShowCookiesWithAnIssue":{"message":"Only show cookies with an issue"},"panels/application/CookieItemsView.ts | selectACookieToPreviewItsValue":{"message":"Select a cookie to preview its value"},"panels/application/CookieItemsView.ts | showUrlDecoded":{"message":"Show URL-decoded"},"panels/application/DOMStorageItemsView.ts | domStorage":{"message":"DOM Storage"},"panels/application/DOMStorageItemsView.ts | domStorageItemDeleted":{"message":"The storage item was deleted."},"panels/application/DOMStorageItemsView.ts | domStorageItems":{"message":"DOM Storage Items"},"panels/application/DOMStorageItemsView.ts | domStorageItemsCleared":{"message":"DOM Storage Items cleared"},"panels/application/DOMStorageItemsView.ts | key":{"message":"Key"},"panels/application/DOMStorageItemsView.ts | value":{"message":"Value"},"panels/application/ExtensionStorageItemsView.ts | extensionStorage":{"message":"Extension Storage"},"panels/application/ExtensionStorageItemsView.ts | extensionStorageItemDeleted":{"message":"The storage item was deleted."},"panels/application/ExtensionStorageItemsView.ts | extensionStorageItems":{"message":"Extension Storage Items"},"panels/application/ExtensionStorageItemsView.ts | extensionStorageItemsCleared":{"message":"Extension Storage Items cleared"},"panels/application/ExtensionStorageItemsView.ts | key":{"message":"Key"},"panels/application/ExtensionStorageItemsView.ts | value":{"message":"Value"},"panels/application/IndexedDBViews.ts | clearObjectStore":{"message":"Clear object store"},"panels/application/IndexedDBViews.ts | collapse":{"message":"Collapse"},"panels/application/IndexedDBViews.ts | dataMayBeStale":{"message":"Data may be stale"},"panels/application/IndexedDBViews.ts | deleteDatabase":{"message":"Delete database"},"panels/application/IndexedDBViews.ts | deleteSelected":{"message":"Delete selected"},"panels/application/IndexedDBViews.ts | expandRecursively":{"message":"Expand Recursively"},"panels/application/IndexedDBViews.ts | filterByKey":{"message":"Filter by key (show keys greater or equal to)"},"panels/application/IndexedDBViews.ts | idb":{"message":"IDB"},"panels/application/IndexedDBViews.ts | indexedDb":{"message":"Indexed DB"},"panels/application/IndexedDBViews.ts | keyGeneratorValueS":{"message":"Key generator value: {PH1}"},"panels/application/IndexedDBViews.ts | keyPath":{"message":"Key path: "},"panels/application/IndexedDBViews.ts | keyString":{"message":"Key"},"panels/application/IndexedDBViews.ts | objectStores":{"message":"Object stores"},"panels/application/IndexedDBViews.ts | pleaseConfirmDeleteOfSDatabase":{"message":"Please confirm delete of \"{PH1}\" database."},"panels/application/IndexedDBViews.ts | primaryKey":{"message":"Primary key"},"panels/application/IndexedDBViews.ts | refresh":{"message":"Refresh"},"panels/application/IndexedDBViews.ts | refreshDatabase":{"message":"Refresh database"},"panels/application/IndexedDBViews.ts | showNextPage":{"message":"Show next page"},"panels/application/IndexedDBViews.ts | showPreviousPage":{"message":"Show previous page"},"panels/application/IndexedDBViews.ts | someEntriesMayHaveBeenModified":{"message":"Some entries may have been modified"},"panels/application/IndexedDBViews.ts | totalEntriesS":{"message":"Total entries: {PH1}"},"panels/application/IndexedDBViews.ts | valueString":{"message":"Value"},"panels/application/IndexedDBViews.ts | version":{"message":"Version"},"panels/application/InterestGroupStorageView.ts | clickToDisplayBody":{"message":"Click on any interest group event to display the group's current state"},"panels/application/InterestGroupStorageView.ts | noDataAvailable":{"message":"No details available for the selected interest group. The browser may have left the group."},"panels/application/InterestGroupTreeElement.ts | interestGroups":{"message":"Interest groups"},"panels/application/OpenedWindowDetailsView.ts | accessToOpener":{"message":"Access to opener"},"panels/application/OpenedWindowDetailsView.ts | clickToOpenInElementsPanel":{"message":"Click to open in Elements panel"},"panels/application/OpenedWindowDetailsView.ts | closed":{"message":"closed"},"panels/application/OpenedWindowDetailsView.ts | crossoriginEmbedderPolicy":{"message":"Cross-Origin Embedder Policy"},"panels/application/OpenedWindowDetailsView.ts | document":{"message":"Document"},"panels/application/OpenedWindowDetailsView.ts | no":{"message":"No"},"panels/application/OpenedWindowDetailsView.ts | openerFrame":{"message":"Opener Frame"},"panels/application/OpenedWindowDetailsView.ts | reportingTo":{"message":"reporting to"},"panels/application/OpenedWindowDetailsView.ts | security":{"message":"Security"},"panels/application/OpenedWindowDetailsView.ts | securityIsolation":{"message":"Security & Isolation"},"panels/application/OpenedWindowDetailsView.ts | showsWhetherTheOpenedWindowIs":{"message":"Shows whether the opened window is able to access its opener and vice versa"},"panels/application/OpenedWindowDetailsView.ts | type":{"message":"Type"},"panels/application/OpenedWindowDetailsView.ts | unknown":{"message":"Unknown"},"panels/application/OpenedWindowDetailsView.ts | url":{"message":"URL"},"panels/application/OpenedWindowDetailsView.ts | webWorker":{"message":"Web Worker"},"panels/application/OpenedWindowDetailsView.ts | windowWithoutTitle":{"message":"Window without title"},"panels/application/OpenedWindowDetailsView.ts | worker":{"message":"worker"},"panels/application/OpenedWindowDetailsView.ts | yes":{"message":"Yes"},"panels/application/preloading/components/MismatchedPreloadingGrid.ts | action":{"message":"Action"},"panels/application/preloading/components/MismatchedPreloadingGrid.ts | status":{"message":"Status"},"panels/application/preloading/components/MismatchedPreloadingGrid.ts | statusFailure":{"message":"Failure"},"panels/application/preloading/components/MismatchedPreloadingGrid.ts | statusNotTriggered":{"message":"Not triggered"},"panels/application/preloading/components/MismatchedPreloadingGrid.ts | statusPending":{"message":"Pending"},"panels/application/preloading/components/MismatchedPreloadingGrid.ts | statusReady":{"message":"Ready"},"panels/application/preloading/components/MismatchedPreloadingGrid.ts | statusRunning":{"message":"Running"},"panels/application/preloading/components/MismatchedPreloadingGrid.ts | statusSuccess":{"message":"Success"},"panels/application/preloading/components/MismatchedPreloadingGrid.ts | url":{"message":"URL"},"panels/application/preloading/components/PreloadingDetailsReportView.ts | automaticallyFellBackToPrefetch":{"message":"(automatically fell back to prefetch)"},"panels/application/preloading/components/PreloadingDetailsReportView.ts | buttonClickToInspect":{"message":"Click to inspect prerendered page"},"panels/application/preloading/components/PreloadingDetailsReportView.ts | buttonClickToRevealRuleSet":{"message":"Click to reveal rule set"},"panels/application/preloading/components/PreloadingDetailsReportView.ts | buttonInspect":{"message":"Inspect"},"panels/application/preloading/components/PreloadingDetailsReportView.ts | detailedStatusFailure":{"message":"Speculative load failed."},"panels/application/preloading/components/PreloadingDetailsReportView.ts | detailedStatusFallbackToPrefetch":{"message":"Speculative load failed, but fallback to prefetch succeeded."},"panels/application/preloading/components/PreloadingDetailsReportView.ts | detailedStatusNotTriggered":{"message":"Speculative load attempt is not yet triggered."},"panels/application/preloading/components/PreloadingDetailsReportView.ts | detailedStatusPending":{"message":"Speculative load attempt is eligible but pending."},"panels/application/preloading/components/PreloadingDetailsReportView.ts | detailedStatusReady":{"message":"Speculative load finished and the result is ready for the next navigation."},"panels/application/preloading/components/PreloadingDetailsReportView.ts | detailedStatusRunning":{"message":"Speculative load is running."},"panels/application/preloading/components/PreloadingDetailsReportView.ts | detailedStatusSuccess":{"message":"Speculative load finished and used for a navigation."},"panels/application/preloading/components/PreloadingDetailsReportView.ts | detailsAction":{"message":"Action"},"panels/application/preloading/components/PreloadingDetailsReportView.ts | detailsDetailedInformation":{"message":"Detailed information"},"panels/application/preloading/components/PreloadingDetailsReportView.ts | detailsFailureReason":{"message":"Failure reason"},"panels/application/preloading/components/PreloadingDetailsReportView.ts | detailsRuleSet":{"message":"Rule set"},"panels/application/preloading/components/PreloadingDetailsReportView.ts | detailsStatus":{"message":"Status"},"panels/application/preloading/components/PreloadingDetailsReportView.ts | selectAnElementForMoreDetails":{"message":"Select an element for more details"},"panels/application/preloading/components/PreloadingDisabledInfobar.ts | descriptionDisabledByBatterySaver":{"message":"Speculative loading is disabled because of the operating system's Battery Saver mode."},"panels/application/preloading/components/PreloadingDisabledInfobar.ts | descriptionDisabledByDataSaver":{"message":"Speculative loading is disabled because of the operating system's Data Saver mode."},"panels/application/preloading/components/PreloadingDisabledInfobar.ts | descriptionDisabledByHoldbackPrefetchSpeculationRules":{"message":"Prefetch is forced-enabled because DevTools is open. When DevTools is closed, prefetch will be disabled because this browser session is part of a holdback group used for performance comparisons."},"panels/application/preloading/components/PreloadingDisabledInfobar.ts | descriptionDisabledByHoldbackPrerenderSpeculationRules":{"message":"Prerendering is forced-enabled because DevTools is open. When DevTools is closed, prerendering will be disabled because this browser session is part of a holdback group used for performance comparisons."},"panels/application/preloading/components/PreloadingDisabledInfobar.ts | descriptionDisabledByPreference":{"message":"Speculative loading is disabled because of user settings or an extension. Go to {PH1} to update your preference. Go to {PH2} to disable any extension that blocks speculative loading."},"panels/application/preloading/components/PreloadingDisabledInfobar.ts | extensionsSettings":{"message":"Extensions settings"},"panels/application/preloading/components/PreloadingDisabledInfobar.ts | footerLearnMore":{"message":"Learn more"},"panels/application/preloading/components/PreloadingDisabledInfobar.ts | headerDisabledByBatterySaver":{"message":"Battery Saver"},"panels/application/preloading/components/PreloadingDisabledInfobar.ts | headerDisabledByDataSaver":{"message":"Data Saver"},"panels/application/preloading/components/PreloadingDisabledInfobar.ts | headerDisabledByHoldbackPrefetchSpeculationRules":{"message":"Prefetch was disabled, but is force-enabled now"},"panels/application/preloading/components/PreloadingDisabledInfobar.ts | headerDisabledByHoldbackPrerenderSpeculationRules":{"message":"Prerendering was disabled, but is force-enabled now"},"panels/application/preloading/components/PreloadingDisabledInfobar.ts | headerDisabledByPreference":{"message":"User settings or extensions"},"panels/application/preloading/components/PreloadingDisabledInfobar.ts | infobarPreloadingIsDisabled":{"message":"Speculative loading is disabled"},"panels/application/preloading/components/PreloadingDisabledInfobar.ts | infobarPreloadingIsForceEnabled":{"message":"Speculative loading is force-enabled"},"panels/application/preloading/components/PreloadingDisabledInfobar.ts | preloadingPagesSettings":{"message":"Preload pages settings"},"panels/application/preloading/components/PreloadingDisabledInfobar.ts | titleReasonsPreventingPreloading":{"message":"Reasons preventing speculative loading"},"panels/application/preloading/components/PreloadingGrid.ts | action":{"message":"Action"},"panels/application/preloading/components/PreloadingGrid.ts | prefetchFallbackReady":{"message":"Prefetch fallback ready"},"panels/application/preloading/components/PreloadingGrid.ts | ruleSet":{"message":"Rule set"},"panels/application/preloading/components/PreloadingGrid.ts | status":{"message":"Status"},"panels/application/preloading/components/PreloadingMismatchedHeadersGrid.ts | activationNavigationValue":{"message":"Value in activation navigation"},"panels/application/preloading/components/PreloadingMismatchedHeadersGrid.ts | headerName":{"message":"Header name"},"panels/application/preloading/components/PreloadingMismatchedHeadersGrid.ts | initialNavigationValue":{"message":"Value in initial navigation"},"panels/application/preloading/components/PreloadingMismatchedHeadersGrid.ts | missing":{"message":"(missing)"},"panels/application/preloading/components/PreloadingString.ts | PrefetchEvictedAfterCandidateRemoved":{"message":"The prefetch was discarded because no speculation rule in the initating page triggers a prefetch for this URL anymore."},"panels/application/preloading/components/PreloadingString.ts | PrefetchEvictedForNewerPrefetch":{"message":"The prefetch was discarded because the initiating page has too many prefetches ongoing, and this was one of the oldest."},"panels/application/preloading/components/PreloadingString.ts | PrefetchFailedIneligibleRedirect":{"message":"The prefetch was redirected, but the redirect URL is not eligible for prefetch."},"panels/application/preloading/components/PreloadingString.ts | PrefetchFailedInvalidRedirect":{"message":"The prefetch was redirected, but there was a problem with the redirect."},"panels/application/preloading/components/PreloadingString.ts | PrefetchFailedMIMENotSupported":{"message":"The prefetch failed because the response's Content-Type header was not supported."},"panels/application/preloading/components/PreloadingString.ts | PrefetchFailedNetError":{"message":"The prefetch failed because of a network error."},"panels/application/preloading/components/PreloadingString.ts | PrefetchFailedNon2XX":{"message":"The prefetch failed because of a non-2xx HTTP response status code."},"panels/application/preloading/components/PreloadingString.ts | PrefetchIneligibleRetryAfter":{"message":"A previous prefetch to the origin got a HTTP 503 response with an Retry-After header that has not elapsed yet."},"panels/application/preloading/components/PreloadingString.ts | PrefetchIsPrivacyDecoy":{"message":"The URL was not eligible to be prefetched because there was a registered service worker or cross-site cookies for that origin, but the prefetch was put on the network anyways and not used, to disguise that the user had some kind of previous relationship with the origin."},"panels/application/preloading/components/PreloadingString.ts | PrefetchIsStale":{"message":"Too much time elapsed between the prefetch and usage, so the prefetch was discarded."},"panels/application/preloading/components/PreloadingString.ts | PrefetchNotEligibleBatterySaverEnabled":{"message":"The prefetch was not performed because the Battery Saver setting was enabled."},"panels/application/preloading/components/PreloadingString.ts | PrefetchNotEligibleBrowserContextOffTheRecord":{"message":"The prefetch was not performed because the browser is in Incognito or Guest mode."},"panels/application/preloading/components/PreloadingString.ts | PrefetchNotEligibleDataSaverEnabled":{"message":"The prefetch was not performed because the operating system is in Data Saver mode."},"panels/application/preloading/components/PreloadingString.ts | PrefetchNotEligibleExistingProxy":{"message":"The URL is not eligible to be prefetched, because in the default network context it is configured to use a proxy server."},"panels/application/preloading/components/PreloadingString.ts | PrefetchNotEligibleHostIsNonUnique":{"message":"The URL was not eligible to be prefetched because its host was not unique (e.g., a non publicly routable IP address or a hostname which is not registry-controlled), but the prefetch was required to be proxied."},"panels/application/preloading/components/PreloadingString.ts | PrefetchNotEligibleNonDefaultStoragePartition":{"message":"The URL was not eligible to be prefetched because it uses a non-default storage partition."},"panels/application/preloading/components/PreloadingString.ts | PrefetchNotEligiblePreloadingDisabled":{"message":"The prefetch was not performed because speculative loading was disabled."},"panels/application/preloading/components/PreloadingString.ts | PrefetchNotEligibleSameSiteCrossOriginPrefetchRequiredProxy":{"message":"The URL was not eligible to be prefetched because the default network context cannot be configured to use the prefetch proxy for a same-site cross-origin prefetch request."},"panels/application/preloading/components/PreloadingString.ts | PrefetchNotEligibleSchemeIsNotHttps":{"message":"The URL was not eligible to be prefetched because its scheme was not https:."},"panels/application/preloading/components/PreloadingString.ts | PrefetchNotEligibleUserHasCookies":{"message":"The URL was not eligible to be prefetched because it was cross-site, but the user had cookies for that origin."},"panels/application/preloading/components/PreloadingString.ts | PrefetchNotEligibleUserHasServiceWorker":{"message":"The URL was not eligible to be prefetched because there was a registered service worker for that origin, which is currently not supported."},"panels/application/preloading/components/PreloadingString.ts | PrefetchNotUsedCookiesChanged":{"message":"The prefetch was not used because it was a cross-site prefetch, and cookies were added for that URL while the prefetch was ongoing, so the prefetched response is now out-of-date."},"panels/application/preloading/components/PreloadingString.ts | PrefetchNotUsedProbeFailed":{"message":"The prefetch was blocked by your Internet Service Provider or network administrator."},"panels/application/preloading/components/PreloadingString.ts | PrefetchProxyNotAvailable":{"message":"A network error was encountered when trying to set up a connection to the prefetching proxy."},"panels/application/preloading/components/PreloadingString.ts | prerenderFinalStatusActivatedDuringMainFrameNavigation":{"message":"Prerendered page activated during initiating page's main frame navigation."},"panels/application/preloading/components/PreloadingString.ts | prerenderFinalStatusActivatedWithAuxiliaryBrowsingContexts":{"message":"The prerender was not used because during activation time, there were other windows with an active opener reference to the initiating page, which is currently not supported."},"panels/application/preloading/components/PreloadingString.ts | prerenderFinalStatusActivationFramePolicyNotCompatible":{"message":"The prerender was not used because the sandboxing flags or permissions policy of the initiating page was not compatible with those of the prerendering page."},"panels/application/preloading/components/PreloadingString.ts | prerenderFinalStatusActivationNavigationParameterMismatch":{"message":"The prerender was not used because during activation time, different navigation parameters (e.g., HTTP headers) were calculated than during the original prerendering navigation request."},"panels/application/preloading/components/PreloadingString.ts | prerenderFinalStatusActivationUrlHasEffectiveUrl":{"message":"The prerender was not used because during activation time, navigation has an effective URL that is different from its normal URL. (For example, the New Tab Page, or hosted apps.)"},"panels/application/preloading/components/PreloadingString.ts | prerenderFinalStatusAllPrerenderingCanceled":{"message":"All prerendered pages were unloaded by the browser for some reason (For example, WebViewCompat.addWebMessageListener() was called during prerendering.)"},"panels/application/preloading/components/PreloadingString.ts | prerenderFinalStatusAudioOutputDeviceRequested":{"message":"The prerendered page requested audio output, which is currently not supported."},"panels/application/preloading/components/PreloadingString.ts | prerenderFinalStatusBatterySaverEnabled":{"message":"The prerender was not performed because the user requested that the browser use less battery."},"panels/application/preloading/components/PreloadingString.ts | prerenderFinalStatusBlockedByClient":{"message":"Some resource load was blocked."},"panels/application/preloading/components/PreloadingString.ts | prerenderFinalStatusClientCertRequested":{"message":"The prerendering navigation required a HTTP client certificate."},"panels/application/preloading/components/PreloadingString.ts | prerenderFinalStatusCrossSiteNavigationInInitialNavigation":{"message":"The prerendering navigation failed because it targeted a cross-site URL."},"panels/application/preloading/components/PreloadingString.ts | prerenderFinalStatusCrossSiteNavigationInMainFrameNavigation":{"message":"The prerendered page navigated to a cross-site URL."},"panels/application/preloading/components/PreloadingString.ts | prerenderFinalStatusCrossSiteRedirectInInitialNavigation":{"message":"The prerendering navigation failed because the prerendered URL redirected to a cross-site URL."},"panels/application/preloading/components/PreloadingString.ts | prerenderFinalStatusCrossSiteRedirectInMainFrameNavigation":{"message":"The prerendered page navigated to a URL which redirected to a cross-site URL."},"panels/application/preloading/components/PreloadingString.ts | prerenderFinalStatusDataSaverEnabled":{"message":"The prerender was not performed because the user requested that the browser use less data."},"panels/application/preloading/components/PreloadingString.ts | prerenderFinalStatusDownload":{"message":"The prerendered page attempted to initiate a download, which is currently not supported."},"panels/application/preloading/components/PreloadingString.ts | prerenderFinalStatusHasEffectiveUrl":{"message":"The initiating page cannot perform prerendering, because it has an effective URL that is different from its normal URL. (For example, the New Tab Page, or hosted apps.)"},"panels/application/preloading/components/PreloadingString.ts | prerenderFinalStatusInvalidSchemeNavigation":{"message":"The URL was not eligible to be prerendered because its scheme was not http: or https:."},"panels/application/preloading/components/PreloadingString.ts | prerenderFinalStatusInvalidSchemeRedirect":{"message":"The prerendering navigation failed because it redirected to a URL whose scheme was not http: or https:."},"panels/application/preloading/components/PreloadingString.ts | prerenderFinalStatusJavaScriptInterfaceAdded":{"message":"The prerendered page was unloaded because a new JavaScript interface has been injected by WebView.addJavascriptInterface()."},"panels/application/preloading/components/PreloadingString.ts | prerenderFinalStatusJavaScriptInterfaceRemoved":{"message":"The prerendered page was unloaded because a JavaScript interface has been removed by WebView.removeJavascriptInterface()."},"panels/application/preloading/components/PreloadingString.ts | prerenderFinalStatusLoginAuthRequested":{"message":"The prerendering navigation required HTTP authentication, which is currently not supported."},"panels/application/preloading/components/PreloadingString.ts | prerenderFinalStatusLowEndDevice":{"message":"The prerender was not performed because this device does not have enough total system memory to support prerendering."},"panels/application/preloading/components/PreloadingString.ts | prerenderFinalStatusMainFrameNavigation":{"message":"The prerendered page navigated itself to another URL, which is currently not supported."},"panels/application/preloading/components/PreloadingString.ts | prerenderFinalStatusMaxNumOfRunningEagerPrerendersExceeded":{"message":"The prerender whose eagerness is \"eager\" was not performed because the initiating page already has too many prerenders ongoing. Remove other speculation rules with \"eager\" to enable further prerendering."},"panels/application/preloading/components/PreloadingString.ts | prerenderFinalStatusMaxNumOfRunningEmbedderPrerendersExceeded":{"message":"The browser-triggered prerender was not performed because the initiating page already has too many prerenders ongoing."},"panels/application/preloading/components/PreloadingString.ts | prerenderFinalStatusMaxNumOfRunningNonEagerPrerendersExceeded":{"message":"The old non-eager prerender (with a \"moderate\" or \"conservative\" eagerness and triggered by hovering or clicking links) was automatically canceled due to starting a new non-eager prerender. It can be retriggered by interacting with the link again."},"panels/application/preloading/components/PreloadingString.ts | prerenderFinalStatusMemoryLimitExceeded":{"message":"The prerender was not performed because the browser exceeded the prerendering memory limit."},"panels/application/preloading/components/PreloadingString.ts | prerenderFinalStatusMemoryPressureAfterTriggered":{"message":"The prerendered page was unloaded because the browser came under critical memory pressure."},"panels/application/preloading/components/PreloadingString.ts | prerenderFinalStatusMemoryPressureOnTrigger":{"message":"The prerender was not performed because the browser was under critical memory pressure."},"panels/application/preloading/components/PreloadingString.ts | prerenderFinalStatusMixedContent":{"message":"The prerendered page contained mixed content."},"panels/application/preloading/components/PreloadingString.ts | prerenderFinalStatusMojoBinderPolicy":{"message":"The prerendered page used a forbidden JavaScript API that is currently not supported. (Internal Mojo interface: {PH1})"},"panels/application/preloading/components/PreloadingString.ts | prerenderFinalStatusNavigationBadHttpStatus":{"message":"The prerendering navigation failed because of a non-2xx HTTP response status code."},"panels/application/preloading/components/PreloadingString.ts | prerenderFinalStatusNavigationRequestBlockedByCsp":{"message":"The prerendering navigation was blocked by a Content Security Policy."},"panels/application/preloading/components/PreloadingString.ts | prerenderFinalStatusNavigationRequestNetworkError":{"message":"The prerendering navigation encountered a network error."},"panels/application/preloading/components/PreloadingString.ts | prerenderFinalStatusPreloadingDisabled":{"message":"The prerender was not performed because the user disabled preloading in their browser settings."},"panels/application/preloading/components/PreloadingString.ts | prerenderFinalStatusPrerenderingDisabledByDevTools":{"message":"The prerender was not performed because DevTools has been used to disable prerendering."},"panels/application/preloading/components/PreloadingString.ts | prerenderFinalStatusPrerenderingUrlHasEffectiveUrl":{"message":"The prerendering navigation failed because it has an effective URL that is different from its normal URL. (For example, the New Tab Page, or hosted apps.)"},"panels/application/preloading/components/PreloadingString.ts | prerenderFinalStatusPrimaryMainFrameRendererProcessCrashed":{"message":"The initiating page crashed."},"panels/application/preloading/components/PreloadingString.ts | prerenderFinalStatusPrimaryMainFrameRendererProcessKilled":{"message":"The initiating page was killed."},"panels/application/preloading/components/PreloadingString.ts | prerenderFinalStatusRedirectedPrerenderingUrlHasEffectiveUrl":{"message":"The prerendering navigation failed because it redirected to an effective URL that is different from its normal URL. (For example, the New Tab Page, or hosted apps.)"},"panels/application/preloading/components/PreloadingString.ts | prerenderFinalStatusRendererProcessCrashed":{"message":"The prerendered page crashed."},"panels/application/preloading/components/PreloadingString.ts | prerenderFinalStatusRendererProcessKilled":{"message":"The prerendered page was killed."},"panels/application/preloading/components/PreloadingString.ts | prerenderFinalStatusSameSiteCrossOriginNavigationNotOptInInInitialNavigation":{"message":"The prerendering navigation failed because it was to a cross-origin same-site URL, but the destination response did not include the appropriate Supports-Loading-Mode header."},"panels/application/preloading/components/PreloadingString.ts | prerenderFinalStatusSameSiteCrossOriginNavigationNotOptInInMainFrameNavigation":{"message":"The prerendered page navigated to a cross-origin same-site URL, but the destination response did not include the appropriate Supports-Loading-Mode header."},"panels/application/preloading/components/PreloadingString.ts | prerenderFinalStatusSameSiteCrossOriginRedirectNotOptInInInitialNavigation":{"message":"The prerendering navigation failed because the prerendered URL redirected to a cross-origin same-site URL, but the destination response did not include the appropriate Supports-Loading-Mode header."},"panels/application/preloading/components/PreloadingString.ts | prerenderFinalStatusSameSiteCrossOriginRedirectNotOptInInMainFrameNavigation":{"message":"The prerendered page navigated to a URL which redirected to a cross-origin same-site URL, but the destination response did not include the appropriate Supports-Loading-Mode header."},"panels/application/preloading/components/PreloadingString.ts | prerenderFinalStatusSpeculationRuleRemoved":{"message":"The prerendered page was unloaded because the initiating page removed the corresponding prerender rule from `;\n const extensions = [CodeMirror.html.html()];\n const state = CodeMirror.EditorState.create({doc, extensions});\n for (const name of ['bar', 'baz']) {\n const from = doc.indexOf(name);\n const to = from + name.length;\n assert.deepInclude(\n computePopoverHighlightRange(state, 'text/html', from),\n {from, to},\n `did not correct highlight '${name}'`,\n );\n }\n });\n\n it('correctly returns highlight range for variables in inline event handlers', () => {\n const doc = `\n`;\n const extensions = [CodeMirror.html.html()];\n const state = CodeMirror.EditorState.create({doc, extensions});\n for (const name of ['foo', 'bar', 'baz']) {\n const from = doc.indexOf(name);\n const to = from + name.length;\n assert.deepInclude(\n computePopoverHighlightRange(state, 'text/html', from),\n {from, to},\n `did not correct highlight '${name}'`,\n );\n }\n });\n });\n\n describe('in TSX files', () => {\n it('correctly returns highlight range for field accesses', () => {\n const doc = `function foo(obj: any): number {\n return obj.x + obj.y;\n}`;\n const extensions = [CodeMirror.javascript.tsxLanguage];\n const state = CodeMirror.EditorState.create({doc, extensions});\n for (const name of ['x', 'y']) {\n const pos = doc.lastIndexOf(name);\n const from = pos - 4;\n const to = pos + name.length;\n assert.deepInclude(\n computePopoverHighlightRange(state, 'text/typescript-jsx', pos),\n {from, to},\n `did not correct highlight '${name}'`,\n );\n }\n });\n });\n });\n});\n"]} \ No newline at end of file +{"version":3,"file":"DebuggerPlugin.test.js","sourceRoot":"","sources":["../../../../../../front_end/panels/sources/DebuggerPlugin.test.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAG7B,OAAO,KAAK,GAAG,MAAM,uBAAuB,CAAC;AAE7C,OAAO,KAAK,QAAQ,MAAM,mCAAmC,CAAC;AAC9D,OAAO,KAAK,SAAS,MAAM,uCAAuC,CAAC;AACnE,OAAO,KAAK,SAAS,MAAM,qCAAqC,CAAC;AACjE,OAAO,EAAC,YAAY,EAAE,uBAAuB,EAAC,MAAM,qCAAqC,CAAC;AAC1F,OAAO,EAAC,0BAA0B,EAAC,MAAM,iCAAiC,CAAC;AAC3E,OAAO,EAAC,mBAAmB,EAAE,eAAe,EAAC,MAAM,iCAAiC,CAAC;AACrF,OAAO,KAAK,UAAU,MAAM,sDAAsD,CAAC;AACnF,OAAO,KAAK,UAAU,MAAM,gDAAgD,CAAC;AAE7E,OAAO,KAAK,OAAO,MAAM,cAAc,CAAC;AAExC,0BAA0B,CAAC,oCAAoC,EAAE,GAAG,EAAE;IACpE,MAAM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K,GAAG,UAAU,CAAC,WAAW,CAAC,MAAM,CAAC,EAAC,GAAG,EAAE,UAAU,EAAC,CAAC,CAAC;gBAC/D,KAAK,MAAM,IAAI,IAAI,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,CAAC;oBAC9B,MAAM,GAAG,GAAG,GAAG,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;oBAClC,MAAM,IAAI,GAAG,GAAG,GAAG,CAAC,CAAC;oBACrB,MAAM,EAAE,GAAG,GAAG,GAAG,IAAI,CAAC,MAAM,CAAC;oBAC7B,MAAM,CAAC,WAAW,CACd,4BAA4B,CAAC,KAAK,EAAE,qBAAqB,EAAE,GAAG,CAAC,EAC/D,EAAC,IAAI,EAAE,EAAE,EAAC,EACV,8BAA8B,IAAI,GAAG,CACxC,CAAC;gBACJ,CAAC;YACH,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["// Copyright 2022 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport type * as Platform from '../../core/platform/platform.js';\nimport * as SDK from '../../core/sdk/sdk.js';\nimport * as Protocol from '../../generated/protocol.js';\nimport * as Bindings from '../../models/bindings/bindings.js';\nimport * as TextUtils from '../../models/text_utils/text_utils.js';\nimport * as Workspace from '../../models/workspace/workspace.js';\nimport {createTarget, describeWithEnvironment} from '../../testing/EnvironmentHelpers.js';\nimport {describeWithMockConnection} from '../../testing/MockConnection.js';\nimport {MockProtocolBackend, parseScopeChain} from '../../testing/MockScopeChain.js';\nimport * as CodeMirror from '../../third_party/codemirror.next/codemirror.next.js';\nimport * as TextEditor from '../../ui/components/text_editor/text_editor.js';\n\nimport * as Sources from './sources.js';\n\ndescribeWithMockConnection('Inline variable view scope helpers', () => {\n const URL = 'file:///tmp/example.js' as Platform.DevToolsPath.UrlString;\n let target: SDK.Target.Target;\n let backend: MockProtocolBackend;\n\n beforeEach(() => {\n const workspace = Workspace.Workspace.WorkspaceImpl.instance();\n const targetManager = SDK.TargetManager.TargetManager.instance();\n const resourceMapping = new Bindings.ResourceMapping.ResourceMapping(targetManager, workspace);\n const debuggerWorkspaceBinding = Bindings.DebuggerWorkspaceBinding.DebuggerWorkspaceBinding.instance({\n forceNew: true,\n resourceMapping,\n targetManager,\n });\n Bindings.IgnoreListManager.IgnoreListManager.instance({forceNew: true, debuggerWorkspaceBinding});\n target = createTarget();\n backend = new MockProtocolBackend();\n });\n\n async function toOffsetWithSourceMap(\n sourceMap: SDK.SourceMap.SourceMap|undefined, location: SDK.DebuggerModel.Location|null) {\n if (!location || !sourceMap) {\n return null;\n }\n const entry = sourceMap.findEntry(location.lineNumber, location.columnNumber);\n if (!entry || !entry.sourceURL) {\n return null;\n }\n const content = sourceMap.embeddedContentByURL(entry.sourceURL);\n if (!content) {\n return null;\n }\n const text = new TextUtils.Text.Text(content);\n return text.offsetFromPosition(entry.sourceLineNumber, entry.sourceColumnNumber);\n }\n\n async function toOffset(source: string|null, location: SDK.DebuggerModel.Location|null) {\n if (!location || !source) {\n return null;\n }\n const text = new TextUtils.Text.Text(source);\n return text.offsetFromPosition(location.lineNumber, location.columnNumber);\n }\n\n it('can resolve single scope mappings with source map', async () => {\n const sourceMapUrl = 'file:///tmp/example.js.min.map';\n // This example was minified with terser v5.7.0 with following command.\n // 'terser index.js -m --toplevel -o example.min.js --source-map \"url=example.min.js.map,includeSources\"'\n const source = `function o(o,n){console.log(o,n)}o(1,2);\\n//# sourceMappingURL=${sourceMapUrl}`;\n const scopes = ' { }';\n\n // The original scopes below have to match with how the source map translates the scope, so it\n // does not align perfectly with the source language scopes. In principle, this test could only\n // assert that the tests are approximately correct; currently, we assert an exact match.\n const originalSource = 'function unminified(par1, par2) {\\n console.log(par1, par2);\\n}\\nunminified(1, 2);\\n';\n const originalScopes = ' { \\n \\n }';\n const expectedOffsets = parseScopeChain(originalScopes);\n\n const sourceMapContent = {\n version: 3,\n names: ['unminified', 'par1', 'par2', 'console', 'log'],\n sources: ['index.js'],\n sourcesContent: [originalSource],\n mappings: 'AAAA,SAASA,EAAWC,EAAMC,GACxBC,QAAQC,IAAIH,EAAMC,EACpB,CACAF,EAAW,EAAG',\n };\n const sourceMapJson = JSON.stringify(sourceMapContent);\n\n const scopeObject = backend.createSimpleRemoteObject([{name: 'o', value: 42}, {name: 'n', value: 1}]);\n const callFrame = await backend.createCallFrame(\n target, {url: URL, content: source}, scopes, {url: sourceMapUrl, content: sourceMapJson}, [scopeObject]);\n\n // Get source map for mapping locations to 'editor' offsets.\n const sourceMap = await callFrame.debuggerModel.sourceMapManager().sourceMapForClientPromise(callFrame.script);\n\n const scopeMappings =\n await Sources.DebuggerPlugin.computeScopeMappings(callFrame, l => toOffsetWithSourceMap(sourceMap, l));\n\n const text = new TextUtils.Text.Text(originalSource);\n assert.lengthOf(scopeMappings, 1);\n assert.strictEqual(\n scopeMappings[0].scopeStart,\n text.offsetFromPosition(expectedOffsets[0].startLine, expectedOffsets[0].startColumn));\n assert.strictEqual(\n scopeMappings[0].scopeEnd, text.offsetFromPosition(expectedOffsets[0].endLine, expectedOffsets[0].endColumn));\n assert.strictEqual(scopeMappings[0].variableMap.get('par1')?.value, 42);\n assert.strictEqual(scopeMappings[0].variableMap.get('par2')?.value, 1);\n });\n\n it('can resolve nested scope mappings with source map', async () => {\n const sourceMapUrl = 'file:///tmp/example.js.min.map';\n // This example was minified with terser v5.7.0 with following command.\n // 'terser index.js -m --toplevel -o example.min.js --source-map \"url=example.min.js.map,includeSources\"'\n const source =\n `function o(o){const n=console.log.bind(console);for(let c=0;c} ';\n\n const originalSource =\n 'function f(n) {\\n const c = console.log.bind(console);\\n for (let i = 0; i < n; i++) c(i);\\n}\\nf(10);\\n';\n const originalScopes =\n ' { \\n \\n < >\\n }';\n const expectedOffsets = parseScopeChain(originalScopes);\n\n const sourceMapContent = {\n version: 3,\n names: ['f', 'n', 'c', 'console', 'log', 'bind', 'i'],\n sources: ['index.js'],\n sourcesContent: [originalSource],\n mappings:\n 'AAAA,SAASA,EAAEC,GACT,MAAMC,EAAIC,QAAQC,IAAIC,KAAKF,SAC3B,IAAK,IAAIG,EAAI,EAAGA,EAAIL,EAAGK,IAAKJ,EAAEI,EAChC,CACAN,EAAE',\n };\n const sourceMapJson = JSON.stringify(sourceMapContent);\n\n const functionScopeObject = backend.createSimpleRemoteObject([{name: 'o', value: 10}, {name: 'n', value: 1234}]);\n const forScopeObject = backend.createSimpleRemoteObject([{name: 'c', value: 5}]);\n\n const callFrame = await backend.createCallFrame(\n target, {url: URL, content: source}, scopes, {url: sourceMapUrl, content: sourceMapJson},\n [forScopeObject, functionScopeObject]);\n\n // Get source map for mapping locations to 'editor' offsets.\n const sourceMap = await callFrame.debuggerModel.sourceMapManager().sourceMapForClientPromise(callFrame.script);\n\n const scopeMappings =\n await Sources.DebuggerPlugin.computeScopeMappings(callFrame, l => toOffsetWithSourceMap(sourceMap, l));\n\n const text = new TextUtils.Text.Text(originalSource);\n assert.lengthOf(scopeMappings, 2);\n assert.strictEqual(\n scopeMappings[0].scopeStart,\n text.offsetFromPosition(expectedOffsets[0].startLine, expectedOffsets[0].startColumn));\n assert.strictEqual(\n scopeMappings[0].scopeEnd, text.offsetFromPosition(expectedOffsets[0].endLine, expectedOffsets[0].endColumn));\n assert.strictEqual(scopeMappings[0].variableMap.get('i')?.value, 5);\n assert.strictEqual(scopeMappings[0].variableMap.size, 1);\n assert.strictEqual(\n scopeMappings[1].scopeStart,\n text.offsetFromPosition(expectedOffsets[1].startLine, expectedOffsets[1].startColumn));\n assert.strictEqual(\n scopeMappings[1].scopeEnd, text.offsetFromPosition(expectedOffsets[1].endLine, expectedOffsets[1].endColumn));\n assert.strictEqual(scopeMappings[1].variableMap.get('n')?.value, 10);\n assert.strictEqual(scopeMappings[1].variableMap.get('c')?.value, 1234);\n assert.strictEqual(scopeMappings[1].variableMap.size, 2);\n });\n\n it('can resolve simple scope mappings', async () => {\n const source = 'function f(a) { debugger } f(1)';\n const scopes = ' { }';\n const expectedOffsets = parseScopeChain(scopes);\n\n const functionScopeObject = backend.createSimpleRemoteObject([{name: 'a', value: 1}]);\n\n const callFrame =\n await backend.createCallFrame(target, {url: URL, content: source}, scopes, null, [functionScopeObject]);\n\n const scopeMappings = await Sources.DebuggerPlugin.computeScopeMappings(callFrame, l => toOffset(source, l));\n\n assert.lengthOf(scopeMappings, 1);\n assert.strictEqual(scopeMappings[0].scopeStart, expectedOffsets[0].startColumn);\n assert.strictEqual(scopeMappings[0].scopeEnd, expectedOffsets[0].endColumn);\n assert.strictEqual(scopeMappings[0].variableMap.get('a')?.value, 1);\n assert.strictEqual(scopeMappings[0].variableMap.size, 1);\n });\n\n it('can resolve nested scope mappings for block with no variables', async () => {\n const source = 'function f() { let a = 1; { debugger } } f()';\n const scopes = ' { < > }';\n const expectedOffsets = parseScopeChain(scopes);\n\n const functionScopeObject = backend.createSimpleRemoteObject([{name: 'a', value: 1}]);\n const blockScopeObject = backend.createSimpleRemoteObject([]);\n\n const callFrame = await backend.createCallFrame(\n target, {url: URL, content: source}, scopes, null, [blockScopeObject, functionScopeObject]);\n\n const scopeMappings = await Sources.DebuggerPlugin.computeScopeMappings(callFrame, l => toOffset(source, l));\n\n assert.lengthOf(scopeMappings, 2);\n assert.strictEqual(scopeMappings[0].scopeStart, expectedOffsets[0].startColumn);\n assert.strictEqual(scopeMappings[0].scopeEnd, expectedOffsets[0].endColumn);\n assert.strictEqual(scopeMappings[0].variableMap.size, 0);\n assert.strictEqual(scopeMappings[1].scopeStart, expectedOffsets[1].startColumn);\n assert.strictEqual(scopeMappings[1].scopeEnd, expectedOffsets[1].endColumn);\n assert.strictEqual(scopeMappings[1].variableMap.get('a')?.value, 1);\n assert.strictEqual(scopeMappings[1].variableMap.size, 1);\n });\n\n it('can resolve nested scope mappings for function with no variables', async () => {\n const source = 'function f() { console.log(\"Hi\"); { let a = 1; debugger } } f()';\n const scopes = ' { < > }';\n const expectedOffsets = parseScopeChain(scopes);\n\n const functionScopeObject = backend.createSimpleRemoteObject([]);\n const blockScopeObject = backend.createSimpleRemoteObject([{name: 'a', value: 1}]);\n\n const callFrame = await backend.createCallFrame(\n target, {url: URL, content: source}, scopes, null, [blockScopeObject, functionScopeObject]);\n\n const scopeMappings = await Sources.DebuggerPlugin.computeScopeMappings(callFrame, l => toOffset(source, l));\n\n assert.lengthOf(scopeMappings, 2);\n assert.strictEqual(scopeMappings[0].scopeStart, expectedOffsets[0].startColumn);\n assert.strictEqual(scopeMappings[0].scopeEnd, expectedOffsets[0].endColumn);\n assert.strictEqual(scopeMappings[0].variableMap.size, 1);\n assert.strictEqual(scopeMappings[0].variableMap.get('a')?.value, 1);\n assert.strictEqual(scopeMappings[1].scopeStart, expectedOffsets[1].startColumn);\n assert.strictEqual(scopeMappings[1].scopeEnd, expectedOffsets[1].endColumn);\n assert.strictEqual(scopeMappings[1].variableMap.size, 0);\n });\n});\n\nfunction makeState(doc: string, extensions: CodeMirror.Extension = []) {\n return CodeMirror.EditorState.create({\n doc,\n extensions: [\n extensions,\n TextEditor.Config.baseConfiguration(doc),\n TextEditor.Config.autocompletion.instance(),\n ],\n });\n}\n\ndescribeWithEnvironment('Inline variable view parser', () => {\n it('parses simple identifier', () => {\n const state = makeState('c', CodeMirror.javascript.javascriptLanguage);\n const variables = Sources.DebuggerPlugin.getVariableNamesByLine(state, 0, 1, 1);\n assert.deepEqual(variables, [{line: 0, from: 0, id: 'c'}]);\n });\n\n it('parses simple function', () => {\n const code = `function f(o) {\n let a = 1;\n debugger;\n }`;\n const state = makeState(code, CodeMirror.javascript.javascriptLanguage);\n const variables = Sources.DebuggerPlugin.getVariableNamesByLine(state, 10, code.length, code.indexOf('debugger'));\n assert.deepEqual(variables, [{line: 0, from: 11, id: 'o'}, {line: 1, from: 26, id: 'a'}]);\n });\n\n it('parses patterns', () => {\n const code = `function f(o) {\n let {x: a, y: [b, c]} = {x: o, y: [1, 2]};\n console.log(a + b + c);\n debugger;\n }`;\n const state = makeState(code, CodeMirror.javascript.javascriptLanguage);\n const variables = Sources.DebuggerPlugin.getVariableNamesByLine(state, 10, code.length, code.indexOf('debugger'));\n assert.deepEqual(variables, [\n {line: 0, from: 11, id: 'o'},\n {line: 1, from: 30, id: 'a'},\n {line: 1, from: 37, id: 'b'},\n {line: 1, from: 40, id: 'c'},\n {line: 1, from: 50, id: 'o'},\n {line: 2, from: 71, id: 'console'},\n {line: 2, from: 83, id: 'a'},\n {line: 2, from: 87, id: 'b'},\n {line: 2, from: 91, id: 'c'},\n ]);\n });\n\n it('parses function with nested block', () => {\n const code = `function f(o) {\n let a = 1;\n {\n let a = 2;\n debugger;\n }\n }`;\n const state = makeState(code, CodeMirror.javascript.javascriptLanguage);\n const variables = Sources.DebuggerPlugin.getVariableNamesByLine(state, 10, code.length, code.indexOf('debugger'));\n assert.deepEqual(\n variables, [{line: 0, from: 11, id: 'o'}, {line: 1, from: 26, id: 'a'}, {line: 3, from: 53, id: 'a'}]);\n });\n\n it('parses function variable, ignores shadowing let in sibling block', () => {\n const code = `function f(o) {\n let a = 1;\n {\n let a = 2;\n console.log(a);\n }\n debugger;\n }`;\n const state = makeState(code, CodeMirror.javascript.javascriptLanguage);\n const variables = Sources.DebuggerPlugin.getVariableNamesByLine(state, 10, code.length, code.indexOf('debugger'));\n assert.deepEqual(\n variables, [{line: 0, from: 11, id: 'o'}, {line: 1, from: 26, id: 'a'}, {line: 4, from: 68, id: 'console'}]);\n });\n\n it('parses function variable, ignores shadowing const in sibling block', () => {\n const code = `function f(o) {\n let a = 1;\n {\n const a = 2;\n console.log(a);\n }\n debugger;\n }`;\n const state = makeState(code, CodeMirror.javascript.javascriptLanguage);\n const variables = Sources.DebuggerPlugin.getVariableNamesByLine(state, 10, code.length, code.indexOf('debugger'));\n assert.deepEqual(\n variables, [{line: 0, from: 11, id: 'o'}, {line: 1, from: 26, id: 'a'}, {line: 4, from: 70, id: 'console'}]);\n });\n\n it('parses function variable, ignores shadowing typed const in sibling block', () => {\n const code = `function f(o) {\n let a: number = 1;\n {\n const a: number = 2;\n console.log(a);\n }\n debugger;\n }`;\n const state = makeState(code, CodeMirror.javascript.javascriptLanguage);\n const variables = Sources.DebuggerPlugin.getVariableNamesByLine(state, 10, code.length, code.indexOf('debugger'));\n assert.deepEqual(\n variables, [{line: 0, from: 11, id: 'o'}, {line: 1, from: 26, id: 'a'}, {line: 4, from: 86, id: 'console'}]);\n });\n\n it('parses function variable, reports all vars', () => {\n const code = `function f(o) {\n var a = 1;\n {\n var a = 2;\n console.log(a);\n }\n debugger;\n }`;\n const state = makeState(code, CodeMirror.javascript.javascriptLanguage);\n const variables = Sources.DebuggerPlugin.getVariableNamesByLine(state, 10, code.length, code.indexOf('debugger'));\n assert.deepEqual(variables, [\n {line: 0, from: 11, id: 'o'},\n {line: 1, from: 26, id: 'a'},\n {line: 3, from: 53, id: 'a'},\n {line: 4, from: 68, id: 'console'},\n {line: 4, from: 80, id: 'a'},\n ]);\n });\n\n it('parses function variable, handles shadowing in doubly nested scopes', () => {\n const code = `function f() {\n let a = 1;\n let b = 2;\n let c = 3;\n {\n let b;\n {\n const c = 4;\n b = 5;\n console.log(c);\n }\n console.log(c);\n }\n debugger;\n }`;\n const state = makeState(code, CodeMirror.javascript.javascriptLanguage);\n const variables = Sources.DebuggerPlugin.getVariableNamesByLine(state, 10, code.length, code.indexOf('debugger'));\n assert.deepEqual(variables, [\n {line: 1, from: 25, id: 'a'},\n {line: 2, from: 42, id: 'b'},\n {line: 3, from: 59, id: 'c'},\n {line: 9, from: 149, id: 'console'},\n {line: 11, from: 183, id: 'console'},\n {line: 11, from: 195, id: 'c'},\n ]);\n });\n\n it('parses function variable, handles shadowing with object pattern', () => {\n const code = `function f() {\n let a = 1;\n {\n let {x: b, y: a} = {x: 1, y: 2};\n console.log(a + b);\n }\n console.log(a);\n debugger;\n }`;\n const state = makeState(code, CodeMirror.javascript.javascriptLanguage);\n const variables = Sources.DebuggerPlugin.getVariableNamesByLine(state, 10, code.length, code.indexOf('debugger'));\n assert.deepEqual(variables, [\n {line: 1, from: 25, id: 'a'},\n {line: 4, from: 89, id: 'console'},\n {line: 6, from: 123, id: 'console'},\n {line: 6, from: 135, id: 'a'},\n ]);\n });\n\n it('parses function variable, handles shadowing with array pattern', () => {\n const code = `function f() {\n let a = 1;\n {\n const [b, a] = [1, 2];\n console.log(a + b);\n }\n console.log(a);\n debugger;\n }`;\n const state = makeState(code, CodeMirror.javascript.javascriptLanguage);\n const variables = Sources.DebuggerPlugin.getVariableNamesByLine(state, 10, code.length, code.indexOf('debugger'));\n assert.deepEqual(variables, [\n {line: 1, from: 25, id: 'a'},\n {line: 4, from: 79, id: 'console'},\n {line: 6, from: 113, id: 'console'},\n {line: 6, from: 125, id: 'a'},\n ]);\n });\n});\n\ndescribeWithEnvironment('Inline variable view scope value resolution', () => {\n it('resolves single variable in single scope', () => {\n const value42 = {type: Protocol.Runtime.RemoteObjectType.Number, value: 42} as SDK.RemoteObject.RemoteObject;\n const scopeMappings = [{scopeStart: 0, scopeEnd: 10, variableMap: new Map([['a', value42]])}];\n const variableNames = [{line: 3, from: 5, id: 'a'}];\n const valuesByLine = Sources.DebuggerPlugin.getVariableValuesByLine(scopeMappings, variableNames);\n\n assert.strictEqual(valuesByLine?.size, 1);\n assert.strictEqual(valuesByLine?.get(3)?.size, 1);\n assert.strictEqual(valuesByLine?.get(3)?.get('a')?.value, 42);\n });\n\n it('resolves shadowed variables', () => {\n const value1 = {type: Protocol.Runtime.RemoteObjectType.Number, value: 1} as SDK.RemoteObject.RemoteObject;\n const value2 = {type: Protocol.Runtime.RemoteObjectType.Number, value: 2} as SDK.RemoteObject.RemoteObject;\n const scopeMappings = [\n {scopeStart: 10, scopeEnd: 20, variableMap: new Map([['a', value1]])},\n {scopeStart: 0, scopeEnd: 30, variableMap: new Map([['a', value2]])},\n ];\n const variableNames = [\n {line: 0, from: 5, id: 'a'}, // Falls into the outer scope.\n {line: 10, from: 15, id: 'a'}, // Inner scope.\n {line: 20, from: 25, id: 'a'}, // Outer scope.\n {line: 30, from: 35, id: 'a'}, // Outside of any scope.\n ];\n const valuesByLine = Sources.DebuggerPlugin.getVariableValuesByLine(scopeMappings, variableNames);\n\n assert.strictEqual(valuesByLine?.size, 3);\n assert.strictEqual(valuesByLine?.get(0)?.size, 1);\n assert.strictEqual(valuesByLine?.get(0)?.get('a')?.value, 2);\n assert.strictEqual(valuesByLine?.get(10)?.size, 1);\n assert.strictEqual(valuesByLine?.get(10)?.get('a')?.value, 1);\n assert.strictEqual(valuesByLine?.get(20)?.size, 1);\n assert.strictEqual(valuesByLine?.get(20)?.get('a')?.value, 2);\n });\n\n it('resolves multiple variables on the same line', () => {\n const value1 = {type: Protocol.Runtime.RemoteObjectType.Number, value: 1} as SDK.RemoteObject.RemoteObject;\n const value2 = {type: Protocol.Runtime.RemoteObjectType.Number, value: 2} as SDK.RemoteObject.RemoteObject;\n const scopeMappings = [{scopeStart: 10, scopeEnd: 20, variableMap: new Map([['a', value1], ['b', value2]])}];\n const variableNames = [\n {line: 10, from: 11, id: 'a'},\n {line: 10, from: 13, id: 'b'},\n {line: 10, from: 15, id: 'a'},\n ];\n const valuesByLine = Sources.DebuggerPlugin.getVariableValuesByLine(scopeMappings, variableNames);\n\n assert.strictEqual(valuesByLine?.size, 1);\n assert.strictEqual(valuesByLine?.get(10)?.size, 2);\n assert.strictEqual(valuesByLine?.get(10)?.get('a')?.value, 1);\n assert.strictEqual(valuesByLine?.get(10)?.get('b')?.value, 2);\n });\n});\n\ndescribe('DebuggerPlugin', () => {\n describe('computePopoverHighlightRange', () => {\n const {computePopoverHighlightRange} = Sources.DebuggerPlugin;\n\n it('correctly returns highlight range depending on cursor position and selection', () => {\n const doc = 'Hello World!';\n const selection = CodeMirror.EditorSelection.create([\n CodeMirror.EditorSelection.range(2, 5),\n ]);\n const state = CodeMirror.EditorState.create({doc, selection});\n assert.isNull(computePopoverHighlightRange(state, 'text/plain', 0));\n assert.deepInclude(computePopoverHighlightRange(state, 'text/plain', 2), {from: 2, to: 5});\n assert.deepInclude(computePopoverHighlightRange(state, 'text/plain', 5), {from: 2, to: 5});\n assert.isNull(computePopoverHighlightRange(state, 'text/plain', 10));\n assert.isNull(computePopoverHighlightRange(state, 'text/plain', doc.length - 1));\n });\n\n describe('in JavaScript files', () => {\n const extensions = [CodeMirror.javascript.javascript()];\n\n it('correctly returns highlight range for member assignments', () => {\n const doc = 'obj.foo = 42;';\n const state = CodeMirror.EditorState.create({doc, extensions});\n\n assert.deepInclude(computePopoverHighlightRange(state, 'text/javascript', 0), {from: 0, to: 3});\n assert.deepInclude(computePopoverHighlightRange(state, 'text/javascript', 4), {from: 0, to: 7});\n });\n\n it('correctly returns highlight range for member assignments involving `this`', () => {\n const doc = 'this.x = bar;';\n const state = CodeMirror.EditorState.create({doc, extensions});\n\n assert.deepInclude(computePopoverHighlightRange(state, 'text/javascript', 0), {from: 0, to: 4});\n assert.deepInclude(computePopoverHighlightRange(state, 'text/javascript', 5), {from: 0, to: 6});\n });\n\n it('correctly reports function calls as potentially side-effecting', () => {\n const doc = 'getRandomCoffee().name';\n const state = CodeMirror.EditorState.create({doc, extensions});\n\n assert.deepInclude(\n computePopoverHighlightRange(state, 'text/javascript', doc.indexOf('getRandomCoffee')),\n {containsSideEffects: false},\n );\n assert.deepInclude(\n computePopoverHighlightRange(state, 'text/javascript', doc.lastIndexOf('.')),\n {containsSideEffects: true},\n );\n assert.deepInclude(\n computePopoverHighlightRange(state, 'text/javascript', doc.indexOf('name')),\n {containsSideEffects: true},\n );\n });\n\n it('correctly reports method calls as potentially side-effecting', () => {\n const doc = 'utils.getRandomCoffee().name';\n const state = CodeMirror.EditorState.create({doc, extensions});\n\n assert.deepInclude(\n computePopoverHighlightRange(state, 'text/javascript', doc.indexOf('utils')),\n {containsSideEffects: false},\n );\n assert.deepInclude(\n computePopoverHighlightRange(state, 'text/javascript', doc.indexOf('getRandomCoffee')),\n {containsSideEffects: false},\n );\n assert.deepInclude(\n computePopoverHighlightRange(state, 'text/javascript', doc.lastIndexOf('.')),\n {containsSideEffects: true},\n );\n assert.deepInclude(\n computePopoverHighlightRange(state, 'text/javascript', doc.indexOf('name')),\n {containsSideEffects: true},\n );\n });\n\n it('correctly reports function calls in property accesses as potentially side-effecting', () => {\n const doc = 'bar[foo()]';\n const state = CodeMirror.EditorState.create({doc, extensions});\n\n assert.deepInclude(\n computePopoverHighlightRange(state, 'text/javascript', doc.indexOf('bar')),\n {containsSideEffects: false, from: 0, to: 'bar'.length},\n );\n assert.deepInclude(\n computePopoverHighlightRange(state, 'text/javascript', doc.indexOf('[')),\n {containsSideEffects: true, from: 0, to: doc.length},\n );\n assert.deepInclude(\n computePopoverHighlightRange(state, 'text/javascript', doc.indexOf(']')),\n {containsSideEffects: true, from: 0, to: doc.length},\n );\n });\n\n it('correct reports postfix increments in property accesses as potentially side-effecting', () => {\n const doc = 'a[i++]';\n const state = CodeMirror.EditorState.create({doc, extensions});\n\n assert.deepInclude(\n computePopoverHighlightRange(state, 'text/javascript', doc.indexOf('[')),\n {containsSideEffects: true, from: 0, to: doc.length},\n );\n assert.deepInclude(\n computePopoverHighlightRange(state, 'text/javascript', doc.indexOf(']')),\n {containsSideEffects: true, from: 0, to: doc.length},\n );\n });\n\n it('correctly reports postfix decrements in property accesses as potentially side-effecting', () => {\n const doc = 'a[i--]';\n const state = CodeMirror.EditorState.create({doc, extensions});\n\n assert.deepInclude(\n computePopoverHighlightRange(state, 'text/javascript', doc.indexOf('[')),\n {containsSideEffects: true, from: 0, to: doc.length},\n );\n assert.deepInclude(\n computePopoverHighlightRange(state, 'text/javascript', doc.indexOf(']')),\n {containsSideEffects: true, from: 0, to: doc.length},\n );\n });\n\n it('correctly reports prefix increments in property accesses as potentially side-effecting', () => {\n const doc = 'array[++index]';\n const state = CodeMirror.EditorState.create({doc, extensions});\n\n assert.deepInclude(\n computePopoverHighlightRange(state, 'text/javascript', doc.indexOf('[')),\n {containsSideEffects: true, from: 0, to: doc.length},\n );\n assert.deepInclude(\n computePopoverHighlightRange(state, 'text/javascript', doc.indexOf(']')),\n {containsSideEffects: true, from: 0, to: doc.length},\n );\n });\n\n it('correctly reports prefix decrements in property accesses as potentially side-effecting', () => {\n const doc = 'array[--index]';\n const state = CodeMirror.EditorState.create({doc, extensions});\n\n assert.deepInclude(\n computePopoverHighlightRange(state, 'text/javascript', doc.indexOf('[')),\n {containsSideEffects: true, from: 0, to: doc.length},\n );\n assert.deepInclude(\n computePopoverHighlightRange(state, 'text/javascript', doc.indexOf(']')),\n {containsSideEffects: true, from: 0, to: doc.length},\n );\n });\n\n it('correctly reports assignment expressions in property accesses as potentially side-effecting', () => {\n const doc = 'array[index *= 5]';\n const state = CodeMirror.EditorState.create({doc, extensions});\n\n assert.deepInclude(\n computePopoverHighlightRange(state, 'text/javascript', doc.indexOf('[')),\n {containsSideEffects: true, from: 0, to: doc.length},\n );\n assert.deepInclude(\n computePopoverHighlightRange(state, 'text/javascript', doc.indexOf(']')),\n {containsSideEffects: true, from: 0, to: doc.length},\n );\n });\n\n it('correctly reports potential side-effects within a larger script', () => {\n const doc = `var a = new Array();\nvar i = 0;\na[i++];\na[i--];\na[++i];\na[--i];\na[i *= 5];\na[foo()];`;\n const state = CodeMirror.EditorState.create({doc, extensions});\n\n for (let offset = 0; (offset = doc.indexOf('a[', offset) + 1) !== 0;) {\n assert.deepInclude(\n computePopoverHighlightRange(state, 'text/javascript', offset),\n {containsSideEffects: true},\n );\n }\n });\n });\n\n describe('in HTML files', () => {\n it('correctly returns highlight range for variables in inline `;\n const extensions = [CodeMirror.html.html()];\n const state = CodeMirror.EditorState.create({doc, extensions});\n for (const name of ['bar', 'baz']) {\n const from = doc.indexOf(name);\n const to = from + name.length;\n assert.deepInclude(\n computePopoverHighlightRange(state, 'text/html', from),\n {from, to},\n `did not correct highlight '${name}'`,\n );\n }\n });\n\n it('correctly returns highlight range for variables in inline event handlers', () => {\n const doc = `\n`;\n const extensions = [CodeMirror.html.html()];\n const state = CodeMirror.EditorState.create({doc, extensions});\n for (const name of ['foo', 'bar', 'baz']) {\n const from = doc.indexOf(name);\n const to = from + name.length;\n assert.deepInclude(\n computePopoverHighlightRange(state, 'text/html', from),\n {from, to},\n `did not correct highlight '${name}'`,\n );\n }\n });\n });\n\n describe('in TSX files', () => {\n it('correctly returns highlight range for field accesses', () => {\n const doc = `function foo(obj: any): number {\n return obj.x + obj.y;\n}`;\n const extensions = [CodeMirror.javascript.tsxLanguage];\n const state = CodeMirror.EditorState.create({doc, extensions});\n for (const name of ['x', 'y']) {\n const pos = doc.lastIndexOf(name);\n const from = pos - 4;\n const to = pos + name.length;\n assert.deepInclude(\n computePopoverHighlightRange(state, 'text/typescript-jsx', pos),\n {from, to},\n `did not correct highlight '${name}'`,\n );\n }\n });\n });\n });\n});\n"]} \ No newline at end of file diff --git a/public/panels/sources/NavigatorView.test.js b/public/panels/sources/NavigatorView.test.js index d24bad866..5cd71af94 100644 --- a/public/panels/sources/NavigatorView.test.js +++ b/public/panels/sources/NavigatorView.test.js @@ -60,11 +60,11 @@ describeWithMockConnection('NavigatorView', () => { const { project } = addResourceAndUISourceCode(url, childFrame, '', 'text/html'); const navigatorView = Sources.SourcesNavigator.NetworkNavigatorView.instance({ forceNew: true }); const children = navigatorView.scriptsTree.rootElement().children(); - assert.strictEqual(children.length, 1, 'The NavigatorView root node should have 1 child before node removal'); + assert.lengthOf(children, 1, 'The NavigatorView root node should have 1 child before node removal'); assert.strictEqual(children[0].title, 'top'); // Remove leaf node and assert that node removal propagates up to the root node. project.removeUISourceCode(url); - assert.strictEqual(navigatorView.scriptsTree.rootElement().children().length, 0, 'The NavigarorView root node should not have any children after node removal'); + assert.lengthOf(navigatorView.scriptsTree.rootElement().children(), 0, 'The NavigarorView root node should not have any children after node removal'); }); describe('domain node display name', () => { it('should use the project origin if the url matches the default context', async () => { diff --git a/public/panels/sources/NavigatorView.test.js.map b/public/panels/sources/NavigatorView.test.js.map index e440b4626..391e1f5cd 100644 --- a/public/panels/sources/NavigatorView.test.js.map +++ b/public/panels/sources/NavigatorView.test.js.map @@ -1 +1 @@ -{"version":3,"file":"NavigatorView.test.js","sourceRoot":"","sources":["../../../../../../front_end/panels/sources/NavigatorView.test.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,KAAK,MAAM,MAAM,6BAA6B,CAAC;AAEtD,OAAO,KAAK,IAAI,MAAM,yBAAyB,CAAC;AAEhD,OAAO,KAAK,QAAQ,MAAM,mCAAmC,CAAC;AAC9D,OAAO,KAAK,WAAW,MAAM,yCAAyC,CAAC;AACvE,OAAO,KAAK,WAAW,MAAM,yCAAyC,CAAC;AACvE,OAAO,KAAK,SAAS,MAAM,uCAAuC,CAAC;AACnE,OAAO,KAAK,SAAS,MAAM,qCAAqC,CAAC;AACjE,OAAO,EAAC,YAAY,EAAC,MAAM,qCAAqC,CAAC;AACjE,OAAO,EACL,0BAA0B,EAC1B,aAAa,EACb,gCAAgC,GACjC,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAC,aAAa,EAAE,cAAc,EAAE,YAAY,EAAE,mBAAmB,EAAC,MAAM,sCAAsC,CAAC;AACtH,OAAO,KAAK,EAAE,MAAM,2BAA2B,CAAC;AAEhD,OAAO,KAAK,OAAO,MAAM,cAAc,CAAC;AAExC,0BAA0B,CAAC,eAAe,EAAE,GAAG,EAAE;IAC/C,IAAI,MAAyB,CAAC;IAC9B,IAAI,SAA4C,CAAC;IAEjD,UAAU,CAAC,GAAG,EAAE;QACd,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,QAAQ,4FAAyD,EAAE,CAAC,CAAC;QAC9F,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,QAAQ,gEAA2C,EAAE,CAAC,CAAC;QAEhF,mBAAmB,CAAC,KAAK,CAAC,CAAC;QAC3B,gCAAgC,CAAC,sBAAsB,EAAE,KAAK,IAAI,EAAE;YAClE,OAAO;gBACL,SAAS,EAAE,IAAI;aAChB,CAA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AC;YAC3C,MAAM,CAAC,QAAQ,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC;YAC7B,MAAM,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,KAAK,EAAE,aAAa,CAAC,CAAC;QACvD,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,mDAAmD,EAAE,KAAK,IAAI,EAAE;YACjE,MAAM,SAAS,GAAG,MAAM,YAAY,CAAC,MAAM,CAAC,CAAC;YAE7C,MAAM,GAAG,GAAG,WAA8C,CAAC;YAC3D,0BAA0B,CAAC,GAAG,EAAE,SAAS,EAAE,EAAE,EAAE,WAAW,CAAC,CAAC;YAE5D,MAAM,aAAa,GAAG,OAAO,CAAC,gBAAgB,CAAC,oBAAoB,CAAC,QAAQ,CAAC,EAAC,QAAQ,EAAE,IAAI,EAAC,CAAC,CAAC;YAC/F,MAAM,WAAW,GAAG,aAAa,CAAC,WAAW,CAAC,WAAW,EAAE,CAAC,QAAQ,EAAE,CAAC;YACvE,MAAM,CAAC,QAAQ,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC;YAChC,MAAM,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;YAEhD,MAAM,QAAQ,GAAG,WAAW,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC;YAC3C,MAAM,CAAC,QAAQ,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC;YAC7B,MAAM,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,KAAK,EAAE,aAAa,CAAC,CAAC;QACvD,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["// Copyright 2023 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport * as Common from '../../core/common/common.js';\nimport type * as Platform from '../../core/platform/platform.js';\nimport * as Root from '../../core/root/root.js';\nimport type * as SDK from '../../core/sdk/sdk.js';\nimport * as Bindings from '../../models/bindings/bindings.js';\nimport * as Breakpoints from '../../models/breakpoints/breakpoints.js';\nimport * as Persistence from '../../models/persistence/persistence.js';\nimport * as TextUtils from '../../models/text_utils/text_utils.js';\nimport * as Workspace from '../../models/workspace/workspace.js';\nimport {createTarget} from '../../testing/EnvironmentHelpers.js';\nimport {\n describeWithMockConnection,\n dispatchEvent,\n setMockConnectionResponseHandler,\n} from '../../testing/MockConnection.js';\nimport {addChildFrame, createResource, getMainFrame, setMockResourceTree} from '../../testing/ResourceTreeHelpers.js';\nimport * as UI from '../../ui/legacy/legacy.js';\n\nimport * as Sources from './sources.js';\n\ndescribeWithMockConnection('NavigatorView', () => {\n let target: SDK.Target.Target;\n let workspace: Workspace.Workspace.WorkspaceImpl;\n\n beforeEach(() => {\n Root.Runtime.experiments.register(Root.Runtime.ExperimentName.AUTHORED_DEPLOYED_GROUPING, '');\n Root.Runtime.experiments.register(Root.Runtime.ExperimentName.JUST_MY_CODE, '');\n\n setMockResourceTree(false);\n setMockConnectionResponseHandler('Page.getResourceTree', async () => {\n return {\n frameTree: null,\n };\n });\n\n const actionRegistryInstance = UI.ActionRegistry.ActionRegistry.instance({forceNew: true});\n UI.ShortcutRegistry.ShortcutRegistry.instance({forceNew: true, actionRegistry: actionRegistryInstance});\n target = createTarget();\n const targetManager = target.targetManager();\n targetManager.setScopeTarget(target);\n workspace = Workspace.Workspace.WorkspaceImpl.instance();\n const resourceMapping = new Bindings.ResourceMapping.ResourceMapping(targetManager, workspace);\n Bindings.CSSWorkspaceBinding.CSSWorkspaceBinding.instance({forceNew: true, resourceMapping, targetManager});\n const debuggerWorkspaceBinding = Bindings.DebuggerWorkspaceBinding.DebuggerWorkspaceBinding.instance({\n forceNew: true,\n resourceMapping,\n targetManager,\n });\n Bindings.IgnoreListManager.IgnoreListManager.instance({forceNew: true, debuggerWorkspaceBinding});\n const breakpointManager = Breakpoints.BreakpointManager.BreakpointManager.instance(\n {forceNew: true, targetManager, workspace, debuggerWorkspaceBinding});\n Persistence.Persistence.PersistenceImpl.instance({forceNew: true, workspace, breakpointManager});\n Persistence.NetworkPersistenceManager.NetworkPersistenceManager.instance({forceNew: true, workspace});\n });\n\n function addResourceAndUISourceCode(\n url: Platform.DevToolsPath.UrlString, frame: SDK.ResourceTreeModel.ResourceTreeFrame, content: string,\n mimeType: string) {\n createResource(frame, url, 'text/html', content);\n const uiSourceCode = workspace.uiSourceCodeForURL(url) as Workspace.UISourceCode.UISourceCode;\n\n const projectType = Workspace.Workspace.projectTypes.Network;\n const project = new Bindings.ContentProviderBasedProject.ContentProviderBasedProject(\n workspace, 'PROJECT_ID', projectType, 'Test project', false /* isServiceProject*/);\n Bindings.NetworkProject.NetworkProject.setTargetForProject(project, target);\n const contentProvider = TextUtils.StaticContentProvider.StaticContentProvider.fromString(\n url, Common.ResourceType.ResourceType.fromMimeType(mimeType), content);\n const metadata = new Workspace.UISourceCode.UISourceCodeMetadata(null, null);\n project.addUISourceCodeWithProvider(uiSourceCode, contentProvider, metadata, mimeType);\n return {project};\n }\n\n it('can discard multiple childless frames', async () => {\n const url = 'http://example.com/index.html' as Platform.DevToolsPath.UrlString;\n\n const childFrame = await addChildFrame(target);\n const {project} = addResourceAndUISourceCode(url, childFrame, '', 'text/html');\n\n const navigatorView = Sources.SourcesNavigator.NetworkNavigatorView.instance({forceNew: true});\n const children = navigatorView.scriptsTree.rootElement().children();\n assert.strictEqual(children.length, 1, 'The NavigatorView root node should have 1 child before node removal');\n assert.strictEqual(children[0].title, 'top');\n\n // Remove leaf node and assert that node removal propagates up to the root node.\n project.removeUISourceCode(url);\n assert.strictEqual(\n navigatorView.scriptsTree.rootElement().children().length, 0,\n 'The NavigarorView root node should not have any children after node removal');\n });\n\n describe('domain node display name', () => {\n it('should use the project origin if the url matches the default context', async () => {\n const mainFrame = await getMainFrame(target);\n\n const url = 'http://example.com/index.html' as Platform.DevToolsPath.UrlString;\n addResourceAndUISourceCode(url, mainFrame, '', 'text/html');\n\n dispatchEvent(target, 'Runtime.executionContextCreated', {\n context: {\n id: 1,\n origin: 'http://example.com',\n name: 'Main Context',\n uniqueId: 'main_context',\n auxData: {\n isDefault: true,\n type: 'default',\n frameId: mainFrame.id,\n },\n },\n });\n dispatchEvent(target, 'Runtime.executionContextCreated', {\n context: {\n id: 2,\n origin: 'chrome-extension://ahfhijdlegdabablpippeagghigmibma',\n name: 'Extension Context',\n uniqueId: 'extension_context',\n auxData: {\n isDefault: false,\n type: 'isolated',\n frameId: mainFrame.id,\n },\n },\n });\n\n const navigatorView = Sources.SourcesNavigator.NetworkNavigatorView.instance({forceNew: true});\n const topChildren = navigatorView.scriptsTree.rootElement().children();\n assert.lengthOf(topChildren, 1);\n assert.strictEqual(topChildren[0].title, 'top');\n\n const children = topChildren[0].children();\n assert.lengthOf(children, 1);\n assert.strictEqual(children[0].title, 'example.com');\n });\n\n it('should use a matching context name if the url does not match the default context', async () => {\n const mainFrame = await getMainFrame(target);\n\n const url = 'chrome-extension://ahfhijdlegdabablpippeagghigmibma/script.js' as Platform.DevToolsPath.UrlString;\n addResourceAndUISourceCode(url, mainFrame, '', 'text/html');\n\n dispatchEvent(target, 'Runtime.executionContextCreated', {\n context: {\n id: 1,\n origin: 'http://example.com',\n name: 'Main Context',\n uniqueId: 'main_context',\n auxData: {\n isDefault: true,\n type: 'default',\n frameId: mainFrame.id,\n },\n },\n });\n dispatchEvent(target, 'Runtime.executionContextCreated', {\n context: {\n id: 2,\n origin: 'chrome-extension://ahfhijdlegdabablpippeagghigmibma',\n name: 'Extension Context',\n uniqueId: 'extension_context',\n auxData: {\n isDefault: false,\n type: 'isolated',\n frameId: mainFrame.id,\n },\n },\n });\n\n const navigatorView = Sources.SourcesNavigator.NetworkNavigatorView.instance({forceNew: true});\n const topChildren = navigatorView.scriptsTree.rootElement().children();\n assert.lengthOf(topChildren, 1);\n assert.strictEqual(topChildren[0].title, 'top');\n\n const children = topChildren[0].children();\n assert.lengthOf(children, 1);\n assert.strictEqual(children[0].title, 'Extension Context');\n });\n\n it('should prioritize the default context', async () => {\n const mainFrame = await getMainFrame(target);\n\n const url = 'http://example.com/index.html' as Platform.DevToolsPath.UrlString;\n addResourceAndUISourceCode(url, mainFrame, '', 'text/html');\n\n dispatchEvent(target, 'Runtime.executionContextCreated', {\n context: {\n id: 1,\n origin: 'http://example.com',\n name: 'Other Context',\n uniqueId: 'other_context',\n auxData: {\n isDefault: false,\n type: 'isolated',\n frameId: mainFrame.id,\n },\n },\n });\n\n // Default context comes last, but this should still indicate that the\n // project origin should be used as the display name.\n dispatchEvent(target, 'Runtime.executionContextCreated', {\n context: {\n id: 2,\n origin: 'http://example.com',\n name: 'Main Context',\n uniqueId: 'main_context',\n auxData: {\n isDefault: true,\n type: 'default',\n frameId: mainFrame.id,\n },\n },\n });\n\n const navigatorView = Sources.SourcesNavigator.NetworkNavigatorView.instance({forceNew: true});\n const topChildren = navigatorView.scriptsTree.rootElement().children();\n assert.lengthOf(topChildren, 1);\n assert.strictEqual(topChildren[0].title, 'top');\n\n const children = topChildren[0].children();\n assert.lengthOf(children, 1);\n assert.strictEqual(children[0].title, 'example.com');\n });\n\n it('should ignore contexts with no name', async () => {\n const mainFrame = await getMainFrame(target);\n\n const url = 'http://example.com/index.html' as Platform.DevToolsPath.UrlString;\n addResourceAndUISourceCode(url, mainFrame, '', 'text/html');\n\n dispatchEvent(target, 'Runtime.executionContextCreated', {\n context: {\n id: 1,\n origin: 'http://example.com',\n name: '',\n uniqueId: 'no_name_context',\n auxData: {\n isDefault: false,\n type: 'isolated',\n frameId: mainFrame.id,\n },\n },\n });\n\n const navigatorView = Sources.SourcesNavigator.NetworkNavigatorView.instance({forceNew: true});\n const topChildren = navigatorView.scriptsTree.rootElement().children();\n assert.lengthOf(topChildren, 1);\n assert.strictEqual(topChildren[0].title, 'top');\n\n const children = topChildren[0].children();\n assert.lengthOf(children, 1);\n assert.strictEqual(children[0].title, 'example.com');\n });\n\n it('should indicate if a display name cannot be found', async () => {\n const mainFrame = await getMainFrame(target);\n\n const url = '*bad url*' as Platform.DevToolsPath.UrlString;\n addResourceAndUISourceCode(url, mainFrame, '', 'text/html');\n\n const navigatorView = Sources.SourcesNavigator.NetworkNavigatorView.instance({forceNew: true});\n const topChildren = navigatorView.scriptsTree.rootElement().children();\n assert.lengthOf(topChildren, 1);\n assert.strictEqual(topChildren[0].title, 'top');\n\n const children = topChildren[0].children();\n assert.lengthOf(children, 1);\n assert.strictEqual(children[0].title, '(no domain)');\n });\n });\n});\n"]} \ No newline at end of file +{"version":3,"file":"NavigatorView.test.js","sourceRoot":"","sources":["../../../../../../front_end/panels/sources/NavigatorView.test.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,KAAK,MAAM,MAAM,6BAA6B,CAAC;AAEtD,OAAO,KAAK,IAAI,MAAM,yBAAyB,CAAC;AAEhD,OAAO,KAAK,QAAQ,MAAM,mCAAmC,CAAC;AAC9D,OAAO,KAAK,WAAW,MAAM,yCAAyC,CAAC;AACvE,OAAO,KAAK,WAAW,MAAM,yCAAyC,CAAC;AACvE,OAAO,KAAK,SAAS,MAAM,uCAAuC,CAAC;AACnE,OAAO,KAAK,SAAS,MAAM,qCAAqC,CAAC;AACjE,OAAO,EAAC,YAAY,EAAC,MAAM,qCAAqC,CAAC;AACjE,OAAO,EACL,0BAA0B,EAC1B,aAAa,EACb,gCAAgC,GACjC,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAC,aAAa,EAAE,cAAc,EAAE,YAAY,EAAE,mBAAmB,EAAC,MAAM,sCAAsC,CAAC;AACtH,OAAO,KAAK,EAAE,MAAM,2BAA2B,CAAC;AAEhD,OAAO,KAAK,OAAO,MAAM,cAAc,CAAC;AAExC,0BAA0B,CAAC,eAAe,EAAE,GAAG,EAAE;IAC/C,IAAI,MAAyB,CAAC;IAC9B,IAAI,SAA4C,CAAC;IAEjD,UAAU,CAAC,GAAG,EAA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AC,CAAC,KAAK,EAAE,aAAa,CAAC,CAAC;QACvD,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["// Copyright 2023 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport * as Common from '../../core/common/common.js';\nimport type * as Platform from '../../core/platform/platform.js';\nimport * as Root from '../../core/root/root.js';\nimport type * as SDK from '../../core/sdk/sdk.js';\nimport * as Bindings from '../../models/bindings/bindings.js';\nimport * as Breakpoints from '../../models/breakpoints/breakpoints.js';\nimport * as Persistence from '../../models/persistence/persistence.js';\nimport * as TextUtils from '../../models/text_utils/text_utils.js';\nimport * as Workspace from '../../models/workspace/workspace.js';\nimport {createTarget} from '../../testing/EnvironmentHelpers.js';\nimport {\n describeWithMockConnection,\n dispatchEvent,\n setMockConnectionResponseHandler,\n} from '../../testing/MockConnection.js';\nimport {addChildFrame, createResource, getMainFrame, setMockResourceTree} from '../../testing/ResourceTreeHelpers.js';\nimport * as UI from '../../ui/legacy/legacy.js';\n\nimport * as Sources from './sources.js';\n\ndescribeWithMockConnection('NavigatorView', () => {\n let target: SDK.Target.Target;\n let workspace: Workspace.Workspace.WorkspaceImpl;\n\n beforeEach(() => {\n Root.Runtime.experiments.register(Root.Runtime.ExperimentName.AUTHORED_DEPLOYED_GROUPING, '');\n Root.Runtime.experiments.register(Root.Runtime.ExperimentName.JUST_MY_CODE, '');\n\n setMockResourceTree(false);\n setMockConnectionResponseHandler('Page.getResourceTree', async () => {\n return {\n frameTree: null,\n };\n });\n\n const actionRegistryInstance = UI.ActionRegistry.ActionRegistry.instance({forceNew: true});\n UI.ShortcutRegistry.ShortcutRegistry.instance({forceNew: true, actionRegistry: actionRegistryInstance});\n target = createTarget();\n const targetManager = target.targetManager();\n targetManager.setScopeTarget(target);\n workspace = Workspace.Workspace.WorkspaceImpl.instance();\n const resourceMapping = new Bindings.ResourceMapping.ResourceMapping(targetManager, workspace);\n Bindings.CSSWorkspaceBinding.CSSWorkspaceBinding.instance({forceNew: true, resourceMapping, targetManager});\n const debuggerWorkspaceBinding = Bindings.DebuggerWorkspaceBinding.DebuggerWorkspaceBinding.instance({\n forceNew: true,\n resourceMapping,\n targetManager,\n });\n Bindings.IgnoreListManager.IgnoreListManager.instance({forceNew: true, debuggerWorkspaceBinding});\n const breakpointManager = Breakpoints.BreakpointManager.BreakpointManager.instance(\n {forceNew: true, targetManager, workspace, debuggerWorkspaceBinding});\n Persistence.Persistence.PersistenceImpl.instance({forceNew: true, workspace, breakpointManager});\n Persistence.NetworkPersistenceManager.NetworkPersistenceManager.instance({forceNew: true, workspace});\n });\n\n function addResourceAndUISourceCode(\n url: Platform.DevToolsPath.UrlString, frame: SDK.ResourceTreeModel.ResourceTreeFrame, content: string,\n mimeType: string) {\n createResource(frame, url, 'text/html', content);\n const uiSourceCode = workspace.uiSourceCodeForURL(url) as Workspace.UISourceCode.UISourceCode;\n\n const projectType = Workspace.Workspace.projectTypes.Network;\n const project = new Bindings.ContentProviderBasedProject.ContentProviderBasedProject(\n workspace, 'PROJECT_ID', projectType, 'Test project', false /* isServiceProject*/);\n Bindings.NetworkProject.NetworkProject.setTargetForProject(project, target);\n const contentProvider = TextUtils.StaticContentProvider.StaticContentProvider.fromString(\n url, Common.ResourceType.ResourceType.fromMimeType(mimeType), content);\n const metadata = new Workspace.UISourceCode.UISourceCodeMetadata(null, null);\n project.addUISourceCodeWithProvider(uiSourceCode, contentProvider, metadata, mimeType);\n return {project};\n }\n\n it('can discard multiple childless frames', async () => {\n const url = 'http://example.com/index.html' as Platform.DevToolsPath.UrlString;\n\n const childFrame = await addChildFrame(target);\n const {project} = addResourceAndUISourceCode(url, childFrame, '', 'text/html');\n\n const navigatorView = Sources.SourcesNavigator.NetworkNavigatorView.instance({forceNew: true});\n const children = navigatorView.scriptsTree.rootElement().children();\n assert.lengthOf(children, 1, 'The NavigatorView root node should have 1 child before node removal');\n assert.strictEqual(children[0].title, 'top');\n\n // Remove leaf node and assert that node removal propagates up to the root node.\n project.removeUISourceCode(url);\n assert.lengthOf(\n navigatorView.scriptsTree.rootElement().children(), 0,\n 'The NavigarorView root node should not have any children after node removal');\n });\n\n describe('domain node display name', () => {\n it('should use the project origin if the url matches the default context', async () => {\n const mainFrame = await getMainFrame(target);\n\n const url = 'http://example.com/index.html' as Platform.DevToolsPath.UrlString;\n addResourceAndUISourceCode(url, mainFrame, '', 'text/html');\n\n dispatchEvent(target, 'Runtime.executionContextCreated', {\n context: {\n id: 1,\n origin: 'http://example.com',\n name: 'Main Context',\n uniqueId: 'main_context',\n auxData: {\n isDefault: true,\n type: 'default',\n frameId: mainFrame.id,\n },\n },\n });\n dispatchEvent(target, 'Runtime.executionContextCreated', {\n context: {\n id: 2,\n origin: 'chrome-extension://ahfhijdlegdabablpippeagghigmibma',\n name: 'Extension Context',\n uniqueId: 'extension_context',\n auxData: {\n isDefault: false,\n type: 'isolated',\n frameId: mainFrame.id,\n },\n },\n });\n\n const navigatorView = Sources.SourcesNavigator.NetworkNavigatorView.instance({forceNew: true});\n const topChildren = navigatorView.scriptsTree.rootElement().children();\n assert.lengthOf(topChildren, 1);\n assert.strictEqual(topChildren[0].title, 'top');\n\n const children = topChildren[0].children();\n assert.lengthOf(children, 1);\n assert.strictEqual(children[0].title, 'example.com');\n });\n\n it('should use a matching context name if the url does not match the default context', async () => {\n const mainFrame = await getMainFrame(target);\n\n const url = 'chrome-extension://ahfhijdlegdabablpippeagghigmibma/script.js' as Platform.DevToolsPath.UrlString;\n addResourceAndUISourceCode(url, mainFrame, '', 'text/html');\n\n dispatchEvent(target, 'Runtime.executionContextCreated', {\n context: {\n id: 1,\n origin: 'http://example.com',\n name: 'Main Context',\n uniqueId: 'main_context',\n auxData: {\n isDefault: true,\n type: 'default',\n frameId: mainFrame.id,\n },\n },\n });\n dispatchEvent(target, 'Runtime.executionContextCreated', {\n context: {\n id: 2,\n origin: 'chrome-extension://ahfhijdlegdabablpippeagghigmibma',\n name: 'Extension Context',\n uniqueId: 'extension_context',\n auxData: {\n isDefault: false,\n type: 'isolated',\n frameId: mainFrame.id,\n },\n },\n });\n\n const navigatorView = Sources.SourcesNavigator.NetworkNavigatorView.instance({forceNew: true});\n const topChildren = navigatorView.scriptsTree.rootElement().children();\n assert.lengthOf(topChildren, 1);\n assert.strictEqual(topChildren[0].title, 'top');\n\n const children = topChildren[0].children();\n assert.lengthOf(children, 1);\n assert.strictEqual(children[0].title, 'Extension Context');\n });\n\n it('should prioritize the default context', async () => {\n const mainFrame = await getMainFrame(target);\n\n const url = 'http://example.com/index.html' as Platform.DevToolsPath.UrlString;\n addResourceAndUISourceCode(url, mainFrame, '', 'text/html');\n\n dispatchEvent(target, 'Runtime.executionContextCreated', {\n context: {\n id: 1,\n origin: 'http://example.com',\n name: 'Other Context',\n uniqueId: 'other_context',\n auxData: {\n isDefault: false,\n type: 'isolated',\n frameId: mainFrame.id,\n },\n },\n });\n\n // Default context comes last, but this should still indicate that the\n // project origin should be used as the display name.\n dispatchEvent(target, 'Runtime.executionContextCreated', {\n context: {\n id: 2,\n origin: 'http://example.com',\n name: 'Main Context',\n uniqueId: 'main_context',\n auxData: {\n isDefault: true,\n type: 'default',\n frameId: mainFrame.id,\n },\n },\n });\n\n const navigatorView = Sources.SourcesNavigator.NetworkNavigatorView.instance({forceNew: true});\n const topChildren = navigatorView.scriptsTree.rootElement().children();\n assert.lengthOf(topChildren, 1);\n assert.strictEqual(topChildren[0].title, 'top');\n\n const children = topChildren[0].children();\n assert.lengthOf(children, 1);\n assert.strictEqual(children[0].title, 'example.com');\n });\n\n it('should ignore contexts with no name', async () => {\n const mainFrame = await getMainFrame(target);\n\n const url = 'http://example.com/index.html' as Platform.DevToolsPath.UrlString;\n addResourceAndUISourceCode(url, mainFrame, '', 'text/html');\n\n dispatchEvent(target, 'Runtime.executionContextCreated', {\n context: {\n id: 1,\n origin: 'http://example.com',\n name: '',\n uniqueId: 'no_name_context',\n auxData: {\n isDefault: false,\n type: 'isolated',\n frameId: mainFrame.id,\n },\n },\n });\n\n const navigatorView = Sources.SourcesNavigator.NetworkNavigatorView.instance({forceNew: true});\n const topChildren = navigatorView.scriptsTree.rootElement().children();\n assert.lengthOf(topChildren, 1);\n assert.strictEqual(topChildren[0].title, 'top');\n\n const children = topChildren[0].children();\n assert.lengthOf(children, 1);\n assert.strictEqual(children[0].title, 'example.com');\n });\n\n it('should indicate if a display name cannot be found', async () => {\n const mainFrame = await getMainFrame(target);\n\n const url = '*bad url*' as Platform.DevToolsPath.UrlString;\n addResourceAndUISourceCode(url, mainFrame, '', 'text/html');\n\n const navigatorView = Sources.SourcesNavigator.NetworkNavigatorView.instance({forceNew: true});\n const topChildren = navigatorView.scriptsTree.rootElement().children();\n assert.lengthOf(topChildren, 1);\n assert.strictEqual(topChildren[0].title, 'top');\n\n const children = topChildren[0].children();\n assert.lengthOf(children, 1);\n assert.strictEqual(children[0].title, '(no domain)');\n });\n });\n});\n"]} \ No newline at end of file diff --git a/public/panels/sources/OutlineQuickOpen.js.map b/public/panels/sources/OutlineQuickOpen.js.map index 54ba6c86f..7a9f90361 100644 --- a/public/panels/sources/OutlineQuickOpen.js.map +++ b/public/panels/sources/OutlineQuickOpen.js.map @@ -1 +1 @@ -{"version":3,"file":"OutlineQuickOpen.js","sourceRoot":"","sources":["../../../../../../front_end/panels/sources/OutlineQuickOpen.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,KAAK,IAAI,MAAM,yBAAyB,CAAC;AAChD,OAAO,KAAK,UAAU,MAAM,sDAAsD,CAAC;AACnF,OAAO,KAAK,SAAS,MAAM,qDAAqD,CAAC;AACjF,OAAO,KAAK,EAAE,MAAM,2BAA2B,CAAC;AAEhD,OAAO,EAAC,WAAW,EAAC,MAAM,kBAAkB,CAAC;AAG7C,MAAM,SAAS,GAAG;IAChB;;OAEG;IACH,cAAc,EAAE,mBAAmB;IACnC;;OAEG;IACH,6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I,CAAC,kBAAkB,EAAE,CAAC;QAC9C,IAAI,CAAC,WAAW,EAAE,CAAC;YACjB,OAAO;QACT,CAAC;QACD,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;QACnC,WAAW,CAAC,cAAc,CAAC,EAAC,UAAU,EAAE,IAAI,CAAC,UAAU,EAAE,YAAY,EAAE,IAAI,CAAC,YAAY,EAAC,EAAE,IAAI,CAAC,CAAC;IACnG,CAAC;IAEO,kBAAkB;QACxB,MAAM,WAAW,GAAG,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;QACtE,OAAO,WAAW,IAAI,WAAW,CAAC,kBAAkB,EAAE,CAAC;IACzD,CAAC;IAEQ,YAAY;QACnB,IAAI,CAAC,IAAI,CAAC,kBAAkB,EAAE,EAAE,CAAC;YAC/B,OAAO,UAAU,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC;QAC9C,CAAC;QACD,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC;YACjB,OAAO,UAAU,CAAC,SAAS,CAAC,6BAA6B,CAAC,CAAC;QAC7D,CAAC;QACD,OAAO,UAAU,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC;IAC9C,CAAC;CACF","sourcesContent":["// Copyright 2017 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport * as i18n from '../../core/i18n/i18n.js';\nimport * as CodeMirror from '../../third_party/codemirror.next/codemirror.next.js';\nimport * as QuickOpen from '../../ui/legacy/components/quick_open/quick_open.js';\nimport * as UI from '../../ui/legacy/legacy.js';\n\nimport {SourcesView} from './SourcesView.js';\nimport type {UISourceCodeFrame} from './UISourceCodeFrame.js';\n\nconst UIStrings = {\n /**\n *@description Text in Go To Line Quick Open of the Sources panel\n */\n noFileSelected: 'No file selected.',\n /**\n *@description Text in Outline Quick Open of the Sources panel\n */\n openAJavascriptOrCssFileToSee: 'Open a JavaScript or CSS file to see symbols',\n /**\n *@description Text to show no results have been found\n */\n noResultsFound: 'No results found',\n};\nconst str_ = i18n.i18n.registerUIStrings('panels/sources/OutlineQuickOpen.ts', UIStrings);\nconst i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);\n\nexport type OutlineItem = {\n title: string,\n lineNumber: number,\n columnNumber: number,\n subtitle?: string,\n};\n\nexport function outline(state: CodeMirror.EditorState): OutlineItem[] {\n function toLineColumn(offset: number): {lineNumber: number, columnNumber: number} {\n offset = Math.max(0, Math.min(offset, state.doc.length));\n const line = state.doc.lineAt(offset);\n return {lineNumber: line.number - 1, columnNumber: offset - line.from};\n }\n\n function subtitleFromParamList(): string {\n while (cursor.name !== 'ParamList' && cursor.nextSibling()) {\n }\n let parameters = '';\n if (cursor.name === 'ParamList' && cursor.firstChild()) {\n do {\n switch (cursor.name as string) {\n case 'ArrayPattern':\n parameters += '[‥]';\n break;\n case 'ObjectPattern':\n parameters += '{‥}';\n break;\n case 'VariableDefinition':\n parameters += state.sliceDoc(cursor.from, cursor.to);\n break;\n case 'Spread':\n parameters += '...';\n break;\n case ',':\n parameters += ', ';\n break;\n }\n } while (cursor.nextSibling());\n }\n return `(${parameters})`;\n }\n\n const tree = CodeMirror.syntaxTree(state);\n const items: OutlineItem[] = [];\n const cursor = tree.cursor();\n do {\n switch (cursor.name) {\n // css.grammar\n case 'RuleSet': {\n for (cursor.firstChild();; cursor.nextSibling()) {\n const title = state.sliceDoc(cursor.from, cursor.to);\n const {lineNumber, columnNumber} = toLineColumn(cursor.from);\n items.push({title, lineNumber, columnNumber});\n cursor.nextSibling();\n if (cursor.name as string !== ',') {\n break;\n }\n }\n break;\n }\n // javascript.grammar\n case 'FunctionDeclaration':\n case 'MethodDeclaration': {\n let prefix = '';\n cursor.firstChild();\n do {\n switch (cursor.name as string) {\n case 'abstract':\n case 'async':\n case 'get':\n case 'set':\n case 'static':\n prefix = `${prefix}${cursor.name} `;\n break;\n case 'Star':\n prefix += '*';\n break;\n case 'PropertyDefinition':\n case 'PrivatePropertyDefinition':\n case 'VariableDefinition': {\n const title = prefix + state.sliceDoc(cursor.from, cursor.to);\n const {lineNumber, columnNumber} = toLineColumn(cursor.from);\n const subtitle = subtitleFromParamList();\n items.push({title, subtitle, lineNumber, columnNumber});\n break;\n }\n }\n } while (cursor.nextSibling());\n break;\n }\n case 'Property': {\n let prefix = '';\n cursor.firstChild();\n do {\n if (cursor.name as string === 'async' || cursor.name as string === 'get' || cursor.name as string === 'set') {\n prefix = `${prefix}${cursor.name} `;\n } else if (cursor.name as string === 'Star') {\n prefix += '*';\n } else if (cursor.name as string === 'PropertyDefinition') {\n let title = state.sliceDoc(cursor.from, cursor.to);\n const {lineNumber, columnNumber} = toLineColumn(cursor.from);\n while (cursor.nextSibling()) {\n if (cursor.name as string === 'ClassExpression') {\n title = `class ${title}`;\n items.push({title, lineNumber, columnNumber});\n break;\n }\n if (cursor.name as string === 'ArrowFunction' || cursor.name as string === 'FunctionExpression') {\n cursor.firstChild();\n }\n if (cursor.name as string === 'async') {\n prefix = `async ${prefix}`;\n } else if (cursor.name as string === 'Star') {\n prefix += '*';\n } else if (cursor.name as string === 'ParamList') {\n title = prefix + title;\n const subtitle = subtitleFromParamList();\n items.push({title, subtitle, lineNumber, columnNumber});\n break;\n }\n }\n break;\n } else {\n // We don't support any other Property syntax.\n break;\n }\n } while (cursor.nextSibling());\n break;\n }\n case 'PropertyName':\n case 'VariableDefinition': {\n if (cursor.matchContext(['ClassDeclaration'])) {\n const title = 'class ' + state.sliceDoc(cursor.from, cursor.to);\n const {lineNumber, columnNumber} = toLineColumn(cursor.from);\n items.push({title, lineNumber, columnNumber});\n } else if (\n cursor.matchContext([\n 'AssignmentExpression',\n 'MemberExpression',\n ]) ||\n cursor.matchContext([\n 'VariableDeclaration',\n ])) {\n let title = state.sliceDoc(cursor.from, cursor.to);\n const {lineNumber, columnNumber} = toLineColumn(cursor.from);\n while (cursor.name as string !== 'Equals' && cursor.next()) {\n }\n if (!cursor.nextSibling()) {\n break;\n }\n if (cursor.name as string === 'ArrowFunction' || cursor.name as string === 'FunctionExpression') {\n cursor.firstChild();\n let prefix = '';\n while (cursor.name as string !== 'ParamList') {\n if (cursor.name as string === 'async') {\n prefix = `async ${prefix}`;\n } else if (cursor.name as string === 'Star') {\n prefix += '*';\n }\n if (!cursor.nextSibling()) {\n break;\n }\n }\n title = prefix + title;\n const subtitle = subtitleFromParamList();\n items.push({title, subtitle, lineNumber, columnNumber});\n } else if (cursor.name as string === 'ClassExpression') {\n title = `class ${title}`;\n items.push({title, lineNumber, columnNumber});\n }\n }\n break;\n }\n // wast.grammar\n case 'App': {\n if (cursor.firstChild() && cursor.nextSibling() && state.sliceDoc(cursor.from, cursor.to) === 'module') {\n if (cursor.nextSibling() && cursor.name as string === 'Identifier') {\n const title = state.sliceDoc(cursor.from, cursor.to);\n const {lineNumber, columnNumber} = toLineColumn(cursor.from);\n items.push({title, lineNumber, columnNumber});\n }\n do {\n if (cursor.name as string === 'App' && cursor.firstChild()) {\n if (cursor.nextSibling() && state.sliceDoc(cursor.from, cursor.to) === 'func' && cursor.nextSibling() &&\n cursor.name as string === 'Identifier') {\n const title = state.sliceDoc(cursor.from, cursor.to);\n const {lineNumber, columnNumber} = toLineColumn(cursor.from);\n const params = [];\n while (cursor.nextSibling()) {\n if (cursor.name as string === 'App' && cursor.firstChild()) {\n if (cursor.nextSibling() && state.sliceDoc(cursor.from, cursor.to) === 'param') {\n if (cursor.nextSibling() && cursor.name as string === 'Identifier') {\n params.push(state.sliceDoc(cursor.from, cursor.to));\n } else {\n params.push(`$${params.length}`);\n }\n }\n cursor.parent();\n }\n }\n const subtitle = `(${params.join(', ')})`;\n items.push({title, subtitle, lineNumber, columnNumber});\n }\n cursor.parent();\n }\n } while (cursor.nextSibling());\n }\n break;\n }\n // cpp.grammar\n case 'FieldIdentifier':\n case 'Identifier': {\n if (cursor.matchContext(['FunctionDeclarator'])) {\n const title = state.sliceDoc(cursor.from, cursor.to);\n const {lineNumber, columnNumber} = toLineColumn(cursor.from);\n items.push({title, lineNumber, columnNumber});\n }\n break;\n }\n case 'TypeIdentifier': {\n if (cursor.matchContext(['ClassSpecifier'])) {\n const title = `class ${state.sliceDoc(cursor.from, cursor.to)}`;\n const {lineNumber, columnNumber} = toLineColumn(cursor.from);\n items.push({title, lineNumber, columnNumber});\n } else if (cursor.matchContext(['StructSpecifier'])) {\n const title = `struct ${state.sliceDoc(cursor.from, cursor.to)}`;\n const {lineNumber, columnNumber} = toLineColumn(cursor.from);\n items.push({title, lineNumber, columnNumber});\n }\n break;\n }\n default:\n break;\n }\n } while (cursor.next());\n return items;\n}\n\nexport class OutlineQuickOpen extends QuickOpen.FilteredListWidget.Provider {\n private items: OutlineItem[] = [];\n private active: boolean = false;\n\n constructor() {\n super('source-symbol');\n }\n\n override attach(): void {\n const sourceFrame = this.currentSourceFrame();\n if (sourceFrame) {\n this.active = true;\n this.items = outline(sourceFrame.textEditor.state).map(({title, subtitle, lineNumber, columnNumber}) => {\n ({lineNumber, columnNumber} = sourceFrame.editorLocationToUILocation(lineNumber, columnNumber));\n return {title, subtitle, lineNumber, columnNumber};\n });\n } else {\n this.active = false;\n this.items = [];\n }\n }\n\n override detach(): void {\n this.active = false;\n this.items = [];\n }\n\n override itemCount(): number {\n return this.items.length;\n }\n\n override itemKeyAt(itemIndex: number): string {\n const item = this.items[itemIndex];\n return item.title + (item.subtitle ? item.subtitle : '');\n }\n\n override itemScoreAt(itemIndex: number, query: string): number {\n const item = this.items[itemIndex];\n const methodName = query.split('(')[0];\n if (methodName.toLowerCase() === item.title.toLowerCase()) {\n return 1 / (1 + item.lineNumber);\n }\n return -item.lineNumber - 1;\n }\n\n override renderItem(itemIndex: number, query: string, titleElement: Element, _subtitleElement: Element): void {\n const item = this.items[itemIndex];\n titleElement.textContent = item.title + (item.subtitle ? item.subtitle : '');\n QuickOpen.FilteredListWidget.FilteredListWidget.highlightRanges(titleElement, query);\n\n const sourceFrame = this.currentSourceFrame();\n if (!sourceFrame) {\n return;\n }\n\n const tagElement = (titleElement.parentElement?.parentElement?.createChild('span', 'tag') as HTMLElement);\n if (!tagElement) {\n return;\n }\n\n const disassembly = sourceFrame.wasmDisassembly;\n if (disassembly) {\n const lastBytecodeOffset = disassembly.lineNumberToBytecodeOffset(disassembly.lineNumbers - 1);\n const bytecodeOffsetDigits = lastBytecodeOffset.toString(16).length;\n tagElement.textContent = `:0x${item.columnNumber.toString(16).padStart(bytecodeOffsetDigits, '0')}`;\n } else {\n tagElement.textContent = `:${item.lineNumber + 1}`;\n }\n }\n\n override selectItem(itemIndex: number|null, _promptValue: string): void {\n if (itemIndex === null) {\n return;\n }\n const sourceFrame = this.currentSourceFrame();\n if (!sourceFrame) {\n return;\n }\n const item = this.items[itemIndex];\n sourceFrame.revealPosition({lineNumber: item.lineNumber, columnNumber: item.columnNumber}, true);\n }\n\n private currentSourceFrame(): UISourceCodeFrame|null {\n const sourcesView = UI.Context.Context.instance().flavor(SourcesView);\n return sourcesView && sourcesView.currentSourceFrame();\n }\n\n override notFoundText(): string {\n if (!this.currentSourceFrame()) {\n return i18nString(UIStrings.noFileSelected);\n }\n if (!this.active) {\n return i18nString(UIStrings.openAJavascriptOrCssFileToSee);\n }\n return i18nString(UIStrings.noResultsFound);\n }\n}\n"]} \ No newline at end of file +{"version":3,"file":"OutlineQuickOpen.js","sourceRoot":"","sources":["../../../../../../front_end/panels/sources/OutlineQuickOpen.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,KAAK,IAAI,MAAM,yBAAyB,CAAC;AAChD,OAAO,KAAK,UAAU,MAAM,sDAAsD,CAAC;AACnF,OAAO,KAAK,SAAS,MAAM,qDAAqD,CAAC;AACjF,OAAO,KAAK,EAAE,MAAM,2BAA2B,CAAC;AAEhD,OAAO,EAAC,WAAW,EAAC,MAAM,kBAAkB,CAAC;AAG7C,MAAM,SAAS,GAA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E,CAAC;YACvB,OAAO;QACT,CAAC;QACD,MAAM,WAAW,GAAG,IAAI,CAAC,kBAAkB,EAAE,CAAC;QAC9C,IAAI,CAAC,WAAW,EAAE,CAAC;YACjB,OAAO;QACT,CAAC;QACD,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;QACnC,WAAW,CAAC,cAAc,CAAC,EAAC,UAAU,EAAE,IAAI,CAAC,UAAU,EAAE,YAAY,EAAE,IAAI,CAAC,YAAY,EAAC,EAAE,IAAI,CAAC,CAAC;IACnG,CAAC;IAEO,kBAAkB;QACxB,MAAM,WAAW,GAAG,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;QACtE,OAAO,WAAW,IAAI,WAAW,CAAC,kBAAkB,EAAE,CAAC;IACzD,CAAC;IAEQ,YAAY;QACnB,IAAI,CAAC,IAAI,CAAC,kBAAkB,EAAE,EAAE,CAAC;YAC/B,OAAO,UAAU,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC;QAC9C,CAAC;QACD,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC;YACjB,OAAO,UAAU,CAAC,SAAS,CAAC,6BAA6B,CAAC,CAAC;QAC7D,CAAC;QACD,OAAO,UAAU,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC;IAC9C,CAAC;CACF","sourcesContent":["// Copyright 2017 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport * as i18n from '../../core/i18n/i18n.js';\nimport * as CodeMirror from '../../third_party/codemirror.next/codemirror.next.js';\nimport * as QuickOpen from '../../ui/legacy/components/quick_open/quick_open.js';\nimport * as UI from '../../ui/legacy/legacy.js';\n\nimport {SourcesView} from './SourcesView.js';\nimport type {UISourceCodeFrame} from './UISourceCodeFrame.js';\n\nconst UIStrings = {\n /**\n *@description Text in Go To Line Quick Open of the Sources panel\n */\n noFileSelected: 'No file selected.',\n /**\n *@description Text in Outline Quick Open of the Sources panel\n */\n openAJavascriptOrCssFileToSee: 'Open a JavaScript or CSS file to see symbols',\n /**\n *@description Text to show no results have been found\n */\n noResultsFound: 'No results found',\n};\nconst str_ = i18n.i18n.registerUIStrings('panels/sources/OutlineQuickOpen.ts', UIStrings);\nconst i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);\n\nexport type OutlineItem = {\n title: string,\n lineNumber: number,\n columnNumber: number,\n subtitle?: string,\n};\n\nexport function outline(state: CodeMirror.EditorState): OutlineItem[] {\n function toLineColumn(offset: number): {lineNumber: number, columnNumber: number} {\n offset = Math.max(0, Math.min(offset, state.doc.length));\n const line = state.doc.lineAt(offset);\n return {lineNumber: line.number - 1, columnNumber: offset - line.from};\n }\n\n function subtitleFromParamList(): string {\n while (cursor.name !== 'ParamList' && cursor.nextSibling()) {\n }\n let parameters = '';\n if (cursor.name === 'ParamList' && cursor.firstChild()) {\n do {\n switch (cursor.name as string) {\n case 'ArrayPattern':\n parameters += '[‥]';\n break;\n case 'ObjectPattern':\n parameters += '{‥}';\n break;\n case 'VariableDefinition':\n parameters += state.sliceDoc(cursor.from, cursor.to);\n break;\n case 'Spread':\n parameters += '...';\n break;\n case ',':\n parameters += ', ';\n break;\n }\n } while (cursor.nextSibling());\n }\n return `(${parameters})`;\n }\n\n const tree = CodeMirror.syntaxTree(state);\n const items: OutlineItem[] = [];\n const cursor = tree.cursor();\n do {\n switch (cursor.name) {\n // css.grammar\n case 'RuleSet': {\n for (cursor.firstChild();; cursor.nextSibling()) {\n const title = state.sliceDoc(cursor.from, cursor.to);\n const {lineNumber, columnNumber} = toLineColumn(cursor.from);\n items.push({title, lineNumber, columnNumber});\n cursor.nextSibling();\n if (cursor.name as string !== ',') {\n break;\n }\n }\n break;\n }\n // javascript.grammar\n case 'FunctionDeclaration':\n case 'MethodDeclaration': {\n let prefix = '';\n cursor.firstChild();\n do {\n switch (cursor.name as string) {\n case 'abstract':\n case 'async':\n case 'get':\n case 'set':\n case 'static':\n prefix = `${prefix}${cursor.name} `;\n break;\n case 'Star':\n prefix += '*';\n break;\n case 'PropertyDefinition':\n case 'PrivatePropertyDefinition':\n case 'VariableDefinition': {\n const title = prefix + state.sliceDoc(cursor.from, cursor.to);\n const {lineNumber, columnNumber} = toLineColumn(cursor.from);\n const subtitle = subtitleFromParamList();\n items.push({title, subtitle, lineNumber, columnNumber});\n break;\n }\n }\n } while (cursor.nextSibling());\n break;\n }\n case 'Property': {\n let prefix = '';\n cursor.firstChild();\n do {\n if (cursor.name as string === 'async' || cursor.name as string === 'get' || cursor.name as string === 'set') {\n prefix = `${prefix}${cursor.name} `;\n } else if (cursor.name as string === 'Star') {\n prefix += '*';\n } else if (cursor.name as string === 'PropertyDefinition') {\n let title = state.sliceDoc(cursor.from, cursor.to);\n const {lineNumber, columnNumber} = toLineColumn(cursor.from);\n while (cursor.nextSibling()) {\n if (cursor.name as string === 'ClassExpression') {\n title = `class ${title}`;\n items.push({title, lineNumber, columnNumber});\n break;\n }\n if (cursor.name as string === 'ArrowFunction' || cursor.name as string === 'FunctionExpression') {\n cursor.firstChild();\n }\n if (cursor.name as string === 'async') {\n prefix = `async ${prefix}`;\n } else if (cursor.name as string === 'Star') {\n prefix += '*';\n } else if (cursor.name as string === 'ParamList') {\n title = prefix + title;\n const subtitle = subtitleFromParamList();\n items.push({title, subtitle, lineNumber, columnNumber});\n break;\n }\n }\n break;\n } else {\n // We don't support any other Property syntax.\n break;\n }\n } while (cursor.nextSibling());\n break;\n }\n case 'PropertyName':\n case 'VariableDefinition': {\n if (cursor.matchContext(['ClassDeclaration'])) {\n const title = 'class ' + state.sliceDoc(cursor.from, cursor.to);\n const {lineNumber, columnNumber} = toLineColumn(cursor.from);\n items.push({title, lineNumber, columnNumber});\n } else if (\n cursor.matchContext([\n 'AssignmentExpression',\n 'MemberExpression',\n ]) ||\n cursor.matchContext([\n 'VariableDeclaration',\n ])) {\n let title = state.sliceDoc(cursor.from, cursor.to);\n const {lineNumber, columnNumber} = toLineColumn(cursor.from);\n while (cursor.name as string !== 'Equals' && cursor.next()) {\n }\n if (!cursor.nextSibling()) {\n break;\n }\n if (cursor.name as string === 'ArrowFunction' || cursor.name as string === 'FunctionExpression') {\n cursor.firstChild();\n let prefix = '';\n while (cursor.name as string !== 'ParamList') {\n if (cursor.name as string === 'async') {\n prefix = `async ${prefix}`;\n } else if (cursor.name as string === 'Star') {\n prefix += '*';\n }\n if (!cursor.nextSibling()) {\n break;\n }\n }\n title = prefix + title;\n const subtitle = subtitleFromParamList();\n items.push({title, subtitle, lineNumber, columnNumber});\n } else if (cursor.name as string === 'ClassExpression') {\n title = `class ${title}`;\n items.push({title, lineNumber, columnNumber});\n }\n }\n break;\n }\n // wast.grammar\n case 'App': {\n if (cursor.firstChild() && cursor.nextSibling() && state.sliceDoc(cursor.from, cursor.to) === 'module') {\n if (cursor.nextSibling() && cursor.name as string === 'Identifier') {\n const title = state.sliceDoc(cursor.from, cursor.to);\n const {lineNumber, columnNumber} = toLineColumn(cursor.from);\n items.push({title, lineNumber, columnNumber});\n }\n do {\n if (cursor.name as string === 'App' && cursor.firstChild()) {\n if (cursor.nextSibling() && state.sliceDoc(cursor.from, cursor.to) === 'func' && cursor.nextSibling() &&\n cursor.name as string === 'Identifier') {\n const title = state.sliceDoc(cursor.from, cursor.to);\n const {lineNumber, columnNumber} = toLineColumn(cursor.from);\n const params = [];\n while (cursor.nextSibling()) {\n if (cursor.name as string === 'App' && cursor.firstChild()) {\n if (cursor.nextSibling() && state.sliceDoc(cursor.from, cursor.to) === 'param') {\n if (cursor.nextSibling() && cursor.name as string === 'Identifier') {\n params.push(state.sliceDoc(cursor.from, cursor.to));\n } else {\n params.push(`$${params.length}`);\n }\n }\n cursor.parent();\n }\n }\n const subtitle = `(${params.join(', ')})`;\n items.push({title, subtitle, lineNumber, columnNumber});\n }\n cursor.parent();\n }\n } while (cursor.nextSibling());\n }\n break;\n }\n // cpp.grammar\n case 'FieldIdentifier':\n case 'Identifier': {\n if (cursor.matchContext(['FunctionDeclarator'])) {\n const title = state.sliceDoc(cursor.from, cursor.to);\n const {lineNumber, columnNumber} = toLineColumn(cursor.from);\n items.push({title, lineNumber, columnNumber});\n }\n break;\n }\n case 'TypeIdentifier': {\n if (cursor.matchContext(['ClassSpecifier'])) {\n const title = `class ${state.sliceDoc(cursor.from, cursor.to)}`;\n const {lineNumber, columnNumber} = toLineColumn(cursor.from);\n items.push({title, lineNumber, columnNumber});\n } else if (cursor.matchContext(['StructSpecifier'])) {\n const title = `struct ${state.sliceDoc(cursor.from, cursor.to)}`;\n const {lineNumber, columnNumber} = toLineColumn(cursor.from);\n items.push({title, lineNumber, columnNumber});\n }\n break;\n }\n default:\n break;\n }\n } while (cursor.next());\n return items;\n}\n\nexport class OutlineQuickOpen extends QuickOpen.FilteredListWidget.Provider {\n private items: OutlineItem[] = [];\n private active: boolean = false;\n\n constructor() {\n super('source-symbol');\n }\n\n override attach(): void {\n const sourceFrame = this.currentSourceFrame();\n if (sourceFrame) {\n this.active = true;\n this.items = outline(sourceFrame.textEditor.state).map(({title, subtitle, lineNumber, columnNumber}) => {\n ({lineNumber, columnNumber} = sourceFrame.editorLocationToUILocation(lineNumber, columnNumber));\n return {title, subtitle, lineNumber, columnNumber};\n });\n } else {\n this.active = false;\n this.items = [];\n }\n }\n\n override detach(): void {\n this.active = false;\n this.items = [];\n }\n\n override itemCount(): number {\n return this.items.length;\n }\n\n override itemKeyAt(itemIndex: number): string {\n const item = this.items[itemIndex];\n return item.title + (item.subtitle ? item.subtitle : '');\n }\n\n override itemScoreAt(itemIndex: number, query: string): number {\n const item = this.items[itemIndex];\n const methodName = query.split('(')[0];\n if (methodName.toLowerCase() === item.title.toLowerCase()) {\n return 1 / (1 + item.lineNumber);\n }\n return -item.lineNumber - 1;\n }\n\n override renderItem(itemIndex: number, query: string, titleElement: Element, _subtitleElement: Element): void {\n const item = this.items[itemIndex];\n titleElement.textContent = item.title + (item.subtitle ? item.subtitle : '');\n QuickOpen.FilteredListWidget.FilteredListWidget.highlightRanges(titleElement, query);\n\n const sourceFrame = this.currentSourceFrame();\n if (!sourceFrame) {\n return;\n }\n\n const tagElement = titleElement.parentElement?.parentElement?.createChild('span', 'tag');\n if (!tagElement) {\n return;\n }\n\n const disassembly = sourceFrame.wasmDisassembly;\n if (disassembly) {\n const lastBytecodeOffset = disassembly.lineNumberToBytecodeOffset(disassembly.lineNumbers - 1);\n const bytecodeOffsetDigits = lastBytecodeOffset.toString(16).length;\n tagElement.textContent = `:0x${item.columnNumber.toString(16).padStart(bytecodeOffsetDigits, '0')}`;\n } else {\n tagElement.textContent = `:${item.lineNumber + 1}`;\n }\n }\n\n override selectItem(itemIndex: number|null, _promptValue: string): void {\n if (itemIndex === null) {\n return;\n }\n const sourceFrame = this.currentSourceFrame();\n if (!sourceFrame) {\n return;\n }\n const item = this.items[itemIndex];\n sourceFrame.revealPosition({lineNumber: item.lineNumber, columnNumber: item.columnNumber}, true);\n }\n\n private currentSourceFrame(): UISourceCodeFrame|null {\n const sourcesView = UI.Context.Context.instance().flavor(SourcesView);\n return sourcesView && sourcesView.currentSourceFrame();\n }\n\n override notFoundText(): string {\n if (!this.currentSourceFrame()) {\n return i18nString(UIStrings.noFileSelected);\n }\n if (!this.active) {\n return i18nString(UIStrings.openAJavascriptOrCssFileToSee);\n }\n return i18nString(UIStrings.noResultsFound);\n }\n}\n"]} \ No newline at end of file diff --git a/public/panels/sources/SourcesNavigator.test.js b/public/panels/sources/SourcesNavigator.test.js index 39b7a17ff..dbbcb86ca 100644 --- a/public/panels/sources/SourcesNavigator.test.js +++ b/public/panels/sources/SourcesNavigator.test.js @@ -97,7 +97,7 @@ describeWithMockConnection('NetworkNavigatorView', () => { }); const navigatorView = Sources.SourcesNavigator.NetworkNavigatorView.instance({ forceNew: true }); const rootElement = navigatorView.scriptsTree.rootElement(); - assert.strictEqual(rootElement.children().length, 0); + assert.lengthOf(rootElement.children(), 0); project.removeProject(); }); it('reveals main frame target on navigation', async () => { diff --git a/public/panels/sources/SourcesNavigator.test.js.map b/public/panels/sources/SourcesNavigator.test.js.map index 5c8066574..6f458c476 100644 --- a/public/panels/sources/SourcesNavigator.test.js.map +++ b/public/panels/sources/SourcesNavigator.test.js.map @@ -1 +1 @@ -{"version":3,"file":"SourcesNavigator.test.js","sourceRoot":"","sources":["../../../../../../front_end/panels/sources/SourcesNavigator.test.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,KAAK,MAAM,MAAM,6BAA6B,CAAC;AAEtD,OAAO,KAAK,IAAI,MAAM,yBAAyB,CAAC;AAChD,OAAO,KAAK,GAAG,MAAM,uBAAuB,CAAC;AAC7C,OAAO,KAAK,QAAQ,MAAM,mCAAmC,CAAC;AAC9D,OAAO,KAAK,WAAW,MAAM,yCAAyC,CAAC;AACvE,OAAO,KAAK,WAAW,MAAM,yCAAyC,CAAC;AACvE,OAAO,KAAK,SAAS,MAAM,qCAAqC,CAAC;AACjE,OAAO,EAAC,YAAY,EAAC,MAAM,qCAAqC,CAAC;AACjE,OAAO,EACL,0BAA0B,EAC1B,aAAa,EACb,gCAAgC,GACjC,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAC,mBAAmB,EAAC,MAAM,iCAAiC,CAAC;AACpE,OAAO,EAAC,mBAAmB,EAAC,MAAM,sCAAsC,CAAC;AACzE,OAAO,EAAC,kCAAkC,EAAC,MAAM,sCAAsC,CAAC;AACxF,OAAO,KAAK,EAAE,MAAM,2BAA2B,CAAC;AAEhD,OAAO,KAAK,OAAO,MAAM,cAAc,CAAC;AAExC,0BAA0B,CAAC,sBAAsB,EAAE,GAAG,EAAE;IACtD,IAAI,SAA4C,CAAC;IACjD,UAAU,CAAC,KAAK,IAAI,EAAE;QACpB,mBAAmB,CAAC,KAAK,CAAC,CAAC;QAC3B,MAAM,sBAAsB,GAAG,EAAE,CAAC,cAAc,C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AAW,CAAC,UAAU,EAAE,CAAC;YAChD,MAAM,aAAa,GAAG,cAAe,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;YACjD,MAAM,WAAW,GAAG,cAAe,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;YAE/C,MAAM,CAAC,WAAW,CAAC,WAAY,CAAC,OAAO,EAAE,yBAAyB,CAAC,CAAC;YACpE,MAAM,CAAC,WAAW,CAAC,aAAc,CAAC,OAAO,EAAE,yBAAyB,CAAC,CAAC;YAEtE,MAAM,EAAC,OAAO,EAAE,YAAY,EAAC,GAAG,kCAAkC,CAAC;gBACjE,KAAK,EAAE;oBACL;wBACE,GAAG,EAAE,iCAAoE;wBACzE,QAAQ,EAAE,wBAAwB;qBACnC;iBACF;gBACD,WAAW,EAAE,SAAS,CAAC,SAAS,CAAC,YAAY,CAAC,OAAO;gBACrD,MAAM;aACP,CAAC,CAAC;YAEH,MAAM,CAAC,WAAW,CAAC,WAAY,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;YAClD,MAAM,CAAC,WAAW,CAAC,aAAc,CAAC,OAAO,EAAE,yBAAyB,CAAC,CAAC;YAEtE,YAAY,CAAC,aAAa,EAAE,CAAC;YAE7B,MAAM,CAAC,WAAW,CAAC,WAAY,CAAC,OAAO,EAAE,uBAAuB,CAAC,CAAC;YAClE,MAAM,CAAC,WAAW,CAAC,aAAc,CAAC,OAAO,EAAE,yBAAyB,CAAC,CAAC;YAEtE,OAAO,CAAC,aAAa,EAAE,CAAC;QAC1B,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["// Copyright 2023 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport * as Common from '../../core/common/common.js';\nimport type * as Platform from '../../core/platform/platform.js';\nimport * as Root from '../../core/root/root.js';\nimport * as SDK from '../../core/sdk/sdk.js';\nimport * as Bindings from '../../models/bindings/bindings.js';\nimport * as Breakpoints from '../../models/breakpoints/breakpoints.js';\nimport * as Persistence from '../../models/persistence/persistence.js';\nimport * as Workspace from '../../models/workspace/workspace.js';\nimport {createTarget} from '../../testing/EnvironmentHelpers.js';\nimport {\n describeWithMockConnection,\n dispatchEvent,\n setMockConnectionResponseHandler,\n} from '../../testing/MockConnection.js';\nimport {MockProtocolBackend} from '../../testing/MockScopeChain.js';\nimport {setMockResourceTree} from '../../testing/ResourceTreeHelpers.js';\nimport {createContentProviderUISourceCodes} from '../../testing/UISourceCodeHelpers.js';\nimport * as UI from '../../ui/legacy/legacy.js';\n\nimport * as Sources from './sources.js';\n\ndescribeWithMockConnection('NetworkNavigatorView', () => {\n let workspace: Workspace.Workspace.WorkspaceImpl;\n beforeEach(async () => {\n setMockResourceTree(false);\n const actionRegistryInstance = UI.ActionRegistry.ActionRegistry.instance({forceNew: true});\n workspace = Workspace.Workspace.WorkspaceImpl.instance();\n const targetManager = SDK.TargetManager.TargetManager.instance();\n const resourceMapping = new Bindings.ResourceMapping.ResourceMapping(targetManager, workspace);\n const debuggerWorkspaceBinding = Bindings.DebuggerWorkspaceBinding.DebuggerWorkspaceBinding.instance({\n forceNew: true,\n resourceMapping,\n targetManager,\n });\n Bindings.IgnoreListManager.IgnoreListManager.instance({forceNew: true, debuggerWorkspaceBinding});\n const breakpointManager = Breakpoints.BreakpointManager.BreakpointManager.instance(\n {forceNew: true, targetManager, workspace, debuggerWorkspaceBinding});\n Persistence.Persistence.PersistenceImpl.instance({forceNew: true, workspace, breakpointManager});\n Persistence.NetworkPersistenceManager.NetworkPersistenceManager.instance({forceNew: true, workspace});\n UI.ShortcutRegistry.ShortcutRegistry.instance({forceNew: true, actionRegistry: actionRegistryInstance});\n Root.Runtime.experiments.register(Root.Runtime.ExperimentName.AUTHORED_DEPLOYED_GROUPING, '');\n Root.Runtime.experiments.register(Root.Runtime.ExperimentName.JUST_MY_CODE, '');\n });\n\n describe('reveals main target', () => {\n let target: SDK.Target.Target;\n let project: Bindings.ContentProviderBasedProject.ContentProviderBasedProject;\n\n beforeEach(async () => {\n const tabTarget = createTarget({type: SDK.Target.Type.TAB});\n createTarget({parentTarget: tabTarget, subtype: 'prerender'});\n target = createTarget({parentTarget: tabTarget});\n ({project} = createContentProviderUISourceCodes({\n items: [\n {url: 'http://example.com/' as Platform.DevToolsPath.UrlString, mimeType: 'text/html'},\n {url: 'http://example.com/favicon.ico' as Platform.DevToolsPath.UrlString, mimeType: 'image/x-icon'},\n {url: 'http://example.com/gtm.js' as Platform.DevToolsPath.UrlString, mimeType: 'application/javascript'},\n ],\n projectType: Workspace.Workspace.projectTypes.Network,\n target,\n }));\n });\n\n afterEach(() => {\n Workspace.Workspace.WorkspaceImpl.instance().removeProject(project);\n });\n\n it('shows folder with scripts requests', async () => {\n const {project} = createContentProviderUISourceCodes({\n items: [\n {\n url: 'http://example.com/script.js' as Platform.DevToolsPath.UrlString,\n mimeType: 'application/javascript',\n resourceType: Common.ResourceType.resourceTypes.Script,\n },\n ],\n projectType: Workspace.Workspace.projectTypes.Network,\n target,\n });\n\n const navigatorView = Sources.SourcesNavigator.NetworkNavigatorView.instance({forceNew: true});\n const rootElement = navigatorView.scriptsTree.rootElement();\n const folder = rootElement.firstChild();\n const file = folder?.firstChild();\n\n assert.strictEqual(folder?.title, 'example.com');\n assert.strictEqual(file?.title, 'script.js');\n\n project.removeProject();\n });\n\n it('does not show Fetch and XHR requests', async () => {\n const {project} = createContentProviderUISourceCodes({\n items: [\n {\n url: 'http://example.com/list-xhr.json' as Platform.DevToolsPath.UrlString,\n mimeType: 'application/json',\n resourceType: Common.ResourceType.resourceTypes.XHR,\n },\n {\n url: 'http://example.com/list-fetch.json' as Platform.DevToolsPath.UrlString,\n mimeType: 'application/json',\n resourceType: Common.ResourceType.resourceTypes.Fetch,\n },\n ],\n projectType: Workspace.Workspace.projectTypes.Network,\n target,\n });\n\n const navigatorView = Sources.SourcesNavigator.NetworkNavigatorView.instance({forceNew: true});\n const rootElement = navigatorView.scriptsTree.rootElement();\n assert.strictEqual(rootElement.children().length, 0);\n\n project.removeProject();\n });\n\n it('reveals main frame target on navigation', async () => {\n const navigatorView = Sources.SourcesNavigator.NetworkNavigatorView.instance({forceNew: true});\n\n const rootElement = navigatorView.scriptsTree.rootElement();\n assert.strictEqual(rootElement.childCount(), 1);\n assert.strictEqual(rootElement.firstChild()?.childCount(), 3);\n assert.isFalse(rootElement.firstChild()?.expanded);\n assert.isTrue(rootElement.firstChild()?.selected);\n\n target.setInspectedURL('http://example.com/' as Platform.DevToolsPath.UrlString);\n\n assert.isTrue(navigatorView.scriptsTree.firstChild()?.expanded);\n assert.isTrue(navigatorView.scriptsTree.firstChild()?.firstChild()?.selected);\n });\n\n it('reveals main frame target when added', async () => {\n target.setInspectedURL('http://example.com/' as Platform.DevToolsPath.UrlString);\n const navigatorView = Sources.SourcesNavigator.NetworkNavigatorView.instance({forceNew: true});\n\n const rootElement = navigatorView.scriptsTree.rootElement();\n assert.strictEqual(rootElement.childCount(), 1);\n assert.strictEqual(rootElement.firstChild()?.childCount(), 3);\n assert.isTrue(navigatorView.scriptsTree.firstChild()?.expanded);\n assert.isTrue(navigatorView.scriptsTree.firstChild()?.firstChild()?.selected);\n });\n });\n\n it('updates in scope change', () => {\n const target = createTarget();\n const {project} = createContentProviderUISourceCodes({\n items: [\n {url: 'http://example.com/' as Platform.DevToolsPath.UrlString, mimeType: 'text/html'},\n {url: 'http://example.com/favicon.ico' as Platform.DevToolsPath.UrlString, mimeType: 'image/x-icon'},\n {url: 'http://example.com/gtm.js' as Platform.DevToolsPath.UrlString, mimeType: 'application/javascript'},\n ],\n projectId: 'project',\n projectType: Workspace.Workspace.projectTypes.Network,\n target,\n });\n const anotherTarget = createTarget();\n const {project: anotherProject} = createContentProviderUISourceCodes({\n items: [\n {url: 'http://example.org/' as Platform.DevToolsPath.UrlString, mimeType: 'text/html'},\n {url: 'http://example.org/background.bmp' as Platform.DevToolsPath.UrlString, mimeType: 'image/x-icon'},\n ],\n projectId: 'anotherProject',\n projectType: Workspace.Workspace.projectTypes.Network,\n target: anotherTarget,\n });\n\n SDK.TargetManager.TargetManager.instance().setScopeTarget(target);\n const navigatorView = Sources.SourcesNavigator.NetworkNavigatorView.instance({forceNew: true});\n\n let rootElement = navigatorView.scriptsTree.rootElement();\n assert.strictEqual(rootElement.childCount(), 1);\n assert.strictEqual(rootElement.firstChild()?.childCount(), 3);\n assert.deepEqual(rootElement.firstChild()?.children().map(i => i.title), ['(index)', 'gtm.js', 'favicon.ico']);\n\n SDK.TargetManager.TargetManager.instance().setScopeTarget(anotherTarget);\n\n rootElement = navigatorView.scriptsTree.rootElement();\n assert.strictEqual(rootElement.childCount(), 1);\n assert.strictEqual(rootElement.firstChild()?.childCount(), 2);\n assert.deepEqual(rootElement.firstChild()?.children().map(i => i.title), ['(index)', 'background.bmp']);\n\n project.removeProject();\n anotherProject.removeProject();\n });\n\n describe('removing source codes selection throttling', () => {\n let target: SDK.Target.Target;\n\n beforeEach(() => {\n target = createTarget();\n });\n\n it('selects just once when removing multiple sibling source codes', () => {\n const {project} = createContentProviderUISourceCodes({\n items: [\n {url: 'http://example.com/a.js' as Platform.DevToolsPath.UrlString, mimeType: 'application/javascript'},\n {url: 'http://example.com/b.js' as Platform.DevToolsPath.UrlString, mimeType: 'application/javascript'},\n ],\n projectType: Workspace.Workspace.projectTypes.Network,\n target,\n });\n const {project: otherProject} = createContentProviderUISourceCodes({\n items: [\n {url: 'http://example.com/c.js' as Platform.DevToolsPath.UrlString, mimeType: 'application/javascript'},\n ],\n projectType: Workspace.Workspace.projectTypes.Network,\n projectId: 'other',\n target,\n });\n\n const navigatorView = Sources.SourcesNavigator.NetworkNavigatorView.instance({forceNew: true});\n const rootElement = navigatorView.scriptsTree.rootElement();\n const exampleComNode = rootElement.firstChild();\n assert.exists(exampleComNode);\n const nodeA = exampleComNode.childAt(0);\n const nodeB = exampleComNode.childAt(1);\n const nodeC = exampleComNode.childAt(2);\n assert.exists(nodeA);\n assert.exists(nodeB);\n assert.exists(nodeC);\n\n // Select the 'http://example.com/a.js' node. Remove the project with a.js and b.js and verify\n // that the selection is moved from 'a.js' to 'c.js', without temporarily selecting 'b.js'.\n nodeA.select();\n\n const nodeBSelectSpy = sinon.spy(nodeB, 'select');\n const nodeCSelectSpy = sinon.spy(nodeC, 'select');\n\n project.removeProject();\n\n assert.isTrue(nodeBSelectSpy.notCalled);\n assert.isTrue(nodeCSelectSpy.called);\n\n otherProject.removeProject();\n });\n\n it('selects parent after removing all children', () => {\n const {project} = createContentProviderUISourceCodes({\n items: [\n {url: 'http://example.com/a.js' as Platform.DevToolsPath.UrlString, mimeType: 'application/javascript'},\n {url: 'http://example.com/b.js' as Platform.DevToolsPath.UrlString, mimeType: 'application/javascript'},\n {url: 'http://example.com/c.js' as Platform.DevToolsPath.UrlString, mimeType: 'application/javascript'},\n ],\n projectType: Workspace.Workspace.projectTypes.Network,\n target,\n });\n\n const navigatorView = Sources.SourcesNavigator.NetworkNavigatorView.instance({forceNew: true});\n const rootElement = navigatorView.scriptsTree.rootElement();\n const nodeExampleCom = rootElement.firstChild();\n assert.exists(nodeExampleCom);\n const nodeA = nodeExampleCom.childAt(0);\n const nodeB = nodeExampleCom.childAt(1);\n const nodeC = nodeExampleCom.childAt(2);\n assert.exists(nodeA);\n assert.exists(nodeB);\n assert.exists(nodeC);\n\n // Select the 'http://example.com/a.js' node. Remove all the source codenodes and check the selection\n // is not propagated forward to the siblings as we remove them. Instead, the selection will be moved\n // directly to the parent.\n nodeA.select();\n\n const nodeBSelectSpy = sinon.spy(nodeB, 'select');\n const nodeCSelectSpy = sinon.spy(nodeC, 'select');\n const nodeExampleComSelectSpy = sinon.spy(nodeExampleCom, 'select');\n\n project.removeProject();\n\n assert.isTrue(nodeBSelectSpy.notCalled);\n assert.isTrue(nodeCSelectSpy.notCalled);\n assert.isTrue(nodeExampleComSelectSpy.called);\n\n // Note that the last asserion is slightly misleading since the empty example.com node is removed.\n // Let us make that clear here.\n assert.strictEqual(rootElement.childCount(), 0);\n });\n\n it('selects sibling after removing folder children', async () => {\n const {project} = createContentProviderUISourceCodes({\n items: [\n {url: 'http://example.com/d/a.js' as Platform.DevToolsPath.UrlString, mimeType: 'application/javascript'},\n {url: 'http://example.com/d/b.js' as Platform.DevToolsPath.UrlString, mimeType: 'application/javascript'},\n ],\n projectType: Workspace.Workspace.projectTypes.Network,\n target,\n });\n const {project: otherProject} = createContentProviderUISourceCodes({\n items: [\n {url: 'http://example.com/c.js' as Platform.DevToolsPath.UrlString, mimeType: 'application/javascript'},\n ],\n projectType: Workspace.Workspace.projectTypes.Network,\n projectId: 'other',\n target,\n });\n\n const navigatorView = Sources.SourcesNavigator.NetworkNavigatorView.instance({forceNew: true});\n const rootElement = navigatorView.scriptsTree.rootElement();\n const exampleComNode = rootElement.firstChild();\n assert.exists(exampleComNode);\n const nodeD = exampleComNode.childAt(0);\n assert.exists(nodeD);\n await nodeD.expand();\n const nodeA = nodeD.childAt(0);\n const nodeB = nodeD.childAt(1);\n const nodeC = exampleComNode.childAt(1);\n assert.exists(nodeA);\n assert.exists(nodeB);\n assert.exists(nodeC);\n\n // Select the 'http://example.com/a.js' node.\n nodeA.select();\n\n const nodeBSelectSpy = sinon.spy(nodeB, 'select');\n const nodeCSelectSpy = sinon.spy(nodeC, 'select');\n\n // Remove the project with the a.js and b.js nodes.\n project.removeProject();\n\n // Let us check that we do not push the selection forward over node 'b.js'.\n // Instead, the selection will be pushed to 'c.js' (with an intermediate step at 'd').\n // (Ideally, it would move directly from 'a.js' to 'c.js', but we are currently only\n // optimizing away the moves to siblings.)\n assert.isTrue(nodeBSelectSpy.notCalled);\n assert.isTrue(nodeCSelectSpy.called);\n\n // Also note that the folder 'd' is removed. Let us make that explicit.\n assert.strictEqual(exampleComNode.childCount(), 1);\n assert.strictEqual(exampleComNode.childAt(0), nodeC);\n\n otherProject.removeProject();\n });\n\n it('selects sibling after removing individual folder children', async () => {\n const {project} = createContentProviderUISourceCodes({\n items: [\n {url: 'http://example.com/d/a.js' as Platform.DevToolsPath.UrlString, mimeType: 'application/javascript'},\n {url: 'http://example.com/e/b.js' as Platform.DevToolsPath.UrlString, mimeType: 'application/javascript'},\n ],\n projectType: Workspace.Workspace.projectTypes.Network,\n target,\n });\n const {project: otherProject} = createContentProviderUISourceCodes({\n items: [\n {url: 'http://example.com/c.js' as Platform.DevToolsPath.UrlString, mimeType: 'application/javascript'},\n ],\n projectType: Workspace.Workspace.projectTypes.Network,\n projectId: 'other',\n target,\n });\n\n const navigatorView = Sources.SourcesNavigator.NetworkNavigatorView.instance({forceNew: true});\n const rootElement = navigatorView.scriptsTree.rootElement();\n const exampleComNode = rootElement.firstChild();\n assert.exists(exampleComNode);\n const nodeD = exampleComNode.childAt(0);\n const nodeE = exampleComNode.childAt(1);\n const nodeC = exampleComNode.childAt(2);\n assert.exists(nodeD);\n assert.exists(nodeE);\n await nodeD.expand();\n await nodeE.expand();\n const nodeA = nodeD.childAt(0);\n const nodeB = nodeE.childAt(0);\n assert.exists(nodeA);\n assert.exists(nodeB);\n assert.exists(nodeC);\n\n // Select the 'http://example.com/a.js' node.\n nodeA.select();\n\n const nodeESelectSpy = sinon.spy(nodeE, 'select');\n const nodeBSelectSpy = sinon.spy(nodeB, 'select');\n const nodeCSelectSpy = sinon.spy(nodeC, 'select');\n\n // Remove a.js and b.js nodes. This will remove their nodes, including the containing folders.\n // The selection will be moved from 'a.js' to its parent (folder 'd') and when that gets removed,\n // it should move to 'c' rather being pushed forward to 'e'.\n project.removeProject();\n\n assert.isTrue(nodeESelectSpy.notCalled);\n assert.isTrue(nodeBSelectSpy.notCalled);\n assert.isTrue(nodeCSelectSpy.called);\n\n // Also note that nodeD and nodeE are removed. Let us make that explicit.\n assert.strictEqual(exampleComNode.childCount(), 1);\n assert.strictEqual(exampleComNode.childAt(0), nodeC);\n\n otherProject.removeProject();\n });\n\n it('selects just once when excution-context-destroyed event removes sibling source codes', async () => {\n const backend = new MockProtocolBackend();\n\n dispatchEvent(target, 'Runtime.executionContextCreated', {\n context: {\n id: 2,\n origin: 'http://example.com',\n name: 'c2',\n uniqueId: 'c2',\n auxData: {\n frameId: 'f2',\n },\n },\n });\n\n await backend.addScript(\n target, {content: '42', url: 'http://example.com/a.js', executionContextId: 2, hasSourceURL: false}, null);\n await backend.addScript(\n target, {content: '42', url: 'http://example.com/b.js', executionContextId: 2, hasSourceURL: false}, null);\n await backend.addScript(target, {content: '42', url: 'http://example.com/c.js', hasSourceURL: false}, null);\n\n const navigatorView = Sources.SourcesNavigator.NetworkNavigatorView.instance({forceNew: true});\n const rootElement = navigatorView.scriptsTree.rootElement();\n const exampleComNode = rootElement.firstChild();\n assert.exists(exampleComNode);\n const nodeA = exampleComNode.childAt(0);\n const nodeB = exampleComNode.childAt(1);\n const nodeC = exampleComNode.childAt(2);\n assert.exists(nodeA);\n assert.exists(nodeB);\n assert.exists(nodeC);\n\n // Select the 'http://example.com/a.js' node. Remove the project with a.js and b.js and verify\n // that the selection is moved from 'a.js' to 'c.js', without temporarily selecting 'b.js'.\n nodeA.select();\n\n const nodeBSelectSpy = sinon.spy(nodeB, 'select');\n const nodeCSelectSpy = sinon.spy(nodeC, 'select');\n\n dispatchEvent(\n target, 'Runtime.executionContextDestroyed', {executionContextId: 2, executionContextUniqueId: 'c2'});\n\n assert.isTrue(nodeBSelectSpy.notCalled);\n assert.isTrue(nodeCSelectSpy.called);\n\n // Sanity check - we should have only one source now.\n assert.strictEqual(exampleComNode.childCount(), 1);\n });\n });\n\n describe('with ignore listing', () => {\n let target: SDK.Target.Target;\n let resolveFn: (() => void)|null = null;\n\n beforeEach(() => {\n target = createTarget();\n Bindings.IgnoreListManager.IgnoreListManager.instance().addChangeListener(() => {\n if (resolveFn) {\n resolveFn();\n resolveFn = null;\n }\n });\n setMockConnectionResponseHandler('Debugger.setBlackboxPatterns', () => ({}));\n setMockConnectionResponseHandler('Debugger.setBlackboxExecutionContexts', () => ({}));\n });\n\n const updatePatternSetting = async (settingValue: Common.Settings.RegExpSettingItem[]) => {\n const setting = Common.Settings.Settings.instance().moduleSetting('skip-stack-frames-pattern') as\n Common.Settings.RegExpSetting;\n const promise = new Promise(resolve => {\n resolveFn = resolve;\n });\n setting.setAsArray(settingValue);\n void await promise;\n };\n const enableIgnoreListing = () => updatePatternSetting([{pattern: '-hidden', disabled: false}]);\n const disableIgnoreListing = () => updatePatternSetting([]);\n\n it('shows folder with only ignore listed content as ignore listed', async () => {\n await enableIgnoreListing();\n const {project} = createContentProviderUISourceCodes({\n items: [\n {\n url: 'http://example.com/ignored/a/a-hidden.js' as Platform.DevToolsPath.UrlString,\n mimeType: 'application/javascript',\n },\n {\n url: 'http://example.com/ignored/b/b-hidden.js' as Platform.DevToolsPath.UrlString,\n mimeType: 'application/javascript',\n },\n {\n url: 'http://example.com/mixed/a/a-hidden.js' as Platform.DevToolsPath.UrlString,\n mimeType: 'application/javascript',\n },\n {\n url: 'http://example.com/mixed/b/b.js' as Platform.DevToolsPath.UrlString,\n mimeType: 'application/javascript',\n },\n ],\n projectType: Workspace.Workspace.projectTypes.Network,\n target,\n });\n\n const navigatorView = Sources.SourcesNavigator.NetworkNavigatorView.instance({forceNew: true});\n const rootElement = navigatorView.scriptsTree.rootElement();\n const nodeExampleCom = rootElement.firstChild();\n const ignoredFolder = nodeExampleCom!.childAt(0);\n const mixedFolder = nodeExampleCom!.childAt(1);\n\n assert.strictEqual(mixedFolder!.tooltip, 'mixed');\n assert.strictEqual(ignoredFolder!.tooltip, 'ignored (ignore listed)');\n\n project.removeProject();\n });\n\n it('updates folders when ignore listing rules change', async () => {\n const {project} = createContentProviderUISourceCodes({\n items: [\n {\n url: 'http://example.com/ignored/a/a-hidden.js' as Platform.DevToolsPath.UrlString,\n mimeType: 'application/javascript',\n },\n {\n url: 'http://example.com/ignored/b/b-hidden.js' as Platform.DevToolsPath.UrlString,\n mimeType: 'application/javascript',\n },\n {\n url: 'http://example.com/mixed/a/a-hidden.js' as Platform.DevToolsPath.UrlString,\n mimeType: 'application/javascript',\n },\n {\n url: 'http://example.com/mixed/b/b.js' as Platform.DevToolsPath.UrlString,\n mimeType: 'application/javascript',\n },\n ],\n projectType: Workspace.Workspace.projectTypes.Network,\n target,\n });\n\n const navigatorView = Sources.SourcesNavigator.NetworkNavigatorView.instance({forceNew: true});\n const rootElement = navigatorView.scriptsTree.rootElement();\n const nodeExampleCom = rootElement.firstChild();\n const ignoredFolder = nodeExampleCom!.childAt(0);\n const mixedFolder = nodeExampleCom!.childAt(1);\n\n assert.strictEqual(mixedFolder!.tooltip, 'mixed');\n assert.strictEqual(ignoredFolder!.tooltip, 'ignored');\n\n await enableIgnoreListing();\n\n assert.strictEqual(mixedFolder!.tooltip, 'mixed');\n assert.strictEqual(ignoredFolder!.tooltip, 'ignored (ignore listed)');\n\n await disableIgnoreListing();\n\n assert.strictEqual(mixedFolder!.tooltip, 'mixed');\n assert.strictEqual(ignoredFolder!.tooltip, 'ignored');\n\n project.removeProject();\n });\n\n it('updates folders when files are added or removed', async () => {\n await enableIgnoreListing();\n const {project} = createContentProviderUISourceCodes({\n items: [\n {\n url: 'http://example.com/ignored/a/a-hidden.js' as Platform.DevToolsPath.UrlString,\n mimeType: 'application/javascript',\n },\n {\n url: 'http://example.com/ignored/b/b-hidden.js' as Platform.DevToolsPath.UrlString,\n mimeType: 'application/javascript',\n },\n {\n url: 'http://example.com/mixed/a/a-hidden.js' as Platform.DevToolsPath.UrlString,\n mimeType: 'application/javascript',\n },\n ],\n projectType: Workspace.Workspace.projectTypes.Network,\n target,\n });\n\n const navigatorView = Sources.SourcesNavigator.NetworkNavigatorView.instance({forceNew: true});\n const rootElement = navigatorView.scriptsTree.rootElement();\n const nodeExampleCom = rootElement.firstChild();\n const ignoredFolder = nodeExampleCom!.childAt(0);\n const mixedFolder = nodeExampleCom!.childAt(1);\n\n assert.strictEqual(mixedFolder!.tooltip, 'mixed/a (ignore listed)');\n assert.strictEqual(ignoredFolder!.tooltip, 'ignored (ignore listed)');\n\n const {project: otherProject} = createContentProviderUISourceCodes({\n items: [\n {\n url: 'http://example.com/mixed/b/b.js' as Platform.DevToolsPath.UrlString,\n mimeType: 'application/javascript',\n },\n ],\n projectType: Workspace.Workspace.projectTypes.Network,\n target,\n });\n\n assert.strictEqual(mixedFolder!.tooltip, 'mixed');\n assert.strictEqual(ignoredFolder!.tooltip, 'ignored (ignore listed)');\n\n otherProject.removeProject();\n\n assert.strictEqual(mixedFolder!.tooltip, 'mixed (ignore listed)');\n assert.strictEqual(ignoredFolder!.tooltip, 'ignored (ignore listed)');\n\n project.removeProject();\n });\n });\n});\n"]} \ No newline at end of file +{"version":3,"file":"SourcesNavigator.test.js","sourceRoot":"","sources":["../../../../../../front_end/panels/sources/SourcesNavigator.test.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,KAAK,MAAM,MAAM,6BAA6B,CAAC;AAEtD,OAAO,KAAK,IAAI,MAAM,yBAAyB,CAAC;AAChD,OAAO,KAAK,GAAG,MAAM,uBAAuB,CAAC;AAC7C,OAAO,KAAK,QAAQ,MAAM,mCAAmC,CAAC;AAC9D,OAAO,KAAK,WAAW,MAAM,yCAAyC,CAAC;AACvE,OAAO,KAAK,WAAW,MAAM,yCAAyC,CAAC;AACvE,OAAO,KAAK,SAAS,MAAM,qCAAqC,CAAC;AACjE,OAAO,EAAC,YAAY,EAAC,MAAM,qCAAqC,CAAC;AACjE,OAAO,EACL,0BAA0B,EAC1B,aAAa,EACb,gCAAgC,GACjC,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAC,mBAAmB,EAAC,MAAM,iCAAiC,CAAC;AACpE,OAAO,EAAC,mBAAmB,EAAC,MAAM,sCAAsC,CAAC;AACzE,OAAO,EAAC,kCAAkC,EAAC,MAAM,sCAAsC,CAAC;AACxF,OAAO,KAAK,EAAE,MAAM,2BAA2B,CAAC;AAEh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":["// Copyright 2023 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport * as Common from '../../core/common/common.js';\nimport type * as Platform from '../../core/platform/platform.js';\nimport * as Root from '../../core/root/root.js';\nimport * as SDK from '../../core/sdk/sdk.js';\nimport * as Bindings from '../../models/bindings/bindings.js';\nimport * as Breakpoints from '../../models/breakpoints/breakpoints.js';\nimport * as Persistence from '../../models/persistence/persistence.js';\nimport * as Workspace from '../../models/workspace/workspace.js';\nimport {createTarget} from '../../testing/EnvironmentHelpers.js';\nimport {\n describeWithMockConnection,\n dispatchEvent,\n setMockConnectionResponseHandler,\n} from '../../testing/MockConnection.js';\nimport {MockProtocolBackend} from '../../testing/MockScopeChain.js';\nimport {setMockResourceTree} from '../../testing/ResourceTreeHelpers.js';\nimport {createContentProviderUISourceCodes} from '../../testing/UISourceCodeHelpers.js';\nimport * as UI from '../../ui/legacy/legacy.js';\n\nimport * as Sources from './sources.js';\n\ndescribeWithMockConnection('NetworkNavigatorView', () => {\n let workspace: Workspace.Workspace.WorkspaceImpl;\n beforeEach(async () => {\n setMockResourceTree(false);\n const actionRegistryInstance = UI.ActionRegistry.ActionRegistry.instance({forceNew: true});\n workspace = Workspace.Workspace.WorkspaceImpl.instance();\n const targetManager = SDK.TargetManager.TargetManager.instance();\n const resourceMapping = new Bindings.ResourceMapping.ResourceMapping(targetManager, workspace);\n const debuggerWorkspaceBinding = Bindings.DebuggerWorkspaceBinding.DebuggerWorkspaceBinding.instance({\n forceNew: true,\n resourceMapping,\n targetManager,\n });\n Bindings.IgnoreListManager.IgnoreListManager.instance({forceNew: true, debuggerWorkspaceBinding});\n const breakpointManager = Breakpoints.BreakpointManager.BreakpointManager.instance(\n {forceNew: true, targetManager, workspace, debuggerWorkspaceBinding});\n Persistence.Persistence.PersistenceImpl.instance({forceNew: true, workspace, breakpointManager});\n Persistence.NetworkPersistenceManager.NetworkPersistenceManager.instance({forceNew: true, workspace});\n UI.ShortcutRegistry.ShortcutRegistry.instance({forceNew: true, actionRegistry: actionRegistryInstance});\n Root.Runtime.experiments.register(Root.Runtime.ExperimentName.AUTHORED_DEPLOYED_GROUPING, '');\n Root.Runtime.experiments.register(Root.Runtime.ExperimentName.JUST_MY_CODE, '');\n });\n\n describe('reveals main target', () => {\n let target: SDK.Target.Target;\n let project: Bindings.ContentProviderBasedProject.ContentProviderBasedProject;\n\n beforeEach(async () => {\n const tabTarget = createTarget({type: SDK.Target.Type.TAB});\n createTarget({parentTarget: tabTarget, subtype: 'prerender'});\n target = createTarget({parentTarget: tabTarget});\n ({project} = createContentProviderUISourceCodes({\n items: [\n {url: 'http://example.com/' as Platform.DevToolsPath.UrlString, mimeType: 'text/html'},\n {url: 'http://example.com/favicon.ico' as Platform.DevToolsPath.UrlString, mimeType: 'image/x-icon'},\n {url: 'http://example.com/gtm.js' as Platform.DevToolsPath.UrlString, mimeType: 'application/javascript'},\n ],\n projectType: Workspace.Workspace.projectTypes.Network,\n target,\n }));\n });\n\n afterEach(() => {\n Workspace.Workspace.WorkspaceImpl.instance().removeProject(project);\n });\n\n it('shows folder with scripts requests', async () => {\n const {project} = createContentProviderUISourceCodes({\n items: [\n {\n url: 'http://example.com/script.js' as Platform.DevToolsPath.UrlString,\n mimeType: 'application/javascript',\n resourceType: Common.ResourceType.resourceTypes.Script,\n },\n ],\n projectType: Workspace.Workspace.projectTypes.Network,\n target,\n });\n\n const navigatorView = Sources.SourcesNavigator.NetworkNavigatorView.instance({forceNew: true});\n const rootElement = navigatorView.scriptsTree.rootElement();\n const folder = rootElement.firstChild();\n const file = folder?.firstChild();\n\n assert.strictEqual(folder?.title, 'example.com');\n assert.strictEqual(file?.title, 'script.js');\n\n project.removeProject();\n });\n\n it('does not show Fetch and XHR requests', async () => {\n const {project} = createContentProviderUISourceCodes({\n items: [\n {\n url: 'http://example.com/list-xhr.json' as Platform.DevToolsPath.UrlString,\n mimeType: 'application/json',\n resourceType: Common.ResourceType.resourceTypes.XHR,\n },\n {\n url: 'http://example.com/list-fetch.json' as Platform.DevToolsPath.UrlString,\n mimeType: 'application/json',\n resourceType: Common.ResourceType.resourceTypes.Fetch,\n },\n ],\n projectType: Workspace.Workspace.projectTypes.Network,\n target,\n });\n\n const navigatorView = Sources.SourcesNavigator.NetworkNavigatorView.instance({forceNew: true});\n const rootElement = navigatorView.scriptsTree.rootElement();\n assert.lengthOf(rootElement.children(), 0);\n\n project.removeProject();\n });\n\n it('reveals main frame target on navigation', async () => {\n const navigatorView = Sources.SourcesNavigator.NetworkNavigatorView.instance({forceNew: true});\n\n const rootElement = navigatorView.scriptsTree.rootElement();\n assert.strictEqual(rootElement.childCount(), 1);\n assert.strictEqual(rootElement.firstChild()?.childCount(), 3);\n assert.isFalse(rootElement.firstChild()?.expanded);\n assert.isTrue(rootElement.firstChild()?.selected);\n\n target.setInspectedURL('http://example.com/' as Platform.DevToolsPath.UrlString);\n\n assert.isTrue(navigatorView.scriptsTree.firstChild()?.expanded);\n assert.isTrue(navigatorView.scriptsTree.firstChild()?.firstChild()?.selected);\n });\n\n it('reveals main frame target when added', async () => {\n target.setInspectedURL('http://example.com/' as Platform.DevToolsPath.UrlString);\n const navigatorView = Sources.SourcesNavigator.NetworkNavigatorView.instance({forceNew: true});\n\n const rootElement = navigatorView.scriptsTree.rootElement();\n assert.strictEqual(rootElement.childCount(), 1);\n assert.strictEqual(rootElement.firstChild()?.childCount(), 3);\n assert.isTrue(navigatorView.scriptsTree.firstChild()?.expanded);\n assert.isTrue(navigatorView.scriptsTree.firstChild()?.firstChild()?.selected);\n });\n });\n\n it('updates in scope change', () => {\n const target = createTarget();\n const {project} = createContentProviderUISourceCodes({\n items: [\n {url: 'http://example.com/' as Platform.DevToolsPath.UrlString, mimeType: 'text/html'},\n {url: 'http://example.com/favicon.ico' as Platform.DevToolsPath.UrlString, mimeType: 'image/x-icon'},\n {url: 'http://example.com/gtm.js' as Platform.DevToolsPath.UrlString, mimeType: 'application/javascript'},\n ],\n projectId: 'project',\n projectType: Workspace.Workspace.projectTypes.Network,\n target,\n });\n const anotherTarget = createTarget();\n const {project: anotherProject} = createContentProviderUISourceCodes({\n items: [\n {url: 'http://example.org/' as Platform.DevToolsPath.UrlString, mimeType: 'text/html'},\n {url: 'http://example.org/background.bmp' as Platform.DevToolsPath.UrlString, mimeType: 'image/x-icon'},\n ],\n projectId: 'anotherProject',\n projectType: Workspace.Workspace.projectTypes.Network,\n target: anotherTarget,\n });\n\n SDK.TargetManager.TargetManager.instance().setScopeTarget(target);\n const navigatorView = Sources.SourcesNavigator.NetworkNavigatorView.instance({forceNew: true});\n\n let rootElement = navigatorView.scriptsTree.rootElement();\n assert.strictEqual(rootElement.childCount(), 1);\n assert.strictEqual(rootElement.firstChild()?.childCount(), 3);\n assert.deepEqual(rootElement.firstChild()?.children().map(i => i.title), ['(index)', 'gtm.js', 'favicon.ico']);\n\n SDK.TargetManager.TargetManager.instance().setScopeTarget(anotherTarget);\n\n rootElement = navigatorView.scriptsTree.rootElement();\n assert.strictEqual(rootElement.childCount(), 1);\n assert.strictEqual(rootElement.firstChild()?.childCount(), 2);\n assert.deepEqual(rootElement.firstChild()?.children().map(i => i.title), ['(index)', 'background.bmp']);\n\n project.removeProject();\n anotherProject.removeProject();\n });\n\n describe('removing source codes selection throttling', () => {\n let target: SDK.Target.Target;\n\n beforeEach(() => {\n target = createTarget();\n });\n\n it('selects just once when removing multiple sibling source codes', () => {\n const {project} = createContentProviderUISourceCodes({\n items: [\n {url: 'http://example.com/a.js' as Platform.DevToolsPath.UrlString, mimeType: 'application/javascript'},\n {url: 'http://example.com/b.js' as Platform.DevToolsPath.UrlString, mimeType: 'application/javascript'},\n ],\n projectType: Workspace.Workspace.projectTypes.Network,\n target,\n });\n const {project: otherProject} = createContentProviderUISourceCodes({\n items: [\n {url: 'http://example.com/c.js' as Platform.DevToolsPath.UrlString, mimeType: 'application/javascript'},\n ],\n projectType: Workspace.Workspace.projectTypes.Network,\n projectId: 'other',\n target,\n });\n\n const navigatorView = Sources.SourcesNavigator.NetworkNavigatorView.instance({forceNew: true});\n const rootElement = navigatorView.scriptsTree.rootElement();\n const exampleComNode = rootElement.firstChild();\n assert.exists(exampleComNode);\n const nodeA = exampleComNode.childAt(0);\n const nodeB = exampleComNode.childAt(1);\n const nodeC = exampleComNode.childAt(2);\n assert.exists(nodeA);\n assert.exists(nodeB);\n assert.exists(nodeC);\n\n // Select the 'http://example.com/a.js' node. Remove the project with a.js and b.js and verify\n // that the selection is moved from 'a.js' to 'c.js', without temporarily selecting 'b.js'.\n nodeA.select();\n\n const nodeBSelectSpy = sinon.spy(nodeB, 'select');\n const nodeCSelectSpy = sinon.spy(nodeC, 'select');\n\n project.removeProject();\n\n assert.isTrue(nodeBSelectSpy.notCalled);\n assert.isTrue(nodeCSelectSpy.called);\n\n otherProject.removeProject();\n });\n\n it('selects parent after removing all children', () => {\n const {project} = createContentProviderUISourceCodes({\n items: [\n {url: 'http://example.com/a.js' as Platform.DevToolsPath.UrlString, mimeType: 'application/javascript'},\n {url: 'http://example.com/b.js' as Platform.DevToolsPath.UrlString, mimeType: 'application/javascript'},\n {url: 'http://example.com/c.js' as Platform.DevToolsPath.UrlString, mimeType: 'application/javascript'},\n ],\n projectType: Workspace.Workspace.projectTypes.Network,\n target,\n });\n\n const navigatorView = Sources.SourcesNavigator.NetworkNavigatorView.instance({forceNew: true});\n const rootElement = navigatorView.scriptsTree.rootElement();\n const nodeExampleCom = rootElement.firstChild();\n assert.exists(nodeExampleCom);\n const nodeA = nodeExampleCom.childAt(0);\n const nodeB = nodeExampleCom.childAt(1);\n const nodeC = nodeExampleCom.childAt(2);\n assert.exists(nodeA);\n assert.exists(nodeB);\n assert.exists(nodeC);\n\n // Select the 'http://example.com/a.js' node. Remove all the source codenodes and check the selection\n // is not propagated forward to the siblings as we remove them. Instead, the selection will be moved\n // directly to the parent.\n nodeA.select();\n\n const nodeBSelectSpy = sinon.spy(nodeB, 'select');\n const nodeCSelectSpy = sinon.spy(nodeC, 'select');\n const nodeExampleComSelectSpy = sinon.spy(nodeExampleCom, 'select');\n\n project.removeProject();\n\n assert.isTrue(nodeBSelectSpy.notCalled);\n assert.isTrue(nodeCSelectSpy.notCalled);\n assert.isTrue(nodeExampleComSelectSpy.called);\n\n // Note that the last asserion is slightly misleading since the empty example.com node is removed.\n // Let us make that clear here.\n assert.strictEqual(rootElement.childCount(), 0);\n });\n\n it('selects sibling after removing folder children', async () => {\n const {project} = createContentProviderUISourceCodes({\n items: [\n {url: 'http://example.com/d/a.js' as Platform.DevToolsPath.UrlString, mimeType: 'application/javascript'},\n {url: 'http://example.com/d/b.js' as Platform.DevToolsPath.UrlString, mimeType: 'application/javascript'},\n ],\n projectType: Workspace.Workspace.projectTypes.Network,\n target,\n });\n const {project: otherProject} = createContentProviderUISourceCodes({\n items: [\n {url: 'http://example.com/c.js' as Platform.DevToolsPath.UrlString, mimeType: 'application/javascript'},\n ],\n projectType: Workspace.Workspace.projectTypes.Network,\n projectId: 'other',\n target,\n });\n\n const navigatorView = Sources.SourcesNavigator.NetworkNavigatorView.instance({forceNew: true});\n const rootElement = navigatorView.scriptsTree.rootElement();\n const exampleComNode = rootElement.firstChild();\n assert.exists(exampleComNode);\n const nodeD = exampleComNode.childAt(0);\n assert.exists(nodeD);\n await nodeD.expand();\n const nodeA = nodeD.childAt(0);\n const nodeB = nodeD.childAt(1);\n const nodeC = exampleComNode.childAt(1);\n assert.exists(nodeA);\n assert.exists(nodeB);\n assert.exists(nodeC);\n\n // Select the 'http://example.com/a.js' node.\n nodeA.select();\n\n const nodeBSelectSpy = sinon.spy(nodeB, 'select');\n const nodeCSelectSpy = sinon.spy(nodeC, 'select');\n\n // Remove the project with the a.js and b.js nodes.\n project.removeProject();\n\n // Let us check that we do not push the selection forward over node 'b.js'.\n // Instead, the selection will be pushed to 'c.js' (with an intermediate step at 'd').\n // (Ideally, it would move directly from 'a.js' to 'c.js', but we are currently only\n // optimizing away the moves to siblings.)\n assert.isTrue(nodeBSelectSpy.notCalled);\n assert.isTrue(nodeCSelectSpy.called);\n\n // Also note that the folder 'd' is removed. Let us make that explicit.\n assert.strictEqual(exampleComNode.childCount(), 1);\n assert.strictEqual(exampleComNode.childAt(0), nodeC);\n\n otherProject.removeProject();\n });\n\n it('selects sibling after removing individual folder children', async () => {\n const {project} = createContentProviderUISourceCodes({\n items: [\n {url: 'http://example.com/d/a.js' as Platform.DevToolsPath.UrlString, mimeType: 'application/javascript'},\n {url: 'http://example.com/e/b.js' as Platform.DevToolsPath.UrlString, mimeType: 'application/javascript'},\n ],\n projectType: Workspace.Workspace.projectTypes.Network,\n target,\n });\n const {project: otherProject} = createContentProviderUISourceCodes({\n items: [\n {url: 'http://example.com/c.js' as Platform.DevToolsPath.UrlString, mimeType: 'application/javascript'},\n ],\n projectType: Workspace.Workspace.projectTypes.Network,\n projectId: 'other',\n target,\n });\n\n const navigatorView = Sources.SourcesNavigator.NetworkNavigatorView.instance({forceNew: true});\n const rootElement = navigatorView.scriptsTree.rootElement();\n const exampleComNode = rootElement.firstChild();\n assert.exists(exampleComNode);\n const nodeD = exampleComNode.childAt(0);\n const nodeE = exampleComNode.childAt(1);\n const nodeC = exampleComNode.childAt(2);\n assert.exists(nodeD);\n assert.exists(nodeE);\n await nodeD.expand();\n await nodeE.expand();\n const nodeA = nodeD.childAt(0);\n const nodeB = nodeE.childAt(0);\n assert.exists(nodeA);\n assert.exists(nodeB);\n assert.exists(nodeC);\n\n // Select the 'http://example.com/a.js' node.\n nodeA.select();\n\n const nodeESelectSpy = sinon.spy(nodeE, 'select');\n const nodeBSelectSpy = sinon.spy(nodeB, 'select');\n const nodeCSelectSpy = sinon.spy(nodeC, 'select');\n\n // Remove a.js and b.js nodes. This will remove their nodes, including the containing folders.\n // The selection will be moved from 'a.js' to its parent (folder 'd') and when that gets removed,\n // it should move to 'c' rather being pushed forward to 'e'.\n project.removeProject();\n\n assert.isTrue(nodeESelectSpy.notCalled);\n assert.isTrue(nodeBSelectSpy.notCalled);\n assert.isTrue(nodeCSelectSpy.called);\n\n // Also note that nodeD and nodeE are removed. Let us make that explicit.\n assert.strictEqual(exampleComNode.childCount(), 1);\n assert.strictEqual(exampleComNode.childAt(0), nodeC);\n\n otherProject.removeProject();\n });\n\n it('selects just once when excution-context-destroyed event removes sibling source codes', async () => {\n const backend = new MockProtocolBackend();\n\n dispatchEvent(target, 'Runtime.executionContextCreated', {\n context: {\n id: 2,\n origin: 'http://example.com',\n name: 'c2',\n uniqueId: 'c2',\n auxData: {\n frameId: 'f2',\n },\n },\n });\n\n await backend.addScript(\n target, {content: '42', url: 'http://example.com/a.js', executionContextId: 2, hasSourceURL: false}, null);\n await backend.addScript(\n target, {content: '42', url: 'http://example.com/b.js', executionContextId: 2, hasSourceURL: false}, null);\n await backend.addScript(target, {content: '42', url: 'http://example.com/c.js', hasSourceURL: false}, null);\n\n const navigatorView = Sources.SourcesNavigator.NetworkNavigatorView.instance({forceNew: true});\n const rootElement = navigatorView.scriptsTree.rootElement();\n const exampleComNode = rootElement.firstChild();\n assert.exists(exampleComNode);\n const nodeA = exampleComNode.childAt(0);\n const nodeB = exampleComNode.childAt(1);\n const nodeC = exampleComNode.childAt(2);\n assert.exists(nodeA);\n assert.exists(nodeB);\n assert.exists(nodeC);\n\n // Select the 'http://example.com/a.js' node. Remove the project with a.js and b.js and verify\n // that the selection is moved from 'a.js' to 'c.js', without temporarily selecting 'b.js'.\n nodeA.select();\n\n const nodeBSelectSpy = sinon.spy(nodeB, 'select');\n const nodeCSelectSpy = sinon.spy(nodeC, 'select');\n\n dispatchEvent(\n target, 'Runtime.executionContextDestroyed', {executionContextId: 2, executionContextUniqueId: 'c2'});\n\n assert.isTrue(nodeBSelectSpy.notCalled);\n assert.isTrue(nodeCSelectSpy.called);\n\n // Sanity check - we should have only one source now.\n assert.strictEqual(exampleComNode.childCount(), 1);\n });\n });\n\n describe('with ignore listing', () => {\n let target: SDK.Target.Target;\n let resolveFn: (() => void)|null = null;\n\n beforeEach(() => {\n target = createTarget();\n Bindings.IgnoreListManager.IgnoreListManager.instance().addChangeListener(() => {\n if (resolveFn) {\n resolveFn();\n resolveFn = null;\n }\n });\n setMockConnectionResponseHandler('Debugger.setBlackboxPatterns', () => ({}));\n setMockConnectionResponseHandler('Debugger.setBlackboxExecutionContexts', () => ({}));\n });\n\n const updatePatternSetting = async (settingValue: Common.Settings.RegExpSettingItem[]) => {\n const setting = Common.Settings.Settings.instance().moduleSetting('skip-stack-frames-pattern') as\n Common.Settings.RegExpSetting;\n const promise = new Promise(resolve => {\n resolveFn = resolve;\n });\n setting.setAsArray(settingValue);\n void await promise;\n };\n const enableIgnoreListing = () => updatePatternSetting([{pattern: '-hidden', disabled: false}]);\n const disableIgnoreListing = () => updatePatternSetting([]);\n\n it('shows folder with only ignore listed content as ignore listed', async () => {\n await enableIgnoreListing();\n const {project} = createContentProviderUISourceCodes({\n items: [\n {\n url: 'http://example.com/ignored/a/a-hidden.js' as Platform.DevToolsPath.UrlString,\n mimeType: 'application/javascript',\n },\n {\n url: 'http://example.com/ignored/b/b-hidden.js' as Platform.DevToolsPath.UrlString,\n mimeType: 'application/javascript',\n },\n {\n url: 'http://example.com/mixed/a/a-hidden.js' as Platform.DevToolsPath.UrlString,\n mimeType: 'application/javascript',\n },\n {\n url: 'http://example.com/mixed/b/b.js' as Platform.DevToolsPath.UrlString,\n mimeType: 'application/javascript',\n },\n ],\n projectType: Workspace.Workspace.projectTypes.Network,\n target,\n });\n\n const navigatorView = Sources.SourcesNavigator.NetworkNavigatorView.instance({forceNew: true});\n const rootElement = navigatorView.scriptsTree.rootElement();\n const nodeExampleCom = rootElement.firstChild();\n const ignoredFolder = nodeExampleCom!.childAt(0);\n const mixedFolder = nodeExampleCom!.childAt(1);\n\n assert.strictEqual(mixedFolder!.tooltip, 'mixed');\n assert.strictEqual(ignoredFolder!.tooltip, 'ignored (ignore listed)');\n\n project.removeProject();\n });\n\n it('updates folders when ignore listing rules change', async () => {\n const {project} = createContentProviderUISourceCodes({\n items: [\n {\n url: 'http://example.com/ignored/a/a-hidden.js' as Platform.DevToolsPath.UrlString,\n mimeType: 'application/javascript',\n },\n {\n url: 'http://example.com/ignored/b/b-hidden.js' as Platform.DevToolsPath.UrlString,\n mimeType: 'application/javascript',\n },\n {\n url: 'http://example.com/mixed/a/a-hidden.js' as Platform.DevToolsPath.UrlString,\n mimeType: 'application/javascript',\n },\n {\n url: 'http://example.com/mixed/b/b.js' as Platform.DevToolsPath.UrlString,\n mimeType: 'application/javascript',\n },\n ],\n projectType: Workspace.Workspace.projectTypes.Network,\n target,\n });\n\n const navigatorView = Sources.SourcesNavigator.NetworkNavigatorView.instance({forceNew: true});\n const rootElement = navigatorView.scriptsTree.rootElement();\n const nodeExampleCom = rootElement.firstChild();\n const ignoredFolder = nodeExampleCom!.childAt(0);\n const mixedFolder = nodeExampleCom!.childAt(1);\n\n assert.strictEqual(mixedFolder!.tooltip, 'mixed');\n assert.strictEqual(ignoredFolder!.tooltip, 'ignored');\n\n await enableIgnoreListing();\n\n assert.strictEqual(mixedFolder!.tooltip, 'mixed');\n assert.strictEqual(ignoredFolder!.tooltip, 'ignored (ignore listed)');\n\n await disableIgnoreListing();\n\n assert.strictEqual(mixedFolder!.tooltip, 'mixed');\n assert.strictEqual(ignoredFolder!.tooltip, 'ignored');\n\n project.removeProject();\n });\n\n it('updates folders when files are added or removed', async () => {\n await enableIgnoreListing();\n const {project} = createContentProviderUISourceCodes({\n items: [\n {\n url: 'http://example.com/ignored/a/a-hidden.js' as Platform.DevToolsPath.UrlString,\n mimeType: 'application/javascript',\n },\n {\n url: 'http://example.com/ignored/b/b-hidden.js' as Platform.DevToolsPath.UrlString,\n mimeType: 'application/javascript',\n },\n {\n url: 'http://example.com/mixed/a/a-hidden.js' as Platform.DevToolsPath.UrlString,\n mimeType: 'application/javascript',\n },\n ],\n projectType: Workspace.Workspace.projectTypes.Network,\n target,\n });\n\n const navigatorView = Sources.SourcesNavigator.NetworkNavigatorView.instance({forceNew: true});\n const rootElement = navigatorView.scriptsTree.rootElement();\n const nodeExampleCom = rootElement.firstChild();\n const ignoredFolder = nodeExampleCom!.childAt(0);\n const mixedFolder = nodeExampleCom!.childAt(1);\n\n assert.strictEqual(mixedFolder!.tooltip, 'mixed/a (ignore listed)');\n assert.strictEqual(ignoredFolder!.tooltip, 'ignored (ignore listed)');\n\n const {project: otherProject} = createContentProviderUISourceCodes({\n items: [\n {\n url: 'http://example.com/mixed/b/b.js' as Platform.DevToolsPath.UrlString,\n mimeType: 'application/javascript',\n },\n ],\n projectType: Workspace.Workspace.projectTypes.Network,\n target,\n });\n\n assert.strictEqual(mixedFolder!.tooltip, 'mixed');\n assert.strictEqual(ignoredFolder!.tooltip, 'ignored (ignore listed)');\n\n otherProject.removeProject();\n\n assert.strictEqual(mixedFolder!.tooltip, 'mixed (ignore listed)');\n assert.strictEqual(ignoredFolder!.tooltip, 'ignored (ignore listed)');\n\n project.removeProject();\n });\n });\n});\n"]} \ No newline at end of file diff --git a/public/panels/sources/SourcesView.test.js b/public/panels/sources/SourcesView.test.js index 06f08bf1b..843d73d55 100644 --- a/public/panels/sources/SourcesView.test.js +++ b/public/panels/sources/SourcesView.test.js @@ -54,16 +54,16 @@ describeWithEnvironment('SourcesView', () => { callback(true, newName, newURL, newContentType); }; sourcesView.viewForFile(uiSourceCode); - assert.isTrue(sourcesView.getSourceView(uiSourceCode) instanceof Sources.UISourceCodeFrame.UISourceCodeFrame); + assert.instanceOf(sourcesView.getSourceView(uiSourceCode), Sources.UISourceCodeFrame.UISourceCodeFrame); // Rename, but contentType stays the same await uiSourceCode.rename('newName.html'); - assert.isTrue(sourcesView.getSourceView(uiSourceCode) instanceof Sources.UISourceCodeFrame.UISourceCodeFrame); + assert.instanceOf(sourcesView.getSourceView(uiSourceCode), Sources.UISourceCodeFrame.UISourceCodeFrame); // Rename which changes contentType await uiSourceCode.rename('image.jpg'); - assert.isTrue(sourcesView.getSourceView(uiSourceCode) instanceof SourceFrame.ImageView.ImageView); + assert.instanceOf(sourcesView.getSourceView(uiSourceCode), SourceFrame.ImageView.ImageView); // Rename which changes contentType await uiSourceCode.rename('font.woff'); - assert.isTrue(sourcesView.getSourceView(uiSourceCode) instanceof SourceFrame.FontView.FontView); + assert.instanceOf(sourcesView.getSourceView(uiSourceCode), SourceFrame.FontView.FontView); workspace.removeProject(project); sourcesView.detach(); }); @@ -72,7 +72,7 @@ describeWithEnvironment('SourcesView', () => { const uiSourceCode = new Workspace.UISourceCode.UISourceCode({}, 'file:///path/to/overrides/www.example.com/.headers', Common.ResourceType.resourceTypes.Document); sinon.stub(uiSourceCode, 'mimeType').returns('text/plain'); sourcesView.viewForFile(uiSourceCode); - assert.isTrue(sourcesView.getSourceView(uiSourceCode) instanceof SourcesComponents.HeadersView.HeadersView); + assert.instanceOf(sourcesView.getSourceView(uiSourceCode), SourcesComponents.HeadersView.HeadersView); }); describe('viewForFile', () => { it('records the correct media type in the DevTools.SourcesPanelFileOpened metric', async () => { diff --git a/public/panels/sources/SourcesView.test.js.map b/public/panels/sources/SourcesView.test.js.map index f529448e7..f649da229 100644 --- a/public/panels/sources/SourcesView.test.js.map +++ b/public/panels/sources/SourcesView.test.js.map @@ -1 +1 @@ -{"version":3,"file":"SourcesView.test.js","sourceRoot":"","sources":["../../../../../../front_end/panels/sources/SourcesView.test.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,KAAK,MAAM,MAAM,6BAA6B,CAAC;AACtD,OAAO,KAAK,IAAI,MAAM,yBAAyB,CAAC;AAEhD,OAAO,KAAK,GAAG,MAAM,uBAAuB,CAAC;AAC7C,OAAO,KAAK,QAAQ,MAAM,mCAAmC,CAAC;AAC9D,OAAO,KAAK,WAAW,MAAM,yCAAyC,CAAC;AACvE,OAAO,KAAK,WAAW,MAAM,yCAAyC,CAAC;AACvE,OAAO,KAAK,SAAS,MAAM,qCAAqC,CAAC;AACjE,OAAO,EAC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G,IAAI,OAAO,CAAC,WAAW,CAAC,WAAW,EAAE,CAAC;QAC1D,MAAM,sBAAsB,GAAG,KAAK,CAAC,GAAG,CAAC,WAAW,CAAC,eAAe,EAAE,qBAAqB,CAAC,CAAC;QAC7F,OAAO,CAAC,aAAa,EAAE,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC;QAChD,MAAM,CAAC,MAAM,CAAC,sBAAsB,CAAC,SAAS,CAAC,CAAC;IAClD,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["// Copyright 2022 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport * as Common from '../../core/common/common.js';\nimport * as Host from '../../core/host/host.js';\nimport type * as Platform from '../../core/platform/platform.js';\nimport * as SDK from '../../core/sdk/sdk.js';\nimport * as Bindings from '../../models/bindings/bindings.js';\nimport * as Breakpoints from '../../models/breakpoints/breakpoints.js';\nimport * as Persistence from '../../models/persistence/persistence.js';\nimport * as Workspace from '../../models/workspace/workspace.js';\nimport {\n createTarget,\n describeWithEnvironment,\n} from '../../testing/EnvironmentHelpers.js';\nimport {describeWithMockConnection} from '../../testing/MockConnection.js';\nimport {\n createContentProviderUISourceCodes,\n createFileSystemUISourceCode,\n} from '../../testing/UISourceCodeHelpers.js';\nimport * as SourceFrame from '../../ui/legacy/components/source_frame/source_frame.js';\nimport * as UI from '../../ui/legacy/legacy.js';\n\nimport * as SourcesComponents from './components/components.js';\nimport * as Sources from './sources.js';\n\ndescribeWithEnvironment('SourcesView', () => {\n beforeEach(async () => {\n const actionRegistryInstance = UI.ActionRegistry.ActionRegistry.instance({forceNew: true});\n const workspace = Workspace.Workspace.WorkspaceImpl.instance();\n const targetManager = SDK.TargetManager.TargetManager.instance();\n const resourceMapping = new Bindings.ResourceMapping.ResourceMapping(targetManager, workspace);\n const debuggerWorkspaceBinding = Bindings.DebuggerWorkspaceBinding.DebuggerWorkspaceBinding.instance({\n forceNew: true,\n resourceMapping,\n targetManager,\n });\n const breakpointManager = Breakpoints.BreakpointManager.BreakpointManager.instance(\n {forceNew: true, targetManager, workspace, debuggerWorkspaceBinding});\n Persistence.Persistence.PersistenceImpl.instance({forceNew: true, workspace, breakpointManager});\n Persistence.NetworkPersistenceManager.NetworkPersistenceManager.instance({forceNew: true, workspace});\n UI.ShortcutRegistry.ShortcutRegistry.instance({forceNew: true, actionRegistry: actionRegistryInstance});\n });\n\n it('creates new source view of updated type when renamed file requires a different viewer', async () => {\n const sourcesView = new Sources.SourcesView.SourcesView();\n sourcesView.markAsRoot();\n sourcesView.show(document.body);\n const workspace = Workspace.Workspace.WorkspaceImpl.instance();\n const {uiSourceCode, project} = createFileSystemUISourceCode({\n url: 'file:///path/to/overrides/example.html' as Platform.DevToolsPath.UrlString,\n mimeType: 'text/html',\n });\n project.canSetFileContent = () => true;\n project.rename =\n (uiSourceCode: Workspace.UISourceCode.UISourceCode, newName: string,\n callback: (\n arg0: boolean, arg1?: string, arg2?: Platform.DevToolsPath.UrlString,\n arg3?: Common.ResourceType.ResourceType) => void) => {\n const newURL = ('file:///path/to/overrides/' + newName) as Platform.DevToolsPath.UrlString;\n let newContentType = Common.ResourceType.resourceTypes.Document;\n if (newName.endsWith('.jpg')) {\n newContentType = Common.ResourceType.resourceTypes.Image;\n } else if (newName.endsWith('.woff')) {\n newContentType = Common.ResourceType.resourceTypes.Font;\n }\n callback(true, newName, newURL, newContentType);\n };\n\n sourcesView.viewForFile(uiSourceCode);\n\n assert.isTrue(sourcesView.getSourceView(uiSourceCode) instanceof Sources.UISourceCodeFrame.UISourceCodeFrame);\n\n // Rename, but contentType stays the same\n await uiSourceCode.rename('newName.html' as Platform.DevToolsPath.RawPathString);\n assert.isTrue(sourcesView.getSourceView(uiSourceCode) instanceof Sources.UISourceCodeFrame.UISourceCodeFrame);\n\n // Rename which changes contentType\n await uiSourceCode.rename('image.jpg' as Platform.DevToolsPath.RawPathString);\n assert.isTrue(sourcesView.getSourceView(uiSourceCode) instanceof SourceFrame.ImageView.ImageView);\n\n // Rename which changes contentType\n await uiSourceCode.rename('font.woff' as Platform.DevToolsPath.RawPathString);\n assert.isTrue(sourcesView.getSourceView(uiSourceCode) instanceof SourceFrame.FontView.FontView);\n workspace.removeProject(project);\n sourcesView.detach();\n });\n\n it('creates a HeadersView when the filename is \\'.headers\\'', async () => {\n const sourcesView = new Sources.SourcesView.SourcesView();\n const uiSourceCode = new Workspace.UISourceCode.UISourceCode(\n {} as Persistence.FileSystemWorkspaceBinding.FileSystem,\n 'file:///path/to/overrides/www.example.com/.headers' as Platform.DevToolsPath.UrlString,\n Common.ResourceType.resourceTypes.Document);\n sinon.stub(uiSourceCode, 'mimeType').returns('text/plain');\n sourcesView.viewForFile(uiSourceCode);\n assert.isTrue(sourcesView.getSourceView(uiSourceCode) instanceof SourcesComponents.HeadersView.HeadersView);\n });\n\n describe('viewForFile', () => {\n it('records the correct media type in the DevTools.SourcesPanelFileOpened metric', async () => {\n const sourcesView = new Sources.SourcesView.SourcesView();\n const {uiSourceCode} = createFileSystemUISourceCode({\n url: 'file:///path/to/project/example.ts' as Platform.DevToolsPath.UrlString,\n mimeType: 'text/typescript',\n content: 'export class Foo {}',\n });\n const sourcesPanelFileOpenedSpy = sinon.spy(Host.userMetrics, 'sourcesPanelFileOpened');\n const contentLoadedPromise = new Promise(res => window.addEventListener('source-file-loaded', res));\n const widget = sourcesView.viewForFile(uiSourceCode);\n assert.instanceOf(widget, Sources.UISourceCodeFrame.UISourceCodeFrame);\n const uiSourceCodeFrame = widget as Sources.UISourceCodeFrame.UISourceCodeFrame;\n\n // Skip creating the DebuggerPlugin, which times out and simulate DOM attach/showing.\n sinon.stub(uiSourceCodeFrame, 'loadPlugins' as keyof typeof uiSourceCodeFrame).callsFake(() => {});\n uiSourceCodeFrame.wasShown();\n\n await contentLoadedPromise;\n\n assert.isTrue(sourcesPanelFileOpenedSpy.calledWithExactly('text/typescript'));\n });\n });\n});\n\ndescribeWithMockConnection('SourcesView', () => {\n let target1: SDK.Target.Target;\n let target2: SDK.Target.Target;\n\n beforeEach(() => {\n const actionRegistryInstance = UI.ActionRegistry.ActionRegistry.instance({forceNew: true});\n UI.ShortcutRegistry.ShortcutRegistry.instance({forceNew: true, actionRegistry: actionRegistryInstance});\n target1 = createTarget();\n target2 = createTarget();\n const targetManager = target1.targetManager();\n targetManager.setScopeTarget(target1);\n const workspace = Workspace.Workspace.WorkspaceImpl.instance();\n\n const resourceMapping = new Bindings.ResourceMapping.ResourceMapping(targetManager, workspace);\n Bindings.CSSWorkspaceBinding.CSSWorkspaceBinding.instance({forceNew: true, resourceMapping, targetManager});\n const debuggerWorkspaceBinding = Bindings.DebuggerWorkspaceBinding.DebuggerWorkspaceBinding.instance({\n forceNew: true,\n resourceMapping,\n targetManager,\n });\n Bindings.IgnoreListManager.IgnoreListManager.instance({forceNew: true, debuggerWorkspaceBinding});\n const breakpointManager = Breakpoints.BreakpointManager.BreakpointManager.instance(\n {forceNew: true, targetManager, workspace, debuggerWorkspaceBinding});\n Persistence.Persistence.PersistenceImpl.instance({forceNew: true, workspace, breakpointManager});\n Persistence.NetworkPersistenceManager.NetworkPersistenceManager.instance({forceNew: true, workspace});\n });\n\n it('creates editor tabs only for in-scope uiSourceCodes', () => {\n const addUISourceCodeSpy =\n sinon.spy(Sources.TabbedEditorContainer.TabbedEditorContainer.prototype, 'addUISourceCode');\n const removeUISourceCodesSpy =\n sinon.spy(Sources.TabbedEditorContainer.TabbedEditorContainer.prototype, 'removeUISourceCodes');\n\n createContentProviderUISourceCodes({\n items: [\n {url: 'http://example.com/a.js' as Platform.DevToolsPath.UrlString, mimeType: 'application/javascript'},\n {url: 'http://example.com/b.js' as Platform.DevToolsPath.UrlString, mimeType: 'application/javascript'},\n ],\n projectId: 'projectId1',\n projectType: Workspace.Workspace.projectTypes.Network,\n target: target1,\n });\n\n createContentProviderUISourceCodes({\n items: [\n {url: 'http://foo.com/script.js' as Platform.DevToolsPath.UrlString, mimeType: 'application/javascript'},\n ],\n projectId: 'projectId2',\n projectType: Workspace.Workspace.projectTypes.Network,\n target: target2,\n });\n\n new Sources.SourcesView.SourcesView();\n let addedURLs = addUISourceCodeSpy.args.map(args => args[0].url());\n assert.deepEqual(addedURLs, ['http://example.com/a.js', 'http://example.com/b.js']);\n assert.isTrue(removeUISourceCodesSpy.notCalled);\n\n addUISourceCodeSpy.resetHistory();\n target2.targetManager().setScopeTarget(target2);\n addedURLs = addUISourceCodeSpy.args.map(args => args[0].url());\n assert.deepEqual(addedURLs, ['http://foo.com/script.js']);\n const removedURLs = removeUISourceCodesSpy.args.map(args => args[0][0].url());\n assert.deepEqual(removedURLs, ['http://example.com/a.js', 'http://example.com/b.js']);\n });\n\n it('doesn\\'t remove non-network UISourceCodes when changing the scope target', () => {\n createFileSystemUISourceCode({\n url: 'snippet:///foo.js' as Platform.DevToolsPath.UrlString,\n mimeType: 'application/javascript',\n type: 'snippets',\n });\n\n const sourcesView = new Sources.SourcesView.SourcesView();\n const removeUISourceCodesSpy = sinon.spy(sourcesView.editorContainer, 'removeUISourceCodes');\n target2.targetManager().setScopeTarget(target2);\n assert.isTrue(removeUISourceCodesSpy.notCalled);\n });\n});\n"]} \ No newline at end of file +{"version":3,"file":"SourcesView.test.js","sourceRoot":"","sources":["../../../../../../front_end/panels/sources/SourcesView.test.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,KAAK,MAAM,MAAM,6BAA6B,CAAC;AACtD,OAAO,KAAK,IAAI,MAAM,yBAAyB,CAAC;AAEhD,OAAO,KAAK,GAAG,MAAM,uBAAuB,CAAC;AAC7C,OAAO,KAAK,QAAQ,MAAM,mCAAmC,CAAC;AAC9D,OAAO,KAAK,WAAW,MAAM,yCAAyC,CAAC;AACvE,OAAO,KAAK,WAAW,MAAM,yCAAyC,CAAC;AACvE,OAAO,KAAK,SAAS,MAAM,qCAAqC,CAAC;AACjE,OAAO,EACL,YAAY,EACZ,uBAAuB,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W,CAAC,WAAW,EAAE,CAAC;QAC1D,MAAM,sBAAsB,GAAG,KAAK,CAAC,GAAG,CAAC,WAAW,CAAC,eAAe,EAAE,qBAAqB,CAAC,CAAC;QAC7F,OAAO,CAAC,aAAa,EAAE,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC;QAChD,MAAM,CAAC,MAAM,CAAC,sBAAsB,CAAC,SAAS,CAAC,CAAC;IAClD,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["// Copyright 2022 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport * as Common from '../../core/common/common.js';\nimport * as Host from '../../core/host/host.js';\nimport type * as Platform from '../../core/platform/platform.js';\nimport * as SDK from '../../core/sdk/sdk.js';\nimport * as Bindings from '../../models/bindings/bindings.js';\nimport * as Breakpoints from '../../models/breakpoints/breakpoints.js';\nimport * as Persistence from '../../models/persistence/persistence.js';\nimport * as Workspace from '../../models/workspace/workspace.js';\nimport {\n createTarget,\n describeWithEnvironment,\n} from '../../testing/EnvironmentHelpers.js';\nimport {describeWithMockConnection} from '../../testing/MockConnection.js';\nimport {\n createContentProviderUISourceCodes,\n createFileSystemUISourceCode,\n} from '../../testing/UISourceCodeHelpers.js';\nimport * as SourceFrame from '../../ui/legacy/components/source_frame/source_frame.js';\nimport * as UI from '../../ui/legacy/legacy.js';\n\nimport * as SourcesComponents from './components/components.js';\nimport * as Sources from './sources.js';\n\ndescribeWithEnvironment('SourcesView', () => {\n beforeEach(async () => {\n const actionRegistryInstance = UI.ActionRegistry.ActionRegistry.instance({forceNew: true});\n const workspace = Workspace.Workspace.WorkspaceImpl.instance();\n const targetManager = SDK.TargetManager.TargetManager.instance();\n const resourceMapping = new Bindings.ResourceMapping.ResourceMapping(targetManager, workspace);\n const debuggerWorkspaceBinding = Bindings.DebuggerWorkspaceBinding.DebuggerWorkspaceBinding.instance({\n forceNew: true,\n resourceMapping,\n targetManager,\n });\n const breakpointManager = Breakpoints.BreakpointManager.BreakpointManager.instance(\n {forceNew: true, targetManager, workspace, debuggerWorkspaceBinding});\n Persistence.Persistence.PersistenceImpl.instance({forceNew: true, workspace, breakpointManager});\n Persistence.NetworkPersistenceManager.NetworkPersistenceManager.instance({forceNew: true, workspace});\n UI.ShortcutRegistry.ShortcutRegistry.instance({forceNew: true, actionRegistry: actionRegistryInstance});\n });\n\n it('creates new source view of updated type when renamed file requires a different viewer', async () => {\n const sourcesView = new Sources.SourcesView.SourcesView();\n sourcesView.markAsRoot();\n sourcesView.show(document.body);\n const workspace = Workspace.Workspace.WorkspaceImpl.instance();\n const {uiSourceCode, project} = createFileSystemUISourceCode({\n url: 'file:///path/to/overrides/example.html' as Platform.DevToolsPath.UrlString,\n mimeType: 'text/html',\n });\n project.canSetFileContent = () => true;\n project.rename =\n (uiSourceCode: Workspace.UISourceCode.UISourceCode, newName: string,\n callback: (\n arg0: boolean, arg1?: string, arg2?: Platform.DevToolsPath.UrlString,\n arg3?: Common.ResourceType.ResourceType) => void) => {\n const newURL = ('file:///path/to/overrides/' + newName) as Platform.DevToolsPath.UrlString;\n let newContentType = Common.ResourceType.resourceTypes.Document;\n if (newName.endsWith('.jpg')) {\n newContentType = Common.ResourceType.resourceTypes.Image;\n } else if (newName.endsWith('.woff')) {\n newContentType = Common.ResourceType.resourceTypes.Font;\n }\n callback(true, newName, newURL, newContentType);\n };\n\n sourcesView.viewForFile(uiSourceCode);\n\n assert.instanceOf(sourcesView.getSourceView(uiSourceCode), Sources.UISourceCodeFrame.UISourceCodeFrame);\n\n // Rename, but contentType stays the same\n await uiSourceCode.rename('newName.html' as Platform.DevToolsPath.RawPathString);\n assert.instanceOf(sourcesView.getSourceView(uiSourceCode), Sources.UISourceCodeFrame.UISourceCodeFrame);\n\n // Rename which changes contentType\n await uiSourceCode.rename('image.jpg' as Platform.DevToolsPath.RawPathString);\n assert.instanceOf(sourcesView.getSourceView(uiSourceCode), SourceFrame.ImageView.ImageView);\n\n // Rename which changes contentType\n await uiSourceCode.rename('font.woff' as Platform.DevToolsPath.RawPathString);\n assert.instanceOf(sourcesView.getSourceView(uiSourceCode), SourceFrame.FontView.FontView);\n workspace.removeProject(project);\n sourcesView.detach();\n });\n\n it('creates a HeadersView when the filename is \\'.headers\\'', async () => {\n const sourcesView = new Sources.SourcesView.SourcesView();\n const uiSourceCode = new Workspace.UISourceCode.UISourceCode(\n {} as Persistence.FileSystemWorkspaceBinding.FileSystem,\n 'file:///path/to/overrides/www.example.com/.headers' as Platform.DevToolsPath.UrlString,\n Common.ResourceType.resourceTypes.Document);\n sinon.stub(uiSourceCode, 'mimeType').returns('text/plain');\n sourcesView.viewForFile(uiSourceCode);\n assert.instanceOf(sourcesView.getSourceView(uiSourceCode), SourcesComponents.HeadersView.HeadersView);\n });\n\n describe('viewForFile', () => {\n it('records the correct media type in the DevTools.SourcesPanelFileOpened metric', async () => {\n const sourcesView = new Sources.SourcesView.SourcesView();\n const {uiSourceCode} = createFileSystemUISourceCode({\n url: 'file:///path/to/project/example.ts' as Platform.DevToolsPath.UrlString,\n mimeType: 'text/typescript',\n content: 'export class Foo {}',\n });\n const sourcesPanelFileOpenedSpy = sinon.spy(Host.userMetrics, 'sourcesPanelFileOpened');\n const contentLoadedPromise = new Promise(res => window.addEventListener('source-file-loaded', res));\n const widget = sourcesView.viewForFile(uiSourceCode);\n assert.instanceOf(widget, Sources.UISourceCodeFrame.UISourceCodeFrame);\n const uiSourceCodeFrame = widget as Sources.UISourceCodeFrame.UISourceCodeFrame;\n\n // Skip creating the DebuggerPlugin, which times out and simulate DOM attach/showing.\n sinon.stub(uiSourceCodeFrame, 'loadPlugins' as keyof typeof uiSourceCodeFrame).callsFake(() => {});\n uiSourceCodeFrame.wasShown();\n\n await contentLoadedPromise;\n\n assert.isTrue(sourcesPanelFileOpenedSpy.calledWithExactly('text/typescript'));\n });\n });\n});\n\ndescribeWithMockConnection('SourcesView', () => {\n let target1: SDK.Target.Target;\n let target2: SDK.Target.Target;\n\n beforeEach(() => {\n const actionRegistryInstance = UI.ActionRegistry.ActionRegistry.instance({forceNew: true});\n UI.ShortcutRegistry.ShortcutRegistry.instance({forceNew: true, actionRegistry: actionRegistryInstance});\n target1 = createTarget();\n target2 = createTarget();\n const targetManager = target1.targetManager();\n targetManager.setScopeTarget(target1);\n const workspace = Workspace.Workspace.WorkspaceImpl.instance();\n\n const resourceMapping = new Bindings.ResourceMapping.ResourceMapping(targetManager, workspace);\n Bindings.CSSWorkspaceBinding.CSSWorkspaceBinding.instance({forceNew: true, resourceMapping, targetManager});\n const debuggerWorkspaceBinding = Bindings.DebuggerWorkspaceBinding.DebuggerWorkspaceBinding.instance({\n forceNew: true,\n resourceMapping,\n targetManager,\n });\n Bindings.IgnoreListManager.IgnoreListManager.instance({forceNew: true, debuggerWorkspaceBinding});\n const breakpointManager = Breakpoints.BreakpointManager.BreakpointManager.instance(\n {forceNew: true, targetManager, workspace, debuggerWorkspaceBinding});\n Persistence.Persistence.PersistenceImpl.instance({forceNew: true, workspace, breakpointManager});\n Persistence.NetworkPersistenceManager.NetworkPersistenceManager.instance({forceNew: true, workspace});\n });\n\n it('creates editor tabs only for in-scope uiSourceCodes', () => {\n const addUISourceCodeSpy =\n sinon.spy(Sources.TabbedEditorContainer.TabbedEditorContainer.prototype, 'addUISourceCode');\n const removeUISourceCodesSpy =\n sinon.spy(Sources.TabbedEditorContainer.TabbedEditorContainer.prototype, 'removeUISourceCodes');\n\n createContentProviderUISourceCodes({\n items: [\n {url: 'http://example.com/a.js' as Platform.DevToolsPath.UrlString, mimeType: 'application/javascript'},\n {url: 'http://example.com/b.js' as Platform.DevToolsPath.UrlString, mimeType: 'application/javascript'},\n ],\n projectId: 'projectId1',\n projectType: Workspace.Workspace.projectTypes.Network,\n target: target1,\n });\n\n createContentProviderUISourceCodes({\n items: [\n {url: 'http://foo.com/script.js' as Platform.DevToolsPath.UrlString, mimeType: 'application/javascript'},\n ],\n projectId: 'projectId2',\n projectType: Workspace.Workspace.projectTypes.Network,\n target: target2,\n });\n\n new Sources.SourcesView.SourcesView();\n let addedURLs = addUISourceCodeSpy.args.map(args => args[0].url());\n assert.deepEqual(addedURLs, ['http://example.com/a.js', 'http://example.com/b.js']);\n assert.isTrue(removeUISourceCodesSpy.notCalled);\n\n addUISourceCodeSpy.resetHistory();\n target2.targetManager().setScopeTarget(target2);\n addedURLs = addUISourceCodeSpy.args.map(args => args[0].url());\n assert.deepEqual(addedURLs, ['http://foo.com/script.js']);\n const removedURLs = removeUISourceCodesSpy.args.map(args => args[0][0].url());\n assert.deepEqual(removedURLs, ['http://example.com/a.js', 'http://example.com/b.js']);\n });\n\n it('doesn\\'t remove non-network UISourceCodes when changing the scope target', () => {\n createFileSystemUISourceCode({\n url: 'snippet:///foo.js' as Platform.DevToolsPath.UrlString,\n mimeType: 'application/javascript',\n type: 'snippets',\n });\n\n const sourcesView = new Sources.SourcesView.SourcesView();\n const removeUISourceCodesSpy = sinon.spy(sourcesView.editorContainer, 'removeUISourceCodes');\n target2.targetManager().setScopeTarget(target2);\n assert.isTrue(removeUISourceCodesSpy.notCalled);\n });\n});\n"]} \ No newline at end of file diff --git a/public/panels/sources/TabbedEditorContainer.test.js b/public/panels/sources/TabbedEditorContainer.test.js index f29acdc3d..117bee633 100644 --- a/public/panels/sources/TabbedEditorContainer.test.js +++ b/public/panels/sources/TabbedEditorContainer.test.js @@ -42,16 +42,16 @@ describe('TabbedEditorContainer', () => { assert.lengthOf(keys, 3); assert.propertyVal(keys[0], 'url', 'http://localhost/foo.js'); assert.propertyVal(keys[0], 'resourceType', Common.ResourceType.resourceTypes.Script); - assert.strictEqual(history.selectionRange(keys[0]), undefined); - assert.strictEqual(history.scrollLineNumber(keys[0]), undefined); + assert.isUndefined(history.selectionRange(keys[0])); + assert.isUndefined(history.scrollLineNumber(keys[0])); assert.propertyVal(keys[1], 'url', 'webpack:///src/foo.vue'); assert.propertyVal(keys[1], 'resourceType', Common.ResourceType.resourceTypes.SourceMapScript); - assert.strictEqual(history.selectionRange(keys[1]), undefined); + assert.isUndefined(history.selectionRange(keys[1])); assert.strictEqual(history.scrollLineNumber(keys[1]), 5); assert.propertyVal(keys[2], 'url', 'http://localhost/foo.js'); assert.propertyVal(keys[2], 'resourceType', Common.ResourceType.resourceTypes.SourceMapScript); - assert.strictEqual(history.selectionRange(keys[2]), undefined); - assert.strictEqual(history.scrollLineNumber(keys[2]), undefined); + assert.isUndefined(history.selectionRange(keys[2])); + assert.isUndefined(history.scrollLineNumber(keys[2])); }); it('gracefully ignores items with invalid resource type names', () => { const history = History.fromObject([ diff --git a/public/panels/sources/TabbedEditorContainer.test.js.map b/public/panels/sources/TabbedEditorContainer.test.js.map index 0d1974b25..d179275e4 100644 --- a/public/panels/sources/TabbedEditorContainer.test.js.map +++ b/public/panels/sources/TabbedEditorContainer.test.js.map @@ -1 +1 @@ -{"version":3,"file":"TabbedEditorContainer.test.js","sourceRoot":"","sources":["../../../../../../front_end/panels/sources/TabbedEditorContainer.test.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,KAAK,MAAM,MAAM,6BAA6B,CAAC;AAGtD,OAAO,KAAK,OAAO,MAAM,cAAc,CAAC;AAExC,QAAQ,CAAC,uBAAuB,EAAE,GAAG,EAAE;IACrC,QAAQ,CAAC,aAAa,EAAE,GAAG,EAAE;QAC3B,MAAM,EAAC,WAAW,EAAC,GAAG,OAAO,CAAC,qBAAqB,CAAC;QACpD,MAAM,GAAG,GAAG,kBAAqD,CAAC;QAElE,QAAQ,CAAC,YAAY,EAAE,GAAG,EAAE;YAC1B,EAAE,CAAC,qCAAqC,EAAE,GAAG,EAAE;gBAC7C,MAAM,CAAC,MAAM,CAAC,GAAG,EAAE;oBACjB,WAAW,CAAC,UAAU,CAAC,EAAC,GAAG,EAAE,gBAAgB,EAAE,iCAAiC,EAAC,CAAC,CAAC;gBACrF,CAAC,CAAC,CAAC;YACL,CAAC,CAAC,CAAC;YAEH,EAA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;oBAC1B,IAAI,WAAW,CACX,wBAA2D,EAC3D,MAAM,CAAC,YAAY,CAAC,aAAa,CAAC,eAAe,CAAC;oBACtD,IAAI,WAAW,CACX,yBAA4D,EAAE,MAAM,CAAC,YAAY,CAAC,aAAa,CAAC,MAAM,CAAC;oBAC3G,IAAI,WAAW,CACX,yBAA4D,EAC5D,MAAM,CAAC,YAAY,CAAC,aAAa,CAAC,eAAe,CAAC;iBACvD,CAAC,CAAC;gBACH,OAAO,CAAC,MAAM,CAAC,CAAC;wBACd,GAAG,EAAE,yBAA4D;wBACjE,YAAY,EAAE,MAAM,CAAC,YAAY,CAAC,aAAa,CAAC,MAAM;qBACvD,CAAC,CAAC,CAAC;gBACJ,MAAM,CAAC,WAAW,CACd,OAAO,CAAC,KAAK,CAAC;oBACZ,GAAG,EAAE,yBAA4D;oBACjE,YAAY,EAAE,MAAM,CAAC,YAAY,CAAC,aAAa,CAAC,MAAM;iBACvD,CAAC,EACF,CAAC,CACJ,CAAC;YACJ,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["// Copyright 2019 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport * as Common from '../../core/common/common.js';\nimport type * as Platform from '../../core/platform/platform.js';\n\nimport * as Sources from './sources.js';\n\ndescribe('TabbedEditorContainer', () => {\n describe('HistoryItem', () => {\n const {HistoryItem} = Sources.TabbedEditorContainer;\n const url = 'http://localhost' as Platform.DevToolsPath.UrlString;\n\n describe('fromObject', () => {\n it('rejects invalid resource type names', () => {\n assert.throws(() => {\n HistoryItem.fromObject({url, resourceTypeName: 'some-invalid-resource-type-name'});\n });\n });\n\n it('correctly deserializes resource type names', () => {\n for (const resourceType of Object.values(Common.ResourceType.resourceTypes)) {\n const resourceTypeName = resourceType.name();\n assert.propertyVal(HistoryItem.fromObject({url, resourceTypeName}), 'resourceType', resourceType);\n }\n });\n });\n\n describe('toObject', () => {\n it('correctly serializes resource types', () => {\n for (const resourceType of Object.values(Common.ResourceType.resourceTypes)) {\n const item = new HistoryItem(url, resourceType);\n assert.propertyVal(item.toObject(), 'resourceTypeName', resourceType.name());\n }\n });\n });\n });\n\n describe('History', () => {\n const {History, HistoryItem} = Sources.TabbedEditorContainer;\n\n describe('fromObject', () => {\n it('deserializes correctly', () => {\n const history = History.fromObject([\n {url: 'http://localhost/foo.js', resourceTypeName: 'script'},\n {url: 'webpack:///src/foo.vue', resourceTypeName: 'sm-script', scrollLineNumber: 5},\n {url: 'http://localhost/foo.js', resourceTypeName: 'sm-script'},\n ]);\n const keys = history.keys();\n assert.lengthOf(keys, 3);\n assert.propertyVal(keys[0], 'url', 'http://localhost/foo.js');\n assert.propertyVal(keys[0], 'resourceType', Common.ResourceType.resourceTypes.Script);\n assert.strictEqual(history.selectionRange(keys[0]), undefined);\n assert.strictEqual(history.scrollLineNumber(keys[0]), undefined);\n assert.propertyVal(keys[1], 'url', 'webpack:///src/foo.vue');\n assert.propertyVal(keys[1], 'resourceType', Common.ResourceType.resourceTypes.SourceMapScript);\n assert.strictEqual(history.selectionRange(keys[1]), undefined);\n assert.strictEqual(history.scrollLineNumber(keys[1]), 5);\n assert.propertyVal(keys[2], 'url', 'http://localhost/foo.js');\n assert.propertyVal(keys[2], 'resourceType', Common.ResourceType.resourceTypes.SourceMapScript);\n assert.strictEqual(history.selectionRange(keys[2]), undefined);\n assert.strictEqual(history.scrollLineNumber(keys[2]), undefined);\n });\n\n it('gracefully ignores items with invalid resource type names', () => {\n const history = History.fromObject([\n {url: 'http://localhost/foo.js', resourceTypeName: 'script'},\n {url: 'http://localhost/baz.js', resourceTypeName: 'some-invalid-resource-type-name'},\n {url: 'http://localhost/bar.js', resourceTypeName: 'sm-script'},\n ]);\n const keys = history.keys();\n assert.lengthOf(keys, 2);\n assert.propertyVal(keys[0], 'url', 'http://localhost/foo.js');\n assert.propertyVal(keys[1], 'url', 'http://localhost/bar.js');\n });\n });\n\n describe('toObject', () => {\n it('serializes correctly', () => {\n const history = new History([\n new HistoryItem(\n 'http://localhost/foo.js' as Platform.DevToolsPath.UrlString, Common.ResourceType.resourceTypes.Script),\n new HistoryItem(\n 'webpack:///src/foo.vue' as Platform.DevToolsPath.UrlString,\n Common.ResourceType.resourceTypes.SourceMapScript, undefined, 5),\n new HistoryItem(\n 'http://localhost/foo.js' as Platform.DevToolsPath.UrlString,\n Common.ResourceType.resourceTypes.SourceMapScript),\n ]);\n const serializedHistory = history.toObject();\n assert.lengthOf(serializedHistory, 3);\n assert.propertyVal(serializedHistory[0], 'url', 'http://localhost/foo.js');\n assert.propertyVal(serializedHistory[0], 'resourceTypeName', 'script');\n assert.propertyVal(serializedHistory[1], 'url', 'webpack:///src/foo.vue');\n assert.propertyVal(serializedHistory[1], 'resourceTypeName', 'sm-script');\n assert.propertyVal(serializedHistory[1], 'scrollLineNumber', 5);\n assert.propertyVal(serializedHistory[2], 'url', 'http://localhost/foo.js');\n assert.propertyVal(serializedHistory[2], 'resourceTypeName', 'sm-script');\n });\n });\n\n describe('update', () => {\n it('moves items referenced by keys to the beginning', () => {\n const history = new History([\n new HistoryItem(\n 'webpack:///src/foo.vue' as Platform.DevToolsPath.UrlString,\n Common.ResourceType.resourceTypes.SourceMapScript),\n new HistoryItem(\n 'http://localhost/foo.js' as Platform.DevToolsPath.UrlString, Common.ResourceType.resourceTypes.Script),\n new HistoryItem(\n 'http://localhost/foo.js' as Platform.DevToolsPath.UrlString,\n Common.ResourceType.resourceTypes.SourceMapScript),\n ]);\n history.update([{\n url: 'http://localhost/foo.js' as Platform.DevToolsPath.UrlString,\n resourceType: Common.ResourceType.resourceTypes.Script,\n }]);\n assert.strictEqual(\n history.index({\n url: 'http://localhost/foo.js' as Platform.DevToolsPath.UrlString,\n resourceType: Common.ResourceType.resourceTypes.Script,\n }),\n 0,\n );\n });\n });\n });\n});\n"]} \ No newline at end of file +{"version":3,"file":"TabbedEditorContainer.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J,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["// Copyright 2019 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport * as Common from '../../core/common/common.js';\nimport type * as Platform from '../../core/platform/platform.js';\n\nimport * as Sources from './sources.js';\n\ndescribe('TabbedEditorContainer', () => {\n describe('HistoryItem', () => {\n const {HistoryItem} = Sources.TabbedEditorContainer;\n const url = 'http://localhost' as Platform.DevToolsPath.UrlString;\n\n describe('fromObject', () => {\n it('rejects invalid resource type names', () => {\n assert.throws(() => {\n HistoryItem.fromObject({url, resourceTypeName: 'some-invalid-resource-type-name'});\n });\n });\n\n it('correctly deserializes resource type names', () => {\n for (const resourceType of Object.values(Common.ResourceType.resourceTypes)) {\n const resourceTypeName = resourceType.name();\n assert.propertyVal(HistoryItem.fromObject({url, resourceTypeName}), 'resourceType', resourceType);\n }\n });\n });\n\n describe('toObject', () => {\n it('correctly serializes resource types', () => {\n for (const resourceType of Object.values(Common.ResourceType.resourceTypes)) {\n const item = new HistoryItem(url, resourceType);\n assert.propertyVal(item.toObject(), 'resourceTypeName', resourceType.name());\n }\n });\n });\n });\n\n describe('History', () => {\n const {History, HistoryItem} = Sources.TabbedEditorContainer;\n\n describe('fromObject', () => {\n it('deserializes correctly', () => {\n const history = History.fromObject([\n {url: 'http://localhost/foo.js', resourceTypeName: 'script'},\n {url: 'webpack:///src/foo.vue', resourceTypeName: 'sm-script', scrollLineNumber: 5},\n {url: 'http://localhost/foo.js', resourceTypeName: 'sm-script'},\n ]);\n const keys = history.keys();\n assert.lengthOf(keys, 3);\n assert.propertyVal(keys[0], 'url', 'http://localhost/foo.js');\n assert.propertyVal(keys[0], 'resourceType', Common.ResourceType.resourceTypes.Script);\n assert.isUndefined(history.selectionRange(keys[0]));\n assert.isUndefined(history.scrollLineNumber(keys[0]));\n assert.propertyVal(keys[1], 'url', 'webpack:///src/foo.vue');\n assert.propertyVal(keys[1], 'resourceType', Common.ResourceType.resourceTypes.SourceMapScript);\n assert.isUndefined(history.selectionRange(keys[1]));\n assert.strictEqual(history.scrollLineNumber(keys[1]), 5);\n assert.propertyVal(keys[2], 'url', 'http://localhost/foo.js');\n assert.propertyVal(keys[2], 'resourceType', Common.ResourceType.resourceTypes.SourceMapScript);\n assert.isUndefined(history.selectionRange(keys[2]));\n assert.isUndefined(history.scrollLineNumber(keys[2]));\n });\n\n it('gracefully ignores items with invalid resource type names', () => {\n const history = History.fromObject([\n {url: 'http://localhost/foo.js', resourceTypeName: 'script'},\n {url: 'http://localhost/baz.js', resourceTypeName: 'some-invalid-resource-type-name'},\n {url: 'http://localhost/bar.js', resourceTypeName: 'sm-script'},\n ]);\n const keys = history.keys();\n assert.lengthOf(keys, 2);\n assert.propertyVal(keys[0], 'url', 'http://localhost/foo.js');\n assert.propertyVal(keys[1], 'url', 'http://localhost/bar.js');\n });\n });\n\n describe('toObject', () => {\n it('serializes correctly', () => {\n const history = new History([\n new HistoryItem(\n 'http://localhost/foo.js' as Platform.DevToolsPath.UrlString, Common.ResourceType.resourceTypes.Script),\n new HistoryItem(\n 'webpack:///src/foo.vue' as Platform.DevToolsPath.UrlString,\n Common.ResourceType.resourceTypes.SourceMapScript, undefined, 5),\n new HistoryItem(\n 'http://localhost/foo.js' as Platform.DevToolsPath.UrlString,\n Common.ResourceType.resourceTypes.SourceMapScript),\n ]);\n const serializedHistory = history.toObject();\n assert.lengthOf(serializedHistory, 3);\n assert.propertyVal(serializedHistory[0], 'url', 'http://localhost/foo.js');\n assert.propertyVal(serializedHistory[0], 'resourceTypeName', 'script');\n assert.propertyVal(serializedHistory[1], 'url', 'webpack:///src/foo.vue');\n assert.propertyVal(serializedHistory[1], 'resourceTypeName', 'sm-script');\n assert.propertyVal(serializedHistory[1], 'scrollLineNumber', 5);\n assert.propertyVal(serializedHistory[2], 'url', 'http://localhost/foo.js');\n assert.propertyVal(serializedHistory[2], 'resourceTypeName', 'sm-script');\n });\n });\n\n describe('update', () => {\n it('moves items referenced by keys to the beginning', () => {\n const history = new History([\n new HistoryItem(\n 'webpack:///src/foo.vue' as Platform.DevToolsPath.UrlString,\n Common.ResourceType.resourceTypes.SourceMapScript),\n new HistoryItem(\n 'http://localhost/foo.js' as Platform.DevToolsPath.UrlString, Common.ResourceType.resourceTypes.Script),\n new HistoryItem(\n 'http://localhost/foo.js' as Platform.DevToolsPath.UrlString,\n Common.ResourceType.resourceTypes.SourceMapScript),\n ]);\n history.update([{\n url: 'http://localhost/foo.js' as Platform.DevToolsPath.UrlString,\n resourceType: Common.ResourceType.resourceTypes.Script,\n }]);\n assert.strictEqual(\n history.index({\n url: 'http://localhost/foo.js' as Platform.DevToolsPath.UrlString,\n resourceType: Common.ResourceType.resourceTypes.Script,\n }),\n 0,\n );\n });\n });\n });\n});\n"]} \ No newline at end of file diff --git a/public/panels/sources/UISourceCodeFrame.js b/public/panels/sources/UISourceCodeFrame.js index dafe89a4d..0589d5620 100644 --- a/public/panels/sources/UISourceCodeFrame.js +++ b/public/panels/sources/UISourceCodeFrame.js @@ -676,11 +676,9 @@ function renderMessage(message, count) { icon.addEventListener('click', () => (message.clickHandler() || Math.min)()); } else { - const repeatCountElement = document.createElement('span', { is: 'dt-small-bubble' }); + const repeatCountElement = element.createChild('dt-small-bubble', 'text-editor-row-message-repeat-count'); repeatCountElement.textContent = String(count); - repeatCountElement.classList.add('text-editor-row-message-repeat-count'); repeatCountElement.style.flexShrink = '0'; - element.appendChild(repeatCountElement); repeatCountElement.type = getBubbleTypePerLevel(message.level()); } const linesContainer = element.createChild('div'); diff --git a/public/panels/sources/UISourceCodeFrame.js.map b/public/panels/sources/UISourceCodeFrame.js.map index 852041a70..069c0366d 100644 --- a/public/panels/sources/UISourceCodeFrame.js.map +++ b/public/panels/sources/UISourceCodeFrame.js.map @@ -1 +1 @@ -{"version":3,"file":"UISourceCodeFrame.js","sourceRoot":"","sources":["../../../../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mBAAmB,EAAE;QACnB,eAAe,EAAE,6BAA6B;QAC9C,gBAAgB,EAAE,UAAU;QAC5B,kBAAkB,EAAE,QAAQ;QAC5B,aAAa,EAAE,KAAK;KACrB;IAED,iBAAiB,EAAE;QACjB,MAAM,EAAE,SAAS;QACjB,OAAO,EAAE;YACP,aAAa,EAAE,aAAa;YAC5B,UAAU,EAAE,KAAK;SAClB;KACF;IAED,8CAA8C,EAAE;QAC9C,SAAS,EAAE,MAAM;QACjB,YAAY,EAAE,MAAM;KACrB;CACF,CAAC,CAAC;AAEH,SAAS,WAAW,CAAC,eAA6B;IAChD,OAAO;QACL,eAAe,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,qBAAqB,CAAC,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,eAAe,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC;QAC3G,eAAe;KAChB,CAAC;AACJ,CAAC","sourcesContent":["/*\n * Copyright (C) 2012 Google Inc. All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are\n * met:\n *\n * * Redistributions of source code must retain the above copyright\n * notice, this list of conditions and the following disclaimer.\n * * Redistributions in binary form must reproduce the above\n * copyright notice, this list of conditions and the following disclaimer\n * in the documentation and/or other materials provided with the\n * distribution.\n * * Neither the name of Google Inc. nor the names of its\n * contributors may be used to endorse or promote products derived from\n * this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nimport * as Common from '../../core/common/common.js';\nimport * as Host from '../../core/host/host.js';\nimport * as FormatterActions from '../../entrypoints/formatter_worker/FormatterActions.js'; // eslint-disable-line rulesdir/es-modules-import\nimport * as IssuesManager from '../../models/issues_manager/issues_manager.js';\nimport * as Persistence from '../../models/persistence/persistence.js';\nimport * as TextUtils from '../../models/text_utils/text_utils.js';\nimport * as Workspace from '../../models/workspace/workspace.js';\nimport * as CodeMirror from '../../third_party/codemirror.next/codemirror.next.js';\nimport * as IconButton from '../../ui/components/icon_button/icon_button.js';\nimport * as IssueCounter from '../../ui/components/issue_counter/issue_counter.js';\nimport * as SourceFrame from '../../ui/legacy/components/source_frame/source_frame.js';\nimport * as UI from '../../ui/legacy/legacy.js';\n\nimport {CoveragePlugin} from './CoveragePlugin.js';\nimport {CSSPlugin} from './CSSPlugin.js';\nimport {DebuggerPlugin} from './DebuggerPlugin.js';\nimport type {Plugin} from './Plugin.js';\nimport {MemoryProfilePlugin, PerformanceProfilePlugin} from './ProfilePlugin.js';\nimport {ResourceOriginPlugin} from './ResourceOriginPlugin.js';\nimport {SnippetsPlugin} from './SnippetsPlugin.js';\nimport {SourcesPanel} from './SourcesPanel.js';\n\nfunction sourceFramePlugins(): (typeof Plugin)[] {\n // The order of these plugins matters for toolbar items and editor\n // extension precedence\n return [\n CSSPlugin,\n DebuggerPlugin,\n SnippetsPlugin,\n ResourceOriginPlugin,\n CoveragePlugin,\n MemoryProfilePlugin,\n PerformanceProfilePlugin,\n ];\n}\n\nexport class UISourceCodeFrame extends\n Common.ObjectWrapper.eventMixin(\n SourceFrame.SourceFrame.SourceFrameImpl) {\n private uiSourceCodeInternal: Workspace.UISourceCode.UISourceCode;\n private muteSourceCodeEvents: boolean;\n private persistenceBinding: Persistence.Persistence.PersistenceBinding|null;\n private uiSourceCodeEventListeners: Common.EventTarget.EventDescriptor[];\n private messageAndDecorationListeners: Common.EventTarget.EventDescriptor[];\n private readonly boundOnBindingChanged: () => void;\n // The active plugins. These are created in setContent, and\n // recreated when the binding changes\n private plugins: Plugin[] = [];\n private readonly errorPopoverHelper: UI.PopoverHelper.PopoverHelper;\n #sourcesPanelOpenedMetricsRecorded = false;\n\n constructor(uiSourceCode: Workspace.UISourceCode.UISourceCode) {\n super(() => this.workingCopy());\n\n this.uiSourceCodeInternal = uiSourceCode;\n\n this.muteSourceCodeEvents = false;\n\n this.persistenceBinding = Persistence.Persistence.PersistenceImpl.instance().binding(uiSourceCode);\n\n this.uiSourceCodeEventListeners = [];\n this.messageAndDecorationListeners = [];\n\n this.boundOnBindingChanged = this.onBindingChanged.bind(this);\n\n Common.Settings.Settings.instance()\n .moduleSetting('persistence-network-overrides-enabled')\n .addChangeListener(this.onNetworkPersistenceChanged, this);\n\n this.errorPopoverHelper = new UI.PopoverHelper.PopoverHelper(\n this.textEditor.editor.contentDOM, this.getErrorPopoverContent.bind(this), 'sources.error');\n this.errorPopoverHelper.setHasPadding(true);\n\n this.errorPopoverHelper.setTimeout(100, 100);\n\n this.initializeUISourceCode();\n }\n\n private async workingCopy(): Promise {\n if (this.uiSourceCodeInternal.isDirty()) {\n return this.uiSourceCodeInternal.workingCopyContentData();\n }\n return this.uiSourceCodeInternal.requestContentData();\n }\n\n protected override editorConfiguration(doc: string): CodeMirror.Extension {\n return [\n super.editorConfiguration(doc),\n rowMessages(this.allMessages()),\n // Inject editor extensions from plugins\n pluginCompartment.of(this.plugins.map(plugin => plugin.editorExtension())),\n ];\n }\n\n protected override onFocus(): void {\n super.onFocus();\n UI.Context.Context.instance().setFlavor(UISourceCodeFrame, this);\n }\n\n protected override onBlur(): void {\n super.onBlur();\n UI.Context.Context.instance().setFlavor(UISourceCodeFrame, null);\n }\n\n private installMessageAndDecorationListeners(): void {\n if (this.persistenceBinding) {\n const networkSourceCode = this.persistenceBinding.network;\n const fileSystemSourceCode = this.persistenceBinding.fileSystem;\n this.messageAndDecorationListeners = [\n networkSourceCode.addEventListener(Workspace.UISourceCode.Events.MessageAdded, this.onMessageAdded, this),\n networkSourceCode.addEventListener(Workspace.UISourceCode.Events.MessageRemoved, this.onMessageRemoved, this),\n networkSourceCode.addEventListener(\n Workspace.UISourceCode.Events.DecorationChanged, this.onDecorationChanged, this),\n\n fileSystemSourceCode.addEventListener(Workspace.UISourceCode.Events.MessageAdded, this.onMessageAdded, this),\n fileSystemSourceCode.addEventListener(\n Workspace.UISourceCode.Events.MessageRemoved, this.onMessageRemoved, this),\n ];\n } else {\n this.messageAndDecorationListeners = [\n this.uiSourceCodeInternal.addEventListener(\n Workspace.UISourceCode.Events.MessageAdded, this.onMessageAdded, this),\n this.uiSourceCodeInternal.addEventListener(\n Workspace.UISourceCode.Events.MessageRemoved, this.onMessageRemoved, this),\n this.uiSourceCodeInternal.addEventListener(\n Workspace.UISourceCode.Events.DecorationChanged, this.onDecorationChanged, this),\n ];\n }\n }\n\n uiSourceCode(): Workspace.UISourceCode.UISourceCode {\n return this.uiSourceCodeInternal;\n }\n\n setUISourceCode(uiSourceCode: Workspace.UISourceCode.UISourceCode): void {\n const loaded = uiSourceCode.contentLoaded() ? Promise.resolve() : uiSourceCode.requestContent();\n const startUISourceCode = this.uiSourceCodeInternal;\n loaded.then(async () => {\n if (this.uiSourceCodeInternal !== startUISourceCode) {\n return;\n }\n this.unloadUISourceCode();\n this.uiSourceCodeInternal = uiSourceCode;\n if (uiSourceCode.workingCopy() !== this.textEditor.state.doc.toString()) {\n await this.setContentDataOrError(Promise.resolve(uiSourceCode.workingCopyContentData()));\n } else {\n this.reloadPlugins();\n }\n this.initializeUISourceCode();\n }, console.error);\n }\n\n private unloadUISourceCode(): void {\n Common.EventTarget.removeEventListeners(this.messageAndDecorationListeners);\n Common.EventTarget.removeEventListeners(this.uiSourceCodeEventListeners);\n this.uiSourceCodeInternal.removeWorkingCopyGetter();\n Persistence.Persistence.PersistenceImpl.instance().unsubscribeFromBindingEvent(\n this.uiSourceCodeInternal, this.boundOnBindingChanged);\n }\n\n private initializeUISourceCode(): void {\n this.uiSourceCodeEventListeners = [\n this.uiSourceCodeInternal.addEventListener(\n Workspace.UISourceCode.Events.WorkingCopyChanged, this.onWorkingCopyChanged, this),\n this.uiSourceCodeInternal.addEventListener(\n Workspace.UISourceCode.Events.WorkingCopyCommitted, this.onWorkingCopyCommitted, this),\n this.uiSourceCodeInternal.addEventListener(Workspace.UISourceCode.Events.TitleChanged, this.onTitleChanged, this),\n ];\n\n Persistence.Persistence.PersistenceImpl.instance().subscribeForBindingEvent(\n this.uiSourceCodeInternal, this.boundOnBindingChanged);\n this.installMessageAndDecorationListeners();\n this.updateStyle();\n const canPrettyPrint = FormatterActions.FORMATTABLE_MEDIA_TYPES.includes(this.contentType) &&\n !this.uiSourceCodeInternal.project().canSetFileContent() &&\n Persistence.Persistence.PersistenceImpl.instance().binding(this.uiSourceCodeInternal) === null;\n const autoPrettyPrint = !this.uiSourceCodeInternal.contentType().isFromSourceMap();\n this.setCanPrettyPrint(canPrettyPrint, autoPrettyPrint);\n }\n\n override wasShown(): void {\n super.wasShown();\n this.setEditable(this.canEditSourceInternal());\n }\n\n override willHide(): void {\n for (const plugin of this.plugins) {\n plugin.willHide();\n }\n super.willHide();\n UI.Context.Context.instance().setFlavor(UISourceCodeFrame, null);\n this.uiSourceCodeInternal.removeWorkingCopyGetter();\n }\n\n protected override getContentType(): string {\n const binding = Persistence.Persistence.PersistenceImpl.instance().binding(this.uiSourceCodeInternal);\n const mimeType = binding ? binding.network.mimeType() : this.uiSourceCodeInternal.mimeType();\n return Common.ResourceType.ResourceType.simplifyContentType(mimeType);\n }\n\n canEditSourceInternal(): boolean {\n if (this.hasLoadError()) {\n return false;\n }\n if (this.uiSourceCodeInternal.editDisabled()) {\n return false;\n }\n if (this.uiSourceCodeInternal.mimeType() === 'application/wasm') {\n return false;\n }\n if (Persistence.Persistence.PersistenceImpl.instance().binding(this.uiSourceCodeInternal)) {\n return true;\n }\n if (this.uiSourceCodeInternal.project().canSetFileContent()) {\n return true;\n }\n if (this.uiSourceCodeInternal.project().isServiceProject()) {\n return false;\n }\n if (this.uiSourceCodeInternal.project().type() === Workspace.Workspace.projectTypes.Network &&\n Persistence.NetworkPersistenceManager.NetworkPersistenceManager.instance().active()) {\n return true;\n }\n // Because live edit fails on large whitespace changes, pretty printed scripts are not editable.\n if (this.pretty && this.uiSourceCodeInternal.contentType().hasScripts()) {\n return false;\n }\n return this.uiSourceCodeInternal.contentType() !== Common.ResourceType.resourceTypes.Document;\n }\n\n private onNetworkPersistenceChanged(): void {\n this.setEditable(this.canEditSourceInternal());\n }\n\n commitEditing(): void {\n if (!this.uiSourceCodeInternal.isDirty()) {\n return;\n }\n\n this.muteSourceCodeEvents = true;\n this.uiSourceCodeInternal.commitWorkingCopy();\n this.muteSourceCodeEvents = false;\n }\n\n override async setContent(content: string): Promise {\n this.disposePlugins();\n this.loadPlugins();\n await super.setContent(content);\n for (const plugin of this.plugins) {\n plugin.editorInitialized(this.textEditor);\n }\n this.#recordSourcesPanelOpenedMetrics();\n Common.EventTarget.fireEvent('source-file-loaded', this.uiSourceCodeInternal.displayName(true));\n }\n\n private createMessage(origin: Workspace.UISourceCode.Message): RowMessage {\n const {lineNumber, columnNumber} = this.uiLocationToEditorLocation(origin.lineNumber(), origin.columnNumber());\n return new RowMessage(origin, lineNumber, columnNumber);\n }\n\n private allMessages(): RowMessage[] {\n const origins = this.persistenceBinding !== null ?\n [...this.persistenceBinding.network.messages(), ...this.persistenceBinding.fileSystem.messages()] :\n [...this.uiSourceCodeInternal.messages()];\n return origins.map(origin => this.createMessage(origin));\n }\n\n override onTextChanged(): void {\n const wasPretty = this.pretty;\n super.onTextChanged();\n this.errorPopoverHelper.hidePopover();\n SourcesPanel.instance().updateLastModificationTime();\n this.muteSourceCodeEvents = true;\n if (this.isClean()) {\n this.uiSourceCodeInternal.resetWorkingCopy();\n } else {\n this.uiSourceCodeInternal.setWorkingCopyGetter(() => this.textEditor.state.sliceDoc());\n }\n this.muteSourceCodeEvents = false;\n if (wasPretty !== this.pretty) {\n this.updateStyle();\n this.reloadPlugins();\n }\n }\n\n onWorkingCopyChanged(): void {\n if (this.muteSourceCodeEvents) {\n return;\n }\n this.maybeSetContent(this.uiSourceCodeInternal.workingCopyContentData());\n }\n\n private onWorkingCopyCommitted(): void {\n if (!this.muteSourceCodeEvents) {\n this.maybeSetContent(this.uiSourceCode().workingCopyContentData());\n }\n this.contentCommitted();\n this.updateStyle();\n }\n\n private reloadPlugins(): void {\n this.disposePlugins();\n this.loadPlugins();\n const editor = this.textEditor;\n editor.dispatch({effects: pluginCompartment.reconfigure(this.plugins.map(plugin => plugin.editorExtension()))});\n for (const plugin of this.plugins) {\n plugin.editorInitialized(editor);\n }\n }\n\n private onTitleChanged(): void {\n this.updateLanguageMode('').then(() => this.reloadPlugins(), console.error);\n }\n\n private loadPlugins(): void {\n const binding = Persistence.Persistence.PersistenceImpl.instance().binding(this.uiSourceCodeInternal);\n const pluginUISourceCode = binding ? binding.network : this.uiSourceCodeInternal;\n\n for (const pluginType of sourceFramePlugins()) {\n if (pluginType.accepts(pluginUISourceCode)) {\n this.plugins.push(new pluginType(pluginUISourceCode, this));\n }\n }\n\n this.dispatchEventToListeners(Events.TOOLBAR_ITEMS_CHANGED);\n }\n\n private disposePlugins(): void {\n for (const plugin of this.plugins) {\n plugin.dispose();\n }\n this.plugins = [];\n }\n\n private onBindingChanged(): void {\n const binding = Persistence.Persistence.PersistenceImpl.instance().binding(this.uiSourceCodeInternal);\n if (binding === this.persistenceBinding) {\n return;\n }\n this.unloadUISourceCode();\n this.persistenceBinding = binding;\n this.initializeUISourceCode();\n this.reloadMessages();\n this.reloadPlugins();\n }\n\n private reloadMessages(): void {\n const messages = this.allMessages();\n const {editor} = this.textEditor;\n editor.dispatch({effects: setRowMessages.of(RowMessages.create(messages))});\n }\n\n private updateStyle(): void {\n this.setEditable(this.canEditSourceInternal());\n }\n\n private maybeSetContent(content: TextUtils.ContentData.ContentData): void {\n if (this.textEditor.state.doc.toString() !== content.text) {\n void this.setContentDataOrError(Promise.resolve(content));\n }\n }\n\n protected override populateTextAreaContextMenu(\n contextMenu: UI.ContextMenu.ContextMenu, lineNumber: number, columnNumber: number): void {\n super.populateTextAreaContextMenu(contextMenu, lineNumber, columnNumber);\n contextMenu.appendApplicableItems(this.uiSourceCodeInternal);\n const location = this.editorLocationToUILocation(lineNumber, columnNumber);\n contextMenu.appendApplicableItems(\n new Workspace.UISourceCode.UILocation(this.uiSourceCodeInternal, location.lineNumber, location.columnNumber));\n for (const plugin of this.plugins) {\n plugin.populateTextAreaContextMenu(contextMenu, lineNumber, columnNumber);\n }\n }\n\n protected override populateLineGutterContextMenu(contextMenu: UI.ContextMenu.ContextMenu, lineNumber: number): void {\n super.populateLineGutterContextMenu(contextMenu, lineNumber);\n for (const plugin of this.plugins) {\n plugin.populateLineGutterContextMenu(contextMenu, lineNumber);\n }\n }\n\n dispose(): void {\n this.errorPopoverHelper.dispose();\n this.disposePlugins();\n this.unloadUISourceCode();\n this.textEditor.editor.destroy();\n this.detach();\n Common.Settings.Settings.instance()\n .moduleSetting('persistence-network-overrides-enabled')\n .removeChangeListener(this.onNetworkPersistenceChanged, this);\n }\n\n private onMessageAdded(event: Common.EventTarget.EventTargetEvent): void {\n const {editor} = this.textEditor, shownMessages = editor.state.field(showRowMessages, false);\n if (shownMessages) {\n const message = this.createMessage(event.data);\n editor.dispatch({effects: setRowMessages.of(shownMessages.messages.add(message))});\n }\n }\n\n private onMessageRemoved(event: Common.EventTarget.EventTargetEvent): void {\n const {editor} = this.textEditor, shownMessages = editor.state.field(showRowMessages, false);\n if (shownMessages) {\n const message = this.createMessage(event.data);\n editor.dispatch({effects: setRowMessages.of(shownMessages.messages.remove(message))});\n }\n }\n\n private onDecorationChanged(event: Common.EventTarget.EventTargetEvent): void {\n for (const plugin of this.plugins) {\n plugin.decorationChanged(event.data as SourceFrame.SourceFrame.DecoratorType, this.textEditor);\n }\n }\n\n override async toolbarItems(): Promise {\n const leftToolbarItems = await super.toolbarItems();\n const rightToolbarItems = [];\n for (const plugin of this.plugins) {\n leftToolbarItems.push(...plugin.leftToolbarItems());\n rightToolbarItems.push(...plugin.rightToolbarItems());\n }\n\n if (!rightToolbarItems.length) {\n return leftToolbarItems;\n }\n\n return [...leftToolbarItems, new UI.Toolbar.ToolbarSeparator(true), ...rightToolbarItems];\n }\n\n private getErrorPopoverContent(event: Event): UI.PopoverHelper.PopoverRequest|null {\n const mouseEvent = event as MouseEvent;\n const eventTarget = event.target as HTMLElement;\n const anchorElement = eventTarget.enclosingNodeOrSelfWithClass('cm-messageIcon-error') ||\n eventTarget.enclosingNodeOrSelfWithClass('cm-messageIcon-issue');\n if (!anchorElement) {\n return null;\n }\n\n const messageField = this.textEditor.state.field(showRowMessages, false);\n if (!messageField || messageField.messages.rows.length === 0) {\n return null;\n }\n const {editor} = this.textEditor;\n const position = editor.posAtCoords(mouseEvent);\n if (position === null) {\n return null;\n }\n const line = editor.state.doc.lineAt(position);\n if (position !== line.to) {\n return null;\n }\n const row = messageField.messages.rows.find(row => row[0].lineNumber() === line.number - 1);\n if (!row) {\n return null;\n }\n const issues = anchorElement.classList.contains('cm-messageIcon-issue');\n const messages = row.filter(msg => (msg.level() === Workspace.UISourceCode.Message.Level.ISSUE) === issues);\n if (!messages.length) {\n return null;\n }\n const anchor =\n anchorElement ? anchorElement.boxInWindow() : new AnchorBox(mouseEvent.clientX, mouseEvent.clientY, 1, 1);\n\n const counts = countDuplicates(messages);\n const element = document.createElement('div');\n element.classList.add('text-editor-messages-description-container');\n for (let i = 0; i < messages.length; i++) {\n if (counts[i]) {\n element.appendChild(renderMessage(messages[i], counts[i]));\n }\n }\n return {\n box: anchor,\n hide(): void{},\n show: async (popover: UI.GlassPane.GlassPane) => {\n popover.contentElement.append(element);\n return true;\n },\n };\n }\n\n /**\n * Only records metrics once per UISourceCodeFrame instance and must only be\n * called once the content of the UISourceCode is available.\n */\n #recordSourcesPanelOpenedMetrics(): void {\n if (this.#sourcesPanelOpenedMetricsRecorded) {\n return;\n }\n this.#sourcesPanelOpenedMetricsRecorded = true;\n\n const mimeType = Common.ResourceType.ResourceType.mimeFromURL(this.uiSourceCodeInternal.url());\n const mediaType = Common.ResourceType.ResourceType.mediaTypeForMetrics(\n mimeType ?? '', this.uiSourceCodeInternal.contentType().isFromSourceMap(),\n TextUtils.TextUtils.isMinified(this.uiSourceCodeInternal.content()),\n this.uiSourceCodeInternal.url().startsWith('snippet://'),\n this.uiSourceCodeInternal.url().startsWith('debugger://'));\n Host.userMetrics.sourcesPanelFileOpened(mediaType);\n }\n}\n\nfunction getIconDataForLevel(level: Workspace.UISourceCode.Message.Level): IconButton.Icon.IconData {\n if (level === Workspace.UISourceCode.Message.Level.ERROR) {\n return {color: 'var(--icon-error)', width: '16px', height: '14px', iconName: 'cross-circle-filled'};\n }\n if (level === Workspace.UISourceCode.Message.Level.WARNING) {\n return {color: 'var(--icon-warning)', width: '18px', height: '14px', iconName: 'warning-filled'};\n }\n if (level === Workspace.UISourceCode.Message.Level.ISSUE) {\n return {color: 'var(--icon-warning)', width: '17px', height: '14px', iconName: 'issue-exclamation-filled'};\n }\n return {color: 'var(--icon-error)', width: '16px', height: '14px', iconName: 'cross-circle-filled'};\n}\n\nfunction getBubbleTypePerLevel(level: Workspace.UISourceCode.Message.Level): string {\n switch (level) {\n case Workspace.UISourceCode.Message.Level.ERROR:\n return 'error';\n case Workspace.UISourceCode.Message.Level.WARNING:\n return 'warning';\n case Workspace.UISourceCode.Message.Level.ISSUE:\n return 'warning';\n }\n}\n\nfunction messageLevelComparator(a: RowMessage, b: RowMessage): number {\n const messageLevelPriority = {\n [Workspace.UISourceCode.Message.Level.ISSUE]: 2,\n [Workspace.UISourceCode.Message.Level.WARNING]: 3,\n [Workspace.UISourceCode.Message.Level.ERROR]: 4,\n };\n return messageLevelPriority[a.level()] - messageLevelPriority[b.level()];\n}\n\nfunction getIconDataForMessage(message: RowMessage): IconButton.Icon.IconData {\n if (message.origin instanceof IssuesManager.SourceFrameIssuesManager.IssueMessage) {\n return {\n ...IssueCounter.IssueCounter.getIssueKindIconData(message.origin.getIssueKind()),\n width: '12px',\n height: '12px',\n };\n }\n return getIconDataForLevel(message.level());\n}\n\nexport const enum Events {\n TOOLBAR_ITEMS_CHANGED = 'ToolbarItemsChanged',\n}\n\nexport type EventTypes = {\n [Events.TOOLBAR_ITEMS_CHANGED]: void,\n};\n\nconst pluginCompartment = new CodeMirror.Compartment();\n\n// Row message management and display logic. The frame manages a\n// collection of messages, organized by line (row), as a wavy\n// underline starting at the start of the first message, up to the end\n// of the line, with icons indicating the message severity and content\n// at the end of the line.\n\nclass RowMessage {\n readonly origin: Workspace.UISourceCode.Message;\n readonly #lineNumber: number;\n readonly #columnNumber: number;\n\n constructor(origin: Workspace.UISourceCode.Message, lineNumber: number, columnNumber: number) {\n this.origin = origin;\n this.#lineNumber = lineNumber;\n this.#columnNumber = columnNumber;\n }\n\n level(): Workspace.UISourceCode.Message.Level {\n return this.origin.level();\n }\n\n text(): string {\n return this.origin.text();\n }\n\n clickHandler(): (() => void)|undefined {\n return this.origin.clickHandler();\n }\n\n lineNumber(): number {\n return this.#lineNumber;\n }\n\n columnNumber(): number {\n return this.#columnNumber;\n }\n\n isEqual(that: RowMessage): boolean {\n return this.origin.isEqual(that.origin);\n }\n}\n\nfunction addMessage(rows: RowMessage[][], message: RowMessage): RowMessage[][] {\n const lineNumber = message.lineNumber();\n let i = 0;\n for (; i < rows.length; i++) {\n const diff = rows[i][0].lineNumber() - lineNumber;\n if (diff === 0) {\n rows[i] = rows[i].concat(message);\n return rows;\n }\n if (diff > 0) {\n break;\n }\n }\n rows.splice(i, 0, [message]);\n return rows;\n}\n\nfunction removeMessage(rows: RowMessage[][], message: RowMessage): void {\n for (let i = 0; i < rows.length; i++) {\n if (rows[i][0].lineNumber() === message.lineNumber()) {\n const remaining = rows[i].filter(m => !m.isEqual(message));\n if (remaining.length) {\n rows[i] = remaining;\n } else {\n rows.splice(i, 1);\n }\n break;\n }\n }\n}\n\nclass RowMessages {\n constructor(readonly rows: RowMessage[][]) {\n }\n\n static create(messages: RowMessage[]): RowMessages {\n const rows: RowMessage[][] = [];\n for (const message of messages) {\n addMessage(rows, message);\n }\n return new RowMessages(rows);\n }\n\n remove(message: RowMessage): RowMessages {\n const rows = this.rows.slice();\n removeMessage(rows, message);\n return new RowMessages(rows);\n }\n\n add(message: RowMessage): RowMessages {\n return new RowMessages(addMessage(this.rows.slice(), message));\n }\n}\n\nconst setRowMessages = CodeMirror.StateEffect.define();\n\nconst underlineMark = CodeMirror.Decoration.mark({class: 'cm-waveUnderline'});\n\n// The widget shown at the end of a message annotation.\nclass MessageWidget extends CodeMirror.WidgetType {\n constructor(readonly messages: RowMessage[]) {\n super();\n }\n\n override eq(other: MessageWidget): boolean {\n return other.messages === this.messages;\n }\n\n toDOM(): HTMLElement {\n const wrap = document.createElement('span');\n wrap.classList.add('cm-messageIcon');\n const nonIssues = this.messages.filter(msg => msg.level() !== Workspace.UISourceCode.Message.Level.ISSUE);\n if (nonIssues.length) {\n const maxIssue = nonIssues.sort(messageLevelComparator)[nonIssues.length - 1];\n const errorIcon = wrap.appendChild(new IconButton.Icon.Icon());\n errorIcon.data = getIconDataForLevel(maxIssue.level());\n errorIcon.classList.add('cm-messageIcon-error');\n }\n const issue = this.messages.find(m => m.level() === Workspace.UISourceCode.Message.Level.ISSUE);\n if (issue) {\n const issueIcon = wrap.appendChild(new IconButton.Icon.Icon());\n issueIcon.data = getIconDataForLevel(Workspace.UISourceCode.Message.Level.ISSUE);\n issueIcon.classList.add('cm-messageIcon-issue');\n issueIcon.addEventListener('click', () => (issue.clickHandler() || Math.min)());\n }\n return wrap;\n }\n\n ignoreEvents(): boolean {\n return true;\n }\n}\n\nclass RowMessageDecorations {\n constructor(readonly messages: RowMessages, readonly decorations: CodeMirror.DecorationSet) {\n }\n\n static create(messages: RowMessages, doc: CodeMirror.Text): RowMessageDecorations {\n const builder = new CodeMirror.RangeSetBuilder();\n for (const row of messages.rows) {\n const line = doc.line(Math.min(doc.lines, row[0].lineNumber() + 1));\n const minCol = row.reduce((col, msg) => Math.min(col, msg.columnNumber() || 0), line.length);\n if (minCol < line.length) {\n builder.add(line.from + minCol, line.to, underlineMark);\n }\n builder.add(line.to, line.to, CodeMirror.Decoration.widget({side: 1, widget: new MessageWidget(row)}));\n }\n return new RowMessageDecorations(messages, builder.finish());\n }\n\n apply(tr: CodeMirror.Transaction): RowMessageDecorations {\n let result: RowMessageDecorations = this;\n if (tr.docChanged) {\n result = new RowMessageDecorations(this.messages, this.decorations.map(tr.changes));\n }\n for (const effect of tr.effects) {\n if (effect.is(setRowMessages)) {\n result = RowMessageDecorations.create(effect.value, tr.state.doc);\n }\n }\n return result;\n }\n}\n\nconst showRowMessages = CodeMirror.StateField.define({\n create(state): RowMessageDecorations {\n return RowMessageDecorations.create(new RowMessages([]), state.doc);\n },\n update(value, tr): RowMessageDecorations {\n return value.apply(tr);\n },\n provide: field => CodeMirror.Prec.lowest(CodeMirror.EditorView.decorations.from(field, value => value.decorations)),\n});\n\nfunction countDuplicates(messages: RowMessage[]): number[] {\n const counts = [];\n for (let i = 0; i < messages.length; i++) {\n counts[i] = 0;\n for (let j = 0; j <= i; j++) {\n if (messages[j].isEqual(messages[i])) {\n counts[j]++;\n break;\n }\n }\n }\n return counts;\n}\n\nfunction renderMessage(message: RowMessage, count: number): HTMLElement {\n const element = document.createElement('div');\n element.classList.add('text-editor-row-message');\n element.style.display = 'flex';\n element.style.alignItems = 'center';\n element.style.gap = '4px';\n\n if (count === 1) {\n const icon = element.appendChild(new IconButton.Icon.Icon());\n icon.data = getIconDataForMessage(message);\n icon.classList.add('text-editor-row-message-icon');\n icon.addEventListener('click', () => (message.clickHandler() || Math.min)());\n } else {\n const repeatCountElement =\n document.createElement('span', {is: 'dt-small-bubble'}) as UI.UIUtils.DevToolsSmallBubble;\n repeatCountElement.textContent = String(count);\n repeatCountElement.classList.add('text-editor-row-message-repeat-count');\n repeatCountElement.style.flexShrink = '0';\n element.appendChild(repeatCountElement);\n repeatCountElement.type = getBubbleTypePerLevel(message.level());\n }\n const linesContainer = element.createChild('div');\n for (const line of message.text().split('\\n')) {\n linesContainer.createChild('div').textContent = line;\n }\n\n return element;\n}\n\nconst rowMessageTheme = CodeMirror.EditorView.baseTheme({\n '.cm-tooltip-message': {\n padding: '4px',\n },\n\n '.cm-waveUnderline': {\n backgroundImage: 'var(--image-file-errorWave)',\n backgroundRepeat: 'repeat-x',\n backgroundPosition: 'bottom',\n paddingBottom: '1px',\n },\n\n '.cm-messageIcon': {\n cursor: 'pointer',\n '& > *': {\n verticalAlign: 'text-bottom',\n marginLeft: '2px',\n },\n },\n\n '.cm-messageIcon-issue, .cm-messageIcon-error': {\n marginTop: '-1px',\n marginBottom: '-1px',\n },\n});\n\nfunction rowMessages(initialMessages: RowMessage[]): CodeMirror.Extension {\n return [\n showRowMessages.init(state => RowMessageDecorations.create(RowMessages.create(initialMessages), state.doc)),\n rowMessageTheme,\n ];\n}\n"]} \ No newline at end of file +{"version":3,"file":"UISourceCodeFrame.js","sourceRoot":"","sources":["../../../../../../front_end/panels/sources/UISourceCodeFrame.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,OAAO,KAAK,MAAM,MAAM,6BAA6B,CAAC;AACtD,OAAO,KAAK,IAAI,MAAM,yBAAyB,CAAC;AAChD,OAAO,KAAK,gBAAgB,MAAM,wDAAwD,CAAC,CAAE,iDAAiD;AAC9I,OAAO,KAAK,aAAa,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CAAC,KAAK,CAAC,EAAE,CAAC,qBAAqB,CAAC,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,eAAe,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC;QAC3G,eAAe;KAChB,CAAC;AACJ,CAAC","sourcesContent":["/*\n * Copyright (C) 2012 Google Inc. All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are\n * met:\n *\n * * Redistributions of source code must retain the above copyright\n * notice, this list of conditions and the following disclaimer.\n * * Redistributions in binary form must reproduce the above\n * copyright notice, this list of conditions and the following disclaimer\n * in the documentation and/or other materials provided with the\n * distribution.\n * * Neither the name of Google Inc. nor the names of its\n * contributors may be used to endorse or promote products derived from\n * this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nimport * as Common from '../../core/common/common.js';\nimport * as Host from '../../core/host/host.js';\nimport * as FormatterActions from '../../entrypoints/formatter_worker/FormatterActions.js'; // eslint-disable-line rulesdir/es-modules-import\nimport * as IssuesManager from '../../models/issues_manager/issues_manager.js';\nimport * as Persistence from '../../models/persistence/persistence.js';\nimport * as TextUtils from '../../models/text_utils/text_utils.js';\nimport * as Workspace from '../../models/workspace/workspace.js';\nimport * as CodeMirror from '../../third_party/codemirror.next/codemirror.next.js';\nimport * as IconButton from '../../ui/components/icon_button/icon_button.js';\nimport * as IssueCounter from '../../ui/components/issue_counter/issue_counter.js';\nimport * as SourceFrame from '../../ui/legacy/components/source_frame/source_frame.js';\nimport * as UI from '../../ui/legacy/legacy.js';\n\nimport {CoveragePlugin} from './CoveragePlugin.js';\nimport {CSSPlugin} from './CSSPlugin.js';\nimport {DebuggerPlugin} from './DebuggerPlugin.js';\nimport type {Plugin} from './Plugin.js';\nimport {MemoryProfilePlugin, PerformanceProfilePlugin} from './ProfilePlugin.js';\nimport {ResourceOriginPlugin} from './ResourceOriginPlugin.js';\nimport {SnippetsPlugin} from './SnippetsPlugin.js';\nimport {SourcesPanel} from './SourcesPanel.js';\n\nfunction sourceFramePlugins(): (typeof Plugin)[] {\n // The order of these plugins matters for toolbar items and editor\n // extension precedence\n return [\n CSSPlugin,\n DebuggerPlugin,\n SnippetsPlugin,\n ResourceOriginPlugin,\n CoveragePlugin,\n MemoryProfilePlugin,\n PerformanceProfilePlugin,\n ];\n}\n\nexport class UISourceCodeFrame extends\n Common.ObjectWrapper.eventMixin(\n SourceFrame.SourceFrame.SourceFrameImpl) {\n private uiSourceCodeInternal: Workspace.UISourceCode.UISourceCode;\n private muteSourceCodeEvents: boolean;\n private persistenceBinding: Persistence.Persistence.PersistenceBinding|null;\n private uiSourceCodeEventListeners: Common.EventTarget.EventDescriptor[];\n private messageAndDecorationListeners: Common.EventTarget.EventDescriptor[];\n private readonly boundOnBindingChanged: () => void;\n // The active plugins. These are created in setContent, and\n // recreated when the binding changes\n private plugins: Plugin[] = [];\n private readonly errorPopoverHelper: UI.PopoverHelper.PopoverHelper;\n #sourcesPanelOpenedMetricsRecorded = false;\n\n constructor(uiSourceCode: Workspace.UISourceCode.UISourceCode) {\n super(() => this.workingCopy());\n\n this.uiSourceCodeInternal = uiSourceCode;\n\n this.muteSourceCodeEvents = false;\n\n this.persistenceBinding = Persistence.Persistence.PersistenceImpl.instance().binding(uiSourceCode);\n\n this.uiSourceCodeEventListeners = [];\n this.messageAndDecorationListeners = [];\n\n this.boundOnBindingChanged = this.onBindingChanged.bind(this);\n\n Common.Settings.Settings.instance()\n .moduleSetting('persistence-network-overrides-enabled')\n .addChangeListener(this.onNetworkPersistenceChanged, this);\n\n this.errorPopoverHelper = new UI.PopoverHelper.PopoverHelper(\n this.textEditor.editor.contentDOM, this.getErrorPopoverContent.bind(this), 'sources.error');\n this.errorPopoverHelper.setHasPadding(true);\n\n this.errorPopoverHelper.setTimeout(100, 100);\n\n this.initializeUISourceCode();\n }\n\n private async workingCopy(): Promise {\n if (this.uiSourceCodeInternal.isDirty()) {\n return this.uiSourceCodeInternal.workingCopyContentData();\n }\n return this.uiSourceCodeInternal.requestContentData();\n }\n\n protected override editorConfiguration(doc: string): CodeMirror.Extension {\n return [\n super.editorConfiguration(doc),\n rowMessages(this.allMessages()),\n // Inject editor extensions from plugins\n pluginCompartment.of(this.plugins.map(plugin => plugin.editorExtension())),\n ];\n }\n\n protected override onFocus(): void {\n super.onFocus();\n UI.Context.Context.instance().setFlavor(UISourceCodeFrame, this);\n }\n\n protected override onBlur(): void {\n super.onBlur();\n UI.Context.Context.instance().setFlavor(UISourceCodeFrame, null);\n }\n\n private installMessageAndDecorationListeners(): void {\n if (this.persistenceBinding) {\n const networkSourceCode = this.persistenceBinding.network;\n const fileSystemSourceCode = this.persistenceBinding.fileSystem;\n this.messageAndDecorationListeners = [\n networkSourceCode.addEventListener(Workspace.UISourceCode.Events.MessageAdded, this.onMessageAdded, this),\n networkSourceCode.addEventListener(Workspace.UISourceCode.Events.MessageRemoved, this.onMessageRemoved, this),\n networkSourceCode.addEventListener(\n Workspace.UISourceCode.Events.DecorationChanged, this.onDecorationChanged, this),\n\n fileSystemSourceCode.addEventListener(Workspace.UISourceCode.Events.MessageAdded, this.onMessageAdded, this),\n fileSystemSourceCode.addEventListener(\n Workspace.UISourceCode.Events.MessageRemoved, this.onMessageRemoved, this),\n ];\n } else {\n this.messageAndDecorationListeners = [\n this.uiSourceCodeInternal.addEventListener(\n Workspace.UISourceCode.Events.MessageAdded, this.onMessageAdded, this),\n this.uiSourceCodeInternal.addEventListener(\n Workspace.UISourceCode.Events.MessageRemoved, this.onMessageRemoved, this),\n this.uiSourceCodeInternal.addEventListener(\n Workspace.UISourceCode.Events.DecorationChanged, this.onDecorationChanged, this),\n ];\n }\n }\n\n uiSourceCode(): Workspace.UISourceCode.UISourceCode {\n return this.uiSourceCodeInternal;\n }\n\n setUISourceCode(uiSourceCode: Workspace.UISourceCode.UISourceCode): void {\n const loaded = uiSourceCode.contentLoaded() ? Promise.resolve() : uiSourceCode.requestContent();\n const startUISourceCode = this.uiSourceCodeInternal;\n loaded.then(async () => {\n if (this.uiSourceCodeInternal !== startUISourceCode) {\n return;\n }\n this.unloadUISourceCode();\n this.uiSourceCodeInternal = uiSourceCode;\n if (uiSourceCode.workingCopy() !== this.textEditor.state.doc.toString()) {\n await this.setContentDataOrError(Promise.resolve(uiSourceCode.workingCopyContentData()));\n } else {\n this.reloadPlugins();\n }\n this.initializeUISourceCode();\n }, console.error);\n }\n\n private unloadUISourceCode(): void {\n Common.EventTarget.removeEventListeners(this.messageAndDecorationListeners);\n Common.EventTarget.removeEventListeners(this.uiSourceCodeEventListeners);\n this.uiSourceCodeInternal.removeWorkingCopyGetter();\n Persistence.Persistence.PersistenceImpl.instance().unsubscribeFromBindingEvent(\n this.uiSourceCodeInternal, this.boundOnBindingChanged);\n }\n\n private initializeUISourceCode(): void {\n this.uiSourceCodeEventListeners = [\n this.uiSourceCodeInternal.addEventListener(\n Workspace.UISourceCode.Events.WorkingCopyChanged, this.onWorkingCopyChanged, this),\n this.uiSourceCodeInternal.addEventListener(\n Workspace.UISourceCode.Events.WorkingCopyCommitted, this.onWorkingCopyCommitted, this),\n this.uiSourceCodeInternal.addEventListener(Workspace.UISourceCode.Events.TitleChanged, this.onTitleChanged, this),\n ];\n\n Persistence.Persistence.PersistenceImpl.instance().subscribeForBindingEvent(\n this.uiSourceCodeInternal, this.boundOnBindingChanged);\n this.installMessageAndDecorationListeners();\n this.updateStyle();\n const canPrettyPrint = FormatterActions.FORMATTABLE_MEDIA_TYPES.includes(this.contentType) &&\n !this.uiSourceCodeInternal.project().canSetFileContent() &&\n Persistence.Persistence.PersistenceImpl.instance().binding(this.uiSourceCodeInternal) === null;\n const autoPrettyPrint = !this.uiSourceCodeInternal.contentType().isFromSourceMap();\n this.setCanPrettyPrint(canPrettyPrint, autoPrettyPrint);\n }\n\n override wasShown(): void {\n super.wasShown();\n this.setEditable(this.canEditSourceInternal());\n }\n\n override willHide(): void {\n for (const plugin of this.plugins) {\n plugin.willHide();\n }\n super.willHide();\n UI.Context.Context.instance().setFlavor(UISourceCodeFrame, null);\n this.uiSourceCodeInternal.removeWorkingCopyGetter();\n }\n\n protected override getContentType(): string {\n const binding = Persistence.Persistence.PersistenceImpl.instance().binding(this.uiSourceCodeInternal);\n const mimeType = binding ? binding.network.mimeType() : this.uiSourceCodeInternal.mimeType();\n return Common.ResourceType.ResourceType.simplifyContentType(mimeType);\n }\n\n canEditSourceInternal(): boolean {\n if (this.hasLoadError()) {\n return false;\n }\n if (this.uiSourceCodeInternal.editDisabled()) {\n return false;\n }\n if (this.uiSourceCodeInternal.mimeType() === 'application/wasm') {\n return false;\n }\n if (Persistence.Persistence.PersistenceImpl.instance().binding(this.uiSourceCodeInternal)) {\n return true;\n }\n if (this.uiSourceCodeInternal.project().canSetFileContent()) {\n return true;\n }\n if (this.uiSourceCodeInternal.project().isServiceProject()) {\n return false;\n }\n if (this.uiSourceCodeInternal.project().type() === Workspace.Workspace.projectTypes.Network &&\n Persistence.NetworkPersistenceManager.NetworkPersistenceManager.instance().active()) {\n return true;\n }\n // Because live edit fails on large whitespace changes, pretty printed scripts are not editable.\n if (this.pretty && this.uiSourceCodeInternal.contentType().hasScripts()) {\n return false;\n }\n return this.uiSourceCodeInternal.contentType() !== Common.ResourceType.resourceTypes.Document;\n }\n\n private onNetworkPersistenceChanged(): void {\n this.setEditable(this.canEditSourceInternal());\n }\n\n commitEditing(): void {\n if (!this.uiSourceCodeInternal.isDirty()) {\n return;\n }\n\n this.muteSourceCodeEvents = true;\n this.uiSourceCodeInternal.commitWorkingCopy();\n this.muteSourceCodeEvents = false;\n }\n\n override async setContent(content: string): Promise {\n this.disposePlugins();\n this.loadPlugins();\n await super.setContent(content);\n for (const plugin of this.plugins) {\n plugin.editorInitialized(this.textEditor);\n }\n this.#recordSourcesPanelOpenedMetrics();\n Common.EventTarget.fireEvent('source-file-loaded', this.uiSourceCodeInternal.displayName(true));\n }\n\n private createMessage(origin: Workspace.UISourceCode.Message): RowMessage {\n const {lineNumber, columnNumber} = this.uiLocationToEditorLocation(origin.lineNumber(), origin.columnNumber());\n return new RowMessage(origin, lineNumber, columnNumber);\n }\n\n private allMessages(): RowMessage[] {\n const origins = this.persistenceBinding !== null ?\n [...this.persistenceBinding.network.messages(), ...this.persistenceBinding.fileSystem.messages()] :\n [...this.uiSourceCodeInternal.messages()];\n return origins.map(origin => this.createMessage(origin));\n }\n\n override onTextChanged(): void {\n const wasPretty = this.pretty;\n super.onTextChanged();\n this.errorPopoverHelper.hidePopover();\n SourcesPanel.instance().updateLastModificationTime();\n this.muteSourceCodeEvents = true;\n if (this.isClean()) {\n this.uiSourceCodeInternal.resetWorkingCopy();\n } else {\n this.uiSourceCodeInternal.setWorkingCopyGetter(() => this.textEditor.state.sliceDoc());\n }\n this.muteSourceCodeEvents = false;\n if (wasPretty !== this.pretty) {\n this.updateStyle();\n this.reloadPlugins();\n }\n }\n\n onWorkingCopyChanged(): void {\n if (this.muteSourceCodeEvents) {\n return;\n }\n this.maybeSetContent(this.uiSourceCodeInternal.workingCopyContentData());\n }\n\n private onWorkingCopyCommitted(): void {\n if (!this.muteSourceCodeEvents) {\n this.maybeSetContent(this.uiSourceCode().workingCopyContentData());\n }\n this.contentCommitted();\n this.updateStyle();\n }\n\n private reloadPlugins(): void {\n this.disposePlugins();\n this.loadPlugins();\n const editor = this.textEditor;\n editor.dispatch({effects: pluginCompartment.reconfigure(this.plugins.map(plugin => plugin.editorExtension()))});\n for (const plugin of this.plugins) {\n plugin.editorInitialized(editor);\n }\n }\n\n private onTitleChanged(): void {\n this.updateLanguageMode('').then(() => this.reloadPlugins(), console.error);\n }\n\n private loadPlugins(): void {\n const binding = Persistence.Persistence.PersistenceImpl.instance().binding(this.uiSourceCodeInternal);\n const pluginUISourceCode = binding ? binding.network : this.uiSourceCodeInternal;\n\n for (const pluginType of sourceFramePlugins()) {\n if (pluginType.accepts(pluginUISourceCode)) {\n this.plugins.push(new pluginType(pluginUISourceCode, this));\n }\n }\n\n this.dispatchEventToListeners(Events.TOOLBAR_ITEMS_CHANGED);\n }\n\n private disposePlugins(): void {\n for (const plugin of this.plugins) {\n plugin.dispose();\n }\n this.plugins = [];\n }\n\n private onBindingChanged(): void {\n const binding = Persistence.Persistence.PersistenceImpl.instance().binding(this.uiSourceCodeInternal);\n if (binding === this.persistenceBinding) {\n return;\n }\n this.unloadUISourceCode();\n this.persistenceBinding = binding;\n this.initializeUISourceCode();\n this.reloadMessages();\n this.reloadPlugins();\n }\n\n private reloadMessages(): void {\n const messages = this.allMessages();\n const {editor} = this.textEditor;\n editor.dispatch({effects: setRowMessages.of(RowMessages.create(messages))});\n }\n\n private updateStyle(): void {\n this.setEditable(this.canEditSourceInternal());\n }\n\n private maybeSetContent(content: TextUtils.ContentData.ContentData): void {\n if (this.textEditor.state.doc.toString() !== content.text) {\n void this.setContentDataOrError(Promise.resolve(content));\n }\n }\n\n protected override populateTextAreaContextMenu(\n contextMenu: UI.ContextMenu.ContextMenu, lineNumber: number, columnNumber: number): void {\n super.populateTextAreaContextMenu(contextMenu, lineNumber, columnNumber);\n contextMenu.appendApplicableItems(this.uiSourceCodeInternal);\n const location = this.editorLocationToUILocation(lineNumber, columnNumber);\n contextMenu.appendApplicableItems(\n new Workspace.UISourceCode.UILocation(this.uiSourceCodeInternal, location.lineNumber, location.columnNumber));\n for (const plugin of this.plugins) {\n plugin.populateTextAreaContextMenu(contextMenu, lineNumber, columnNumber);\n }\n }\n\n protected override populateLineGutterContextMenu(contextMenu: UI.ContextMenu.ContextMenu, lineNumber: number): void {\n super.populateLineGutterContextMenu(contextMenu, lineNumber);\n for (const plugin of this.plugins) {\n plugin.populateLineGutterContextMenu(contextMenu, lineNumber);\n }\n }\n\n dispose(): void {\n this.errorPopoverHelper.dispose();\n this.disposePlugins();\n this.unloadUISourceCode();\n this.textEditor.editor.destroy();\n this.detach();\n Common.Settings.Settings.instance()\n .moduleSetting('persistence-network-overrides-enabled')\n .removeChangeListener(this.onNetworkPersistenceChanged, this);\n }\n\n private onMessageAdded(event: Common.EventTarget.EventTargetEvent): void {\n const {editor} = this.textEditor, shownMessages = editor.state.field(showRowMessages, false);\n if (shownMessages) {\n const message = this.createMessage(event.data);\n editor.dispatch({effects: setRowMessages.of(shownMessages.messages.add(message))});\n }\n }\n\n private onMessageRemoved(event: Common.EventTarget.EventTargetEvent): void {\n const {editor} = this.textEditor, shownMessages = editor.state.field(showRowMessages, false);\n if (shownMessages) {\n const message = this.createMessage(event.data);\n editor.dispatch({effects: setRowMessages.of(shownMessages.messages.remove(message))});\n }\n }\n\n private onDecorationChanged(event: Common.EventTarget.EventTargetEvent): void {\n for (const plugin of this.plugins) {\n plugin.decorationChanged(event.data as SourceFrame.SourceFrame.DecoratorType, this.textEditor);\n }\n }\n\n override async toolbarItems(): Promise {\n const leftToolbarItems = await super.toolbarItems();\n const rightToolbarItems = [];\n for (const plugin of this.plugins) {\n leftToolbarItems.push(...plugin.leftToolbarItems());\n rightToolbarItems.push(...plugin.rightToolbarItems());\n }\n\n if (!rightToolbarItems.length) {\n return leftToolbarItems;\n }\n\n return [...leftToolbarItems, new UI.Toolbar.ToolbarSeparator(true), ...rightToolbarItems];\n }\n\n private getErrorPopoverContent(event: Event): UI.PopoverHelper.PopoverRequest|null {\n const mouseEvent = event as MouseEvent;\n const eventTarget = event.target as HTMLElement;\n const anchorElement = eventTarget.enclosingNodeOrSelfWithClass('cm-messageIcon-error') ||\n eventTarget.enclosingNodeOrSelfWithClass('cm-messageIcon-issue');\n if (!anchorElement) {\n return null;\n }\n\n const messageField = this.textEditor.state.field(showRowMessages, false);\n if (!messageField || messageField.messages.rows.length === 0) {\n return null;\n }\n const {editor} = this.textEditor;\n const position = editor.posAtCoords(mouseEvent);\n if (position === null) {\n return null;\n }\n const line = editor.state.doc.lineAt(position);\n if (position !== line.to) {\n return null;\n }\n const row = messageField.messages.rows.find(row => row[0].lineNumber() === line.number - 1);\n if (!row) {\n return null;\n }\n const issues = anchorElement.classList.contains('cm-messageIcon-issue');\n const messages = row.filter(msg => (msg.level() === Workspace.UISourceCode.Message.Level.ISSUE) === issues);\n if (!messages.length) {\n return null;\n }\n const anchor =\n anchorElement ? anchorElement.boxInWindow() : new AnchorBox(mouseEvent.clientX, mouseEvent.clientY, 1, 1);\n\n const counts = countDuplicates(messages);\n const element = document.createElement('div');\n element.classList.add('text-editor-messages-description-container');\n for (let i = 0; i < messages.length; i++) {\n if (counts[i]) {\n element.appendChild(renderMessage(messages[i], counts[i]));\n }\n }\n return {\n box: anchor,\n hide(): void{},\n show: async (popover: UI.GlassPane.GlassPane) => {\n popover.contentElement.append(element);\n return true;\n },\n };\n }\n\n /**\n * Only records metrics once per UISourceCodeFrame instance and must only be\n * called once the content of the UISourceCode is available.\n */\n #recordSourcesPanelOpenedMetrics(): void {\n if (this.#sourcesPanelOpenedMetricsRecorded) {\n return;\n }\n this.#sourcesPanelOpenedMetricsRecorded = true;\n\n const mimeType = Common.ResourceType.ResourceType.mimeFromURL(this.uiSourceCodeInternal.url());\n const mediaType = Common.ResourceType.ResourceType.mediaTypeForMetrics(\n mimeType ?? '', this.uiSourceCodeInternal.contentType().isFromSourceMap(),\n TextUtils.TextUtils.isMinified(this.uiSourceCodeInternal.content()),\n this.uiSourceCodeInternal.url().startsWith('snippet://'),\n this.uiSourceCodeInternal.url().startsWith('debugger://'));\n Host.userMetrics.sourcesPanelFileOpened(mediaType);\n }\n}\n\nfunction getIconDataForLevel(level: Workspace.UISourceCode.Message.Level): IconButton.Icon.IconData {\n if (level === Workspace.UISourceCode.Message.Level.ERROR) {\n return {color: 'var(--icon-error)', width: '16px', height: '14px', iconName: 'cross-circle-filled'};\n }\n if (level === Workspace.UISourceCode.Message.Level.WARNING) {\n return {color: 'var(--icon-warning)', width: '18px', height: '14px', iconName: 'warning-filled'};\n }\n if (level === Workspace.UISourceCode.Message.Level.ISSUE) {\n return {color: 'var(--icon-warning)', width: '17px', height: '14px', iconName: 'issue-exclamation-filled'};\n }\n return {color: 'var(--icon-error)', width: '16px', height: '14px', iconName: 'cross-circle-filled'};\n}\n\nfunction getBubbleTypePerLevel(level: Workspace.UISourceCode.Message.Level): string {\n switch (level) {\n case Workspace.UISourceCode.Message.Level.ERROR:\n return 'error';\n case Workspace.UISourceCode.Message.Level.WARNING:\n return 'warning';\n case Workspace.UISourceCode.Message.Level.ISSUE:\n return 'warning';\n }\n}\n\nfunction messageLevelComparator(a: RowMessage, b: RowMessage): number {\n const messageLevelPriority = {\n [Workspace.UISourceCode.Message.Level.ISSUE]: 2,\n [Workspace.UISourceCode.Message.Level.WARNING]: 3,\n [Workspace.UISourceCode.Message.Level.ERROR]: 4,\n };\n return messageLevelPriority[a.level()] - messageLevelPriority[b.level()];\n}\n\nfunction getIconDataForMessage(message: RowMessage): IconButton.Icon.IconData {\n if (message.origin instanceof IssuesManager.SourceFrameIssuesManager.IssueMessage) {\n return {\n ...IssueCounter.IssueCounter.getIssueKindIconData(message.origin.getIssueKind()),\n width: '12px',\n height: '12px',\n };\n }\n return getIconDataForLevel(message.level());\n}\n\nexport const enum Events {\n TOOLBAR_ITEMS_CHANGED = 'ToolbarItemsChanged',\n}\n\nexport type EventTypes = {\n [Events.TOOLBAR_ITEMS_CHANGED]: void,\n};\n\nconst pluginCompartment = new CodeMirror.Compartment();\n\n// Row message management and display logic. The frame manages a\n// collection of messages, organized by line (row), as a wavy\n// underline starting at the start of the first message, up to the end\n// of the line, with icons indicating the message severity and content\n// at the end of the line.\n\nclass RowMessage {\n readonly origin: Workspace.UISourceCode.Message;\n readonly #lineNumber: number;\n readonly #columnNumber: number;\n\n constructor(origin: Workspace.UISourceCode.Message, lineNumber: number, columnNumber: number) {\n this.origin = origin;\n this.#lineNumber = lineNumber;\n this.#columnNumber = columnNumber;\n }\n\n level(): Workspace.UISourceCode.Message.Level {\n return this.origin.level();\n }\n\n text(): string {\n return this.origin.text();\n }\n\n clickHandler(): (() => void)|undefined {\n return this.origin.clickHandler();\n }\n\n lineNumber(): number {\n return this.#lineNumber;\n }\n\n columnNumber(): number {\n return this.#columnNumber;\n }\n\n isEqual(that: RowMessage): boolean {\n return this.origin.isEqual(that.origin);\n }\n}\n\nfunction addMessage(rows: RowMessage[][], message: RowMessage): RowMessage[][] {\n const lineNumber = message.lineNumber();\n let i = 0;\n for (; i < rows.length; i++) {\n const diff = rows[i][0].lineNumber() - lineNumber;\n if (diff === 0) {\n rows[i] = rows[i].concat(message);\n return rows;\n }\n if (diff > 0) {\n break;\n }\n }\n rows.splice(i, 0, [message]);\n return rows;\n}\n\nfunction removeMessage(rows: RowMessage[][], message: RowMessage): void {\n for (let i = 0; i < rows.length; i++) {\n if (rows[i][0].lineNumber() === message.lineNumber()) {\n const remaining = rows[i].filter(m => !m.isEqual(message));\n if (remaining.length) {\n rows[i] = remaining;\n } else {\n rows.splice(i, 1);\n }\n break;\n }\n }\n}\n\nclass RowMessages {\n constructor(readonly rows: RowMessage[][]) {\n }\n\n static create(messages: RowMessage[]): RowMessages {\n const rows: RowMessage[][] = [];\n for (const message of messages) {\n addMessage(rows, message);\n }\n return new RowMessages(rows);\n }\n\n remove(message: RowMessage): RowMessages {\n const rows = this.rows.slice();\n removeMessage(rows, message);\n return new RowMessages(rows);\n }\n\n add(message: RowMessage): RowMessages {\n return new RowMessages(addMessage(this.rows.slice(), message));\n }\n}\n\nconst setRowMessages = CodeMirror.StateEffect.define();\n\nconst underlineMark = CodeMirror.Decoration.mark({class: 'cm-waveUnderline'});\n\n// The widget shown at the end of a message annotation.\nclass MessageWidget extends CodeMirror.WidgetType {\n constructor(readonly messages: RowMessage[]) {\n super();\n }\n\n override eq(other: MessageWidget): boolean {\n return other.messages === this.messages;\n }\n\n toDOM(): HTMLElement {\n const wrap = document.createElement('span');\n wrap.classList.add('cm-messageIcon');\n const nonIssues = this.messages.filter(msg => msg.level() !== Workspace.UISourceCode.Message.Level.ISSUE);\n if (nonIssues.length) {\n const maxIssue = nonIssues.sort(messageLevelComparator)[nonIssues.length - 1];\n const errorIcon = wrap.appendChild(new IconButton.Icon.Icon());\n errorIcon.data = getIconDataForLevel(maxIssue.level());\n errorIcon.classList.add('cm-messageIcon-error');\n }\n const issue = this.messages.find(m => m.level() === Workspace.UISourceCode.Message.Level.ISSUE);\n if (issue) {\n const issueIcon = wrap.appendChild(new IconButton.Icon.Icon());\n issueIcon.data = getIconDataForLevel(Workspace.UISourceCode.Message.Level.ISSUE);\n issueIcon.classList.add('cm-messageIcon-issue');\n issueIcon.addEventListener('click', () => (issue.clickHandler() || Math.min)());\n }\n return wrap;\n }\n\n ignoreEvents(): boolean {\n return true;\n }\n}\n\nclass RowMessageDecorations {\n constructor(readonly messages: RowMessages, readonly decorations: CodeMirror.DecorationSet) {\n }\n\n static create(messages: RowMessages, doc: CodeMirror.Text): RowMessageDecorations {\n const builder = new CodeMirror.RangeSetBuilder();\n for (const row of messages.rows) {\n const line = doc.line(Math.min(doc.lines, row[0].lineNumber() + 1));\n const minCol = row.reduce((col, msg) => Math.min(col, msg.columnNumber() || 0), line.length);\n if (minCol < line.length) {\n builder.add(line.from + minCol, line.to, underlineMark);\n }\n builder.add(line.to, line.to, CodeMirror.Decoration.widget({side: 1, widget: new MessageWidget(row)}));\n }\n return new RowMessageDecorations(messages, builder.finish());\n }\n\n apply(tr: CodeMirror.Transaction): RowMessageDecorations {\n let result: RowMessageDecorations = this;\n if (tr.docChanged) {\n result = new RowMessageDecorations(this.messages, this.decorations.map(tr.changes));\n }\n for (const effect of tr.effects) {\n if (effect.is(setRowMessages)) {\n result = RowMessageDecorations.create(effect.value, tr.state.doc);\n }\n }\n return result;\n }\n}\n\nconst showRowMessages = CodeMirror.StateField.define({\n create(state): RowMessageDecorations {\n return RowMessageDecorations.create(new RowMessages([]), state.doc);\n },\n update(value, tr): RowMessageDecorations {\n return value.apply(tr);\n },\n provide: field => CodeMirror.Prec.lowest(CodeMirror.EditorView.decorations.from(field, value => value.decorations)),\n});\n\nfunction countDuplicates(messages: RowMessage[]): number[] {\n const counts = [];\n for (let i = 0; i < messages.length; i++) {\n counts[i] = 0;\n for (let j = 0; j <= i; j++) {\n if (messages[j].isEqual(messages[i])) {\n counts[j]++;\n break;\n }\n }\n }\n return counts;\n}\n\nfunction renderMessage(message: RowMessage, count: number): HTMLElement {\n const element = document.createElement('div');\n element.classList.add('text-editor-row-message');\n element.style.display = 'flex';\n element.style.alignItems = 'center';\n element.style.gap = '4px';\n\n if (count === 1) {\n const icon = element.appendChild(new IconButton.Icon.Icon());\n icon.data = getIconDataForMessage(message);\n icon.classList.add('text-editor-row-message-icon');\n icon.addEventListener('click', () => (message.clickHandler() || Math.min)());\n } else {\n const repeatCountElement = element.createChild('dt-small-bubble', 'text-editor-row-message-repeat-count');\n repeatCountElement.textContent = String(count);\n repeatCountElement.style.flexShrink = '0';\n repeatCountElement.type = getBubbleTypePerLevel(message.level());\n }\n const linesContainer = element.createChild('div');\n for (const line of message.text().split('\\n')) {\n linesContainer.createChild('div').textContent = line;\n }\n\n return element;\n}\n\nconst rowMessageTheme = CodeMirror.EditorView.baseTheme({\n '.cm-tooltip-message': {\n padding: '4px',\n },\n\n '.cm-waveUnderline': {\n backgroundImage: 'var(--image-file-errorWave)',\n backgroundRepeat: 'repeat-x',\n backgroundPosition: 'bottom',\n paddingBottom: '1px',\n },\n\n '.cm-messageIcon': {\n cursor: 'pointer',\n '& > *': {\n verticalAlign: 'text-bottom',\n marginLeft: '2px',\n },\n },\n\n '.cm-messageIcon-issue, .cm-messageIcon-error': {\n marginTop: '-1px',\n marginBottom: '-1px',\n },\n});\n\nfunction rowMessages(initialMessages: RowMessage[]): CodeMirror.Extension {\n return [\n showRowMessages.init(state => RowMessageDecorations.create(RowMessages.create(initialMessages), state.doc)),\n rowMessageTheme,\n ];\n}\n"]} \ No newline at end of file diff --git a/public/panels/sources/WatchExpressionsSidebarPane.js.map b/public/panels/sources/WatchExpressionsSidebarPane.js.map index da2484a88..b3e8e6c89 100644 --- a/public/panels/sources/WatchExpressionsSidebarPane.js.map +++ b/public/panels/sources/WatchExpressionsSidebarPane.js.map @@ -1 +1 @@ -{"version":3,"file":"WatchExpressionsSidebarPane.js","sourceRoot":"","sources":["../../../../../../front_end/panels/sources/WatchExpressionsSidebarPane.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,OAAO,KAAK,MAAM,MAAM,6BAA6B,CAAC;AACtD,OAAO,KAAK,IAAI,MAAM,yBAAyB,CAAC;AAChD,OAAO,KAAK,IAAI,MAAM,yBAAyB,CAAC;AAChD,OAAO,KAAK,QAAQ,MAAM,iCAAiC,CAAC;AAC5D,OAAO,KAAK,GAAG,MAAM,uBAAuB,CAAC;AAE7C,OAAO,KAAK,SAAS,MAAM,qCAAqC,CAAC;AACjE,OAAO,KAAK,eAAe,MAAM,qDAAqD,CAAC;AACvF,OAAO,KAAK,OAAO,MAAM,wCAAwC,CAAC;AAClE,OAAO,KAAK,QAAQ,MAAM,mDAAmD,CAAC;AAC9E,sDAAsD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,CAAC,EAAE,CAAC;YACzG,WAAW,CAAC,gBAAgB,EAAE,CAAC,UAAU,CACrC,UAAU,CAAC,SAAS,CAAC,SAAS,CAAC,EAAE,IAAI,CAAC,sBAAsB,CAAC,IAAI,CAAC,IAAI,CAAC,EACvE,EAAC,YAAY,EAAE,6BAA6B,EAAC,CAAC,CAAC;QACrD,CAAC;QAED,MAAM,MAAM,GAAG,EAAE,CAAC,OAAO,CAAC,oBAAoB,CAAC,KAAK,CAAC,CAAC;QACtD,IAAI,MAAM,IAAI,IAAI,CAAC,YAAY,CAAC,gBAAgB,CAAC,MAAM,CAAC,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;YACxE,WAAW,CAAC,qBAAqB,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QACjD,CAAC;IACH,CAAC;IAEO,sBAAsB;QAC5B,IAAI,CAAC,qBAAqB,CAAC,6BAA6B,CAAC,QAAQ,CAAC,IAAI,CAAC,YAAY,CAAC,WAAW,CAAC,CAAC;IACnG,CAAC;IAEO,MAAM,CAAU,kBAAkB,GAAG,aAAa,CAAC","sourcesContent":["// Copyright 2021 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\n/*\n * Copyright (C) IBM Corp. 2009 All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are\n * met:\n *\n * * Redistributions of source code must retain the above copyright\n * notice, this list of conditions and the following disclaimer.\n * * Redistributions in binary form must reproduce the above\n * copyright notice, this list of conditions and the following disclaimer\n * in the documentation and/or other materials provided with the\n * distribution.\n * * Neither the name of IBM Corp. nor the names of its\n * contributors may be used to endorse or promote products derived from\n * this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nimport * as Common from '../../core/common/common.js';\nimport * as Host from '../../core/host/host.js';\nimport * as i18n from '../../core/i18n/i18n.js';\nimport * as Platform from '../../core/platform/platform.js';\nimport * as SDK from '../../core/sdk/sdk.js';\nimport type * as Protocol from '../../generated/protocol.js';\nimport * as Formatter from '../../models/formatter/formatter.js';\nimport * as SourceMapScopes from '../../models/source_map_scopes/source_map_scopes.js';\nimport * as Buttons from '../../ui/components/buttons/buttons.js';\nimport * as ObjectUI from '../../ui/legacy/components/object_ui/object_ui.js';\n// eslint-disable-next-line rulesdir/es-modules-import\nimport objectValueStyles from '../../ui/legacy/components/object_ui/objectValue.css.js';\nimport * as Components from '../../ui/legacy/components/utils/utils.js';\nimport * as UI from '../../ui/legacy/legacy.js';\nimport * as VisualLogging from '../../ui/visual_logging/visual_logging.js';\n\nimport {UISourceCodeFrame} from './UISourceCodeFrame.js';\nimport watchExpressionsSidebarPaneStyles from './watchExpressionsSidebarPane.css.js';\n\nconst UIStrings = {\n /**\n *@description A context menu item in the Watch Expressions Sidebar Pane of the Sources panel\n */\n addWatchExpression: 'Add watch expression',\n /**\n *@description Tooltip/screen reader label of a button in the Sources panel that refreshes all watch expressions.\n */\n refreshWatchExpressions: 'Refresh watch expressions',\n /**\n *@description Empty element text content in Watch Expressions Sidebar Pane of the Sources panel\n */\n noWatchExpressions: 'No watch expressions',\n /**\n *@description A context menu item in the Watch Expressions Sidebar Pane of the Sources panel\n */\n deleteAllWatchExpressions: 'Delete all watch expressions',\n /**\n *@description A context menu item in the Watch Expressions Sidebar Pane of the Sources panel\n */\n addPropertyPathToWatch: 'Add property path to watch',\n /**\n *@description A context menu item in the Watch Expressions Sidebar Pane of the Sources panel\n */\n deleteWatchExpression: 'Delete watch expression',\n /**\n *@description Value element text content in Watch Expressions Sidebar Pane of the Sources panel\n */\n notAvailable: '',\n /**\n *@description A context menu item in the Watch Expressions Sidebar Pane of the Sources panel and Network pane request.\n */\n copyValue: 'Copy value',\n};\nconst str_ = i18n.i18n.registerUIStrings('panels/sources/WatchExpressionsSidebarPane.ts', UIStrings);\nconst i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);\nlet watchExpressionsSidebarPaneInstance: WatchExpressionsSidebarPane;\n\nexport class WatchExpressionsSidebarPane extends UI.ThrottledWidget.ThrottledWidget implements\n UI.ActionRegistration.ActionDelegate, UI.Toolbar.ItemsProvider,\n UI.ContextMenu.Provider {\n private watchExpressions: WatchExpression[];\n private emptyElement!: HTMLElement;\n private readonly watchExpressionsSetting: Common.Settings.Setting;\n private readonly addButton: UI.Toolbar.ToolbarButton;\n private readonly refreshButton: UI.Toolbar.ToolbarButton;\n private readonly treeOutline: ObjectUI.ObjectPropertiesSection.ObjectPropertiesSectionsTreeOutline;\n private readonly expandController: ObjectUI.ObjectPropertiesSection.ObjectPropertiesSectionsTreeExpandController;\n private readonly linkifier: Components.Linkifier.Linkifier;\n private constructor() {\n super(true);\n\n // TODO(szuend): Replace with a Set once the web test\n // panels/sources/debugger-ui/watch-expressions-preserve-expansion.js is either converted\n // to an e2e test or no longer accesses this variable directly.\n this.watchExpressions = [];\n this.watchExpressionsSetting =\n Common.Settings.Settings.instance().createLocalSetting('watch-expressions', []);\n\n this.addButton = new UI.Toolbar.ToolbarButton(\n i18nString(UIStrings.addWatchExpression), 'plus', undefined, 'add-watch-expression');\n this.addButton.setSize(Buttons.Button.Size.SMALL);\n this.addButton.addEventListener(UI.Toolbar.ToolbarButton.Events.CLICK, _event => {\n void this.addButtonClicked();\n });\n this.refreshButton = new UI.Toolbar.ToolbarButton(\n i18nString(UIStrings.refreshWatchExpressions), 'refresh', undefined, 'refresh-watch-expressions');\n this.refreshButton.setSize(Buttons.Button.Size.SMALL);\n this.refreshButton.addEventListener(UI.Toolbar.ToolbarButton.Events.CLICK, this.update, this);\n\n this.contentElement.classList.add('watch-expressions');\n this.contentElement.setAttribute('jslog', `${VisualLogging.section('sources.watch')}`);\n this.contentElement.addEventListener('contextmenu', this.contextMenu.bind(this), false);\n this.treeOutline = new ObjectUI.ObjectPropertiesSection.ObjectPropertiesSectionsTreeOutline();\n this.treeOutline.hideOverflow();\n\n this.treeOutline.setShowSelectionOnKeyboardFocus(/* show */ true);\n this.expandController =\n new ObjectUI.ObjectPropertiesSection.ObjectPropertiesSectionsTreeExpandController(this.treeOutline);\n\n UI.Context.Context.instance().addFlavorChangeListener(SDK.RuntimeModel.ExecutionContext, this.update, this);\n UI.Context.Context.instance().addFlavorChangeListener(SDK.DebuggerModel.CallFrame, this.update, this);\n this.linkifier = new Components.Linkifier.Linkifier();\n this.update();\n }\n\n static instance(): WatchExpressionsSidebarPane {\n if (!watchExpressionsSidebarPaneInstance) {\n watchExpressionsSidebarPaneInstance = new WatchExpressionsSidebarPane();\n }\n return watchExpressionsSidebarPaneInstance;\n }\n\n toolbarItems(): UI.Toolbar.ToolbarItem[] {\n return [this.addButton, this.refreshButton];\n }\n\n override focus(): void {\n if (this.hasFocus()) {\n return;\n }\n if (this.watchExpressions.length > 0) {\n this.treeOutline.forceSelect();\n }\n }\n\n hasExpressions(): boolean {\n return Boolean(this.watchExpressionsSetting.get().length);\n }\n\n private saveExpressions(): void {\n const toSave = [];\n for (let i = 0; i < this.watchExpressions.length; i++) {\n const expression = this.watchExpressions[i].expression();\n if (expression) {\n toSave.push(expression);\n }\n }\n\n this.watchExpressionsSetting.set(toSave);\n }\n\n private async addButtonClicked(): Promise {\n await UI.ViewManager.ViewManager.instance().showView('sources.watch');\n this.emptyElement.classList.add('hidden');\n this.createWatchExpression(null).startEditing();\n }\n\n override async doUpdate(): Promise {\n this.linkifier.reset();\n this.contentElement.removeChildren();\n this.treeOutline.removeChildren();\n this.watchExpressions = [];\n this.emptyElement = (this.contentElement.createChild('div', 'gray-info-message') as HTMLElement);\n this.emptyElement.textContent = i18nString(UIStrings.noWatchExpressions);\n this.emptyElement.tabIndex = -1;\n const watchExpressionStrings = this.watchExpressionsSetting.get();\n if (watchExpressionStrings.length) {\n this.emptyElement.classList.add('hidden');\n }\n for (let i = 0; i < watchExpressionStrings.length; ++i) {\n const expression = watchExpressionStrings[i];\n if (!expression) {\n continue;\n }\n\n this.createWatchExpression(expression);\n }\n }\n\n private createWatchExpression(expression: string|null): WatchExpression {\n this.contentElement.appendChild(this.treeOutline.element);\n const watchExpression = new WatchExpression(expression, this.expandController, this.linkifier);\n UI.ARIAUtils.setLabel(this.contentElement, i18nString(UIStrings.addWatchExpression));\n watchExpression.addEventListener(Events.EXPRESSION_UPDATED, this.watchExpressionUpdated, this);\n this.treeOutline.appendChild(watchExpression.treeElement());\n this.watchExpressions.push(watchExpression);\n return watchExpression;\n }\n\n private watchExpressionUpdated({data: watchExpression}: Common.EventTarget.EventTargetEvent): void {\n if (!watchExpression.expression()) {\n Platform.ArrayUtilities.removeElement(this.watchExpressions, watchExpression);\n this.treeOutline.removeChild(watchExpression.treeElement());\n this.emptyElement.classList.toggle('hidden', Boolean(this.watchExpressions.length));\n if (this.watchExpressions.length === 0) {\n this.treeOutline.element.remove();\n }\n }\n\n this.saveExpressions();\n }\n\n private contextMenu(event: MouseEvent): void {\n const contextMenu = new UI.ContextMenu.ContextMenu(event);\n this.populateContextMenu(contextMenu, event);\n void contextMenu.show();\n }\n\n private populateContextMenu(contextMenu: UI.ContextMenu.ContextMenu, event: MouseEvent): void {\n let isEditing = false;\n for (const watchExpression of this.watchExpressions) {\n isEditing = isEditing || watchExpression.isEditing();\n }\n\n if (!isEditing) {\n contextMenu.debugSection().appendItem(\n i18nString(UIStrings.addWatchExpression), this.addButtonClicked.bind(this),\n {jslogContext: 'add-watch-expression'});\n }\n\n if (this.watchExpressions.length > 1) {\n contextMenu.debugSection().appendItem(\n i18nString(UIStrings.deleteAllWatchExpressions), this.deleteAllButtonClicked.bind(this),\n {jslogContext: 'delete-all-watch-expressions'});\n }\n\n const treeElement = this.treeOutline.treeElementFromEvent(event);\n if (!treeElement) {\n return;\n }\n const currentWatchExpression =\n this.watchExpressions.find(watchExpression => treeElement.hasAncestorOrSelf(watchExpression.treeElement()));\n if (currentWatchExpression) {\n currentWatchExpression.populateContextMenu(contextMenu, event);\n }\n }\n\n private deleteAllButtonClicked(): void {\n this.watchExpressions = [];\n this.saveExpressions();\n this.update();\n }\n\n private async focusAndAddExpressionToWatch(expression: string): Promise {\n await UI.ViewManager.ViewManager.instance().showView('sources.watch');\n this.createWatchExpression(expression);\n this.saveExpressions();\n this.update();\n }\n\n handleAction(_context: UI.Context.Context, _actionId: string): boolean {\n const frame = UI.Context.Context.instance().flavor(UISourceCodeFrame);\n if (!frame) {\n return false;\n }\n const {state} = frame.textEditor;\n const text = state.sliceDoc(state.selection.main.from, state.selection.main.to);\n void this.focusAndAddExpressionToWatch(text);\n return true;\n }\n\n appendApplicableItems(\n _event: Event, contextMenu: UI.ContextMenu.ContextMenu,\n target: ObjectUI.ObjectPropertiesSection.ObjectPropertyTreeElement|UISourceCodeFrame): void {\n if (target instanceof ObjectUI.ObjectPropertiesSection.ObjectPropertyTreeElement) {\n if (!target.property.synthetic) {\n contextMenu.debugSection().appendItem(\n i18nString(UIStrings.addPropertyPathToWatch), () => this.focusAndAddExpressionToWatch(target.path()),\n {jslogContext: 'add-property-path-to-watch'});\n }\n return;\n }\n\n if (target.textEditor.state.selection.main.empty) {\n return;\n }\n\n contextMenu.debugSection().appendAction('sources.add-to-watch');\n }\n\n override wasShown(): void {\n super.wasShown();\n this.treeOutline.registerCSSFiles([watchExpressionsSidebarPaneStyles]);\n this.registerCSSFiles([watchExpressionsSidebarPaneStyles, objectValueStyles]);\n }\n}\n\nexport class WatchExpression extends Common.ObjectWrapper.ObjectWrapper {\n private treeElementInternal!: UI.TreeOutline.TreeElement;\n private nameElement!: Element;\n private valueElement!: Element;\n private expressionInternal: string|null;\n private readonly expandController: ObjectUI.ObjectPropertiesSection.ObjectPropertiesSectionsTreeExpandController;\n private element: HTMLDivElement;\n private editing: boolean;\n private linkifier: Components.Linkifier.Linkifier;\n private textPrompt?: ObjectUI.ObjectPropertiesSection.ObjectPropertyPrompt;\n private result?: SDK.RemoteObject.RemoteObject|null;\n private preventClickTimeout?: number;\n constructor(\n expression: string|null,\n expandController: ObjectUI.ObjectPropertiesSection.ObjectPropertiesSectionsTreeExpandController,\n linkifier: Components.Linkifier.Linkifier) {\n super();\n\n this.expressionInternal = expression;\n this.expandController = expandController;\n this.element = document.createElement('div');\n this.element.classList.add('watch-expression');\n this.element.classList.add('monospace');\n this.editing = false;\n this.linkifier = linkifier;\n\n this.createWatchExpression();\n this.update();\n }\n\n treeElement(): UI.TreeOutline.TreeElement {\n return this.treeElementInternal;\n }\n\n expression(): string|null {\n return this.expressionInternal;\n }\n\n async #evaluateExpression(executionContext: SDK.RuntimeModel.ExecutionContext, expression: string):\n Promise {\n const callFrame = executionContext.debuggerModel.selectedCallFrame();\n if (callFrame && callFrame.script.isJavaScript()) {\n const nameMap = await SourceMapScopes.NamesResolver.allVariablesInCallFrame(callFrame);\n try {\n expression =\n await Formatter.FormatterWorkerPool.formatterWorkerPool().javaScriptSubstitute(expression, nameMap);\n } catch {\n }\n }\n\n return executionContext.evaluate(\n {\n expression,\n objectGroup: WatchExpression.watchObjectGroupId,\n includeCommandLineAPI: false,\n silent: true,\n returnByValue: false,\n generatePreview: false,\n },\n /* userGesture */ false,\n /* awaitPromise */ false);\n }\n\n update(): void {\n const currentExecutionContext = UI.Context.Context.instance().flavor(SDK.RuntimeModel.ExecutionContext);\n if (currentExecutionContext && this.expressionInternal) {\n void this.#evaluateExpression(currentExecutionContext, this.expressionInternal).then(result => {\n if ('object' in result) {\n this.createWatchExpression(result.object, result.exceptionDetails);\n } else {\n this.createWatchExpression();\n }\n });\n } else {\n this.createWatchExpression();\n }\n }\n\n startEditing(): void {\n this.editing = true;\n this.treeElementInternal.setDisableSelectFocus(true);\n this.element.removeChildren();\n const newDiv = this.element.createChild('div');\n newDiv.textContent = this.nameElement.textContent;\n this.textPrompt = new ObjectUI.ObjectPropertiesSection.ObjectPropertyPrompt();\n this.textPrompt.renderAsBlock();\n const proxyElement = (this.textPrompt.attachAndStartEditing(newDiv, this.finishEditing.bind(this)) as HTMLElement);\n this.treeElementInternal.listItemElement.classList.add('watch-expression-editing');\n this.treeElementInternal.collapse();\n proxyElement.classList.add('watch-expression-text-prompt-proxy');\n proxyElement.addEventListener('keydown', this.promptKeyDown.bind(this), false);\n const selection = this.element.getComponentSelection();\n if (selection) {\n selection.selectAllChildren(newDiv);\n }\n }\n\n isEditing(): boolean {\n return Boolean(this.editing);\n }\n\n private finishEditing(event: Event, canceled?: boolean): void {\n if (event) {\n event.consume(canceled);\n }\n\n this.editing = false;\n this.treeElementInternal.setDisableSelectFocus(false);\n this.treeElementInternal.listItemElement.classList.remove('watch-expression-editing');\n if (this.textPrompt) {\n this.textPrompt.detach();\n const newExpression = canceled ? this.expressionInternal : this.textPrompt.text();\n this.textPrompt = undefined;\n this.element.removeChildren();\n this.updateExpression(newExpression);\n }\n }\n\n private dblClickOnWatchExpression(event: Event): void {\n event.consume();\n if (!this.isEditing()) {\n this.startEditing();\n }\n }\n\n private updateExpression(newExpression: string|null): void {\n if (this.expressionInternal) {\n this.expandController.stopWatchSectionsWithId(this.expressionInternal);\n }\n this.expressionInternal = newExpression;\n this.update();\n this.dispatchEventToListeners(Events.EXPRESSION_UPDATED, this);\n }\n\n private deleteWatchExpression(event: Event): void {\n event.consume(true);\n this.updateExpression(null);\n }\n\n private createWatchExpression(\n result?: SDK.RemoteObject.RemoteObject, exceptionDetails?: Protocol.Runtime.ExceptionDetails): void {\n this.result = result || null;\n\n this.element.removeChildren();\n const oldTreeElement = this.treeElementInternal;\n this.createWatchExpressionTreeElement(result, exceptionDetails);\n if (oldTreeElement && oldTreeElement.parent) {\n const root = oldTreeElement.parent;\n const index = root.indexOfChild(oldTreeElement);\n root.removeChild(oldTreeElement);\n root.insertChild(this.treeElementInternal, index);\n }\n this.treeElementInternal.select();\n }\n\n private createWatchExpressionHeader(\n expressionValue?: SDK.RemoteObject.RemoteObject, exceptionDetails?: Protocol.Runtime.ExceptionDetails): Element {\n const headerElement = this.element.createChild('div', 'watch-expression-header');\n const deleteButton = new Buttons.Button.Button();\n deleteButton.data = {\n variant: Buttons.Button.Variant.ICON,\n iconName: 'bin',\n size: Buttons.Button.Size.SMALL,\n jslogContext: 'delete-watch-expression',\n };\n deleteButton.className = 'watch-expression-delete-button';\n UI.Tooltip.Tooltip.install(deleteButton, i18nString(UIStrings.deleteWatchExpression));\n deleteButton.addEventListener('click', this.deleteWatchExpression.bind(this), false);\n deleteButton.addEventListener('keydown', event => {\n if (event.key === 'Enter') {\n this.deleteWatchExpression(event);\n }\n });\n\n const titleElement = headerElement.createChild('div', 'watch-expression-title tree-element-title');\n titleElement.appendChild(deleteButton);\n this.nameElement =\n ObjectUI.ObjectPropertiesSection.ObjectPropertiesSection.createNameElement(this.expressionInternal);\n UI.Tooltip.Tooltip.install(this.nameElement as HTMLElement, this.expressionInternal);\n if (Boolean(exceptionDetails) || !expressionValue) {\n this.valueElement = document.createElement('span');\n this.valueElement.classList.add('watch-expression-error');\n this.valueElement.classList.add('value');\n titleElement.classList.add('dimmed');\n this.valueElement.textContent = i18nString(UIStrings.notAvailable);\n if (exceptionDetails !== undefined && exceptionDetails.exception !== undefined &&\n exceptionDetails.exception.description !== undefined) {\n UI.Tooltip.Tooltip.install(this.valueElement as HTMLElement, exceptionDetails.exception.description);\n }\n } else {\n const propertyValue =\n ObjectUI.ObjectPropertiesSection.ObjectPropertiesSection.createPropertyValueWithCustomSupport(\n expressionValue, Boolean(exceptionDetails), false /* showPreview */, titleElement, this.linkifier);\n this.valueElement = propertyValue.element;\n }\n const separatorElement = document.createElement('span');\n separatorElement.classList.add('watch-expressions-separator');\n separatorElement.textContent = ': ';\n titleElement.append(this.nameElement, separatorElement, this.valueElement);\n\n return headerElement;\n }\n\n private createWatchExpressionTreeElement(\n expressionValue?: SDK.RemoteObject.RemoteObject, exceptionDetails?: Protocol.Runtime.ExceptionDetails): void {\n const headerElement = this.createWatchExpressionHeader(expressionValue, exceptionDetails);\n\n if (!exceptionDetails && expressionValue && expressionValue.hasChildren && !expressionValue.customPreview()) {\n headerElement.classList.add('watch-expression-object-header');\n this.treeElementInternal = new ObjectUI.ObjectPropertiesSection.RootElement(expressionValue, this.linkifier);\n this.expandController.watchSection(\n (this.expressionInternal as string),\n (this.treeElementInternal as ObjectUI.ObjectPropertiesSection.RootElement));\n this.treeElementInternal.toggleOnClick = false;\n this.treeElementInternal.listItemElement.addEventListener('click', this.onSectionClick.bind(this), false);\n this.treeElementInternal.listItemElement.addEventListener('dblclick', this.dblClickOnWatchExpression.bind(this));\n } else {\n headerElement.addEventListener('dblclick', this.dblClickOnWatchExpression.bind(this));\n this.treeElementInternal = new UI.TreeOutline.TreeElement();\n }\n this.treeElementInternal.title = this.element;\n this.treeElementInternal.listItemElement.classList.add('watch-expression-tree-item');\n this.treeElementInternal.listItemElement.addEventListener('keydown', event => {\n if (event.key === 'Enter' && !this.isEditing()) {\n this.startEditing();\n event.consume(true);\n } else if (event.key === 'Delete' && !this.isEditing()) {\n this.deleteWatchExpression(event);\n }\n });\n }\n\n private onSectionClick(event: Event): void {\n event.consume(true);\n const mouseEvent = (event as MouseEvent);\n if (mouseEvent.detail === 1) {\n this.preventClickTimeout = window.setTimeout(handleClick.bind(this), 333);\n } else if (this.preventClickTimeout !== undefined) {\n window.clearTimeout(this.preventClickTimeout);\n this.preventClickTimeout = undefined;\n }\n\n function handleClick(this: WatchExpression): void {\n if (!this.treeElementInternal) {\n return;\n }\n\n if (this.treeElementInternal.expanded) {\n this.treeElementInternal.collapse();\n } else if (!this.editing) {\n this.treeElementInternal.expand();\n }\n }\n }\n\n private promptKeyDown(event: KeyboardEvent): void {\n const isEscapeKey = Platform.KeyboardUtilities.isEscKey(event);\n if (event.key === 'Enter' || isEscapeKey) {\n this.finishEditing(event, isEscapeKey);\n }\n }\n\n populateContextMenu(contextMenu: UI.ContextMenu.ContextMenu, event: Event): void {\n if (!this.isEditing()) {\n contextMenu.editSection().appendItem(\n i18nString(UIStrings.deleteWatchExpression), this.updateExpression.bind(this, null),\n {jslogContext: 'delete-watch-expression'});\n }\n\n if (!this.isEditing() && this.result && (this.result.type === 'number' || this.result.type === 'string')) {\n contextMenu.clipboardSection().appendItem(\n i18nString(UIStrings.copyValue), this.copyValueButtonClicked.bind(this),\n {jslogContext: 'copy-watch-expression-value'});\n }\n\n const target = UI.UIUtils.deepElementFromEvent(event);\n if (target && this.valueElement.isSelfOrAncestor(target) && this.result) {\n contextMenu.appendApplicableItems(this.result);\n }\n }\n\n private copyValueButtonClicked(): void {\n Host.InspectorFrontendHost.InspectorFrontendHostInstance.copyText(this.valueElement.textContent);\n }\n\n private static readonly watchObjectGroupId = 'watch-group';\n}\n\nconst enum Events {\n EXPRESSION_UPDATED = 'ExpressionUpdated',\n}\n\ntype EventTypes = {\n [Events.EXPRESSION_UPDATED]: WatchExpression,\n};\n"]} \ No newline at end of file +{"version":3,"file":"WatchExpressionsSidebarPane.js","sourceRoot":"","sources":["../../../../../../front_end/panels/sources/WatchExpressionsSidebarPane.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B;;;;;;;;;;;;;;;;;;;;;;;;;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,CAAC,IAAI,CAAC,SAAS,EAAE,EAAE,CAAC;YACtB,WAAW,CAAC,WAAW,EAAE,CAAC,UAAU,CAChC,UAAU,CAAC,SAAS,CAAC,qBAAqB,CAAC,EAAE,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,EACnF,EAAC,YAAY,EAAE,yBAAyB,EAAC,CAAC,CAAC;QACjD,CAAC;QAED,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,IAAI,CAAC,MAAM,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,KAAK,QAAQ,IAAI,IAAI,CAAC,MAAM,CAAC,IAAI,KAAK,QAAQ,CAAC,EAAE,CAAC;YACzG,WAAW,CAAC,gBAAgB,EAAE,CAAC,UAAU,CACrC,UAAU,CAAC,SAAS,CAAC,SAAS,CAAC,EAAE,IAAI,CAAC,sBAAsB,CAAC,IAAI,CAAC,IAAI,CAAC,EACvE,EAAC,YAAY,EAAE,6BAA6B,EAAC,CAAC,CAAC;QACrD,CAAC;QAED,MAAM,MAAM,GAAG,EAAE,CAAC,OAAO,CAAC,oBAAoB,CAAC,KAAK,CAAC,CAAC;QACtD,IAAI,MAAM,IAAI,IAAI,CAAC,YAAY,CAAC,gBAAgB,CAAC,MAAM,CAAC,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;YACxE,WAAW,CAAC,qBAAqB,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QACjD,CAAC;IACH,CAAC;IAEO,sBAAsB;QAC5B,IAAI,CAAC,qBAAqB,CAAC,6BAA6B,CAAC,QAAQ,CAAC,IAAI,CAAC,YAAY,CAAC,WAAW,CAAC,CAAC;IACnG,CAAC;IAEO,MAAM,CAAU,kBAAkB,GAAG,aAAa,CAAC","sourcesContent":["// Copyright 2021 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\n/*\n * Copyright (C) IBM Corp. 2009 All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are\n * met:\n *\n * * Redistributions of source code must retain the above copyright\n * notice, this list of conditions and the following disclaimer.\n * * Redistributions in binary form must reproduce the above\n * copyright notice, this list of conditions and the following disclaimer\n * in the documentation and/or other materials provided with the\n * distribution.\n * * Neither the name of IBM Corp. nor the names of its\n * contributors may be used to endorse or promote products derived from\n * this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nimport * as Common from '../../core/common/common.js';\nimport * as Host from '../../core/host/host.js';\nimport * as i18n from '../../core/i18n/i18n.js';\nimport * as Platform from '../../core/platform/platform.js';\nimport * as SDK from '../../core/sdk/sdk.js';\nimport type * as Protocol from '../../generated/protocol.js';\nimport * as Formatter from '../../models/formatter/formatter.js';\nimport * as SourceMapScopes from '../../models/source_map_scopes/source_map_scopes.js';\nimport * as Buttons from '../../ui/components/buttons/buttons.js';\nimport * as ObjectUI from '../../ui/legacy/components/object_ui/object_ui.js';\n// eslint-disable-next-line rulesdir/es-modules-import\nimport objectValueStyles from '../../ui/legacy/components/object_ui/objectValue.css.js';\nimport * as Components from '../../ui/legacy/components/utils/utils.js';\nimport * as UI from '../../ui/legacy/legacy.js';\nimport * as VisualLogging from '../../ui/visual_logging/visual_logging.js';\n\nimport {UISourceCodeFrame} from './UISourceCodeFrame.js';\nimport watchExpressionsSidebarPaneStyles from './watchExpressionsSidebarPane.css.js';\n\nconst UIStrings = {\n /**\n *@description A context menu item in the Watch Expressions Sidebar Pane of the Sources panel\n */\n addWatchExpression: 'Add watch expression',\n /**\n *@description Tooltip/screen reader label of a button in the Sources panel that refreshes all watch expressions.\n */\n refreshWatchExpressions: 'Refresh watch expressions',\n /**\n *@description Empty element text content in Watch Expressions Sidebar Pane of the Sources panel\n */\n noWatchExpressions: 'No watch expressions',\n /**\n *@description A context menu item in the Watch Expressions Sidebar Pane of the Sources panel\n */\n deleteAllWatchExpressions: 'Delete all watch expressions',\n /**\n *@description A context menu item in the Watch Expressions Sidebar Pane of the Sources panel\n */\n addPropertyPathToWatch: 'Add property path to watch',\n /**\n *@description A context menu item in the Watch Expressions Sidebar Pane of the Sources panel\n */\n deleteWatchExpression: 'Delete watch expression',\n /**\n *@description Value element text content in Watch Expressions Sidebar Pane of the Sources panel\n */\n notAvailable: '',\n /**\n *@description A context menu item in the Watch Expressions Sidebar Pane of the Sources panel and Network pane request.\n */\n copyValue: 'Copy value',\n};\nconst str_ = i18n.i18n.registerUIStrings('panels/sources/WatchExpressionsSidebarPane.ts', UIStrings);\nconst i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);\nlet watchExpressionsSidebarPaneInstance: WatchExpressionsSidebarPane;\n\nexport class WatchExpressionsSidebarPane extends UI.ThrottledWidget.ThrottledWidget implements\n UI.ActionRegistration.ActionDelegate, UI.Toolbar.ItemsProvider,\n UI.ContextMenu.Provider {\n private watchExpressions: WatchExpression[];\n private emptyElement!: HTMLElement;\n private readonly watchExpressionsSetting: Common.Settings.Setting;\n private readonly addButton: UI.Toolbar.ToolbarButton;\n private readonly refreshButton: UI.Toolbar.ToolbarButton;\n private readonly treeOutline: ObjectUI.ObjectPropertiesSection.ObjectPropertiesSectionsTreeOutline;\n private readonly expandController: ObjectUI.ObjectPropertiesSection.ObjectPropertiesSectionsTreeExpandController;\n private readonly linkifier: Components.Linkifier.Linkifier;\n private constructor() {\n super(true);\n\n // TODO(szuend): Replace with a Set once the web test\n // panels/sources/debugger-ui/watch-expressions-preserve-expansion.js is either converted\n // to an e2e test or no longer accesses this variable directly.\n this.watchExpressions = [];\n this.watchExpressionsSetting =\n Common.Settings.Settings.instance().createLocalSetting('watch-expressions', []);\n\n this.addButton = new UI.Toolbar.ToolbarButton(\n i18nString(UIStrings.addWatchExpression), 'plus', undefined, 'add-watch-expression');\n this.addButton.setSize(Buttons.Button.Size.SMALL);\n this.addButton.addEventListener(UI.Toolbar.ToolbarButton.Events.CLICK, _event => {\n void this.addButtonClicked();\n });\n this.refreshButton = new UI.Toolbar.ToolbarButton(\n i18nString(UIStrings.refreshWatchExpressions), 'refresh', undefined, 'refresh-watch-expressions');\n this.refreshButton.setSize(Buttons.Button.Size.SMALL);\n this.refreshButton.addEventListener(UI.Toolbar.ToolbarButton.Events.CLICK, this.update, this);\n\n this.contentElement.classList.add('watch-expressions');\n this.contentElement.setAttribute('jslog', `${VisualLogging.section('sources.watch')}`);\n this.contentElement.addEventListener('contextmenu', this.contextMenu.bind(this), false);\n this.treeOutline = new ObjectUI.ObjectPropertiesSection.ObjectPropertiesSectionsTreeOutline();\n this.treeOutline.hideOverflow();\n\n this.treeOutline.setShowSelectionOnKeyboardFocus(/* show */ true);\n this.expandController =\n new ObjectUI.ObjectPropertiesSection.ObjectPropertiesSectionsTreeExpandController(this.treeOutline);\n\n UI.Context.Context.instance().addFlavorChangeListener(SDK.RuntimeModel.ExecutionContext, this.update, this);\n UI.Context.Context.instance().addFlavorChangeListener(SDK.DebuggerModel.CallFrame, this.update, this);\n this.linkifier = new Components.Linkifier.Linkifier();\n this.update();\n }\n\n static instance(): WatchExpressionsSidebarPane {\n if (!watchExpressionsSidebarPaneInstance) {\n watchExpressionsSidebarPaneInstance = new WatchExpressionsSidebarPane();\n }\n return watchExpressionsSidebarPaneInstance;\n }\n\n toolbarItems(): UI.Toolbar.ToolbarItem[] {\n return [this.addButton, this.refreshButton];\n }\n\n override focus(): void {\n if (this.hasFocus()) {\n return;\n }\n if (this.watchExpressions.length > 0) {\n this.treeOutline.forceSelect();\n }\n }\n\n hasExpressions(): boolean {\n return Boolean(this.watchExpressionsSetting.get().length);\n }\n\n private saveExpressions(): void {\n const toSave = [];\n for (let i = 0; i < this.watchExpressions.length; i++) {\n const expression = this.watchExpressions[i].expression();\n if (expression) {\n toSave.push(expression);\n }\n }\n\n this.watchExpressionsSetting.set(toSave);\n }\n\n private async addButtonClicked(): Promise {\n await UI.ViewManager.ViewManager.instance().showView('sources.watch');\n this.emptyElement.classList.add('hidden');\n this.createWatchExpression(null).startEditing();\n }\n\n override async doUpdate(): Promise {\n this.linkifier.reset();\n this.contentElement.removeChildren();\n this.treeOutline.removeChildren();\n this.watchExpressions = [];\n this.emptyElement = this.contentElement.createChild('div', 'gray-info-message');\n this.emptyElement.textContent = i18nString(UIStrings.noWatchExpressions);\n this.emptyElement.tabIndex = -1;\n const watchExpressionStrings = this.watchExpressionsSetting.get();\n if (watchExpressionStrings.length) {\n this.emptyElement.classList.add('hidden');\n }\n for (let i = 0; i < watchExpressionStrings.length; ++i) {\n const expression = watchExpressionStrings[i];\n if (!expression) {\n continue;\n }\n\n this.createWatchExpression(expression);\n }\n }\n\n private createWatchExpression(expression: string|null): WatchExpression {\n this.contentElement.appendChild(this.treeOutline.element);\n const watchExpression = new WatchExpression(expression, this.expandController, this.linkifier);\n UI.ARIAUtils.setLabel(this.contentElement, i18nString(UIStrings.addWatchExpression));\n watchExpression.addEventListener(Events.EXPRESSION_UPDATED, this.watchExpressionUpdated, this);\n this.treeOutline.appendChild(watchExpression.treeElement());\n this.watchExpressions.push(watchExpression);\n return watchExpression;\n }\n\n private watchExpressionUpdated({data: watchExpression}: Common.EventTarget.EventTargetEvent): void {\n if (!watchExpression.expression()) {\n Platform.ArrayUtilities.removeElement(this.watchExpressions, watchExpression);\n this.treeOutline.removeChild(watchExpression.treeElement());\n this.emptyElement.classList.toggle('hidden', Boolean(this.watchExpressions.length));\n if (this.watchExpressions.length === 0) {\n this.treeOutline.element.remove();\n }\n }\n\n this.saveExpressions();\n }\n\n private contextMenu(event: MouseEvent): void {\n const contextMenu = new UI.ContextMenu.ContextMenu(event);\n this.populateContextMenu(contextMenu, event);\n void contextMenu.show();\n }\n\n private populateContextMenu(contextMenu: UI.ContextMenu.ContextMenu, event: MouseEvent): void {\n let isEditing = false;\n for (const watchExpression of this.watchExpressions) {\n isEditing = isEditing || watchExpression.isEditing();\n }\n\n if (!isEditing) {\n contextMenu.debugSection().appendItem(\n i18nString(UIStrings.addWatchExpression), this.addButtonClicked.bind(this),\n {jslogContext: 'add-watch-expression'});\n }\n\n if (this.watchExpressions.length > 1) {\n contextMenu.debugSection().appendItem(\n i18nString(UIStrings.deleteAllWatchExpressions), this.deleteAllButtonClicked.bind(this),\n {jslogContext: 'delete-all-watch-expressions'});\n }\n\n const treeElement = this.treeOutline.treeElementFromEvent(event);\n if (!treeElement) {\n return;\n }\n const currentWatchExpression =\n this.watchExpressions.find(watchExpression => treeElement.hasAncestorOrSelf(watchExpression.treeElement()));\n if (currentWatchExpression) {\n currentWatchExpression.populateContextMenu(contextMenu, event);\n }\n }\n\n private deleteAllButtonClicked(): void {\n this.watchExpressions = [];\n this.saveExpressions();\n this.update();\n }\n\n private async focusAndAddExpressionToWatch(expression: string): Promise {\n await UI.ViewManager.ViewManager.instance().showView('sources.watch');\n this.createWatchExpression(expression);\n this.saveExpressions();\n this.update();\n }\n\n handleAction(_context: UI.Context.Context, _actionId: string): boolean {\n const frame = UI.Context.Context.instance().flavor(UISourceCodeFrame);\n if (!frame) {\n return false;\n }\n const {state} = frame.textEditor;\n const text = state.sliceDoc(state.selection.main.from, state.selection.main.to);\n void this.focusAndAddExpressionToWatch(text);\n return true;\n }\n\n appendApplicableItems(\n _event: Event, contextMenu: UI.ContextMenu.ContextMenu,\n target: ObjectUI.ObjectPropertiesSection.ObjectPropertyTreeElement|UISourceCodeFrame): void {\n if (target instanceof ObjectUI.ObjectPropertiesSection.ObjectPropertyTreeElement) {\n if (!target.property.synthetic) {\n contextMenu.debugSection().appendItem(\n i18nString(UIStrings.addPropertyPathToWatch), () => this.focusAndAddExpressionToWatch(target.path()),\n {jslogContext: 'add-property-path-to-watch'});\n }\n return;\n }\n\n if (target.textEditor.state.selection.main.empty) {\n return;\n }\n\n contextMenu.debugSection().appendAction('sources.add-to-watch');\n }\n\n override wasShown(): void {\n super.wasShown();\n this.treeOutline.registerCSSFiles([watchExpressionsSidebarPaneStyles]);\n this.registerCSSFiles([watchExpressionsSidebarPaneStyles, objectValueStyles]);\n }\n}\n\nexport class WatchExpression extends Common.ObjectWrapper.ObjectWrapper {\n private treeElementInternal!: UI.TreeOutline.TreeElement;\n private nameElement!: Element;\n private valueElement!: Element;\n private expressionInternal: string|null;\n private readonly expandController: ObjectUI.ObjectPropertiesSection.ObjectPropertiesSectionsTreeExpandController;\n private element: HTMLDivElement;\n private editing: boolean;\n private linkifier: Components.Linkifier.Linkifier;\n private textPrompt?: ObjectUI.ObjectPropertiesSection.ObjectPropertyPrompt;\n private result?: SDK.RemoteObject.RemoteObject|null;\n private preventClickTimeout?: number;\n constructor(\n expression: string|null,\n expandController: ObjectUI.ObjectPropertiesSection.ObjectPropertiesSectionsTreeExpandController,\n linkifier: Components.Linkifier.Linkifier) {\n super();\n\n this.expressionInternal = expression;\n this.expandController = expandController;\n this.element = document.createElement('div');\n this.element.classList.add('watch-expression');\n this.element.classList.add('monospace');\n this.editing = false;\n this.linkifier = linkifier;\n\n this.createWatchExpression();\n this.update();\n }\n\n treeElement(): UI.TreeOutline.TreeElement {\n return this.treeElementInternal;\n }\n\n expression(): string|null {\n return this.expressionInternal;\n }\n\n async #evaluateExpression(executionContext: SDK.RuntimeModel.ExecutionContext, expression: string):\n Promise {\n const callFrame = executionContext.debuggerModel.selectedCallFrame();\n if (callFrame && callFrame.script.isJavaScript()) {\n const nameMap = await SourceMapScopes.NamesResolver.allVariablesInCallFrame(callFrame);\n try {\n expression =\n await Formatter.FormatterWorkerPool.formatterWorkerPool().javaScriptSubstitute(expression, nameMap);\n } catch {\n }\n }\n\n return executionContext.evaluate(\n {\n expression,\n objectGroup: WatchExpression.watchObjectGroupId,\n includeCommandLineAPI: false,\n silent: true,\n returnByValue: false,\n generatePreview: false,\n },\n /* userGesture */ false,\n /* awaitPromise */ false);\n }\n\n update(): void {\n const currentExecutionContext = UI.Context.Context.instance().flavor(SDK.RuntimeModel.ExecutionContext);\n if (currentExecutionContext && this.expressionInternal) {\n void this.#evaluateExpression(currentExecutionContext, this.expressionInternal).then(result => {\n if ('object' in result) {\n this.createWatchExpression(result.object, result.exceptionDetails);\n } else {\n this.createWatchExpression();\n }\n });\n } else {\n this.createWatchExpression();\n }\n }\n\n startEditing(): void {\n this.editing = true;\n this.treeElementInternal.setDisableSelectFocus(true);\n this.element.removeChildren();\n const newDiv = this.element.createChild('div');\n newDiv.textContent = this.nameElement.textContent;\n this.textPrompt = new ObjectUI.ObjectPropertiesSection.ObjectPropertyPrompt();\n this.textPrompt.renderAsBlock();\n const proxyElement = (this.textPrompt.attachAndStartEditing(newDiv, this.finishEditing.bind(this)) as HTMLElement);\n this.treeElementInternal.listItemElement.classList.add('watch-expression-editing');\n this.treeElementInternal.collapse();\n proxyElement.classList.add('watch-expression-text-prompt-proxy');\n proxyElement.addEventListener('keydown', this.promptKeyDown.bind(this), false);\n const selection = this.element.getComponentSelection();\n if (selection) {\n selection.selectAllChildren(newDiv);\n }\n }\n\n isEditing(): boolean {\n return Boolean(this.editing);\n }\n\n private finishEditing(event: Event, canceled?: boolean): void {\n if (event) {\n event.consume(canceled);\n }\n\n this.editing = false;\n this.treeElementInternal.setDisableSelectFocus(false);\n this.treeElementInternal.listItemElement.classList.remove('watch-expression-editing');\n if (this.textPrompt) {\n this.textPrompt.detach();\n const newExpression = canceled ? this.expressionInternal : this.textPrompt.text();\n this.textPrompt = undefined;\n this.element.removeChildren();\n this.updateExpression(newExpression);\n }\n }\n\n private dblClickOnWatchExpression(event: Event): void {\n event.consume();\n if (!this.isEditing()) {\n this.startEditing();\n }\n }\n\n private updateExpression(newExpression: string|null): void {\n if (this.expressionInternal) {\n this.expandController.stopWatchSectionsWithId(this.expressionInternal);\n }\n this.expressionInternal = newExpression;\n this.update();\n this.dispatchEventToListeners(Events.EXPRESSION_UPDATED, this);\n }\n\n private deleteWatchExpression(event: Event): void {\n event.consume(true);\n this.updateExpression(null);\n }\n\n private createWatchExpression(\n result?: SDK.RemoteObject.RemoteObject, exceptionDetails?: Protocol.Runtime.ExceptionDetails): void {\n this.result = result || null;\n\n this.element.removeChildren();\n const oldTreeElement = this.treeElementInternal;\n this.createWatchExpressionTreeElement(result, exceptionDetails);\n if (oldTreeElement && oldTreeElement.parent) {\n const root = oldTreeElement.parent;\n const index = root.indexOfChild(oldTreeElement);\n root.removeChild(oldTreeElement);\n root.insertChild(this.treeElementInternal, index);\n }\n this.treeElementInternal.select();\n }\n\n private createWatchExpressionHeader(\n expressionValue?: SDK.RemoteObject.RemoteObject, exceptionDetails?: Protocol.Runtime.ExceptionDetails): Element {\n const headerElement = this.element.createChild('div', 'watch-expression-header');\n const deleteButton = new Buttons.Button.Button();\n deleteButton.data = {\n variant: Buttons.Button.Variant.ICON,\n iconName: 'bin',\n size: Buttons.Button.Size.SMALL,\n jslogContext: 'delete-watch-expression',\n };\n deleteButton.className = 'watch-expression-delete-button';\n UI.Tooltip.Tooltip.install(deleteButton, i18nString(UIStrings.deleteWatchExpression));\n deleteButton.addEventListener('click', this.deleteWatchExpression.bind(this), false);\n deleteButton.addEventListener('keydown', event => {\n if (event.key === 'Enter') {\n this.deleteWatchExpression(event);\n }\n });\n\n const titleElement = headerElement.createChild('div', 'watch-expression-title tree-element-title');\n titleElement.appendChild(deleteButton);\n this.nameElement =\n ObjectUI.ObjectPropertiesSection.ObjectPropertiesSection.createNameElement(this.expressionInternal);\n UI.Tooltip.Tooltip.install(this.nameElement as HTMLElement, this.expressionInternal);\n if (Boolean(exceptionDetails) || !expressionValue) {\n this.valueElement = document.createElement('span');\n this.valueElement.classList.add('watch-expression-error');\n this.valueElement.classList.add('value');\n titleElement.classList.add('dimmed');\n this.valueElement.textContent = i18nString(UIStrings.notAvailable);\n if (exceptionDetails !== undefined && exceptionDetails.exception !== undefined &&\n exceptionDetails.exception.description !== undefined) {\n UI.Tooltip.Tooltip.install(this.valueElement as HTMLElement, exceptionDetails.exception.description);\n }\n } else {\n const propertyValue =\n ObjectUI.ObjectPropertiesSection.ObjectPropertiesSection.createPropertyValueWithCustomSupport(\n expressionValue, Boolean(exceptionDetails), false /* showPreview */, titleElement, this.linkifier);\n this.valueElement = propertyValue.element;\n }\n const separatorElement = document.createElement('span');\n separatorElement.classList.add('watch-expressions-separator');\n separatorElement.textContent = ': ';\n titleElement.append(this.nameElement, separatorElement, this.valueElement);\n\n return headerElement;\n }\n\n private createWatchExpressionTreeElement(\n expressionValue?: SDK.RemoteObject.RemoteObject, exceptionDetails?: Protocol.Runtime.ExceptionDetails): void {\n const headerElement = this.createWatchExpressionHeader(expressionValue, exceptionDetails);\n\n if (!exceptionDetails && expressionValue && expressionValue.hasChildren && !expressionValue.customPreview()) {\n headerElement.classList.add('watch-expression-object-header');\n this.treeElementInternal = new ObjectUI.ObjectPropertiesSection.RootElement(expressionValue, this.linkifier);\n this.expandController.watchSection(\n (this.expressionInternal as string),\n (this.treeElementInternal as ObjectUI.ObjectPropertiesSection.RootElement));\n this.treeElementInternal.toggleOnClick = false;\n this.treeElementInternal.listItemElement.addEventListener('click', this.onSectionClick.bind(this), false);\n this.treeElementInternal.listItemElement.addEventListener('dblclick', this.dblClickOnWatchExpression.bind(this));\n } else {\n headerElement.addEventListener('dblclick', this.dblClickOnWatchExpression.bind(this));\n this.treeElementInternal = new UI.TreeOutline.TreeElement();\n }\n this.treeElementInternal.title = this.element;\n this.treeElementInternal.listItemElement.classList.add('watch-expression-tree-item');\n this.treeElementInternal.listItemElement.addEventListener('keydown', event => {\n if (event.key === 'Enter' && !this.isEditing()) {\n this.startEditing();\n event.consume(true);\n } else if (event.key === 'Delete' && !this.isEditing()) {\n this.deleteWatchExpression(event);\n }\n });\n }\n\n private onSectionClick(event: Event): void {\n event.consume(true);\n const mouseEvent = (event as MouseEvent);\n if (mouseEvent.detail === 1) {\n this.preventClickTimeout = window.setTimeout(handleClick.bind(this), 333);\n } else if (this.preventClickTimeout !== undefined) {\n window.clearTimeout(this.preventClickTimeout);\n this.preventClickTimeout = undefined;\n }\n\n function handleClick(this: WatchExpression): void {\n if (!this.treeElementInternal) {\n return;\n }\n\n if (this.treeElementInternal.expanded) {\n this.treeElementInternal.collapse();\n } else if (!this.editing) {\n this.treeElementInternal.expand();\n }\n }\n }\n\n private promptKeyDown(event: KeyboardEvent): void {\n const isEscapeKey = Platform.KeyboardUtilities.isEscKey(event);\n if (event.key === 'Enter' || isEscapeKey) {\n this.finishEditing(event, isEscapeKey);\n }\n }\n\n populateContextMenu(contextMenu: UI.ContextMenu.ContextMenu, event: Event): void {\n if (!this.isEditing()) {\n contextMenu.editSection().appendItem(\n i18nString(UIStrings.deleteWatchExpression), this.updateExpression.bind(this, null),\n {jslogContext: 'delete-watch-expression'});\n }\n\n if (!this.isEditing() && this.result && (this.result.type === 'number' || this.result.type === 'string')) {\n contextMenu.clipboardSection().appendItem(\n i18nString(UIStrings.copyValue), this.copyValueButtonClicked.bind(this),\n {jslogContext: 'copy-watch-expression-value'});\n }\n\n const target = UI.UIUtils.deepElementFromEvent(event);\n if (target && this.valueElement.isSelfOrAncestor(target) && this.result) {\n contextMenu.appendApplicableItems(this.result);\n }\n }\n\n private copyValueButtonClicked(): void {\n Host.InspectorFrontendHost.InspectorFrontendHostInstance.copyText(this.valueElement.textContent);\n }\n\n private static readonly watchObjectGroupId = 'watch-group';\n}\n\nconst enum Events {\n EXPRESSION_UPDATED = 'ExpressionUpdated',\n}\n\ntype EventTypes = {\n [Events.EXPRESSION_UPDATED]: WatchExpression,\n};\n"]} \ No newline at end of file diff --git a/public/panels/sources/components/BreakpointsView.js b/public/panels/sources/components/BreakpointsView.js index ff1f84b57..06102d8ee 100644 --- a/public/panels/sources/components/BreakpointsView.js +++ b/public/panels/sources/components/BreakpointsView.js @@ -14,7 +14,7 @@ import * as TextUtils from '../../../models/text_utils/text_utils.js'; import * as Workspace from '../../../models/workspace/workspace.js'; import * as Input from '../../../ui/components/input/input.js'; import * as LegacyWrapper from '../../../ui/components/legacy_wrapper/legacy_wrapper.js'; -import * as Coordinator from '../../../ui/components/render_coordinator/render_coordinator.js'; +import * as RenderCoordinator from '../../../ui/components/render_coordinator/render_coordinator.js'; import * as UI from '../../../ui/legacy/legacy.js'; import * as LitHtml from '../../../ui/lit-html/lit-html.js'; import * as VisualLogging from '../../../ui/visual_logging/visual_logging.js'; @@ -104,7 +104,6 @@ const UIStrings = { }; const str_ = i18n.i18n.registerUIStrings('panels/sources/components/BreakpointsView.ts', UIStrings); const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_); -const coordinator = Coordinator.RenderCoordinator.RenderCoordinator.instance(); const MAX_SNIPPET_LENGTH = 200; let breakpointsViewInstance; let breakpointsViewControllerInstance; @@ -453,7 +452,7 @@ export class BreakpointsView extends LegacyWrapper.LegacyWrapper.WrappableCompon this.#shadow.adoptedStyleSheets = [Input.checkboxStyles, breakpointsViewStyles]; } async render() { - await coordinator.write('BreakpointsView render', () => { + await RenderCoordinator.write('BreakpointsView render', () => { const clickHandler = async (event) => { const currentTarget = event.currentTarget; await this.#setSelected(currentTarget); @@ -495,7 +494,7 @@ export class BreakpointsView extends LegacyWrapper.LegacyWrapper.WrappableCompon }); // If no element is tabbable, set the pause-on-exceptions to be tabbable. This can happen // if the previously focused element was removed. - await coordinator.write('BreakpointsView make pause-on-exceptions focusable', () => { + await RenderCoordinator.write('BreakpointsView make pause-on-exceptions focusable', () => { if (this.#shadow.querySelector('[tabindex="0"]') === null) { const element = this.#shadow.querySelector('[data-first-pause]'); element?.setAttribute('tabindex', '0'); @@ -529,7 +528,7 @@ export class BreakpointsView extends LegacyWrapper.LegacyWrapper.WrappableCompon if (!element) { return; } - void coordinator.write('BreakpointsView focus on selected element', () => { + void RenderCoordinator.write('BreakpointsView focus on selected element', () => { const prevSelected = this.#shadow.querySelector('[tabindex="0"]'); prevSelected?.setAttribute('tabindex', '-1'); element.setAttribute('tabindex', '0'); @@ -539,11 +538,11 @@ export class BreakpointsView extends LegacyWrapper.LegacyWrapper.WrappableCompon async #handleArrowKey(key, target) { const setGroupExpandedState = (detailsElement, expanded) => { if (expanded) { - return coordinator.write('BreakpointsView expand', () => { + return RenderCoordinator.write('BreakpointsView expand', () => { detailsElement.setAttribute('open', ''); }); } - return coordinator.write('BreakpointsView expand', () => { + return RenderCoordinator.write('BreakpointsView expand', () => { detailsElement.removeAttribute('open'); }); }; @@ -840,7 +839,7 @@ export class BreakpointsView extends LegacyWrapper.LegacyWrapper.WrappableCompon // uncheck the pause on caught exception checkbox. pauseOnCaughtCheckbox.click(); } - void coordinator.write('BreakpointsView update pause-on-uncaught-exception', () => { + void RenderCoordinator.write('BreakpointsView update pause-on-uncaught-exception', () => { // Disable/enable the pause on caught exception checkbox depending on whether // or not we are pausing on uncaught exceptions. if (checked) { diff --git a/public/panels/sources/components/BreakpointsView.js.map b/public/panels/sources/components/BreakpointsView.js.map index 25fcb6116..3f9b5fa17 100644 --- a/public/panels/sources/components/BreakpointsView.js.map +++ b/public/panels/sources/components/BreakpointsView.js.map @@ -1 +1 @@ -{"version":3,"file":"BreakpointsView.js","sourceRoot":"","sources":["../../../../../../../front_end/panels/sources/components/BreakpointsView.ts"],"names":[],"mapp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BAAsB,CAAC,IAAI,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;IACjE,CAAC;IAED,sCAAsC,CAAC,CAAQ;QAC7C,MAAM,EAAC,OAAO,EAAC,GAAG,CAAC,CAAC,MAA0B,CAAC;QAC/C,IAAI,CAAC,WAAW,CAAC,0BAA0B,CAAC,OAAO,CAAC,CAAC;IACvD,CAAC;IAED,wCAAwC,CAAC,CAAQ;QAC/C,MAAM,EAAC,OAAO,EAAC,GAAG,CAAC,CAAC,MAA0B,CAAC;QAC/C,IAAI,CAAC,IAAI,CAAC,wBAAwB,EAAE,CAAC;YACnC,MAAM,qBAAqB,GAAG,IAAI,CAAC,OAAO,CAAC,aAAa,CAAmB,iCAAiC,CAAC,CAAC;YAC9G,wBAAwB,CAAC,qBAAqB,CAAC,CAAC;YAChD,IAAI,CAAC,OAAO,IAAI,qBAAqB,CAAC,OAAO,EAAE,CAAC;gBAC9C,6FAA6F;gBAC7F,kDAAkD;gBAClD,qBAAqB,CAAC,KAAK,EAAE,CAAC;YAChC,CAAC;YAED,KAAK,WAAW,CAAC,KAAK,CAAC,oDAAoD,EAAE,GAAG,EAAE;gBAChF,6EAA6E;gBAC7E,gDAAgD;gBAChD,IAAI,OAAO,EAAE,CAAC;oBACZ,qBAAqB,CAAC,QAAQ,GAAG,KAAK,CAAC;gBACzC,CAAC;qBAAM,CAAC;oBACN,qBAAqB,CAAC,QAAQ,GAAG,IAAI,CAAC;gBACxC,CAAC;YACH,CAAC,CAAC,CAAC;QACL,CAAC;QACD,IAAI,CAAC,WAAW,CAAC,4BAA4B,CAAC,OAAO,CAAC,CAAC;IACzD,CAAC;CACF;AAED,cAAc,CAAC,MAAM,CAAC,0BAA0B,EAAE,eAAe,CAAC,CAAC","sourcesContent":["// Copyright (c) 2022 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport '../../../ui/components/icon_button/icon_button.js';\n\nimport * as Common from '../../../core/common/common.js';\nimport * as Host from '../../../core/host/host.js';\nimport * as i18n from '../../../core/i18n/i18n.js';\nimport * as Platform from '../../../core/platform/platform.js';\nimport {assertNotNullOrUndefined} from '../../../core/platform/platform.js';\nimport * as SDK from '../../../core/sdk/sdk.js';\nimport * as Bindings from '../../../models/bindings/bindings.js';\nimport * as Breakpoints from '../../../models/breakpoints/breakpoints.js';\nimport * as TextUtils from '../../../models/text_utils/text_utils.js';\nimport * as Workspace from '../../../models/workspace/workspace.js';\nimport * as Input from '../../../ui/components/input/input.js';\nimport * as LegacyWrapper from '../../../ui/components/legacy_wrapper/legacy_wrapper.js';\nimport * as Coordinator from '../../../ui/components/render_coordinator/render_coordinator.js';\nimport * as UI from '../../../ui/legacy/legacy.js';\nimport * as LitHtml from '../../../ui/lit-html/lit-html.js';\nimport * as VisualLogging from '../../../ui/visual_logging/visual_logging.js';\n\nimport breakpointsViewStyles from './breakpointsView.css.js';\nimport {findNextNodeForKeyboardNavigation, getDifferentiatingPathMap, type TitleInfo} from './BreakpointsViewUtils.js';\n\nconst {html, Directives: {ifDefined, repeat, classMap, live}} = LitHtml;\n\nconst UIStrings = {\n /**\n *@description Label for a checkbox to toggle pausing on uncaught exceptions in the breakpoint sidebar of the Sources panel. When the checkbox is checked, DevTools will pause if an uncaught exception is thrown at runtime.\n */\n pauseOnUncaughtExceptions: 'Pause on uncaught exceptions',\n /**\n *@description Label for a checkbox to toggling pausing on caught exceptions in the breakpoint sidebar of the Sources panel. When the checkbox is checked, DevTools will pause if an exception is thrown, but caught (handled) at runtime.\n */\n pauseOnCaughtExceptions: 'Pause on caught exceptions',\n /**\n *@description Text exposed to screen readers on checked items.\n */\n checked: 'checked',\n /**\n *@description Accessible text exposed to screen readers when the screen reader encounters an unchecked checkbox.\n */\n unchecked: 'unchecked',\n /**\n *@description Accessible text for a breakpoint collection with a combination of checked states.\n */\n indeterminate: 'mixed',\n /**\n *@description Accessibility label for hit breakpoints in the Sources panel.\n *@example {checked} PH1\n */\n breakpointHit: '{PH1} breakpoint hit',\n /**\n *@description Tooltip text that shows when hovered over a remove button that appears next to a filename in the breakpoint sidebar of the sources panel. Also used in the context menu for breakpoint groups.\n */\n removeAllBreakpointsInFile: 'Remove all breakpoints in file',\n /**\n *@description Context menu item in the Breakpoints Sidebar Pane of the Sources panel that disables all breakpoints in a file.\n */\n disableAllBreakpointsInFile: 'Disable all breakpoints in file',\n /**\n *@description Context menu item in the Breakpoints Sidebar Pane of the Sources panel that enables all breakpoints in a file.\n */\n enableAllBreakpointsInFile: 'Enable all breakpoints in file',\n /**\n *@description Tooltip text that shows when hovered over an edit button that appears next to a breakpoint or conditional breakpoint in the breakpoint sidebar of the sources panel.\n */\n editCondition: 'Edit condition',\n /**\n *@description Tooltip text that shows when hovered over an edit button that appears next to a logpoint in the breakpoint sidebar of the sources panel.\n */\n editLogpoint: 'Edit logpoint',\n /**\n *@description Context menu item in the Breakpoints Sidebar Pane of the Sources panel that disables all breakpoints.\n */\n disableAllBreakpoints: 'Disable all breakpoints',\n /**\n *@description Context menu item in the Breakpoints Sidebar Pane of the Sources panel that enables all breakpoints.\n */\n enableAllBreakpoints: 'Enable all breakpoints',\n /**\n *@description Tooltip text that shows when hovered over a remove button that appears next to a breakpoint in the breakpoint sidebar of the sources panel. Also used in the context menu for breakpoint items.\n */\n removeBreakpoint: 'Remove breakpoint',\n /**\n *@description Text to remove all breakpoints\n */\n removeAllBreakpoints: 'Remove all breakpoints',\n /**\n *@description Text in Breakpoints Sidebar Pane of the Sources panel\n */\n removeOtherBreakpoints: 'Remove other breakpoints',\n /**\n *@description Context menu item that reveals the source code location of a breakpoint in the Sources panel.\n */\n revealLocation: 'Reveal location',\n /**\n *@description Tooltip text that shows when hovered over a piece of code of a breakpoint in the breakpoint sidebar of the sources panel. It shows the condition, on which the breakpoint will stop.\n *@example {x < 3} PH1\n */\n conditionCode: 'Condition: {PH1}',\n /**\n *@description Tooltip text that shows when hovered over a piece of code of a breakpoint in the breakpoint sidebar of the sources panel. It shows what is going to be printed in the console, if execution hits this breakpoint.\n *@example {'hello'} PH1\n */\n logpointCode: 'Logpoint: {PH1}',\n};\nconst str_ = i18n.i18n.registerUIStrings('panels/sources/components/BreakpointsView.ts', UIStrings);\nconst i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);\nconst coordinator = Coordinator.RenderCoordinator.RenderCoordinator.instance();\n\nconst MAX_SNIPPET_LENGTH = 200;\n\nexport interface BreakpointsViewData {\n breakpointsActive: boolean;\n pauseOnUncaughtExceptions: boolean;\n pauseOnCaughtExceptions: boolean;\n // TODO(crbug.com/1382762): Remove special casing with dependent toggles as soon as Node LTS caught up on independent pause of exception toggles.\n independentPauseToggles: boolean;\n groups: BreakpointGroup[];\n}\n\nexport interface BreakpointGroup {\n name: string;\n url: Platform.DevToolsPath.UrlString;\n editable: boolean;\n expanded: boolean;\n breakpointItems: BreakpointItem[];\n}\n\nexport interface BreakpointItem {\n id: string;\n location: string;\n codeSnippet: string;\n isHit: boolean;\n status: BreakpointStatus;\n type: SDK.DebuggerModel.BreakpointType;\n hoverText?: string;\n}\n\nexport const enum BreakpointStatus {\n ENABLED = 'ENABLED',\n DISABLED = 'DISABLED',\n INDETERMINATE = 'INDETERMINATE',\n}\n\nlet breakpointsViewInstance: LegacyWrapper.LegacyWrapper.LegacyWrapper|null;\nlet breakpointsViewControllerInstance: BreakpointsSidebarController|null;\n\nexport class BreakpointsSidebarController implements UI.ContextFlavorListener.ContextFlavorListener {\n readonly #breakpointManager: Breakpoints.BreakpointManager.BreakpointManager;\n readonly #breakpointItemToLocationMap =\n new WeakMap();\n readonly #breakpointsActiveSetting: Common.Settings.Setting;\n readonly #pauseOnUncaughtExceptionSetting: Common.Settings.Setting;\n readonly #pauseOnCaughtExceptionSetting: Common.Settings.Setting;\n\n readonly #collapsedFilesSettings: Common.Settings.Setting;\n readonly #collapsedFiles: Set;\n\n // This is used to keep track of outstanding edits to breakpoints that were initiated\n // by the breakpoint edit button (for UMA).\n #outstandingBreakpointEdited: Breakpoints.BreakpointManager.Breakpoint|undefined;\n #updateScheduled = false;\n #updateRunning = false;\n\n private constructor(\n breakpointManager: Breakpoints.BreakpointManager.BreakpointManager, settings: Common.Settings.Settings) {\n this.#collapsedFilesSettings = Common.Settings.Settings.instance().createSetting('collapsed-files', []);\n this.#collapsedFiles = new Set(this.#collapsedFilesSettings.get());\n this.#breakpointManager = breakpointManager;\n this.#breakpointManager.addEventListener(\n Breakpoints.BreakpointManager.Events.BreakpointAdded, this.#onBreakpointAdded, this);\n this.#breakpointManager.addEventListener(\n Breakpoints.BreakpointManager.Events.BreakpointRemoved, this.#onBreakpointRemoved, this);\n this.#breakpointsActiveSetting = settings.moduleSetting('breakpoints-active');\n this.#breakpointsActiveSetting.addChangeListener(this.update, this);\n this.#pauseOnUncaughtExceptionSetting = settings.moduleSetting('pause-on-uncaught-exception');\n this.#pauseOnUncaughtExceptionSetting.addChangeListener(this.update, this);\n this.#pauseOnCaughtExceptionSetting = settings.moduleSetting('pause-on-caught-exception');\n this.#pauseOnCaughtExceptionSetting.addChangeListener(this.update, this);\n }\n\n static instance({forceNew, breakpointManager, settings}: {\n forceNew: boolean|null,\n breakpointManager: Breakpoints.BreakpointManager.BreakpointManager,\n settings: Common.Settings.Settings,\n } = {\n forceNew: null,\n breakpointManager: Breakpoints.BreakpointManager.BreakpointManager.instance(),\n settings: Common.Settings.Settings.instance(),\n }): BreakpointsSidebarController {\n if (!breakpointsViewControllerInstance || forceNew) {\n breakpointsViewControllerInstance = new BreakpointsSidebarController(breakpointManager, settings);\n }\n return breakpointsViewControllerInstance;\n }\n\n static removeInstance(): void {\n breakpointsViewControllerInstance = null;\n }\n\n static targetSupportsIndependentPauseOnExceptionToggles(): boolean {\n const hasNodeTargets =\n SDK.TargetManager.TargetManager.instance().targets().some(target => target.type() === SDK.Target.Type.NODE);\n return !hasNodeTargets;\n }\n\n flavorChanged(_object: Object|null): void {\n void this.update();\n }\n\n breakpointEditFinished(breakpoint: Breakpoints.BreakpointManager.Breakpoint|null, edited: boolean): void {\n if (this.#outstandingBreakpointEdited && this.#outstandingBreakpointEdited === breakpoint) {\n if (edited) {\n Host.userMetrics.actionTaken(Host.UserMetrics.Action.BreakpointConditionEditedFromSidebar);\n }\n this.#outstandingBreakpointEdited = undefined;\n }\n }\n\n breakpointStateChanged(breakpointItem: BreakpointItem, checked: boolean): void {\n const locations = this.#getLocationsForBreakpointItem(breakpointItem);\n locations.forEach((value: Breakpoints.BreakpointManager.BreakpointLocation) => {\n const breakpoint = value.breakpoint;\n breakpoint.setEnabled(checked);\n });\n }\n\n async breakpointEdited(breakpointItem: BreakpointItem, editButtonClicked: boolean): Promise {\n const locations = this.#getLocationsForBreakpointItem(breakpointItem);\n let location: Breakpoints.BreakpointManager.BreakpointLocation|undefined;\n for (const locationCandidate of locations) {\n if (!location || locationCandidate.uiLocation.compareTo(location.uiLocation) < 0) {\n location = locationCandidate;\n }\n }\n if (location) {\n if (editButtonClicked) {\n this.#outstandingBreakpointEdited = location.breakpoint;\n }\n await Common.Revealer.reveal(location);\n }\n }\n\n breakpointsRemoved(breakpointItems: BreakpointItem[]): void {\n const locations = breakpointItems.flatMap(breakpointItem => this.#getLocationsForBreakpointItem(breakpointItem));\n locations.forEach(location => location?.breakpoint.remove(false /* keepInStorage */));\n }\n\n expandedStateChanged(url: Platform.DevToolsPath.UrlString, expanded: boolean): void {\n if (expanded) {\n this.#collapsedFiles.delete(url);\n } else {\n this.#collapsedFiles.add(url);\n }\n\n this.#saveSettings();\n }\n\n async jumpToSource(breakpointItem: BreakpointItem): Promise {\n const uiLocations = this.#getLocationsForBreakpointItem(breakpointItem).map(location => location.uiLocation);\n let uiLocation: Workspace.UISourceCode.UILocation|undefined;\n for (const uiLocationCandidate of uiLocations) {\n if (!uiLocation || uiLocationCandidate.compareTo(uiLocation) < 0) {\n uiLocation = uiLocationCandidate;\n }\n }\n if (uiLocation) {\n await Common.Revealer.reveal(uiLocation);\n }\n }\n\n setPauseOnUncaughtExceptions(value: boolean): void {\n this.#pauseOnUncaughtExceptionSetting.set(value);\n }\n\n setPauseOnCaughtExceptions(value: boolean): void {\n this.#pauseOnCaughtExceptionSetting.set(value);\n }\n\n async update(): Promise {\n this.#updateScheduled = true;\n if (this.#updateRunning) {\n return;\n }\n this.#updateRunning = true;\n while (this.#updateScheduled) {\n this.#updateScheduled = false;\n const data = await this.getUpdatedBreakpointViewData();\n BreakpointsView.instance().data = data;\n }\n this.#updateRunning = false;\n }\n\n async getUpdatedBreakpointViewData(): Promise {\n const breakpointsActive = this.#breakpointsActiveSetting.get();\n const independentPauseToggles = BreakpointsSidebarController.targetSupportsIndependentPauseOnExceptionToggles();\n const pauseOnUncaughtExceptions = this.#pauseOnUncaughtExceptionSetting.get();\n const pauseOnCaughtExceptions = this.#pauseOnCaughtExceptionSetting.get();\n\n const breakpointLocations = this.#getBreakpointLocations();\n if (!breakpointLocations.length) {\n return {\n breakpointsActive,\n pauseOnCaughtExceptions,\n pauseOnUncaughtExceptions,\n independentPauseToggles,\n groups: [],\n };\n }\n\n const locationsGroupedById = this.#groupBreakpointLocationsById(breakpointLocations);\n const locationIdsByLineId = this.#getLocationIdsByLineId(breakpointLocations);\n\n const [content, selectedUILocation] = await Promise.all([\n this.#getContent(locationsGroupedById),\n this.#getHitUILocation(),\n ]);\n\n const scriptIdToGroup = new Map();\n\n for (let idx = 0; idx < locationsGroupedById.length; idx++) {\n const locations = locationsGroupedById[idx];\n const fstLocation = locations[0];\n const sourceURL = fstLocation.uiLocation.uiSourceCode.url();\n const scriptId = fstLocation.uiLocation.uiSourceCode.canononicalScriptId();\n const uiLocation = fstLocation.uiLocation;\n\n const isHit = selectedUILocation !== null &&\n locations.some(location => location.uiLocation.id() === selectedUILocation.id());\n\n const numBreakpointsOnLine = locationIdsByLineId.get(uiLocation.lineId()).size;\n const showColumn = numBreakpointsOnLine > 1;\n const locationText = uiLocation.lineAndColumnText(showColumn) as string;\n\n const contentData = content[idx];\n const codeSnippet = contentData instanceof TextUtils.WasmDisassembly.WasmDisassembly ?\n contentData.lines[contentData.bytecodeOffsetToLineNumber(uiLocation.columnNumber ?? 0)] ?? '' :\n contentData.textObj.lineAt(uiLocation.lineNumber);\n\n if (isHit && this.#collapsedFiles.has(sourceURL)) {\n this.#collapsedFiles.delete(sourceURL);\n this.#saveSettings();\n }\n const expanded = !this.#collapsedFiles.has(sourceURL);\n\n const status: BreakpointStatus = this.#getBreakpointState(locations);\n const {type, hoverText} = this.#getBreakpointTypeAndDetails(locations);\n const item = {\n id: fstLocation.breakpoint.breakpointStorageId(),\n location: locationText,\n codeSnippet,\n isHit,\n status,\n type,\n hoverText,\n };\n this.#breakpointItemToLocationMap.set(item, locations);\n\n let group = scriptIdToGroup.get(scriptId);\n if (group) {\n group.breakpointItems.push(item);\n group.expanded ||= expanded;\n } else {\n const editable = this.#breakpointManager.supportsConditionalBreakpoints(uiLocation.uiSourceCode);\n group = {\n url: sourceURL,\n name: uiLocation.uiSourceCode.displayName(),\n editable,\n expanded,\n breakpointItems: [item],\n };\n scriptIdToGroup.set(scriptId, group);\n }\n }\n return {\n breakpointsActive,\n pauseOnCaughtExceptions,\n pauseOnUncaughtExceptions,\n independentPauseToggles,\n groups: Array.from(scriptIdToGroup.values()),\n };\n }\n\n #onBreakpointAdded(event: Common.EventTarget.EventTargetEvent):\n Promise {\n const breakpoint = event.data.breakpoint;\n if (breakpoint.origin === Breakpoints.BreakpointManager.BreakpointOrigin.USER_ACTION &&\n this.#collapsedFiles.has(breakpoint.url())) {\n // Auto-expand if a new breakpoint was added to a collapsed group.\n this.#collapsedFiles.delete(breakpoint.url());\n this.#saveSettings();\n }\n return this.update();\n }\n\n #onBreakpointRemoved(event: Common.EventTarget.EventTargetEvent):\n Promise {\n const breakpoint = event.data.breakpoint;\n if (this.#collapsedFiles.has(breakpoint.url())) {\n const locations = Breakpoints.BreakpointManager.BreakpointManager.instance().allBreakpointLocations();\n const otherBreakpointsOnSameFileExist =\n locations.some(location => location.breakpoint.url() === breakpoint.url());\n if (!otherBreakpointsOnSameFileExist) {\n // Clear up the #collapsedFiles set from this url if no breakpoint is left in this group.\n this.#collapsedFiles.delete(breakpoint.url());\n this.#saveSettings();\n }\n }\n return this.update();\n }\n\n #saveSettings(): void {\n this.#collapsedFilesSettings.set(Array.from(this.#collapsedFiles.values()));\n }\n\n #getBreakpointTypeAndDetails(locations: Breakpoints.BreakpointManager.BreakpointLocation[]):\n {type: SDK.DebuggerModel.BreakpointType, hoverText?: string} {\n const breakpointWithCondition = locations.find(location => Boolean(location.breakpoint.condition()));\n const breakpoint = breakpointWithCondition?.breakpoint;\n if (!breakpoint || !breakpoint.condition()) {\n return {type: SDK.DebuggerModel.BreakpointType.REGULAR_BREAKPOINT};\n }\n\n const condition = breakpoint.condition();\n if (breakpoint.isLogpoint()) {\n return {type: SDK.DebuggerModel.BreakpointType.LOGPOINT, hoverText: condition};\n }\n\n return {type: SDK.DebuggerModel.BreakpointType.CONDITIONAL_BREAKPOINT, hoverText: condition};\n }\n\n #getLocationsForBreakpointItem(breakpointItem: BreakpointItem): Breakpoints.BreakpointManager.BreakpointLocation[] {\n const locations = this.#breakpointItemToLocationMap.get(breakpointItem);\n assertNotNullOrUndefined(locations);\n return locations;\n }\n\n async #getHitUILocation(): Promise {\n const details = UI.Context.Context.instance().flavor(SDK.DebuggerModel.DebuggerPausedDetails);\n if (details && details.callFrames.length) {\n return await Bindings.DebuggerWorkspaceBinding.DebuggerWorkspaceBinding.instance().rawLocationToUILocation(\n details.callFrames[0].location());\n }\n return null;\n }\n\n #getBreakpointLocations(): Breakpoints.BreakpointManager.BreakpointLocation[] {\n const locations = this.#breakpointManager.allBreakpointLocations().filter(\n breakpointLocation =>\n breakpointLocation.uiLocation.uiSourceCode.project().type() !== Workspace.Workspace.projectTypes.Debugger);\n\n locations.sort((item1, item2) => item1.uiLocation.compareTo(item2.uiLocation));\n\n const result = [];\n let lastBreakpoint: Breakpoints.BreakpointManager.Breakpoint|null = null;\n let lastLocation: Workspace.UISourceCode.UILocation|null = null;\n for (const location of locations) {\n if (location.breakpoint !== lastBreakpoint || (lastLocation && location.uiLocation.compareTo(lastLocation))) {\n result.push(location);\n lastBreakpoint = location.breakpoint;\n lastLocation = location.uiLocation;\n }\n }\n return result;\n }\n\n #groupBreakpointLocationsById(breakpointLocations: Breakpoints.BreakpointManager.BreakpointLocation[]):\n Breakpoints.BreakpointManager.BreakpointLocation[][] {\n const map = new Platform.MapUtilities.Multimap();\n for (const breakpointLocation of breakpointLocations) {\n const uiLocation = breakpointLocation.uiLocation;\n map.set(uiLocation.id(), breakpointLocation);\n }\n const arr: Breakpoints.BreakpointManager.BreakpointLocation[][] = [];\n for (const id of map.keysArray()) {\n const locations = Array.from(map.get(id));\n if (locations.length) {\n arr.push(locations);\n }\n }\n return arr;\n }\n\n #getLocationIdsByLineId(breakpointLocations: Breakpoints.BreakpointManager.BreakpointLocation[]):\n Platform.MapUtilities.Multimap {\n const result = new Platform.MapUtilities.Multimap();\n\n for (const breakpointLocation of breakpointLocations) {\n const uiLocation = breakpointLocation.uiLocation;\n result.set(uiLocation.lineId(), uiLocation.id());\n }\n\n return result;\n }\n\n #getBreakpointState(locations: Breakpoints.BreakpointManager.BreakpointLocation[]): BreakpointStatus {\n const hasEnabled = locations.some(location => location.breakpoint.enabled());\n const hasDisabled = locations.some(location => !location.breakpoint.enabled());\n let status: BreakpointStatus;\n if (hasEnabled) {\n status = hasDisabled ? BreakpointStatus.INDETERMINATE : BreakpointStatus.ENABLED;\n } else {\n status = BreakpointStatus.DISABLED;\n }\n return status;\n }\n\n #getContent(locations: Breakpoints.BreakpointManager.BreakpointLocation[][]):\n Promise {\n return Promise.all(locations.map(async ([{uiLocation: {uiSourceCode}}]) => {\n const contentData = await uiSourceCode.requestContentData({cachedWasmOnly: true});\n return TextUtils.ContentData.ContentData.contentDataOrEmpty(contentData);\n }));\n }\n}\n\nexport class BreakpointsView extends LegacyWrapper.LegacyWrapper.WrappableComponent {\n readonly #controller: BreakpointsSidebarController;\n\n static instance({forceNew}: {forceNew: boolean} = {forceNew: false}): BreakpointsView {\n if (!breakpointsViewInstance || forceNew) {\n breakpointsViewInstance = LegacyWrapper.LegacyWrapper.legacyWrapper(UI.Widget.Widget, new BreakpointsView());\n }\n return breakpointsViewInstance.getComponent();\n }\n\n constructor() {\n super();\n this.#controller = BreakpointsSidebarController.instance();\n this.setAttribute('jslog', `${VisualLogging.section('sources.js-breakpoints')}`);\n void this.#controller.update();\n }\n\n readonly #shadow = this.attachShadow({mode: 'open'});\n\n #pauseOnUncaughtExceptions: boolean = false;\n #pauseOnCaughtExceptions: boolean = false;\n\n // TODO(crbug.com/1382762): Remove special casing with dependent toggles as soon as Node LTS caught up on independent pause of exception toggles.\n #independentPauseToggles: boolean = false;\n\n #breakpointsActive: boolean = true;\n #breakpointGroups: BreakpointGroup[] = [];\n #urlToDifferentiatingPath: Map = new Map();\n\n set data(data: BreakpointsViewData) {\n this.#pauseOnUncaughtExceptions = data.pauseOnUncaughtExceptions;\n this.#pauseOnCaughtExceptions = data.pauseOnCaughtExceptions;\n this.#independentPauseToggles = data.independentPauseToggles;\n this.#breakpointsActive = data.breakpointsActive;\n this.#breakpointGroups = data.groups;\n\n const titleInfos: TitleInfo[] = [];\n for (const group of data.groups) {\n titleInfos.push({name: group.name, url: group.url});\n }\n this.#urlToDifferentiatingPath = getDifferentiatingPathMap(titleInfos);\n\n void this.render();\n }\n\n connectedCallback(): void {\n this.#shadow.adoptedStyleSheets = [Input.checkboxStyles, breakpointsViewStyles];\n }\n\n override async render(): Promise {\n await coordinator.write('BreakpointsView render', () => {\n const clickHandler = async(event: Event): Promise => {\n const currentTarget = event.currentTarget as HTMLElement;\n await this.#setSelected(currentTarget);\n event.consume();\n };\n\n const pauseOnCaughtIsChecked =\n (this.#independentPauseToggles || this.#pauseOnUncaughtExceptions) && this.#pauseOnCaughtExceptions;\n const pauseOnCaughtExceptionIsDisabled = !this.#independentPauseToggles && !this.#pauseOnUncaughtExceptions;\n // clang-format off\n const out = html`\n \n \n
\n ${repeat(\n this.#breakpointGroups,\n group => group.url,\n (group, groupIndex) => html`${this.#renderBreakpointGroup(group, groupIndex)}`)}\n
`;\n // clang-format on\n LitHtml.render(out, this.#shadow, {host: this});\n });\n\n // If no element is tabbable, set the pause-on-exceptions to be tabbable. This can happen\n // if the previously focused element was removed.\n await coordinator.write('BreakpointsView make pause-on-exceptions focusable', () => {\n if (this.#shadow.querySelector('[tabindex=\"0\"]') === null) {\n const element = this.#shadow.querySelector('[data-first-pause]');\n element?.setAttribute('tabindex', '0');\n }\n });\n }\n\n async #keyDownHandler(event: KeyboardEvent): Promise {\n if (!event.target || !(event.target instanceof HTMLElement)) {\n return;\n }\n\n if (event.key === 'Home' || event.key === 'End') {\n event.consume(true);\n return this.#handleHomeOrEndKey(event.key);\n }\n if (Platform.KeyboardUtilities.keyIsArrowKey(event.key)) {\n event.consume(true);\n return this.#handleArrowKey(event.key, event.target);\n }\n if (Platform.KeyboardUtilities.isEnterOrSpaceKey(event)) {\n const currentTarget = event.currentTarget as HTMLElement;\n await this.#setSelected(currentTarget);\n const input = currentTarget.querySelector('input');\n if (input) {\n input.click();\n }\n event.consume();\n }\n return;\n }\n\n async #setSelected(element: HTMLElement|null): Promise {\n if (!element) {\n return;\n }\n void coordinator.write('BreakpointsView focus on selected element', () => {\n const prevSelected = this.#shadow.querySelector('[tabindex=\"0\"]');\n prevSelected?.setAttribute('tabindex', '-1');\n element.setAttribute('tabindex', '0');\n element.focus();\n });\n }\n\n async #handleArrowKey(key: Platform.KeyboardUtilities.ArrowKey, target: HTMLElement): Promise {\n const setGroupExpandedState = (detailsElement: HTMLDetailsElement, expanded: boolean): Promise => {\n if (expanded) {\n return coordinator.write('BreakpointsView expand', () => {\n detailsElement.setAttribute('open', '');\n });\n }\n return coordinator.write('BreakpointsView expand', () => {\n detailsElement.removeAttribute('open');\n });\n };\n const nextNode = await findNextNodeForKeyboardNavigation(target, key, setGroupExpandedState);\n return this.#setSelected(nextNode);\n }\n\n async #handleHomeOrEndKey(key: 'Home'|'End'): Promise {\n if (key === 'Home') {\n const pauseOnExceptionsNode = this.#shadow.querySelector('[data-first-pause]');\n return this.#setSelected(pauseOnExceptionsNode);\n }\n if (key === 'End') {\n const numGroups = this.#breakpointGroups.length;\n if (numGroups === 0) {\n const lastPauseOnExceptionsNode = this.#shadow.querySelector('[data-last-pause]');\n return this.#setSelected(lastPauseOnExceptionsNode);\n }\n const lastGroupIndex = numGroups - 1;\n const lastGroup = this.#breakpointGroups[lastGroupIndex];\n\n if (lastGroup.expanded) {\n const lastBreakpointItem =\n this.#shadow.querySelector('[data-last-group] > [data-last-breakpoint]');\n return this.#setSelected(lastBreakpointItem);\n }\n const lastGroupSummaryElement = this.#shadow.querySelector('[data-last-group] > summary');\n return this.#setSelected(lastGroupSummaryElement);\n }\n return;\n }\n\n #renderEditBreakpointButton(breakpointItem: BreakpointItem): LitHtml.TemplateResult {\n const clickHandler = (event: Event): void => {\n void this.#controller.breakpointEdited(breakpointItem, true /* editButtonClicked */);\n event.consume();\n };\n const title = breakpointItem.type === SDK.DebuggerModel.BreakpointType.LOGPOINT ?\n i18nString(UIStrings.editLogpoint) :\n i18nString(UIStrings.editCondition);\n // clang-format off\n return html`\n \n `;\n // clang-format on\n }\n\n #renderRemoveBreakpointButton(\n breakpointItems: BreakpointItem[], tooltipText: string, action: Host.UserMetrics.Action): LitHtml.TemplateResult {\n const clickHandler = (event: Event): void => {\n Host.userMetrics.actionTaken(action);\n void this.#controller.breakpointsRemoved(breakpointItems);\n event.consume();\n };\n // clang-format off\n return html`\n \n `;\n // clang-format on\n }\n\n #onBreakpointGroupContextMenu(event: Event, breakpointGroup: BreakpointGroup): void {\n const {breakpointItems} = breakpointGroup;\n const menu = new UI.ContextMenu.ContextMenu(event);\n\n menu.defaultSection().appendItem(i18nString(UIStrings.removeAllBreakpointsInFile), () => {\n Host.userMetrics.actionTaken(Host.UserMetrics.Action.BreakpointsInFileRemovedFromContextMenu);\n void this.#controller.breakpointsRemoved(breakpointItems);\n }, {jslogContext: 'remove-file-breakpoints'});\n const otherGroups = this.#breakpointGroups.filter(group => group !== breakpointGroup);\n menu.defaultSection().appendItem(i18nString(UIStrings.removeOtherBreakpoints), () => {\n const breakpointItems = otherGroups.map(({breakpointItems}) => breakpointItems).flat();\n void this.#controller.breakpointsRemoved(breakpointItems);\n }, {disabled: otherGroups.length === 0, jslogContext: 'remove-other-breakpoints'});\n menu.defaultSection().appendItem(i18nString(UIStrings.removeAllBreakpoints), () => {\n const breakpointItems = this.#breakpointGroups.map(({breakpointItems}) => breakpointItems).flat();\n void this.#controller.breakpointsRemoved(breakpointItems);\n }, {jslogContext: 'remove-all-breakpoints'});\n\n const notEnabledItems =\n breakpointItems.filter(breakpointItem => breakpointItem.status !== BreakpointStatus.ENABLED);\n menu.debugSection().appendItem(i18nString(UIStrings.enableAllBreakpointsInFile), () => {\n Host.userMetrics.actionTaken(Host.UserMetrics.Action.BreakpointsInFileEnabledDisabledFromContextMenu);\n for (const breakpointItem of notEnabledItems) {\n this.#controller.breakpointStateChanged(breakpointItem, true);\n }\n }, {disabled: notEnabledItems.length === 0, jslogContext: 'enable-file-breakpoints'});\n const notDisabledItems =\n breakpointItems.filter(breakpointItem => breakpointItem.status !== BreakpointStatus.DISABLED);\n menu.debugSection().appendItem(i18nString(UIStrings.disableAllBreakpointsInFile), () => {\n Host.userMetrics.actionTaken(Host.UserMetrics.Action.BreakpointsInFileEnabledDisabledFromContextMenu);\n for (const breakpointItem of notDisabledItems) {\n this.#controller.breakpointStateChanged(breakpointItem, false);\n }\n }, {disabled: notDisabledItems.length === 0, jslogContext: 'disable-file-breakpoints'});\n\n void menu.show();\n }\n\n #renderBreakpointGroup(group: BreakpointGroup, groupIndex: number): LitHtml.TemplateResult {\n const contextmenuHandler = (event: Event): void => {\n this.#onBreakpointGroupContextMenu(event, group);\n event.consume();\n };\n const toggleHandler = (event: Event): void => {\n const htmlDetails = event.target as HTMLDetailsElement;\n group.expanded = htmlDetails.open;\n void this.#controller.expandedStateChanged(group.url, group.expanded);\n };\n const clickHandler = async(event: Event): Promise => {\n const selected = event.currentTarget as HTMLElement;\n await this.#setSelected(selected);\n // Record the metric for expanding/collapsing in the click handler,\n // as we only then get the number of expand/collapse actions that were\n // initiated by the user.\n Host.userMetrics.actionTaken(Host.UserMetrics.Action.BreakpointGroupExpandedStateChanged);\n event.consume();\n };\n // clang-format off\n return html`\n
\n \n \n \n ${this.#renderRemoveBreakpointButton(group.breakpointItems, i18nString(UIStrings.removeAllBreakpointsInFile), Host.UserMetrics.Action.BreakpointsInFileRemovedFromRemoveButton)}\n \n \n ${repeat(\n group.breakpointItems,\n item => item.id,\n (item, breakpointItemIndex) => this.#renderBreakpointEntry(item, group.editable, groupIndex, breakpointItemIndex))}\n
\n `;\n // clang-format on\n }\n\n #renderGroupCheckbox(group: BreakpointGroup): LitHtml.TemplateResult {\n const groupCheckboxToggled = (e: Event): void => {\n Host.userMetrics.actionTaken(Host.UserMetrics.Action.BreakpointsInFileCheckboxToggled);\n const element = e.target as HTMLInputElement;\n const updatedStatus = element.checked ? BreakpointStatus.ENABLED : BreakpointStatus.DISABLED;\n const itemsToUpdate = group.breakpointItems.filter(item => item.status !== updatedStatus);\n itemsToUpdate.forEach(item => {\n this.#controller.breakpointStateChanged(item, element.checked);\n });\n e.consume();\n };\n\n const checked = group.breakpointItems.some(item => item.status === BreakpointStatus.ENABLED);\n return html`\n \n `;\n }\n\n #renderFileIcon(): LitHtml.TemplateResult {\n return html``;\n }\n\n #onBreakpointEntryContextMenu(event: Event, breakpointItem: BreakpointItem, editable: boolean): void {\n const items = this.#breakpointGroups.map(({breakpointItems}) => breakpointItems).flat();\n const otherItems = items.filter(item => item !== breakpointItem);\n\n const menu = new UI.ContextMenu.ContextMenu(event);\n const editBreakpointText = breakpointItem.type === SDK.DebuggerModel.BreakpointType.LOGPOINT ?\n i18nString(UIStrings.editLogpoint) :\n i18nString(UIStrings.editCondition);\n menu.revealSection().appendItem(i18nString(UIStrings.revealLocation), () => {\n void this.#controller.jumpToSource(breakpointItem);\n }, {jslogContext: 'jump-to-breakpoint'});\n\n menu.editSection().appendItem(editBreakpointText, () => {\n void this.#controller.breakpointEdited(breakpointItem, false /* editButtonClicked */);\n }, {disabled: !editable, jslogContext: 'edit-breakpoint'});\n\n menu.defaultSection().appendItem(\n i18nString(UIStrings.enableAllBreakpoints),\n items.forEach.bind(items, item => this.#controller.breakpointStateChanged(item, true)), {\n disabled: items.every(item => item.status === BreakpointStatus.ENABLED),\n jslogContext: 'enable-all-breakpoints',\n });\n menu.defaultSection().appendItem(\n i18nString(UIStrings.disableAllBreakpoints),\n items.forEach.bind(items, item => this.#controller.breakpointStateChanged(item, false)), {\n disabled: items.every(item => item.status === BreakpointStatus.DISABLED),\n jslogContext: 'disable-all-breakpoints',\n });\n\n menu.footerSection().appendItem(i18nString(UIStrings.removeBreakpoint), () => {\n Host.userMetrics.actionTaken(Host.UserMetrics.Action.BreakpointRemovedFromContextMenu);\n void this.#controller.breakpointsRemoved([breakpointItem]);\n }, {jslogContext: 'remove-breakpoint'});\n menu.footerSection().appendItem(i18nString(UIStrings.removeOtherBreakpoints), () => {\n void this.#controller.breakpointsRemoved(otherItems);\n }, {disabled: otherItems.length === 0, jslogContext: 'remove-other-breakpoints'});\n menu.footerSection().appendItem(i18nString(UIStrings.removeAllBreakpoints), () => {\n const breakpointItems = this.#breakpointGroups.map(({breakpointItems}) => breakpointItems).flat();\n void this.#controller.breakpointsRemoved(breakpointItems);\n }, {jslogContext: 'remove-all-breakpoints'});\n\n void menu.show();\n }\n\n #renderBreakpointEntry(\n breakpointItem: BreakpointItem, editable: boolean, groupIndex: number,\n breakpointItemIndex: number): LitHtml.TemplateResult {\n const codeSnippetClickHandler = (event: Event): void => {\n void this.#controller.jumpToSource(breakpointItem);\n event.consume();\n };\n const breakpointItemClickHandler = async(event: Event): Promise => {\n const target = event.currentTarget as HTMLDivElement;\n await this.#setSelected(target);\n event.consume();\n };\n const contextmenuHandler = (event: Event): void => {\n this.#onBreakpointEntryContextMenu(event, breakpointItem, editable);\n event.consume();\n };\n const breakpointItemDescription = this.#getBreakpointItemDescription(breakpointItem);\n const codeSnippet = Platform.StringUtilities.trimEndWithMaxLength(breakpointItem.codeSnippet, MAX_SNIPPET_LENGTH);\n const codeSnippetTooltip = this.#getCodeSnippetTooltip(breakpointItem.type, breakpointItem.hoverText);\n const itemsInGroup = this.#breakpointGroups[groupIndex].breakpointItems;\n\n // clang-format off\n return html`\n
\n \n ${codeSnippet}\n \n ${editable ? this.#renderEditBreakpointButton(breakpointItem) : LitHtml.nothing}\n ${this.#renderRemoveBreakpointButton([breakpointItem], i18nString(UIStrings.removeBreakpoint), Host.UserMetrics.Action.BreakpointRemovedFromRemoveButton)}\n ${breakpointItem.location}\n \n
\n `;\n // clang-format on\n }\n\n #getCodeSnippetTooltip(type: SDK.DebuggerModel.BreakpointType, hoverText?: string): string|undefined {\n switch (type) {\n case SDK.DebuggerModel.BreakpointType.REGULAR_BREAKPOINT:\n return undefined;\n case SDK.DebuggerModel.BreakpointType.CONDITIONAL_BREAKPOINT:\n assertNotNullOrUndefined(hoverText);\n return i18nString(UIStrings.conditionCode, {PH1: hoverText});\n case SDK.DebuggerModel.BreakpointType.LOGPOINT:\n assertNotNullOrUndefined(hoverText);\n return i18nString(UIStrings.logpointCode, {PH1: hoverText});\n }\n }\n\n #getBreakpointItemDescription(breakpointItem: BreakpointItem): Platform.UIString.LocalizedString {\n let checkboxDescription;\n switch (breakpointItem.status) {\n case BreakpointStatus.ENABLED:\n checkboxDescription = i18nString(UIStrings.checked);\n break;\n case BreakpointStatus.DISABLED:\n checkboxDescription = i18nString(UIStrings.unchecked);\n break;\n case BreakpointStatus.INDETERMINATE:\n checkboxDescription = i18nString(UIStrings.indeterminate);\n break;\n }\n if (!breakpointItem.isHit) {\n return checkboxDescription;\n }\n return i18nString(UIStrings.breakpointHit, {PH1: checkboxDescription});\n }\n\n #onCheckboxToggled(e: Event, item: BreakpointItem): void {\n const element = e.target as HTMLInputElement;\n this.#controller.breakpointStateChanged(item, element.checked);\n }\n\n #onPauseOnCaughtExceptionsStateChanged(e: Event): void {\n const {checked} = e.target as HTMLInputElement;\n this.#controller.setPauseOnCaughtExceptions(checked);\n }\n\n #onPauseOnUncaughtExceptionsStateChanged(e: Event): void {\n const {checked} = e.target as HTMLInputElement;\n if (!this.#independentPauseToggles) {\n const pauseOnCaughtCheckbox = this.#shadow.querySelector('[data-pause-on-caught-checkbox]');\n assertNotNullOrUndefined(pauseOnCaughtCheckbox);\n if (!checked && pauseOnCaughtCheckbox.checked) {\n // If we can only pause on caught exceptions if we pause on uncaught exceptions, make sure to\n // uncheck the pause on caught exception checkbox.\n pauseOnCaughtCheckbox.click();\n }\n\n void coordinator.write('BreakpointsView update pause-on-uncaught-exception', () => {\n // Disable/enable the pause on caught exception checkbox depending on whether\n // or not we are pausing on uncaught exceptions.\n if (checked) {\n pauseOnCaughtCheckbox.disabled = false;\n } else {\n pauseOnCaughtCheckbox.disabled = true;\n }\n });\n }\n this.#controller.setPauseOnUncaughtExceptions(checked);\n }\n}\n\ncustomElements.define('devtools-breakpoint-view', BreakpointsView);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'devtools-breakpoint-view': BreakpointsView;\n }\n}\n"]} \ No newline at end of file +{"version":3,"file":"BreakpointsView.js","sourceRoot":"","sources":["../../../../../../../front_end/panels/sources/components/BreakpointsView.ts"],"names":[],"mappings":"AAAA,gEAAgE;AAChE,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,mDAAmD,CAAC;AAE3D,OAAO,KAAK,MAAM,MAAM,gCAAgC,CAAC;AACzD,OAAO,KAAK,IAAI,MAAM,4BAA4B,CAAC;AACnD,OAAO,KAAK,IAAI,MAAM,4BAA4B,CAAC;AACnD,OAAO,KAAK,QAAQ,MAAM,oCAAoC,CAAC;AAC/D,OAAO,EAAC,wBAAwB,EAAC,MAAM,oCAAoC,CAAC;AAC5E,OAAO,KAAK,GAAG,MAAM,0BAA0B,CAAC;AA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AAa,CAAmB,iCAAiC,CAAC,CAAC;YAC9G,wBAAwB,CAAC,qBAAqB,CAAC,CAAC;YAChD,IAAI,CAAC,OAAO,IAAI,qBAAqB,CAAC,OAAO,EAAE,CAAC;gBAC9C,6FAA6F;gBAC7F,kDAAkD;gBAClD,qBAAqB,CAAC,KAAK,EAAE,CAAC;YAChC,CAAC;YAED,KAAK,iBAAiB,CAAC,KAAK,CAAC,oDAAoD,EAAE,GAAG,EAAE;gBACtF,6EAA6E;gBAC7E,gDAAgD;gBAChD,IAAI,OAAO,EAAE,CAAC;oBACZ,qBAAqB,CAAC,QAAQ,GAAG,KAAK,CAAC;gBACzC,CAAC;qBAAM,CAAC;oBACN,qBAAqB,CAAC,QAAQ,GAAG,IAAI,CAAC;gBACxC,CAAC;YACH,CAAC,CAAC,CAAC;QACL,CAAC;QACD,IAAI,CAAC,WAAW,CAAC,4BAA4B,CAAC,OAAO,CAAC,CAAC;IACzD,CAAC;CACF;AAED,cAAc,CAAC,MAAM,CAAC,0BAA0B,EAAE,eAAe,CAAC,CAAC","sourcesContent":["// Copyright (c) 2022 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport '../../../ui/components/icon_button/icon_button.js';\n\nimport * as Common from '../../../core/common/common.js';\nimport * as Host from '../../../core/host/host.js';\nimport * as i18n from '../../../core/i18n/i18n.js';\nimport * as Platform from '../../../core/platform/platform.js';\nimport {assertNotNullOrUndefined} from '../../../core/platform/platform.js';\nimport * as SDK from '../../../core/sdk/sdk.js';\nimport * as Bindings from '../../../models/bindings/bindings.js';\nimport * as Breakpoints from '../../../models/breakpoints/breakpoints.js';\nimport * as TextUtils from '../../../models/text_utils/text_utils.js';\nimport * as Workspace from '../../../models/workspace/workspace.js';\nimport * as Input from '../../../ui/components/input/input.js';\nimport * as LegacyWrapper from '../../../ui/components/legacy_wrapper/legacy_wrapper.js';\nimport * as RenderCoordinator from '../../../ui/components/render_coordinator/render_coordinator.js';\nimport * as UI from '../../../ui/legacy/legacy.js';\nimport * as LitHtml from '../../../ui/lit-html/lit-html.js';\nimport * as VisualLogging from '../../../ui/visual_logging/visual_logging.js';\n\nimport breakpointsViewStyles from './breakpointsView.css.js';\nimport {findNextNodeForKeyboardNavigation, getDifferentiatingPathMap, type TitleInfo} from './BreakpointsViewUtils.js';\n\nconst {html, Directives: {ifDefined, repeat, classMap, live}} = LitHtml;\n\nconst UIStrings = {\n /**\n *@description Label for a checkbox to toggle pausing on uncaught exceptions in the breakpoint sidebar of the Sources panel. When the checkbox is checked, DevTools will pause if an uncaught exception is thrown at runtime.\n */\n pauseOnUncaughtExceptions: 'Pause on uncaught exceptions',\n /**\n *@description Label for a checkbox to toggling pausing on caught exceptions in the breakpoint sidebar of the Sources panel. When the checkbox is checked, DevTools will pause if an exception is thrown, but caught (handled) at runtime.\n */\n pauseOnCaughtExceptions: 'Pause on caught exceptions',\n /**\n *@description Text exposed to screen readers on checked items.\n */\n checked: 'checked',\n /**\n *@description Accessible text exposed to screen readers when the screen reader encounters an unchecked checkbox.\n */\n unchecked: 'unchecked',\n /**\n *@description Accessible text for a breakpoint collection with a combination of checked states.\n */\n indeterminate: 'mixed',\n /**\n *@description Accessibility label for hit breakpoints in the Sources panel.\n *@example {checked} PH1\n */\n breakpointHit: '{PH1} breakpoint hit',\n /**\n *@description Tooltip text that shows when hovered over a remove button that appears next to a filename in the breakpoint sidebar of the sources panel. Also used in the context menu for breakpoint groups.\n */\n removeAllBreakpointsInFile: 'Remove all breakpoints in file',\n /**\n *@description Context menu item in the Breakpoints Sidebar Pane of the Sources panel that disables all breakpoints in a file.\n */\n disableAllBreakpointsInFile: 'Disable all breakpoints in file',\n /**\n *@description Context menu item in the Breakpoints Sidebar Pane of the Sources panel that enables all breakpoints in a file.\n */\n enableAllBreakpointsInFile: 'Enable all breakpoints in file',\n /**\n *@description Tooltip text that shows when hovered over an edit button that appears next to a breakpoint or conditional breakpoint in the breakpoint sidebar of the sources panel.\n */\n editCondition: 'Edit condition',\n /**\n *@description Tooltip text that shows when hovered over an edit button that appears next to a logpoint in the breakpoint sidebar of the sources panel.\n */\n editLogpoint: 'Edit logpoint',\n /**\n *@description Context menu item in the Breakpoints Sidebar Pane of the Sources panel that disables all breakpoints.\n */\n disableAllBreakpoints: 'Disable all breakpoints',\n /**\n *@description Context menu item in the Breakpoints Sidebar Pane of the Sources panel that enables all breakpoints.\n */\n enableAllBreakpoints: 'Enable all breakpoints',\n /**\n *@description Tooltip text that shows when hovered over a remove button that appears next to a breakpoint in the breakpoint sidebar of the sources panel. Also used in the context menu for breakpoint items.\n */\n removeBreakpoint: 'Remove breakpoint',\n /**\n *@description Text to remove all breakpoints\n */\n removeAllBreakpoints: 'Remove all breakpoints',\n /**\n *@description Text in Breakpoints Sidebar Pane of the Sources panel\n */\n removeOtherBreakpoints: 'Remove other breakpoints',\n /**\n *@description Context menu item that reveals the source code location of a breakpoint in the Sources panel.\n */\n revealLocation: 'Reveal location',\n /**\n *@description Tooltip text that shows when hovered over a piece of code of a breakpoint in the breakpoint sidebar of the sources panel. It shows the condition, on which the breakpoint will stop.\n *@example {x < 3} PH1\n */\n conditionCode: 'Condition: {PH1}',\n /**\n *@description Tooltip text that shows when hovered over a piece of code of a breakpoint in the breakpoint sidebar of the sources panel. It shows what is going to be printed in the console, if execution hits this breakpoint.\n *@example {'hello'} PH1\n */\n logpointCode: 'Logpoint: {PH1}',\n};\nconst str_ = i18n.i18n.registerUIStrings('panels/sources/components/BreakpointsView.ts', UIStrings);\nconst i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);\nconst MAX_SNIPPET_LENGTH = 200;\n\nexport interface BreakpointsViewData {\n breakpointsActive: boolean;\n pauseOnUncaughtExceptions: boolean;\n pauseOnCaughtExceptions: boolean;\n // TODO(crbug.com/1382762): Remove special casing with dependent toggles as soon as Node LTS caught up on independent pause of exception toggles.\n independentPauseToggles: boolean;\n groups: BreakpointGroup[];\n}\n\nexport interface BreakpointGroup {\n name: string;\n url: Platform.DevToolsPath.UrlString;\n editable: boolean;\n expanded: boolean;\n breakpointItems: BreakpointItem[];\n}\n\nexport interface BreakpointItem {\n id: string;\n location: string;\n codeSnippet: string;\n isHit: boolean;\n status: BreakpointStatus;\n type: SDK.DebuggerModel.BreakpointType;\n hoverText?: string;\n}\n\nexport const enum BreakpointStatus {\n ENABLED = 'ENABLED',\n DISABLED = 'DISABLED',\n INDETERMINATE = 'INDETERMINATE',\n}\n\nlet breakpointsViewInstance: LegacyWrapper.LegacyWrapper.LegacyWrapper|null;\nlet breakpointsViewControllerInstance: BreakpointsSidebarController|null;\n\nexport class BreakpointsSidebarController implements UI.ContextFlavorListener.ContextFlavorListener {\n readonly #breakpointManager: Breakpoints.BreakpointManager.BreakpointManager;\n readonly #breakpointItemToLocationMap =\n new WeakMap();\n readonly #breakpointsActiveSetting: Common.Settings.Setting;\n readonly #pauseOnUncaughtExceptionSetting: Common.Settings.Setting;\n readonly #pauseOnCaughtExceptionSetting: Common.Settings.Setting;\n\n readonly #collapsedFilesSettings: Common.Settings.Setting;\n readonly #collapsedFiles: Set;\n\n // This is used to keep track of outstanding edits to breakpoints that were initiated\n // by the breakpoint edit button (for UMA).\n #outstandingBreakpointEdited: Breakpoints.BreakpointManager.Breakpoint|undefined;\n #updateScheduled = false;\n #updateRunning = false;\n\n private constructor(\n breakpointManager: Breakpoints.BreakpointManager.BreakpointManager, settings: Common.Settings.Settings) {\n this.#collapsedFilesSettings = Common.Settings.Settings.instance().createSetting('collapsed-files', []);\n this.#collapsedFiles = new Set(this.#collapsedFilesSettings.get());\n this.#breakpointManager = breakpointManager;\n this.#breakpointManager.addEventListener(\n Breakpoints.BreakpointManager.Events.BreakpointAdded, this.#onBreakpointAdded, this);\n this.#breakpointManager.addEventListener(\n Breakpoints.BreakpointManager.Events.BreakpointRemoved, this.#onBreakpointRemoved, this);\n this.#breakpointsActiveSetting = settings.moduleSetting('breakpoints-active');\n this.#breakpointsActiveSetting.addChangeListener(this.update, this);\n this.#pauseOnUncaughtExceptionSetting = settings.moduleSetting('pause-on-uncaught-exception');\n this.#pauseOnUncaughtExceptionSetting.addChangeListener(this.update, this);\n this.#pauseOnCaughtExceptionSetting = settings.moduleSetting('pause-on-caught-exception');\n this.#pauseOnCaughtExceptionSetting.addChangeListener(this.update, this);\n }\n\n static instance({forceNew, breakpointManager, settings}: {\n forceNew: boolean|null,\n breakpointManager: Breakpoints.BreakpointManager.BreakpointManager,\n settings: Common.Settings.Settings,\n } = {\n forceNew: null,\n breakpointManager: Breakpoints.BreakpointManager.BreakpointManager.instance(),\n settings: Common.Settings.Settings.instance(),\n }): BreakpointsSidebarController {\n if (!breakpointsViewControllerInstance || forceNew) {\n breakpointsViewControllerInstance = new BreakpointsSidebarController(breakpointManager, settings);\n }\n return breakpointsViewControllerInstance;\n }\n\n static removeInstance(): void {\n breakpointsViewControllerInstance = null;\n }\n\n static targetSupportsIndependentPauseOnExceptionToggles(): boolean {\n const hasNodeTargets =\n SDK.TargetManager.TargetManager.instance().targets().some(target => target.type() === SDK.Target.Type.NODE);\n return !hasNodeTargets;\n }\n\n flavorChanged(_object: Object|null): void {\n void this.update();\n }\n\n breakpointEditFinished(breakpoint: Breakpoints.BreakpointManager.Breakpoint|null, edited: boolean): void {\n if (this.#outstandingBreakpointEdited && this.#outstandingBreakpointEdited === breakpoint) {\n if (edited) {\n Host.userMetrics.actionTaken(Host.UserMetrics.Action.BreakpointConditionEditedFromSidebar);\n }\n this.#outstandingBreakpointEdited = undefined;\n }\n }\n\n breakpointStateChanged(breakpointItem: BreakpointItem, checked: boolean): void {\n const locations = this.#getLocationsForBreakpointItem(breakpointItem);\n locations.forEach((value: Breakpoints.BreakpointManager.BreakpointLocation) => {\n const breakpoint = value.breakpoint;\n breakpoint.setEnabled(checked);\n });\n }\n\n async breakpointEdited(breakpointItem: BreakpointItem, editButtonClicked: boolean): Promise {\n const locations = this.#getLocationsForBreakpointItem(breakpointItem);\n let location: Breakpoints.BreakpointManager.BreakpointLocation|undefined;\n for (const locationCandidate of locations) {\n if (!location || locationCandidate.uiLocation.compareTo(location.uiLocation) < 0) {\n location = locationCandidate;\n }\n }\n if (location) {\n if (editButtonClicked) {\n this.#outstandingBreakpointEdited = location.breakpoint;\n }\n await Common.Revealer.reveal(location);\n }\n }\n\n breakpointsRemoved(breakpointItems: BreakpointItem[]): void {\n const locations = breakpointItems.flatMap(breakpointItem => this.#getLocationsForBreakpointItem(breakpointItem));\n locations.forEach(location => location?.breakpoint.remove(false /* keepInStorage */));\n }\n\n expandedStateChanged(url: Platform.DevToolsPath.UrlString, expanded: boolean): void {\n if (expanded) {\n this.#collapsedFiles.delete(url);\n } else {\n this.#collapsedFiles.add(url);\n }\n\n this.#saveSettings();\n }\n\n async jumpToSource(breakpointItem: BreakpointItem): Promise {\n const uiLocations = this.#getLocationsForBreakpointItem(breakpointItem).map(location => location.uiLocation);\n let uiLocation: Workspace.UISourceCode.UILocation|undefined;\n for (const uiLocationCandidate of uiLocations) {\n if (!uiLocation || uiLocationCandidate.compareTo(uiLocation) < 0) {\n uiLocation = uiLocationCandidate;\n }\n }\n if (uiLocation) {\n await Common.Revealer.reveal(uiLocation);\n }\n }\n\n setPauseOnUncaughtExceptions(value: boolean): void {\n this.#pauseOnUncaughtExceptionSetting.set(value);\n }\n\n setPauseOnCaughtExceptions(value: boolean): void {\n this.#pauseOnCaughtExceptionSetting.set(value);\n }\n\n async update(): Promise {\n this.#updateScheduled = true;\n if (this.#updateRunning) {\n return;\n }\n this.#updateRunning = true;\n while (this.#updateScheduled) {\n this.#updateScheduled = false;\n const data = await this.getUpdatedBreakpointViewData();\n BreakpointsView.instance().data = data;\n }\n this.#updateRunning = false;\n }\n\n async getUpdatedBreakpointViewData(): Promise {\n const breakpointsActive = this.#breakpointsActiveSetting.get();\n const independentPauseToggles = BreakpointsSidebarController.targetSupportsIndependentPauseOnExceptionToggles();\n const pauseOnUncaughtExceptions = this.#pauseOnUncaughtExceptionSetting.get();\n const pauseOnCaughtExceptions = this.#pauseOnCaughtExceptionSetting.get();\n\n const breakpointLocations = this.#getBreakpointLocations();\n if (!breakpointLocations.length) {\n return {\n breakpointsActive,\n pauseOnCaughtExceptions,\n pauseOnUncaughtExceptions,\n independentPauseToggles,\n groups: [],\n };\n }\n\n const locationsGroupedById = this.#groupBreakpointLocationsById(breakpointLocations);\n const locationIdsByLineId = this.#getLocationIdsByLineId(breakpointLocations);\n\n const [content, selectedUILocation] = await Promise.all([\n this.#getContent(locationsGroupedById),\n this.#getHitUILocation(),\n ]);\n\n const scriptIdToGroup = new Map();\n\n for (let idx = 0; idx < locationsGroupedById.length; idx++) {\n const locations = locationsGroupedById[idx];\n const fstLocation = locations[0];\n const sourceURL = fstLocation.uiLocation.uiSourceCode.url();\n const scriptId = fstLocation.uiLocation.uiSourceCode.canononicalScriptId();\n const uiLocation = fstLocation.uiLocation;\n\n const isHit = selectedUILocation !== null &&\n locations.some(location => location.uiLocation.id() === selectedUILocation.id());\n\n const numBreakpointsOnLine = locationIdsByLineId.get(uiLocation.lineId()).size;\n const showColumn = numBreakpointsOnLine > 1;\n const locationText = uiLocation.lineAndColumnText(showColumn) as string;\n\n const contentData = content[idx];\n const codeSnippet = contentData instanceof TextUtils.WasmDisassembly.WasmDisassembly ?\n contentData.lines[contentData.bytecodeOffsetToLineNumber(uiLocation.columnNumber ?? 0)] ?? '' :\n contentData.textObj.lineAt(uiLocation.lineNumber);\n\n if (isHit && this.#collapsedFiles.has(sourceURL)) {\n this.#collapsedFiles.delete(sourceURL);\n this.#saveSettings();\n }\n const expanded = !this.#collapsedFiles.has(sourceURL);\n\n const status: BreakpointStatus = this.#getBreakpointState(locations);\n const {type, hoverText} = this.#getBreakpointTypeAndDetails(locations);\n const item = {\n id: fstLocation.breakpoint.breakpointStorageId(),\n location: locationText,\n codeSnippet,\n isHit,\n status,\n type,\n hoverText,\n };\n this.#breakpointItemToLocationMap.set(item, locations);\n\n let group = scriptIdToGroup.get(scriptId);\n if (group) {\n group.breakpointItems.push(item);\n group.expanded ||= expanded;\n } else {\n const editable = this.#breakpointManager.supportsConditionalBreakpoints(uiLocation.uiSourceCode);\n group = {\n url: sourceURL,\n name: uiLocation.uiSourceCode.displayName(),\n editable,\n expanded,\n breakpointItems: [item],\n };\n scriptIdToGroup.set(scriptId, group);\n }\n }\n return {\n breakpointsActive,\n pauseOnCaughtExceptions,\n pauseOnUncaughtExceptions,\n independentPauseToggles,\n groups: Array.from(scriptIdToGroup.values()),\n };\n }\n\n #onBreakpointAdded(event: Common.EventTarget.EventTargetEvent):\n Promise {\n const breakpoint = event.data.breakpoint;\n if (breakpoint.origin === Breakpoints.BreakpointManager.BreakpointOrigin.USER_ACTION &&\n this.#collapsedFiles.has(breakpoint.url())) {\n // Auto-expand if a new breakpoint was added to a collapsed group.\n this.#collapsedFiles.delete(breakpoint.url());\n this.#saveSettings();\n }\n return this.update();\n }\n\n #onBreakpointRemoved(event: Common.EventTarget.EventTargetEvent):\n Promise {\n const breakpoint = event.data.breakpoint;\n if (this.#collapsedFiles.has(breakpoint.url())) {\n const locations = Breakpoints.BreakpointManager.BreakpointManager.instance().allBreakpointLocations();\n const otherBreakpointsOnSameFileExist =\n locations.some(location => location.breakpoint.url() === breakpoint.url());\n if (!otherBreakpointsOnSameFileExist) {\n // Clear up the #collapsedFiles set from this url if no breakpoint is left in this group.\n this.#collapsedFiles.delete(breakpoint.url());\n this.#saveSettings();\n }\n }\n return this.update();\n }\n\n #saveSettings(): void {\n this.#collapsedFilesSettings.set(Array.from(this.#collapsedFiles.values()));\n }\n\n #getBreakpointTypeAndDetails(locations: Breakpoints.BreakpointManager.BreakpointLocation[]):\n {type: SDK.DebuggerModel.BreakpointType, hoverText?: string} {\n const breakpointWithCondition = locations.find(location => Boolean(location.breakpoint.condition()));\n const breakpoint = breakpointWithCondition?.breakpoint;\n if (!breakpoint || !breakpoint.condition()) {\n return {type: SDK.DebuggerModel.BreakpointType.REGULAR_BREAKPOINT};\n }\n\n const condition = breakpoint.condition();\n if (breakpoint.isLogpoint()) {\n return {type: SDK.DebuggerModel.BreakpointType.LOGPOINT, hoverText: condition};\n }\n\n return {type: SDK.DebuggerModel.BreakpointType.CONDITIONAL_BREAKPOINT, hoverText: condition};\n }\n\n #getLocationsForBreakpointItem(breakpointItem: BreakpointItem): Breakpoints.BreakpointManager.BreakpointLocation[] {\n const locations = this.#breakpointItemToLocationMap.get(breakpointItem);\n assertNotNullOrUndefined(locations);\n return locations;\n }\n\n async #getHitUILocation(): Promise {\n const details = UI.Context.Context.instance().flavor(SDK.DebuggerModel.DebuggerPausedDetails);\n if (details && details.callFrames.length) {\n return await Bindings.DebuggerWorkspaceBinding.DebuggerWorkspaceBinding.instance().rawLocationToUILocation(\n details.callFrames[0].location());\n }\n return null;\n }\n\n #getBreakpointLocations(): Breakpoints.BreakpointManager.BreakpointLocation[] {\n const locations = this.#breakpointManager.allBreakpointLocations().filter(\n breakpointLocation =>\n breakpointLocation.uiLocation.uiSourceCode.project().type() !== Workspace.Workspace.projectTypes.Debugger);\n\n locations.sort((item1, item2) => item1.uiLocation.compareTo(item2.uiLocation));\n\n const result = [];\n let lastBreakpoint: Breakpoints.BreakpointManager.Breakpoint|null = null;\n let lastLocation: Workspace.UISourceCode.UILocation|null = null;\n for (const location of locations) {\n if (location.breakpoint !== lastBreakpoint || (lastLocation && location.uiLocation.compareTo(lastLocation))) {\n result.push(location);\n lastBreakpoint = location.breakpoint;\n lastLocation = location.uiLocation;\n }\n }\n return result;\n }\n\n #groupBreakpointLocationsById(breakpointLocations: Breakpoints.BreakpointManager.BreakpointLocation[]):\n Breakpoints.BreakpointManager.BreakpointLocation[][] {\n const map = new Platform.MapUtilities.Multimap();\n for (const breakpointLocation of breakpointLocations) {\n const uiLocation = breakpointLocation.uiLocation;\n map.set(uiLocation.id(), breakpointLocation);\n }\n const arr: Breakpoints.BreakpointManager.BreakpointLocation[][] = [];\n for (const id of map.keysArray()) {\n const locations = Array.from(map.get(id));\n if (locations.length) {\n arr.push(locations);\n }\n }\n return arr;\n }\n\n #getLocationIdsByLineId(breakpointLocations: Breakpoints.BreakpointManager.BreakpointLocation[]):\n Platform.MapUtilities.Multimap {\n const result = new Platform.MapUtilities.Multimap();\n\n for (const breakpointLocation of breakpointLocations) {\n const uiLocation = breakpointLocation.uiLocation;\n result.set(uiLocation.lineId(), uiLocation.id());\n }\n\n return result;\n }\n\n #getBreakpointState(locations: Breakpoints.BreakpointManager.BreakpointLocation[]): BreakpointStatus {\n const hasEnabled = locations.some(location => location.breakpoint.enabled());\n const hasDisabled = locations.some(location => !location.breakpoint.enabled());\n let status: BreakpointStatus;\n if (hasEnabled) {\n status = hasDisabled ? BreakpointStatus.INDETERMINATE : BreakpointStatus.ENABLED;\n } else {\n status = BreakpointStatus.DISABLED;\n }\n return status;\n }\n\n #getContent(locations: Breakpoints.BreakpointManager.BreakpointLocation[][]):\n Promise {\n return Promise.all(locations.map(async ([{uiLocation: {uiSourceCode}}]) => {\n const contentData = await uiSourceCode.requestContentData({cachedWasmOnly: true});\n return TextUtils.ContentData.ContentData.contentDataOrEmpty(contentData);\n }));\n }\n}\n\nexport class BreakpointsView extends LegacyWrapper.LegacyWrapper.WrappableComponent {\n readonly #controller: BreakpointsSidebarController;\n\n static instance({forceNew}: {forceNew: boolean} = {forceNew: false}): BreakpointsView {\n if (!breakpointsViewInstance || forceNew) {\n breakpointsViewInstance = LegacyWrapper.LegacyWrapper.legacyWrapper(UI.Widget.Widget, new BreakpointsView());\n }\n return breakpointsViewInstance.getComponent();\n }\n\n constructor() {\n super();\n this.#controller = BreakpointsSidebarController.instance();\n this.setAttribute('jslog', `${VisualLogging.section('sources.js-breakpoints')}`);\n void this.#controller.update();\n }\n\n readonly #shadow = this.attachShadow({mode: 'open'});\n\n #pauseOnUncaughtExceptions: boolean = false;\n #pauseOnCaughtExceptions: boolean = false;\n\n // TODO(crbug.com/1382762): Remove special casing with dependent toggles as soon as Node LTS caught up on independent pause of exception toggles.\n #independentPauseToggles: boolean = false;\n\n #breakpointsActive: boolean = true;\n #breakpointGroups: BreakpointGroup[] = [];\n #urlToDifferentiatingPath: Map = new Map();\n\n set data(data: BreakpointsViewData) {\n this.#pauseOnUncaughtExceptions = data.pauseOnUncaughtExceptions;\n this.#pauseOnCaughtExceptions = data.pauseOnCaughtExceptions;\n this.#independentPauseToggles = data.independentPauseToggles;\n this.#breakpointsActive = data.breakpointsActive;\n this.#breakpointGroups = data.groups;\n\n const titleInfos: TitleInfo[] = [];\n for (const group of data.groups) {\n titleInfos.push({name: group.name, url: group.url});\n }\n this.#urlToDifferentiatingPath = getDifferentiatingPathMap(titleInfos);\n\n void this.render();\n }\n\n connectedCallback(): void {\n this.#shadow.adoptedStyleSheets = [Input.checkboxStyles, breakpointsViewStyles];\n }\n\n override async render(): Promise {\n await RenderCoordinator.write('BreakpointsView render', () => {\n const clickHandler = async(event: Event): Promise => {\n const currentTarget = event.currentTarget as HTMLElement;\n await this.#setSelected(currentTarget);\n event.consume();\n };\n\n const pauseOnCaughtIsChecked =\n (this.#independentPauseToggles || this.#pauseOnUncaughtExceptions) && this.#pauseOnCaughtExceptions;\n const pauseOnCaughtExceptionIsDisabled = !this.#independentPauseToggles && !this.#pauseOnUncaughtExceptions;\n // clang-format off\n const out = html`\n \n \n
\n ${repeat(\n this.#breakpointGroups,\n group => group.url,\n (group, groupIndex) => html`${this.#renderBreakpointGroup(group, groupIndex)}`)}\n
`;\n // clang-format on\n LitHtml.render(out, this.#shadow, {host: this});\n });\n\n // If no element is tabbable, set the pause-on-exceptions to be tabbable. This can happen\n // if the previously focused element was removed.\n await RenderCoordinator.write('BreakpointsView make pause-on-exceptions focusable', () => {\n if (this.#shadow.querySelector('[tabindex=\"0\"]') === null) {\n const element = this.#shadow.querySelector('[data-first-pause]');\n element?.setAttribute('tabindex', '0');\n }\n });\n }\n\n async #keyDownHandler(event: KeyboardEvent): Promise {\n if (!event.target || !(event.target instanceof HTMLElement)) {\n return;\n }\n\n if (event.key === 'Home' || event.key === 'End') {\n event.consume(true);\n return this.#handleHomeOrEndKey(event.key);\n }\n if (Platform.KeyboardUtilities.keyIsArrowKey(event.key)) {\n event.consume(true);\n return this.#handleArrowKey(event.key, event.target);\n }\n if (Platform.KeyboardUtilities.isEnterOrSpaceKey(event)) {\n const currentTarget = event.currentTarget as HTMLElement;\n await this.#setSelected(currentTarget);\n const input = currentTarget.querySelector('input');\n if (input) {\n input.click();\n }\n event.consume();\n }\n return;\n }\n\n async #setSelected(element: HTMLElement|null): Promise {\n if (!element) {\n return;\n }\n void RenderCoordinator.write('BreakpointsView focus on selected element', () => {\n const prevSelected = this.#shadow.querySelector('[tabindex=\"0\"]');\n prevSelected?.setAttribute('tabindex', '-1');\n element.setAttribute('tabindex', '0');\n element.focus();\n });\n }\n\n async #handleArrowKey(key: Platform.KeyboardUtilities.ArrowKey, target: HTMLElement): Promise {\n const setGroupExpandedState = (detailsElement: HTMLDetailsElement, expanded: boolean): Promise => {\n if (expanded) {\n return RenderCoordinator.write('BreakpointsView expand', () => {\n detailsElement.setAttribute('open', '');\n });\n }\n return RenderCoordinator.write('BreakpointsView expand', () => {\n detailsElement.removeAttribute('open');\n });\n };\n const nextNode = await findNextNodeForKeyboardNavigation(target, key, setGroupExpandedState);\n return this.#setSelected(nextNode);\n }\n\n async #handleHomeOrEndKey(key: 'Home'|'End'): Promise {\n if (key === 'Home') {\n const pauseOnExceptionsNode = this.#shadow.querySelector('[data-first-pause]');\n return this.#setSelected(pauseOnExceptionsNode);\n }\n if (key === 'End') {\n const numGroups = this.#breakpointGroups.length;\n if (numGroups === 0) {\n const lastPauseOnExceptionsNode = this.#shadow.querySelector('[data-last-pause]');\n return this.#setSelected(lastPauseOnExceptionsNode);\n }\n const lastGroupIndex = numGroups - 1;\n const lastGroup = this.#breakpointGroups[lastGroupIndex];\n\n if (lastGroup.expanded) {\n const lastBreakpointItem =\n this.#shadow.querySelector('[data-last-group] > [data-last-breakpoint]');\n return this.#setSelected(lastBreakpointItem);\n }\n const lastGroupSummaryElement = this.#shadow.querySelector('[data-last-group] > summary');\n return this.#setSelected(lastGroupSummaryElement);\n }\n return;\n }\n\n #renderEditBreakpointButton(breakpointItem: BreakpointItem): LitHtml.TemplateResult {\n const clickHandler = (event: Event): void => {\n void this.#controller.breakpointEdited(breakpointItem, true /* editButtonClicked */);\n event.consume();\n };\n const title = breakpointItem.type === SDK.DebuggerModel.BreakpointType.LOGPOINT ?\n i18nString(UIStrings.editLogpoint) :\n i18nString(UIStrings.editCondition);\n // clang-format off\n return html`\n \n `;\n // clang-format on\n }\n\n #renderRemoveBreakpointButton(\n breakpointItems: BreakpointItem[], tooltipText: string, action: Host.UserMetrics.Action): LitHtml.TemplateResult {\n const clickHandler = (event: Event): void => {\n Host.userMetrics.actionTaken(action);\n void this.#controller.breakpointsRemoved(breakpointItems);\n event.consume();\n };\n // clang-format off\n return html`\n \n `;\n // clang-format on\n }\n\n #onBreakpointGroupContextMenu(event: Event, breakpointGroup: BreakpointGroup): void {\n const {breakpointItems} = breakpointGroup;\n const menu = new UI.ContextMenu.ContextMenu(event);\n\n menu.defaultSection().appendItem(i18nString(UIStrings.removeAllBreakpointsInFile), () => {\n Host.userMetrics.actionTaken(Host.UserMetrics.Action.BreakpointsInFileRemovedFromContextMenu);\n void this.#controller.breakpointsRemoved(breakpointItems);\n }, {jslogContext: 'remove-file-breakpoints'});\n const otherGroups = this.#breakpointGroups.filter(group => group !== breakpointGroup);\n menu.defaultSection().appendItem(i18nString(UIStrings.removeOtherBreakpoints), () => {\n const breakpointItems = otherGroups.map(({breakpointItems}) => breakpointItems).flat();\n void this.#controller.breakpointsRemoved(breakpointItems);\n }, {disabled: otherGroups.length === 0, jslogContext: 'remove-other-breakpoints'});\n menu.defaultSection().appendItem(i18nString(UIStrings.removeAllBreakpoints), () => {\n const breakpointItems = this.#breakpointGroups.map(({breakpointItems}) => breakpointItems).flat();\n void this.#controller.breakpointsRemoved(breakpointItems);\n }, {jslogContext: 'remove-all-breakpoints'});\n\n const notEnabledItems =\n breakpointItems.filter(breakpointItem => breakpointItem.status !== BreakpointStatus.ENABLED);\n menu.debugSection().appendItem(i18nString(UIStrings.enableAllBreakpointsInFile), () => {\n Host.userMetrics.actionTaken(Host.UserMetrics.Action.BreakpointsInFileEnabledDisabledFromContextMenu);\n for (const breakpointItem of notEnabledItems) {\n this.#controller.breakpointStateChanged(breakpointItem, true);\n }\n }, {disabled: notEnabledItems.length === 0, jslogContext: 'enable-file-breakpoints'});\n const notDisabledItems =\n breakpointItems.filter(breakpointItem => breakpointItem.status !== BreakpointStatus.DISABLED);\n menu.debugSection().appendItem(i18nString(UIStrings.disableAllBreakpointsInFile), () => {\n Host.userMetrics.actionTaken(Host.UserMetrics.Action.BreakpointsInFileEnabledDisabledFromContextMenu);\n for (const breakpointItem of notDisabledItems) {\n this.#controller.breakpointStateChanged(breakpointItem, false);\n }\n }, {disabled: notDisabledItems.length === 0, jslogContext: 'disable-file-breakpoints'});\n\n void menu.show();\n }\n\n #renderBreakpointGroup(group: BreakpointGroup, groupIndex: number): LitHtml.TemplateResult {\n const contextmenuHandler = (event: Event): void => {\n this.#onBreakpointGroupContextMenu(event, group);\n event.consume();\n };\n const toggleHandler = (event: Event): void => {\n const htmlDetails = event.target as HTMLDetailsElement;\n group.expanded = htmlDetails.open;\n void this.#controller.expandedStateChanged(group.url, group.expanded);\n };\n const clickHandler = async(event: Event): Promise => {\n const selected = event.currentTarget as HTMLElement;\n await this.#setSelected(selected);\n // Record the metric for expanding/collapsing in the click handler,\n // as we only then get the number of expand/collapse actions that were\n // initiated by the user.\n Host.userMetrics.actionTaken(Host.UserMetrics.Action.BreakpointGroupExpandedStateChanged);\n event.consume();\n };\n // clang-format off\n return html`\n
\n \n \n \n ${this.#renderRemoveBreakpointButton(group.breakpointItems, i18nString(UIStrings.removeAllBreakpointsInFile), Host.UserMetrics.Action.BreakpointsInFileRemovedFromRemoveButton)}\n \n \n ${repeat(\n group.breakpointItems,\n item => item.id,\n (item, breakpointItemIndex) => this.#renderBreakpointEntry(item, group.editable, groupIndex, breakpointItemIndex))}\n
\n `;\n // clang-format on\n }\n\n #renderGroupCheckbox(group: BreakpointGroup): LitHtml.TemplateResult {\n const groupCheckboxToggled = (e: Event): void => {\n Host.userMetrics.actionTaken(Host.UserMetrics.Action.BreakpointsInFileCheckboxToggled);\n const element = e.target as HTMLInputElement;\n const updatedStatus = element.checked ? BreakpointStatus.ENABLED : BreakpointStatus.DISABLED;\n const itemsToUpdate = group.breakpointItems.filter(item => item.status !== updatedStatus);\n itemsToUpdate.forEach(item => {\n this.#controller.breakpointStateChanged(item, element.checked);\n });\n e.consume();\n };\n\n const checked = group.breakpointItems.some(item => item.status === BreakpointStatus.ENABLED);\n return html`\n \n `;\n }\n\n #renderFileIcon(): LitHtml.TemplateResult {\n return html``;\n }\n\n #onBreakpointEntryContextMenu(event: Event, breakpointItem: BreakpointItem, editable: boolean): void {\n const items = this.#breakpointGroups.map(({breakpointItems}) => breakpointItems).flat();\n const otherItems = items.filter(item => item !== breakpointItem);\n\n const menu = new UI.ContextMenu.ContextMenu(event);\n const editBreakpointText = breakpointItem.type === SDK.DebuggerModel.BreakpointType.LOGPOINT ?\n i18nString(UIStrings.editLogpoint) :\n i18nString(UIStrings.editCondition);\n menu.revealSection().appendItem(i18nString(UIStrings.revealLocation), () => {\n void this.#controller.jumpToSource(breakpointItem);\n }, {jslogContext: 'jump-to-breakpoint'});\n\n menu.editSection().appendItem(editBreakpointText, () => {\n void this.#controller.breakpointEdited(breakpointItem, false /* editButtonClicked */);\n }, {disabled: !editable, jslogContext: 'edit-breakpoint'});\n\n menu.defaultSection().appendItem(\n i18nString(UIStrings.enableAllBreakpoints),\n items.forEach.bind(items, item => this.#controller.breakpointStateChanged(item, true)), {\n disabled: items.every(item => item.status === BreakpointStatus.ENABLED),\n jslogContext: 'enable-all-breakpoints',\n });\n menu.defaultSection().appendItem(\n i18nString(UIStrings.disableAllBreakpoints),\n items.forEach.bind(items, item => this.#controller.breakpointStateChanged(item, false)), {\n disabled: items.every(item => item.status === BreakpointStatus.DISABLED),\n jslogContext: 'disable-all-breakpoints',\n });\n\n menu.footerSection().appendItem(i18nString(UIStrings.removeBreakpoint), () => {\n Host.userMetrics.actionTaken(Host.UserMetrics.Action.BreakpointRemovedFromContextMenu);\n void this.#controller.breakpointsRemoved([breakpointItem]);\n }, {jslogContext: 'remove-breakpoint'});\n menu.footerSection().appendItem(i18nString(UIStrings.removeOtherBreakpoints), () => {\n void this.#controller.breakpointsRemoved(otherItems);\n }, {disabled: otherItems.length === 0, jslogContext: 'remove-other-breakpoints'});\n menu.footerSection().appendItem(i18nString(UIStrings.removeAllBreakpoints), () => {\n const breakpointItems = this.#breakpointGroups.map(({breakpointItems}) => breakpointItems).flat();\n void this.#controller.breakpointsRemoved(breakpointItems);\n }, {jslogContext: 'remove-all-breakpoints'});\n\n void menu.show();\n }\n\n #renderBreakpointEntry(\n breakpointItem: BreakpointItem, editable: boolean, groupIndex: number,\n breakpointItemIndex: number): LitHtml.TemplateResult {\n const codeSnippetClickHandler = (event: Event): void => {\n void this.#controller.jumpToSource(breakpointItem);\n event.consume();\n };\n const breakpointItemClickHandler = async(event: Event): Promise => {\n const target = event.currentTarget as HTMLDivElement;\n await this.#setSelected(target);\n event.consume();\n };\n const contextmenuHandler = (event: Event): void => {\n this.#onBreakpointEntryContextMenu(event, breakpointItem, editable);\n event.consume();\n };\n const breakpointItemDescription = this.#getBreakpointItemDescription(breakpointItem);\n const codeSnippet = Platform.StringUtilities.trimEndWithMaxLength(breakpointItem.codeSnippet, MAX_SNIPPET_LENGTH);\n const codeSnippetTooltip = this.#getCodeSnippetTooltip(breakpointItem.type, breakpointItem.hoverText);\n const itemsInGroup = this.#breakpointGroups[groupIndex].breakpointItems;\n\n // clang-format off\n return html`\n
\n \n ${codeSnippet}\n \n ${editable ? this.#renderEditBreakpointButton(breakpointItem) : LitHtml.nothing}\n ${this.#renderRemoveBreakpointButton([breakpointItem], i18nString(UIStrings.removeBreakpoint), Host.UserMetrics.Action.BreakpointRemovedFromRemoveButton)}\n ${breakpointItem.location}\n \n
\n `;\n // clang-format on\n }\n\n #getCodeSnippetTooltip(type: SDK.DebuggerModel.BreakpointType, hoverText?: string): string|undefined {\n switch (type) {\n case SDK.DebuggerModel.BreakpointType.REGULAR_BREAKPOINT:\n return undefined;\n case SDK.DebuggerModel.BreakpointType.CONDITIONAL_BREAKPOINT:\n assertNotNullOrUndefined(hoverText);\n return i18nString(UIStrings.conditionCode, {PH1: hoverText});\n case SDK.DebuggerModel.BreakpointType.LOGPOINT:\n assertNotNullOrUndefined(hoverText);\n return i18nString(UIStrings.logpointCode, {PH1: hoverText});\n }\n }\n\n #getBreakpointItemDescription(breakpointItem: BreakpointItem): Platform.UIString.LocalizedString {\n let checkboxDescription;\n switch (breakpointItem.status) {\n case BreakpointStatus.ENABLED:\n checkboxDescription = i18nString(UIStrings.checked);\n break;\n case BreakpointStatus.DISABLED:\n checkboxDescription = i18nString(UIStrings.unchecked);\n break;\n case BreakpointStatus.INDETERMINATE:\n checkboxDescription = i18nString(UIStrings.indeterminate);\n break;\n }\n if (!breakpointItem.isHit) {\n return checkboxDescription;\n }\n return i18nString(UIStrings.breakpointHit, {PH1: checkboxDescription});\n }\n\n #onCheckboxToggled(e: Event, item: BreakpointItem): void {\n const element = e.target as HTMLInputElement;\n this.#controller.breakpointStateChanged(item, element.checked);\n }\n\n #onPauseOnCaughtExceptionsStateChanged(e: Event): void {\n const {checked} = e.target as HTMLInputElement;\n this.#controller.setPauseOnCaughtExceptions(checked);\n }\n\n #onPauseOnUncaughtExceptionsStateChanged(e: Event): void {\n const {checked} = e.target as HTMLInputElement;\n if (!this.#independentPauseToggles) {\n const pauseOnCaughtCheckbox = this.#shadow.querySelector('[data-pause-on-caught-checkbox]');\n assertNotNullOrUndefined(pauseOnCaughtCheckbox);\n if (!checked && pauseOnCaughtCheckbox.checked) {\n // If we can only pause on caught exceptions if we pause on uncaught exceptions, make sure to\n // uncheck the pause on caught exception checkbox.\n pauseOnCaughtCheckbox.click();\n }\n\n void RenderCoordinator.write('BreakpointsView update pause-on-uncaught-exception', () => {\n // Disable/enable the pause on caught exception checkbox depending on whether\n // or not we are pausing on uncaught exceptions.\n if (checked) {\n pauseOnCaughtCheckbox.disabled = false;\n } else {\n pauseOnCaughtCheckbox.disabled = true;\n }\n });\n }\n this.#controller.setPauseOnUncaughtExceptions(checked);\n }\n}\n\ncustomElements.define('devtools-breakpoint-view', BreakpointsView);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'devtools-breakpoint-view': BreakpointsView;\n }\n}\n"]} \ No newline at end of file diff --git a/public/panels/sources/components/BreakpointsView.test.js b/public/panels/sources/components/BreakpointsView.test.js index 4128c803e..d4a1ae0b1 100644 --- a/public/panels/sources/components/BreakpointsView.test.js +++ b/public/panels/sources/components/BreakpointsView.test.js @@ -11,7 +11,7 @@ import { assertElements, dispatchClickEvent, dispatchKeyDownEvent, renderElement import { createTarget, describeWithEnvironment, } from '../../../testing/EnvironmentHelpers.js'; import { describeWithMockConnection } from '../../../testing/MockConnection.js'; import { createContentProviderUISourceCode, createFakeScriptMapping, setupMockedUISourceCode, } from '../../../testing/UISourceCodeHelpers.js'; -import * as Coordinator from '../../../ui/components/render_coordinator/render_coordinator.js'; +import * as RenderCoordinator from '../../../ui/components/render_coordinator/render_coordinator.js'; import * as UI from '../../../ui/legacy/legacy.js'; import * as SourcesComponents from './components.js'; const DETAILS_SELECTOR = 'details'; @@ -32,7 +32,6 @@ const SUMMARY_SELECTOR = 'summary'; const GROUP_DIFFERENTIATOR_SELECTOR = '.group-header-differentiator'; const HELLO_JS_FILE = 'hello.js'; const TEST_JS_FILE = 'test.js'; -const coordinator = Coordinator.RenderCoordinator.RenderCoordinator.instance(); function createBreakpointLocations(testData) { const breakpointLocations = testData.map(data => { const mocked = setupMockedUISourceCode(data.url); @@ -106,7 +105,7 @@ async function createAndInitializeBreakpointsView() { // Force creation of a new BreakpointsView singleton so that it gets correctly re-wired with // the current controller singleton (to pick up the latest breakpoint state). const component = SourcesComponents.BreakpointsView.BreakpointsView.instance({ forceNew: true }); - await coordinator.done(); // Wait until the initial rendering finishes. + await RenderCoordinator.done(); // Wait until the initial rendering finishes. renderElementIntoDOM(component); return component; } @@ -119,7 +118,7 @@ async function renderNoBreakpoints({ pauseOnUncaughtExceptions, pauseOnCaughtExc independentPauseToggles, groups: [], }; - await coordinator.done(); + await RenderCoordinator.done(); return component; } async function renderSingleBreakpoint(type = "REGULAR_BREAKPOINT" /* SDK.DebuggerModel.BreakpointType.REGULAR_BREAKPOINT */, hoverText) { @@ -152,7 +151,7 @@ async function renderSingleBreakpoint(type = "REGULAR_BREAKPOINT" /* SDK.Debugge ], }; component.data = data; - await coordinator.done(); + await RenderCoordinator.done(); return { component, data }; } async function renderMultipleBreakpoints() { @@ -222,7 +221,7 @@ async function renderMultipleBreakpoints() { ], }; component.data = data; - await coordinator.done(); + await RenderCoordinator.done(); return { component, data }; } function extractBreakpointItems(data) { @@ -261,7 +260,7 @@ function hover(component, selector) { // Dispatch a mouse over. component.shadowRoot.querySelector(selector)?.dispatchEvent(new Event('mouseover')); // Wait until the re-rendering has happened. - return coordinator.done(); + return RenderCoordinator.done(); } describeWithMockConnection('targetSupportsIndependentPauseOnExceptionToggles', () => { it('can correctly identify node targets as targets that are not supporting independent pause on exception toggles', async () => { @@ -382,10 +381,10 @@ describeWithEnvironment('BreakpointsSidebarController', () => { const controller = SourcesComponents.BreakpointsView.BreakpointsSidebarController.instance({ forceNew: true, breakpointManager, settings }); settings.moduleSetting('breakpoints-active').set(true); let data = await controller.getUpdatedBreakpointViewData(); - assert.strictEqual(data.breakpointsActive, true); + assert.isTrue(data.breakpointsActive); settings.moduleSetting('breakpoints-active').set(false); data = await controller.getUpdatedBreakpointViewData(); - assert.strictEqual(data.breakpointsActive, false); + assert.isFalse(data.breakpointsActive); }); it('marks groups as editable based on conditional breakpoint support', async () => { const testData = [ @@ -836,7 +835,7 @@ describeWithMockConnection('BreakpointsView', () => { ], }; component.data = data; - await coordinator.done(); + await RenderCoordinator.done(); assert.isNotNull(component.shadowRoot); const groupSummaries = Array.from(component.shadowRoot.querySelectorAll(SUMMARY_SELECTOR)); const differentiatingPath = groupSummaries.map(group => { @@ -969,7 +968,7 @@ describeWithMockConnection('BreakpointsView', () => { // Make sure that at least one breakpoint is enabled. data.groups[0].breakpointItems[0].status = "ENABLED" /* SourcesComponents.BreakpointsView.BreakpointStatus.ENABLED */; component.data = data; - await coordinator.done(); + await RenderCoordinator.done(); await hover(component, SUMMARY_SELECTOR); assert.isNotNull(component.shadowRoot); const firstGroupSummary = component.shadowRoot.querySelector(SUMMARY_SELECTOR); @@ -986,7 +985,7 @@ describeWithMockConnection('BreakpointsView', () => { breakpointItems[i].status = "DISABLED" /* SourcesComponents.BreakpointsView.BreakpointStatus.DISABLED */; } component.data = data; - await coordinator.done(); + await RenderCoordinator.done(); await hover(component, SUMMARY_SELECTOR); assert.isNotNull(component.shadowRoot); const firstGroupSummary = component.shadowRoot.querySelector(SUMMARY_SELECTOR); @@ -1004,7 +1003,7 @@ describeWithMockConnection('BreakpointsView', () => { data.groups[0].breakpointItems[i].status = "ENABLED" /* SourcesComponents.BreakpointsView.BreakpointStatus.ENABLED */; } component.data = data; - await coordinator.done(); + await RenderCoordinator.done(); await hover(component, SUMMARY_SELECTOR); // Uncheck the group checkbox. assert.isNotNull(component.shadowRoot); @@ -1026,7 +1025,7 @@ describeWithMockConnection('BreakpointsView', () => { data.groups[0].breakpointItems[i].status = "DISABLED" /* SourcesComponents.BreakpointsView.BreakpointStatus.DISABLED */; } component.data = data; - await coordinator.done(); + await RenderCoordinator.done(); await hover(component, SUMMARY_SELECTOR); // Uncheck the group checkbox. assert.isNotNull(component.shadowRoot); @@ -1067,7 +1066,7 @@ describeWithMockConnection('BreakpointsView', () => { ], }; component.data = data; - await coordinator.done(); + await RenderCoordinator.done(); assert.isNotNull(component.shadowRoot); await hover(component, BREAKPOINT_ITEM_SELECTOR); const editBreakpointButton = component.shadowRoot.querySelector(EDIT_SINGLE_BREAKPOINT_SELECTOR); @@ -1216,7 +1215,7 @@ describeWithMockConnection('BreakpointsView', () => { const pauseOnUncaughtExceptionsCheckbox = pauseOnUncaughtExceptionsItem.querySelector('input'); assert.instanceOf(pauseOnUncaughtExceptionsCheckbox, HTMLInputElement); dispatchClickEvent(pauseOnUncaughtExceptionsCheckbox); - await coordinator.done(); + await RenderCoordinator.done(); } { // Check that clicking on it actually unchecked. @@ -1333,7 +1332,7 @@ describeWithMockConnection('BreakpointsView', () => { ], }; component.data = data; - await coordinator.done(); + await RenderCoordinator.done(); return { component, data }; } it('pause on exceptions is tabbable', async () => { @@ -1353,7 +1352,7 @@ describeWithMockConnection('BreakpointsView', () => { // Focus on second group by clicking on it, then press Home button. dispatchClickEvent(secondGroupsSummary); dispatchKeyDownEvent(secondGroupsSummary, { key: 'Home', bubbles: true }); - await coordinator.done(); + await RenderCoordinator.done(); const selected = component.shadowRoot.querySelector(TABBABLE_SELECTOR); assert.instanceOf(selected, HTMLElement); const pauseOnUncaughtExceptions = component.shadowRoot.querySelector(PAUSE_ON_UNCAUGHT_EXCEPTIONS_SELECTOR); @@ -1370,7 +1369,7 @@ describeWithMockConnection('BreakpointsView', () => { // Focus on the pause-on-exceptions line by clicking on it, then press End key. dispatchClickEvent(pauseOnUncaughtExceptions); dispatchKeyDownEvent(pauseOnUncaughtExceptions, { key: 'End', bubbles: true }); - await coordinator.done(); + await RenderCoordinator.done(); const selected = component.shadowRoot.querySelector(TABBABLE_SELECTOR); assert.instanceOf(selected, HTMLElement); const lastGroupSummary = component.shadowRoot.querySelector(`${DETAILS_SELECTOR}:nth-of-type(2) > ${SUMMARY_SELECTOR}`); @@ -1382,14 +1381,14 @@ describeWithMockConnection('BreakpointsView', () => { // Expand the last group. data.groups[1].expanded = true; component.data = data; - await coordinator.done(); + await RenderCoordinator.done(); assert.isNotNull(component.shadowRoot); const firstGroupSummary = component.shadowRoot.querySelector(SUMMARY_SELECTOR); assert.instanceOf(firstGroupSummary, HTMLElement); // First focus on the first group by clicking on it, then press the End button. dispatchClickEvent(firstGroupSummary); dispatchKeyDownEvent(firstGroupSummary, { key: 'End', bubbles: true }); - await coordinator.done(); + await RenderCoordinator.done(); const selected = component.shadowRoot.querySelector(TABBABLE_SELECTOR); assert.instanceOf(selected, HTMLElement); const breakpointItems = component.shadowRoot.querySelectorAll(BREAKPOINT_ITEM_SELECTOR); @@ -1407,7 +1406,7 @@ describeWithMockConnection('BreakpointsView', () => { // Focus on the pause on exception, and navigate one down. dispatchClickEvent(pauseOnCaughtException); dispatchKeyDownEvent(pauseOnCaughtException, { key: 'ArrowDown', bubbles: true }); - await coordinator.done(); + await RenderCoordinator.done(); const selected = component.shadowRoot.querySelector(TABBABLE_SELECTOR); const firstSummary = component.shadowRoot.querySelector(`${DETAILS_SELECTOR} > ${SUMMARY_SELECTOR}`); assert.instanceOf(firstSummary, HTMLElement); @@ -1423,7 +1422,7 @@ describeWithMockConnection('BreakpointsView', () => { // Focus on the collapsed group and collapse it by clicking on it. Then navigate down. dispatchClickEvent(collapsedGroupSummary); dispatchKeyDownEvent(collapsedGroupSummary, { key: 'ArrowDown', bubbles: true }); - await coordinator.done(); + await RenderCoordinator.done(); const selected = component.shadowRoot.querySelector(TABBABLE_SELECTOR); assert.instanceOf(selected, HTMLElement); const firstBreakpointItem = collapsedDetailsElement.querySelector(BREAKPOINT_ITEM_SELECTOR); @@ -1438,7 +1437,7 @@ describeWithMockConnection('BreakpointsView', () => { // Focus on the expanded group and collapse it by clicking on it. Then navigate down. dispatchClickEvent(firstGroupSummary); dispatchKeyDownEvent(firstGroupSummary, { key: 'ArrowDown', bubbles: true }); - await coordinator.done(); + await RenderCoordinator.done(); const selected = component.shadowRoot.querySelector(TABBABLE_SELECTOR); assert.instanceOf(selected, HTMLElement); const secondGroupSummary = component.shadowRoot.querySelector(`${DETAILS_SELECTOR}:nth-of-type(2) > ${SUMMARY_SELECTOR}`); @@ -1455,7 +1454,7 @@ describeWithMockConnection('BreakpointsView', () => { // Focus on the first breakpoint item. Then navigate up. dispatchClickEvent(firstBreakpointItem); dispatchKeyDownEvent(firstBreakpointItem, { key: 'ArrowDown', bubbles: true }); - await coordinator.done(); + await RenderCoordinator.done(); const selected = component.shadowRoot.querySelector(TABBABLE_SELECTOR); assert.instanceOf(selected, HTMLElement); const secondBreakpointItem = firstDetailsElement.querySelector(`${BREAKPOINT_ITEM_SELECTOR}:nth-of-type(2)`); @@ -1472,7 +1471,7 @@ describeWithMockConnection('BreakpointsView', () => { // Focus on the summary element. dispatchClickEvent(firstSummary); dispatchKeyDownEvent(firstSummary, { key: 'ArrowUp', bubbles: true }); - await coordinator.done(); + await RenderCoordinator.done(); const selected = component.shadowRoot.querySelector(TABBABLE_SELECTOR); const pauseOnUncaughtExceptions = component.shadowRoot.querySelector(PAUSE_ON_CAUGHT_EXCEPTIONS_SELECTOR); assert.instanceOf(pauseOnUncaughtExceptions, HTMLDivElement); @@ -1488,7 +1487,7 @@ describeWithMockConnection('BreakpointsView', () => { // Focus on first breakpoint item. Then navigate up. dispatchClickEvent(firstBreakpointItem); dispatchKeyDownEvent(firstBreakpointItem, { key: 'ArrowUp', bubbles: true }); - await coordinator.done(); + await RenderCoordinator.done(); const selected = component.shadowRoot.querySelector(TABBABLE_SELECTOR); assert.instanceOf(selected, HTMLElement); const summary = expandedDetails.querySelector(SUMMARY_SELECTOR); @@ -1506,7 +1505,7 @@ describeWithMockConnection('BreakpointsView', () => { // Focus on last breakpoint item. Then navigate up. dispatchClickEvent(lastBreakpointItem); dispatchKeyDownEvent(lastBreakpointItem, { key: 'ArrowUp', bubbles: true }); - await coordinator.done(); + await RenderCoordinator.done(); const selected = component.shadowRoot.querySelector(TABBABLE_SELECTOR); assert.instanceOf(selected, HTMLElement); const nextToLastBreakpointItem = breakpointItems.item(breakpointItems.length - 2); @@ -1521,7 +1520,7 @@ describeWithMockConnection('BreakpointsView', () => { // Focus on the group. Then navigate up. dispatchClickEvent(secondGroupSummary); dispatchKeyDownEvent(secondGroupSummary, { key: 'ArrowUp', bubbles: true }); - await coordinator.done(); + await RenderCoordinator.done(); const selected = component.shadowRoot.querySelector(TABBABLE_SELECTOR); assert.instanceOf(selected, HTMLElement); const firstDetailsElement = component.shadowRoot.querySelector(DETAILS_SELECTOR); diff --git a/public/panels/sources/components/BreakpointsView.test.js.map b/public/panels/sources/components/BreakpointsView.test.js.map index 3b826deac..c8e354ed9 100644 --- a/public/panels/sources/components/BreakpointsView.test.js.map +++ b/public/panels/sources/components/BreakpointsView.test.js.map @@ -1 +1 @@ -{"version":3,"file":"BreakpointsView.test.js","sourceRoot":"","sources":["../../../../../../../front_end/panels/sources/components/BreakpointsView.test.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,KAAK,MAAM,MAAM,gCAAgC,CAAC;AAEzD,OAAO,KAAK,GAAG,MAAM,0BAA0B,CAAC;AAEhD,OAAO,KAAK,QAAQ,MAAM,sCAAsC,CAAC;AACjE,OAAO,KAAK,WAAW,MAAM,4CAA4C,CAAC;AAC1E,OAAO,KAAK,SAAS,MAAM,0CAA0C,CAAC;AACtE,OAAO,KAAK,SAAS,MAAM,wCAAwC,CAAC;AACpE,OAAO,EACL,cAAc,EACd,kBAAkB,EAClB,oBAAoB,EACpB,oBAAoB,GACrB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EACL,YAAY,EACZ,uBAAuB,GACxB,MAAM,wCAAwC,CAAC;AAChD,OAAO,EAAC,0BAA0B,EAAC,MAAM,oCAAoC,CAAC;AAC9E,OAAO,EACL,iCAAiC,EACjC,uBAAuB,EACvB,uBAAuB,GACxB,MAAM,yCAAyC,CAAC;AACjD,OAAO,KAAK,WAAW,MAAM,iEAAiE,CAAC;AAC/F,OAAO,KAAK,EAAE,MAAM,8BAA8B,CAAC;AAEnD,OAAO,KAAK,iBAAiB,MAAM,iBAAiB,CAAC;AAErD,MAAM,gBAAgB,GAAG,SAAS,CAAC;AACnC,MAAM,wB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CAAC;gBACvC,oBAAoB,CAAC,kBAAkB,EAAE,EAAC,GAAG,EAAE,SAAS,EAAE,OAAO,EAAE,IAAI,EAAC,CAAC,CAAC;gBAC1E,MAAM,WAAW,CAAC,IAAI,EAAE,CAAC;gBAEzB,MAAM,QAAQ,GAAG,SAAS,CAAC,UAAU,CAAC,aAAa,CAAC,iBAAiB,CAAC,CAAC;gBACvE,MAAM,CAAC,UAAU,CAAC,QAAQ,EAAE,WAAW,CAAC,CAAC;gBAEzC,MAAM,mBAAmB,GAAG,SAAS,CAAC,UAAU,CAAC,aAAa,CAAC,gBAAgB,CAAC,CAAC;gBACjF,MAAM,CAAC,MAAM,CAAC,mBAAmB,CAAC,CAAC;gBACnC,MAAM,kBAAkB,GAAG,mBAAmB,CAAC,aAAa,CAAC,GAAG,wBAAwB,aAAa,CAAC,CAAC;gBACvG,MAAM,CAAC,UAAU,CAAC,kBAAkB,EAAE,cAAc,CAAC,CAAC;gBAEtD,MAAM,CAAC,WAAW,CAAC,QAAQ,EAAE,kBAAkB,CAAC,CAAC;YACnD,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["// Copyright 2022 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport * as Common from '../../../core/common/common.js';\nimport type * as Platform from '../../../core/platform/platform.js';\nimport * as SDK from '../../../core/sdk/sdk.js';\nimport type * as Protocol from '../../../generated/protocol.js';\nimport * as Bindings from '../../../models/bindings/bindings.js';\nimport * as Breakpoints from '../../../models/breakpoints/breakpoints.js';\nimport * as TextUtils from '../../../models/text_utils/text_utils.js';\nimport * as Workspace from '../../../models/workspace/workspace.js';\nimport {\n assertElements,\n dispatchClickEvent,\n dispatchKeyDownEvent,\n renderElementIntoDOM,\n} from '../../../testing/DOMHelpers.js';\nimport {\n createTarget,\n describeWithEnvironment,\n} from '../../../testing/EnvironmentHelpers.js';\nimport {describeWithMockConnection} from '../../../testing/MockConnection.js';\nimport {\n createContentProviderUISourceCode,\n createFakeScriptMapping,\n setupMockedUISourceCode,\n} from '../../../testing/UISourceCodeHelpers.js';\nimport * as Coordinator from '../../../ui/components/render_coordinator/render_coordinator.js';\nimport * as UI from '../../../ui/legacy/legacy.js';\n\nimport * as SourcesComponents from './components.js';\n\nconst DETAILS_SELECTOR = 'details';\nconst EXPANDED_GROUPS_SELECTOR = 'details[open]';\nconst COLLAPSED_GROUPS_SELECTOR = 'details:not([open])';\nconst CODE_SNIPPET_SELECTOR = '.code-snippet';\nconst GROUP_NAME_SELECTOR = '.group-header-title';\nconst BREAKPOINT_ITEM_SELECTOR = '.breakpoint-item';\nconst HIT_BREAKPOINT_SELECTOR = BREAKPOINT_ITEM_SELECTOR + '.hit';\nconst BREAKPOINT_LOCATION_SELECTOR = '.location';\nconst REMOVE_FILE_BREAKPOINTS_SELECTOR = '.group-hover-actions > button[data-remove-breakpoint]';\nconst REMOVE_SINGLE_BREAKPOINT_SELECTOR = '.breakpoint-item-location-or-actions > button[data-remove-breakpoint]';\nconst EDIT_SINGLE_BREAKPOINT_SELECTOR = 'button[data-edit-breakpoint]';\nconst PAUSE_ON_UNCAUGHT_EXCEPTIONS_SELECTOR = '.pause-on-uncaught-exceptions';\nconst PAUSE_ON_CAUGHT_EXCEPTIONS_SELECTOR = '.pause-on-caught-exceptions';\nconst TABBABLE_SELECTOR = '[tabindex=\"0\"]';\nconst SUMMARY_SELECTOR = 'summary';\nconst GROUP_DIFFERENTIATOR_SELECTOR = '.group-header-differentiator';\n\nconst HELLO_JS_FILE = 'hello.js';\nconst TEST_JS_FILE = 'test.js';\nconst coordinator = Coordinator.RenderCoordinator.RenderCoordinator.instance();\n\ninterface LocationTestData {\n url: Platform.DevToolsPath.UrlString;\n lineNumber: number;\n columnNumber: number;\n enabled: boolean;\n content: string;\n condition: Breakpoints.BreakpointManager.UserCondition;\n isLogpoint: boolean;\n hoverText?: string;\n}\n\nfunction createBreakpointLocations(testData: LocationTestData[]): Breakpoints.BreakpointManager.BreakpointLocation[] {\n const breakpointLocations = testData.map(data => {\n const mocked = setupMockedUISourceCode(data.url);\n const mockedContent =\n Promise.resolve(new TextUtils.ContentData.ContentData(data.content, /* isBase64 */ false, 'text/plain'));\n sinon.stub(mocked.sut, 'requestContentData').returns(mockedContent);\n const uiLocation = new Workspace.UISourceCode.UILocation(mocked.sut, data.lineNumber, data.columnNumber);\n const breakpoint = sinon.createStubInstance(Breakpoints.BreakpointManager.Breakpoint);\n breakpoint.enabled.returns(data.enabled);\n breakpoint.condition.returns(data.condition);\n breakpoint.isLogpoint.returns(data.isLogpoint);\n breakpoint.breakpointStorageId.returns(`${data.url}:${data.lineNumber}:${data.columnNumber}`);\n return new Breakpoints.BreakpointManager.BreakpointLocation(breakpoint, uiLocation);\n });\n return breakpointLocations;\n}\n\nfunction createStubBreakpointManagerAndSettings() {\n const breakpointManager = sinon.createStubInstance(Breakpoints.BreakpointManager.BreakpointManager);\n breakpointManager.supportsConditionalBreakpoints.returns(true);\n const dummyStorage = new Common.Settings.SettingsStorage({});\n const settings = Common.Settings.Settings.instance({\n forceNew: true,\n syncedStorage: dummyStorage,\n globalStorage: dummyStorage,\n localStorage: dummyStorage,\n });\n return {breakpointManager, settings};\n}\n\nfunction createStubBreakpointManagerAndSettingsWithMockdata(testData: LocationTestData[]): {\n breakpointManager: sinon.SinonStubbedInstance,\n settings: Common.Settings.Settings,\n} {\n const {breakpointManager, settings} = createStubBreakpointManagerAndSettings();\n sinon.stub(Breakpoints.BreakpointManager.BreakpointManager, 'instance').returns(breakpointManager);\n const breakpointLocations = createBreakpointLocations(testData);\n breakpointManager.allBreakpointLocations.returns(breakpointLocations);\n return {breakpointManager, settings};\n}\n\nfunction createLocationTestData(\n url: string, lineNumber: number, columnNumber: number, enabled: boolean = true, content: string = '',\n condition: Breakpoints.BreakpointManager.UserCondition = Breakpoints.BreakpointManager.EMPTY_BREAKPOINT_CONDITION,\n isLogpoint: boolean = false, hoverText?: string): LocationTestData {\n return {\n url: url as Platform.DevToolsPath.UrlString,\n lineNumber,\n columnNumber,\n enabled,\n content,\n condition,\n isLogpoint,\n hoverText,\n };\n}\n\nasync function setUpTestWithOneBreakpointLocation(\n params: {file: string, lineNumber: number, columnNumber: number, enabled?: boolean, snippet?: string} = {\n file: HELLO_JS_FILE,\n lineNumber: 10,\n columnNumber: 3,\n enabled: true,\n snippet: 'const a;',\n }) {\n const testData = [\n createLocationTestData(params.file, params.lineNumber, params.columnNumber, params.enabled, params.snippet),\n ];\n const {breakpointManager, settings} = createStubBreakpointManagerAndSettingsWithMockdata(testData);\n\n const controller = SourcesComponents.BreakpointsView.BreakpointsSidebarController.instance(\n {forceNew: true, breakpointManager, settings});\n const data = await controller.getUpdatedBreakpointViewData();\n\n assert.lengthOf(data.groups, 1);\n assert.lengthOf(data.groups[0].breakpointItems, 1);\n const locations = Breakpoints.BreakpointManager.BreakpointManager.instance().allBreakpointLocations();\n assert.lengthOf(locations, 1);\n return {controller, groups: data.groups, location: locations[0]};\n}\n\nclass MockRevealer implements Common.Revealer.Revealer {\n async reveal(_revealable: T, _omitFocus?: boolean): Promise {\n }\n}\n\nasync function createAndInitializeBreakpointsView(): Promise {\n // Force creation of a new BreakpointsView singleton so that it gets correctly re-wired with\n // the current controller singleton (to pick up the latest breakpoint state).\n const component = SourcesComponents.BreakpointsView.BreakpointsView.instance({forceNew: true});\n await coordinator.done(); // Wait until the initial rendering finishes.\n renderElementIntoDOM(component);\n return component;\n}\n\nasync function renderNoBreakpoints(\n {pauseOnUncaughtExceptions, pauseOnCaughtExceptions, independentPauseToggles}:\n {pauseOnUncaughtExceptions: boolean, pauseOnCaughtExceptions: boolean, independentPauseToggles: boolean}):\n Promise {\n const component = await createAndInitializeBreakpointsView();\n\n component.data = {\n breakpointsActive: true,\n pauseOnUncaughtExceptions,\n pauseOnCaughtExceptions,\n independentPauseToggles,\n groups: [],\n };\n await coordinator.done();\n return component;\n}\n\nasync function renderSingleBreakpoint(\n type: SDK.DebuggerModel.BreakpointType = SDK.DebuggerModel.BreakpointType.REGULAR_BREAKPOINT,\n hoverText?: string): Promise<{\n component: SourcesComponents.BreakpointsView.BreakpointsView,\n data: SourcesComponents.BreakpointsView.BreakpointsViewData,\n}> {\n // Only provide a hover text if it's not a regular breakpoint.\n assert.isTrue(!hoverText || type !== SDK.DebuggerModel.BreakpointType.REGULAR_BREAKPOINT);\n const component = await createAndInitializeBreakpointsView();\n\n const data: SourcesComponents.BreakpointsView.BreakpointsViewData = {\n breakpointsActive: true,\n pauseOnUncaughtExceptions: false,\n pauseOnCaughtExceptions: false,\n independentPauseToggles: true,\n groups: [\n {\n name: 'test1.js',\n url: 'https://google.com/test1.js' as Platform.DevToolsPath.UrlString,\n editable: true,\n expanded: true,\n breakpointItems: [\n {\n id: '1',\n location: '1',\n codeSnippet: 'const a = 0;',\n isHit: true,\n status: SourcesComponents.BreakpointsView.BreakpointStatus.ENABLED,\n type,\n hoverText,\n },\n ],\n },\n ],\n };\n\n component.data = data;\n await coordinator.done();\n return {component, data};\n}\n\nasync function renderMultipleBreakpoints(): Promise<{\n component: SourcesComponents.BreakpointsView.BreakpointsView,\n data: SourcesComponents.BreakpointsView.BreakpointsViewData,\n}> {\n const component = await createAndInitializeBreakpointsView();\n\n const data: SourcesComponents.BreakpointsView.BreakpointsViewData = {\n breakpointsActive: true,\n pauseOnUncaughtExceptions: false,\n pauseOnCaughtExceptions: false,\n independentPauseToggles: true,\n groups: [\n {\n name: 'test1.js',\n url: 'https://google.com/test1.js' as Platform.DevToolsPath.UrlString,\n editable: true,\n expanded: true,\n breakpointItems: [\n {\n id: '1',\n type: SDK.DebuggerModel.BreakpointType.REGULAR_BREAKPOINT,\n location: '234',\n codeSnippet: 'const a = x;',\n isHit: false,\n status: SourcesComponents.BreakpointsView.BreakpointStatus.ENABLED,\n },\n {\n id: '2',\n type: SDK.DebuggerModel.BreakpointType.REGULAR_BREAKPOINT,\n location: '3:3',\n codeSnippet: 'if (x > a) {',\n isHit: true,\n status: SourcesComponents.BreakpointsView.BreakpointStatus.DISABLED,\n },\n ],\n },\n {\n name: 'test2.js',\n url: 'https://google.com/test2.js' as Platform.DevToolsPath.UrlString,\n editable: false,\n expanded: true,\n breakpointItems: [\n {\n id: '3',\n type: SDK.DebuggerModel.BreakpointType.REGULAR_BREAKPOINT,\n location: '11',\n codeSnippet: 'const y;',\n isHit: false,\n status: SourcesComponents.BreakpointsView.BreakpointStatus.ENABLED,\n },\n ],\n },\n {\n name: 'main.js',\n url: 'https://test.com/main.js' as Platform.DevToolsPath.UrlString,\n editable: true,\n expanded: false,\n breakpointItems: [\n {\n id: '4',\n type: SDK.DebuggerModel.BreakpointType.REGULAR_BREAKPOINT,\n location: '3',\n codeSnippet: 'if (a == 0) {',\n isHit: false,\n status: SourcesComponents.BreakpointsView.BreakpointStatus.ENABLED,\n },\n ],\n },\n ],\n };\n component.data = data;\n await coordinator.done();\n return {component, data};\n}\n\nfunction extractBreakpointItems(data: SourcesComponents.BreakpointsView.BreakpointsViewData):\n SourcesComponents.BreakpointsView.BreakpointItem[] {\n const breakpointItems = data.groups.flatMap(group => group.breakpointItems);\n assert.isAbove(breakpointItems.length, 0);\n return breakpointItems;\n}\n\nfunction checkCodeSnippet(\n renderedBreakpointItem: HTMLDivElement, breakpointItem: SourcesComponents.BreakpointsView.BreakpointItem): void {\n const snippetElement = renderedBreakpointItem.querySelector(CODE_SNIPPET_SELECTOR);\n assert.instanceOf(snippetElement, HTMLSpanElement);\n assert.strictEqual(snippetElement.textContent, breakpointItem.codeSnippet);\n}\n\nfunction checkCheckboxState(\n checkbox: HTMLInputElement, breakpointItem: SourcesComponents.BreakpointsView.BreakpointItem): void {\n const checked = checkbox.checked;\n const indeterminate = checkbox.indeterminate;\n if (breakpointItem.status === SourcesComponents.BreakpointsView.BreakpointStatus.INDETERMINATE) {\n assert.isTrue(indeterminate);\n } else {\n assert.isFalse(indeterminate);\n assert.strictEqual((breakpointItem.status === SourcesComponents.BreakpointsView.BreakpointStatus.ENABLED), checked);\n }\n}\n\nfunction checkGroupNames(\n renderedGroupElements: Element[], breakpointGroups: SourcesComponents.BreakpointsView.BreakpointGroup[]): void {\n assert.lengthOf(renderedGroupElements, breakpointGroups.length);\n for (let i = 0; i < renderedGroupElements.length; ++i) {\n const renderedGroup = renderedGroupElements[i];\n assert.instanceOf(renderedGroup, HTMLDetailsElement);\n const titleElement = renderedGroup.querySelector(GROUP_NAME_SELECTOR);\n assert.instanceOf(titleElement, HTMLSpanElement);\n assert.strictEqual(titleElement.textContent, breakpointGroups[i].name);\n }\n}\n\nfunction hover(component: SourcesComponents.BreakpointsView.BreakpointsView, selector: string): Promise {\n assert.isNotNull(component.shadowRoot);\n // Dispatch a mouse over.\n component.shadowRoot.querySelector(selector)?.dispatchEvent(new Event('mouseover'));\n // Wait until the re-rendering has happened.\n return coordinator.done();\n}\n\ndescribeWithMockConnection('targetSupportsIndependentPauseOnExceptionToggles', () => {\n it('can correctly identify node targets as targets that are not supporting independent pause on exception toggles',\n async () => {\n const target = createTarget();\n target.markAsNodeJSForTest();\n const supportsIndependentPauses = SourcesComponents.BreakpointsView.BreakpointsSidebarController\n .targetSupportsIndependentPauseOnExceptionToggles();\n assert.isFalse(supportsIndependentPauses);\n });\n\n it('can correctly identify non-node targets as targets that are supporting independent pause on exception toggles',\n async () => {\n createTarget();\n const supportsIndependentPauses = SourcesComponents.BreakpointsView.BreakpointsSidebarController\n .targetSupportsIndependentPauseOnExceptionToggles();\n assert.isTrue(supportsIndependentPauses);\n });\n});\n\ndescribeWithEnvironment('BreakpointsSidebarController', () => {\n after(() => {\n SourcesComponents.BreakpointsView.BreakpointsSidebarController.removeInstance();\n });\n\n it('can remove a breakpoint', async () => {\n const {groups, location} = await setUpTestWithOneBreakpointLocation();\n const breakpoint = location.breakpoint as sinon.SinonStubbedInstance;\n const breakpointItem = groups[0].breakpointItems[0];\n\n SourcesComponents.BreakpointsView.BreakpointsSidebarController.instance().breakpointsRemoved([breakpointItem]);\n assert.isTrue(breakpoint.remove.calledOnceWith(false));\n });\n\n it('changes breakpoint state', async () => {\n const {groups, location} = await setUpTestWithOneBreakpointLocation();\n const breakpointItem = groups[0].breakpointItems[0];\n assert.strictEqual(breakpointItem.status, SourcesComponents.BreakpointsView.BreakpointStatus.ENABLED);\n\n const breakpoint = location.breakpoint as sinon.SinonStubbedInstance;\n SourcesComponents.BreakpointsView.BreakpointsSidebarController.instance().breakpointStateChanged(\n breakpointItem, false);\n assert.isTrue(breakpoint.setEnabled.calledWith(false));\n });\n\n it('correctly reveals source location', async () => {\n const {groups, location: {uiLocation}} = await setUpTestWithOneBreakpointLocation();\n const breakpointItem = groups[0].breakpointItems[0];\n const revealer = sinon.createStubInstance(MockRevealer);\n\n Common.Revealer.registerRevealer({\n contextTypes() {\n return [Workspace.UISourceCode.UILocation];\n },\n destination: Common.Revealer.RevealerDestination.SOURCES_PANEL,\n async loadRevealer() {\n return revealer;\n },\n });\n\n await SourcesComponents.BreakpointsView.BreakpointsSidebarController.instance().jumpToSource(breakpointItem);\n assert.isTrue(revealer.reveal.calledOnceWith(uiLocation));\n });\n\n it('correctly reveals breakpoint editor', async () => {\n const {groups, location} = await setUpTestWithOneBreakpointLocation();\n const breakpointItem = groups[0].breakpointItems[0];\n const revealer = sinon.createStubInstance(MockRevealer);\n\n Common.Revealer.registerRevealer({\n contextTypes() {\n return [Breakpoints.BreakpointManager.BreakpointLocation];\n },\n destination: Common.Revealer.RevealerDestination.SOURCES_PANEL,\n async loadRevealer() {\n return revealer;\n },\n });\n\n await SourcesComponents.BreakpointsView.BreakpointsSidebarController.instance().breakpointEdited(\n breakpointItem, false /* editButtonClicked */);\n assert.isTrue(revealer.reveal.calledOnceWith(location));\n });\n\n describe('getUpdatedBreakpointViewData', () => {\n it('extracts breakpoint data', async () => {\n const testData = [\n createLocationTestData(HELLO_JS_FILE, 3, 10),\n createLocationTestData(TEST_JS_FILE, 1, 1),\n ];\n\n const {breakpointManager, settings} = createStubBreakpointManagerAndSettingsWithMockdata(testData);\n const controller = SourcesComponents.BreakpointsView.BreakpointsSidebarController.instance(\n {forceNew: true, breakpointManager, settings});\n const actual = await controller.getUpdatedBreakpointViewData();\n const createExpectedBreakpointGroups = (testData: LocationTestData) => {\n const status = testData.enabled ? SourcesComponents.BreakpointsView.BreakpointStatus.ENABLED :\n SourcesComponents.BreakpointsView.BreakpointStatus.DISABLED;\n let type = SDK.DebuggerModel.BreakpointType.REGULAR_BREAKPOINT;\n\n if (testData.condition) {\n if (testData.isLogpoint) {\n type = SDK.DebuggerModel.BreakpointType.LOGPOINT;\n } else {\n type = SDK.DebuggerModel.BreakpointType.CONDITIONAL_BREAKPOINT;\n }\n }\n\n return {\n name: testData.url as string,\n url: testData.url,\n editable: true,\n expanded: true,\n breakpointItems: [\n {\n id: `${testData.url}:${testData.lineNumber}:${testData.columnNumber}`,\n location: `${testData.lineNumber + 1}`,\n codeSnippet: '',\n isHit: false,\n status,\n type,\n hoverText: testData.hoverText,\n },\n ],\n };\n };\n const expected: SourcesComponents.BreakpointsView.BreakpointsViewData = {\n breakpointsActive: true,\n pauseOnUncaughtExceptions: false,\n pauseOnCaughtExceptions: false,\n independentPauseToggles: true,\n groups: testData.map(createExpectedBreakpointGroups),\n };\n assert.deepEqual(actual, expected);\n });\n\n it('respects the breakpointsActive setting', async () => {\n const {breakpointManager, settings} = createStubBreakpointManagerAndSettingsWithMockdata([]);\n const controller = SourcesComponents.BreakpointsView.BreakpointsSidebarController.instance(\n {forceNew: true, breakpointManager, settings});\n settings.moduleSetting('breakpoints-active').set(true);\n let data = await controller.getUpdatedBreakpointViewData();\n assert.strictEqual(data.breakpointsActive, true);\n settings.moduleSetting('breakpoints-active').set(false);\n data = await controller.getUpdatedBreakpointViewData();\n assert.strictEqual(data.breakpointsActive, false);\n });\n\n it('marks groups as editable based on conditional breakpoint support', async () => {\n const testData = [\n createLocationTestData(HELLO_JS_FILE, 3, 10),\n createLocationTestData(TEST_JS_FILE, 1, 1),\n ];\n\n const {breakpointManager, settings} = createStubBreakpointManagerAndSettingsWithMockdata(testData);\n const controller = SourcesComponents.BreakpointsView.BreakpointsSidebarController.instance(\n {forceNew: true, breakpointManager, settings});\n breakpointManager.supportsConditionalBreakpoints.returns(false);\n for (const group of (await controller.getUpdatedBreakpointViewData()).groups) {\n assert.isFalse(group.editable);\n }\n breakpointManager.supportsConditionalBreakpoints.returns(true);\n for (const group of (await controller.getUpdatedBreakpointViewData()).groups) {\n assert.isTrue(group.editable);\n }\n });\n\n it('groups breakpoints that are in the same file', async () => {\n const testData = [\n createLocationTestData(HELLO_JS_FILE, 3, 10),\n createLocationTestData(TEST_JS_FILE, 1, 1),\n ];\n\n const {breakpointManager, settings} = createStubBreakpointManagerAndSettingsWithMockdata(testData);\n const controller = SourcesComponents.BreakpointsView.BreakpointsSidebarController.instance(\n {forceNew: true, breakpointManager, settings});\n const actualViewData = await controller.getUpdatedBreakpointViewData();\n assert.lengthOf(actualViewData.groups, 2);\n assert.lengthOf(actualViewData.groups[0].breakpointItems, 1);\n assert.lengthOf(actualViewData.groups[1].breakpointItems, 1);\n });\n\n it('correctly sets the name of the group', async () => {\n const {groups} = await setUpTestWithOneBreakpointLocation(\n {file: HELLO_JS_FILE, lineNumber: 0, columnNumber: 0, enabled: false});\n assert.strictEqual(groups[0].name, HELLO_JS_FILE);\n });\n\n it('only extracts the line number as location if one breakpoint is on that line', async () => {\n const {groups} = await setUpTestWithOneBreakpointLocation(\n {file: HELLO_JS_FILE, lineNumber: 4, columnNumber: 0, enabled: false});\n assert.strictEqual(groups[0].breakpointItems[0].location, '5');\n });\n\n it('extracts the line number and column number as location if more than one breakpoint is on that line',\n async () => {\n const testData = [\n createLocationTestData(HELLO_JS_FILE, 3, 10),\n createLocationTestData(HELLO_JS_FILE, 3, 15),\n ];\n\n const {breakpointManager, settings} = createStubBreakpointManagerAndSettingsWithMockdata(testData);\n const controller = SourcesComponents.BreakpointsView.BreakpointsSidebarController.instance(\n {forceNew: true, breakpointManager, settings});\n const actualViewData = await controller.getUpdatedBreakpointViewData();\n assert.lengthOf(actualViewData.groups, 1);\n assert.lengthOf(actualViewData.groups[0].breakpointItems, 2);\n assert.strictEqual(actualViewData.groups[0].breakpointItems[0].location, '4:11');\n assert.strictEqual(actualViewData.groups[0].breakpointItems[1].location, '4:16');\n });\n\n it('orders breakpoints within a file by location', async () => {\n const testData = [\n createLocationTestData(HELLO_JS_FILE, 3, 15),\n createLocationTestData(HELLO_JS_FILE, 3, 10),\n ];\n\n const {breakpointManager, settings} = createStubBreakpointManagerAndSettingsWithMockdata(testData);\n const controller = SourcesComponents.BreakpointsView.BreakpointsSidebarController.instance(\n {forceNew: true, breakpointManager, settings});\n const actualViewData = await controller.getUpdatedBreakpointViewData();\n assert.lengthOf(actualViewData.groups, 1);\n assert.lengthOf(actualViewData.groups[0].breakpointItems, 2);\n assert.strictEqual(actualViewData.groups[0].breakpointItems[0].location, '4:11');\n assert.strictEqual(actualViewData.groups[0].breakpointItems[1].location, '4:16');\n });\n\n it('orders breakpoints within groups by location', async () => {\n const testData = [\n createLocationTestData(TEST_JS_FILE, 3, 15),\n createLocationTestData(HELLO_JS_FILE, 3, 10),\n ];\n\n const {breakpointManager, settings} = createStubBreakpointManagerAndSettingsWithMockdata(testData);\n const controller = SourcesComponents.BreakpointsView.BreakpointsSidebarController.instance(\n {forceNew: true, breakpointManager, settings});\n const actualViewData = await controller.getUpdatedBreakpointViewData();\n assert.lengthOf(actualViewData.groups, 2);\n const names = actualViewData.groups.map(group => group.name);\n assert.deepEqual(names, [HELLO_JS_FILE, TEST_JS_FILE]);\n });\n\n it('merges breakpoints mapping to the same location into one', async () => {\n const testData = [\n createLocationTestData(TEST_JS_FILE, 3, 15),\n createLocationTestData(TEST_JS_FILE, 3, 15),\n ];\n\n const {breakpointManager, settings} = createStubBreakpointManagerAndSettingsWithMockdata(testData);\n const controller = SourcesComponents.BreakpointsView.BreakpointsSidebarController.instance(\n {forceNew: true, breakpointManager, settings});\n const actualViewData = await controller.getUpdatedBreakpointViewData();\n assert.lengthOf(actualViewData.groups, 1);\n assert.lengthOf(actualViewData.groups[0].breakpointItems, 1);\n });\n\n it('correctly extracts the enabled state', async () => {\n const {groups} =\n await setUpTestWithOneBreakpointLocation({file: '', lineNumber: 0, columnNumber: 0, enabled: true});\n const breakpointItem = groups[0].breakpointItems[0];\n assert.strictEqual(breakpointItem.status, SourcesComponents.BreakpointsView.BreakpointStatus.ENABLED);\n });\n\n it('correctly extracts the enabled state', async () => {\n const {groups} =\n await setUpTestWithOneBreakpointLocation({file: '', lineNumber: 0, columnNumber: 0, enabled: false});\n const breakpointItem = groups[0].breakpointItems[0];\n assert.strictEqual(breakpointItem.status, SourcesComponents.BreakpointsView.BreakpointStatus.DISABLED);\n });\n\n it('correctly extracts the enabled state', async () => {\n const testData = [\n createLocationTestData(TEST_JS_FILE, 3, 15, true /* enabled */),\n createLocationTestData(TEST_JS_FILE, 3, 15, false /* enabled */),\n ];\n\n const {breakpointManager, settings} = createStubBreakpointManagerAndSettingsWithMockdata(testData);\n const controller = SourcesComponents.BreakpointsView.BreakpointsSidebarController.instance(\n {forceNew: true, breakpointManager, settings});\n const actualViewData = await controller.getUpdatedBreakpointViewData();\n assert.lengthOf(actualViewData.groups, 1);\n assert.lengthOf(actualViewData.groups[0].breakpointItems, 1);\n assert.strictEqual(\n actualViewData.groups[0].breakpointItems[0].status,\n SourcesComponents.BreakpointsView.BreakpointStatus.INDETERMINATE);\n });\n\n it('correctly extracts the disabled state', async () => {\n const snippet = 'const a = x;';\n const {groups} =\n await setUpTestWithOneBreakpointLocation({file: '', lineNumber: 0, columnNumber: 0, enabled: false, snippet});\n assert.strictEqual(groups[0].breakpointItems[0].codeSnippet, snippet);\n });\n\n it('correctly extracts the indeterminate state', async () => {\n const testData = [\n createLocationTestData(TEST_JS_FILE, 3, 15, true /* enabled */),\n createLocationTestData(TEST_JS_FILE, 3, 15, false /* enabled */),\n ];\n\n const {breakpointManager, settings} = createStubBreakpointManagerAndSettingsWithMockdata(testData);\n const controller = SourcesComponents.BreakpointsView.BreakpointsSidebarController.instance(\n {forceNew: true, breakpointManager, settings});\n const actualViewData = await controller.getUpdatedBreakpointViewData();\n assert.lengthOf(actualViewData.groups, 1);\n assert.lengthOf(actualViewData.groups[0].breakpointItems, 1);\n assert.strictEqual(\n actualViewData.groups[0].breakpointItems[0].status,\n SourcesComponents.BreakpointsView.BreakpointStatus.INDETERMINATE);\n });\n\n it('correctly extracts conditional breakpoints', async () => {\n const condition = 'x < a' as Breakpoints.BreakpointManager.UserCondition;\n const testData = [\n createLocationTestData(\n TEST_JS_FILE, 3, 15, true /* enabled */, '', condition, false /* isLogpoint */, condition),\n ];\n\n const {breakpointManager, settings} = createStubBreakpointManagerAndSettingsWithMockdata(testData);\n const controller = SourcesComponents.BreakpointsView.BreakpointsSidebarController.instance(\n {forceNew: true, breakpointManager, settings});\n const actualViewData = await controller.getUpdatedBreakpointViewData();\n assert.lengthOf(actualViewData.groups, 1);\n assert.lengthOf(actualViewData.groups[0].breakpointItems, 1);\n const breakpointItem = actualViewData.groups[0].breakpointItems[0];\n assert.strictEqual(breakpointItem.type, SDK.DebuggerModel.BreakpointType.CONDITIONAL_BREAKPOINT);\n assert.strictEqual(breakpointItem.hoverText, condition);\n });\n\n it('correctly extracts logpoints', async () => {\n const logExpression = 'x' as Breakpoints.BreakpointManager.UserCondition;\n const testData = [\n createLocationTestData(\n TEST_JS_FILE, 3, 15, true /* enabled */, '', logExpression, true /* isLogpoint */, logExpression),\n ];\n\n const {breakpointManager, settings} = createStubBreakpointManagerAndSettingsWithMockdata(testData);\n const controller = SourcesComponents.BreakpointsView.BreakpointsSidebarController.instance(\n {forceNew: true, breakpointManager, settings});\n const actualViewData = await controller.getUpdatedBreakpointViewData();\n assert.lengthOf(actualViewData.groups, 1);\n assert.lengthOf(actualViewData.groups[0].breakpointItems, 1);\n const breakpointItem = actualViewData.groups[0].breakpointItems[0];\n assert.strictEqual(breakpointItem.type, SDK.DebuggerModel.BreakpointType.LOGPOINT);\n assert.strictEqual(breakpointItem.hoverText, logExpression);\n });\n\n describe('breakpoint groups', () => {\n it('are expanded by default', async () => {\n const {controller} = await setUpTestWithOneBreakpointLocation();\n const actualViewData = await controller.getUpdatedBreakpointViewData();\n assert.isTrue(actualViewData.groups[0].expanded);\n });\n\n it('are collapsed if user collapses it', async () => {\n const {controller, groups} = await setUpTestWithOneBreakpointLocation();\n controller.expandedStateChanged(groups[0].url, false /* expanded */);\n const actualViewData = await controller.getUpdatedBreakpointViewData();\n assert.isFalse(actualViewData.groups[0].expanded);\n });\n\n it('are expanded if user expands it', async () => {\n const {controller, groups} = await setUpTestWithOneBreakpointLocation();\n controller.expandedStateChanged(groups[0].url, true /* expanded */);\n const actualViewData = await controller.getUpdatedBreakpointViewData();\n assert.isTrue(actualViewData.groups[0].expanded);\n });\n\n it('remember the collapsed state', async () => {\n {\n const {controller, groups} = await setUpTestWithOneBreakpointLocation();\n controller.expandedStateChanged(groups[0].url, false /* expanded */);\n const actualViewData = await controller.getUpdatedBreakpointViewData();\n assert.isFalse(actualViewData.groups[0].expanded);\n }\n\n // A new controller is created and initialized with the expanded settings.\n {const breakpointManager = Breakpoints.BreakpointManager.BreakpointManager.instance();\n const settings = Common.Settings.Settings.instance();\n const controller = SourcesComponents.BreakpointsView.BreakpointsSidebarController.instance({\n forceNew: true,\n breakpointManager,\n settings,\n });\n const actualViewData = await controller.getUpdatedBreakpointViewData();\n assert.isFalse(actualViewData.groups[0].expanded);}\n });\n\n it('remember the expanded state', async () => {\n {\n const {controller, groups} = await setUpTestWithOneBreakpointLocation();\n controller.expandedStateChanged(groups[0].url, true /* expanded */);\n const actualViewData = await controller.getUpdatedBreakpointViewData();\n assert.isTrue(actualViewData.groups[0].expanded);\n }\n // A new controller is created and initialized with the expanded settings.\n {\n\n const controller = SourcesComponents.BreakpointsView.BreakpointsSidebarController.instance({\n forceNew: true,\n breakpointManager: Breakpoints.BreakpointManager.BreakpointManager.instance(),\n settings: Common.Settings.Settings.instance(),\n });\n const actualViewData = await controller.getUpdatedBreakpointViewData();\n assert.isTrue(actualViewData.groups[0].expanded);\n\n }\n });\n });\n });\n});\n\ndescribeWithMockConnection('BreakpointsSidebarController', () => {\n beforeEach(() => {\n const workspace = Workspace.Workspace.WorkspaceImpl.instance();\n const targetManager = SDK.TargetManager.TargetManager.instance();\n const resourceMapping = new Bindings.ResourceMapping.ResourceMapping(targetManager, workspace);\n const debuggerWorkspaceBinding = Bindings.DebuggerWorkspaceBinding.DebuggerWorkspaceBinding.instance({\n forceNew: true,\n resourceMapping,\n targetManager,\n });\n Breakpoints.BreakpointManager.BreakpointManager.instance(\n {forceNew: true, targetManager, workspace, debuggerWorkspaceBinding});\n });\n\n const DEFAULT_BREAKPOINT:\n [Breakpoints.BreakpointManager.UserCondition, boolean, boolean, Breakpoints.BreakpointManager.BreakpointOrigin] =\n [\n Breakpoints.BreakpointManager.EMPTY_BREAKPOINT_CONDITION,\n true, // enabled\n false, // isLogpoint\n Breakpoints.BreakpointManager.BreakpointOrigin.USER_ACTION,\n ];\n\n // Flaky\n it.skip('[crbug.com/345456307] auto-expands if a user adds a new breakpoint', async () => {\n const breakpointManager = Breakpoints.BreakpointManager.BreakpointManager.instance();\n const settings = Common.Settings.Settings.instance();\n const {uiSourceCode, project} = createContentProviderUISourceCode(\n {url: 'test.js' as Platform.DevToolsPath.UrlString, mimeType: 'text/javascript'});\n const controller = SourcesComponents.BreakpointsView.BreakpointsSidebarController.instance(\n {forceNew: true, breakpointManager, settings});\n\n // Add one breakpoint and collapse the tree.\n const b1 = await breakpointManager.setBreakpoint(uiSourceCode, 0, 0, ...DEFAULT_BREAKPOINT);\n assert.exists(b1);\n {\n controller.expandedStateChanged(uiSourceCode.url(), false /* expanded */);\n const data = await controller.getUpdatedBreakpointViewData();\n assert.lengthOf(data.groups, 1);\n assert.lengthOf(data.groups[0].breakpointItems, 1);\n assert.isFalse(data.groups[0].expanded);\n }\n\n // Add a new breakpoint and check if it's expanded as expected.\n const b2 = await breakpointManager.setBreakpoint(uiSourceCode, 0, 3, ...DEFAULT_BREAKPOINT);\n assert.exists(b2);\n {\n const data = await controller.getUpdatedBreakpointViewData();\n assert.lengthOf(data.groups, 1);\n assert.lengthOf(data.groups[0].breakpointItems, 2);\n assert.isTrue(data.groups[0].expanded);\n }\n\n // Clean up.\n await b1.remove(false /* keepInStorage */);\n await b2.remove(false /* keepInStorage */);\n Workspace.Workspace.WorkspaceImpl.instance().removeProject(project);\n });\n\n it('does not auto-expand if a breakpoint was not triggered by user action', async () => {\n const breakpointManager = Breakpoints.BreakpointManager.BreakpointManager.instance();\n const settings = Common.Settings.Settings.instance();\n const {uiSourceCode, project} = createContentProviderUISourceCode(\n {url: 'test.js' as Platform.DevToolsPath.UrlString, mimeType: 'text/javascript'});\n const controller = SourcesComponents.BreakpointsView.BreakpointsSidebarController.instance(\n {forceNew: true, breakpointManager, settings});\n\n // Add one breakpoint and collapse the tree.\n const b1 = await breakpointManager.setBreakpoint(uiSourceCode, 0, 0, ...DEFAULT_BREAKPOINT);\n assert.exists(b1);\n {\n controller.expandedStateChanged(uiSourceCode.url(), false /* expanded */);\n const data = await controller.getUpdatedBreakpointViewData();\n assert.lengthOf(data.groups, 1);\n assert.lengthOf(data.groups[0].breakpointItems, 1);\n assert.isFalse(data.groups[0].expanded);\n }\n\n // Add a new non-user triggered breakpoint and check if it's still collapsed.\n const b2 = await breakpointManager.setBreakpoint(\n uiSourceCode, 0, 3, Breakpoints.BreakpointManager.EMPTY_BREAKPOINT_CONDITION, true, false,\n Breakpoints.BreakpointManager.BreakpointOrigin.OTHER);\n assert.exists(b2);\n {\n const data = await controller.getUpdatedBreakpointViewData();\n assert.lengthOf(data.groups, 1);\n assert.lengthOf(data.groups[0].breakpointItems, 2);\n assert.isFalse(data.groups[0].expanded);\n }\n\n // Clean up.\n await b1.remove(false /* keepInStorage */);\n await b2.remove(false /* keepInStorage */);\n Workspace.Workspace.WorkspaceImpl.instance().removeProject(project);\n });\n\n it('auto-expands if a breakpoint was hit', async () => {\n sinon.stub(\n Common.Revealer.RevealerRegistry.instance(),\n 'reveal'); // Prevent pending reveal promises after tests are done.\n\n const breakpointManager = Breakpoints.BreakpointManager.BreakpointManager.instance();\n\n // Set up sdk and ui location, and a mapping between them, such that we can identify that\n // the hit breakpoint is the one we are adding.\n const scriptId = '0' as Protocol.Runtime.ScriptId;\n\n const {uiSourceCode, project} = createContentProviderUISourceCode(\n {url: 'test.js' as Platform.DevToolsPath.UrlString, mimeType: 'text/javascript'});\n const uiLocation = new Workspace.UISourceCode.UILocation(uiSourceCode, 0, 0);\n\n const debuggerModel = sinon.createStubInstance(SDK.DebuggerModel.DebuggerModel);\n const sdkLocation = new SDK.DebuggerModel.Location(debuggerModel, scriptId, 0);\n\n const mapping = createFakeScriptMapping(debuggerModel, uiSourceCode, 0, scriptId);\n Bindings.DebuggerWorkspaceBinding.DebuggerWorkspaceBinding.instance().addSourceMapping(mapping);\n\n // Add one breakpoint and collapse its group.\n const b1 = await breakpointManager.setBreakpoint(\n uiSourceCode, uiLocation.lineNumber, uiLocation.columnNumber, ...DEFAULT_BREAKPOINT);\n const controller = SourcesComponents.BreakpointsView.BreakpointsSidebarController.instance(\n {forceNew: true, breakpointManager, settings: Common.Settings.Settings.instance()});\n assert.exists(b1);\n controller.expandedStateChanged(uiSourceCode.url(), false /* expanded */);\n\n // Double check that the group is collapsed.\n {\n const data = await controller.getUpdatedBreakpointViewData();\n assert.isFalse(data.groups[0].expanded);\n }\n\n // Simulating a breakpoint hit. Update the DebuggerPausedDetails to contain the info on the hit breakpoint.\n const callFrame = sinon.createStubInstance(SDK.DebuggerModel.CallFrame);\n callFrame.location.returns(new SDK.DebuggerModel.Location(debuggerModel, scriptId, sdkLocation.lineNumber));\n const pausedDetails = sinon.createStubInstance(SDK.DebuggerModel.DebuggerPausedDetails);\n pausedDetails.callFrames = [callFrame];\n\n // Instead of setting the flavor, directly call `flavorChanged` on the controller and mock what it's set to.\n // Setting the flavor would have other listeners listening to it, and would cause undesirable side effects.\n sinon.stub(UI.Context.Context.instance(), 'flavor')\n .callsFake(flavorType => flavorType === SDK.DebuggerModel.DebuggerPausedDetails ? pausedDetails : null);\n controller.flavorChanged(pausedDetails);\n {\n const data = await controller.getUpdatedBreakpointViewData();\n // Assert that the breakpoint is hit and the group is expanded.\n assert.isTrue(data.groups[0].breakpointItems[0].isHit);\n assert.isTrue(data.groups[0].expanded);\n }\n\n // Clean up.\n await b1.remove(false /* keepInStorage */);\n Workspace.Workspace.WorkspaceImpl.instance().removeProject(project);\n Bindings.DebuggerWorkspaceBinding.DebuggerWorkspaceBinding.instance().removeSourceMapping(mapping);\n });\n\n it('changes pause on exception state', async () => {\n const {breakpointManager, settings} = createStubBreakpointManagerAndSettings();\n breakpointManager.allBreakpointLocations.returns([]);\n const controller = SourcesComponents.BreakpointsView.BreakpointsSidebarController.instance(\n {forceNew: true, breakpointManager, settings});\n for (const pauseOnUncaughtExceptions of [true, false]) {\n for (const pauseOnCaughtExceptions of [true, false]) {\n controller.setPauseOnUncaughtExceptions(pauseOnUncaughtExceptions);\n controller.setPauseOnCaughtExceptions(pauseOnCaughtExceptions);\n\n const data = await controller.getUpdatedBreakpointViewData();\n assert.strictEqual(data.pauseOnUncaughtExceptions, pauseOnUncaughtExceptions);\n assert.strictEqual(data.pauseOnCaughtExceptions, pauseOnCaughtExceptions);\n assert.strictEqual(settings.moduleSetting('pause-on-uncaught-exception').get(), pauseOnUncaughtExceptions);\n assert.strictEqual(settings.moduleSetting('pause-on-caught-exception').get(), pauseOnCaughtExceptions);\n }\n }\n });\n});\n\ndescribeWithMockConnection('BreakpointsView', () => {\n beforeEach(() => {\n const workspace = Workspace.Workspace.WorkspaceImpl.instance();\n const targetManager = SDK.TargetManager.TargetManager.instance();\n const resourceMapping = new Bindings.ResourceMapping.ResourceMapping(targetManager, workspace);\n const debuggerWorkspaceBinding = Bindings.DebuggerWorkspaceBinding.DebuggerWorkspaceBinding.instance({\n forceNew: true,\n resourceMapping,\n targetManager,\n });\n Breakpoints.BreakpointManager.BreakpointManager.instance(\n {forceNew: true, targetManager, workspace, debuggerWorkspaceBinding});\n });\n\n it('correctly expands breakpoint groups', async () => {\n const {component, data} = await renderMultipleBreakpoints();\n assert.isNotNull(component.shadowRoot);\n\n const expandedGroups = data.groups.filter(group => group.expanded);\n assert.isAbove(expandedGroups.length, 0);\n\n const renderedExpandedGroups = Array.from(component.shadowRoot.querySelectorAll(EXPANDED_GROUPS_SELECTOR));\n assert.lengthOf(renderedExpandedGroups, expandedGroups.length);\n\n checkGroupNames(renderedExpandedGroups, expandedGroups);\n });\n\n it('correctly collapses breakpoint groups', async () => {\n const {component, data} = await renderMultipleBreakpoints();\n assert.isNotNull(component.shadowRoot);\n\n const collapsedGroups = data.groups.filter(group => !group.expanded);\n assert.isAbove(collapsedGroups.length, 0);\n\n const renderedCollapsedGroups = Array.from(component.shadowRoot.querySelectorAll(COLLAPSED_GROUPS_SELECTOR));\n\n checkGroupNames(renderedCollapsedGroups, collapsedGroups);\n });\n\n it('renders the group names', async () => {\n const {component, data} = await renderMultipleBreakpoints();\n assert.isNotNull(component.shadowRoot);\n\n const renderedGroupNames = component.shadowRoot.querySelectorAll(GROUP_NAME_SELECTOR);\n assertElements(renderedGroupNames, HTMLSpanElement);\n\n const expectedNames = data.groups.flatMap(group => group.name);\n const actualNames = [];\n for (const renderedGroupName of renderedGroupNames.values()) {\n actualNames.push(renderedGroupName.textContent);\n }\n assert.deepEqual(actualNames, expectedNames);\n });\n\n it('renders the breakpoints with their checkboxes', async () => {\n const {component, data} = await renderMultipleBreakpoints();\n assert.isNotNull(component.shadowRoot);\n\n const renderedBreakpointItems = Array.from(component.shadowRoot.querySelectorAll(BREAKPOINT_ITEM_SELECTOR));\n\n const breakpointItems = extractBreakpointItems(data);\n assert.lengthOf(renderedBreakpointItems, breakpointItems.length);\n\n for (let i = 0; i < renderedBreakpointItems.length; ++i) {\n const renderedItem = renderedBreakpointItems[i];\n assert.instanceOf(renderedItem, HTMLDivElement);\n\n const inputElement = renderedItem.querySelector('input');\n assert.instanceOf(inputElement, HTMLInputElement);\n checkCheckboxState(inputElement, breakpointItems[i]);\n }\n });\n\n it('renders breakpoints with their code snippet', async () => {\n const {component, data} = await renderMultipleBreakpoints();\n assert.isNotNull(component.shadowRoot);\n\n const renderedBreakpointItems = Array.from(component.shadowRoot.querySelectorAll(BREAKPOINT_ITEM_SELECTOR));\n\n const breakpointItems = extractBreakpointItems(data);\n assert.lengthOf(renderedBreakpointItems, breakpointItems.length);\n\n for (let i = 0; i < renderedBreakpointItems.length; ++i) {\n const renderedBreakpointItem = renderedBreakpointItems[i];\n assert.instanceOf(renderedBreakpointItem, HTMLDivElement);\n checkCodeSnippet(renderedBreakpointItem, breakpointItems[i]);\n }\n });\n\n it('renders breakpoint groups with a differentiator if the file names are not unique', async () => {\n const component = await createAndInitializeBreakpointsView();\n\n const groupTemplate = {\n name: 'index.js',\n url: '' as Platform.DevToolsPath.UrlString,\n editable: true,\n expanded: true,\n breakpointItems: [\n {\n id: '1',\n type: SDK.DebuggerModel.BreakpointType.REGULAR_BREAKPOINT,\n location: '234',\n codeSnippet: 'const a = x;',\n isHit: false,\n status: SourcesComponents.BreakpointsView.BreakpointStatus.ENABLED,\n },\n ],\n };\n\n // Create two groups with the same file name, but different url.\n const group1 = {...groupTemplate};\n group1.url = 'https://google.com/lib/index.js' as Platform.DevToolsPath.UrlString;\n\n const group2 = {...groupTemplate};\n group2.url = 'https://google.com/src/index.js' as Platform.DevToolsPath.UrlString;\n\n const data: SourcesComponents.BreakpointsView.BreakpointsViewData = {\n breakpointsActive: true,\n pauseOnUncaughtExceptions: false,\n pauseOnCaughtExceptions: false,\n independentPauseToggles: true,\n groups: [\n group1,\n group2,\n ],\n };\n component.data = data;\n await coordinator.done();\n\n assert.isNotNull(component.shadowRoot);\n const groupSummaries = Array.from(component.shadowRoot.querySelectorAll(SUMMARY_SELECTOR));\n const differentiatingPath = groupSummaries.map(group => {\n const differentiatorElement = group.querySelector(GROUP_DIFFERENTIATOR_SELECTOR);\n assert.instanceOf(differentiatorElement, HTMLSpanElement);\n return differentiatorElement.textContent;\n });\n assert.deepEqual(differentiatingPath, ['lib/', 'src/']);\n });\n\n it('renders breakpoints with a differentiating path', async () => {\n const {component, data} = await renderMultipleBreakpoints();\n assert.isNotNull(component.shadowRoot);\n\n const renderedBreakpointItems = Array.from(component.shadowRoot.querySelectorAll(BREAKPOINT_ITEM_SELECTOR));\n\n const breakpointItems = extractBreakpointItems(data);\n assert.lengthOf(renderedBreakpointItems, breakpointItems.length);\n\n for (let i = 0; i < renderedBreakpointItems.length; ++i) {\n const renderedBreakpointItem = renderedBreakpointItems[i];\n assert.instanceOf(renderedBreakpointItem, HTMLDivElement);\n\n const locationElement = renderedBreakpointItem.querySelector(BREAKPOINT_LOCATION_SELECTOR);\n assert.instanceOf(locationElement, HTMLSpanElement);\n\n const actualLocation = locationElement.textContent;\n const expectedLocation = breakpointItems[i].location;\n\n assert.strictEqual(actualLocation, expectedLocation);\n }\n });\n\n it('triggers an event on clicking the checkbox of a breakpoint', async () => {\n const {component, data} = await renderSingleBreakpoint();\n assert.isNotNull(component.shadowRoot);\n\n const renderedItem = component.shadowRoot.querySelector(BREAKPOINT_ITEM_SELECTOR);\n assert.instanceOf(renderedItem, HTMLDivElement);\n\n const checkbox = renderedItem.querySelector('input');\n assert.instanceOf(checkbox, HTMLInputElement);\n const checked = checkbox.checked;\n\n const controller = SourcesComponents.BreakpointsView.BreakpointsSidebarController.instance();\n const breakpointStateChanged = sinon.stub(controller, 'breakpointStateChanged');\n checkbox.click();\n\n assert.isTrue(breakpointStateChanged.calledOnceWith(data.groups[0].breakpointItems[0], !checked));\n });\n\n it('triggers an event on clicking on the snippet text', async () => {\n const {component, data} = await renderSingleBreakpoint();\n assert.isNotNull(component.shadowRoot);\n\n const snippet = component.shadowRoot.querySelector(CODE_SNIPPET_SELECTOR);\n assert.instanceOf(snippet, HTMLSpanElement);\n\n const controller = SourcesComponents.BreakpointsView.BreakpointsSidebarController.instance();\n const jumpToSource = sinon.stub(controller, 'jumpToSource');\n snippet.click();\n\n assert.isTrue(jumpToSource.calledOnceWith(data.groups[0].breakpointItems[0]));\n });\n\n it('triggers an event on expanding/unexpanding', async () => {\n const {component, data} = await renderSingleBreakpoint();\n assert.isNotNull(component.shadowRoot);\n\n const renderedGroupName = component.shadowRoot.querySelector(GROUP_NAME_SELECTOR);\n assert.instanceOf(renderedGroupName, HTMLSpanElement);\n\n const expandedInitialValue = data.groups[0].expanded;\n\n const controller = SourcesComponents.BreakpointsView.BreakpointsSidebarController.instance();\n const expandedStateChanged = sinon.stub(controller, 'expandedStateChanged');\n renderedGroupName.click();\n\n await new Promise(resolve => setTimeout(resolve, 0));\n const group = data.groups[0];\n assert.isTrue(expandedStateChanged.calledOnceWith(group.url, group.expanded));\n assert.notStrictEqual(group.expanded, expandedInitialValue);\n });\n\n it('highlights breakpoint if it is set to be hit', async () => {\n const {component} = await renderSingleBreakpoint();\n assert.isNotNull(component.shadowRoot);\n\n const renderedBreakpointItem = component.shadowRoot.querySelector(HIT_BREAKPOINT_SELECTOR);\n assert.instanceOf(renderedBreakpointItem, HTMLDivElement);\n });\n\n it('triggers an event on removing file breakpoints', async () => {\n const {component, data} = await renderMultipleBreakpoints();\n assert.isNotNull(component.shadowRoot);\n\n await hover(component, SUMMARY_SELECTOR);\n\n const removeFileBreakpointsButton = component.shadowRoot.querySelector(REMOVE_FILE_BREAKPOINTS_SELECTOR);\n assert.instanceOf(removeFileBreakpointsButton, HTMLButtonElement);\n\n const controller = SourcesComponents.BreakpointsView.BreakpointsSidebarController.instance();\n const breakpointsRemoved = sinon.stub(controller, 'breakpointsRemoved');\n removeFileBreakpointsButton.click();\n // await new Promise(resolve => setTimeout(resolve, 0));\n assert.isTrue(breakpointsRemoved.calledOnceWith(data.groups[0].breakpointItems));\n });\n\n it('triggers an event on removing one breakpoint', async () => {\n const {component, data} = await renderMultipleBreakpoints();\n assert.isNotNull(component.shadowRoot);\n\n await hover(component, BREAKPOINT_ITEM_SELECTOR);\n\n const removeFileBreakpointsButton = component.shadowRoot.querySelector(REMOVE_SINGLE_BREAKPOINT_SELECTOR);\n assert.instanceOf(removeFileBreakpointsButton, HTMLButtonElement);\n\n const controller = SourcesComponents.BreakpointsView.BreakpointsSidebarController.instance();\n const breakpointsRemoved = sinon.stub(controller, 'breakpointsRemoved');\n removeFileBreakpointsButton.click();\n // await new Promise(resolve => setTimeout(resolve, 0));\n assert.isTrue(breakpointsRemoved.calledOnce);\n assert.deepEqual(breakpointsRemoved.firstCall.firstArg, [data.groups[0].breakpointItems[0]]);\n });\n\n it('triggers an event on editing one breakpoint', async () => {\n const {component, data} = await renderMultipleBreakpoints();\n assert.isNotNull(component.shadowRoot);\n\n await hover(component, BREAKPOINT_ITEM_SELECTOR);\n\n const editBreakpointButton = component.shadowRoot.querySelector(EDIT_SINGLE_BREAKPOINT_SELECTOR);\n assert.instanceOf(editBreakpointButton, HTMLButtonElement);\n\n const controller = SourcesComponents.BreakpointsView.BreakpointsSidebarController.instance();\n const breakpointEdited = sinon.stub(controller, 'breakpointEdited');\n editBreakpointButton.click();\n // await new Promise(resolve => setTimeout(resolve, 0));\n assert.isTrue(breakpointEdited.calledOnceWith(data.groups[0].breakpointItems[0], true));\n });\n\n it('shows a tooltip with edit condition on regular breakpoints', async () => {\n const {component} = await renderSingleBreakpoint(SDK.DebuggerModel.BreakpointType.REGULAR_BREAKPOINT);\n assert.isNotNull(component.shadowRoot);\n\n await hover(component, BREAKPOINT_ITEM_SELECTOR);\n\n const editBreakpointButton = component.shadowRoot.querySelector(EDIT_SINGLE_BREAKPOINT_SELECTOR);\n assert.instanceOf(editBreakpointButton, HTMLButtonElement);\n\n assert.strictEqual(editBreakpointButton.title, 'Edit condition');\n });\n\n describe('group checkboxes', () => {\n async function waitForCheckboxToggledEventsWithCheckedUpdate(\n component: SourcesComponents.BreakpointsView.BreakpointsView, numBreakpointItems: number, checked: boolean) {\n return new Promise(resolve => {\n let numCheckboxToggledEvents = 0;\n const controller = SourcesComponents.BreakpointsView.BreakpointsSidebarController.instance();\n sinon.stub(controller, 'breakpointStateChanged').callsFake((_, checkedArg) => {\n assert.strictEqual(checkedArg, checked);\n ++numCheckboxToggledEvents;\n if (numCheckboxToggledEvents === numBreakpointItems) {\n resolve();\n }\n });\n });\n }\n it('show a checked group checkbox if at least one breakpoint in that group is enabled', async () => {\n const {component, data} = await renderMultipleBreakpoints();\n\n // Make sure that at least one breakpoint is enabled.\n data.groups[0].breakpointItems[0].status = SourcesComponents.BreakpointsView.BreakpointStatus.ENABLED;\n component.data = data;\n await coordinator.done();\n\n await hover(component, SUMMARY_SELECTOR);\n\n assert.isNotNull(component.shadowRoot);\n const firstGroupSummary = component.shadowRoot.querySelector(SUMMARY_SELECTOR);\n assert.exists(firstGroupSummary);\n const groupCheckbox = firstGroupSummary.querySelector('input');\n assert.instanceOf(groupCheckbox, HTMLInputElement);\n\n assert.isTrue(groupCheckbox.checked);\n });\n\n it('show an unchecked group checkbox if no breakpoint in that group is enabled', async () => {\n const {component, data} = await renderMultipleBreakpoints();\n\n // Make sure that all breakpoints are disabled.\n const breakpointItems = data.groups[0].breakpointItems;\n for (let i = 0; i < breakpointItems.length; ++i) {\n breakpointItems[i].status = SourcesComponents.BreakpointsView.BreakpointStatus.DISABLED;\n }\n\n component.data = data;\n await coordinator.done();\n\n await hover(component, SUMMARY_SELECTOR);\n\n assert.isNotNull(component.shadowRoot);\n const firstGroupSummary = component.shadowRoot.querySelector(SUMMARY_SELECTOR);\n assert.exists(firstGroupSummary);\n const groupCheckbox = firstGroupSummary.querySelector('input');\n assert.instanceOf(groupCheckbox, HTMLInputElement);\n\n assert.isFalse(groupCheckbox.checked);\n });\n\n it('disable all breakpoints on unchecking', async () => {\n const {component, data} = await renderMultipleBreakpoints();\n\n const numBreakpointItems = data.groups[0].breakpointItems.length;\n assert.isTrue(numBreakpointItems > 1);\n\n // Make sure that all breakpoints are enabled.\n for (let i = 0; i < numBreakpointItems; ++i) {\n data.groups[0].breakpointItems[i].status = SourcesComponents.BreakpointsView.BreakpointStatus.ENABLED;\n }\n component.data = data;\n await coordinator.done();\n\n await hover(component, SUMMARY_SELECTOR);\n\n // Uncheck the group checkbox.\n assert.isNotNull(component.shadowRoot);\n const firstGroupSummary = component.shadowRoot.querySelector(SUMMARY_SELECTOR);\n assert.exists(firstGroupSummary);\n const groupCheckbox = firstGroupSummary.querySelector('input');\n assert.instanceOf(groupCheckbox, HTMLInputElement);\n\n // Wait until we receive all events fired that notify us of disabled breakpoints.\n const waitForEventPromise = waitForCheckboxToggledEventsWithCheckedUpdate(component, numBreakpointItems, false);\n\n groupCheckbox.click();\n await waitForEventPromise;\n });\n\n it('enable all breakpoints on unchecking', async () => {\n const {component, data} = await renderMultipleBreakpoints();\n\n const numBreakpointItems = data.groups[0].breakpointItems.length;\n assert.isTrue(numBreakpointItems > 1);\n\n // Make sure that all breakpoints are disabled.\n for (let i = 0; i < numBreakpointItems; ++i) {\n data.groups[0].breakpointItems[i].status = SourcesComponents.BreakpointsView.BreakpointStatus.DISABLED;\n }\n component.data = data;\n await coordinator.done();\n\n await hover(component, SUMMARY_SELECTOR);\n\n // Uncheck the group checkbox.\n assert.isNotNull(component.shadowRoot);\n const firstGroupSummary = component.shadowRoot.querySelector(SUMMARY_SELECTOR);\n assert.exists(firstGroupSummary);\n const groupCheckbox = firstGroupSummary.querySelector('input');\n assert.instanceOf(groupCheckbox, HTMLInputElement);\n\n // Wait until we receive all events fired that notify us of enabled breakpoints.\n const waitForEventPromise = waitForCheckboxToggledEventsWithCheckedUpdate(component, numBreakpointItems, true);\n\n groupCheckbox.click();\n await waitForEventPromise;\n });\n });\n\n it('only renders edit button for breakpoints in editable groups', async () => {\n const component = await createAndInitializeBreakpointsView();\n\n const data: SourcesComponents.BreakpointsView.BreakpointsViewData = {\n breakpointsActive: true,\n pauseOnUncaughtExceptions: false,\n pauseOnCaughtExceptions: false,\n independentPauseToggles: true,\n groups: [\n {\n name: 'test1.js',\n url: 'https://google.com/test1.js' as Platform.DevToolsPath.UrlString,\n editable: false,\n expanded: true,\n breakpointItems: [\n {\n id: '1',\n location: '1',\n codeSnippet: 'const a = 0;',\n isHit: true,\n status: SourcesComponents.BreakpointsView.BreakpointStatus.ENABLED,\n type: SDK.DebuggerModel.BreakpointType.REGULAR_BREAKPOINT,\n },\n ],\n },\n ],\n };\n\n component.data = data;\n await coordinator.done();\n assert.isNotNull(component.shadowRoot);\n\n await hover(component, BREAKPOINT_ITEM_SELECTOR);\n\n const editBreakpointButton = component.shadowRoot.querySelector(EDIT_SINGLE_BREAKPOINT_SELECTOR);\n assert.isNull(editBreakpointButton);\n });\n\n it('initializes data from the controller on construction', async () => {\n await setUpTestWithOneBreakpointLocation();\n const component = await createAndInitializeBreakpointsView();\n const renderedGroupName = component.shadowRoot?.querySelector(GROUP_NAME_SELECTOR);\n assert.strictEqual(renderedGroupName?.textContent, HELLO_JS_FILE);\n });\n\n describe('conditional breakpoints', () => {\n const breakpointDetails = 'x < a';\n\n it('are rendered', async () => {\n const {component} =\n await renderSingleBreakpoint(SDK.DebuggerModel.BreakpointType.CONDITIONAL_BREAKPOINT, breakpointDetails);\n const breakpointItem = component.shadowRoot?.querySelector(BREAKPOINT_ITEM_SELECTOR);\n assert.exists(breakpointItem);\n assert.instanceOf(breakpointItem, HTMLDivElement);\n assert.isTrue(breakpointItem.classList.contains('conditional-breakpoint'));\n });\n\n it('show a tooltip', async () => {\n const {component} =\n await renderSingleBreakpoint(SDK.DebuggerModel.BreakpointType.CONDITIONAL_BREAKPOINT, breakpointDetails);\n const codeSnippet = component.shadowRoot?.querySelector(CODE_SNIPPET_SELECTOR);\n assert.exists(codeSnippet);\n assert.instanceOf(codeSnippet, HTMLSpanElement);\n assert.strictEqual(codeSnippet.title, `Condition: ${breakpointDetails}`);\n });\n\n it('show a tooltip on editing the condition', async () => {\n const {component} =\n await renderSingleBreakpoint(SDK.DebuggerModel.BreakpointType.CONDITIONAL_BREAKPOINT, breakpointDetails);\n assert.isNotNull(component.shadowRoot);\n\n await hover(component, BREAKPOINT_ITEM_SELECTOR);\n\n const editBreakpointButton = component.shadowRoot.querySelector(EDIT_SINGLE_BREAKPOINT_SELECTOR);\n assert.instanceOf(editBreakpointButton, HTMLButtonElement);\n\n assert.strictEqual(editBreakpointButton.title, 'Edit condition');\n });\n });\n\n describe('logpoints', () => {\n const breakpointDetails = 'x, a';\n\n it('are rendered', async () => {\n const {component} = await renderSingleBreakpoint(SDK.DebuggerModel.BreakpointType.LOGPOINT, breakpointDetails);\n const breakpointItem = component.shadowRoot?.querySelector(BREAKPOINT_ITEM_SELECTOR);\n assert.exists(breakpointItem);\n assert.instanceOf(breakpointItem, HTMLDivElement);\n assert.isTrue(breakpointItem.classList.contains('logpoint'));\n });\n\n it('show a tooltip', async () => {\n const {component} = await renderSingleBreakpoint(SDK.DebuggerModel.BreakpointType.LOGPOINT, breakpointDetails);\n const codeSnippet = component.shadowRoot?.querySelector(CODE_SNIPPET_SELECTOR);\n assert.exists(codeSnippet);\n assert.instanceOf(codeSnippet, HTMLSpanElement);\n assert.strictEqual(codeSnippet.title, `Logpoint: ${breakpointDetails}`);\n });\n\n it('show a tooltip on editing the logpoint', async () => {\n const {component} = await renderSingleBreakpoint(SDK.DebuggerModel.BreakpointType.LOGPOINT, breakpointDetails);\n assert.isNotNull(component.shadowRoot);\n\n await hover(component, BREAKPOINT_ITEM_SELECTOR);\n\n const editBreakpointButton = component.shadowRoot.querySelector(EDIT_SINGLE_BREAKPOINT_SELECTOR);\n assert.instanceOf(editBreakpointButton, HTMLButtonElement);\n\n assert.strictEqual(editBreakpointButton.title, 'Edit logpoint');\n });\n });\n\n describe('pause on exceptions', () => {\n it('state is rendered correctly when disabled', async () => {\n const component = await renderNoBreakpoints(\n {pauseOnUncaughtExceptions: false, pauseOnCaughtExceptions: false, independentPauseToggles: true});\n assert.isNotNull(component.shadowRoot);\n\n const pauseOnUncaughtExceptionsItem = component.shadowRoot.querySelector(PAUSE_ON_UNCAUGHT_EXCEPTIONS_SELECTOR);\n assert.exists(pauseOnUncaughtExceptionsItem);\n\n const pauseOnUncaughtExceptionsCheckbox = pauseOnUncaughtExceptionsItem.querySelector('input');\n assert.instanceOf(pauseOnUncaughtExceptionsCheckbox, HTMLInputElement);\n assert.isFalse(pauseOnUncaughtExceptionsCheckbox.checked);\n\n const pauseOnCaughtExceptionsItem = component.shadowRoot?.querySelector(PAUSE_ON_CAUGHT_EXCEPTIONS_SELECTOR);\n assert.exists(pauseOnCaughtExceptionsItem);\n\n const pauseOnCaughtExceptionsCheckbox = pauseOnUncaughtExceptionsItem.querySelector('input');\n assert.instanceOf(pauseOnCaughtExceptionsCheckbox, HTMLInputElement);\n assert.isFalse(pauseOnCaughtExceptionsCheckbox.checked);\n });\n\n it('state is rendered correctly when pausing on uncaught exceptions', async () => {\n const component = await renderNoBreakpoints(\n {pauseOnUncaughtExceptions: true, pauseOnCaughtExceptions: false, independentPauseToggles: true});\n assert.isNotNull(component.shadowRoot);\n\n const pauseOnUncaughtExceptionsItem = component.shadowRoot.querySelector(PAUSE_ON_UNCAUGHT_EXCEPTIONS_SELECTOR);\n assert.exists(pauseOnUncaughtExceptionsItem);\n\n const pauseOnUncaughtExceptionsCheckbox = pauseOnUncaughtExceptionsItem.querySelector('input');\n assert.exists(pauseOnUncaughtExceptionsCheckbox);\n assert.instanceOf(pauseOnUncaughtExceptionsCheckbox, HTMLInputElement);\n assert.isTrue(pauseOnUncaughtExceptionsCheckbox.checked);\n\n const pauseOnCaughtExceptionsItem = component.shadowRoot?.querySelector(PAUSE_ON_CAUGHT_EXCEPTIONS_SELECTOR);\n assert.exists(pauseOnCaughtExceptionsItem);\n\n const pauseOnCaughtExceptionsCheckbox = pauseOnCaughtExceptionsItem.querySelector('input');\n assert.exists(pauseOnCaughtExceptionsCheckbox);\n assert.instanceOf(pauseOnCaughtExceptionsCheckbox, HTMLInputElement);\n assert.isFalse(pauseOnCaughtExceptionsCheckbox.checked);\n });\n\n it('state is rendered correctly when pausing on all exceptions', async () => {\n const component = await renderNoBreakpoints(\n {pauseOnUncaughtExceptions: true, pauseOnCaughtExceptions: true, independentPauseToggles: true});\n assert.isNotNull(component.shadowRoot);\n\n const pauseOnUncaughtExceptionsItem = component.shadowRoot.querySelector(PAUSE_ON_UNCAUGHT_EXCEPTIONS_SELECTOR);\n assert.exists(pauseOnUncaughtExceptionsItem);\n\n const pauseOnUncaughtExceptionsCheckbox = pauseOnUncaughtExceptionsItem.querySelector('input');\n assert.exists(pauseOnUncaughtExceptionsCheckbox);\n assert.instanceOf(pauseOnUncaughtExceptionsCheckbox, HTMLInputElement);\n assert.isTrue(pauseOnUncaughtExceptionsCheckbox.checked);\n\n const pauseOnCaughtExceptionsItem = component.shadowRoot?.querySelector(PAUSE_ON_CAUGHT_EXCEPTIONS_SELECTOR);\n assert.exists(pauseOnCaughtExceptionsItem);\n\n const pauseOnCaughtExceptionsCheckbox = pauseOnCaughtExceptionsItem.querySelector('input');\n assert.exists(pauseOnCaughtExceptionsCheckbox);\n assert.instanceOf(pauseOnCaughtExceptionsCheckbox, HTMLInputElement);\n assert.isTrue(pauseOnCaughtExceptionsCheckbox.checked);\n });\n\n it('state is rendered correctly when toggles are dependent and only pausing on uncaught exceptions', async () => {\n const component = await renderNoBreakpoints(\n {pauseOnUncaughtExceptions: true, pauseOnCaughtExceptions: false, independentPauseToggles: false});\n assert.isNotNull(component.shadowRoot);\n\n const pauseOnUncaughtExceptionsItem = component.shadowRoot.querySelector(PAUSE_ON_UNCAUGHT_EXCEPTIONS_SELECTOR);\n assert.exists(pauseOnUncaughtExceptionsItem);\n\n const pauseOnUncaughtExceptionsCheckbox = pauseOnUncaughtExceptionsItem.querySelector('input');\n assert.exists(pauseOnUncaughtExceptionsCheckbox);\n assert.instanceOf(pauseOnUncaughtExceptionsCheckbox, HTMLInputElement);\n assert.isTrue(pauseOnUncaughtExceptionsCheckbox.checked);\n\n const pauseOnCaughtExceptionsItem = component.shadowRoot?.querySelector(PAUSE_ON_CAUGHT_EXCEPTIONS_SELECTOR);\n assert.exists(pauseOnCaughtExceptionsItem);\n\n const pauseOnCaughtExceptionsCheckbox = pauseOnCaughtExceptionsItem.querySelector('input');\n assert.instanceOf(pauseOnCaughtExceptionsCheckbox, HTMLInputElement);\n assert.isFalse(pauseOnCaughtExceptionsCheckbox.disabled);\n });\n\n it('state is rendered correctly when toggles are dependent and not pausing on uncaught exceptions', async () => {\n const component = await renderNoBreakpoints(\n {pauseOnUncaughtExceptions: false, pauseOnCaughtExceptions: false, independentPauseToggles: false});\n assert.isNotNull(component.shadowRoot);\n\n const pauseOnUncaughtExceptionsItem = component.shadowRoot.querySelector(PAUSE_ON_UNCAUGHT_EXCEPTIONS_SELECTOR);\n assert.exists(pauseOnUncaughtExceptionsItem);\n\n const pauseOnUncaughtExceptionsCheckbox = pauseOnUncaughtExceptionsItem.querySelector('input');\n assert.exists(pauseOnUncaughtExceptionsCheckbox);\n assert.instanceOf(pauseOnUncaughtExceptionsCheckbox, HTMLInputElement);\n assert.isFalse(pauseOnUncaughtExceptionsCheckbox.checked);\n\n const pauseOnCaughtExceptionsItem = component.shadowRoot?.querySelector(PAUSE_ON_CAUGHT_EXCEPTIONS_SELECTOR);\n assert.exists(pauseOnCaughtExceptionsItem);\n\n const pauseOnCaughtExceptionsCheckbox = pauseOnCaughtExceptionsItem.querySelector('input');\n assert.instanceOf(pauseOnCaughtExceptionsCheckbox, HTMLInputElement);\n assert.isTrue(pauseOnCaughtExceptionsCheckbox.disabled);\n });\n\n it('state is rendered correctly when toggles are dependent and pausing on uncaught exceptions is unchecked',\n async () => {\n const component = await renderNoBreakpoints(\n {pauseOnUncaughtExceptions: true, pauseOnCaughtExceptions: true, independentPauseToggles: false});\n assert.isNotNull(component.shadowRoot);\n\n const pauseOnUncaughtExceptionsItem =\n component.shadowRoot.querySelector(PAUSE_ON_UNCAUGHT_EXCEPTIONS_SELECTOR);\n assert.instanceOf(pauseOnUncaughtExceptionsItem, HTMLDivElement);\n\n {\n // Click on the pause on exceptions checkbox to uncheck.\n const pauseOnUncaughtExceptionsCheckbox = pauseOnUncaughtExceptionsItem.querySelector('input');\n assert.instanceOf(pauseOnUncaughtExceptionsCheckbox, HTMLInputElement);\n dispatchClickEvent(pauseOnUncaughtExceptionsCheckbox);\n await coordinator.done();\n }\n {\n // Check that clicking on it actually unchecked.\n const pauseOnUncaughtExceptionsCheckbox = pauseOnUncaughtExceptionsItem.querySelector('input');\n assert.instanceOf(pauseOnUncaughtExceptionsCheckbox, HTMLInputElement);\n assert.isFalse(pauseOnUncaughtExceptionsCheckbox.checked);\n }\n\n // Check if the pause on caught exception checkbox is unchecked and disabled as a result.\n const pauseOnCaughtExceptionsItem = component.shadowRoot?.querySelector(PAUSE_ON_CAUGHT_EXCEPTIONS_SELECTOR);\n assert.exists(pauseOnCaughtExceptionsItem);\n\n const pauseOnCaughtExceptionsCheckbox = pauseOnCaughtExceptionsItem.querySelector('input');\n assert.instanceOf(pauseOnCaughtExceptionsCheckbox, HTMLInputElement);\n assert.isTrue(pauseOnCaughtExceptionsCheckbox.disabled);\n assert.isFalse(pauseOnCaughtExceptionsCheckbox.checked);\n });\n\n it('triggers an event when disabling pausing on all exceptions', async () => {\n const component = await renderNoBreakpoints(\n {pauseOnUncaughtExceptions: true, pauseOnCaughtExceptions: false, independentPauseToggles: true});\n assert.isNotNull(component.shadowRoot);\n\n const item = component.shadowRoot.querySelector(PAUSE_ON_UNCAUGHT_EXCEPTIONS_SELECTOR);\n assert.exists(item);\n\n const checkbox = item.querySelector('input');\n assert.instanceOf(checkbox, HTMLInputElement);\n const {checked} = checkbox;\n\n const controller = SourcesComponents.BreakpointsView.BreakpointsSidebarController.instance();\n const setPauseOnUncaughtExceptions = sinon.stub(controller, 'setPauseOnUncaughtExceptions');\n\n checkbox.click();\n\n assert.isTrue(setPauseOnUncaughtExceptions.calledOnceWith(!checked));\n });\n\n it('triggers an event when enabling pausing on caught exceptions', async () => {\n const component = await renderNoBreakpoints(\n {pauseOnUncaughtExceptions: true, pauseOnCaughtExceptions: false, independentPauseToggles: true});\n assert.isNotNull(component.shadowRoot);\n\n const item = component.shadowRoot.querySelector(PAUSE_ON_CAUGHT_EXCEPTIONS_SELECTOR);\n assert.exists(item);\n\n const checkbox = item.querySelector('input');\n assert.instanceOf(checkbox, HTMLInputElement);\n const {checked} = checkbox;\n\n const controller = SourcesComponents.BreakpointsView.BreakpointsSidebarController.instance();\n const setPauseOnCaughtExceptions = sinon.stub(controller, 'setPauseOnCaughtExceptions');\n\n checkbox.click();\n\n assert.isTrue(setPauseOnCaughtExceptions.calledOnceWith(!checked));\n });\n\n it('triggers an event when enabling pausing on uncaught exceptions', async () => {\n const component = await renderNoBreakpoints(\n {pauseOnUncaughtExceptions: false, pauseOnCaughtExceptions: true, independentPauseToggles: true});\n assert.isNotNull(component.shadowRoot);\n\n const item = component.shadowRoot.querySelector(PAUSE_ON_UNCAUGHT_EXCEPTIONS_SELECTOR);\n assert.exists(item);\n\n const checkbox = item.querySelector('input');\n assert.instanceOf(checkbox, HTMLInputElement);\n const {checked} = checkbox;\n\n const controller = SourcesComponents.BreakpointsView.BreakpointsSidebarController.instance();\n const setPauseOnUncaughtExceptions = sinon.stub(controller, 'setPauseOnUncaughtExceptions');\n\n checkbox.click();\n\n assert.isTrue(setPauseOnUncaughtExceptions.calledOnceWith(!checked));\n });\n });\n\n describe('navigating with keyboard', () => {\n // One expanded group with 2 breakpoints, and one collapsed with 2 breakpoints.\n async function renderBreakpointsForKeyboardNavigation(): Promise<{\n component: SourcesComponents.BreakpointsView.BreakpointsView,\n data: SourcesComponents.BreakpointsView.BreakpointsViewData,\n }> {\n const component = await createAndInitializeBreakpointsView();\n\n const data: SourcesComponents.BreakpointsView.BreakpointsViewData = {\n breakpointsActive: true,\n pauseOnUncaughtExceptions: false,\n pauseOnCaughtExceptions: false,\n independentPauseToggles: true,\n groups: [\n {\n name: 'test1.js',\n url: 'https://google.com/test1.js' as Platform.DevToolsPath.UrlString,\n editable: false,\n expanded: true,\n breakpointItems: [\n {\n id: '1',\n type: SDK.DebuggerModel.BreakpointType.REGULAR_BREAKPOINT,\n location: '234',\n codeSnippet: 'const a = x;',\n isHit: false,\n status: SourcesComponents.BreakpointsView.BreakpointStatus.ENABLED,\n },\n {\n id: '2',\n type: SDK.DebuggerModel.BreakpointType.REGULAR_BREAKPOINT,\n location: '3:3',\n codeSnippet: 'if (x > a) {',\n isHit: true,\n status: SourcesComponents.BreakpointsView.BreakpointStatus.DISABLED,\n },\n ],\n },\n {\n name: 'test2.js',\n url: 'https://google.com/test2.js' as Platform.DevToolsPath.UrlString,\n editable: false,\n expanded: false,\n breakpointItems: [\n {\n id: '3',\n type: SDK.DebuggerModel.BreakpointType.REGULAR_BREAKPOINT,\n location: '11',\n codeSnippet: 'const y;',\n isHit: false,\n status: SourcesComponents.BreakpointsView.BreakpointStatus.ENABLED,\n },\n {\n id: '4',\n type: SDK.DebuggerModel.BreakpointType.REGULAR_BREAKPOINT,\n location: '12',\n codeSnippet: 'const y;',\n isHit: false,\n status: SourcesComponents.BreakpointsView.BreakpointStatus.ENABLED,\n },\n ],\n },\n ],\n };\n component.data = data;\n await coordinator.done();\n return {component, data};\n }\n\n it('pause on exceptions is tabbable', async () => {\n const component = await renderNoBreakpoints(\n {pauseOnUncaughtExceptions: true, pauseOnCaughtExceptions: false, independentPauseToggles: true});\n assert.isNotNull(component.shadowRoot);\n\n const focusableElements = component.shadowRoot.querySelectorAll(TABBABLE_SELECTOR);\n assert.lengthOf(focusableElements, 1);\n\n const pauseOnUncaughtExceptions = component.shadowRoot.querySelector(PAUSE_ON_UNCAUGHT_EXCEPTIONS_SELECTOR);\n assert.deepEqual(focusableElements[0], pauseOnUncaughtExceptions);\n });\n\n describe('pressing the HOME key', () => {\n it('takes the user to the pause-on-exceptions line', async () => {\n const {component} = await renderBreakpointsForKeyboardNavigation();\n assert.isNotNull(component.shadowRoot);\n const secondGroupsSummary =\n component.shadowRoot.querySelector(`${DETAILS_SELECTOR}:nth-of-type(2) > ${SUMMARY_SELECTOR}`);\n assert.instanceOf(secondGroupsSummary, HTMLElement);\n\n // Focus on second group by clicking on it, then press Home button.\n dispatchClickEvent(secondGroupsSummary);\n dispatchKeyDownEvent(secondGroupsSummary, {key: 'Home', bubbles: true});\n await coordinator.done();\n\n const selected = component.shadowRoot.querySelector(TABBABLE_SELECTOR);\n assert.instanceOf(selected, HTMLElement);\n const pauseOnUncaughtExceptions = component.shadowRoot.querySelector(PAUSE_ON_UNCAUGHT_EXCEPTIONS_SELECTOR);\n assert.instanceOf(pauseOnUncaughtExceptions, HTMLElement);\n assert.strictEqual(selected, pauseOnUncaughtExceptions);\n });\n });\n\n describe('pressing the END key', () => {\n it('takes the user to the summary node of the last group (if last group is collapsed)', async () => {\n const {component} = await renderBreakpointsForKeyboardNavigation();\n assert.isNotNull(component.shadowRoot);\n const pauseOnUncaughtExceptions = component.shadowRoot.querySelector(PAUSE_ON_UNCAUGHT_EXCEPTIONS_SELECTOR);\n assert.instanceOf(pauseOnUncaughtExceptions, HTMLElement);\n\n // Focus on the pause-on-exceptions line by clicking on it, then press End key.\n dispatchClickEvent(pauseOnUncaughtExceptions);\n dispatchKeyDownEvent(pauseOnUncaughtExceptions, {key: 'End', bubbles: true});\n await coordinator.done();\n\n const selected = component.shadowRoot.querySelector(TABBABLE_SELECTOR);\n assert.instanceOf(selected, HTMLElement);\n\n const lastGroupSummary =\n component.shadowRoot.querySelector(`${DETAILS_SELECTOR}:nth-of-type(2) > ${SUMMARY_SELECTOR}`);\n assert.instanceOf(lastGroupSummary, HTMLElement);\n assert.strictEqual(selected, lastGroupSummary);\n });\n\n it('takes the user to the last breakpoint item (if last group is expanded))', async () => {\n const {component, data} = await renderBreakpointsForKeyboardNavigation();\n // Expand the last group.\n data.groups[1].expanded = true;\n component.data = data;\n await coordinator.done();\n\n assert.isNotNull(component.shadowRoot);\n const firstGroupSummary = component.shadowRoot.querySelector(SUMMARY_SELECTOR);\n assert.instanceOf(firstGroupSummary, HTMLElement);\n\n // First focus on the first group by clicking on it, then press the End button.\n dispatchClickEvent(firstGroupSummary);\n dispatchKeyDownEvent(firstGroupSummary, {key: 'End', bubbles: true});\n await coordinator.done();\n\n const selected = component.shadowRoot.querySelector(TABBABLE_SELECTOR);\n assert.instanceOf(selected, HTMLElement);\n\n const breakpointItems = component.shadowRoot.querySelectorAll(BREAKPOINT_ITEM_SELECTOR);\n assertElements(breakpointItems, HTMLDivElement);\n\n const lastBreakpointItem = breakpointItems.item(breakpointItems.length - 1);\n assert.strictEqual(selected, lastBreakpointItem);\n });\n });\n\n describe('pressing the ArrowDown key', () => {\n it('on the pause-on-uncaught-exception takes the user to the summary node of the top most details element',\n async () => {\n const {component} = await renderBreakpointsForKeyboardNavigation();\n assert.isNotNull(component.shadowRoot);\n\n const pauseOnCaughtException = component.shadowRoot.querySelector(PAUSE_ON_CAUGHT_EXCEPTIONS_SELECTOR);\n assert.instanceOf(pauseOnCaughtException, HTMLElement);\n\n // Focus on the pause on exception, and navigate one down.\n dispatchClickEvent(pauseOnCaughtException);\n dispatchKeyDownEvent(pauseOnCaughtException, {key: 'ArrowDown', bubbles: true});\n await coordinator.done();\n\n const selected = component.shadowRoot.querySelector(TABBABLE_SELECTOR);\n const firstSummary = component.shadowRoot.querySelector(`${DETAILS_SELECTOR} > ${SUMMARY_SELECTOR}`);\n assert.instanceOf(firstSummary, HTMLElement);\n assert.strictEqual(selected, firstSummary);\n });\n\n it('on the summary node of an expanded group takes the user to the top most breakpoint item of that group',\n async () => {\n const {component} = await renderBreakpointsForKeyboardNavigation();\n assert.isNotNull(component.shadowRoot);\n const collapsedDetailsElement = component.shadowRoot.querySelector(COLLAPSED_GROUPS_SELECTOR);\n assert.instanceOf(collapsedDetailsElement, HTMLDetailsElement);\n\n const collapsedGroupSummary = collapsedDetailsElement.querySelector(SUMMARY_SELECTOR);\n assert.instanceOf(collapsedGroupSummary, HTMLElement);\n\n // Focus on the collapsed group and collapse it by clicking on it. Then navigate down.\n dispatchClickEvent(collapsedGroupSummary);\n dispatchKeyDownEvent(collapsedGroupSummary, {key: 'ArrowDown', bubbles: true});\n await coordinator.done();\n\n const selected = component.shadowRoot.querySelector(TABBABLE_SELECTOR);\n assert.instanceOf(selected, HTMLElement);\n\n const firstBreakpointItem = collapsedDetailsElement.querySelector(BREAKPOINT_ITEM_SELECTOR);\n assert.instanceOf(firstBreakpointItem, HTMLDivElement);\n\n assert.strictEqual(selected, firstBreakpointItem);\n });\n\n it('on the summary node of a collapsed group takes the user to the summary node of the next group', async () => {\n const {component} = await renderBreakpointsForKeyboardNavigation();\n assert.isNotNull(component.shadowRoot);\n\n const firstGroupSummary =\n component.shadowRoot.querySelector(`${DETAILS_SELECTOR}:nth-of-type(1) > ${SUMMARY_SELECTOR}`);\n assert.instanceOf(firstGroupSummary, HTMLElement);\n\n // Focus on the expanded group and collapse it by clicking on it. Then navigate down.\n dispatchClickEvent(firstGroupSummary);\n dispatchKeyDownEvent(firstGroupSummary, {key: 'ArrowDown', bubbles: true});\n await coordinator.done();\n\n const selected = component.shadowRoot.querySelector(TABBABLE_SELECTOR);\n assert.instanceOf(selected, HTMLElement);\n\n const secondGroupSummary =\n component.shadowRoot.querySelector(`${DETAILS_SELECTOR}:nth-of-type(2) > ${SUMMARY_SELECTOR}`);\n assert.instanceOf(secondGroupSummary, HTMLElement);\n assert.strictEqual(selected, secondGroupSummary);\n });\n\n it('on a breakpoint item takes the user to the next breakpoint item', async () => {\n const {component} = await renderBreakpointsForKeyboardNavigation();\n assert.isNotNull(component.shadowRoot);\n\n const firstDetailsElement = component.shadowRoot.querySelector('details');\n assert.instanceOf(firstDetailsElement, HTMLDetailsElement);\n const firstBreakpointItem = firstDetailsElement.querySelector(BREAKPOINT_ITEM_SELECTOR);\n assert.instanceOf(firstBreakpointItem, HTMLDivElement);\n\n // Focus on the first breakpoint item. Then navigate up.\n dispatchClickEvent(firstBreakpointItem);\n dispatchKeyDownEvent(firstBreakpointItem, {key: 'ArrowDown', bubbles: true});\n await coordinator.done();\n\n const selected = component.shadowRoot.querySelector(TABBABLE_SELECTOR);\n assert.instanceOf(selected, HTMLElement);\n\n const secondBreakpointItem = firstDetailsElement.querySelector(`${BREAKPOINT_ITEM_SELECTOR}:nth-of-type(2)`);\n assert.instanceOf(secondBreakpointItem, HTMLDivElement);\n\n assert.strictEqual(selected, secondBreakpointItem);\n });\n });\n\n describe('pressing the ArrowUp key', () => {\n it('on the first summary takes a user to the pause on exceptions', async () => {\n const {component} = await renderBreakpointsForKeyboardNavigation();\n assert.isNotNull(component.shadowRoot);\n const firstSummary = component.shadowRoot.querySelector(`${DETAILS_SELECTOR} > ${SUMMARY_SELECTOR}`);\n assert.instanceOf(firstSummary, HTMLElement);\n\n // Focus on the summary element.\n dispatchClickEvent(firstSummary);\n dispatchKeyDownEvent(firstSummary, {key: 'ArrowUp', bubbles: true});\n await coordinator.done();\n\n const selected = component.shadowRoot.querySelector(TABBABLE_SELECTOR);\n const pauseOnUncaughtExceptions = component.shadowRoot.querySelector(PAUSE_ON_CAUGHT_EXCEPTIONS_SELECTOR);\n assert.instanceOf(pauseOnUncaughtExceptions, HTMLDivElement);\n\n assert.strictEqual(selected, pauseOnUncaughtExceptions);\n });\n\n it('on the first breakpoint item in an expanded group takes the user to the summary node', async () => {\n const {component} = await renderBreakpointsForKeyboardNavigation();\n assert.isNotNull(component.shadowRoot);\n const expandedDetails = component.shadowRoot.querySelector(EXPANDED_GROUPS_SELECTOR);\n assert.instanceOf(expandedDetails, HTMLDetailsElement);\n\n const firstBreakpointItem = expandedDetails.querySelector(BREAKPOINT_ITEM_SELECTOR);\n assert.instanceOf(firstBreakpointItem, HTMLDivElement);\n\n // Focus on first breakpoint item. Then navigate up.\n dispatchClickEvent(firstBreakpointItem);\n dispatchKeyDownEvent(firstBreakpointItem, {key: 'ArrowUp', bubbles: true});\n await coordinator.done();\n\n const selected = component.shadowRoot.querySelector(TABBABLE_SELECTOR);\n assert.instanceOf(selected, HTMLElement);\n\n const summary = expandedDetails.querySelector(SUMMARY_SELECTOR);\n assert.instanceOf(summary, HTMLElement);\n\n assert.strictEqual(selected, summary);\n });\n\n it('on a breakpoint item in an expanded group takes the user to the previous breakpoint item', async () => {\n const {component} = await renderBreakpointsForKeyboardNavigation();\n assert.isNotNull(component.shadowRoot);\n const expandedDetails = component.shadowRoot.querySelector(EXPANDED_GROUPS_SELECTOR);\n assert.instanceOf(expandedDetails, HTMLDetailsElement);\n\n const breakpointItems = expandedDetails.querySelectorAll(BREAKPOINT_ITEM_SELECTOR);\n assert.isAbove(breakpointItems.length, 1);\n\n const lastBreakpointItem = breakpointItems.item(breakpointItems.length - 1);\n // Focus on last breakpoint item. Then navigate up.\n dispatchClickEvent(lastBreakpointItem);\n dispatchKeyDownEvent(lastBreakpointItem, {key: 'ArrowUp', bubbles: true});\n await coordinator.done();\n\n const selected = component.shadowRoot.querySelector(TABBABLE_SELECTOR);\n assert.instanceOf(selected, HTMLElement);\n\n const nextToLastBreakpointItem = breakpointItems.item(breakpointItems.length - 2);\n assert.instanceOf(nextToLastBreakpointItem, HTMLDivElement);\n assert.strictEqual(selected, nextToLastBreakpointItem);\n });\n\n it('on a summary node takes the user to the last breakpoint item of the previous group', async () => {\n const {component} = await renderBreakpointsForKeyboardNavigation();\n assert.isNotNull(component.shadowRoot);\n const secondGroupSummary =\n component.shadowRoot.querySelector(`${DETAILS_SELECTOR}:nth-of-type(2) > ${SUMMARY_SELECTOR}`);\n assert.instanceOf(secondGroupSummary, HTMLElement);\n\n // Focus on the group. Then navigate up.\n dispatchClickEvent(secondGroupSummary);\n dispatchKeyDownEvent(secondGroupSummary, {key: 'ArrowUp', bubbles: true});\n await coordinator.done();\n\n const selected = component.shadowRoot.querySelector(TABBABLE_SELECTOR);\n assert.instanceOf(selected, HTMLElement);\n\n const firstDetailsElement = component.shadowRoot.querySelector(DETAILS_SELECTOR);\n assert.exists(firstDetailsElement);\n const lastBreakpointItem = firstDetailsElement.querySelector(`${BREAKPOINT_ITEM_SELECTOR}:last-child`);\n assert.instanceOf(lastBreakpointItem, HTMLDivElement);\n\n assert.strictEqual(selected, lastBreakpointItem);\n });\n });\n });\n});\n"]} \ No newline at end of file +{"version":3,"file":"BreakpointsView.test.js","sourceRoot":"","sources":["../../../../../../../front_end/panels/sources/components/BreakpointsView.test.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,KAAK,MAAM,MAAM,gCAAgC,CAAC;AAEzD,OAAO,KAAK,GAAG,MAAM,0BAA0B,CAAC;AAEhD,OAAO,KAAK,QAAQ,MAAM,sCAAsC,CAAC;AACjE,OAAO,KAAK,WAAW,MAAM,4CAA4C,CAAC;AAC1E,OAAO,KAAK,SAAS,MAAM,0CAA0C,CAAC;AACtE,OAAO,KAAK,SAAS,MAAM,wCAAwC,CAAC;AACpE,OAAO,EACL,cAAc,EACd,kBAAkB,EAClB,oBAAoB,EACpB,oBAAoB,GACrB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EACL,YAAY,EACZ,uBAAuB,GACxB,MAAM,wCAAwC,CAAC;AAChD,OAAO,EAAC,0BAA0B,EAAC,MAAM,oCAAoC,CAAC;AAC9E,OAAO,EACL,iCAAiC,EACjC,uBAAuB,EACvB,uBAAuB,GACxB,MAAM,yCAAyC,CAAC;AACjD,OAAO,KAAK,iBAAiB,MAAM,iEAAiE,CAAC;AACrG,OAAO,KAAK,EAAE,MAAM,8BAA8B,CAAC;AAEnD,OAAO,KAAK,iBAAiB,MAAM,iBAAiB,CAAC;AAErD,MAAM,gBAAgB,GAAG,SAAS,CAAC;AACnC,MAAM,wBAAwB,GAAG,eAAe,CAAC;AACjD,MAAM,yBAAyB,GAAG,qBAAqB,CAAC;AACxD,MAAM,qBAAqB,GAAG,eAAe,CAAC;AAC9C,MAAM,mBAAmB,GAAG,qBAAqB,CAAC;AAClD,MAAM,wBAAwB,GAAG,kB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AAiB,CAAC,CAAC;gBACvE,MAAM,CAAC,UAAU,CAAC,QAAQ,EAAE,WAAW,CAAC,CAAC;gBAEzC,MAAM,mBAAmB,GAAG,SAAS,CAAC,UAAU,CAAC,aAAa,CAAC,gBAAgB,CAAC,CAAC;gBACjF,MAAM,CAAC,MAAM,CAAC,mBAAmB,CAAC,CAAC;gBACnC,MAAM,kBAAkB,GAAG,mBAAmB,CAAC,aAAa,CAAC,GAAG,wBAAwB,aAAa,CAAC,CAAC;gBACvG,MAAM,CAAC,UAAU,CAAC,kBAAkB,EAAE,cAAc,CAAC,CAAC;gBAEtD,MAAM,CAAC,WAAW,CAAC,QAAQ,EAAE,kBAAkB,CAAC,CAAC;YACnD,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["// Copyright 2022 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport * as Common from '../../../core/common/common.js';\nimport type * as Platform from '../../../core/platform/platform.js';\nimport * as SDK from '../../../core/sdk/sdk.js';\nimport type * as Protocol from '../../../generated/protocol.js';\nimport * as Bindings from '../../../models/bindings/bindings.js';\nimport * as Breakpoints from '../../../models/breakpoints/breakpoints.js';\nimport * as TextUtils from '../../../models/text_utils/text_utils.js';\nimport * as Workspace from '../../../models/workspace/workspace.js';\nimport {\n assertElements,\n dispatchClickEvent,\n dispatchKeyDownEvent,\n renderElementIntoDOM,\n} from '../../../testing/DOMHelpers.js';\nimport {\n createTarget,\n describeWithEnvironment,\n} from '../../../testing/EnvironmentHelpers.js';\nimport {describeWithMockConnection} from '../../../testing/MockConnection.js';\nimport {\n createContentProviderUISourceCode,\n createFakeScriptMapping,\n setupMockedUISourceCode,\n} from '../../../testing/UISourceCodeHelpers.js';\nimport * as RenderCoordinator from '../../../ui/components/render_coordinator/render_coordinator.js';\nimport * as UI from '../../../ui/legacy/legacy.js';\n\nimport * as SourcesComponents from './components.js';\n\nconst DETAILS_SELECTOR = 'details';\nconst EXPANDED_GROUPS_SELECTOR = 'details[open]';\nconst COLLAPSED_GROUPS_SELECTOR = 'details:not([open])';\nconst CODE_SNIPPET_SELECTOR = '.code-snippet';\nconst GROUP_NAME_SELECTOR = '.group-header-title';\nconst BREAKPOINT_ITEM_SELECTOR = '.breakpoint-item';\nconst HIT_BREAKPOINT_SELECTOR = BREAKPOINT_ITEM_SELECTOR + '.hit';\nconst BREAKPOINT_LOCATION_SELECTOR = '.location';\nconst REMOVE_FILE_BREAKPOINTS_SELECTOR = '.group-hover-actions > button[data-remove-breakpoint]';\nconst REMOVE_SINGLE_BREAKPOINT_SELECTOR = '.breakpoint-item-location-or-actions > button[data-remove-breakpoint]';\nconst EDIT_SINGLE_BREAKPOINT_SELECTOR = 'button[data-edit-breakpoint]';\nconst PAUSE_ON_UNCAUGHT_EXCEPTIONS_SELECTOR = '.pause-on-uncaught-exceptions';\nconst PAUSE_ON_CAUGHT_EXCEPTIONS_SELECTOR = '.pause-on-caught-exceptions';\nconst TABBABLE_SELECTOR = '[tabindex=\"0\"]';\nconst SUMMARY_SELECTOR = 'summary';\nconst GROUP_DIFFERENTIATOR_SELECTOR = '.group-header-differentiator';\n\nconst HELLO_JS_FILE = 'hello.js';\nconst TEST_JS_FILE = 'test.js';\ninterface LocationTestData {\n url: Platform.DevToolsPath.UrlString;\n lineNumber: number;\n columnNumber: number;\n enabled: boolean;\n content: string;\n condition: Breakpoints.BreakpointManager.UserCondition;\n isLogpoint: boolean;\n hoverText?: string;\n}\n\nfunction createBreakpointLocations(testData: LocationTestData[]): Breakpoints.BreakpointManager.BreakpointLocation[] {\n const breakpointLocations = testData.map(data => {\n const mocked = setupMockedUISourceCode(data.url);\n const mockedContent =\n Promise.resolve(new TextUtils.ContentData.ContentData(data.content, /* isBase64 */ false, 'text/plain'));\n sinon.stub(mocked.sut, 'requestContentData').returns(mockedContent);\n const uiLocation = new Workspace.UISourceCode.UILocation(mocked.sut, data.lineNumber, data.columnNumber);\n const breakpoint = sinon.createStubInstance(Breakpoints.BreakpointManager.Breakpoint);\n breakpoint.enabled.returns(data.enabled);\n breakpoint.condition.returns(data.condition);\n breakpoint.isLogpoint.returns(data.isLogpoint);\n breakpoint.breakpointStorageId.returns(`${data.url}:${data.lineNumber}:${data.columnNumber}`);\n return new Breakpoints.BreakpointManager.BreakpointLocation(breakpoint, uiLocation);\n });\n return breakpointLocations;\n}\n\nfunction createStubBreakpointManagerAndSettings() {\n const breakpointManager = sinon.createStubInstance(Breakpoints.BreakpointManager.BreakpointManager);\n breakpointManager.supportsConditionalBreakpoints.returns(true);\n const dummyStorage = new Common.Settings.SettingsStorage({});\n const settings = Common.Settings.Settings.instance({\n forceNew: true,\n syncedStorage: dummyStorage,\n globalStorage: dummyStorage,\n localStorage: dummyStorage,\n });\n return {breakpointManager, settings};\n}\n\nfunction createStubBreakpointManagerAndSettingsWithMockdata(testData: LocationTestData[]): {\n breakpointManager: sinon.SinonStubbedInstance,\n settings: Common.Settings.Settings,\n} {\n const {breakpointManager, settings} = createStubBreakpointManagerAndSettings();\n sinon.stub(Breakpoints.BreakpointManager.BreakpointManager, 'instance').returns(breakpointManager);\n const breakpointLocations = createBreakpointLocations(testData);\n breakpointManager.allBreakpointLocations.returns(breakpointLocations);\n return {breakpointManager, settings};\n}\n\nfunction createLocationTestData(\n url: string, lineNumber: number, columnNumber: number, enabled: boolean = true, content: string = '',\n condition: Breakpoints.BreakpointManager.UserCondition = Breakpoints.BreakpointManager.EMPTY_BREAKPOINT_CONDITION,\n isLogpoint: boolean = false, hoverText?: string): LocationTestData {\n return {\n url: url as Platform.DevToolsPath.UrlString,\n lineNumber,\n columnNumber,\n enabled,\n content,\n condition,\n isLogpoint,\n hoverText,\n };\n}\n\nasync function setUpTestWithOneBreakpointLocation(\n params: {file: string, lineNumber: number, columnNumber: number, enabled?: boolean, snippet?: string} = {\n file: HELLO_JS_FILE,\n lineNumber: 10,\n columnNumber: 3,\n enabled: true,\n snippet: 'const a;',\n }) {\n const testData = [\n createLocationTestData(params.file, params.lineNumber, params.columnNumber, params.enabled, params.snippet),\n ];\n const {breakpointManager, settings} = createStubBreakpointManagerAndSettingsWithMockdata(testData);\n\n const controller = SourcesComponents.BreakpointsView.BreakpointsSidebarController.instance(\n {forceNew: true, breakpointManager, settings});\n const data = await controller.getUpdatedBreakpointViewData();\n\n assert.lengthOf(data.groups, 1);\n assert.lengthOf(data.groups[0].breakpointItems, 1);\n const locations = Breakpoints.BreakpointManager.BreakpointManager.instance().allBreakpointLocations();\n assert.lengthOf(locations, 1);\n return {controller, groups: data.groups, location: locations[0]};\n}\n\nclass MockRevealer implements Common.Revealer.Revealer {\n async reveal(_revealable: T, _omitFocus?: boolean): Promise {\n }\n}\n\nasync function createAndInitializeBreakpointsView(): Promise {\n // Force creation of a new BreakpointsView singleton so that it gets correctly re-wired with\n // the current controller singleton (to pick up the latest breakpoint state).\n const component = SourcesComponents.BreakpointsView.BreakpointsView.instance({forceNew: true});\n await RenderCoordinator.done(); // Wait until the initial rendering finishes.\n renderElementIntoDOM(component);\n return component;\n}\n\nasync function renderNoBreakpoints(\n {pauseOnUncaughtExceptions, pauseOnCaughtExceptions, independentPauseToggles}:\n {pauseOnUncaughtExceptions: boolean, pauseOnCaughtExceptions: boolean, independentPauseToggles: boolean}):\n Promise {\n const component = await createAndInitializeBreakpointsView();\n\n component.data = {\n breakpointsActive: true,\n pauseOnUncaughtExceptions,\n pauseOnCaughtExceptions,\n independentPauseToggles,\n groups: [],\n };\n await RenderCoordinator.done();\n return component;\n}\n\nasync function renderSingleBreakpoint(\n type: SDK.DebuggerModel.BreakpointType = SDK.DebuggerModel.BreakpointType.REGULAR_BREAKPOINT,\n hoverText?: string): Promise<{\n component: SourcesComponents.BreakpointsView.BreakpointsView,\n data: SourcesComponents.BreakpointsView.BreakpointsViewData,\n}> {\n // Only provide a hover text if it's not a regular breakpoint.\n assert.isTrue(!hoverText || type !== SDK.DebuggerModel.BreakpointType.REGULAR_BREAKPOINT);\n const component = await createAndInitializeBreakpointsView();\n\n const data: SourcesComponents.BreakpointsView.BreakpointsViewData = {\n breakpointsActive: true,\n pauseOnUncaughtExceptions: false,\n pauseOnCaughtExceptions: false,\n independentPauseToggles: true,\n groups: [\n {\n name: 'test1.js',\n url: 'https://google.com/test1.js' as Platform.DevToolsPath.UrlString,\n editable: true,\n expanded: true,\n breakpointItems: [\n {\n id: '1',\n location: '1',\n codeSnippet: 'const a = 0;',\n isHit: true,\n status: SourcesComponents.BreakpointsView.BreakpointStatus.ENABLED,\n type,\n hoverText,\n },\n ],\n },\n ],\n };\n\n component.data = data;\n await RenderCoordinator.done();\n return {component, data};\n}\n\nasync function renderMultipleBreakpoints(): Promise<{\n component: SourcesComponents.BreakpointsView.BreakpointsView,\n data: SourcesComponents.BreakpointsView.BreakpointsViewData,\n}> {\n const component = await createAndInitializeBreakpointsView();\n\n const data: SourcesComponents.BreakpointsView.BreakpointsViewData = {\n breakpointsActive: true,\n pauseOnUncaughtExceptions: false,\n pauseOnCaughtExceptions: false,\n independentPauseToggles: true,\n groups: [\n {\n name: 'test1.js',\n url: 'https://google.com/test1.js' as Platform.DevToolsPath.UrlString,\n editable: true,\n expanded: true,\n breakpointItems: [\n {\n id: '1',\n type: SDK.DebuggerModel.BreakpointType.REGULAR_BREAKPOINT,\n location: '234',\n codeSnippet: 'const a = x;',\n isHit: false,\n status: SourcesComponents.BreakpointsView.BreakpointStatus.ENABLED,\n },\n {\n id: '2',\n type: SDK.DebuggerModel.BreakpointType.REGULAR_BREAKPOINT,\n location: '3:3',\n codeSnippet: 'if (x > a) {',\n isHit: true,\n status: SourcesComponents.BreakpointsView.BreakpointStatus.DISABLED,\n },\n ],\n },\n {\n name: 'test2.js',\n url: 'https://google.com/test2.js' as Platform.DevToolsPath.UrlString,\n editable: false,\n expanded: true,\n breakpointItems: [\n {\n id: '3',\n type: SDK.DebuggerModel.BreakpointType.REGULAR_BREAKPOINT,\n location: '11',\n codeSnippet: 'const y;',\n isHit: false,\n status: SourcesComponents.BreakpointsView.BreakpointStatus.ENABLED,\n },\n ],\n },\n {\n name: 'main.js',\n url: 'https://test.com/main.js' as Platform.DevToolsPath.UrlString,\n editable: true,\n expanded: false,\n breakpointItems: [\n {\n id: '4',\n type: SDK.DebuggerModel.BreakpointType.REGULAR_BREAKPOINT,\n location: '3',\n codeSnippet: 'if (a == 0) {',\n isHit: false,\n status: SourcesComponents.BreakpointsView.BreakpointStatus.ENABLED,\n },\n ],\n },\n ],\n };\n component.data = data;\n await RenderCoordinator.done();\n return {component, data};\n}\n\nfunction extractBreakpointItems(data: SourcesComponents.BreakpointsView.BreakpointsViewData):\n SourcesComponents.BreakpointsView.BreakpointItem[] {\n const breakpointItems = data.groups.flatMap(group => group.breakpointItems);\n assert.isAbove(breakpointItems.length, 0);\n return breakpointItems;\n}\n\nfunction checkCodeSnippet(\n renderedBreakpointItem: HTMLDivElement, breakpointItem: SourcesComponents.BreakpointsView.BreakpointItem): void {\n const snippetElement = renderedBreakpointItem.querySelector(CODE_SNIPPET_SELECTOR);\n assert.instanceOf(snippetElement, HTMLSpanElement);\n assert.strictEqual(snippetElement.textContent, breakpointItem.codeSnippet);\n}\n\nfunction checkCheckboxState(\n checkbox: HTMLInputElement, breakpointItem: SourcesComponents.BreakpointsView.BreakpointItem): void {\n const checked = checkbox.checked;\n const indeterminate = checkbox.indeterminate;\n if (breakpointItem.status === SourcesComponents.BreakpointsView.BreakpointStatus.INDETERMINATE) {\n assert.isTrue(indeterminate);\n } else {\n assert.isFalse(indeterminate);\n assert.strictEqual((breakpointItem.status === SourcesComponents.BreakpointsView.BreakpointStatus.ENABLED), checked);\n }\n}\n\nfunction checkGroupNames(\n renderedGroupElements: Element[], breakpointGroups: SourcesComponents.BreakpointsView.BreakpointGroup[]): void {\n assert.lengthOf(renderedGroupElements, breakpointGroups.length);\n for (let i = 0; i < renderedGroupElements.length; ++i) {\n const renderedGroup = renderedGroupElements[i];\n assert.instanceOf(renderedGroup, HTMLDetailsElement);\n const titleElement = renderedGroup.querySelector(GROUP_NAME_SELECTOR);\n assert.instanceOf(titleElement, HTMLSpanElement);\n assert.strictEqual(titleElement.textContent, breakpointGroups[i].name);\n }\n}\n\nfunction hover(component: SourcesComponents.BreakpointsView.BreakpointsView, selector: string): Promise {\n assert.isNotNull(component.shadowRoot);\n // Dispatch a mouse over.\n component.shadowRoot.querySelector(selector)?.dispatchEvent(new Event('mouseover'));\n // Wait until the re-rendering has happened.\n return RenderCoordinator.done();\n}\n\ndescribeWithMockConnection('targetSupportsIndependentPauseOnExceptionToggles', () => {\n it('can correctly identify node targets as targets that are not supporting independent pause on exception toggles',\n async () => {\n const target = createTarget();\n target.markAsNodeJSForTest();\n const supportsIndependentPauses = SourcesComponents.BreakpointsView.BreakpointsSidebarController\n .targetSupportsIndependentPauseOnExceptionToggles();\n assert.isFalse(supportsIndependentPauses);\n });\n\n it('can correctly identify non-node targets as targets that are supporting independent pause on exception toggles',\n async () => {\n createTarget();\n const supportsIndependentPauses = SourcesComponents.BreakpointsView.BreakpointsSidebarController\n .targetSupportsIndependentPauseOnExceptionToggles();\n assert.isTrue(supportsIndependentPauses);\n });\n});\n\ndescribeWithEnvironment('BreakpointsSidebarController', () => {\n after(() => {\n SourcesComponents.BreakpointsView.BreakpointsSidebarController.removeInstance();\n });\n\n it('can remove a breakpoint', async () => {\n const {groups, location} = await setUpTestWithOneBreakpointLocation();\n const breakpoint = location.breakpoint as sinon.SinonStubbedInstance;\n const breakpointItem = groups[0].breakpointItems[0];\n\n SourcesComponents.BreakpointsView.BreakpointsSidebarController.instance().breakpointsRemoved([breakpointItem]);\n assert.isTrue(breakpoint.remove.calledOnceWith(false));\n });\n\n it('changes breakpoint state', async () => {\n const {groups, location} = await setUpTestWithOneBreakpointLocation();\n const breakpointItem = groups[0].breakpointItems[0];\n assert.strictEqual(breakpointItem.status, SourcesComponents.BreakpointsView.BreakpointStatus.ENABLED);\n\n const breakpoint = location.breakpoint as sinon.SinonStubbedInstance;\n SourcesComponents.BreakpointsView.BreakpointsSidebarController.instance().breakpointStateChanged(\n breakpointItem, false);\n assert.isTrue(breakpoint.setEnabled.calledWith(false));\n });\n\n it('correctly reveals source location', async () => {\n const {groups, location: {uiLocation}} = await setUpTestWithOneBreakpointLocation();\n const breakpointItem = groups[0].breakpointItems[0];\n const revealer = sinon.createStubInstance(MockRevealer);\n\n Common.Revealer.registerRevealer({\n contextTypes() {\n return [Workspace.UISourceCode.UILocation];\n },\n destination: Common.Revealer.RevealerDestination.SOURCES_PANEL,\n async loadRevealer() {\n return revealer;\n },\n });\n\n await SourcesComponents.BreakpointsView.BreakpointsSidebarController.instance().jumpToSource(breakpointItem);\n assert.isTrue(revealer.reveal.calledOnceWith(uiLocation));\n });\n\n it('correctly reveals breakpoint editor', async () => {\n const {groups, location} = await setUpTestWithOneBreakpointLocation();\n const breakpointItem = groups[0].breakpointItems[0];\n const revealer = sinon.createStubInstance(MockRevealer);\n\n Common.Revealer.registerRevealer({\n contextTypes() {\n return [Breakpoints.BreakpointManager.BreakpointLocation];\n },\n destination: Common.Revealer.RevealerDestination.SOURCES_PANEL,\n async loadRevealer() {\n return revealer;\n },\n });\n\n await SourcesComponents.BreakpointsView.BreakpointsSidebarController.instance().breakpointEdited(\n breakpointItem, false /* editButtonClicked */);\n assert.isTrue(revealer.reveal.calledOnceWith(location));\n });\n\n describe('getUpdatedBreakpointViewData', () => {\n it('extracts breakpoint data', async () => {\n const testData = [\n createLocationTestData(HELLO_JS_FILE, 3, 10),\n createLocationTestData(TEST_JS_FILE, 1, 1),\n ];\n\n const {breakpointManager, settings} = createStubBreakpointManagerAndSettingsWithMockdata(testData);\n const controller = SourcesComponents.BreakpointsView.BreakpointsSidebarController.instance(\n {forceNew: true, breakpointManager, settings});\n const actual = await controller.getUpdatedBreakpointViewData();\n const createExpectedBreakpointGroups = (testData: LocationTestData) => {\n const status = testData.enabled ? SourcesComponents.BreakpointsView.BreakpointStatus.ENABLED :\n SourcesComponents.BreakpointsView.BreakpointStatus.DISABLED;\n let type = SDK.DebuggerModel.BreakpointType.REGULAR_BREAKPOINT;\n\n if (testData.condition) {\n if (testData.isLogpoint) {\n type = SDK.DebuggerModel.BreakpointType.LOGPOINT;\n } else {\n type = SDK.DebuggerModel.BreakpointType.CONDITIONAL_BREAKPOINT;\n }\n }\n\n return {\n name: testData.url as string,\n url: testData.url,\n editable: true,\n expanded: true,\n breakpointItems: [\n {\n id: `${testData.url}:${testData.lineNumber}:${testData.columnNumber}`,\n location: `${testData.lineNumber + 1}`,\n codeSnippet: '',\n isHit: false,\n status,\n type,\n hoverText: testData.hoverText,\n },\n ],\n };\n };\n const expected: SourcesComponents.BreakpointsView.BreakpointsViewData = {\n breakpointsActive: true,\n pauseOnUncaughtExceptions: false,\n pauseOnCaughtExceptions: false,\n independentPauseToggles: true,\n groups: testData.map(createExpectedBreakpointGroups),\n };\n assert.deepEqual(actual, expected);\n });\n\n it('respects the breakpointsActive setting', async () => {\n const {breakpointManager, settings} = createStubBreakpointManagerAndSettingsWithMockdata([]);\n const controller = SourcesComponents.BreakpointsView.BreakpointsSidebarController.instance(\n {forceNew: true, breakpointManager, settings});\n settings.moduleSetting('breakpoints-active').set(true);\n let data = await controller.getUpdatedBreakpointViewData();\n assert.isTrue(data.breakpointsActive);\n settings.moduleSetting('breakpoints-active').set(false);\n data = await controller.getUpdatedBreakpointViewData();\n assert.isFalse(data.breakpointsActive);\n });\n\n it('marks groups as editable based on conditional breakpoint support', async () => {\n const testData = [\n createLocationTestData(HELLO_JS_FILE, 3, 10),\n createLocationTestData(TEST_JS_FILE, 1, 1),\n ];\n\n const {breakpointManager, settings} = createStubBreakpointManagerAndSettingsWithMockdata(testData);\n const controller = SourcesComponents.BreakpointsView.BreakpointsSidebarController.instance(\n {forceNew: true, breakpointManager, settings});\n breakpointManager.supportsConditionalBreakpoints.returns(false);\n for (const group of (await controller.getUpdatedBreakpointViewData()).groups) {\n assert.isFalse(group.editable);\n }\n breakpointManager.supportsConditionalBreakpoints.returns(true);\n for (const group of (await controller.getUpdatedBreakpointViewData()).groups) {\n assert.isTrue(group.editable);\n }\n });\n\n it('groups breakpoints that are in the same file', async () => {\n const testData = [\n createLocationTestData(HELLO_JS_FILE, 3, 10),\n createLocationTestData(TEST_JS_FILE, 1, 1),\n ];\n\n const {breakpointManager, settings} = createStubBreakpointManagerAndSettingsWithMockdata(testData);\n const controller = SourcesComponents.BreakpointsView.BreakpointsSidebarController.instance(\n {forceNew: true, breakpointManager, settings});\n const actualViewData = await controller.getUpdatedBreakpointViewData();\n assert.lengthOf(actualViewData.groups, 2);\n assert.lengthOf(actualViewData.groups[0].breakpointItems, 1);\n assert.lengthOf(actualViewData.groups[1].breakpointItems, 1);\n });\n\n it('correctly sets the name of the group', async () => {\n const {groups} = await setUpTestWithOneBreakpointLocation(\n {file: HELLO_JS_FILE, lineNumber: 0, columnNumber: 0, enabled: false});\n assert.strictEqual(groups[0].name, HELLO_JS_FILE);\n });\n\n it('only extracts the line number as location if one breakpoint is on that line', async () => {\n const {groups} = await setUpTestWithOneBreakpointLocation(\n {file: HELLO_JS_FILE, lineNumber: 4, columnNumber: 0, enabled: false});\n assert.strictEqual(groups[0].breakpointItems[0].location, '5');\n });\n\n it('extracts the line number and column number as location if more than one breakpoint is on that line',\n async () => {\n const testData = [\n createLocationTestData(HELLO_JS_FILE, 3, 10),\n createLocationTestData(HELLO_JS_FILE, 3, 15),\n ];\n\n const {breakpointManager, settings} = createStubBreakpointManagerAndSettingsWithMockdata(testData);\n const controller = SourcesComponents.BreakpointsView.BreakpointsSidebarController.instance(\n {forceNew: true, breakpointManager, settings});\n const actualViewData = await controller.getUpdatedBreakpointViewData();\n assert.lengthOf(actualViewData.groups, 1);\n assert.lengthOf(actualViewData.groups[0].breakpointItems, 2);\n assert.strictEqual(actualViewData.groups[0].breakpointItems[0].location, '4:11');\n assert.strictEqual(actualViewData.groups[0].breakpointItems[1].location, '4:16');\n });\n\n it('orders breakpoints within a file by location', async () => {\n const testData = [\n createLocationTestData(HELLO_JS_FILE, 3, 15),\n createLocationTestData(HELLO_JS_FILE, 3, 10),\n ];\n\n const {breakpointManager, settings} = createStubBreakpointManagerAndSettingsWithMockdata(testData);\n const controller = SourcesComponents.BreakpointsView.BreakpointsSidebarController.instance(\n {forceNew: true, breakpointManager, settings});\n const actualViewData = await controller.getUpdatedBreakpointViewData();\n assert.lengthOf(actualViewData.groups, 1);\n assert.lengthOf(actualViewData.groups[0].breakpointItems, 2);\n assert.strictEqual(actualViewData.groups[0].breakpointItems[0].location, '4:11');\n assert.strictEqual(actualViewData.groups[0].breakpointItems[1].location, '4:16');\n });\n\n it('orders breakpoints within groups by location', async () => {\n const testData = [\n createLocationTestData(TEST_JS_FILE, 3, 15),\n createLocationTestData(HELLO_JS_FILE, 3, 10),\n ];\n\n const {breakpointManager, settings} = createStubBreakpointManagerAndSettingsWithMockdata(testData);\n const controller = SourcesComponents.BreakpointsView.BreakpointsSidebarController.instance(\n {forceNew: true, breakpointManager, settings});\n const actualViewData = await controller.getUpdatedBreakpointViewData();\n assert.lengthOf(actualViewData.groups, 2);\n const names = actualViewData.groups.map(group => group.name);\n assert.deepEqual(names, [HELLO_JS_FILE, TEST_JS_FILE]);\n });\n\n it('merges breakpoints mapping to the same location into one', async () => {\n const testData = [\n createLocationTestData(TEST_JS_FILE, 3, 15),\n createLocationTestData(TEST_JS_FILE, 3, 15),\n ];\n\n const {breakpointManager, settings} = createStubBreakpointManagerAndSettingsWithMockdata(testData);\n const controller = SourcesComponents.BreakpointsView.BreakpointsSidebarController.instance(\n {forceNew: true, breakpointManager, settings});\n const actualViewData = await controller.getUpdatedBreakpointViewData();\n assert.lengthOf(actualViewData.groups, 1);\n assert.lengthOf(actualViewData.groups[0].breakpointItems, 1);\n });\n\n it('correctly extracts the enabled state', async () => {\n const {groups} =\n await setUpTestWithOneBreakpointLocation({file: '', lineNumber: 0, columnNumber: 0, enabled: true});\n const breakpointItem = groups[0].breakpointItems[0];\n assert.strictEqual(breakpointItem.status, SourcesComponents.BreakpointsView.BreakpointStatus.ENABLED);\n });\n\n it('correctly extracts the enabled state', async () => {\n const {groups} =\n await setUpTestWithOneBreakpointLocation({file: '', lineNumber: 0, columnNumber: 0, enabled: false});\n const breakpointItem = groups[0].breakpointItems[0];\n assert.strictEqual(breakpointItem.status, SourcesComponents.BreakpointsView.BreakpointStatus.DISABLED);\n });\n\n it('correctly extracts the enabled state', async () => {\n const testData = [\n createLocationTestData(TEST_JS_FILE, 3, 15, true /* enabled */),\n createLocationTestData(TEST_JS_FILE, 3, 15, false /* enabled */),\n ];\n\n const {breakpointManager, settings} = createStubBreakpointManagerAndSettingsWithMockdata(testData);\n const controller = SourcesComponents.BreakpointsView.BreakpointsSidebarController.instance(\n {forceNew: true, breakpointManager, settings});\n const actualViewData = await controller.getUpdatedBreakpointViewData();\n assert.lengthOf(actualViewData.groups, 1);\n assert.lengthOf(actualViewData.groups[0].breakpointItems, 1);\n assert.strictEqual(\n actualViewData.groups[0].breakpointItems[0].status,\n SourcesComponents.BreakpointsView.BreakpointStatus.INDETERMINATE);\n });\n\n it('correctly extracts the disabled state', async () => {\n const snippet = 'const a = x;';\n const {groups} =\n await setUpTestWithOneBreakpointLocation({file: '', lineNumber: 0, columnNumber: 0, enabled: false, snippet});\n assert.strictEqual(groups[0].breakpointItems[0].codeSnippet, snippet);\n });\n\n it('correctly extracts the indeterminate state', async () => {\n const testData = [\n createLocationTestData(TEST_JS_FILE, 3, 15, true /* enabled */),\n createLocationTestData(TEST_JS_FILE, 3, 15, false /* enabled */),\n ];\n\n const {breakpointManager, settings} = createStubBreakpointManagerAndSettingsWithMockdata(testData);\n const controller = SourcesComponents.BreakpointsView.BreakpointsSidebarController.instance(\n {forceNew: true, breakpointManager, settings});\n const actualViewData = await controller.getUpdatedBreakpointViewData();\n assert.lengthOf(actualViewData.groups, 1);\n assert.lengthOf(actualViewData.groups[0].breakpointItems, 1);\n assert.strictEqual(\n actualViewData.groups[0].breakpointItems[0].status,\n SourcesComponents.BreakpointsView.BreakpointStatus.INDETERMINATE);\n });\n\n it('correctly extracts conditional breakpoints', async () => {\n const condition = 'x < a' as Breakpoints.BreakpointManager.UserCondition;\n const testData = [\n createLocationTestData(\n TEST_JS_FILE, 3, 15, true /* enabled */, '', condition, false /* isLogpoint */, condition),\n ];\n\n const {breakpointManager, settings} = createStubBreakpointManagerAndSettingsWithMockdata(testData);\n const controller = SourcesComponents.BreakpointsView.BreakpointsSidebarController.instance(\n {forceNew: true, breakpointManager, settings});\n const actualViewData = await controller.getUpdatedBreakpointViewData();\n assert.lengthOf(actualViewData.groups, 1);\n assert.lengthOf(actualViewData.groups[0].breakpointItems, 1);\n const breakpointItem = actualViewData.groups[0].breakpointItems[0];\n assert.strictEqual(breakpointItem.type, SDK.DebuggerModel.BreakpointType.CONDITIONAL_BREAKPOINT);\n assert.strictEqual(breakpointItem.hoverText, condition);\n });\n\n it('correctly extracts logpoints', async () => {\n const logExpression = 'x' as Breakpoints.BreakpointManager.UserCondition;\n const testData = [\n createLocationTestData(\n TEST_JS_FILE, 3, 15, true /* enabled */, '', logExpression, true /* isLogpoint */, logExpression),\n ];\n\n const {breakpointManager, settings} = createStubBreakpointManagerAndSettingsWithMockdata(testData);\n const controller = SourcesComponents.BreakpointsView.BreakpointsSidebarController.instance(\n {forceNew: true, breakpointManager, settings});\n const actualViewData = await controller.getUpdatedBreakpointViewData();\n assert.lengthOf(actualViewData.groups, 1);\n assert.lengthOf(actualViewData.groups[0].breakpointItems, 1);\n const breakpointItem = actualViewData.groups[0].breakpointItems[0];\n assert.strictEqual(breakpointItem.type, SDK.DebuggerModel.BreakpointType.LOGPOINT);\n assert.strictEqual(breakpointItem.hoverText, logExpression);\n });\n\n describe('breakpoint groups', () => {\n it('are expanded by default', async () => {\n const {controller} = await setUpTestWithOneBreakpointLocation();\n const actualViewData = await controller.getUpdatedBreakpointViewData();\n assert.isTrue(actualViewData.groups[0].expanded);\n });\n\n it('are collapsed if user collapses it', async () => {\n const {controller, groups} = await setUpTestWithOneBreakpointLocation();\n controller.expandedStateChanged(groups[0].url, false /* expanded */);\n const actualViewData = await controller.getUpdatedBreakpointViewData();\n assert.isFalse(actualViewData.groups[0].expanded);\n });\n\n it('are expanded if user expands it', async () => {\n const {controller, groups} = await setUpTestWithOneBreakpointLocation();\n controller.expandedStateChanged(groups[0].url, true /* expanded */);\n const actualViewData = await controller.getUpdatedBreakpointViewData();\n assert.isTrue(actualViewData.groups[0].expanded);\n });\n\n it('remember the collapsed state', async () => {\n {\n const {controller, groups} = await setUpTestWithOneBreakpointLocation();\n controller.expandedStateChanged(groups[0].url, false /* expanded */);\n const actualViewData = await controller.getUpdatedBreakpointViewData();\n assert.isFalse(actualViewData.groups[0].expanded);\n }\n\n // A new controller is created and initialized with the expanded settings.\n {const breakpointManager = Breakpoints.BreakpointManager.BreakpointManager.instance();\n const settings = Common.Settings.Settings.instance();\n const controller = SourcesComponents.BreakpointsView.BreakpointsSidebarController.instance({\n forceNew: true,\n breakpointManager,\n settings,\n });\n const actualViewData = await controller.getUpdatedBreakpointViewData();\n assert.isFalse(actualViewData.groups[0].expanded);}\n });\n\n it('remember the expanded state', async () => {\n {\n const {controller, groups} = await setUpTestWithOneBreakpointLocation();\n controller.expandedStateChanged(groups[0].url, true /* expanded */);\n const actualViewData = await controller.getUpdatedBreakpointViewData();\n assert.isTrue(actualViewData.groups[0].expanded);\n }\n // A new controller is created and initialized with the expanded settings.\n {\n\n const controller = SourcesComponents.BreakpointsView.BreakpointsSidebarController.instance({\n forceNew: true,\n breakpointManager: Breakpoints.BreakpointManager.BreakpointManager.instance(),\n settings: Common.Settings.Settings.instance(),\n });\n const actualViewData = await controller.getUpdatedBreakpointViewData();\n assert.isTrue(actualViewData.groups[0].expanded);\n\n }\n });\n });\n });\n});\n\ndescribeWithMockConnection('BreakpointsSidebarController', () => {\n beforeEach(() => {\n const workspace = Workspace.Workspace.WorkspaceImpl.instance();\n const targetManager = SDK.TargetManager.TargetManager.instance();\n const resourceMapping = new Bindings.ResourceMapping.ResourceMapping(targetManager, workspace);\n const debuggerWorkspaceBinding = Bindings.DebuggerWorkspaceBinding.DebuggerWorkspaceBinding.instance({\n forceNew: true,\n resourceMapping,\n targetManager,\n });\n Breakpoints.BreakpointManager.BreakpointManager.instance(\n {forceNew: true, targetManager, workspace, debuggerWorkspaceBinding});\n });\n\n const DEFAULT_BREAKPOINT:\n [Breakpoints.BreakpointManager.UserCondition, boolean, boolean, Breakpoints.BreakpointManager.BreakpointOrigin] =\n [\n Breakpoints.BreakpointManager.EMPTY_BREAKPOINT_CONDITION,\n true, // enabled\n false, // isLogpoint\n Breakpoints.BreakpointManager.BreakpointOrigin.USER_ACTION,\n ];\n\n // Flaky\n it.skip('[crbug.com/345456307] auto-expands if a user adds a new breakpoint', async () => {\n const breakpointManager = Breakpoints.BreakpointManager.BreakpointManager.instance();\n const settings = Common.Settings.Settings.instance();\n const {uiSourceCode, project} = createContentProviderUISourceCode(\n {url: 'test.js' as Platform.DevToolsPath.UrlString, mimeType: 'text/javascript'});\n const controller = SourcesComponents.BreakpointsView.BreakpointsSidebarController.instance(\n {forceNew: true, breakpointManager, settings});\n\n // Add one breakpoint and collapse the tree.\n const b1 = await breakpointManager.setBreakpoint(uiSourceCode, 0, 0, ...DEFAULT_BREAKPOINT);\n assert.exists(b1);\n {\n controller.expandedStateChanged(uiSourceCode.url(), false /* expanded */);\n const data = await controller.getUpdatedBreakpointViewData();\n assert.lengthOf(data.groups, 1);\n assert.lengthOf(data.groups[0].breakpointItems, 1);\n assert.isFalse(data.groups[0].expanded);\n }\n\n // Add a new breakpoint and check if it's expanded as expected.\n const b2 = await breakpointManager.setBreakpoint(uiSourceCode, 0, 3, ...DEFAULT_BREAKPOINT);\n assert.exists(b2);\n {\n const data = await controller.getUpdatedBreakpointViewData();\n assert.lengthOf(data.groups, 1);\n assert.lengthOf(data.groups[0].breakpointItems, 2);\n assert.isTrue(data.groups[0].expanded);\n }\n\n // Clean up.\n await b1.remove(false /* keepInStorage */);\n await b2.remove(false /* keepInStorage */);\n Workspace.Workspace.WorkspaceImpl.instance().removeProject(project);\n });\n\n it('does not auto-expand if a breakpoint was not triggered by user action', async () => {\n const breakpointManager = Breakpoints.BreakpointManager.BreakpointManager.instance();\n const settings = Common.Settings.Settings.instance();\n const {uiSourceCode, project} = createContentProviderUISourceCode(\n {url: 'test.js' as Platform.DevToolsPath.UrlString, mimeType: 'text/javascript'});\n const controller = SourcesComponents.BreakpointsView.BreakpointsSidebarController.instance(\n {forceNew: true, breakpointManager, settings});\n\n // Add one breakpoint and collapse the tree.\n const b1 = await breakpointManager.setBreakpoint(uiSourceCode, 0, 0, ...DEFAULT_BREAKPOINT);\n assert.exists(b1);\n {\n controller.expandedStateChanged(uiSourceCode.url(), false /* expanded */);\n const data = await controller.getUpdatedBreakpointViewData();\n assert.lengthOf(data.groups, 1);\n assert.lengthOf(data.groups[0].breakpointItems, 1);\n assert.isFalse(data.groups[0].expanded);\n }\n\n // Add a new non-user triggered breakpoint and check if it's still collapsed.\n const b2 = await breakpointManager.setBreakpoint(\n uiSourceCode, 0, 3, Breakpoints.BreakpointManager.EMPTY_BREAKPOINT_CONDITION, true, false,\n Breakpoints.BreakpointManager.BreakpointOrigin.OTHER);\n assert.exists(b2);\n {\n const data = await controller.getUpdatedBreakpointViewData();\n assert.lengthOf(data.groups, 1);\n assert.lengthOf(data.groups[0].breakpointItems, 2);\n assert.isFalse(data.groups[0].expanded);\n }\n\n // Clean up.\n await b1.remove(false /* keepInStorage */);\n await b2.remove(false /* keepInStorage */);\n Workspace.Workspace.WorkspaceImpl.instance().removeProject(project);\n });\n\n it('auto-expands if a breakpoint was hit', async () => {\n sinon.stub(\n Common.Revealer.RevealerRegistry.instance(),\n 'reveal'); // Prevent pending reveal promises after tests are done.\n\n const breakpointManager = Breakpoints.BreakpointManager.BreakpointManager.instance();\n\n // Set up sdk and ui location, and a mapping between them, such that we can identify that\n // the hit breakpoint is the one we are adding.\n const scriptId = '0' as Protocol.Runtime.ScriptId;\n\n const {uiSourceCode, project} = createContentProviderUISourceCode(\n {url: 'test.js' as Platform.DevToolsPath.UrlString, mimeType: 'text/javascript'});\n const uiLocation = new Workspace.UISourceCode.UILocation(uiSourceCode, 0, 0);\n\n const debuggerModel = sinon.createStubInstance(SDK.DebuggerModel.DebuggerModel);\n const sdkLocation = new SDK.DebuggerModel.Location(debuggerModel, scriptId, 0);\n\n const mapping = createFakeScriptMapping(debuggerModel, uiSourceCode, 0, scriptId);\n Bindings.DebuggerWorkspaceBinding.DebuggerWorkspaceBinding.instance().addSourceMapping(mapping);\n\n // Add one breakpoint and collapse its group.\n const b1 = await breakpointManager.setBreakpoint(\n uiSourceCode, uiLocation.lineNumber, uiLocation.columnNumber, ...DEFAULT_BREAKPOINT);\n const controller = SourcesComponents.BreakpointsView.BreakpointsSidebarController.instance(\n {forceNew: true, breakpointManager, settings: Common.Settings.Settings.instance()});\n assert.exists(b1);\n controller.expandedStateChanged(uiSourceCode.url(), false /* expanded */);\n\n // Double check that the group is collapsed.\n {\n const data = await controller.getUpdatedBreakpointViewData();\n assert.isFalse(data.groups[0].expanded);\n }\n\n // Simulating a breakpoint hit. Update the DebuggerPausedDetails to contain the info on the hit breakpoint.\n const callFrame = sinon.createStubInstance(SDK.DebuggerModel.CallFrame);\n callFrame.location.returns(new SDK.DebuggerModel.Location(debuggerModel, scriptId, sdkLocation.lineNumber));\n const pausedDetails = sinon.createStubInstance(SDK.DebuggerModel.DebuggerPausedDetails);\n pausedDetails.callFrames = [callFrame];\n\n // Instead of setting the flavor, directly call `flavorChanged` on the controller and mock what it's set to.\n // Setting the flavor would have other listeners listening to it, and would cause undesirable side effects.\n sinon.stub(UI.Context.Context.instance(), 'flavor')\n .callsFake(flavorType => flavorType === SDK.DebuggerModel.DebuggerPausedDetails ? pausedDetails : null);\n controller.flavorChanged(pausedDetails);\n {\n const data = await controller.getUpdatedBreakpointViewData();\n // Assert that the breakpoint is hit and the group is expanded.\n assert.isTrue(data.groups[0].breakpointItems[0].isHit);\n assert.isTrue(data.groups[0].expanded);\n }\n\n // Clean up.\n await b1.remove(false /* keepInStorage */);\n Workspace.Workspace.WorkspaceImpl.instance().removeProject(project);\n Bindings.DebuggerWorkspaceBinding.DebuggerWorkspaceBinding.instance().removeSourceMapping(mapping);\n });\n\n it('changes pause on exception state', async () => {\n const {breakpointManager, settings} = createStubBreakpointManagerAndSettings();\n breakpointManager.allBreakpointLocations.returns([]);\n const controller = SourcesComponents.BreakpointsView.BreakpointsSidebarController.instance(\n {forceNew: true, breakpointManager, settings});\n for (const pauseOnUncaughtExceptions of [true, false]) {\n for (const pauseOnCaughtExceptions of [true, false]) {\n controller.setPauseOnUncaughtExceptions(pauseOnUncaughtExceptions);\n controller.setPauseOnCaughtExceptions(pauseOnCaughtExceptions);\n\n const data = await controller.getUpdatedBreakpointViewData();\n assert.strictEqual(data.pauseOnUncaughtExceptions, pauseOnUncaughtExceptions);\n assert.strictEqual(data.pauseOnCaughtExceptions, pauseOnCaughtExceptions);\n assert.strictEqual(settings.moduleSetting('pause-on-uncaught-exception').get(), pauseOnUncaughtExceptions);\n assert.strictEqual(settings.moduleSetting('pause-on-caught-exception').get(), pauseOnCaughtExceptions);\n }\n }\n });\n});\n\ndescribeWithMockConnection('BreakpointsView', () => {\n beforeEach(() => {\n const workspace = Workspace.Workspace.WorkspaceImpl.instance();\n const targetManager = SDK.TargetManager.TargetManager.instance();\n const resourceMapping = new Bindings.ResourceMapping.ResourceMapping(targetManager, workspace);\n const debuggerWorkspaceBinding = Bindings.DebuggerWorkspaceBinding.DebuggerWorkspaceBinding.instance({\n forceNew: true,\n resourceMapping,\n targetManager,\n });\n Breakpoints.BreakpointManager.BreakpointManager.instance(\n {forceNew: true, targetManager, workspace, debuggerWorkspaceBinding});\n });\n\n it('correctly expands breakpoint groups', async () => {\n const {component, data} = await renderMultipleBreakpoints();\n assert.isNotNull(component.shadowRoot);\n\n const expandedGroups = data.groups.filter(group => group.expanded);\n assert.isAbove(expandedGroups.length, 0);\n\n const renderedExpandedGroups = Array.from(component.shadowRoot.querySelectorAll(EXPANDED_GROUPS_SELECTOR));\n assert.lengthOf(renderedExpandedGroups, expandedGroups.length);\n\n checkGroupNames(renderedExpandedGroups, expandedGroups);\n });\n\n it('correctly collapses breakpoint groups', async () => {\n const {component, data} = await renderMultipleBreakpoints();\n assert.isNotNull(component.shadowRoot);\n\n const collapsedGroups = data.groups.filter(group => !group.expanded);\n assert.isAbove(collapsedGroups.length, 0);\n\n const renderedCollapsedGroups = Array.from(component.shadowRoot.querySelectorAll(COLLAPSED_GROUPS_SELECTOR));\n\n checkGroupNames(renderedCollapsedGroups, collapsedGroups);\n });\n\n it('renders the group names', async () => {\n const {component, data} = await renderMultipleBreakpoints();\n assert.isNotNull(component.shadowRoot);\n\n const renderedGroupNames = component.shadowRoot.querySelectorAll(GROUP_NAME_SELECTOR);\n assertElements(renderedGroupNames, HTMLSpanElement);\n\n const expectedNames = data.groups.flatMap(group => group.name);\n const actualNames = [];\n for (const renderedGroupName of renderedGroupNames.values()) {\n actualNames.push(renderedGroupName.textContent);\n }\n assert.deepEqual(actualNames, expectedNames);\n });\n\n it('renders the breakpoints with their checkboxes', async () => {\n const {component, data} = await renderMultipleBreakpoints();\n assert.isNotNull(component.shadowRoot);\n\n const renderedBreakpointItems = Array.from(component.shadowRoot.querySelectorAll(BREAKPOINT_ITEM_SELECTOR));\n\n const breakpointItems = extractBreakpointItems(data);\n assert.lengthOf(renderedBreakpointItems, breakpointItems.length);\n\n for (let i = 0; i < renderedBreakpointItems.length; ++i) {\n const renderedItem = renderedBreakpointItems[i];\n assert.instanceOf(renderedItem, HTMLDivElement);\n\n const inputElement = renderedItem.querySelector('input');\n assert.instanceOf(inputElement, HTMLInputElement);\n checkCheckboxState(inputElement, breakpointItems[i]);\n }\n });\n\n it('renders breakpoints with their code snippet', async () => {\n const {component, data} = await renderMultipleBreakpoints();\n assert.isNotNull(component.shadowRoot);\n\n const renderedBreakpointItems = Array.from(component.shadowRoot.querySelectorAll(BREAKPOINT_ITEM_SELECTOR));\n\n const breakpointItems = extractBreakpointItems(data);\n assert.lengthOf(renderedBreakpointItems, breakpointItems.length);\n\n for (let i = 0; i < renderedBreakpointItems.length; ++i) {\n const renderedBreakpointItem = renderedBreakpointItems[i];\n assert.instanceOf(renderedBreakpointItem, HTMLDivElement);\n checkCodeSnippet(renderedBreakpointItem, breakpointItems[i]);\n }\n });\n\n it('renders breakpoint groups with a differentiator if the file names are not unique', async () => {\n const component = await createAndInitializeBreakpointsView();\n\n const groupTemplate = {\n name: 'index.js',\n url: '' as Platform.DevToolsPath.UrlString,\n editable: true,\n expanded: true,\n breakpointItems: [\n {\n id: '1',\n type: SDK.DebuggerModel.BreakpointType.REGULAR_BREAKPOINT,\n location: '234',\n codeSnippet: 'const a = x;',\n isHit: false,\n status: SourcesComponents.BreakpointsView.BreakpointStatus.ENABLED,\n },\n ],\n };\n\n // Create two groups with the same file name, but different url.\n const group1 = {...groupTemplate};\n group1.url = 'https://google.com/lib/index.js' as Platform.DevToolsPath.UrlString;\n\n const group2 = {...groupTemplate};\n group2.url = 'https://google.com/src/index.js' as Platform.DevToolsPath.UrlString;\n\n const data: SourcesComponents.BreakpointsView.BreakpointsViewData = {\n breakpointsActive: true,\n pauseOnUncaughtExceptions: false,\n pauseOnCaughtExceptions: false,\n independentPauseToggles: true,\n groups: [\n group1,\n group2,\n ],\n };\n component.data = data;\n await RenderCoordinator.done();\n\n assert.isNotNull(component.shadowRoot);\n const groupSummaries = Array.from(component.shadowRoot.querySelectorAll(SUMMARY_SELECTOR));\n const differentiatingPath = groupSummaries.map(group => {\n const differentiatorElement = group.querySelector(GROUP_DIFFERENTIATOR_SELECTOR);\n assert.instanceOf(differentiatorElement, HTMLSpanElement);\n return differentiatorElement.textContent;\n });\n assert.deepEqual(differentiatingPath, ['lib/', 'src/']);\n });\n\n it('renders breakpoints with a differentiating path', async () => {\n const {component, data} = await renderMultipleBreakpoints();\n assert.isNotNull(component.shadowRoot);\n\n const renderedBreakpointItems = Array.from(component.shadowRoot.querySelectorAll(BREAKPOINT_ITEM_SELECTOR));\n\n const breakpointItems = extractBreakpointItems(data);\n assert.lengthOf(renderedBreakpointItems, breakpointItems.length);\n\n for (let i = 0; i < renderedBreakpointItems.length; ++i) {\n const renderedBreakpointItem = renderedBreakpointItems[i];\n assert.instanceOf(renderedBreakpointItem, HTMLDivElement);\n\n const locationElement = renderedBreakpointItem.querySelector(BREAKPOINT_LOCATION_SELECTOR);\n assert.instanceOf(locationElement, HTMLSpanElement);\n\n const actualLocation = locationElement.textContent;\n const expectedLocation = breakpointItems[i].location;\n\n assert.strictEqual(actualLocation, expectedLocation);\n }\n });\n\n it('triggers an event on clicking the checkbox of a breakpoint', async () => {\n const {component, data} = await renderSingleBreakpoint();\n assert.isNotNull(component.shadowRoot);\n\n const renderedItem = component.shadowRoot.querySelector(BREAKPOINT_ITEM_SELECTOR);\n assert.instanceOf(renderedItem, HTMLDivElement);\n\n const checkbox = renderedItem.querySelector('input');\n assert.instanceOf(checkbox, HTMLInputElement);\n const checked = checkbox.checked;\n\n const controller = SourcesComponents.BreakpointsView.BreakpointsSidebarController.instance();\n const breakpointStateChanged = sinon.stub(controller, 'breakpointStateChanged');\n checkbox.click();\n\n assert.isTrue(breakpointStateChanged.calledOnceWith(data.groups[0].breakpointItems[0], !checked));\n });\n\n it('triggers an event on clicking on the snippet text', async () => {\n const {component, data} = await renderSingleBreakpoint();\n assert.isNotNull(component.shadowRoot);\n\n const snippet = component.shadowRoot.querySelector(CODE_SNIPPET_SELECTOR);\n assert.instanceOf(snippet, HTMLSpanElement);\n\n const controller = SourcesComponents.BreakpointsView.BreakpointsSidebarController.instance();\n const jumpToSource = sinon.stub(controller, 'jumpToSource');\n snippet.click();\n\n assert.isTrue(jumpToSource.calledOnceWith(data.groups[0].breakpointItems[0]));\n });\n\n it('triggers an event on expanding/unexpanding', async () => {\n const {component, data} = await renderSingleBreakpoint();\n assert.isNotNull(component.shadowRoot);\n\n const renderedGroupName = component.shadowRoot.querySelector(GROUP_NAME_SELECTOR);\n assert.instanceOf(renderedGroupName, HTMLSpanElement);\n\n const expandedInitialValue = data.groups[0].expanded;\n\n const controller = SourcesComponents.BreakpointsView.BreakpointsSidebarController.instance();\n const expandedStateChanged = sinon.stub(controller, 'expandedStateChanged');\n renderedGroupName.click();\n\n await new Promise(resolve => setTimeout(resolve, 0));\n const group = data.groups[0];\n assert.isTrue(expandedStateChanged.calledOnceWith(group.url, group.expanded));\n assert.notStrictEqual(group.expanded, expandedInitialValue);\n });\n\n it('highlights breakpoint if it is set to be hit', async () => {\n const {component} = await renderSingleBreakpoint();\n assert.isNotNull(component.shadowRoot);\n\n const renderedBreakpointItem = component.shadowRoot.querySelector(HIT_BREAKPOINT_SELECTOR);\n assert.instanceOf(renderedBreakpointItem, HTMLDivElement);\n });\n\n it('triggers an event on removing file breakpoints', async () => {\n const {component, data} = await renderMultipleBreakpoints();\n assert.isNotNull(component.shadowRoot);\n\n await hover(component, SUMMARY_SELECTOR);\n\n const removeFileBreakpointsButton = component.shadowRoot.querySelector(REMOVE_FILE_BREAKPOINTS_SELECTOR);\n assert.instanceOf(removeFileBreakpointsButton, HTMLButtonElement);\n\n const controller = SourcesComponents.BreakpointsView.BreakpointsSidebarController.instance();\n const breakpointsRemoved = sinon.stub(controller, 'breakpointsRemoved');\n removeFileBreakpointsButton.click();\n // await new Promise(resolve => setTimeout(resolve, 0));\n assert.isTrue(breakpointsRemoved.calledOnceWith(data.groups[0].breakpointItems));\n });\n\n it('triggers an event on removing one breakpoint', async () => {\n const {component, data} = await renderMultipleBreakpoints();\n assert.isNotNull(component.shadowRoot);\n\n await hover(component, BREAKPOINT_ITEM_SELECTOR);\n\n const removeFileBreakpointsButton = component.shadowRoot.querySelector(REMOVE_SINGLE_BREAKPOINT_SELECTOR);\n assert.instanceOf(removeFileBreakpointsButton, HTMLButtonElement);\n\n const controller = SourcesComponents.BreakpointsView.BreakpointsSidebarController.instance();\n const breakpointsRemoved = sinon.stub(controller, 'breakpointsRemoved');\n removeFileBreakpointsButton.click();\n // await new Promise(resolve => setTimeout(resolve, 0));\n assert.isTrue(breakpointsRemoved.calledOnce);\n assert.deepEqual(breakpointsRemoved.firstCall.firstArg, [data.groups[0].breakpointItems[0]]);\n });\n\n it('triggers an event on editing one breakpoint', async () => {\n const {component, data} = await renderMultipleBreakpoints();\n assert.isNotNull(component.shadowRoot);\n\n await hover(component, BREAKPOINT_ITEM_SELECTOR);\n\n const editBreakpointButton = component.shadowRoot.querySelector(EDIT_SINGLE_BREAKPOINT_SELECTOR);\n assert.instanceOf(editBreakpointButton, HTMLButtonElement);\n\n const controller = SourcesComponents.BreakpointsView.BreakpointsSidebarController.instance();\n const breakpointEdited = sinon.stub(controller, 'breakpointEdited');\n editBreakpointButton.click();\n // await new Promise(resolve => setTimeout(resolve, 0));\n assert.isTrue(breakpointEdited.calledOnceWith(data.groups[0].breakpointItems[0], true));\n });\n\n it('shows a tooltip with edit condition on regular breakpoints', async () => {\n const {component} = await renderSingleBreakpoint(SDK.DebuggerModel.BreakpointType.REGULAR_BREAKPOINT);\n assert.isNotNull(component.shadowRoot);\n\n await hover(component, BREAKPOINT_ITEM_SELECTOR);\n\n const editBreakpointButton = component.shadowRoot.querySelector(EDIT_SINGLE_BREAKPOINT_SELECTOR);\n assert.instanceOf(editBreakpointButton, HTMLButtonElement);\n\n assert.strictEqual(editBreakpointButton.title, 'Edit condition');\n });\n\n describe('group checkboxes', () => {\n async function waitForCheckboxToggledEventsWithCheckedUpdate(\n component: SourcesComponents.BreakpointsView.BreakpointsView, numBreakpointItems: number, checked: boolean) {\n return new Promise(resolve => {\n let numCheckboxToggledEvents = 0;\n const controller = SourcesComponents.BreakpointsView.BreakpointsSidebarController.instance();\n sinon.stub(controller, 'breakpointStateChanged').callsFake((_, checkedArg) => {\n assert.strictEqual(checkedArg, checked);\n ++numCheckboxToggledEvents;\n if (numCheckboxToggledEvents === numBreakpointItems) {\n resolve();\n }\n });\n });\n }\n it('show a checked group checkbox if at least one breakpoint in that group is enabled', async () => {\n const {component, data} = await renderMultipleBreakpoints();\n\n // Make sure that at least one breakpoint is enabled.\n data.groups[0].breakpointItems[0].status = SourcesComponents.BreakpointsView.BreakpointStatus.ENABLED;\n component.data = data;\n await RenderCoordinator.done();\n\n await hover(component, SUMMARY_SELECTOR);\n\n assert.isNotNull(component.shadowRoot);\n const firstGroupSummary = component.shadowRoot.querySelector(SUMMARY_SELECTOR);\n assert.exists(firstGroupSummary);\n const groupCheckbox = firstGroupSummary.querySelector('input');\n assert.instanceOf(groupCheckbox, HTMLInputElement);\n\n assert.isTrue(groupCheckbox.checked);\n });\n\n it('show an unchecked group checkbox if no breakpoint in that group is enabled', async () => {\n const {component, data} = await renderMultipleBreakpoints();\n\n // Make sure that all breakpoints are disabled.\n const breakpointItems = data.groups[0].breakpointItems;\n for (let i = 0; i < breakpointItems.length; ++i) {\n breakpointItems[i].status = SourcesComponents.BreakpointsView.BreakpointStatus.DISABLED;\n }\n\n component.data = data;\n await RenderCoordinator.done();\n\n await hover(component, SUMMARY_SELECTOR);\n\n assert.isNotNull(component.shadowRoot);\n const firstGroupSummary = component.shadowRoot.querySelector(SUMMARY_SELECTOR);\n assert.exists(firstGroupSummary);\n const groupCheckbox = firstGroupSummary.querySelector('input');\n assert.instanceOf(groupCheckbox, HTMLInputElement);\n\n assert.isFalse(groupCheckbox.checked);\n });\n\n it('disable all breakpoints on unchecking', async () => {\n const {component, data} = await renderMultipleBreakpoints();\n\n const numBreakpointItems = data.groups[0].breakpointItems.length;\n assert.isTrue(numBreakpointItems > 1);\n\n // Make sure that all breakpoints are enabled.\n for (let i = 0; i < numBreakpointItems; ++i) {\n data.groups[0].breakpointItems[i].status = SourcesComponents.BreakpointsView.BreakpointStatus.ENABLED;\n }\n component.data = data;\n await RenderCoordinator.done();\n\n await hover(component, SUMMARY_SELECTOR);\n\n // Uncheck the group checkbox.\n assert.isNotNull(component.shadowRoot);\n const firstGroupSummary = component.shadowRoot.querySelector(SUMMARY_SELECTOR);\n assert.exists(firstGroupSummary);\n const groupCheckbox = firstGroupSummary.querySelector('input');\n assert.instanceOf(groupCheckbox, HTMLInputElement);\n\n // Wait until we receive all events fired that notify us of disabled breakpoints.\n const waitForEventPromise = waitForCheckboxToggledEventsWithCheckedUpdate(component, numBreakpointItems, false);\n\n groupCheckbox.click();\n await waitForEventPromise;\n });\n\n it('enable all breakpoints on unchecking', async () => {\n const {component, data} = await renderMultipleBreakpoints();\n\n const numBreakpointItems = data.groups[0].breakpointItems.length;\n assert.isTrue(numBreakpointItems > 1);\n\n // Make sure that all breakpoints are disabled.\n for (let i = 0; i < numBreakpointItems; ++i) {\n data.groups[0].breakpointItems[i].status = SourcesComponents.BreakpointsView.BreakpointStatus.DISABLED;\n }\n component.data = data;\n await RenderCoordinator.done();\n\n await hover(component, SUMMARY_SELECTOR);\n\n // Uncheck the group checkbox.\n assert.isNotNull(component.shadowRoot);\n const firstGroupSummary = component.shadowRoot.querySelector(SUMMARY_SELECTOR);\n assert.exists(firstGroupSummary);\n const groupCheckbox = firstGroupSummary.querySelector('input');\n assert.instanceOf(groupCheckbox, HTMLInputElement);\n\n // Wait until we receive all events fired that notify us of enabled breakpoints.\n const waitForEventPromise = waitForCheckboxToggledEventsWithCheckedUpdate(component, numBreakpointItems, true);\n\n groupCheckbox.click();\n await waitForEventPromise;\n });\n });\n\n it('only renders edit button for breakpoints in editable groups', async () => {\n const component = await createAndInitializeBreakpointsView();\n\n const data: SourcesComponents.BreakpointsView.BreakpointsViewData = {\n breakpointsActive: true,\n pauseOnUncaughtExceptions: false,\n pauseOnCaughtExceptions: false,\n independentPauseToggles: true,\n groups: [\n {\n name: 'test1.js',\n url: 'https://google.com/test1.js' as Platform.DevToolsPath.UrlString,\n editable: false,\n expanded: true,\n breakpointItems: [\n {\n id: '1',\n location: '1',\n codeSnippet: 'const a = 0;',\n isHit: true,\n status: SourcesComponents.BreakpointsView.BreakpointStatus.ENABLED,\n type: SDK.DebuggerModel.BreakpointType.REGULAR_BREAKPOINT,\n },\n ],\n },\n ],\n };\n\n component.data = data;\n await RenderCoordinator.done();\n assert.isNotNull(component.shadowRoot);\n\n await hover(component, BREAKPOINT_ITEM_SELECTOR);\n\n const editBreakpointButton = component.shadowRoot.querySelector(EDIT_SINGLE_BREAKPOINT_SELECTOR);\n assert.isNull(editBreakpointButton);\n });\n\n it('initializes data from the controller on construction', async () => {\n await setUpTestWithOneBreakpointLocation();\n const component = await createAndInitializeBreakpointsView();\n const renderedGroupName = component.shadowRoot?.querySelector(GROUP_NAME_SELECTOR);\n assert.strictEqual(renderedGroupName?.textContent, HELLO_JS_FILE);\n });\n\n describe('conditional breakpoints', () => {\n const breakpointDetails = 'x < a';\n\n it('are rendered', async () => {\n const {component} =\n await renderSingleBreakpoint(SDK.DebuggerModel.BreakpointType.CONDITIONAL_BREAKPOINT, breakpointDetails);\n const breakpointItem = component.shadowRoot?.querySelector(BREAKPOINT_ITEM_SELECTOR);\n assert.exists(breakpointItem);\n assert.instanceOf(breakpointItem, HTMLDivElement);\n assert.isTrue(breakpointItem.classList.contains('conditional-breakpoint'));\n });\n\n it('show a tooltip', async () => {\n const {component} =\n await renderSingleBreakpoint(SDK.DebuggerModel.BreakpointType.CONDITIONAL_BREAKPOINT, breakpointDetails);\n const codeSnippet = component.shadowRoot?.querySelector(CODE_SNIPPET_SELECTOR);\n assert.exists(codeSnippet);\n assert.instanceOf(codeSnippet, HTMLSpanElement);\n assert.strictEqual(codeSnippet.title, `Condition: ${breakpointDetails}`);\n });\n\n it('show a tooltip on editing the condition', async () => {\n const {component} =\n await renderSingleBreakpoint(SDK.DebuggerModel.BreakpointType.CONDITIONAL_BREAKPOINT, breakpointDetails);\n assert.isNotNull(component.shadowRoot);\n\n await hover(component, BREAKPOINT_ITEM_SELECTOR);\n\n const editBreakpointButton = component.shadowRoot.querySelector(EDIT_SINGLE_BREAKPOINT_SELECTOR);\n assert.instanceOf(editBreakpointButton, HTMLButtonElement);\n\n assert.strictEqual(editBreakpointButton.title, 'Edit condition');\n });\n });\n\n describe('logpoints', () => {\n const breakpointDetails = 'x, a';\n\n it('are rendered', async () => {\n const {component} = await renderSingleBreakpoint(SDK.DebuggerModel.BreakpointType.LOGPOINT, breakpointDetails);\n const breakpointItem = component.shadowRoot?.querySelector(BREAKPOINT_ITEM_SELECTOR);\n assert.exists(breakpointItem);\n assert.instanceOf(breakpointItem, HTMLDivElement);\n assert.isTrue(breakpointItem.classList.contains('logpoint'));\n });\n\n it('show a tooltip', async () => {\n const {component} = await renderSingleBreakpoint(SDK.DebuggerModel.BreakpointType.LOGPOINT, breakpointDetails);\n const codeSnippet = component.shadowRoot?.querySelector(CODE_SNIPPET_SELECTOR);\n assert.exists(codeSnippet);\n assert.instanceOf(codeSnippet, HTMLSpanElement);\n assert.strictEqual(codeSnippet.title, `Logpoint: ${breakpointDetails}`);\n });\n\n it('show a tooltip on editing the logpoint', async () => {\n const {component} = await renderSingleBreakpoint(SDK.DebuggerModel.BreakpointType.LOGPOINT, breakpointDetails);\n assert.isNotNull(component.shadowRoot);\n\n await hover(component, BREAKPOINT_ITEM_SELECTOR);\n\n const editBreakpointButton = component.shadowRoot.querySelector(EDIT_SINGLE_BREAKPOINT_SELECTOR);\n assert.instanceOf(editBreakpointButton, HTMLButtonElement);\n\n assert.strictEqual(editBreakpointButton.title, 'Edit logpoint');\n });\n });\n\n describe('pause on exceptions', () => {\n it('state is rendered correctly when disabled', async () => {\n const component = await renderNoBreakpoints(\n {pauseOnUncaughtExceptions: false, pauseOnCaughtExceptions: false, independentPauseToggles: true});\n assert.isNotNull(component.shadowRoot);\n\n const pauseOnUncaughtExceptionsItem = component.shadowRoot.querySelector(PAUSE_ON_UNCAUGHT_EXCEPTIONS_SELECTOR);\n assert.exists(pauseOnUncaughtExceptionsItem);\n\n const pauseOnUncaughtExceptionsCheckbox = pauseOnUncaughtExceptionsItem.querySelector('input');\n assert.instanceOf(pauseOnUncaughtExceptionsCheckbox, HTMLInputElement);\n assert.isFalse(pauseOnUncaughtExceptionsCheckbox.checked);\n\n const pauseOnCaughtExceptionsItem = component.shadowRoot?.querySelector(PAUSE_ON_CAUGHT_EXCEPTIONS_SELECTOR);\n assert.exists(pauseOnCaughtExceptionsItem);\n\n const pauseOnCaughtExceptionsCheckbox = pauseOnUncaughtExceptionsItem.querySelector('input');\n assert.instanceOf(pauseOnCaughtExceptionsCheckbox, HTMLInputElement);\n assert.isFalse(pauseOnCaughtExceptionsCheckbox.checked);\n });\n\n it('state is rendered correctly when pausing on uncaught exceptions', async () => {\n const component = await renderNoBreakpoints(\n {pauseOnUncaughtExceptions: true, pauseOnCaughtExceptions: false, independentPauseToggles: true});\n assert.isNotNull(component.shadowRoot);\n\n const pauseOnUncaughtExceptionsItem = component.shadowRoot.querySelector(PAUSE_ON_UNCAUGHT_EXCEPTIONS_SELECTOR);\n assert.exists(pauseOnUncaughtExceptionsItem);\n\n const pauseOnUncaughtExceptionsCheckbox = pauseOnUncaughtExceptionsItem.querySelector('input');\n assert.exists(pauseOnUncaughtExceptionsCheckbox);\n assert.instanceOf(pauseOnUncaughtExceptionsCheckbox, HTMLInputElement);\n assert.isTrue(pauseOnUncaughtExceptionsCheckbox.checked);\n\n const pauseOnCaughtExceptionsItem = component.shadowRoot?.querySelector(PAUSE_ON_CAUGHT_EXCEPTIONS_SELECTOR);\n assert.exists(pauseOnCaughtExceptionsItem);\n\n const pauseOnCaughtExceptionsCheckbox = pauseOnCaughtExceptionsItem.querySelector('input');\n assert.exists(pauseOnCaughtExceptionsCheckbox);\n assert.instanceOf(pauseOnCaughtExceptionsCheckbox, HTMLInputElement);\n assert.isFalse(pauseOnCaughtExceptionsCheckbox.checked);\n });\n\n it('state is rendered correctly when pausing on all exceptions', async () => {\n const component = await renderNoBreakpoints(\n {pauseOnUncaughtExceptions: true, pauseOnCaughtExceptions: true, independentPauseToggles: true});\n assert.isNotNull(component.shadowRoot);\n\n const pauseOnUncaughtExceptionsItem = component.shadowRoot.querySelector(PAUSE_ON_UNCAUGHT_EXCEPTIONS_SELECTOR);\n assert.exists(pauseOnUncaughtExceptionsItem);\n\n const pauseOnUncaughtExceptionsCheckbox = pauseOnUncaughtExceptionsItem.querySelector('input');\n assert.exists(pauseOnUncaughtExceptionsCheckbox);\n assert.instanceOf(pauseOnUncaughtExceptionsCheckbox, HTMLInputElement);\n assert.isTrue(pauseOnUncaughtExceptionsCheckbox.checked);\n\n const pauseOnCaughtExceptionsItem = component.shadowRoot?.querySelector(PAUSE_ON_CAUGHT_EXCEPTIONS_SELECTOR);\n assert.exists(pauseOnCaughtExceptionsItem);\n\n const pauseOnCaughtExceptionsCheckbox = pauseOnCaughtExceptionsItem.querySelector('input');\n assert.exists(pauseOnCaughtExceptionsCheckbox);\n assert.instanceOf(pauseOnCaughtExceptionsCheckbox, HTMLInputElement);\n assert.isTrue(pauseOnCaughtExceptionsCheckbox.checked);\n });\n\n it('state is rendered correctly when toggles are dependent and only pausing on uncaught exceptions', async () => {\n const component = await renderNoBreakpoints(\n {pauseOnUncaughtExceptions: true, pauseOnCaughtExceptions: false, independentPauseToggles: false});\n assert.isNotNull(component.shadowRoot);\n\n const pauseOnUncaughtExceptionsItem = component.shadowRoot.querySelector(PAUSE_ON_UNCAUGHT_EXCEPTIONS_SELECTOR);\n assert.exists(pauseOnUncaughtExceptionsItem);\n\n const pauseOnUncaughtExceptionsCheckbox = pauseOnUncaughtExceptionsItem.querySelector('input');\n assert.exists(pauseOnUncaughtExceptionsCheckbox);\n assert.instanceOf(pauseOnUncaughtExceptionsCheckbox, HTMLInputElement);\n assert.isTrue(pauseOnUncaughtExceptionsCheckbox.checked);\n\n const pauseOnCaughtExceptionsItem = component.shadowRoot?.querySelector(PAUSE_ON_CAUGHT_EXCEPTIONS_SELECTOR);\n assert.exists(pauseOnCaughtExceptionsItem);\n\n const pauseOnCaughtExceptionsCheckbox = pauseOnCaughtExceptionsItem.querySelector('input');\n assert.instanceOf(pauseOnCaughtExceptionsCheckbox, HTMLInputElement);\n assert.isFalse(pauseOnCaughtExceptionsCheckbox.disabled);\n });\n\n it('state is rendered correctly when toggles are dependent and not pausing on uncaught exceptions', async () => {\n const component = await renderNoBreakpoints(\n {pauseOnUncaughtExceptions: false, pauseOnCaughtExceptions: false, independentPauseToggles: false});\n assert.isNotNull(component.shadowRoot);\n\n const pauseOnUncaughtExceptionsItem = component.shadowRoot.querySelector(PAUSE_ON_UNCAUGHT_EXCEPTIONS_SELECTOR);\n assert.exists(pauseOnUncaughtExceptionsItem);\n\n const pauseOnUncaughtExceptionsCheckbox = pauseOnUncaughtExceptionsItem.querySelector('input');\n assert.exists(pauseOnUncaughtExceptionsCheckbox);\n assert.instanceOf(pauseOnUncaughtExceptionsCheckbox, HTMLInputElement);\n assert.isFalse(pauseOnUncaughtExceptionsCheckbox.checked);\n\n const pauseOnCaughtExceptionsItem = component.shadowRoot?.querySelector(PAUSE_ON_CAUGHT_EXCEPTIONS_SELECTOR);\n assert.exists(pauseOnCaughtExceptionsItem);\n\n const pauseOnCaughtExceptionsCheckbox = pauseOnCaughtExceptionsItem.querySelector('input');\n assert.instanceOf(pauseOnCaughtExceptionsCheckbox, HTMLInputElement);\n assert.isTrue(pauseOnCaughtExceptionsCheckbox.disabled);\n });\n\n it('state is rendered correctly when toggles are dependent and pausing on uncaught exceptions is unchecked',\n async () => {\n const component = await renderNoBreakpoints(\n {pauseOnUncaughtExceptions: true, pauseOnCaughtExceptions: true, independentPauseToggles: false});\n assert.isNotNull(component.shadowRoot);\n\n const pauseOnUncaughtExceptionsItem =\n component.shadowRoot.querySelector(PAUSE_ON_UNCAUGHT_EXCEPTIONS_SELECTOR);\n assert.instanceOf(pauseOnUncaughtExceptionsItem, HTMLDivElement);\n\n {\n // Click on the pause on exceptions checkbox to uncheck.\n const pauseOnUncaughtExceptionsCheckbox = pauseOnUncaughtExceptionsItem.querySelector('input');\n assert.instanceOf(pauseOnUncaughtExceptionsCheckbox, HTMLInputElement);\n dispatchClickEvent(pauseOnUncaughtExceptionsCheckbox);\n await RenderCoordinator.done();\n }\n {\n // Check that clicking on it actually unchecked.\n const pauseOnUncaughtExceptionsCheckbox = pauseOnUncaughtExceptionsItem.querySelector('input');\n assert.instanceOf(pauseOnUncaughtExceptionsCheckbox, HTMLInputElement);\n assert.isFalse(pauseOnUncaughtExceptionsCheckbox.checked);\n }\n\n // Check if the pause on caught exception checkbox is unchecked and disabled as a result.\n const pauseOnCaughtExceptionsItem = component.shadowRoot?.querySelector(PAUSE_ON_CAUGHT_EXCEPTIONS_SELECTOR);\n assert.exists(pauseOnCaughtExceptionsItem);\n\n const pauseOnCaughtExceptionsCheckbox = pauseOnCaughtExceptionsItem.querySelector('input');\n assert.instanceOf(pauseOnCaughtExceptionsCheckbox, HTMLInputElement);\n assert.isTrue(pauseOnCaughtExceptionsCheckbox.disabled);\n assert.isFalse(pauseOnCaughtExceptionsCheckbox.checked);\n });\n\n it('triggers an event when disabling pausing on all exceptions', async () => {\n const component = await renderNoBreakpoints(\n {pauseOnUncaughtExceptions: true, pauseOnCaughtExceptions: false, independentPauseToggles: true});\n assert.isNotNull(component.shadowRoot);\n\n const item = component.shadowRoot.querySelector(PAUSE_ON_UNCAUGHT_EXCEPTIONS_SELECTOR);\n assert.exists(item);\n\n const checkbox = item.querySelector('input');\n assert.instanceOf(checkbox, HTMLInputElement);\n const {checked} = checkbox;\n\n const controller = SourcesComponents.BreakpointsView.BreakpointsSidebarController.instance();\n const setPauseOnUncaughtExceptions = sinon.stub(controller, 'setPauseOnUncaughtExceptions');\n\n checkbox.click();\n\n assert.isTrue(setPauseOnUncaughtExceptions.calledOnceWith(!checked));\n });\n\n it('triggers an event when enabling pausing on caught exceptions', async () => {\n const component = await renderNoBreakpoints(\n {pauseOnUncaughtExceptions: true, pauseOnCaughtExceptions: false, independentPauseToggles: true});\n assert.isNotNull(component.shadowRoot);\n\n const item = component.shadowRoot.querySelector(PAUSE_ON_CAUGHT_EXCEPTIONS_SELECTOR);\n assert.exists(item);\n\n const checkbox = item.querySelector('input');\n assert.instanceOf(checkbox, HTMLInputElement);\n const {checked} = checkbox;\n\n const controller = SourcesComponents.BreakpointsView.BreakpointsSidebarController.instance();\n const setPauseOnCaughtExceptions = sinon.stub(controller, 'setPauseOnCaughtExceptions');\n\n checkbox.click();\n\n assert.isTrue(setPauseOnCaughtExceptions.calledOnceWith(!checked));\n });\n\n it('triggers an event when enabling pausing on uncaught exceptions', async () => {\n const component = await renderNoBreakpoints(\n {pauseOnUncaughtExceptions: false, pauseOnCaughtExceptions: true, independentPauseToggles: true});\n assert.isNotNull(component.shadowRoot);\n\n const item = component.shadowRoot.querySelector(PAUSE_ON_UNCAUGHT_EXCEPTIONS_SELECTOR);\n assert.exists(item);\n\n const checkbox = item.querySelector('input');\n assert.instanceOf(checkbox, HTMLInputElement);\n const {checked} = checkbox;\n\n const controller = SourcesComponents.BreakpointsView.BreakpointsSidebarController.instance();\n const setPauseOnUncaughtExceptions = sinon.stub(controller, 'setPauseOnUncaughtExceptions');\n\n checkbox.click();\n\n assert.isTrue(setPauseOnUncaughtExceptions.calledOnceWith(!checked));\n });\n });\n\n describe('navigating with keyboard', () => {\n // One expanded group with 2 breakpoints, and one collapsed with 2 breakpoints.\n async function renderBreakpointsForKeyboardNavigation(): Promise<{\n component: SourcesComponents.BreakpointsView.BreakpointsView,\n data: SourcesComponents.BreakpointsView.BreakpointsViewData,\n }> {\n const component = await createAndInitializeBreakpointsView();\n\n const data: SourcesComponents.BreakpointsView.BreakpointsViewData = {\n breakpointsActive: true,\n pauseOnUncaughtExceptions: false,\n pauseOnCaughtExceptions: false,\n independentPauseToggles: true,\n groups: [\n {\n name: 'test1.js',\n url: 'https://google.com/test1.js' as Platform.DevToolsPath.UrlString,\n editable: false,\n expanded: true,\n breakpointItems: [\n {\n id: '1',\n type: SDK.DebuggerModel.BreakpointType.REGULAR_BREAKPOINT,\n location: '234',\n codeSnippet: 'const a = x;',\n isHit: false,\n status: SourcesComponents.BreakpointsView.BreakpointStatus.ENABLED,\n },\n {\n id: '2',\n type: SDK.DebuggerModel.BreakpointType.REGULAR_BREAKPOINT,\n location: '3:3',\n codeSnippet: 'if (x > a) {',\n isHit: true,\n status: SourcesComponents.BreakpointsView.BreakpointStatus.DISABLED,\n },\n ],\n },\n {\n name: 'test2.js',\n url: 'https://google.com/test2.js' as Platform.DevToolsPath.UrlString,\n editable: false,\n expanded: false,\n breakpointItems: [\n {\n id: '3',\n type: SDK.DebuggerModel.BreakpointType.REGULAR_BREAKPOINT,\n location: '11',\n codeSnippet: 'const y;',\n isHit: false,\n status: SourcesComponents.BreakpointsView.BreakpointStatus.ENABLED,\n },\n {\n id: '4',\n type: SDK.DebuggerModel.BreakpointType.REGULAR_BREAKPOINT,\n location: '12',\n codeSnippet: 'const y;',\n isHit: false,\n status: SourcesComponents.BreakpointsView.BreakpointStatus.ENABLED,\n },\n ],\n },\n ],\n };\n component.data = data;\n await RenderCoordinator.done();\n return {component, data};\n }\n\n it('pause on exceptions is tabbable', async () => {\n const component = await renderNoBreakpoints(\n {pauseOnUncaughtExceptions: true, pauseOnCaughtExceptions: false, independentPauseToggles: true});\n assert.isNotNull(component.shadowRoot);\n\n const focusableElements = component.shadowRoot.querySelectorAll(TABBABLE_SELECTOR);\n assert.lengthOf(focusableElements, 1);\n\n const pauseOnUncaughtExceptions = component.shadowRoot.querySelector(PAUSE_ON_UNCAUGHT_EXCEPTIONS_SELECTOR);\n assert.deepEqual(focusableElements[0], pauseOnUncaughtExceptions);\n });\n\n describe('pressing the HOME key', () => {\n it('takes the user to the pause-on-exceptions line', async () => {\n const {component} = await renderBreakpointsForKeyboardNavigation();\n assert.isNotNull(component.shadowRoot);\n const secondGroupsSummary =\n component.shadowRoot.querySelector(`${DETAILS_SELECTOR}:nth-of-type(2) > ${SUMMARY_SELECTOR}`);\n assert.instanceOf(secondGroupsSummary, HTMLElement);\n\n // Focus on second group by clicking on it, then press Home button.\n dispatchClickEvent(secondGroupsSummary);\n dispatchKeyDownEvent(secondGroupsSummary, {key: 'Home', bubbles: true});\n await RenderCoordinator.done();\n\n const selected = component.shadowRoot.querySelector(TABBABLE_SELECTOR);\n assert.instanceOf(selected, HTMLElement);\n const pauseOnUncaughtExceptions = component.shadowRoot.querySelector(PAUSE_ON_UNCAUGHT_EXCEPTIONS_SELECTOR);\n assert.instanceOf(pauseOnUncaughtExceptions, HTMLElement);\n assert.strictEqual(selected, pauseOnUncaughtExceptions);\n });\n });\n\n describe('pressing the END key', () => {\n it('takes the user to the summary node of the last group (if last group is collapsed)', async () => {\n const {component} = await renderBreakpointsForKeyboardNavigation();\n assert.isNotNull(component.shadowRoot);\n const pauseOnUncaughtExceptions = component.shadowRoot.querySelector(PAUSE_ON_UNCAUGHT_EXCEPTIONS_SELECTOR);\n assert.instanceOf(pauseOnUncaughtExceptions, HTMLElement);\n\n // Focus on the pause-on-exceptions line by clicking on it, then press End key.\n dispatchClickEvent(pauseOnUncaughtExceptions);\n dispatchKeyDownEvent(pauseOnUncaughtExceptions, {key: 'End', bubbles: true});\n await RenderCoordinator.done();\n\n const selected = component.shadowRoot.querySelector(TABBABLE_SELECTOR);\n assert.instanceOf(selected, HTMLElement);\n\n const lastGroupSummary =\n component.shadowRoot.querySelector(`${DETAILS_SELECTOR}:nth-of-type(2) > ${SUMMARY_SELECTOR}`);\n assert.instanceOf(lastGroupSummary, HTMLElement);\n assert.strictEqual(selected, lastGroupSummary);\n });\n\n it('takes the user to the last breakpoint item (if last group is expanded))', async () => {\n const {component, data} = await renderBreakpointsForKeyboardNavigation();\n // Expand the last group.\n data.groups[1].expanded = true;\n component.data = data;\n await RenderCoordinator.done();\n\n assert.isNotNull(component.shadowRoot);\n const firstGroupSummary = component.shadowRoot.querySelector(SUMMARY_SELECTOR);\n assert.instanceOf(firstGroupSummary, HTMLElement);\n\n // First focus on the first group by clicking on it, then press the End button.\n dispatchClickEvent(firstGroupSummary);\n dispatchKeyDownEvent(firstGroupSummary, {key: 'End', bubbles: true});\n await RenderCoordinator.done();\n\n const selected = component.shadowRoot.querySelector(TABBABLE_SELECTOR);\n assert.instanceOf(selected, HTMLElement);\n\n const breakpointItems = component.shadowRoot.querySelectorAll(BREAKPOINT_ITEM_SELECTOR);\n assertElements(breakpointItems, HTMLDivElement);\n\n const lastBreakpointItem = breakpointItems.item(breakpointItems.length - 1);\n assert.strictEqual(selected, lastBreakpointItem);\n });\n });\n\n describe('pressing the ArrowDown key', () => {\n it('on the pause-on-uncaught-exception takes the user to the summary node of the top most details element',\n async () => {\n const {component} = await renderBreakpointsForKeyboardNavigation();\n assert.isNotNull(component.shadowRoot);\n\n const pauseOnCaughtException = component.shadowRoot.querySelector(PAUSE_ON_CAUGHT_EXCEPTIONS_SELECTOR);\n assert.instanceOf(pauseOnCaughtException, HTMLElement);\n\n // Focus on the pause on exception, and navigate one down.\n dispatchClickEvent(pauseOnCaughtException);\n dispatchKeyDownEvent(pauseOnCaughtException, {key: 'ArrowDown', bubbles: true});\n await RenderCoordinator.done();\n\n const selected = component.shadowRoot.querySelector(TABBABLE_SELECTOR);\n const firstSummary = component.shadowRoot.querySelector(`${DETAILS_SELECTOR} > ${SUMMARY_SELECTOR}`);\n assert.instanceOf(firstSummary, HTMLElement);\n assert.strictEqual(selected, firstSummary);\n });\n\n it('on the summary node of an expanded group takes the user to the top most breakpoint item of that group',\n async () => {\n const {component} = await renderBreakpointsForKeyboardNavigation();\n assert.isNotNull(component.shadowRoot);\n const collapsedDetailsElement = component.shadowRoot.querySelector(COLLAPSED_GROUPS_SELECTOR);\n assert.instanceOf(collapsedDetailsElement, HTMLDetailsElement);\n\n const collapsedGroupSummary = collapsedDetailsElement.querySelector(SUMMARY_SELECTOR);\n assert.instanceOf(collapsedGroupSummary, HTMLElement);\n\n // Focus on the collapsed group and collapse it by clicking on it. Then navigate down.\n dispatchClickEvent(collapsedGroupSummary);\n dispatchKeyDownEvent(collapsedGroupSummary, {key: 'ArrowDown', bubbles: true});\n await RenderCoordinator.done();\n\n const selected = component.shadowRoot.querySelector(TABBABLE_SELECTOR);\n assert.instanceOf(selected, HTMLElement);\n\n const firstBreakpointItem = collapsedDetailsElement.querySelector(BREAKPOINT_ITEM_SELECTOR);\n assert.instanceOf(firstBreakpointItem, HTMLDivElement);\n\n assert.strictEqual(selected, firstBreakpointItem);\n });\n\n it('on the summary node of a collapsed group takes the user to the summary node of the next group', async () => {\n const {component} = await renderBreakpointsForKeyboardNavigation();\n assert.isNotNull(component.shadowRoot);\n\n const firstGroupSummary =\n component.shadowRoot.querySelector(`${DETAILS_SELECTOR}:nth-of-type(1) > ${SUMMARY_SELECTOR}`);\n assert.instanceOf(firstGroupSummary, HTMLElement);\n\n // Focus on the expanded group and collapse it by clicking on it. Then navigate down.\n dispatchClickEvent(firstGroupSummary);\n dispatchKeyDownEvent(firstGroupSummary, {key: 'ArrowDown', bubbles: true});\n await RenderCoordinator.done();\n\n const selected = component.shadowRoot.querySelector(TABBABLE_SELECTOR);\n assert.instanceOf(selected, HTMLElement);\n\n const secondGroupSummary =\n component.shadowRoot.querySelector(`${DETAILS_SELECTOR}:nth-of-type(2) > ${SUMMARY_SELECTOR}`);\n assert.instanceOf(secondGroupSummary, HTMLElement);\n assert.strictEqual(selected, secondGroupSummary);\n });\n\n it('on a breakpoint item takes the user to the next breakpoint item', async () => {\n const {component} = await renderBreakpointsForKeyboardNavigation();\n assert.isNotNull(component.shadowRoot);\n\n const firstDetailsElement = component.shadowRoot.querySelector('details');\n assert.instanceOf(firstDetailsElement, HTMLDetailsElement);\n const firstBreakpointItem = firstDetailsElement.querySelector(BREAKPOINT_ITEM_SELECTOR);\n assert.instanceOf(firstBreakpointItem, HTMLDivElement);\n\n // Focus on the first breakpoint item. Then navigate up.\n dispatchClickEvent(firstBreakpointItem);\n dispatchKeyDownEvent(firstBreakpointItem, {key: 'ArrowDown', bubbles: true});\n await RenderCoordinator.done();\n\n const selected = component.shadowRoot.querySelector(TABBABLE_SELECTOR);\n assert.instanceOf(selected, HTMLElement);\n\n const secondBreakpointItem = firstDetailsElement.querySelector(`${BREAKPOINT_ITEM_SELECTOR}:nth-of-type(2)`);\n assert.instanceOf(secondBreakpointItem, HTMLDivElement);\n\n assert.strictEqual(selected, secondBreakpointItem);\n });\n });\n\n describe('pressing the ArrowUp key', () => {\n it('on the first summary takes a user to the pause on exceptions', async () => {\n const {component} = await renderBreakpointsForKeyboardNavigation();\n assert.isNotNull(component.shadowRoot);\n const firstSummary = component.shadowRoot.querySelector(`${DETAILS_SELECTOR} > ${SUMMARY_SELECTOR}`);\n assert.instanceOf(firstSummary, HTMLElement);\n\n // Focus on the summary element.\n dispatchClickEvent(firstSummary);\n dispatchKeyDownEvent(firstSummary, {key: 'ArrowUp', bubbles: true});\n await RenderCoordinator.done();\n\n const selected = component.shadowRoot.querySelector(TABBABLE_SELECTOR);\n const pauseOnUncaughtExceptions = component.shadowRoot.querySelector(PAUSE_ON_CAUGHT_EXCEPTIONS_SELECTOR);\n assert.instanceOf(pauseOnUncaughtExceptions, HTMLDivElement);\n\n assert.strictEqual(selected, pauseOnUncaughtExceptions);\n });\n\n it('on the first breakpoint item in an expanded group takes the user to the summary node', async () => {\n const {component} = await renderBreakpointsForKeyboardNavigation();\n assert.isNotNull(component.shadowRoot);\n const expandedDetails = component.shadowRoot.querySelector(EXPANDED_GROUPS_SELECTOR);\n assert.instanceOf(expandedDetails, HTMLDetailsElement);\n\n const firstBreakpointItem = expandedDetails.querySelector(BREAKPOINT_ITEM_SELECTOR);\n assert.instanceOf(firstBreakpointItem, HTMLDivElement);\n\n // Focus on first breakpoint item. Then navigate up.\n dispatchClickEvent(firstBreakpointItem);\n dispatchKeyDownEvent(firstBreakpointItem, {key: 'ArrowUp', bubbles: true});\n await RenderCoordinator.done();\n\n const selected = component.shadowRoot.querySelector(TABBABLE_SELECTOR);\n assert.instanceOf(selected, HTMLElement);\n\n const summary = expandedDetails.querySelector(SUMMARY_SELECTOR);\n assert.instanceOf(summary, HTMLElement);\n\n assert.strictEqual(selected, summary);\n });\n\n it('on a breakpoint item in an expanded group takes the user to the previous breakpoint item', async () => {\n const {component} = await renderBreakpointsForKeyboardNavigation();\n assert.isNotNull(component.shadowRoot);\n const expandedDetails = component.shadowRoot.querySelector(EXPANDED_GROUPS_SELECTOR);\n assert.instanceOf(expandedDetails, HTMLDetailsElement);\n\n const breakpointItems = expandedDetails.querySelectorAll(BREAKPOINT_ITEM_SELECTOR);\n assert.isAbove(breakpointItems.length, 1);\n\n const lastBreakpointItem = breakpointItems.item(breakpointItems.length - 1);\n // Focus on last breakpoint item. Then navigate up.\n dispatchClickEvent(lastBreakpointItem);\n dispatchKeyDownEvent(lastBreakpointItem, {key: 'ArrowUp', bubbles: true});\n await RenderCoordinator.done();\n\n const selected = component.shadowRoot.querySelector(TABBABLE_SELECTOR);\n assert.instanceOf(selected, HTMLElement);\n\n const nextToLastBreakpointItem = breakpointItems.item(breakpointItems.length - 2);\n assert.instanceOf(nextToLastBreakpointItem, HTMLDivElement);\n assert.strictEqual(selected, nextToLastBreakpointItem);\n });\n\n it('on a summary node takes the user to the last breakpoint item of the previous group', async () => {\n const {component} = await renderBreakpointsForKeyboardNavigation();\n assert.isNotNull(component.shadowRoot);\n const secondGroupSummary =\n component.shadowRoot.querySelector(`${DETAILS_SELECTOR}:nth-of-type(2) > ${SUMMARY_SELECTOR}`);\n assert.instanceOf(secondGroupSummary, HTMLElement);\n\n // Focus on the group. Then navigate up.\n dispatchClickEvent(secondGroupSummary);\n dispatchKeyDownEvent(secondGroupSummary, {key: 'ArrowUp', bubbles: true});\n await RenderCoordinator.done();\n\n const selected = component.shadowRoot.querySelector(TABBABLE_SELECTOR);\n assert.instanceOf(selected, HTMLElement);\n\n const firstDetailsElement = component.shadowRoot.querySelector(DETAILS_SELECTOR);\n assert.exists(firstDetailsElement);\n const lastBreakpointItem = firstDetailsElement.querySelector(`${BREAKPOINT_ITEM_SELECTOR}:last-child`);\n assert.instanceOf(lastBreakpointItem, HTMLDivElement);\n\n assert.strictEqual(selected, lastBreakpointItem);\n });\n });\n });\n});\n"]} \ No newline at end of file diff --git a/public/panels/sources/components/HeadersView.test.js b/public/panels/sources/components/HeadersView.test.js index 25b78b0a8..55379ae33 100644 --- a/public/panels/sources/components/HeadersView.test.js +++ b/public/panels/sources/components/HeadersView.test.js @@ -8,9 +8,8 @@ import { dispatchFocusEvent, dispatchFocusOutEvent, dispatchInputEvent, dispatch import { deinitializeGlobalVars, initializeGlobalVars, } from '../../../testing/EnvironmentHelpers.js'; import { createFileSystemUISourceCode } from '../../../testing/UISourceCodeHelpers.js'; import { recordedMetricsContain, resetRecordedMetrics, } from '../../../testing/UserMetricsHelpers.js'; -import * as Coordinator from '../../../ui/components/render_coordinator/render_coordinator.js'; +import * as RenderCoordinator from '../../../ui/components/render_coordinator/render_coordinator.js'; import * as SourcesComponents from './components.js'; -const coordinator = Coordinator.RenderCoordinator.RenderCoordinator.instance(); describe('HeadersView', () => { const commitWorkingCopySpy = sinon.spy(); before(async () => { @@ -59,7 +58,7 @@ describe('HeadersView', () => { }; renderElementIntoDOM(editor); assert.isNotNull(editor.shadowRoot); - await coordinator.done(); + await RenderCoordinator.done(); return editor; } async function renderEditorWithinWrapper() { @@ -95,11 +94,11 @@ describe('HeadersView', () => { project.canSetFileContent = () => true; const editorWrapper = new SourcesComponents.HeadersView.HeadersView(uiSourceCode); await uiSourceCode.requestContentData(); - await coordinator.done(); + await RenderCoordinator.done(); const editor = editorWrapper.getComponent(); renderElementIntoDOM(editor); assert.isNotNull(editor.shadowRoot); - await coordinator.done(); + await RenderCoordinator.done(); workspace.removeProject(project); return editor; } @@ -108,7 +107,7 @@ describe('HeadersView', () => { editable.innerText = value; dispatchInputEvent(editable, { inputType: 'insertText', data: value, bubbles: true, composed: true }); dispatchFocusOutEvent(editable, { bubbles: true }); - await coordinator.done(); + await RenderCoordinator.done(); assert.isTrue(recordedMetricsContain("DevTools.ActionTaken" /* Host.InspectorFrontendHostAPI.EnumeratedHistogram.ActionTaken */, Host.UserMetrics.Action.HeaderOverrideHeadersFileEdited)); } async function pressButton(shadowRoot, rowIndex, selector) { @@ -116,7 +115,7 @@ describe('HeadersView', () => { const button = rowElements[rowIndex].querySelector(selector); assert.instanceOf(button, HTMLElement); button.click(); - await coordinator.done(); + await RenderCoordinator.done(); } function getRowContent(shadowRoot) { const rows = Array.from(shadowRoot.querySelectorAll('.row')); @@ -159,7 +158,7 @@ describe('HeadersView', () => { }; renderElementIntoDOM(editor); assert.isNotNull(editor.shadowRoot); - await coordinator.done(); + await RenderCoordinator.done(); const errorHeader = editor.shadowRoot.querySelector('.error-header'); assert.strictEqual(errorHeader?.textContent, 'Error when parsing \'.headers\'.'); }); @@ -200,7 +199,7 @@ describe('HeadersView', () => { assert.isNotNull(editor.shadowRoot); assert.deepEqual(getSingleRowContent(editor.shadowRoot, 1), 'server:DevTools Unit Test Server'); const editables = editor.shadowRoot.querySelectorAll('.editable'); - assert.strictEqual(editables.length, 8); + assert.lengthOf(editables, 8); const headerValue = editables[2]; headerValue.focus(); headerValue.innerText = 'discard_me'; @@ -209,7 +208,7 @@ describe('HeadersView', () => { key: 'Escape', bubbles: true, }); - await coordinator.done(); + await RenderCoordinator.done(); assert.deepEqual(getSingleRowContent(editor.shadowRoot, 1), 'server:DevTools Unit Test Server'); const headerName = editables[1]; headerName.focus(); @@ -219,7 +218,7 @@ describe('HeadersView', () => { key: 'Escape', bubbles: true, }); - await coordinator.done(); + await RenderCoordinator.done(); assert.deepEqual(getSingleRowContent(editor.shadowRoot, 1), 'server:DevTools Unit Test Server'); }); it('selects the whole content when clicking on an editable field', async () => { @@ -250,7 +249,7 @@ describe('HeadersView', () => { const editor = await renderEditor(); assert.isNotNull(editor.shadowRoot); const editables = editor.shadowRoot.querySelectorAll('.editable'); - assert.strictEqual(editables.length, 8); + assert.lengthOf(editables, 8); const lastHeaderName = editables[6]; const lastHeaderValue = editables[7]; assert.isFalse(lastHeaderName.hasSelection()); @@ -270,7 +269,7 @@ describe('HeadersView', () => { const editor = await renderEditor(); assert.isNotNull(editor.shadowRoot); const editables = editor.shadowRoot.querySelectorAll('.editable'); - assert.strictEqual(editables.length, 8); + assert.lengthOf(editables, 8); const applyTo = editables[5]; assert.strictEqual(applyTo.innerHTML, '*.jpg'); applyTo.innerText = ''; @@ -292,14 +291,14 @@ describe('HeadersView', () => { 'jpg-header:only for jpg files', ]); const editables = editor.shadowRoot.querySelectorAll('.editable'); - assert.strictEqual(editables.length, 8); + assert.lengthOf(editables, 8); const headerName = editables[1]; assert.strictEqual(headerName.innerHTML, 'server'); headerName.innerText = ''; dispatchInputEvent(headerName, { inputType: 'deleteContentBackward', data: null, bubbles: true }); assert.strictEqual(headerName.innerHTML, ''); dispatchFocusOutEvent(headerName, { bubbles: true }); - await coordinator.done(); + await RenderCoordinator.done(); rows = getRowContent(editor.shadowRoot); assert.deepEqual(rows, [ 'Apply to:*', @@ -312,7 +311,7 @@ describe('HeadersView', () => { }); it('allows adding headers', async () => { const editor = await renderEditorWithinWrapper(); - await coordinator.done(); + await RenderCoordinator.done(); assert.isNotNull(editor.shadowRoot); let rows = getRowContent(editor.shadowRoot); assert.deepEqual(rows, [ @@ -348,7 +347,7 @@ describe('HeadersView', () => { }); it('allows adding "ApplyTo"-blocks', async () => { const editor = await renderEditorWithinWrapper(); - await coordinator.done(); + await RenderCoordinator.done(); assert.isNotNull(editor.shadowRoot); let rows = getRowContent(editor.shadowRoot); assert.deepEqual(rows, [ @@ -361,7 +360,7 @@ describe('HeadersView', () => { const button = editor.shadowRoot.querySelector('.add-block'); assert.instanceOf(button, HTMLElement); button.click(); - await coordinator.done(); + await RenderCoordinator.done(); rows = getRowContent(editor.shadowRoot); assert.deepEqual(rows, [ 'Apply to:*', @@ -390,7 +389,7 @@ describe('HeadersView', () => { }); it('allows removing headers', async () => { const editor = await renderEditorWithinWrapper(); - await coordinator.done(); + await RenderCoordinator.done(); assert.isNotNull(editor.shadowRoot); let rows = getRowContent(editor.shadowRoot); assert.deepEqual(rows, [ @@ -424,7 +423,7 @@ describe('HeadersView', () => { }); it('allows removing "ApplyTo"-blocks', async () => { const editor = await renderEditorWithinWrapper(); - await coordinator.done(); + await RenderCoordinator.done(); assert.isNotNull(editor.shadowRoot); let rows = getRowContent(editor.shadowRoot); assert.deepEqual(rows, [ @@ -446,7 +445,7 @@ describe('HeadersView', () => { const editor = await renderEditor(); assert.isNotNull(editor.shadowRoot); const editables = editor.shadowRoot.querySelectorAll('.editable'); - assert.strictEqual(editables.length, 8); + assert.lengthOf(editables, 8); assert.deepEqual(getSingleRowContent(editor.shadowRoot, 2), 'access-control-allow-origin:*'); const headerValue = editables[4]; headerValue.focus(); @@ -454,7 +453,7 @@ describe('HeadersView', () => { dt.setData('text/plain', 'foo\nbar'); dt.setData('text/html', 'This is bold'); dispatchPasteEvent(headerValue, { clipboardData: dt, bubbles: true }); - await coordinator.done(); + await RenderCoordinator.done(); assert.deepEqual(getSingleRowContent(editor.shadowRoot, 2), 'access-control-allow-origin:foo bar'); assert.isTrue(recordedMetricsContain("DevTools.ActionTaken" /* Host.InspectorFrontendHostAPI.EnumeratedHistogram.ActionTaken */, Host.UserMetrics.Action.HeaderOverrideHeadersFileEdited)); }); diff --git a/public/panels/sources/components/HeadersView.test.js.map b/public/panels/sources/components/HeadersView.test.js.map index fabc30332..aa8c9fd58 100644 --- a/public/panels/sources/components/HeadersView.test.js.map +++ b/public/panels/sources/components/HeadersView.test.js.map @@ -1 +1 @@ -{"version":3,"file":"HeadersView.test.js","sourceRoot":"","sources":["../../../../../../../front_end/panels/sources/components/HeadersView.test.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,KAAK,IAAI,MAAM,4BAA4B,CAAC;AAEnD,OAAO,KAAK,SAAS,MAAM,wCAAwC,CAAC;AACpE,OAAO,EACL,wBAAwB,GACzB,MAAM,wCAAwC,CAAC;AAChD,OAAO,EACL,kBAAkB,EAClB,qBAAqB,EACrB,kBAAkB,EAClB,oBAAoB,EACpB,kBAAkB,EAClB,oBAAoB,GACrB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,MAAM,CAAC,SAAS,CAAC,mBAAmB,CAAC,MAAM,CAAC,UAAU,EAAE,CAAC,CAAC,EAAE,+BAA+B,CAAC,CAAC;QAE7F,MAAM,WAAW,GAAG,SAAS,CAAC,CAAC,CAAoB,CAAC;QACpD,WAAW,CAAC,KAAK,EAAE,CAAC;QACpB,MAAM,EAAE,GAAG,IAAI,YAAY,EAAE,CAAC;QAC9B,EAAE,CAAC,OAAO,CAAC,YAAY,EAAE,UAAU,CAAC,CAAC;QACrC,EAAE,CAAC,OAAO,CAAC,WAAW,EAAE,qBAAqB,CAAC,CAAC;QAC/C,kBAAkB,CAAC,WAAW,EAAE,EAAC,aAAa,EAAE,EAAE,EAAE,OAAO,EAAE,IAAI,EAAC,CAAC,CAAC;QACpE,MAAM,WAAW,CAAC,IAAI,EAAE,CAAC;QACzB,MAAM,CAAC,SAAS,CAAC,mBAAmB,CAAC,MAAM,CAAC,UAAU,EAAE,CAAC,CAAC,EAAE,qCAAqC,CAAC,CAAC;QACnG,MAAM,CAAC,MAAM,CAAC,sBAAsB,6FAEhC,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,+BAA+B,CAAC,CAAC,CAAC;IAChE,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,oBAAoB,EAAE,KAAK,IAAI,EAAE;QAClC,MAAM,MAAM,GAAG,MAAM,YAAY,EAAE,CAAC;QACpC,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;QACpC,MAAM,WAAW,GAAG,wBAAwB,CAAC,MAAM,CAAC,CAAC;QACrD,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;IAC7B,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["// Copyright 2022 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport * as Host from '../../../core/host/host.js';\nimport type * as Platform from '../../../core/platform/platform.js';\nimport * as Workspace from '../../../models/workspace/workspace.js';\nimport {\n getContextMenuForElement,\n} from '../../../testing/ContextMenuHelpers.js';\nimport {\n dispatchFocusEvent,\n dispatchFocusOutEvent,\n dispatchInputEvent,\n dispatchKeyDownEvent,\n dispatchPasteEvent,\n renderElementIntoDOM,\n} from '../../../testing/DOMHelpers.js';\nimport {\n deinitializeGlobalVars,\n initializeGlobalVars,\n} from '../../../testing/EnvironmentHelpers.js';\nimport {createFileSystemUISourceCode} from '../../../testing/UISourceCodeHelpers.js';\nimport {\n recordedMetricsContain,\n resetRecordedMetrics,\n} from '../../../testing/UserMetricsHelpers.js';\nimport * as Coordinator from '../../../ui/components/render_coordinator/render_coordinator.js';\n\nimport * as SourcesComponents from './components.js';\n\nconst coordinator = Coordinator.RenderCoordinator.RenderCoordinator.instance();\n\ndescribe('HeadersView', () => {\n const commitWorkingCopySpy = sinon.spy();\n\n before(async () => {\n await initializeGlobalVars();\n });\n\n after(async () => {\n await deinitializeGlobalVars();\n });\n\n beforeEach(() => {\n commitWorkingCopySpy.resetHistory();\n resetRecordedMetrics();\n });\n\n async function renderEditor(): Promise {\n const editor = new SourcesComponents.HeadersView.HeadersViewComponent();\n editor.data = {\n headerOverrides: [\n {\n applyTo: '*',\n headers: [\n {\n name: 'server',\n value: 'DevTools Unit Test Server',\n },\n {\n name: 'access-control-allow-origin',\n value: '*',\n },\n ],\n },\n {\n applyTo: '*.jpg',\n headers: [\n {\n name: 'jpg-header',\n value: 'only for jpg files',\n },\n ],\n },\n ],\n parsingError: false,\n uiSourceCode: {\n name: () => '.headers',\n setWorkingCopy: () => {},\n commitWorkingCopy: commitWorkingCopySpy,\n } as unknown as Workspace.UISourceCode.UISourceCode,\n };\n renderElementIntoDOM(editor);\n assert.isNotNull(editor.shadowRoot);\n await coordinator.done();\n return editor;\n }\n\n async function renderEditorWithinWrapper(): Promise {\n const workspace = Workspace.Workspace.WorkspaceImpl.instance();\n const headers = `[\n {\n \"applyTo\": \"*\",\n \"headers\": [\n {\n \"name\": \"server\",\n \"value\": \"DevTools Unit Test Server\"\n },\n {\n \"name\": \"access-control-allow-origin\",\n \"value\": \"*\"\n }\n ]\n },\n {\n \"applyTo\": \"*.jpg\",\n \"headers\": [{\n \"name\": \"jpg-header\",\n \"value\": \"only for jpg files\"\n }]\n }\n ]`;\n const {uiSourceCode, project} = createFileSystemUISourceCode({\n url: 'file:///path/to/overrides/example.html' as Platform.DevToolsPath.UrlString,\n mimeType: 'text/html',\n content: headers,\n });\n uiSourceCode.commitWorkingCopy = commitWorkingCopySpy;\n project.canSetFileContent = () => true;\n\n const editorWrapper = new SourcesComponents.HeadersView.HeadersView(uiSourceCode);\n await uiSourceCode.requestContentData();\n await coordinator.done();\n const editor = editorWrapper.getComponent();\n renderElementIntoDOM(editor);\n assert.isNotNull(editor.shadowRoot);\n await coordinator.done();\n workspace.removeProject(project);\n return editor;\n }\n\n async function changeEditable(editable: HTMLElement, value: string): Promise {\n dispatchFocusEvent(editable, {bubbles: true});\n editable.innerText = value;\n dispatchInputEvent(editable, {inputType: 'insertText', data: value, bubbles: true, composed: true});\n dispatchFocusOutEvent(editable, {bubbles: true});\n await coordinator.done();\n assert.isTrue(recordedMetricsContain(\n Host.InspectorFrontendHostAPI.EnumeratedHistogram.ActionTaken,\n Host.UserMetrics.Action.HeaderOverrideHeadersFileEdited));\n }\n\n async function pressButton(shadowRoot: ShadowRoot, rowIndex: number, selector: string): Promise {\n const rowElements = shadowRoot.querySelectorAll('.row');\n const button = rowElements[rowIndex].querySelector(selector);\n assert.instanceOf(button, HTMLElement);\n button.click();\n await coordinator.done();\n }\n\n function getRowContent(shadowRoot: ShadowRoot): string[] {\n const rows = Array.from(shadowRoot.querySelectorAll('.row'));\n return rows.map(row => {\n return Array.from(row.querySelectorAll('div, .editable'))\n .map(element => (element as HTMLElement).innerText)\n .join('');\n });\n }\n\n function getSingleRowContent(shadowRoot: ShadowRoot, rowIndex: number): string {\n const rows = Array.from(shadowRoot.querySelectorAll('.row'));\n assert.isTrue(rows.length > rowIndex);\n return Array.from(rows[rowIndex].querySelectorAll('div, .editable'))\n .map(element => (element as HTMLElement).innerText)\n .join('');\n }\n\n function isWholeElementContentSelected(element: HTMLElement): boolean {\n const textContent = element.textContent;\n if (!textContent || textContent.length < 1 || !element.hasSelection()) {\n return false;\n }\n const selection = element.getComponentSelection();\n if (!selection || selection.rangeCount < 1) {\n return false;\n }\n if (selection.anchorNode !== selection.focusNode) {\n return false;\n }\n const range = selection.getRangeAt(0);\n return (range.endOffset - range.startOffset === textContent.length);\n }\n\n it('shows an error message when parsingError is true', async () => {\n const editor = new SourcesComponents.HeadersView.HeadersViewComponent();\n editor.data = {\n headerOverrides: [],\n parsingError: true,\n uiSourceCode: {\n name: () => '.headers',\n } as Workspace.UISourceCode.UISourceCode,\n };\n renderElementIntoDOM(editor);\n assert.isNotNull(editor.shadowRoot);\n await coordinator.done();\n\n const errorHeader = editor.shadowRoot.querySelector('.error-header');\n assert.strictEqual(errorHeader?.textContent, 'Error when parsing \\'.headers\\'.');\n });\n\n it('displays data and allows editing', async () => {\n const editor = await renderEditor();\n assert.isNotNull(editor.shadowRoot);\n\n let rows = getRowContent(editor.shadowRoot);\n assert.deepEqual(rows, [\n 'Apply to:*',\n 'server:DevTools Unit Test Server',\n 'access-control-allow-origin:*',\n 'Apply to:*.jpg',\n 'jpg-header:only for jpg files',\n ]);\n\n const addRuleButton = editor.shadowRoot.querySelector('.add-block');\n assert.instanceOf(addRuleButton, HTMLElement);\n assert.strictEqual(addRuleButton.textContent?.trim(), 'Add override rule');\n\n const learnMoreLink = editor.shadowRoot.querySelector('.learn-more-row x-link');\n assert.instanceOf(learnMoreLink, HTMLElement);\n assert.strictEqual(learnMoreLink.title, 'https://goo.gle/devtools-override');\n\n const editables = editor.shadowRoot.querySelectorAll('.editable');\n await changeEditable(editables[0] as HTMLElement, 'index.html');\n await changeEditable(editables[1] as HTMLElement, 'content-type');\n await changeEditable(editables[4] as HTMLElement, 'example.com');\n await changeEditable(editables[7] as HTMLElement, 'is image');\n\n rows = getRowContent(editor.shadowRoot);\n assert.deepEqual(rows, [\n 'Apply to:index.html',\n 'content-type:DevTools Unit Test Server',\n 'access-control-allow-origin:example.com',\n 'Apply to:*.jpg',\n 'jpg-header:is image',\n ]);\n assert.strictEqual(commitWorkingCopySpy.callCount, 4);\n });\n\n it('resets edited value to previous state on Escape key', async () => {\n const editor = await renderEditor();\n assert.isNotNull(editor.shadowRoot);\n assert.deepEqual(getSingleRowContent(editor.shadowRoot, 1), 'server:DevTools Unit Test Server');\n\n const editables = editor.shadowRoot.querySelectorAll('.editable');\n assert.strictEqual(editables.length, 8);\n const headerValue = editables[2] as HTMLElement;\n headerValue.focus();\n headerValue.innerText = 'discard_me';\n assert.deepEqual(getSingleRowContent(editor.shadowRoot, 1), 'server:discard_me');\n\n dispatchKeyDownEvent(headerValue, {\n key: 'Escape',\n bubbles: true,\n });\n await coordinator.done();\n assert.deepEqual(getSingleRowContent(editor.shadowRoot, 1), 'server:DevTools Unit Test Server');\n\n const headerName = editables[1] as HTMLElement;\n headerName.focus();\n headerName.innerText = 'discard_me_2';\n assert.deepEqual(getSingleRowContent(editor.shadowRoot, 1), 'discard_me_2:DevTools Unit Test Server');\n\n dispatchKeyDownEvent(headerName, {\n key: 'Escape',\n bubbles: true,\n });\n await coordinator.done();\n assert.deepEqual(getSingleRowContent(editor.shadowRoot, 1), 'server:DevTools Unit Test Server');\n });\n\n it('selects the whole content when clicking on an editable field', async () => {\n const editor = await renderEditor();\n assert.isNotNull(editor.shadowRoot);\n const editables = editor.shadowRoot.querySelectorAll('.editable');\n\n let element = editables[0] as HTMLElement;\n element.focus();\n assert.isTrue(isWholeElementContentSelected(element));\n\n element = editables[1] as HTMLElement;\n element.focus();\n assert.isTrue(isWholeElementContentSelected(element));\n\n element = editables[2] as HTMLElement;\n element.focus();\n assert.isTrue(isWholeElementContentSelected(element));\n });\n\n it('un-selects the content when an editable field loses focus', async () => {\n const editor = await renderEditor();\n assert.isNotNull(editor.shadowRoot);\n const editables = editor.shadowRoot.querySelectorAll('.editable');\n\n const element = editables[0] as HTMLElement;\n element.focus();\n assert.isTrue(isWholeElementContentSelected(element));\n element.blur();\n assert.isFalse(element.hasSelection());\n });\n\n it('handles pressing \\'Enter\\' key by removing focus and moving it to the next field if possible', async () => {\n const editor = await renderEditor();\n assert.isNotNull(editor.shadowRoot);\n const editables = editor.shadowRoot.querySelectorAll('.editable');\n assert.strictEqual(editables.length, 8);\n\n const lastHeaderName = editables[6] as HTMLSpanElement;\n const lastHeaderValue = editables[7] as HTMLSpanElement;\n assert.isFalse(lastHeaderName.hasSelection());\n assert.isFalse(lastHeaderValue.hasSelection());\n\n lastHeaderName.focus();\n assert.isTrue(isWholeElementContentSelected(lastHeaderName));\n assert.isFalse(lastHeaderValue.hasSelection());\n\n dispatchKeyDownEvent(lastHeaderName, {key: 'Enter', bubbles: true});\n assert.isFalse(lastHeaderName.hasSelection());\n assert.isTrue(isWholeElementContentSelected(lastHeaderValue));\n\n dispatchKeyDownEvent(lastHeaderValue, {key: 'Enter', bubbles: true});\n for (const editable of editables) {\n assert.isFalse(editable.hasSelection());\n }\n });\n\n it('sets empty \\'ApplyTo\\' to \\'*\\'', async () => {\n const editor = await renderEditor();\n assert.isNotNull(editor.shadowRoot);\n const editables = editor.shadowRoot.querySelectorAll('.editable');\n assert.strictEqual(editables.length, 8);\n\n const applyTo = editables[5] as HTMLSpanElement;\n assert.strictEqual(applyTo.innerHTML, '*.jpg');\n\n applyTo.innerText = '';\n dispatchInputEvent(applyTo, {inputType: 'deleteContentBackward', data: null, bubbles: true});\n assert.strictEqual(applyTo.innerHTML, '');\n\n dispatchFocusOutEvent(applyTo, {bubbles: true});\n assert.strictEqual(applyTo.innerHTML, '*');\n assert.strictEqual(commitWorkingCopySpy.callCount, 1);\n });\n\n it('removes the entire header when the header name is deleted', async () => {\n const editor = await renderEditorWithinWrapper();\n assert.isNotNull(editor.shadowRoot);\n let rows = getRowContent(editor.shadowRoot);\n assert.deepEqual(rows, [\n 'Apply to:*',\n 'server:DevTools Unit Test Server',\n 'access-control-allow-origin:*',\n 'Apply to:*.jpg',\n 'jpg-header:only for jpg files',\n ]);\n\n const editables = editor.shadowRoot.querySelectorAll('.editable');\n assert.strictEqual(editables.length, 8);\n\n const headerName = editables[1] as HTMLSpanElement;\n assert.strictEqual(headerName.innerHTML, 'server');\n\n headerName.innerText = '';\n dispatchInputEvent(headerName, {inputType: 'deleteContentBackward', data: null, bubbles: true});\n assert.strictEqual(headerName.innerHTML, '');\n\n dispatchFocusOutEvent(headerName, {bubbles: true});\n await coordinator.done();\n\n rows = getRowContent(editor.shadowRoot);\n assert.deepEqual(rows, [\n 'Apply to:*',\n 'access-control-allow-origin:*',\n 'Apply to:*.jpg',\n 'jpg-header:only for jpg files',\n ]);\n assert.strictEqual(commitWorkingCopySpy.callCount, 1);\n assert.isTrue(recordedMetricsContain(\n Host.InspectorFrontendHostAPI.EnumeratedHistogram.ActionTaken,\n Host.UserMetrics.Action.HeaderOverrideHeadersFileEdited));\n });\n\n it('allows adding headers', async () => {\n const editor = await renderEditorWithinWrapper();\n await coordinator.done();\n assert.isNotNull(editor.shadowRoot);\n\n let rows = getRowContent(editor.shadowRoot);\n assert.deepEqual(rows, [\n 'Apply to:*',\n 'server:DevTools Unit Test Server',\n 'access-control-allow-origin:*',\n 'Apply to:*.jpg',\n 'jpg-header:only for jpg files',\n ]);\n\n await pressButton(editor.shadowRoot, 1, '.add-header');\n\n rows = getRowContent(editor.shadowRoot);\n assert.deepEqual(rows, [\n 'Apply to:*',\n 'server:DevTools Unit Test Server',\n 'header-name-1:header value',\n 'access-control-allow-origin:*',\n 'Apply to:*.jpg',\n 'jpg-header:only for jpg files',\n ]);\n assert.isTrue(recordedMetricsContain(\n Host.InspectorFrontendHostAPI.EnumeratedHistogram.ActionTaken,\n Host.UserMetrics.Action.HeaderOverrideHeadersFileEdited));\n\n const editables = editor.shadowRoot.querySelectorAll('.editable');\n await changeEditable(editables[3] as HTMLElement, 'cache-control');\n await changeEditable(editables[4] as HTMLElement, 'max-age=1000');\n\n rows = getRowContent(editor.shadowRoot);\n assert.deepEqual(rows, [\n 'Apply to:*',\n 'server:DevTools Unit Test Server',\n 'cache-control:max-age=1000',\n 'access-control-allow-origin:*',\n 'Apply to:*.jpg',\n 'jpg-header:only for jpg files',\n ]);\n });\n\n it('allows adding \"ApplyTo\"-blocks', async () => {\n const editor = await renderEditorWithinWrapper();\n await coordinator.done();\n assert.isNotNull(editor.shadowRoot);\n\n let rows = getRowContent(editor.shadowRoot);\n assert.deepEqual(rows, [\n 'Apply to:*',\n 'server:DevTools Unit Test Server',\n 'access-control-allow-origin:*',\n 'Apply to:*.jpg',\n 'jpg-header:only for jpg files',\n ]);\n\n const button = editor.shadowRoot.querySelector('.add-block');\n assert.instanceOf(button, HTMLElement);\n button.click();\n await coordinator.done();\n\n rows = getRowContent(editor.shadowRoot);\n assert.deepEqual(rows, [\n 'Apply to:*',\n 'server:DevTools Unit Test Server',\n 'access-control-allow-origin:*',\n 'Apply to:*.jpg',\n 'jpg-header:only for jpg files',\n 'Apply to:*',\n 'header-name-1:header value',\n ]);\n assert.isTrue(recordedMetricsContain(\n Host.InspectorFrontendHostAPI.EnumeratedHistogram.ActionTaken,\n Host.UserMetrics.Action.HeaderOverrideHeadersFileEdited));\n\n const editables = editor.shadowRoot.querySelectorAll('.editable');\n await changeEditable(editables[8] as HTMLElement, 'articles/*');\n await changeEditable(editables[9] as HTMLElement, 'cache-control');\n await changeEditable(editables[10] as HTMLElement, 'max-age=1000');\n\n rows = getRowContent(editor.shadowRoot);\n assert.deepEqual(rows, [\n 'Apply to:*',\n 'server:DevTools Unit Test Server',\n 'access-control-allow-origin:*',\n 'Apply to:*.jpg',\n 'jpg-header:only for jpg files',\n 'Apply to:articles/*',\n 'cache-control:max-age=1000',\n ]);\n });\n\n it('allows removing headers', async () => {\n const editor = await renderEditorWithinWrapper();\n await coordinator.done();\n assert.isNotNull(editor.shadowRoot);\n\n let rows = getRowContent(editor.shadowRoot);\n assert.deepEqual(rows, [\n 'Apply to:*',\n 'server:DevTools Unit Test Server',\n 'access-control-allow-origin:*',\n 'Apply to:*.jpg',\n 'jpg-header:only for jpg files',\n ]);\n\n await pressButton(editor.shadowRoot, 1, '.remove-header');\n\n rows = getRowContent(editor.shadowRoot);\n assert.deepEqual(rows, [\n 'Apply to:*',\n 'access-control-allow-origin:*',\n 'Apply to:*.jpg',\n 'jpg-header:only for jpg files',\n ]);\n assert.isTrue(recordedMetricsContain(\n Host.InspectorFrontendHostAPI.EnumeratedHistogram.ActionTaken,\n Host.UserMetrics.Action.HeaderOverrideHeadersFileEdited));\n\n let hiddenDeleteElements = await editor.shadowRoot.querySelectorAll('.row.padded > .remove-header[hidden]');\n assert.isTrue(hiddenDeleteElements.length === 0, 'remove-header button is visible');\n\n await pressButton(editor.shadowRoot, 1, '.remove-header');\n\n rows = getRowContent(editor.shadowRoot);\n assert.deepEqual(rows, [\n 'Apply to:*',\n 'header-name-1:header value',\n 'Apply to:*.jpg',\n 'jpg-header:only for jpg files',\n ]);\n\n hiddenDeleteElements = await editor.shadowRoot.querySelectorAll('.row.padded > .remove-header[hidden]');\n assert.isTrue(hiddenDeleteElements.length === 1, 'remove-header button is hidden');\n });\n\n it('allows removing \"ApplyTo\"-blocks', async () => {\n const editor = await renderEditorWithinWrapper();\n await coordinator.done();\n assert.isNotNull(editor.shadowRoot);\n\n let rows = getRowContent(editor.shadowRoot);\n assert.deepEqual(rows, [\n 'Apply to:*',\n 'server:DevTools Unit Test Server',\n 'access-control-allow-origin:*',\n 'Apply to:*.jpg',\n 'jpg-header:only for jpg files',\n ]);\n\n await pressButton(editor.shadowRoot, 0, '.remove-block');\n\n rows = getRowContent(editor.shadowRoot);\n assert.deepEqual(rows, [\n 'Apply to:*.jpg',\n 'jpg-header:only for jpg files',\n ]);\n assert.isTrue(recordedMetricsContain(\n Host.InspectorFrontendHostAPI.EnumeratedHistogram.ActionTaken,\n Host.UserMetrics.Action.HeaderOverrideHeadersFileEdited));\n });\n\n it('removes formatting for pasted content', async () => {\n const editor = await renderEditor();\n assert.isNotNull(editor.shadowRoot);\n const editables = editor.shadowRoot.querySelectorAll('.editable');\n assert.strictEqual(editables.length, 8);\n assert.deepEqual(getSingleRowContent(editor.shadowRoot, 2), 'access-control-allow-origin:*');\n\n const headerValue = editables[4] as HTMLSpanElement;\n headerValue.focus();\n const dt = new DataTransfer();\n dt.setData('text/plain', 'foo\\nbar');\n dt.setData('text/html', 'This is bold');\n dispatchPasteEvent(headerValue, {clipboardData: dt, bubbles: true});\n await coordinator.done();\n assert.deepEqual(getSingleRowContent(editor.shadowRoot, 2), 'access-control-allow-origin:foo bar');\n assert.isTrue(recordedMetricsContain(\n Host.InspectorFrontendHostAPI.EnumeratedHistogram.ActionTaken,\n Host.UserMetrics.Action.HeaderOverrideHeadersFileEdited));\n });\n\n it('shows context menu', async () => {\n const editor = await renderEditor();\n assert.isNotNull(editor.shadowRoot);\n const contextMenu = getContextMenuForElement(editor);\n assert.exists(contextMenu);\n });\n});\n"]} \ No newline at end of file +{"version":3,"file":"HeadersView.test.js","sourceRoot":"","sources":["../../../../../../../front_end/panels/sources/components/HeadersView.test.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,KAAK,IAAI,MAAM,4BAA4B,CAAC;AAEnD,OAAO,KAAK,SAAS,MAAM,wCAAwC,CAAC;AACpE,OAAO,EACL,wBAAwB,GACzB,MAAM,wCAAwC,CAAC;AAChD,OAAO,EACL,kBAAkB,EAClB,qBAAqB,EACrB,kBAAkB,EAClB,oBAAoB,EACpB,kBAAkB,EAClB,oBAAoB,GACrB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EACL,sBAAsB,EACtB,oBAAoB,GACrB,MAAM,wCAAwC,CAAC;AAChD,OAAO,EAAC,4BAA4B,EAAC,MAAM,yCAAyC,CAAC;AACrF,OAAO,EACL,sBAAsB,EACtB,oBAAoB,GACrB,MAAM,wCAAwC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AAU,CAAC,CAAC;QACrC,EAAE,CAAC,OAAO,CAAC,WAAW,EAAE,qBAAqB,CAAC,CAAC;QAC/C,kBAAkB,CAAC,WAAW,EAAE,EAAC,aAAa,EAAE,EAAE,EAAE,OAAO,EAAE,IAAI,EAAC,CAAC,CAAC;QACpE,MAAM,iBAAiB,CAAC,IAAI,EAAE,CAAC;QAC/B,MAAM,CAAC,SAAS,CAAC,mBAAmB,CAAC,MAAM,CAAC,UAAU,EAAE,CAAC,CAAC,EAAE,qCAAqC,CAAC,CAAC;QACnG,MAAM,CAAC,MAAM,CAAC,sBAAsB,6FAEhC,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,+BAA+B,CAAC,CAAC,CAAC;IAChE,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,oBAAoB,EAAE,KAAK,IAAI,EAAE;QAClC,MAAM,MAAM,GAAG,MAAM,YAAY,EAAE,CAAC;QACpC,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;QACpC,MAAM,WAAW,GAAG,wBAAwB,CAAC,MAAM,CAAC,CAAC;QACrD,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;IAC7B,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["// Copyright 2022 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport * as Host from '../../../core/host/host.js';\nimport type * as Platform from '../../../core/platform/platform.js';\nimport * as Workspace from '../../../models/workspace/workspace.js';\nimport {\n getContextMenuForElement,\n} from '../../../testing/ContextMenuHelpers.js';\nimport {\n dispatchFocusEvent,\n dispatchFocusOutEvent,\n dispatchInputEvent,\n dispatchKeyDownEvent,\n dispatchPasteEvent,\n renderElementIntoDOM,\n} from '../../../testing/DOMHelpers.js';\nimport {\n deinitializeGlobalVars,\n initializeGlobalVars,\n} from '../../../testing/EnvironmentHelpers.js';\nimport {createFileSystemUISourceCode} from '../../../testing/UISourceCodeHelpers.js';\nimport {\n recordedMetricsContain,\n resetRecordedMetrics,\n} from '../../../testing/UserMetricsHelpers.js';\nimport * as RenderCoordinator from '../../../ui/components/render_coordinator/render_coordinator.js';\n\nimport * as SourcesComponents from './components.js';\n\ndescribe('HeadersView', () => {\n const commitWorkingCopySpy = sinon.spy();\n\n before(async () => {\n await initializeGlobalVars();\n });\n\n after(async () => {\n await deinitializeGlobalVars();\n });\n\n beforeEach(() => {\n commitWorkingCopySpy.resetHistory();\n resetRecordedMetrics();\n });\n\n async function renderEditor(): Promise {\n const editor = new SourcesComponents.HeadersView.HeadersViewComponent();\n editor.data = {\n headerOverrides: [\n {\n applyTo: '*',\n headers: [\n {\n name: 'server',\n value: 'DevTools Unit Test Server',\n },\n {\n name: 'access-control-allow-origin',\n value: '*',\n },\n ],\n },\n {\n applyTo: '*.jpg',\n headers: [\n {\n name: 'jpg-header',\n value: 'only for jpg files',\n },\n ],\n },\n ],\n parsingError: false,\n uiSourceCode: {\n name: () => '.headers',\n setWorkingCopy: () => {},\n commitWorkingCopy: commitWorkingCopySpy,\n } as unknown as Workspace.UISourceCode.UISourceCode,\n };\n renderElementIntoDOM(editor);\n assert.isNotNull(editor.shadowRoot);\n await RenderCoordinator.done();\n return editor;\n }\n\n async function renderEditorWithinWrapper(): Promise {\n const workspace = Workspace.Workspace.WorkspaceImpl.instance();\n const headers = `[\n {\n \"applyTo\": \"*\",\n \"headers\": [\n {\n \"name\": \"server\",\n \"value\": \"DevTools Unit Test Server\"\n },\n {\n \"name\": \"access-control-allow-origin\",\n \"value\": \"*\"\n }\n ]\n },\n {\n \"applyTo\": \"*.jpg\",\n \"headers\": [{\n \"name\": \"jpg-header\",\n \"value\": \"only for jpg files\"\n }]\n }\n ]`;\n const {uiSourceCode, project} = createFileSystemUISourceCode({\n url: 'file:///path/to/overrides/example.html' as Platform.DevToolsPath.UrlString,\n mimeType: 'text/html',\n content: headers,\n });\n uiSourceCode.commitWorkingCopy = commitWorkingCopySpy;\n project.canSetFileContent = () => true;\n\n const editorWrapper = new SourcesComponents.HeadersView.HeadersView(uiSourceCode);\n await uiSourceCode.requestContentData();\n await RenderCoordinator.done();\n const editor = editorWrapper.getComponent();\n renderElementIntoDOM(editor);\n assert.isNotNull(editor.shadowRoot);\n await RenderCoordinator.done();\n workspace.removeProject(project);\n return editor;\n }\n\n async function changeEditable(editable: HTMLElement, value: string): Promise {\n dispatchFocusEvent(editable, {bubbles: true});\n editable.innerText = value;\n dispatchInputEvent(editable, {inputType: 'insertText', data: value, bubbles: true, composed: true});\n dispatchFocusOutEvent(editable, {bubbles: true});\n await RenderCoordinator.done();\n assert.isTrue(recordedMetricsContain(\n Host.InspectorFrontendHostAPI.EnumeratedHistogram.ActionTaken,\n Host.UserMetrics.Action.HeaderOverrideHeadersFileEdited));\n }\n\n async function pressButton(shadowRoot: ShadowRoot, rowIndex: number, selector: string): Promise {\n const rowElements = shadowRoot.querySelectorAll('.row');\n const button = rowElements[rowIndex].querySelector(selector);\n assert.instanceOf(button, HTMLElement);\n button.click();\n await RenderCoordinator.done();\n }\n\n function getRowContent(shadowRoot: ShadowRoot): string[] {\n const rows = Array.from(shadowRoot.querySelectorAll('.row'));\n return rows.map(row => {\n return Array.from(row.querySelectorAll('div, .editable'))\n .map(element => (element as HTMLElement).innerText)\n .join('');\n });\n }\n\n function getSingleRowContent(shadowRoot: ShadowRoot, rowIndex: number): string {\n const rows = Array.from(shadowRoot.querySelectorAll('.row'));\n assert.isTrue(rows.length > rowIndex);\n return Array.from(rows[rowIndex].querySelectorAll('div, .editable'))\n .map(element => (element as HTMLElement).innerText)\n .join('');\n }\n\n function isWholeElementContentSelected(element: HTMLElement): boolean {\n const textContent = element.textContent;\n if (!textContent || textContent.length < 1 || !element.hasSelection()) {\n return false;\n }\n const selection = element.getComponentSelection();\n if (!selection || selection.rangeCount < 1) {\n return false;\n }\n if (selection.anchorNode !== selection.focusNode) {\n return false;\n }\n const range = selection.getRangeAt(0);\n return (range.endOffset - range.startOffset === textContent.length);\n }\n\n it('shows an error message when parsingError is true', async () => {\n const editor = new SourcesComponents.HeadersView.HeadersViewComponent();\n editor.data = {\n headerOverrides: [],\n parsingError: true,\n uiSourceCode: {\n name: () => '.headers',\n } as Workspace.UISourceCode.UISourceCode,\n };\n renderElementIntoDOM(editor);\n assert.isNotNull(editor.shadowRoot);\n await RenderCoordinator.done();\n\n const errorHeader = editor.shadowRoot.querySelector('.error-header');\n assert.strictEqual(errorHeader?.textContent, 'Error when parsing \\'.headers\\'.');\n });\n\n it('displays data and allows editing', async () => {\n const editor = await renderEditor();\n assert.isNotNull(editor.shadowRoot);\n\n let rows = getRowContent(editor.shadowRoot);\n assert.deepEqual(rows, [\n 'Apply to:*',\n 'server:DevTools Unit Test Server',\n 'access-control-allow-origin:*',\n 'Apply to:*.jpg',\n 'jpg-header:only for jpg files',\n ]);\n\n const addRuleButton = editor.shadowRoot.querySelector('.add-block');\n assert.instanceOf(addRuleButton, HTMLElement);\n assert.strictEqual(addRuleButton.textContent?.trim(), 'Add override rule');\n\n const learnMoreLink = editor.shadowRoot.querySelector('.learn-more-row x-link');\n assert.instanceOf(learnMoreLink, HTMLElement);\n assert.strictEqual(learnMoreLink.title, 'https://goo.gle/devtools-override');\n\n const editables = editor.shadowRoot.querySelectorAll('.editable');\n await changeEditable(editables[0] as HTMLElement, 'index.html');\n await changeEditable(editables[1] as HTMLElement, 'content-type');\n await changeEditable(editables[4] as HTMLElement, 'example.com');\n await changeEditable(editables[7] as HTMLElement, 'is image');\n\n rows = getRowContent(editor.shadowRoot);\n assert.deepEqual(rows, [\n 'Apply to:index.html',\n 'content-type:DevTools Unit Test Server',\n 'access-control-allow-origin:example.com',\n 'Apply to:*.jpg',\n 'jpg-header:is image',\n ]);\n assert.strictEqual(commitWorkingCopySpy.callCount, 4);\n });\n\n it('resets edited value to previous state on Escape key', async () => {\n const editor = await renderEditor();\n assert.isNotNull(editor.shadowRoot);\n assert.deepEqual(getSingleRowContent(editor.shadowRoot, 1), 'server:DevTools Unit Test Server');\n\n const editables = editor.shadowRoot.querySelectorAll('.editable');\n assert.lengthOf(editables, 8);\n const headerValue = editables[2] as HTMLElement;\n headerValue.focus();\n headerValue.innerText = 'discard_me';\n assert.deepEqual(getSingleRowContent(editor.shadowRoot, 1), 'server:discard_me');\n\n dispatchKeyDownEvent(headerValue, {\n key: 'Escape',\n bubbles: true,\n });\n await RenderCoordinator.done();\n assert.deepEqual(getSingleRowContent(editor.shadowRoot, 1), 'server:DevTools Unit Test Server');\n\n const headerName = editables[1] as HTMLElement;\n headerName.focus();\n headerName.innerText = 'discard_me_2';\n assert.deepEqual(getSingleRowContent(editor.shadowRoot, 1), 'discard_me_2:DevTools Unit Test Server');\n\n dispatchKeyDownEvent(headerName, {\n key: 'Escape',\n bubbles: true,\n });\n await RenderCoordinator.done();\n assert.deepEqual(getSingleRowContent(editor.shadowRoot, 1), 'server:DevTools Unit Test Server');\n });\n\n it('selects the whole content when clicking on an editable field', async () => {\n const editor = await renderEditor();\n assert.isNotNull(editor.shadowRoot);\n const editables = editor.shadowRoot.querySelectorAll('.editable');\n\n let element = editables[0] as HTMLElement;\n element.focus();\n assert.isTrue(isWholeElementContentSelected(element));\n\n element = editables[1] as HTMLElement;\n element.focus();\n assert.isTrue(isWholeElementContentSelected(element));\n\n element = editables[2] as HTMLElement;\n element.focus();\n assert.isTrue(isWholeElementContentSelected(element));\n });\n\n it('un-selects the content when an editable field loses focus', async () => {\n const editor = await renderEditor();\n assert.isNotNull(editor.shadowRoot);\n const editables = editor.shadowRoot.querySelectorAll('.editable');\n\n const element = editables[0] as HTMLElement;\n element.focus();\n assert.isTrue(isWholeElementContentSelected(element));\n element.blur();\n assert.isFalse(element.hasSelection());\n });\n\n it('handles pressing \\'Enter\\' key by removing focus and moving it to the next field if possible', async () => {\n const editor = await renderEditor();\n assert.isNotNull(editor.shadowRoot);\n const editables = editor.shadowRoot.querySelectorAll('.editable');\n assert.lengthOf(editables, 8);\n\n const lastHeaderName = editables[6] as HTMLSpanElement;\n const lastHeaderValue = editables[7] as HTMLSpanElement;\n assert.isFalse(lastHeaderName.hasSelection());\n assert.isFalse(lastHeaderValue.hasSelection());\n\n lastHeaderName.focus();\n assert.isTrue(isWholeElementContentSelected(lastHeaderName));\n assert.isFalse(lastHeaderValue.hasSelection());\n\n dispatchKeyDownEvent(lastHeaderName, {key: 'Enter', bubbles: true});\n assert.isFalse(lastHeaderName.hasSelection());\n assert.isTrue(isWholeElementContentSelected(lastHeaderValue));\n\n dispatchKeyDownEvent(lastHeaderValue, {key: 'Enter', bubbles: true});\n for (const editable of editables) {\n assert.isFalse(editable.hasSelection());\n }\n });\n\n it('sets empty \\'ApplyTo\\' to \\'*\\'', async () => {\n const editor = await renderEditor();\n assert.isNotNull(editor.shadowRoot);\n const editables = editor.shadowRoot.querySelectorAll('.editable');\n assert.lengthOf(editables, 8);\n\n const applyTo = editables[5] as HTMLSpanElement;\n assert.strictEqual(applyTo.innerHTML, '*.jpg');\n\n applyTo.innerText = '';\n dispatchInputEvent(applyTo, {inputType: 'deleteContentBackward', data: null, bubbles: true});\n assert.strictEqual(applyTo.innerHTML, '');\n\n dispatchFocusOutEvent(applyTo, {bubbles: true});\n assert.strictEqual(applyTo.innerHTML, '*');\n assert.strictEqual(commitWorkingCopySpy.callCount, 1);\n });\n\n it('removes the entire header when the header name is deleted', async () => {\n const editor = await renderEditorWithinWrapper();\n assert.isNotNull(editor.shadowRoot);\n let rows = getRowContent(editor.shadowRoot);\n assert.deepEqual(rows, [\n 'Apply to:*',\n 'server:DevTools Unit Test Server',\n 'access-control-allow-origin:*',\n 'Apply to:*.jpg',\n 'jpg-header:only for jpg files',\n ]);\n\n const editables = editor.shadowRoot.querySelectorAll('.editable');\n assert.lengthOf(editables, 8);\n\n const headerName = editables[1] as HTMLSpanElement;\n assert.strictEqual(headerName.innerHTML, 'server');\n\n headerName.innerText = '';\n dispatchInputEvent(headerName, {inputType: 'deleteContentBackward', data: null, bubbles: true});\n assert.strictEqual(headerName.innerHTML, '');\n\n dispatchFocusOutEvent(headerName, {bubbles: true});\n await RenderCoordinator.done();\n\n rows = getRowContent(editor.shadowRoot);\n assert.deepEqual(rows, [\n 'Apply to:*',\n 'access-control-allow-origin:*',\n 'Apply to:*.jpg',\n 'jpg-header:only for jpg files',\n ]);\n assert.strictEqual(commitWorkingCopySpy.callCount, 1);\n assert.isTrue(recordedMetricsContain(\n Host.InspectorFrontendHostAPI.EnumeratedHistogram.ActionTaken,\n Host.UserMetrics.Action.HeaderOverrideHeadersFileEdited));\n });\n\n it('allows adding headers', async () => {\n const editor = await renderEditorWithinWrapper();\n await RenderCoordinator.done();\n assert.isNotNull(editor.shadowRoot);\n\n let rows = getRowContent(editor.shadowRoot);\n assert.deepEqual(rows, [\n 'Apply to:*',\n 'server:DevTools Unit Test Server',\n 'access-control-allow-origin:*',\n 'Apply to:*.jpg',\n 'jpg-header:only for jpg files',\n ]);\n\n await pressButton(editor.shadowRoot, 1, '.add-header');\n\n rows = getRowContent(editor.shadowRoot);\n assert.deepEqual(rows, [\n 'Apply to:*',\n 'server:DevTools Unit Test Server',\n 'header-name-1:header value',\n 'access-control-allow-origin:*',\n 'Apply to:*.jpg',\n 'jpg-header:only for jpg files',\n ]);\n assert.isTrue(recordedMetricsContain(\n Host.InspectorFrontendHostAPI.EnumeratedHistogram.ActionTaken,\n Host.UserMetrics.Action.HeaderOverrideHeadersFileEdited));\n\n const editables = editor.shadowRoot.querySelectorAll('.editable');\n await changeEditable(editables[3] as HTMLElement, 'cache-control');\n await changeEditable(editables[4] as HTMLElement, 'max-age=1000');\n\n rows = getRowContent(editor.shadowRoot);\n assert.deepEqual(rows, [\n 'Apply to:*',\n 'server:DevTools Unit Test Server',\n 'cache-control:max-age=1000',\n 'access-control-allow-origin:*',\n 'Apply to:*.jpg',\n 'jpg-header:only for jpg files',\n ]);\n });\n\n it('allows adding \"ApplyTo\"-blocks', async () => {\n const editor = await renderEditorWithinWrapper();\n await RenderCoordinator.done();\n assert.isNotNull(editor.shadowRoot);\n\n let rows = getRowContent(editor.shadowRoot);\n assert.deepEqual(rows, [\n 'Apply to:*',\n 'server:DevTools Unit Test Server',\n 'access-control-allow-origin:*',\n 'Apply to:*.jpg',\n 'jpg-header:only for jpg files',\n ]);\n\n const button = editor.shadowRoot.querySelector('.add-block');\n assert.instanceOf(button, HTMLElement);\n button.click();\n await RenderCoordinator.done();\n\n rows = getRowContent(editor.shadowRoot);\n assert.deepEqual(rows, [\n 'Apply to:*',\n 'server:DevTools Unit Test Server',\n 'access-control-allow-origin:*',\n 'Apply to:*.jpg',\n 'jpg-header:only for jpg files',\n 'Apply to:*',\n 'header-name-1:header value',\n ]);\n assert.isTrue(recordedMetricsContain(\n Host.InspectorFrontendHostAPI.EnumeratedHistogram.ActionTaken,\n Host.UserMetrics.Action.HeaderOverrideHeadersFileEdited));\n\n const editables = editor.shadowRoot.querySelectorAll('.editable');\n await changeEditable(editables[8] as HTMLElement, 'articles/*');\n await changeEditable(editables[9] as HTMLElement, 'cache-control');\n await changeEditable(editables[10] as HTMLElement, 'max-age=1000');\n\n rows = getRowContent(editor.shadowRoot);\n assert.deepEqual(rows, [\n 'Apply to:*',\n 'server:DevTools Unit Test Server',\n 'access-control-allow-origin:*',\n 'Apply to:*.jpg',\n 'jpg-header:only for jpg files',\n 'Apply to:articles/*',\n 'cache-control:max-age=1000',\n ]);\n });\n\n it('allows removing headers', async () => {\n const editor = await renderEditorWithinWrapper();\n await RenderCoordinator.done();\n assert.isNotNull(editor.shadowRoot);\n\n let rows = getRowContent(editor.shadowRoot);\n assert.deepEqual(rows, [\n 'Apply to:*',\n 'server:DevTools Unit Test Server',\n 'access-control-allow-origin:*',\n 'Apply to:*.jpg',\n 'jpg-header:only for jpg files',\n ]);\n\n await pressButton(editor.shadowRoot, 1, '.remove-header');\n\n rows = getRowContent(editor.shadowRoot);\n assert.deepEqual(rows, [\n 'Apply to:*',\n 'access-control-allow-origin:*',\n 'Apply to:*.jpg',\n 'jpg-header:only for jpg files',\n ]);\n assert.isTrue(recordedMetricsContain(\n Host.InspectorFrontendHostAPI.EnumeratedHistogram.ActionTaken,\n Host.UserMetrics.Action.HeaderOverrideHeadersFileEdited));\n\n let hiddenDeleteElements = await editor.shadowRoot.querySelectorAll('.row.padded > .remove-header[hidden]');\n assert.isTrue(hiddenDeleteElements.length === 0, 'remove-header button is visible');\n\n await pressButton(editor.shadowRoot, 1, '.remove-header');\n\n rows = getRowContent(editor.shadowRoot);\n assert.deepEqual(rows, [\n 'Apply to:*',\n 'header-name-1:header value',\n 'Apply to:*.jpg',\n 'jpg-header:only for jpg files',\n ]);\n\n hiddenDeleteElements = await editor.shadowRoot.querySelectorAll('.row.padded > .remove-header[hidden]');\n assert.isTrue(hiddenDeleteElements.length === 1, 'remove-header button is hidden');\n });\n\n it('allows removing \"ApplyTo\"-blocks', async () => {\n const editor = await renderEditorWithinWrapper();\n await RenderCoordinator.done();\n assert.isNotNull(editor.shadowRoot);\n\n let rows = getRowContent(editor.shadowRoot);\n assert.deepEqual(rows, [\n 'Apply to:*',\n 'server:DevTools Unit Test Server',\n 'access-control-allow-origin:*',\n 'Apply to:*.jpg',\n 'jpg-header:only for jpg files',\n ]);\n\n await pressButton(editor.shadowRoot, 0, '.remove-block');\n\n rows = getRowContent(editor.shadowRoot);\n assert.deepEqual(rows, [\n 'Apply to:*.jpg',\n 'jpg-header:only for jpg files',\n ]);\n assert.isTrue(recordedMetricsContain(\n Host.InspectorFrontendHostAPI.EnumeratedHistogram.ActionTaken,\n Host.UserMetrics.Action.HeaderOverrideHeadersFileEdited));\n });\n\n it('removes formatting for pasted content', async () => {\n const editor = await renderEditor();\n assert.isNotNull(editor.shadowRoot);\n const editables = editor.shadowRoot.querySelectorAll('.editable');\n assert.lengthOf(editables, 8);\n assert.deepEqual(getSingleRowContent(editor.shadowRoot, 2), 'access-control-allow-origin:*');\n\n const headerValue = editables[4] as HTMLSpanElement;\n headerValue.focus();\n const dt = new DataTransfer();\n dt.setData('text/plain', 'foo\\nbar');\n dt.setData('text/html', 'This is bold');\n dispatchPasteEvent(headerValue, {clipboardData: dt, bubbles: true});\n await RenderCoordinator.done();\n assert.deepEqual(getSingleRowContent(editor.shadowRoot, 2), 'access-control-allow-origin:foo bar');\n assert.isTrue(recordedMetricsContain(\n Host.InspectorFrontendHostAPI.EnumeratedHistogram.ActionTaken,\n Host.UserMetrics.Action.HeaderOverrideHeadersFileEdited));\n });\n\n it('shows context menu', async () => {\n const editor = await renderEditor();\n assert.isNotNull(editor.shadowRoot);\n const contextMenu = getContextMenuForElement(editor);\n assert.exists(contextMenu);\n });\n});\n"]} \ No newline at end of file diff --git a/public/panels/sources/navigatorTree.css.js b/public/panels/sources/navigatorTree.css.js index 2e35cdd04..a5a3d5e79 100644 --- a/public/panels/sources/navigatorTree.css.js +++ b/public/panels/sources/navigatorTree.css.js @@ -112,8 +112,8 @@ styles.replaceSync( color: var(--icon-folder-authored); } -.navigator-fs-tree-item:not(.has-mapped-files):not(.selected) > :not(.selection), -.navigator-fs-folder-tree-item:not(.has-mapped-files):not(.selected) > :not(.selection) { +.navigator-fs-tree-item:not(.has-mapped-files, .selected) > :not(.selection), +.navigator-fs-folder-tree-item:not(.has-mapped-files, .selected) > :not(.selection) { color: var(--sys-color-on-surface-subtle); opacity: 40%; @@ -149,8 +149,8 @@ styles.replaceSync( color: HighlightText; } - .navigator-fs-tree-item:not(.has-mapped-files):not(.selected) > :not(.selection), - .navigator-fs-folder-tree-item:not(.has-mapped-files):not(.selected) > :not(.selection), + .navigator-fs-tree-item:not(.has-mapped-files, .selected) > :not(.selection), + .navigator-fs-folder-tree-item:not(.has-mapped-files, .selected) > :not(.selection), .is-ignore-listed { filter: none; opacity: 100%; diff --git a/public/panels/timeline/EntriesFilter.test.js b/public/panels/timeline/EntriesFilter.test.js index bffadb290..8bce1c24c 100644 --- a/public/panels/timeline/EntriesFilter.test.js +++ b/public/panels/timeline/EntriesFilter.test.js @@ -61,7 +61,7 @@ describeWithEnvironment('EntriesFilter', function () { stack.applyFilterAction({ type: "MERGE_FUNCTION" /* PerfUI.FlameChart.FilterAction.MERGE_FUNCTION */, entry: entryTwo }); assert.isTrue(stack.invisibleEntries().includes(entryTwo), 'entryTwo is invisble'); // Only one entry - the one for the `basicTwo` function - should have been hidden. - assert.strictEqual(stack.invisibleEntries().length, 1); + assert.lengthOf(stack.invisibleEntries(), 1); }); it('adds the parent of the merged entry into the expandableEntries array', async function () { const { parsedTrace } = await TraceLoader.traceEngine(this, 'basic-stack.json.gz'); @@ -413,7 +413,7 @@ describeWithEnvironment('EntriesFilter', function () { // UNDO_ALL_ACTIONS can be called on any visible entry stack.applyFilterAction({ type: "UNDO_ALL_ACTIONS" /* PerfUI.FlameChart.FilterAction.UNDO_ALL_ACTIONS */, entry: basicTwoCallEntry }); // If the length of invisibleEntries list is 0, all of the entries added earlier were removed and are now visible. - assert.strictEqual(stack.invisibleEntries().length, 0); + assert.lengthOf(stack.invisibleEntries(), 0); }); it('supports resetting children of the closest expandable parent when a hidden entry is provided', async function () { const { parsedTrace } = await TraceLoader.traceEngine(this, 'basic-stack.json.gz'); @@ -458,11 +458,11 @@ describeWithEnvironment('EntriesFilter', function () { entry.dur === 827; }); // Make sure no entries are hidden - assert.strictEqual(stack.invisibleEntries().length, 0); + assert.lengthOf(stack.invisibleEntries(), 0); // Collapse all children of basicTwo call: stack.applyFilterAction({ type: "COLLAPSE_FUNCTION" /* PerfUI.FlameChart.FilterAction.COLLAPSE_FUNCTION */, entry: basicTwoCallEntry }); // Make sure all 37 of basicTwo descdendants are hidden - assert.strictEqual(stack.invisibleEntries().length, 37); + assert.lengthOf(stack.invisibleEntries(), 37); // Get the first fibonacci call that is one of the hidden children and make sure it is hidden const firstFibCallEntry = findFirstEntry(mainThread.entries, entry => { return Trace.Types.Events.isProfileCall(entry) && entry.callFrame.functionName === 'fibonacci'; @@ -471,7 +471,7 @@ describeWithEnvironment('EntriesFilter', function () { // Reveal the first fibonacci call and make sure that the all of the entries are now visible because the closest // expandable parent to the fib call is basicTwo and, therefore, we need to reset its children. stack.revealEntry(firstFibCallEntry); - assert.strictEqual(stack.invisibleEntries().length, 0); + assert.lengthOf(stack.invisibleEntries(), 0); }); it('supports resetting all hidden children of a selected entry', async function () { const { parsedTrace } = await TraceLoader.traceEngine(this, 'two-functions-recursion.json.gz'); @@ -549,7 +549,7 @@ describeWithEnvironment('EntriesFilter', function () { }); assert.isTrue(allFoo2InStackAreVisible, 'Some foo2 calls are invisible'); // Reset all children after second foo2 call - assert.strictEqual(foo2Calls.length, 3); + assert.lengthOf(foo2Calls, 3); stack.applyFilterAction({ type: "RESET_CHILDREN" /* PerfUI.FlameChart.FilterAction.RESET_CHILDREN */, entry: foo2Calls[1] }); // All foo and foo2 calls except the second foo cll should now be visible allFoo2InStackAreVisible = foo2Calls.every(fooCall => { @@ -620,11 +620,11 @@ describeWithEnvironment('EntriesFilter', function () { return entry.name === 'RunTask' && entry.dur === 978 && entry.ts === 164397762991; }); // Make sure the expandable entries are empty at first - assert.strictEqual(stack.expandableEntries().length, 0); + assert.lengthOf(stack.expandableEntries(), 0); // Hide the anonymous function stack.applyFilterAction({ type: "MERGE_FUNCTION" /* PerfUI.FlameChart.FilterAction.MERGE_FUNCTION */, entry: anonymousEntryWithInvisibleParent }); // Make sure Task entry is added to expandable entries - assert.strictEqual(stack.expandableEntries().length, 1); + assert.lengthOf(stack.expandableEntries(), 1); assert.isTrue(stack.expandableEntries().includes(taskEntry)); }); it('returns the trace entry tree starting from the root task, highlighting the selected event', async function () { @@ -659,7 +659,7 @@ describeWithEnvironment('EntriesFilter', function () { assert.exists(fooAiNode); // Use the toJSON simplification for comparison. const simpleFooNode = JSON.parse(JSON.stringify(fooAiNode)); - assert.strictEqual(simpleFooNode.children.length, 1); + assert.lengthOf(simpleFooNode.children, 1); // delete for smaller deepStrictEqual comparison simpleFooNode.children = []; assert.deepEqual(simpleFooNode, { diff --git a/public/panels/timeline/EntriesFilter.test.js.map b/public/panels/timeline/EntriesFilter.test.js.map index 842733711..c9e2fc7f3 100644 --- a/public/panels/timeline/EntriesFilter.test.js.map +++ b/public/panels/timeline/EntriesFilter.test.js.map @@ -1 +1 @@ -{"version":3,"file":"EntriesFilter.test.js","sourceRoot":"","sources":["../../../../../../front_end/panels/timeline/EntriesFilter.test.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,gEAAgE;AAChE,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,KAAK,KAAK,MAAM,6BAA6B,CAAC;AACrD,OAAO,EAAC,uBAAuB,EAAC,MAAM,qCAAqC,CAAC;AAC5E,OAAO,EAAC,aAAa,EAAC,MAAM,+BAA+B,CAAC;AAC5D,OAAO,EAAC,WAAW,EAAC,MAAM,8BAA8B,CAAC;AACzD,OAAO,KAAK,MAAM,MAAM,+CAA+C,CAAC;AAExE,OAAO,KAAK,QAAQ,MAAM,eAAe,CAAC;AAE1C,SAAS,cAAc,CACnB,UAA+C,EAC/C,SAAuD;IACzD,MAAM,KAAK,GAAG,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC;IACzD,IAAI,CAAC,KAAK,EAAE,CAAC;QACX,MAAM,IAAI,KAAK,CAAC,gCAAgC,CAAC,CAAC;IACpD,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED,uBAAuB,CAAC,eAAe,EAAE;IACvC,EAAE,CAAC,+DAA+D,EAAE,KAAK;QACvE,MAAM,EAAC,WAAW,EAAC,GAAG,MAAM,WAAW,CAAC,WAAW,CAAC,IAAI,EAAE,qBAAqB,CAAC,CAAC;QACjF,MAAM,KAAK,GAAG,IAAI,QAAQ,CAAC,aAAa,CAAC,aAAa,CAAC,WAAW,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC;QACzF,MAAM,CAAC,SAAS,CAAC,EAAE,EAAE,KAAK,EAAE,gBAAgB,EAAE,CAAC,CAAC;IAClD,CAAC,CA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QAEzB,gDAAgD;QAChD,MAAM,aAAa,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC,CAAC;QAC5D,MAAM,CAAC,WAAW,CAAC,aAAa,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;QAErD,gDAAgD;QAChD,aAAa,CAAC,QAAQ,GAAG,EAAE,CAAC;QAE5B,MAAM,CAAC,SAAS,CAAC,aAAa,EAAE;YAC9B,GAAG,EAAE,GAAG;YACR,IAAI,EAAE,KAAK;YACX,QAAQ,EAAE,IAAI;YACd,IAAI,EAAE,GAAG;YACT,GAAG,EAAE,gEAAgE;YACrE,QAAQ,EAAE,EAAE;SACb,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["// Copyright 2023 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\n// Copyright 2023222 The Chromium Author2s. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport * as Trace from '../../models/trace/trace.js';\nimport {describeWithEnvironment} from '../../testing/EnvironmentHelpers.js';\nimport {getMainThread} from '../../testing/TraceHelpers.js';\nimport {TraceLoader} from '../../testing/TraceLoader.js';\nimport * as PerfUI from '../../ui/legacy/components/perf_ui/perf_ui.js';\n\nimport * as Timeline from './timeline.js';\n\nfunction findFirstEntry(\n allEntries: readonly Trace.Types.Events.Event[],\n predicate: (entry: Trace.Types.Events.Event) => boolean): Trace.Types.Events.Event {\n const entry = allEntries.find(entry => predicate(entry));\n if (!entry) {\n throw new Error('Could not find expected entry.');\n }\n return entry;\n}\n\ndescribeWithEnvironment('EntriesFilter', function() {\n it('parses a stack and returns an empty list of invisible entries', async function() {\n const {parsedTrace} = await TraceLoader.traceEngine(this, 'basic-stack.json.gz');\n const stack = new Timeline.EntriesFilter.EntriesFilter(parsedTrace.Renderer.entryToNode);\n assert.deepEqual([], stack?.invisibleEntries());\n });\n\n it('supports the user merging an entry into its parent', async function() {\n const {parsedTrace} = await TraceLoader.traceEngine(this, 'basic-stack.json.gz');\n const mainThread = getMainThread(parsedTrace.Renderer);\n /** This stack looks roughly like so (with some events omitted):\n * ======== basicStackOne ============\n * =========== basicTwo ==============\n * =========== basicThree ============\n * ======== fibonacci ===\n * ======== fibonacci ===\n * ======== fibonacci ===\n * ======== fibonacci ===\n * ======== fibonacci ===\n * ==== fibonacci ===\n *\n * In this test we want to test the user merging basicTwo into its parent, so the resulting trace should look like so:\n * ======== basicStackOne ============\n * =========== basicThree ============ << No more basicTwo, it has been merged.\n * ======== fibonacci ===\n * ======== fibonacci ===\n * ======== fibonacci ===\n * ======== fibonacci ===\n * ======== fibonacci ===\n * ==== fibonacci ===\n *\n **/\n const entryTwo = findFirstEntry(mainThread.entries, entry => {\n // Processing this trace ends up with two distinct stacks for basicTwo()\n // So we find the first one so we can focus this test on just one stack.\n return Trace.Types.Events.isProfileCall(entry) && entry.callFrame.functionName === 'basicTwo' &&\n entry.dur === 827;\n });\n const stack = new Timeline.EntriesFilter.EntriesFilter(parsedTrace.Renderer.entryToNode);\n if (!stack) {\n throw new Error('EntriesFilter does not exist');\n }\n stack.applyFilterAction({type: PerfUI.FlameChart.FilterAction.MERGE_FUNCTION, entry: entryTwo});\n assert.isTrue(stack.invisibleEntries().includes(entryTwo), 'entryTwo is invisble');\n // Only one entry - the one for the `basicTwo` function - should have been hidden.\n assert.strictEqual(stack.invisibleEntries().length, 1);\n });\n\n it('adds the parent of the merged entry into the expandableEntries array', async function() {\n const {parsedTrace} = await TraceLoader.traceEngine(this, 'basic-stack.json.gz');\n const mainThread = getMainThread(parsedTrace.Renderer);\n /** This stack looks roughly like so (with some events omitted):\n * ======== basicStackOne ============\n * =========== basicTwo ==============\n * =========== basicThree ============\n * ======== fibonacci ===\n * ======== fibonacci ===\n * ======== fibonacci ===\n * ======== fibonacci ===\n *\n * In this test we want to test that the parent of the merged entry is added to the expandableEntries array,\n * so that later an array decoration is added to it and the merged entry could be shown again if the array is clicked.\n * the user merging basicTwo into its parent, so the resulting trace should look like so:\n * ======== basicStackOne ============ << As parent of basicTwo, it belongs to the expandableEntries array\n * =========== basicThree ============ << No more basicTwo, it has been merged.\n * ======== fibonacci ===\n * ======== fibonacci ===\n * ======== fibonacci ===\n * ======== fibonacci ===\n *\n **/\n const entryTwo = findFirstEntry(mainThread.entries, entry => {\n // Processing this trace ends up with two distinct stacks for basicTwo()\n // So we find the first one so we can focus this test on just one stack.\n return Trace.Types.Events.isProfileCall(entry) && entry.callFrame.functionName === 'basicTwo' &&\n entry.dur === 827;\n });\n const stack = new Timeline.EntriesFilter.EntriesFilter(parsedTrace.Renderer.entryToNode);\n if (!stack) {\n throw new Error('EntriesFilter does not exist');\n }\n stack.applyFilterAction({type: PerfUI.FlameChart.FilterAction.MERGE_FUNCTION, entry: entryTwo});\n assert.isTrue(stack.invisibleEntries().includes(entryTwo), 'entryTwo is invisble');\n\n // Get the parent of basicTwo, which is basicStackOne.\n const basicStackOne = findFirstEntry(mainThread.entries, entry => {\n return Trace.Types.Events.isProfileCall(entry) && entry.callFrame.functionName === 'basicStackOne' &&\n entry.dur === 827;\n });\n // Get the parent of basicTwo marked as expandable.\n assert.isTrue(stack.isEntryExpandable(basicStackOne));\n });\n\n it('adds the collapsed entry into the expandableEntries array', async function() {\n const {parsedTrace} = await TraceLoader.traceEngine(this, 'basic-stack.json.gz');\n const mainThread = getMainThread(parsedTrace.Renderer);\n /** This stack looks roughly like so (with some events omitted):\n * ======== basicStackOne ============\n * =========== basicTwo ==============\n * =========== basicThree ============\n * ======== fibonacci ===\n * ======== fibonacci ===\n * ======== fibonacci ===\n * ======== fibonacci ===\n *\n * In this test we want to test that the collapsed entry is added to the expandableEntries array,\n * so that later an arrow decoration is added to it and the collapsed entries could be shown again if the arraw is clicked.\n *\n * The user collapses basicTwo, so the resulting trace should look like so:\n * ======== basicStackOne ============\n * =========== basicTwo ============ << All entries under basicTwo merged collapsed and it belongs to the expandableEntries array\n *\n **/\n const entryTwo = findFirstEntry(mainThread.entries, entry => {\n // Processing this trace ends up with two distinct stacks for basicTwo()\n // So we find the first one so we can focus this test on just one stack.\n return Trace.Types.Events.isProfileCall(entry) && entry.callFrame.functionName === 'basicTwo' &&\n entry.dur === 827;\n });\n const stack = new Timeline.EntriesFilter.EntriesFilter(parsedTrace.Renderer.entryToNode);\n if (!stack) {\n throw new Error('EntriesFilter does not exist');\n }\n stack.applyFilterAction({type: PerfUI.FlameChart.FilterAction.COLLAPSE_FUNCTION, entry: entryTwo});\n // basicTwo is marked as expandable.\n assert.isTrue(stack.isEntryExpandable(entryTwo));\n });\n\n it('adds the next visible parent of the merged entry into the expandableEntries array if the direct parent is hidden',\n async function() {\n const {parsedTrace} = await TraceLoader.traceEngine(this, 'two-functions-recursion.json.gz');\n const mainThread = getMainThread(parsedTrace.Renderer);\n /** This stack looks roughly like so (with some events omitted):\n * ======== onclick ============\n * =========== foo =============\n * ==== foo2 =====\n * ===== foo =====\n * ==== foo2 =====\n * ===== foo =====\n * ==== foo2 =====\n * ===== foo =====\n *\n * In this test we want to test that the next visible parent of the merged entry is added to the\n * expandableEntries array even if the direct one is hidden by some other action,\n * so that later an array decoration is added to it and the merged entry could be shown again if the array is clicked.\n *\n * collapse all repeating calls of foo after the first one:\n * ======== onclick ============\n * =========== foo ============= << all foo except first removed\n * ===== foo2 ====\n * ==== foo2 ===== << direct parent is not visible anymore\n * ==== foo2 =====\n *\n * merge second foo2 and add the next visible parent to the expandableEntries array:\n * ======== onclick ============\n * =========== foo =============\n * ===== foo2 ==== << added to expandableEntries as the next visible parent of the merged entry\n * ==== foo2 =====\n *\n **/\n const firstFooCallEntry = findFirstEntry(mainThread.entries, entry => {\n return Trace.Types.Events.isProfileCall(entry) && entry.callFrame.functionName === 'foo' && entry.dur === 233;\n });\n const firstFooCallEndTime = Trace.Helpers.Timing.eventTimingsMicroSeconds(firstFooCallEntry).endTime;\n const fooCalls = mainThread.entries.filter(entry => {\n const isFooCall = Trace.Types.Events.isProfileCall(entry) && entry.callFrame.functionName === 'foo';\n if (!isFooCall) {\n return false;\n }\n const {endTime} = Trace.Helpers.Timing.eventTimingsMicroSeconds(entry);\n return endTime <= firstFooCallEndTime;\n });\n const stack = new Timeline.EntriesFilter.EntriesFilter(parsedTrace.Renderer.entryToNode);\n if (!stack) {\n throw new Error('EntriesFilter does not exist');\n }\n // Collapse all foo calls after the first one.\n stack.applyFilterAction({\n type: PerfUI.FlameChart.FilterAction.COLLAPSE_REPEATING_DESCENDANTS,\n entry: firstFooCallEntry,\n });\n\n // First foo call is marked as expandable since its' children are hidden.\n assert.isTrue(stack.isEntryExpandable(firstFooCallEntry));\n\n // Make sure all foo calls after first are hidden.\n const allFooExceptFirstInStackAreHidden = fooCalls.every((fooCall, i) => {\n if (i === 0) {\n // First foo should not be invisible.\n return !stack.invisibleEntries().includes(fooCall);\n }\n return stack.invisibleEntries().includes(fooCall);\n });\n assert.isTrue(\n allFooExceptFirstInStackAreHidden, 'First foo is invisible or some following foo calls are still visible');\n\n const foo2Calls = mainThread.entries.filter(entry => {\n const isFoo2Call = Trace.Types.Events.isProfileCall(entry) && entry.callFrame.functionName === 'foo2';\n if (!isFoo2Call) {\n return false;\n }\n const {endTime} = Trace.Helpers.Timing.eventTimingsMicroSeconds(entry);\n return endTime <= firstFooCallEndTime;\n });\n\n // Merge second foo2 entry.\n stack.applyFilterAction({type: PerfUI.FlameChart.FilterAction.MERGE_FUNCTION, entry: foo2Calls[1]});\n // First foo2 entry should be in the expandableEntries array.\n assert.isTrue(stack.isEntryExpandable(foo2Calls[0]));\n });\n\n it('supports collapsing an entry', async function() {\n const {parsedTrace} = await TraceLoader.traceEngine(this, 'basic-stack.json.gz');\n const mainThread = getMainThread(parsedTrace.Renderer);\n /** This stack looks roughly like so (with some events omitted):\n * ======== basicStackOne ============\n * =========== basicTwo ==============\n * =========== basicThree ============\n * ======== fibonacci ===\n * ======== fibonacci ===\n * ======== fibonacci ===\n * ======== fibonacci ===\n * ======== fibonacci ===\n * ==== fibonacci ===\n *\n * In this test we want to test the user collapsing basicTwo, which should have the effect of keeping basicTwo visible, but removing all of its children:\n * ======== basicStackOne ============\n * =========== basicTwo ==============\n * << all children removed\n **/\n const basicTwoCallEntry = findFirstEntry(mainThread.entries, entry => {\n // Processing this trace ends up with two distinct stacks for basicTwo()\n // So we find the first one so we can focus this test on just one stack.\n return Trace.Types.Events.isProfileCall(entry) && entry.callFrame.functionName === 'basicTwo' &&\n entry.dur === 827;\n });\n\n // Gather the fib() calls under the first basicTwo stack, by finding all\n // the calls whose end time is less than or equal to the end time of the\n // `basicTwo` function.\n const fibonacciCalls = mainThread.entries.filter(entry => {\n const isFibCall = Trace.Types.Events.isProfileCall(entry) && entry.callFrame.functionName === 'fibonacci';\n if (!isFibCall) {\n return false;\n }\n const {endTime} = Trace.Helpers.Timing.eventTimingsMicroSeconds(entry);\n const basicTwoCallEndTime = Trace.Helpers.Timing.eventTimingsMicroSeconds(basicTwoCallEntry).endTime;\n return endTime <= basicTwoCallEndTime;\n });\n const stack = new Timeline.EntriesFilter.EntriesFilter(parsedTrace.Renderer.entryToNode);\n if (!stack) {\n throw new Error('EntriesFilter does not exist');\n }\n stack.applyFilterAction({type: PerfUI.FlameChart.FilterAction.COLLAPSE_FUNCTION, entry: basicTwoCallEntry});\n\n // We collapsed at the `basicTwo` entry - so it should not be included in the invisible list itself.\n assert.isFalse(stack.invisibleEntries().includes(basicTwoCallEntry), 'entryTwo is not visible');\n // But all fib() calls below it in the stack should now be invisible.\n const allFibonacciInStackAreHidden = fibonacciCalls.every(fibCall => {\n return stack.invisibleEntries().includes(fibCall);\n });\n assert.isTrue(allFibonacciInStackAreHidden, 'Some fibonacci calls are still visible');\n });\n\n it('supports collapsing all repeating entries among descendants', async function() {\n const {parsedTrace} = await TraceLoader.traceEngine(this, 'two-functions-recursion.json.gz');\n const mainThread = getMainThread(parsedTrace.Renderer);\n /** This stack looks roughly like so (with some events omitted):\n * ======== onclick ============\n * =========== foo =============\n * ==== foo2 =====\n * ===== foo =====\n * ==== foo2 =====\n * ===== foo =====\n * ==== foo2 =====\n * ===== foo =====\n *\n * In this test we want to test the user collapsing all descendant foo calls of the first first one,\n * which should have the effect of keeping the first foo visible, but removing all of its other calls:\n * ======== onclick ============\n * =========== foo =============\n * ===== foo2 ==== << all foo except first removed\n * ==== foo2 =====\n * ==== foo2 =====\n **/\n\n const firstFooCallEntry = findFirstEntry(mainThread.entries, entry => {\n return Trace.Types.Events.isProfileCall(entry) && entry.callFrame.functionName === 'foo' && entry.dur === 233;\n });\n\n // Gather the foo() and foo2() calls under and including the first foo entry, by finding all\n // the calls whose end time is less than or equal to the end time of the first `foo` function.\n const firstFooCallEndTime = Trace.Helpers.Timing.eventTimingsMicroSeconds(firstFooCallEntry).endTime;\n const fooCalls = mainThread.entries.filter(entry => {\n const isFooCall = Trace.Types.Events.isProfileCall(entry) && entry.callFrame.functionName === 'foo';\n if (!isFooCall) {\n return false;\n }\n const {endTime} = Trace.Helpers.Timing.eventTimingsMicroSeconds(entry);\n return endTime <= firstFooCallEndTime;\n });\n\n const foo2Calls = mainThread.entries.filter(entry => {\n const isFoo2Call = Trace.Types.Events.isProfileCall(entry) && entry.callFrame.functionName === 'foo2';\n if (!isFoo2Call) {\n return false;\n }\n const {endTime} = Trace.Helpers.Timing.eventTimingsMicroSeconds(entry);\n return endTime <= firstFooCallEndTime;\n });\n\n const stack = new Timeline.EntriesFilter.EntriesFilter(parsedTrace.Renderer.entryToNode);\n if (!stack) {\n throw new Error('EntriesFilter does not exist');\n }\n stack.applyFilterAction(\n {type: PerfUI.FlameChart.FilterAction.COLLAPSE_REPEATING_DESCENDANTS, entry: firstFooCallEntry});\n\n // We collapsed identical descendants after the first `foo` entry - so it should not be included in the invisible list itself,\n // but all foo() calls below it in the stack should now be invisible.\n const allFooExceptFirstInStackAreHidden = fooCalls.every((fooCall, i) => {\n if (i === 0) {\n // First foo should not be invisible.\n return !stack.invisibleEntries().includes(fooCall);\n }\n return stack.invisibleEntries().includes(fooCall);\n });\n assert.isTrue(\n allFooExceptFirstInStackAreHidden, 'First foo is invisible or some following foo calls are still visible');\n\n // All of the foo2 calls that were inbetween foo calls should still be visible.\n const allFoo2InStackAreVisible = foo2Calls.every(fooCall => {\n return !stack.invisibleEntries().includes(fooCall);\n });\n assert.isTrue(allFoo2InStackAreVisible, 'Some foo2 calls are invisible');\n });\n\n it('supports undo all filter actions by applying context menu undo action', async function() {\n const {parsedTrace} = await TraceLoader.traceEngine(this, 'basic-stack.json.gz');\n const mainThread = getMainThread(parsedTrace.Renderer);\n /** This stack looks roughly like so (with some events omitted):\n * ======== basicStackOne ============\n * =========== basicTwo ==============\n * =========== basicThree ============\n * ======== fibonacci ===\n * ======== fibonacci ===\n * ======== fibonacci ===\n * ======== fibonacci ===\n * ======== fibonacci ===\n * ==== fibonacci ===\n *\n * In this test we want to test the user undoing all actions with 'undo all actions' after applying merge, collapse repeating descendants and collapse function.\n *\n * First, collapse all repeating descendants of the first fibonacci call:\n * ======== basicStackOne ============\n * =========== basicTwo ==============\n * =========== basicThree ============\n * ======== fibonacci === << repeating children removed\n *\n * Then, merge basicStackOne:\n * =========== basicTwo ==============\n * =========== basicThree ============\n * ======== fibonacci ===\n *\n * Finally, collapse basicTwo():\n * =========== basicTwo ==============\n *\n * Applying 'undo all actions' should bring the stack to the original state.\n **/\n\n const stack = new Timeline.EntriesFilter.EntriesFilter(parsedTrace.Renderer.entryToNode);\n if (!stack) {\n throw new Error('EntriesFilter does not exist');\n }\n const basicTwoCallEntry = findFirstEntry(mainThread.entries, entry => {\n // Processing this trace ends up with two distinct stacks for basicTwo()\n // So we find the first one so we can focus this test on just one stack.\n return Trace.Types.Events.isProfileCall(entry) && entry.callFrame.functionName === 'basicTwo' &&\n entry.dur === 827;\n });\n const fibonacciCalls = mainThread.entries.filter(entry => {\n const isFibCall = Trace.Types.Events.isProfileCall(entry) && entry.callFrame.functionName === 'fibonacci';\n if (!isFibCall) {\n return false;\n }\n const {endTime} = Trace.Helpers.Timing.eventTimingsMicroSeconds(entry);\n const basicTwoCallEndTime = Trace.Helpers.Timing.eventTimingsMicroSeconds(basicTwoCallEntry).endTime;\n return endTime <= basicTwoCallEndTime;\n });\n\n // Collapse all repeating descendants of the first fibonacci call:\n stack.applyFilterAction(\n {type: PerfUI.FlameChart.FilterAction.COLLAPSE_REPEATING_DESCENDANTS, entry: fibonacciCalls[0]});\n // We collapsed identical descendants after the first `foo` entry - so it should not be included in the invisible list itself,\n // but all foo() calls below it in the stack should now be invisible.\n const allFibExceptFirstInStackAreHidden = fibonacciCalls.every((fibCall, i) => {\n if (i === 0) {\n // First foo should not be invisible.\n return !stack.invisibleEntries().includes(fibCall);\n }\n return stack.invisibleEntries().includes(fibCall);\n });\n assert.isTrue(\n allFibExceptFirstInStackAreHidden, 'First fib is invisible or some following fib calls are still visible');\n\n // Merge basicStackOne:\n const basicStackOne = findFirstEntry(mainThread.entries, entry => {\n return Trace.Types.Events.isProfileCall(entry) && entry.callFrame.functionName === 'basicStackOne' &&\n entry.dur === 827;\n });\n stack.applyFilterAction({type: PerfUI.FlameChart.FilterAction.MERGE_FUNCTION, entry: basicStackOne});\n assert.isTrue(stack.invisibleEntries().includes(basicStackOne), 'entrybasicStackOneTwo is visble');\n\n // Collapse basicTwo():\n stack.applyFilterAction({type: PerfUI.FlameChart.FilterAction.COLLAPSE_FUNCTION, entry: basicTwoCallEntry});\n // basicThree and first fibnacci should now be hidden:\n const basicThree = findFirstEntry(mainThread.entries, entry => {\n return Trace.Types.Events.isProfileCall(entry) && entry.callFrame.functionName === 'basicThree' &&\n entry.dur === 827;\n });\n assert.isTrue(stack.invisibleEntries().includes(basicThree), 'basicThree is visble');\n assert.isTrue(stack.invisibleEntries().includes(fibonacciCalls[0]), 'first fibonacci is visble');\n\n // Apply UNDO_ALL_ACTIONS to bring back all of the hidden entries:\n // UNDO_ALL_ACTIONS can be called on any visible entry\n stack.applyFilterAction({type: PerfUI.FlameChart.FilterAction.UNDO_ALL_ACTIONS, entry: basicTwoCallEntry});\n // If the length of invisibleEntries list is 0, all of the entries added earlier were removed and are now visible.\n assert.strictEqual(stack.invisibleEntries().length, 0);\n });\n\n it('supports resetting children of the closest expandable parent when a hidden entry is provided', async function() {\n const {parsedTrace} = await TraceLoader.traceEngine(this, 'basic-stack.json.gz');\n const mainThread = getMainThread(parsedTrace.Renderer);\n /** This stack looks roughly like so (with some events omitted):\n * ======== basicStackOne ============\n * =========== basicTwo ==============\n * =========== basicThree ============\n * ======== fibonacci ===\n * ======== fibonacci ===\n * ======== fibonacci ===\n * ======== fibonacci ===\n * ======== fibonacci ===\n * ==== fibonacci ===\n *\n * In this test we want to test the user selecting an entry that is hidden via a link.\n * If this happens, we should reveal this entry to resetting children of the closest expandable parent.\n *\n * First, collapse all children of the basicTwo:\n * ======== basicStackOne ============\n * =========== basicTwo ============== << children collapsed\n * =========== basicThree ============\n * ======== fibonacci === << repeating children removed\n *\n * Then, reveal the first fibonacci entry that is hidden:\n * ======== basicStackOne ============\n * =========== basicTwo ==============\n * =========== basicThree ============\n * ======== fibonacci === << reveal this hidden entry\n * ======== fibonacci ===\n *\n * This should result in all basicTwo children being removed from the invisible array and stack being in the initial state.\n **/\n\n const stack = new Timeline.EntriesFilter.EntriesFilter(parsedTrace.Renderer.entryToNode);\n if (!stack) {\n throw new Error('EntriesFilter does not exist');\n }\n const basicTwoCallEntry = findFirstEntry(mainThread.entries, entry => {\n // Processing this trace ends up with two distinct stacks for basicTwo()\n // So we find the first one so we can focus this test on just one stack.\n return Trace.Types.Events.isProfileCall(entry) && entry.callFrame.functionName === 'basicTwo' &&\n entry.dur === 827;\n });\n\n // Make sure no entries are hidden\n assert.strictEqual(stack.invisibleEntries().length, 0);\n\n // Collapse all children of basicTwo call:\n stack.applyFilterAction({type: PerfUI.FlameChart.FilterAction.COLLAPSE_FUNCTION, entry: basicTwoCallEntry});\n\n // Make sure all 37 of basicTwo descdendants are hidden\n assert.strictEqual(stack.invisibleEntries().length, 37);\n\n // Get the first fibonacci call that is one of the hidden children and make sure it is hidden\n const firstFibCallEntry = findFirstEntry(mainThread.entries, entry => {\n return Trace.Types.Events.isProfileCall(entry) && entry.callFrame.functionName === 'fibonacci';\n });\n\n assert.isTrue(stack.invisibleEntries().includes(firstFibCallEntry));\n\n // Reveal the first fibonacci call and make sure that the all of the entries are now visible because the closest\n // expandable parent to the fib call is basicTwo and, therefore, we need to reset its children.\n stack.revealEntry(firstFibCallEntry);\n assert.strictEqual(stack.invisibleEntries().length, 0);\n });\n\n it('supports resetting all hidden children of a selected entry', async function() {\n const {parsedTrace} = await TraceLoader.traceEngine(this, 'two-functions-recursion.json.gz');\n const mainThread = getMainThread(parsedTrace.Renderer);\n /** This stack looks roughly like so (with some events omitted):\n * ======== onclick ============\n * =========== foo =============\n * ==== foo2 =====\n * ===== foo =====\n * ==== foo2 =====\n * ===== foo =====\n * ==== foo2 =====\n * ===== foo =====\n *\n * In this test we want to test the user collapsing all descendant foo calls of the first first one,\n * which should have the effect of keeping the first foo visible, but removing all of its other calls:\n * ======== onclick ============\n * =========== foo =============\n * ===== foo2 ==== << all foo except first removed\n * ==== foo2 =====\n * ==== foo2 =====\n *\n * Then, reset children on the second visible foo2.\n * ======== onclick ============\n * =========== foo =============\n * ===== foo2 ==== << foo() after this entry still hidden\n * ==== foo2 ===== << all children from this node are visible\n * ===== foo =====\n * ==== foo2 =====\n * ===== foo =====\n *\n * This results in a stack where all children of an entry children were reset on (second foo2)\n * are visible, but the entries hidden above the entry children were reset on stay hidden.\n **/\n\n const firstFooCallEntry = findFirstEntry(mainThread.entries, entry => {\n return Trace.Types.Events.isProfileCall(entry) && entry.callFrame.functionName === 'foo' && entry.dur === 233;\n });\n\n // Gather the foo() and foo2() calls under and including the first foo entry, by finding all\n // the calls whose end time is less than or equal to the end time of the first `foo` function.\n const firstFooCallEndTime = Trace.Helpers.Timing.eventTimingsMicroSeconds(firstFooCallEntry).endTime;\n const fooCalls = mainThread.entries.filter(entry => {\n const isFooCall = Trace.Types.Events.isProfileCall(entry) && entry.callFrame.functionName === 'foo';\n if (!isFooCall) {\n return false;\n }\n const {endTime} = Trace.Helpers.Timing.eventTimingsMicroSeconds(entry);\n return endTime <= firstFooCallEndTime;\n });\n\n const foo2Calls = mainThread.entries.filter(entry => {\n const isFoo2Call = Trace.Types.Events.isProfileCall(entry) && entry.callFrame.functionName === 'foo2';\n if (!isFoo2Call) {\n return false;\n }\n const {endTime} = Trace.Helpers.Timing.eventTimingsMicroSeconds(entry);\n return endTime <= firstFooCallEndTime;\n });\n\n const stack = new Timeline.EntriesFilter.EntriesFilter(parsedTrace.Renderer.entryToNode);\n if (!stack) {\n throw new Error('EntriesFilter does not exist');\n }\n stack.applyFilterAction(\n {type: PerfUI.FlameChart.FilterAction.COLLAPSE_REPEATING_DESCENDANTS, entry: firstFooCallEntry});\n\n // We collapsed identical descendants after the first `foo` entry - so it should not be included in the invisible list itself,\n // but all foo() calls below it in the stack should now be invisible.\n const allFooExceptFirstInStackAreHidden = fooCalls.every((fooCall, i) => {\n if (i === 0) {\n // First foo should not be invisible.\n return !stack.invisibleEntries().includes(fooCall);\n }\n return stack.invisibleEntries().includes(fooCall);\n });\n assert.isTrue(\n allFooExceptFirstInStackAreHidden, 'First foo is invisible or some following foo calls are still visible');\n\n // All of the foo2 calls that were inbetween foo calls should still be visible.\n let allFoo2InStackAreVisible = foo2Calls.every(fooCall => {\n return !stack.invisibleEntries().includes(fooCall);\n });\n assert.isTrue(allFoo2InStackAreVisible, 'Some foo2 calls are invisible');\n\n // Reset all children after second foo2 call\n assert.strictEqual(foo2Calls.length, 3);\n stack.applyFilterAction({type: PerfUI.FlameChart.FilterAction.RESET_CHILDREN, entry: foo2Calls[1]});\n\n // All foo and foo2 calls except the second foo cll should now be visible\n allFoo2InStackAreVisible = foo2Calls.every(fooCall => {\n return !stack.invisibleEntries().includes(fooCall);\n });\n assert.isTrue(allFoo2InStackAreVisible, 'Some foo2 calls are invisible');\n\n const allFooExceptSecondInStackAreVisible = fooCalls.every((fooCall, i) => {\n if (i === 1) {\n // Second foo should be invisible.\n return stack.invisibleEntries().includes(fooCall);\n }\n return !stack.invisibleEntries().includes(fooCall);\n });\n assert.isTrue(\n allFooExceptSecondInStackAreVisible,\n 'Some foo calls except the second one are invisible or the second one is visible');\n });\n\n it('correctly returns the amount of hidden children of a node', async function() {\n const {parsedTrace} = await TraceLoader.traceEngine(this, 'two-functions-recursion.json.gz');\n const mainThread = getMainThread(parsedTrace.Renderer);\n /** This stack looks roughly like so (with some erlier events omitted):\n * ======== onclick ============\n * =========== foo =============\n * ==== foo2 =====\n * ===== foo =====\n * ==== foo2 =====\n * ===== foo =====\n * ==== foo2 =====\n * ===== foo =====\n *\n * In this test we want to test if the amount of hidden children returned is correct:\n * If we collapse repeating children on the first foo call, the 3 child foo calls should be removed.\n * Therefore, the amount of hidden children should be equal to 3.\n * ======== onclick ============\n * =========== foo ============= << all foo except first hidden\n * ===== foo2 ====\n * ==== foo2 =====\n * ==== foo2 =====\n **/\n\n const firstFooCallEntry = findFirstEntry(mainThread.entries, entry => {\n return Trace.Types.Events.isProfileCall(entry) && entry.callFrame.functionName === 'foo' && entry.dur === 233;\n });\n\n const stack = new Timeline.EntriesFilter.EntriesFilter(parsedTrace.Renderer.entryToNode);\n if (!stack) {\n throw new Error('EntriesFilter does not exist');\n }\n // Before applying any action on a node, there should be no entries hidden under it\n assert.strictEqual(stack.findHiddenDescendantsAmount(firstFooCallEntry), 0);\n\n stack.applyFilterAction(\n {type: PerfUI.FlameChart.FilterAction.COLLAPSE_REPEATING_DESCENDANTS, entry: firstFooCallEntry});\n\n // There should be 3 foo() entries hidden under the first foo call entry\n assert.strictEqual(stack.findHiddenDescendantsAmount(firstFooCallEntry), 3);\n });\n\n it('correctly assigns a visible parent to expandable entries if the direct parent is not visible', async function() {\n const {parsedTrace} = await TraceLoader.traceEngine(this, 'basic-stack.json.gz');\n const mainThread = getMainThread(parsedTrace.Renderer);\n /** This stack looks roughly like so (with some events omitted):\n * ======== Task ===============\n * ======== (anonymous) ======== << entry with an invisible in the timeline direct parent. We need to make sure that we correctly add Task to the expandable entries\n * ======== RegisterFrameID ====\n * ======== postMessage ========\n **/\n const anonymousEntryWithInvisibleParent = findFirstEntry(mainThread.entries, entry => {\n return Trace.Types.Events.isProfileCall(entry) && entry.nodeId === 42;\n });\n\n const stack = new Timeline.EntriesFilter.EntriesFilter(parsedTrace.Renderer.entryToNode);\n if (!stack) {\n throw new Error('EntriesFilter does not exist');\n }\n\n const taskEntry = findFirstEntry(mainThread.entries, entry => {\n return entry.name === 'RunTask' && entry.dur === 978 && entry.ts === 164397762991;\n });\n\n // Make sure the expandable entries are empty at first\n assert.strictEqual(stack.expandableEntries().length, 0);\n\n // Hide the anonymous function\n stack.applyFilterAction(\n {type: PerfUI.FlameChart.FilterAction.MERGE_FUNCTION, entry: anonymousEntryWithInvisibleParent});\n\n // Make sure Task entry is added to expandable entries\n assert.strictEqual(stack.expandableEntries().length, 1);\n assert.isTrue(stack.expandableEntries().includes(taskEntry));\n });\n\n it('returns the trace entry tree starting from the root task, highlighting the selected event', async function() {\n const {parsedTrace} = await TraceLoader.traceEngine(this, 'two-functions-recursion.json.gz');\n const mainThread = getMainThread(parsedTrace.Renderer);\n /** This stack looks roughly like so (with some events omitted):\n * ===========RunTask===========\n * ...\n * ======== onclick ============\n * =========== foo =============\n * ==== foo2 =====\n * ===== foo =====\n * ==== foo2 =====\n * ===== foo =====\n * ==== foo2 =====\n * ===== foo =====\n *\n * In this test we want to test if for a selected entry, the tree for AI processing\n * is generated correctly such that the root RunTask is the root node and the\n * node for the selected event has property selected set as true.\n **/\n\n const firstFooCallEntry = findFirstEntry(mainThread.entries, entry => {\n return Trace.Types.Events.isProfileCall(entry) && entry.callFrame.functionName === 'foo' && entry.dur === 233;\n });\n\n const entriesFilter = new Timeline.EntriesFilter.EntriesFilter(parsedTrace.Renderer.entryToNode);\n if (!entriesFilter) {\n throw new Error('EntriesFilter does not exist');\n }\n const aiNodeTree = entriesFilter.getAIEventNodeTree(firstFooCallEntry);\n assert.exists(aiNodeTree);\n\n const fooAiNode = Trace.Helpers.TreeHelpers.AINode.getSelectedNodeWithinTree(aiNodeTree);\n assert.exists(fooAiNode);\n\n // Use the toJSON simplification for comparison.\n const simpleFooNode = JSON.parse(JSON.stringify(fooAiNode));\n assert.strictEqual(simpleFooNode.children.length, 1);\n\n // delete for smaller deepStrictEqual comparison\n simpleFooNode.children = [];\n\n assert.deepEqual(simpleFooNode, {\n dur: 0.2,\n name: 'foo',\n selected: true,\n self: 0.2,\n url: 'file:///usr/local/google/home/alinavarkki/stack/recursion.html',\n children: [],\n });\n });\n});\n"]} \ No newline at end of file +{"version":3,"file":"EntriesFilter.test.js","sourceRoot":"","sources":["../../../../../../front_end/panels/timeline/EntriesFilter.test.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,gEAAgE;AAChE,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,KAAK,KAAK,MAAM,6BAA6B,CAAC;AACrD,OAAO,EAAC,uBAAuB,EAAC,MAAM,qCAAqC,CAAC;AAC5E,OAAO,EAAC,aAAa,EAAC,MAAM,+BAA+B,CAAC;AAC5D,OAAO,EAAC,WAAW,EAAC,MAAM,8BAA8B,CAAC;AACzD,OAAO,KAAK,MAAM,MAAM,+CAA+C,CAAC;AAExE,OAAO,KAAK,QAAQ,MAAM,eAAe,CAAC;AAE1C,SAAS,cAAc,CACnB,UAA+C,EAC/C,SAAuD;IACzD,MAAM,KAAK,GAAG,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC;IACzD,IAAI,CAAC,KAAK,EAAE,CAAC;QACX,MAAM,IAAI,KAAK,CAAC,gCAAgC,CAAC,CAAC;IACpD,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED,uBAAu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;QAClD,CAAC;QACD,MAAM,UAAU,GAAG,aAAa,CAAC,kBAAkB,CAAC,iBAAiB,CAAC,CAAC;QACvE,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;QAE1B,MAAM,SAAS,GAAG,KAAK,CAAC,OAAO,CAAC,WAAW,CAAC,MAAM,CAAC,yBAAyB,CAAC,UAAU,CAAC,CAAC;QACzF,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;QAEzB,gDAAgD;QAChD,MAAM,aAAa,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC,CAAC;QAC5D,MAAM,CAAC,QAAQ,CAAC,aAAa,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC;QAE3C,gDAAgD;QAChD,aAAa,CAAC,QAAQ,GAAG,EAAE,CAAC;QAE5B,MAAM,CAAC,SAAS,CAAC,aAAa,EAAE;YAC9B,GAAG,EAAE,GAAG;YACR,IAAI,EAAE,KAAK;YACX,QAAQ,EAAE,IAAI;YACd,IAAI,EAAE,GAAG;YACT,GAAG,EAAE,gEAAgE;YACrE,QAAQ,EAAE,EAAE;SACb,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["// Copyright 2023 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\n// Copyright 2023222 The Chromium Author2s. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport * as Trace from '../../models/trace/trace.js';\nimport {describeWithEnvironment} from '../../testing/EnvironmentHelpers.js';\nimport {getMainThread} from '../../testing/TraceHelpers.js';\nimport {TraceLoader} from '../../testing/TraceLoader.js';\nimport * as PerfUI from '../../ui/legacy/components/perf_ui/perf_ui.js';\n\nimport * as Timeline from './timeline.js';\n\nfunction findFirstEntry(\n allEntries: readonly Trace.Types.Events.Event[],\n predicate: (entry: Trace.Types.Events.Event) => boolean): Trace.Types.Events.Event {\n const entry = allEntries.find(entry => predicate(entry));\n if (!entry) {\n throw new Error('Could not find expected entry.');\n }\n return entry;\n}\n\ndescribeWithEnvironment('EntriesFilter', function() {\n it('parses a stack and returns an empty list of invisible entries', async function() {\n const {parsedTrace} = await TraceLoader.traceEngine(this, 'basic-stack.json.gz');\n const stack = new Timeline.EntriesFilter.EntriesFilter(parsedTrace.Renderer.entryToNode);\n assert.deepEqual([], stack?.invisibleEntries());\n });\n\n it('supports the user merging an entry into its parent', async function() {\n const {parsedTrace} = await TraceLoader.traceEngine(this, 'basic-stack.json.gz');\n const mainThread = getMainThread(parsedTrace.Renderer);\n /** This stack looks roughly like so (with some events omitted):\n * ======== basicStackOne ============\n * =========== basicTwo ==============\n * =========== basicThree ============\n * ======== fibonacci ===\n * ======== fibonacci ===\n * ======== fibonacci ===\n * ======== fibonacci ===\n * ======== fibonacci ===\n * ==== fibonacci ===\n *\n * In this test we want to test the user merging basicTwo into its parent, so the resulting trace should look like so:\n * ======== basicStackOne ============\n * =========== basicThree ============ << No more basicTwo, it has been merged.\n * ======== fibonacci ===\n * ======== fibonacci ===\n * ======== fibonacci ===\n * ======== fibonacci ===\n * ======== fibonacci ===\n * ==== fibonacci ===\n *\n **/\n const entryTwo = findFirstEntry(mainThread.entries, entry => {\n // Processing this trace ends up with two distinct stacks for basicTwo()\n // So we find the first one so we can focus this test on just one stack.\n return Trace.Types.Events.isProfileCall(entry) && entry.callFrame.functionName === 'basicTwo' &&\n entry.dur === 827;\n });\n const stack = new Timeline.EntriesFilter.EntriesFilter(parsedTrace.Renderer.entryToNode);\n if (!stack) {\n throw new Error('EntriesFilter does not exist');\n }\n stack.applyFilterAction({type: PerfUI.FlameChart.FilterAction.MERGE_FUNCTION, entry: entryTwo});\n assert.isTrue(stack.invisibleEntries().includes(entryTwo), 'entryTwo is invisble');\n // Only one entry - the one for the `basicTwo` function - should have been hidden.\n assert.lengthOf(stack.invisibleEntries(), 1);\n });\n\n it('adds the parent of the merged entry into the expandableEntries array', async function() {\n const {parsedTrace} = await TraceLoader.traceEngine(this, 'basic-stack.json.gz');\n const mainThread = getMainThread(parsedTrace.Renderer);\n /** This stack looks roughly like so (with some events omitted):\n * ======== basicStackOne ============\n * =========== basicTwo ==============\n * =========== basicThree ============\n * ======== fibonacci ===\n * ======== fibonacci ===\n * ======== fibonacci ===\n * ======== fibonacci ===\n *\n * In this test we want to test that the parent of the merged entry is added to the expandableEntries array,\n * so that later an array decoration is added to it and the merged entry could be shown again if the array is clicked.\n * the user merging basicTwo into its parent, so the resulting trace should look like so:\n * ======== basicStackOne ============ << As parent of basicTwo, it belongs to the expandableEntries array\n * =========== basicThree ============ << No more basicTwo, it has been merged.\n * ======== fibonacci ===\n * ======== fibonacci ===\n * ======== fibonacci ===\n * ======== fibonacci ===\n *\n **/\n const entryTwo = findFirstEntry(mainThread.entries, entry => {\n // Processing this trace ends up with two distinct stacks for basicTwo()\n // So we find the first one so we can focus this test on just one stack.\n return Trace.Types.Events.isProfileCall(entry) && entry.callFrame.functionName === 'basicTwo' &&\n entry.dur === 827;\n });\n const stack = new Timeline.EntriesFilter.EntriesFilter(parsedTrace.Renderer.entryToNode);\n if (!stack) {\n throw new Error('EntriesFilter does not exist');\n }\n stack.applyFilterAction({type: PerfUI.FlameChart.FilterAction.MERGE_FUNCTION, entry: entryTwo});\n assert.isTrue(stack.invisibleEntries().includes(entryTwo), 'entryTwo is invisble');\n\n // Get the parent of basicTwo, which is basicStackOne.\n const basicStackOne = findFirstEntry(mainThread.entries, entry => {\n return Trace.Types.Events.isProfileCall(entry) && entry.callFrame.functionName === 'basicStackOne' &&\n entry.dur === 827;\n });\n // Get the parent of basicTwo marked as expandable.\n assert.isTrue(stack.isEntryExpandable(basicStackOne));\n });\n\n it('adds the collapsed entry into the expandableEntries array', async function() {\n const {parsedTrace} = await TraceLoader.traceEngine(this, 'basic-stack.json.gz');\n const mainThread = getMainThread(parsedTrace.Renderer);\n /** This stack looks roughly like so (with some events omitted):\n * ======== basicStackOne ============\n * =========== basicTwo ==============\n * =========== basicThree ============\n * ======== fibonacci ===\n * ======== fibonacci ===\n * ======== fibonacci ===\n * ======== fibonacci ===\n *\n * In this test we want to test that the collapsed entry is added to the expandableEntries array,\n * so that later an arrow decoration is added to it and the collapsed entries could be shown again if the arraw is clicked.\n *\n * The user collapses basicTwo, so the resulting trace should look like so:\n * ======== basicStackOne ============\n * =========== basicTwo ============ << All entries under basicTwo merged collapsed and it belongs to the expandableEntries array\n *\n **/\n const entryTwo = findFirstEntry(mainThread.entries, entry => {\n // Processing this trace ends up with two distinct stacks for basicTwo()\n // So we find the first one so we can focus this test on just one stack.\n return Trace.Types.Events.isProfileCall(entry) && entry.callFrame.functionName === 'basicTwo' &&\n entry.dur === 827;\n });\n const stack = new Timeline.EntriesFilter.EntriesFilter(parsedTrace.Renderer.entryToNode);\n if (!stack) {\n throw new Error('EntriesFilter does not exist');\n }\n stack.applyFilterAction({type: PerfUI.FlameChart.FilterAction.COLLAPSE_FUNCTION, entry: entryTwo});\n // basicTwo is marked as expandable.\n assert.isTrue(stack.isEntryExpandable(entryTwo));\n });\n\n it('adds the next visible parent of the merged entry into the expandableEntries array if the direct parent is hidden',\n async function() {\n const {parsedTrace} = await TraceLoader.traceEngine(this, 'two-functions-recursion.json.gz');\n const mainThread = getMainThread(parsedTrace.Renderer);\n /** This stack looks roughly like so (with some events omitted):\n * ======== onclick ============\n * =========== foo =============\n * ==== foo2 =====\n * ===== foo =====\n * ==== foo2 =====\n * ===== foo =====\n * ==== foo2 =====\n * ===== foo =====\n *\n * In this test we want to test that the next visible parent of the merged entry is added to the\n * expandableEntries array even if the direct one is hidden by some other action,\n * so that later an array decoration is added to it and the merged entry could be shown again if the array is clicked.\n *\n * collapse all repeating calls of foo after the first one:\n * ======== onclick ============\n * =========== foo ============= << all foo except first removed\n * ===== foo2 ====\n * ==== foo2 ===== << direct parent is not visible anymore\n * ==== foo2 =====\n *\n * merge second foo2 and add the next visible parent to the expandableEntries array:\n * ======== onclick ============\n * =========== foo =============\n * ===== foo2 ==== << added to expandableEntries as the next visible parent of the merged entry\n * ==== foo2 =====\n *\n **/\n const firstFooCallEntry = findFirstEntry(mainThread.entries, entry => {\n return Trace.Types.Events.isProfileCall(entry) && entry.callFrame.functionName === 'foo' && entry.dur === 233;\n });\n const firstFooCallEndTime = Trace.Helpers.Timing.eventTimingsMicroSeconds(firstFooCallEntry).endTime;\n const fooCalls = mainThread.entries.filter(entry => {\n const isFooCall = Trace.Types.Events.isProfileCall(entry) && entry.callFrame.functionName === 'foo';\n if (!isFooCall) {\n return false;\n }\n const {endTime} = Trace.Helpers.Timing.eventTimingsMicroSeconds(entry);\n return endTime <= firstFooCallEndTime;\n });\n const stack = new Timeline.EntriesFilter.EntriesFilter(parsedTrace.Renderer.entryToNode);\n if (!stack) {\n throw new Error('EntriesFilter does not exist');\n }\n // Collapse all foo calls after the first one.\n stack.applyFilterAction({\n type: PerfUI.FlameChart.FilterAction.COLLAPSE_REPEATING_DESCENDANTS,\n entry: firstFooCallEntry,\n });\n\n // First foo call is marked as expandable since its' children are hidden.\n assert.isTrue(stack.isEntryExpandable(firstFooCallEntry));\n\n // Make sure all foo calls after first are hidden.\n const allFooExceptFirstInStackAreHidden = fooCalls.every((fooCall, i) => {\n if (i === 0) {\n // First foo should not be invisible.\n return !stack.invisibleEntries().includes(fooCall);\n }\n return stack.invisibleEntries().includes(fooCall);\n });\n assert.isTrue(\n allFooExceptFirstInStackAreHidden, 'First foo is invisible or some following foo calls are still visible');\n\n const foo2Calls = mainThread.entries.filter(entry => {\n const isFoo2Call = Trace.Types.Events.isProfileCall(entry) && entry.callFrame.functionName === 'foo2';\n if (!isFoo2Call) {\n return false;\n }\n const {endTime} = Trace.Helpers.Timing.eventTimingsMicroSeconds(entry);\n return endTime <= firstFooCallEndTime;\n });\n\n // Merge second foo2 entry.\n stack.applyFilterAction({type: PerfUI.FlameChart.FilterAction.MERGE_FUNCTION, entry: foo2Calls[1]});\n // First foo2 entry should be in the expandableEntries array.\n assert.isTrue(stack.isEntryExpandable(foo2Calls[0]));\n });\n\n it('supports collapsing an entry', async function() {\n const {parsedTrace} = await TraceLoader.traceEngine(this, 'basic-stack.json.gz');\n const mainThread = getMainThread(parsedTrace.Renderer);\n /** This stack looks roughly like so (with some events omitted):\n * ======== basicStackOne ============\n * =========== basicTwo ==============\n * =========== basicThree ============\n * ======== fibonacci ===\n * ======== fibonacci ===\n * ======== fibonacci ===\n * ======== fibonacci ===\n * ======== fibonacci ===\n * ==== fibonacci ===\n *\n * In this test we want to test the user collapsing basicTwo, which should have the effect of keeping basicTwo visible, but removing all of its children:\n * ======== basicStackOne ============\n * =========== basicTwo ==============\n * << all children removed\n **/\n const basicTwoCallEntry = findFirstEntry(mainThread.entries, entry => {\n // Processing this trace ends up with two distinct stacks for basicTwo()\n // So we find the first one so we can focus this test on just one stack.\n return Trace.Types.Events.isProfileCall(entry) && entry.callFrame.functionName === 'basicTwo' &&\n entry.dur === 827;\n });\n\n // Gather the fib() calls under the first basicTwo stack, by finding all\n // the calls whose end time is less than or equal to the end time of the\n // `basicTwo` function.\n const fibonacciCalls = mainThread.entries.filter(entry => {\n const isFibCall = Trace.Types.Events.isProfileCall(entry) && entry.callFrame.functionName === 'fibonacci';\n if (!isFibCall) {\n return false;\n }\n const {endTime} = Trace.Helpers.Timing.eventTimingsMicroSeconds(entry);\n const basicTwoCallEndTime = Trace.Helpers.Timing.eventTimingsMicroSeconds(basicTwoCallEntry).endTime;\n return endTime <= basicTwoCallEndTime;\n });\n const stack = new Timeline.EntriesFilter.EntriesFilter(parsedTrace.Renderer.entryToNode);\n if (!stack) {\n throw new Error('EntriesFilter does not exist');\n }\n stack.applyFilterAction({type: PerfUI.FlameChart.FilterAction.COLLAPSE_FUNCTION, entry: basicTwoCallEntry});\n\n // We collapsed at the `basicTwo` entry - so it should not be included in the invisible list itself.\n assert.isFalse(stack.invisibleEntries().includes(basicTwoCallEntry), 'entryTwo is not visible');\n // But all fib() calls below it in the stack should now be invisible.\n const allFibonacciInStackAreHidden = fibonacciCalls.every(fibCall => {\n return stack.invisibleEntries().includes(fibCall);\n });\n assert.isTrue(allFibonacciInStackAreHidden, 'Some fibonacci calls are still visible');\n });\n\n it('supports collapsing all repeating entries among descendants', async function() {\n const {parsedTrace} = await TraceLoader.traceEngine(this, 'two-functions-recursion.json.gz');\n const mainThread = getMainThread(parsedTrace.Renderer);\n /** This stack looks roughly like so (with some events omitted):\n * ======== onclick ============\n * =========== foo =============\n * ==== foo2 =====\n * ===== foo =====\n * ==== foo2 =====\n * ===== foo =====\n * ==== foo2 =====\n * ===== foo =====\n *\n * In this test we want to test the user collapsing all descendant foo calls of the first first one,\n * which should have the effect of keeping the first foo visible, but removing all of its other calls:\n * ======== onclick ============\n * =========== foo =============\n * ===== foo2 ==== << all foo except first removed\n * ==== foo2 =====\n * ==== foo2 =====\n **/\n\n const firstFooCallEntry = findFirstEntry(mainThread.entries, entry => {\n return Trace.Types.Events.isProfileCall(entry) && entry.callFrame.functionName === 'foo' && entry.dur === 233;\n });\n\n // Gather the foo() and foo2() calls under and including the first foo entry, by finding all\n // the calls whose end time is less than or equal to the end time of the first `foo` function.\n const firstFooCallEndTime = Trace.Helpers.Timing.eventTimingsMicroSeconds(firstFooCallEntry).endTime;\n const fooCalls = mainThread.entries.filter(entry => {\n const isFooCall = Trace.Types.Events.isProfileCall(entry) && entry.callFrame.functionName === 'foo';\n if (!isFooCall) {\n return false;\n }\n const {endTime} = Trace.Helpers.Timing.eventTimingsMicroSeconds(entry);\n return endTime <= firstFooCallEndTime;\n });\n\n const foo2Calls = mainThread.entries.filter(entry => {\n const isFoo2Call = Trace.Types.Events.isProfileCall(entry) && entry.callFrame.functionName === 'foo2';\n if (!isFoo2Call) {\n return false;\n }\n const {endTime} = Trace.Helpers.Timing.eventTimingsMicroSeconds(entry);\n return endTime <= firstFooCallEndTime;\n });\n\n const stack = new Timeline.EntriesFilter.EntriesFilter(parsedTrace.Renderer.entryToNode);\n if (!stack) {\n throw new Error('EntriesFilter does not exist');\n }\n stack.applyFilterAction(\n {type: PerfUI.FlameChart.FilterAction.COLLAPSE_REPEATING_DESCENDANTS, entry: firstFooCallEntry});\n\n // We collapsed identical descendants after the first `foo` entry - so it should not be included in the invisible list itself,\n // but all foo() calls below it in the stack should now be invisible.\n const allFooExceptFirstInStackAreHidden = fooCalls.every((fooCall, i) => {\n if (i === 0) {\n // First foo should not be invisible.\n return !stack.invisibleEntries().includes(fooCall);\n }\n return stack.invisibleEntries().includes(fooCall);\n });\n assert.isTrue(\n allFooExceptFirstInStackAreHidden, 'First foo is invisible or some following foo calls are still visible');\n\n // All of the foo2 calls that were inbetween foo calls should still be visible.\n const allFoo2InStackAreVisible = foo2Calls.every(fooCall => {\n return !stack.invisibleEntries().includes(fooCall);\n });\n assert.isTrue(allFoo2InStackAreVisible, 'Some foo2 calls are invisible');\n });\n\n it('supports undo all filter actions by applying context menu undo action', async function() {\n const {parsedTrace} = await TraceLoader.traceEngine(this, 'basic-stack.json.gz');\n const mainThread = getMainThread(parsedTrace.Renderer);\n /** This stack looks roughly like so (with some events omitted):\n * ======== basicStackOne ============\n * =========== basicTwo ==============\n * =========== basicThree ============\n * ======== fibonacci ===\n * ======== fibonacci ===\n * ======== fibonacci ===\n * ======== fibonacci ===\n * ======== fibonacci ===\n * ==== fibonacci ===\n *\n * In this test we want to test the user undoing all actions with 'undo all actions' after applying merge, collapse repeating descendants and collapse function.\n *\n * First, collapse all repeating descendants of the first fibonacci call:\n * ======== basicStackOne ============\n * =========== basicTwo ==============\n * =========== basicThree ============\n * ======== fibonacci === << repeating children removed\n *\n * Then, merge basicStackOne:\n * =========== basicTwo ==============\n * =========== basicThree ============\n * ======== fibonacci ===\n *\n * Finally, collapse basicTwo():\n * =========== basicTwo ==============\n *\n * Applying 'undo all actions' should bring the stack to the original state.\n **/\n\n const stack = new Timeline.EntriesFilter.EntriesFilter(parsedTrace.Renderer.entryToNode);\n if (!stack) {\n throw new Error('EntriesFilter does not exist');\n }\n const basicTwoCallEntry = findFirstEntry(mainThread.entries, entry => {\n // Processing this trace ends up with two distinct stacks for basicTwo()\n // So we find the first one so we can focus this test on just one stack.\n return Trace.Types.Events.isProfileCall(entry) && entry.callFrame.functionName === 'basicTwo' &&\n entry.dur === 827;\n });\n const fibonacciCalls = mainThread.entries.filter(entry => {\n const isFibCall = Trace.Types.Events.isProfileCall(entry) && entry.callFrame.functionName === 'fibonacci';\n if (!isFibCall) {\n return false;\n }\n const {endTime} = Trace.Helpers.Timing.eventTimingsMicroSeconds(entry);\n const basicTwoCallEndTime = Trace.Helpers.Timing.eventTimingsMicroSeconds(basicTwoCallEntry).endTime;\n return endTime <= basicTwoCallEndTime;\n });\n\n // Collapse all repeating descendants of the first fibonacci call:\n stack.applyFilterAction(\n {type: PerfUI.FlameChart.FilterAction.COLLAPSE_REPEATING_DESCENDANTS, entry: fibonacciCalls[0]});\n // We collapsed identical descendants after the first `foo` entry - so it should not be included in the invisible list itself,\n // but all foo() calls below it in the stack should now be invisible.\n const allFibExceptFirstInStackAreHidden = fibonacciCalls.every((fibCall, i) => {\n if (i === 0) {\n // First foo should not be invisible.\n return !stack.invisibleEntries().includes(fibCall);\n }\n return stack.invisibleEntries().includes(fibCall);\n });\n assert.isTrue(\n allFibExceptFirstInStackAreHidden, 'First fib is invisible or some following fib calls are still visible');\n\n // Merge basicStackOne:\n const basicStackOne = findFirstEntry(mainThread.entries, entry => {\n return Trace.Types.Events.isProfileCall(entry) && entry.callFrame.functionName === 'basicStackOne' &&\n entry.dur === 827;\n });\n stack.applyFilterAction({type: PerfUI.FlameChart.FilterAction.MERGE_FUNCTION, entry: basicStackOne});\n assert.isTrue(stack.invisibleEntries().includes(basicStackOne), 'entrybasicStackOneTwo is visble');\n\n // Collapse basicTwo():\n stack.applyFilterAction({type: PerfUI.FlameChart.FilterAction.COLLAPSE_FUNCTION, entry: basicTwoCallEntry});\n // basicThree and first fibnacci should now be hidden:\n const basicThree = findFirstEntry(mainThread.entries, entry => {\n return Trace.Types.Events.isProfileCall(entry) && entry.callFrame.functionName === 'basicThree' &&\n entry.dur === 827;\n });\n assert.isTrue(stack.invisibleEntries().includes(basicThree), 'basicThree is visble');\n assert.isTrue(stack.invisibleEntries().includes(fibonacciCalls[0]), 'first fibonacci is visble');\n\n // Apply UNDO_ALL_ACTIONS to bring back all of the hidden entries:\n // UNDO_ALL_ACTIONS can be called on any visible entry\n stack.applyFilterAction({type: PerfUI.FlameChart.FilterAction.UNDO_ALL_ACTIONS, entry: basicTwoCallEntry});\n // If the length of invisibleEntries list is 0, all of the entries added earlier were removed and are now visible.\n assert.lengthOf(stack.invisibleEntries(), 0);\n });\n\n it('supports resetting children of the closest expandable parent when a hidden entry is provided', async function() {\n const {parsedTrace} = await TraceLoader.traceEngine(this, 'basic-stack.json.gz');\n const mainThread = getMainThread(parsedTrace.Renderer);\n /** This stack looks roughly like so (with some events omitted):\n * ======== basicStackOne ============\n * =========== basicTwo ==============\n * =========== basicThree ============\n * ======== fibonacci ===\n * ======== fibonacci ===\n * ======== fibonacci ===\n * ======== fibonacci ===\n * ======== fibonacci ===\n * ==== fibonacci ===\n *\n * In this test we want to test the user selecting an entry that is hidden via a link.\n * If this happens, we should reveal this entry to resetting children of the closest expandable parent.\n *\n * First, collapse all children of the basicTwo:\n * ======== basicStackOne ============\n * =========== basicTwo ============== << children collapsed\n * =========== basicThree ============\n * ======== fibonacci === << repeating children removed\n *\n * Then, reveal the first fibonacci entry that is hidden:\n * ======== basicStackOne ============\n * =========== basicTwo ==============\n * =========== basicThree ============\n * ======== fibonacci === << reveal this hidden entry\n * ======== fibonacci ===\n *\n * This should result in all basicTwo children being removed from the invisible array and stack being in the initial state.\n **/\n\n const stack = new Timeline.EntriesFilter.EntriesFilter(parsedTrace.Renderer.entryToNode);\n if (!stack) {\n throw new Error('EntriesFilter does not exist');\n }\n const basicTwoCallEntry = findFirstEntry(mainThread.entries, entry => {\n // Processing this trace ends up with two distinct stacks for basicTwo()\n // So we find the first one so we can focus this test on just one stack.\n return Trace.Types.Events.isProfileCall(entry) && entry.callFrame.functionName === 'basicTwo' &&\n entry.dur === 827;\n });\n\n // Make sure no entries are hidden\n assert.lengthOf(stack.invisibleEntries(), 0);\n\n // Collapse all children of basicTwo call:\n stack.applyFilterAction({type: PerfUI.FlameChart.FilterAction.COLLAPSE_FUNCTION, entry: basicTwoCallEntry});\n\n // Make sure all 37 of basicTwo descdendants are hidden\n assert.lengthOf(stack.invisibleEntries(), 37);\n\n // Get the first fibonacci call that is one of the hidden children and make sure it is hidden\n const firstFibCallEntry = findFirstEntry(mainThread.entries, entry => {\n return Trace.Types.Events.isProfileCall(entry) && entry.callFrame.functionName === 'fibonacci';\n });\n\n assert.isTrue(stack.invisibleEntries().includes(firstFibCallEntry));\n\n // Reveal the first fibonacci call and make sure that the all of the entries are now visible because the closest\n // expandable parent to the fib call is basicTwo and, therefore, we need to reset its children.\n stack.revealEntry(firstFibCallEntry);\n assert.lengthOf(stack.invisibleEntries(), 0);\n });\n\n it('supports resetting all hidden children of a selected entry', async function() {\n const {parsedTrace} = await TraceLoader.traceEngine(this, 'two-functions-recursion.json.gz');\n const mainThread = getMainThread(parsedTrace.Renderer);\n /** This stack looks roughly like so (with some events omitted):\n * ======== onclick ============\n * =========== foo =============\n * ==== foo2 =====\n * ===== foo =====\n * ==== foo2 =====\n * ===== foo =====\n * ==== foo2 =====\n * ===== foo =====\n *\n * In this test we want to test the user collapsing all descendant foo calls of the first first one,\n * which should have the effect of keeping the first foo visible, but removing all of its other calls:\n * ======== onclick ============\n * =========== foo =============\n * ===== foo2 ==== << all foo except first removed\n * ==== foo2 =====\n * ==== foo2 =====\n *\n * Then, reset children on the second visible foo2.\n * ======== onclick ============\n * =========== foo =============\n * ===== foo2 ==== << foo() after this entry still hidden\n * ==== foo2 ===== << all children from this node are visible\n * ===== foo =====\n * ==== foo2 =====\n * ===== foo =====\n *\n * This results in a stack where all children of an entry children were reset on (second foo2)\n * are visible, but the entries hidden above the entry children were reset on stay hidden.\n **/\n\n const firstFooCallEntry = findFirstEntry(mainThread.entries, entry => {\n return Trace.Types.Events.isProfileCall(entry) && entry.callFrame.functionName === 'foo' && entry.dur === 233;\n });\n\n // Gather the foo() and foo2() calls under and including the first foo entry, by finding all\n // the calls whose end time is less than or equal to the end time of the first `foo` function.\n const firstFooCallEndTime = Trace.Helpers.Timing.eventTimingsMicroSeconds(firstFooCallEntry).endTime;\n const fooCalls = mainThread.entries.filter(entry => {\n const isFooCall = Trace.Types.Events.isProfileCall(entry) && entry.callFrame.functionName === 'foo';\n if (!isFooCall) {\n return false;\n }\n const {endTime} = Trace.Helpers.Timing.eventTimingsMicroSeconds(entry);\n return endTime <= firstFooCallEndTime;\n });\n\n const foo2Calls = mainThread.entries.filter(entry => {\n const isFoo2Call = Trace.Types.Events.isProfileCall(entry) && entry.callFrame.functionName === 'foo2';\n if (!isFoo2Call) {\n return false;\n }\n const {endTime} = Trace.Helpers.Timing.eventTimingsMicroSeconds(entry);\n return endTime <= firstFooCallEndTime;\n });\n\n const stack = new Timeline.EntriesFilter.EntriesFilter(parsedTrace.Renderer.entryToNode);\n if (!stack) {\n throw new Error('EntriesFilter does not exist');\n }\n stack.applyFilterAction(\n {type: PerfUI.FlameChart.FilterAction.COLLAPSE_REPEATING_DESCENDANTS, entry: firstFooCallEntry});\n\n // We collapsed identical descendants after the first `foo` entry - so it should not be included in the invisible list itself,\n // but all foo() calls below it in the stack should now be invisible.\n const allFooExceptFirstInStackAreHidden = fooCalls.every((fooCall, i) => {\n if (i === 0) {\n // First foo should not be invisible.\n return !stack.invisibleEntries().includes(fooCall);\n }\n return stack.invisibleEntries().includes(fooCall);\n });\n assert.isTrue(\n allFooExceptFirstInStackAreHidden, 'First foo is invisible or some following foo calls are still visible');\n\n // All of the foo2 calls that were inbetween foo calls should still be visible.\n let allFoo2InStackAreVisible = foo2Calls.every(fooCall => {\n return !stack.invisibleEntries().includes(fooCall);\n });\n assert.isTrue(allFoo2InStackAreVisible, 'Some foo2 calls are invisible');\n\n // Reset all children after second foo2 call\n assert.lengthOf(foo2Calls, 3);\n stack.applyFilterAction({type: PerfUI.FlameChart.FilterAction.RESET_CHILDREN, entry: foo2Calls[1]});\n\n // All foo and foo2 calls except the second foo cll should now be visible\n allFoo2InStackAreVisible = foo2Calls.every(fooCall => {\n return !stack.invisibleEntries().includes(fooCall);\n });\n assert.isTrue(allFoo2InStackAreVisible, 'Some foo2 calls are invisible');\n\n const allFooExceptSecondInStackAreVisible = fooCalls.every((fooCall, i) => {\n if (i === 1) {\n // Second foo should be invisible.\n return stack.invisibleEntries().includes(fooCall);\n }\n return !stack.invisibleEntries().includes(fooCall);\n });\n assert.isTrue(\n allFooExceptSecondInStackAreVisible,\n 'Some foo calls except the second one are invisible or the second one is visible');\n });\n\n it('correctly returns the amount of hidden children of a node', async function() {\n const {parsedTrace} = await TraceLoader.traceEngine(this, 'two-functions-recursion.json.gz');\n const mainThread = getMainThread(parsedTrace.Renderer);\n /** This stack looks roughly like so (with some erlier events omitted):\n * ======== onclick ============\n * =========== foo =============\n * ==== foo2 =====\n * ===== foo =====\n * ==== foo2 =====\n * ===== foo =====\n * ==== foo2 =====\n * ===== foo =====\n *\n * In this test we want to test if the amount of hidden children returned is correct:\n * If we collapse repeating children on the first foo call, the 3 child foo calls should be removed.\n * Therefore, the amount of hidden children should be equal to 3.\n * ======== onclick ============\n * =========== foo ============= << all foo except first hidden\n * ===== foo2 ====\n * ==== foo2 =====\n * ==== foo2 =====\n **/\n\n const firstFooCallEntry = findFirstEntry(mainThread.entries, entry => {\n return Trace.Types.Events.isProfileCall(entry) && entry.callFrame.functionName === 'foo' && entry.dur === 233;\n });\n\n const stack = new Timeline.EntriesFilter.EntriesFilter(parsedTrace.Renderer.entryToNode);\n if (!stack) {\n throw new Error('EntriesFilter does not exist');\n }\n // Before applying any action on a node, there should be no entries hidden under it\n assert.strictEqual(stack.findHiddenDescendantsAmount(firstFooCallEntry), 0);\n\n stack.applyFilterAction(\n {type: PerfUI.FlameChart.FilterAction.COLLAPSE_REPEATING_DESCENDANTS, entry: firstFooCallEntry});\n\n // There should be 3 foo() entries hidden under the first foo call entry\n assert.strictEqual(stack.findHiddenDescendantsAmount(firstFooCallEntry), 3);\n });\n\n it('correctly assigns a visible parent to expandable entries if the direct parent is not visible', async function() {\n const {parsedTrace} = await TraceLoader.traceEngine(this, 'basic-stack.json.gz');\n const mainThread = getMainThread(parsedTrace.Renderer);\n /** This stack looks roughly like so (with some events omitted):\n * ======== Task ===============\n * ======== (anonymous) ======== << entry with an invisible in the timeline direct parent. We need to make sure that we correctly add Task to the expandable entries\n * ======== RegisterFrameID ====\n * ======== postMessage ========\n **/\n const anonymousEntryWithInvisibleParent = findFirstEntry(mainThread.entries, entry => {\n return Trace.Types.Events.isProfileCall(entry) && entry.nodeId === 42;\n });\n\n const stack = new Timeline.EntriesFilter.EntriesFilter(parsedTrace.Renderer.entryToNode);\n if (!stack) {\n throw new Error('EntriesFilter does not exist');\n }\n\n const taskEntry = findFirstEntry(mainThread.entries, entry => {\n return entry.name === 'RunTask' && entry.dur === 978 && entry.ts === 164397762991;\n });\n\n // Make sure the expandable entries are empty at first\n assert.lengthOf(stack.expandableEntries(), 0);\n\n // Hide the anonymous function\n stack.applyFilterAction(\n {type: PerfUI.FlameChart.FilterAction.MERGE_FUNCTION, entry: anonymousEntryWithInvisibleParent});\n\n // Make sure Task entry is added to expandable entries\n assert.lengthOf(stack.expandableEntries(), 1);\n assert.isTrue(stack.expandableEntries().includes(taskEntry));\n });\n\n it('returns the trace entry tree starting from the root task, highlighting the selected event', async function() {\n const {parsedTrace} = await TraceLoader.traceEngine(this, 'two-functions-recursion.json.gz');\n const mainThread = getMainThread(parsedTrace.Renderer);\n /** This stack looks roughly like so (with some events omitted):\n * ===========RunTask===========\n * ...\n * ======== onclick ============\n * =========== foo =============\n * ==== foo2 =====\n * ===== foo =====\n * ==== foo2 =====\n * ===== foo =====\n * ==== foo2 =====\n * ===== foo =====\n *\n * In this test we want to test if for a selected entry, the tree for AI processing\n * is generated correctly such that the root RunTask is the root node and the\n * node for the selected event has property selected set as true.\n **/\n\n const firstFooCallEntry = findFirstEntry(mainThread.entries, entry => {\n return Trace.Types.Events.isProfileCall(entry) && entry.callFrame.functionName === 'foo' && entry.dur === 233;\n });\n\n const entriesFilter = new Timeline.EntriesFilter.EntriesFilter(parsedTrace.Renderer.entryToNode);\n if (!entriesFilter) {\n throw new Error('EntriesFilter does not exist');\n }\n const aiNodeTree = entriesFilter.getAIEventNodeTree(firstFooCallEntry);\n assert.exists(aiNodeTree);\n\n const fooAiNode = Trace.Helpers.TreeHelpers.AINode.getSelectedNodeWithinTree(aiNodeTree);\n assert.exists(fooAiNode);\n\n // Use the toJSON simplification for comparison.\n const simpleFooNode = JSON.parse(JSON.stringify(fooAiNode));\n assert.lengthOf(simpleFooNode.children, 1);\n\n // delete for smaller deepStrictEqual comparison\n simpleFooNode.children = [];\n\n assert.deepEqual(simpleFooNode, {\n dur: 0.2,\n name: 'foo',\n selected: true,\n self: 0.2,\n url: 'file:///usr/local/google/home/alinavarkki/stack/recursion.html',\n children: [],\n });\n });\n});\n"]} \ No newline at end of file diff --git a/public/panels/timeline/Initiators.test.js b/public/panels/timeline/Initiators.test.js index 86206cc78..b7ca0ba40 100644 --- a/public/panels/timeline/Initiators.test.js +++ b/public/panels/timeline/Initiators.test.js @@ -110,7 +110,7 @@ describeWithEnvironment('Initiators', () => { assert.strictEqual(initiatorsData[0].event, functionCallByRAF); assert.strictEqual(initiatorsData[0].initiator, rAFParent.entry); // Ensure the expandable entry is marked as hidden - assert.strictEqual(initiatorsData[0].isInitiatorHidden, true); + assert.isTrue(initiatorsData[0].isInitiatorHidden); }); it('will return the closest expandable ancestor as an initiated event in a pair if the event itself is hidden', async function () { const functionCallByRAFParent = parsedTrace.Renderer.entryToNode.get(functionCallByRAF)?.parent; @@ -120,7 +120,7 @@ describeWithEnvironment('Initiators', () => { assert.strictEqual(initiatorsData[0].event, functionCallByRAFParent?.entry); assert.strictEqual(initiatorsData[0].initiator, rAFCall); // Ensure the expandable entry is marked as hidden - assert.strictEqual(initiatorsData[0].isEntryHidden, true); + assert.isTrue(initiatorsData[0].isEntryHidden); }); }); describe('Network Requests', function () { diff --git a/public/panels/timeline/Initiators.test.js.map b/public/panels/timeline/Initiators.test.js.map index ec0783c16..56846200c 100644 --- a/public/panels/timeline/Initiators.test.js.map +++ b/public/panels/timeline/Initiators.test.js.map @@ -1 +1 @@ -{"version":3,"file":"Initiators.test.js","sourceRoot":"","sources":["../../../../../../front_end/panels/timeline/Initiators.test.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,KAAK,KAAK,MAAM,6BAA6B,CAAC;AACrD,OAAO,EAAC,uBAAuB,EAAC,MAAM,qCAAqC,CAAC;AAC5E,OAAO,EAAC,WAAW,EAAC,MAAM,8BAA8B,CAAC;AAEzD,OAAO,KAAK,QAAQ,MAAM,eAAe,CAAC;AAE1C,uBAAuB,CAAC,YAAY,EAAE,GAAG,EAAE;IACzC,QAAQ,CAAC,yCAAyC,EAAE,GAAG,EAAE;QACvD,IAAI,uBAAgE,CAAC;QACrE,IAAI,iCAA2D,CAAC;QAChE,IAAI,cAAuD,CAAC;QAC5D,IAAI,wBAAkD,CAAC;QACvD,IAAI,OAAgD,CAAC;QACrD,IAAI,iBAA2C,CAAC;QAEhD,IAAI,WAA6C,CAAC;QAClD,UAAU,CAAC,KAAK;YACd,WAAW,GAAG,CAAC,MAAM,WAAW,CAAC,WAAW,CAAC,IAAI,EAAE,wBAAwB,CAAC,CAAC,CAAC,WAAW,CAAC;YAC1F,cAAc;gBACV,WAAW,CAAC,QAAQ,CAAC,eAAe;qBAC/B,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS,CAAC,YAAY,KAAK,YAAY,CA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AC,CAAC;YAC/F,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;YACzB,MAAM,aAAa,GAAG,QAAQ,CAAC,UAAU,CAAC,8BAA8B,CAAC,WAAW,EAAE,KAAK,CAAC,CAAC;YAE7F,MAAM,CAAC,SAAS,CAAC,aAAa,EAAE,CAAC,EAAC,KAAK,EAAE,SAAS,EAAC,CAAC,CAAC,CAAC;QACxD,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["// Copyright 2023 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport * as Trace from '../../models/trace/trace.js';\nimport {describeWithEnvironment} from '../../testing/EnvironmentHelpers.js';\nimport {TraceLoader} from '../../testing/TraceLoader.js';\n\nimport * as Timeline from './timeline.js';\n\ndescribeWithEnvironment('Initiators', () => {\n describe('initiator-initiated event relationships', () => {\n let requestIdleCallbackCall: Trace.Types.Events.SyntheticProfileCall;\n let functionCallByrequestIdleCallback: Trace.Types.Events.Event;\n let setTimeoutCall: Trace.Types.Events.SyntheticProfileCall;\n let functionCallBySetTimeout: Trace.Types.Events.Event;\n let rAFCall: Trace.Types.Events.SyntheticProfileCall;\n let functionCallByRAF: Trace.Types.Events.Event;\n\n let parsedTrace: Trace.Handlers.Types.ParsedTrace;\n beforeEach(async function() {\n parsedTrace = (await TraceLoader.traceEngine(this, 'async-js-calls.json.gz')).parsedTrace;\n setTimeoutCall =\n parsedTrace.Renderer.allTraceEntries\n .filter(e => Trace.Types.Events.isProfileCall(e) && e.callFrame.functionName === 'setTimeout')\n .at(-1) as Trace.Types.Events.SyntheticProfileCall;\n assert.exists(setTimeoutCall);\n assert.isTrue(Trace.Types.Events.isProfileCall(setTimeoutCall));\n\n functionCallBySetTimeout =\n parsedTrace.Renderer.allTraceEntries.find(\n e => Trace.Types.Events.isFunctionCall(e) && e.ts > setTimeoutCall.ts) as Trace.Types.Events.Event;\n assert.exists(functionCallBySetTimeout);\n\n rAFCall =\n parsedTrace.Renderer.allTraceEntries\n .filter(e => Trace.Types.Events.isProfileCall(e) && e.callFrame.functionName === 'requestAnimationFrame')\n .at(-1) as Trace.Types.Events.SyntheticProfileCall;\n assert.exists(rAFCall);\n assert.isTrue(Trace.Types.Events.isProfileCall(rAFCall));\n\n functionCallByRAF =\n parsedTrace.Renderer.allTraceEntries.find(e => Trace.Types.Events.isFunctionCall(e) && e.ts > rAFCall.ts) as\n Trace.Types.Events.Event;\n assert.exists(functionCallByRAF);\n\n requestIdleCallbackCall =\n parsedTrace.Renderer.allTraceEntries\n .filter(e => Trace.Types.Events.isProfileCall(e) && e.callFrame.functionName === 'requestIdleCallback')\n .at(-1) as Trace.Types.Events.SyntheticProfileCall;\n assert.exists(requestIdleCallbackCall);\n assert.isTrue(Trace.Types.Events.isProfileCall(requestIdleCallbackCall));\n\n functionCallByrequestIdleCallback = parsedTrace.Renderer.allTraceEntries.find(\n e => Trace.Types.Events.isFunctionCall(e) &&\n e.ts > requestIdleCallbackCall.ts) as Trace.Types.Events.Event;\n assert.exists(functionCallByrequestIdleCallback);\n });\n it('returns the initiator data', async function() {\n const initiatorData = Timeline.Initiators.initiatorsDataToDraw(parsedTrace, functionCallBySetTimeout, [], []);\n assert.deepEqual(initiatorData[0], {\n event: functionCallBySetTimeout,\n initiator: setTimeoutCall,\n });\n });\n\n it('can walk up the tree to find the first parent with an initiator', async function() {\n // Find any of the bar() calls; they have a parent event\n // (FunctionCall) that has an initiator.\n const barCall = parsedTrace.Renderer.allTraceEntries.find(\n e => Trace.Types.Events.isProfileCall(e) && e.callFrame.functionName === 'bar');\n assert.exists(barCall);\n\n // Find the initator data but starting at the fibonacci()\n // call.\n const initiatorsData = Timeline.Initiators.initiatorsDataToDraw(parsedTrace, barCall, [], []);\n\n assert.deepEqual(initiatorsData[0], {\n event: functionCallBySetTimeout,\n initiator: setTimeoutCall,\n });\n });\n\n it('will walk back through the initiators to find the entire chain', async function() {\n // Find any of the baz() calls; they have a parent event\n // (FunctionCall) that has an initiator.\n const bazCall = parsedTrace.Renderer.allTraceEntries.find(\n e => Trace.Types.Events.isProfileCall(e) && e.callFrame.functionName === 'baz');\n assert.exists(bazCall);\n\n // Find the initators data but starting at the baz()\n // call. We expect to find 3 initiatorData objects here:\n // 1. baz() ===> FunctionCall caused by requestIdleCallback\n // 2. The requestIdleCallback from (1), caused by a prior setTimeout.\n // 3. The setTimeout from (2), caused by a prior requestAnimationFrame.\n const initiatorsData = Timeline.Initiators.initiatorsDataToDraw(parsedTrace, bazCall, [], []);\n\n assert.deepEqual(initiatorsData, [\n {\n event: functionCallByrequestIdleCallback,\n initiator: requestIdleCallbackCall,\n },\n {\n event: functionCallBySetTimeout,\n initiator: setTimeoutCall,\n },\n {\n event: functionCallByRAF,\n initiator: rAFCall,\n },\n ]);\n });\n\n it('will walk forward to find the events initiated by the selected entry', async function() {\n const initatorsData = Timeline.Initiators.initiatorsDataToDraw(parsedTrace, rAFCall, [], []);\n assert.lengthOf(initatorsData, 1);\n assert.strictEqual(initatorsData[0].event, functionCallByRAF);\n assert.strictEqual(initatorsData[0].initiator, rAFCall);\n });\n\n it('will return the closest expandable ancestor as an initiator in a pair if the initiator itself is hidden',\n async function() {\n // Get the parent of rAF to add to the expandable events array.\n // When we add rAF to hidden entries list, it will be the\n // closest expandable parent and the initiator should point to it.\n const rAFParent = parsedTrace.Renderer.entryToNode.get(rAFCall)?.parent;\n assert.exists(rAFParent);\n\n // Find the initatorData objects starting at the rAF\n // call. We expect to find one initatorData here:\n // rAF callback initiated by rAF -> Parent of rAF because rAF is hidden\n const initiatorsData =\n Timeline.Initiators.initiatorsDataToDraw(parsedTrace, rAFCall, [rAFCall], [rAFParent?.entry]);\n\n assert.lengthOf(initiatorsData, 1);\n assert.strictEqual(initiatorsData[0].event, functionCallByRAF);\n assert.strictEqual(initiatorsData[0].initiator, rAFParent.entry);\n // Ensure the expandable entry is marked as hidden\n assert.strictEqual(initiatorsData[0].isInitiatorHidden, true);\n });\n\n it('will return the closest expandable ancestor as an initiated event in a pair if the event itself is hidden',\n async function() {\n const functionCallByRAFParent = parsedTrace.Renderer.entryToNode.get(functionCallByRAF)?.parent;\n assert.exists(functionCallByRAFParent);\n\n const initiatorsData = Timeline.Initiators.initiatorsDataToDraw(\n parsedTrace, rAFCall, [functionCallByRAF], [functionCallByRAFParent?.entry]);\n\n assert.lengthOf(initiatorsData, 1);\n assert.strictEqual(initiatorsData[0].event, functionCallByRAFParent?.entry);\n assert.strictEqual(initiatorsData[0].initiator, rAFCall);\n // Ensure the expandable entry is marked as hidden\n assert.strictEqual(initiatorsData[0].isEntryHidden, true);\n });\n });\n\n describe('Network Requests', function() {\n it('returns the initiator data for network requests', async function() {\n const {parsedTrace} = await TraceLoader.traceEngine(this, 'network-requests-initiators.json.gz');\n\n // Find the network request to test, it is initiated by `youtube.com`.\n const event = parsedTrace.NetworkRequests.byTime.find(event => event.ts === 1491680762420);\n assert.exists(event);\n // Find the `youtube.com` network request.\n const initiator = parsedTrace.NetworkRequests.byTime.find(event => event.ts === 1491680629144);\n assert.exists(initiator);\n const initiatorData = Timeline.Initiators.initiatorsDataToDrawForNetwork(parsedTrace, event);\n\n assert.deepEqual(initiatorData, [{event, initiator}]);\n });\n });\n});\n"]} \ No newline at end of file +{"version":3,"file":"Initiators.test.js","sourceRoot":"","sources":["../../../../../../front_end/panels/timeline/Initiators.test.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,KAAK,KAAK,MAAM,6BAA6B,CAAC;AACrD,OAAO,EAAC,uBAAuB,EAAC,MAAM,qCAAqC,CAAC;AAC5E,OAAO,EAAC,WAAW,EAAC,MAAM,8BAA8B,CAAC;AAEzD,OAAO,KAAK,QAAQ,MAAM,eAAe,CAAC;AAE1C,uBAAuB,CAAC,YAAY,EAAE,GAAG,EAAE;IACzC,QAAQ,CAAC,yCAAyC,EAAE,GAAG,EAAE;QACvD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;QAC3B,EAAE,CAAC,iDAAiD,EAAE,KAAK;YACzD,MAAM,EAAC,WAAW,EAAC,GAAG,MAAM,WAAW,CAAC,WAAW,CAAC,IAAI,EAAE,qCAAqC,CAAC,CAAC;YAEjG,sEAAsE;YACtE,MAAM,KAAK,GAAG,WAAW,CAAC,eAAe,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,EAAE,KAAK,aAAa,CAAC,CAAC;YAC3F,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;YACrB,0CAA0C;YAC1C,MAAM,SAAS,GAAG,WAAW,CAAC,eAAe,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,EAAE,KAAK,aAAa,CAAC,CAAC;YAC/F,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;YACzB,MAAM,aAAa,GAAG,QAAQ,CAAC,UAAU,CAAC,8BAA8B,CAAC,WAAW,EAAE,KAAK,CAAC,CAAC;YAE7F,MAAM,CAAC,SAAS,CAAC,aAAa,EAAE,CAAC,EAAC,KAAK,EAAE,SAAS,EAAC,CAAC,CAAC,CAAC;QACxD,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["// Copyright 2023 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport * as Trace from '../../models/trace/trace.js';\nimport {describeWithEnvironment} from '../../testing/EnvironmentHelpers.js';\nimport {TraceLoader} from '../../testing/TraceLoader.js';\n\nimport * as Timeline from './timeline.js';\n\ndescribeWithEnvironment('Initiators', () => {\n describe('initiator-initiated event relationships', () => {\n let requestIdleCallbackCall: Trace.Types.Events.SyntheticProfileCall;\n let functionCallByrequestIdleCallback: Trace.Types.Events.Event;\n let setTimeoutCall: Trace.Types.Events.SyntheticProfileCall;\n let functionCallBySetTimeout: Trace.Types.Events.Event;\n let rAFCall: Trace.Types.Events.SyntheticProfileCall;\n let functionCallByRAF: Trace.Types.Events.Event;\n\n let parsedTrace: Trace.Handlers.Types.ParsedTrace;\n beforeEach(async function() {\n parsedTrace = (await TraceLoader.traceEngine(this, 'async-js-calls.json.gz')).parsedTrace;\n setTimeoutCall =\n parsedTrace.Renderer.allTraceEntries\n .filter(e => Trace.Types.Events.isProfileCall(e) && e.callFrame.functionName === 'setTimeout')\n .at(-1) as Trace.Types.Events.SyntheticProfileCall;\n assert.exists(setTimeoutCall);\n assert.isTrue(Trace.Types.Events.isProfileCall(setTimeoutCall));\n\n functionCallBySetTimeout =\n parsedTrace.Renderer.allTraceEntries.find(\n e => Trace.Types.Events.isFunctionCall(e) && e.ts > setTimeoutCall.ts) as Trace.Types.Events.Event;\n assert.exists(functionCallBySetTimeout);\n\n rAFCall =\n parsedTrace.Renderer.allTraceEntries\n .filter(e => Trace.Types.Events.isProfileCall(e) && e.callFrame.functionName === 'requestAnimationFrame')\n .at(-1) as Trace.Types.Events.SyntheticProfileCall;\n assert.exists(rAFCall);\n assert.isTrue(Trace.Types.Events.isProfileCall(rAFCall));\n\n functionCallByRAF =\n parsedTrace.Renderer.allTraceEntries.find(e => Trace.Types.Events.isFunctionCall(e) && e.ts > rAFCall.ts) as\n Trace.Types.Events.Event;\n assert.exists(functionCallByRAF);\n\n requestIdleCallbackCall =\n parsedTrace.Renderer.allTraceEntries\n .filter(e => Trace.Types.Events.isProfileCall(e) && e.callFrame.functionName === 'requestIdleCallback')\n .at(-1) as Trace.Types.Events.SyntheticProfileCall;\n assert.exists(requestIdleCallbackCall);\n assert.isTrue(Trace.Types.Events.isProfileCall(requestIdleCallbackCall));\n\n functionCallByrequestIdleCallback = parsedTrace.Renderer.allTraceEntries.find(\n e => Trace.Types.Events.isFunctionCall(e) &&\n e.ts > requestIdleCallbackCall.ts) as Trace.Types.Events.Event;\n assert.exists(functionCallByrequestIdleCallback);\n });\n it('returns the initiator data', async function() {\n const initiatorData = Timeline.Initiators.initiatorsDataToDraw(parsedTrace, functionCallBySetTimeout, [], []);\n assert.deepEqual(initiatorData[0], {\n event: functionCallBySetTimeout,\n initiator: setTimeoutCall,\n });\n });\n\n it('can walk up the tree to find the first parent with an initiator', async function() {\n // Find any of the bar() calls; they have a parent event\n // (FunctionCall) that has an initiator.\n const barCall = parsedTrace.Renderer.allTraceEntries.find(\n e => Trace.Types.Events.isProfileCall(e) && e.callFrame.functionName === 'bar');\n assert.exists(barCall);\n\n // Find the initator data but starting at the fibonacci()\n // call.\n const initiatorsData = Timeline.Initiators.initiatorsDataToDraw(parsedTrace, barCall, [], []);\n\n assert.deepEqual(initiatorsData[0], {\n event: functionCallBySetTimeout,\n initiator: setTimeoutCall,\n });\n });\n\n it('will walk back through the initiators to find the entire chain', async function() {\n // Find any of the baz() calls; they have a parent event\n // (FunctionCall) that has an initiator.\n const bazCall = parsedTrace.Renderer.allTraceEntries.find(\n e => Trace.Types.Events.isProfileCall(e) && e.callFrame.functionName === 'baz');\n assert.exists(bazCall);\n\n // Find the initators data but starting at the baz()\n // call. We expect to find 3 initiatorData objects here:\n // 1. baz() ===> FunctionCall caused by requestIdleCallback\n // 2. The requestIdleCallback from (1), caused by a prior setTimeout.\n // 3. The setTimeout from (2), caused by a prior requestAnimationFrame.\n const initiatorsData = Timeline.Initiators.initiatorsDataToDraw(parsedTrace, bazCall, [], []);\n\n assert.deepEqual(initiatorsData, [\n {\n event: functionCallByrequestIdleCallback,\n initiator: requestIdleCallbackCall,\n },\n {\n event: functionCallBySetTimeout,\n initiator: setTimeoutCall,\n },\n {\n event: functionCallByRAF,\n initiator: rAFCall,\n },\n ]);\n });\n\n it('will walk forward to find the events initiated by the selected entry', async function() {\n const initatorsData = Timeline.Initiators.initiatorsDataToDraw(parsedTrace, rAFCall, [], []);\n assert.lengthOf(initatorsData, 1);\n assert.strictEqual(initatorsData[0].event, functionCallByRAF);\n assert.strictEqual(initatorsData[0].initiator, rAFCall);\n });\n\n it('will return the closest expandable ancestor as an initiator in a pair if the initiator itself is hidden',\n async function() {\n // Get the parent of rAF to add to the expandable events array.\n // When we add rAF to hidden entries list, it will be the\n // closest expandable parent and the initiator should point to it.\n const rAFParent = parsedTrace.Renderer.entryToNode.get(rAFCall)?.parent;\n assert.exists(rAFParent);\n\n // Find the initatorData objects starting at the rAF\n // call. We expect to find one initatorData here:\n // rAF callback initiated by rAF -> Parent of rAF because rAF is hidden\n const initiatorsData =\n Timeline.Initiators.initiatorsDataToDraw(parsedTrace, rAFCall, [rAFCall], [rAFParent?.entry]);\n\n assert.lengthOf(initiatorsData, 1);\n assert.strictEqual(initiatorsData[0].event, functionCallByRAF);\n assert.strictEqual(initiatorsData[0].initiator, rAFParent.entry);\n // Ensure the expandable entry is marked as hidden\n assert.isTrue(initiatorsData[0].isInitiatorHidden);\n });\n\n it('will return the closest expandable ancestor as an initiated event in a pair if the event itself is hidden',\n async function() {\n const functionCallByRAFParent = parsedTrace.Renderer.entryToNode.get(functionCallByRAF)?.parent;\n assert.exists(functionCallByRAFParent);\n\n const initiatorsData = Timeline.Initiators.initiatorsDataToDraw(\n parsedTrace, rAFCall, [functionCallByRAF], [functionCallByRAFParent?.entry]);\n\n assert.lengthOf(initiatorsData, 1);\n assert.strictEqual(initiatorsData[0].event, functionCallByRAFParent?.entry);\n assert.strictEqual(initiatorsData[0].initiator, rAFCall);\n // Ensure the expandable entry is marked as hidden\n assert.isTrue(initiatorsData[0].isEntryHidden);\n });\n });\n\n describe('Network Requests', function() {\n it('returns the initiator data for network requests', async function() {\n const {parsedTrace} = await TraceLoader.traceEngine(this, 'network-requests-initiators.json.gz');\n\n // Find the network request to test, it is initiated by `youtube.com`.\n const event = parsedTrace.NetworkRequests.byTime.find(event => event.ts === 1491680762420);\n assert.exists(event);\n // Find the `youtube.com` network request.\n const initiator = parsedTrace.NetworkRequests.byTime.find(event => event.ts === 1491680629144);\n assert.exists(initiator);\n const initiatorData = Timeline.Initiators.initiatorsDataToDrawForNetwork(parsedTrace, event);\n\n assert.deepEqual(initiatorData, [{event, initiator}]);\n });\n });\n});\n"]} \ No newline at end of file diff --git a/public/panels/timeline/ModificationsManager.test.js b/public/panels/timeline/ModificationsManager.test.js index 59f02ebcd..cf9e66388 100644 --- a/public/panels/timeline/ModificationsManager.test.js +++ b/public/panels/timeline/ModificationsManager.test.js @@ -13,8 +13,8 @@ describeWithEnvironment('ModificationsManager', () => { throw new Error('Modifications manager does not exist.'); } const entriesFilter = modificationsManager.getEntriesFilter(); - assert.strictEqual(entriesFilter.expandableEntries().length, 1); - assert.strictEqual(entriesFilter.invisibleEntries().length, 108); + assert.lengthOf(entriesFilter.expandableEntries(), 1); + assert.lengthOf(entriesFilter.invisibleEntries(), 108); assert.deepEqual(modificationsManager.getTimelineBreadcrumbs().initialBreadcrumb, { window: { min: 1020034823047, max: 1020036087961, range: 1264914 }, child: { window: { min: 1020034823047, max: 1020035228006.5569, range: 404959.5568847656 }, child: null }, @@ -38,9 +38,9 @@ describeWithEnvironment('ModificationsManager', () => { } const entriesFilter = modificationsManager.getEntriesFilter(); const modifications = modificationsManager.toJSON(); - assert.strictEqual(entriesFilter.expandableEntries().length, 1); - assert.strictEqual(modifications.entriesModifications.expandableEntries.length, 1); - assert.strictEqual(modifications.entriesModifications.hiddenEntries.length, 108); + assert.lengthOf(entriesFilter.expandableEntries(), 1); + assert.lengthOf(modifications.entriesModifications.expandableEntries, 1); + assert.lengthOf(modifications.entriesModifications.hiddenEntries, 108); assert.deepEqual(modifications.initialBreadcrumb, { window: { min: 1020034823047, max: 1020036087961, range: 1264914 }, child: { window: { min: 1020034823047, max: 1020035228006.5569, range: 404959.5568847656 }, child: null }, diff --git a/public/panels/timeline/ModificationsManager.test.js.map b/public/panels/timeline/ModificationsManager.test.js.map index b86ec130d..b833cccf3 100644 --- a/public/panels/timeline/ModificationsManager.test.js.map +++ b/public/panels/timeline/ModificationsManager.test.js.map @@ -1 +1 @@ -{"version":3,"file":"ModificationsManager.test.js","sourceRoot":"","sources":["../../../../../../front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,CAAC,CAAC;QAC1E,MAAM,MAAM,GAAG,WAAW,CAAC,QAAQ,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC;QACvD,MAAM,MAAM,GAAG,WAAW,CAAC,QAAQ,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC;QAEvD,0FAA0F;QAC1F,+BAA+B;QAC/B,oBAAoB,CAAC,gBAAgB,CAAC;YACpC,IAAI,EAAE,cAAc;YACpB,KAAK,+DAA6C;YAClD,SAAS,EAAE,MAAM;YACjB,OAAO,EAAE,yBAAyB;SACnC,CAAC,CAAC;QAEH,wCAAwC;QACxC,yCAAyC;QACzC,oBAAoB,CAAC,gBAAgB,CAAC;YACpC,IAAI,EAAE,cAAc;YACpB,KAAK,+DAA6C;YAClD,SAAS,EAAE,MAAM;YACjB,OAAO,EAAE,MAAM;SAChB,CAAC,CAAC;QAEH,0DAA0D;QAC1D,+BAA+B;QAC/B,oBAAoB,CAAC,gBAAgB,CAAC;YACpC,IAAI,EAAE,aAAa;YACnB,KAAK,EAAE,yBAAyB;YAChC,KAAK,EAAE,aAAa;SACrB,CAAC,CAAC;QAEH,oBAAoB,CAAC,sBAAsB,CAAC,yBAAyB,CAAC,CAAC;QACvE,MAAM,mBAAmB,GAAG,oBAAoB,CAAC,cAAc,EAAE,CAAC;QAElE,6FAA6F;QAC7F,MAAM,CAAC,SAAS,CACZ,mBAAmB,EACnB;YACE;gBACE,IAAI,EAAE,cAAc;gBACpB,KAAK,+DAA6C;gBAClD,SAAS,EAAE,MAAM;gBACjB,OAAO,EAAE,MAAM;aAChB;SACF,CACJ,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["// Copyright 2024 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport * as Trace from '../../models/trace/trace.js';\nimport {describeWithEnvironment} from '../../testing/EnvironmentHelpers.js';\nimport {TraceLoader} from '../../testing/TraceLoader.js';\n\nimport * as Timeline from './timeline.js';\n\ndescribeWithEnvironment('ModificationsManager', () => {\n it('applies modifications when present in a trace file', async function() {\n await TraceLoader.traceEngine(null, 'web-dev-modifications.json.gz');\n const modificationsManager = Timeline.ModificationsManager.ModificationsManager.activeManager();\n if (!modificationsManager) {\n throw new Error('Modifications manager does not exist.');\n }\n const entriesFilter = modificationsManager.getEntriesFilter();\n assert.strictEqual(entriesFilter.expandableEntries().length, 1);\n assert.strictEqual(entriesFilter.invisibleEntries().length, 108);\n assert.deepEqual(modificationsManager.getTimelineBreadcrumbs().initialBreadcrumb, {\n window: {min: 1020034823047, max: 1020036087961, range: 1264914},\n child: {window: {min: 1020034823047, max: 1020035228006.5569, range: 404959.5568847656}, child: null},\n } as Trace.Types.File.Breadcrumb);\n // Make sure the saved Label Annotation is applied\n const labelAnnotation = modificationsManager.getAnnotations()[0];\n const label = (labelAnnotation.type === 'ENTRY_LABEL') ? labelAnnotation.label : '';\n assert.deepEqual(labelAnnotation.type, 'ENTRY_LABEL');\n assert.deepEqual(label, 'Initialize App');\n // Make sure the saved Range Annotation is applied\n const timeRangeAnnotation = modificationsManager.getAnnotations()[1];\n const rangeLabel = (timeRangeAnnotation.type === 'TIME_RANGE') ? timeRangeAnnotation.label : '';\n assert.deepEqual(modificationsManager.getAnnotations()[1].type, 'TIME_RANGE');\n assert.deepEqual(rangeLabel, 'Visibility change 1');\n });\n\n it('generates a serializable modifications json ', async function() {\n await TraceLoader.traceEngine(null, 'web-dev-modifications.json.gz');\n const modificationsManager = Timeline.ModificationsManager.ModificationsManager.activeManager();\n if (!modificationsManager) {\n throw new Error('Modifications manager does not exist.');\n }\n const entriesFilter = modificationsManager.getEntriesFilter();\n const modifications = modificationsManager.toJSON();\n assert.strictEqual(entriesFilter.expandableEntries().length, 1);\n assert.strictEqual(modifications.entriesModifications.expandableEntries.length, 1);\n assert.strictEqual(modifications.entriesModifications.hiddenEntries.length, 108);\n assert.deepEqual(modifications.initialBreadcrumb, {\n window: {min: 1020034823047, max: 1020036087961, range: 1264914},\n child: {window: {min: 1020034823047, max: 1020035228006.5569, range: 404959.5568847656}, child: null},\n } as Trace.Types.File.Breadcrumb);\n assert.deepEqual(modifications.annotations.entryLabels, [\n {entry: 'p-73704-775-2151-457', label: 'Initialize App'},\n ]);\n assert.deepEqual(modifications.annotations.labelledTimeRanges, [\n {\n bounds: {min: 1020034870460.4769, max: 1020034880507.9258, range: 10047.448852539062},\n label: 'Visibility change 1',\n },\n ]);\n });\n\n it('creates annotations and generates correct json for annotations', async function() {\n const parsedTrace = (await TraceLoader.traceEngine(null, 'web-dev-with-commit.json.gz')).parsedTrace;\n // Get any entres to create a label and a link with.\n const entry = parsedTrace.Renderer.allTraceEntries[0];\n const entry2 = parsedTrace.Renderer.allTraceEntries[1];\n\n const modificationsManager = Timeline.ModificationsManager.ModificationsManager.activeManager();\n assert.isOk(modificationsManager);\n\n modificationsManager.createAnnotation({\n type: 'ENTRY_LABEL',\n entry,\n label: 'entry label',\n });\n\n modificationsManager.createAnnotation({\n type: 'ENTRIES_LINK',\n state: Trace.Types.File.EntriesLinkState.CONNECTED,\n entryFrom: entry,\n entryTo: entry2,\n });\n\n modificationsManager.createAnnotation({\n type: 'TIME_RANGE',\n bounds: {\n min: Trace.Types.Timing.MicroSeconds(0),\n max: Trace.Types.Timing.MicroSeconds(10),\n range: Trace.Types.Timing.MicroSeconds(10),\n },\n label: 'range label',\n });\n\n const modifications = modificationsManager.toJSON().annotations;\n assert.deepEqual(modifications, {\n entryLabels: [{\n entry: 'r-38',\n label: 'entry label',\n }],\n labelledTimeRanges: [{\n bounds: {\n min: Trace.Types.Timing.MicroSeconds(0),\n max: Trace.Types.Timing.MicroSeconds(10),\n range: Trace.Types.Timing.MicroSeconds(10),\n },\n label: 'range label',\n }],\n linksBetweenEntries: [{\n entryFrom: 'r-38',\n entryTo: 'r-39',\n }],\n });\n });\n\n it('does not add the annotation link between entries into the json saved into metadata if `entryTo` does not exist',\n async function() {\n const parsedTrace = (await TraceLoader.traceEngine(null, 'web-dev-with-commit.json.gz')).parsedTrace;\n // Get any entry to create links with.\n const entry = parsedTrace.Renderer.allTraceEntries[0];\n const entry2 = parsedTrace.Renderer.allTraceEntries[1];\n\n const modificationsManager = Timeline.ModificationsManager.ModificationsManager.activeManager();\n assert.isOk(modificationsManager);\n\n modificationsManager.createAnnotation({\n type: 'ENTRIES_LINK',\n state: Trace.Types.File.EntriesLinkState.CONNECTED,\n entryFrom: entry,\n entryTo: entry2,\n });\n\n modificationsManager.createAnnotation({\n type: 'ENTRIES_LINK',\n state: Trace.Types.File.EntriesLinkState.PENDING_TO_EVENT,\n entryFrom: entry2,\n });\n\n // Make sure only the link with both 'to' and 'from' entries in in the generated JSON\n const modifications = modificationsManager.toJSON().annotations;\n assert.deepEqual(modifications, {\n entryLabels: [],\n labelledTimeRanges: [],\n linksBetweenEntries: [{\n entryFrom: 'r-38',\n entryTo: 'r-39',\n }],\n });\n });\n\n it('correctly identifies if a connection between entries already exists', async function() {\n const parsedTrace = (await TraceLoader.traceEngine(null, 'web-dev-with-commit.json.gz')).parsedTrace;\n // Get any entry to create links with.\n const entry1 = parsedTrace.Renderer.allTraceEntries[0];\n const entry2 = parsedTrace.Renderer.allTraceEntries[1];\n const entry3 = parsedTrace.Renderer.allTraceEntries[2];\n\n const modificationsManager = Timeline.ModificationsManager.ModificationsManager.activeManager();\n assert.isOk(modificationsManager);\n\n // Create a connection between entry 1 and entry 2\n modificationsManager.createAnnotation({\n type: 'ENTRIES_LINK',\n state: Trace.Types.File.EntriesLinkState.CONNECTED,\n entryFrom: entry1,\n entryTo: entry2,\n });\n\n // Chech if a connection between entries 1 and 3 exists\n const existsBetween1And3 = modificationsManager.linkAnnotationBetweenEntriesExists(entry1, entry3);\n // Make sure the link does not exists\n assert.isFalse(existsBetween1And3);\n\n // Chech if a connection between entries 1 and 2 exists\n const existsBetween1And2 = modificationsManager.linkAnnotationBetweenEntriesExists(entry1, entry2);\n // Make sure the link exists\n assert.isTrue(existsBetween1And2);\n\n // Chech if a connection between entries 2 and 1 exists. It should since the order of entries does not matter.\n const existsBetween2And1 = modificationsManager.linkAnnotationBetweenEntriesExists(entry1, entry2);\n // Make sure the link exists\n assert.isTrue(existsBetween2And1);\n });\n\n it('deletes time ranges with an empty label from the annotations list', async function() {\n await TraceLoader.traceEngine(null, 'web-dev-with-commit.json.gz');\n const modificationsManager = Timeline.ModificationsManager.ModificationsManager.activeManager();\n assert.isOk(modificationsManager);\n\n modificationsManager.createAnnotation({\n type: 'TIME_RANGE',\n bounds: {\n min: Trace.Types.Timing.MicroSeconds(0),\n max: Trace.Types.Timing.MicroSeconds(10),\n range: Trace.Types.Timing.MicroSeconds(10),\n },\n label: 'label',\n });\n\n // Create time range with empty label that shoud be removed\n modificationsManager.createAnnotation({\n type: 'TIME_RANGE',\n bounds: {\n min: Trace.Types.Timing.MicroSeconds(3),\n max: Trace.Types.Timing.MicroSeconds(10),\n range: Trace.Types.Timing.MicroSeconds(7),\n },\n label: '',\n });\n\n // Create time range with empty label that shoud be removed\n modificationsManager.createAnnotation({\n type: 'TIME_RANGE',\n bounds: {\n min: Trace.Types.Timing.MicroSeconds(5),\n max: Trace.Types.Timing.MicroSeconds(10),\n range: Trace.Types.Timing.MicroSeconds(5),\n },\n label: '',\n });\n\n modificationsManager.deleteEmptyRangeAnnotations();\n const modifications = modificationsManager.toJSON().annotations;\n\n // Make sure that the annotations with an empty label were deleted\n assert.deepEqual(modifications.labelledTimeRanges, [{\n bounds: {\n min: Trace.Types.Timing.MicroSeconds(0),\n max: Trace.Types.Timing.MicroSeconds(10),\n range: Trace.Types.Timing.MicroSeconds(10),\n },\n label: 'label',\n }]);\n });\n\n it('correctly gets all annotations associated with an entry', async function() {\n const parsedTrace = (await TraceLoader.traceEngine(null, 'web-dev-with-commit.json.gz')).parsedTrace;\n const modificationsManager = Timeline.ModificationsManager.ModificationsManager.activeManager();\n assert.isOk(modificationsManager);\n\n // Get any entry to create annotations with.\n const entryToFindAnnotationsFor = parsedTrace.Renderer.allTraceEntries[0];\n const entry2 = parsedTrace.Renderer.allTraceEntries[1];\n const entry3 = parsedTrace.Renderer.allTraceEntries[2];\n\n // Create a connection between entry we are looking for annotations for and another entry.\n // This link should be a part of associated with the entry annotations.\n modificationsManager.createAnnotation({\n type: 'ENTRIES_LINK',\n state: Trace.Types.File.EntriesLinkState.CONNECTED,\n entryFrom: entry2,\n entryTo: entryToFindAnnotationsFor,\n });\n\n // Create a link between random entries\n modificationsManager.createAnnotation({\n type: 'ENTRIES_LINK',\n state: Trace.Types.File.EntriesLinkState.CONNECTED,\n entryFrom: entry3,\n entryTo: entry2,\n });\n\n // Label for the entry we are looking for annotations for.\n // This label should be a part of associated with the entry annotations.\n modificationsManager.createAnnotation({\n type: 'ENTRY_LABEL',\n entry: entryToFindAnnotationsFor,\n label: 'entry label',\n });\n\n const annotationsForEntry = modificationsManager.annotationsForEntry(entryToFindAnnotationsFor);\n\n // Make sure the method returns annotations that `entryToFindAnnotationsFor` is a part of\n assert.deepEqual(\n annotationsForEntry,\n [\n {\n type: 'ENTRIES_LINK',\n state: Trace.Types.File.EntriesLinkState.CONNECTED,\n entryFrom: entry2,\n entryTo: entryToFindAnnotationsFor,\n },\n {\n type: 'ENTRY_LABEL',\n entry: entryToFindAnnotationsFor,\n label: 'entry label',\n },\n ],\n );\n });\n\n it('deletes all annotations associated with an entry', async function() {\n const parsedTrace = (await TraceLoader.traceEngine(null, 'web-dev-with-commit.json.gz')).parsedTrace;\n const modificationsManager = Timeline.ModificationsManager.ModificationsManager.activeManager();\n assert.isOk(modificationsManager);\n\n // Get any entry to create annotations with.\n const entryToFindAnnotationsFor = parsedTrace.Renderer.allTraceEntries[0];\n const entry2 = parsedTrace.Renderer.allTraceEntries[1];\n const entry3 = parsedTrace.Renderer.allTraceEntries[2];\n\n // Create a connection between entry we are looking for annotations for and another entry.\n // This link should be deleted.\n modificationsManager.createAnnotation({\n type: 'ENTRIES_LINK',\n state: Trace.Types.File.EntriesLinkState.CONNECTED,\n entryFrom: entry2,\n entryTo: entryToFindAnnotationsFor,\n });\n\n // Create a link between random entries.\n // This annotation should not be deleted/\n modificationsManager.createAnnotation({\n type: 'ENTRIES_LINK',\n state: Trace.Types.File.EntriesLinkState.CONNECTED,\n entryFrom: entry3,\n entryTo: entry2,\n });\n\n // Label for the entry we are looking for annotations for.\n // This link should be deleted.\n modificationsManager.createAnnotation({\n type: 'ENTRY_LABEL',\n entry: entryToFindAnnotationsFor,\n label: 'entry label',\n });\n\n modificationsManager.deleteEntryAnnotations(entryToFindAnnotationsFor);\n const annotationsForEntry = modificationsManager.getAnnotations();\n\n // Make sure the method deleted all annotations that `entryToFindAnnotationsFor` is a part of\n assert.deepEqual(\n annotationsForEntry,\n [\n {\n type: 'ENTRIES_LINK',\n state: Trace.Types.File.EntriesLinkState.CONNECTED,\n entryFrom: entry3,\n entryTo: entry2,\n },\n ],\n );\n });\n});\n"]} \ No newline at end of file +{"version":3,"file":"ModificationsManager.test.js","sourceRoot":"","sources":["../../../../../../front_end/panels/timeline/ModificationsManager.test.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,KAAK,KAAK,MAAM,6BAA6B,CAAC;AACrD,OAAO,EAAC,uBAAuB,EAAC,MAAM,qCAAqC,CAAC;AAC5E,OAAO,EAAC,WAAW,EAAC,MAAM,8BAA8B,CAAC;AAEzD,OAAO,KAAK,QAAQ,MAAM,eAAe,CAAC;AAE1C,uBAAuB,CAAC,sBAAsB,EAAE,GAAG,EAAE;IACnD,EAAE,CAAC,oDAAoD,EAAE,KAAK;QAC5D,MAAM,WAAW,CAAC,WAAW,CAAC,IAAI,EAAE,+BAA+B,CAAC,CAAC;QACrE,MAAM,oBAAoB,GAAG,QAAQ,CAAC,oBAAoB,CAAC,oBAAoB,CAAC,aAAa,EAAE,CAAC;QAChG,IAAI,CAAC,oBAAoB,EAAE,CAAC;YAC1B,MAAM,IAAI,KAAK,CAAC,uCAAuC,CAA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E,aAAa;SACrB,CAAC,CAAC;QAEH,oBAAoB,CAAC,sBAAsB,CAAC,yBAAyB,CAAC,CAAC;QACvE,MAAM,mBAAmB,GAAG,oBAAoB,CAAC,cAAc,EAAE,CAAC;QAElE,6FAA6F;QAC7F,MAAM,CAAC,SAAS,CACZ,mBAAmB,EACnB;YACE;gBACE,IAAI,EAAE,cAAc;gBACpB,KAAK,+DAA6C;gBAClD,SAAS,EAAE,MAAM;gBACjB,OAAO,EAAE,MAAM;aAChB;SACF,CACJ,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["// Copyright 2024 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport * as Trace from '../../models/trace/trace.js';\nimport {describeWithEnvironment} from '../../testing/EnvironmentHelpers.js';\nimport {TraceLoader} from '../../testing/TraceLoader.js';\n\nimport * as Timeline from './timeline.js';\n\ndescribeWithEnvironment('ModificationsManager', () => {\n it('applies modifications when present in a trace file', async function() {\n await TraceLoader.traceEngine(null, 'web-dev-modifications.json.gz');\n const modificationsManager = Timeline.ModificationsManager.ModificationsManager.activeManager();\n if (!modificationsManager) {\n throw new Error('Modifications manager does not exist.');\n }\n const entriesFilter = modificationsManager.getEntriesFilter();\n assert.lengthOf(entriesFilter.expandableEntries(), 1);\n assert.lengthOf(entriesFilter.invisibleEntries(), 108);\n assert.deepEqual(modificationsManager.getTimelineBreadcrumbs().initialBreadcrumb, {\n window: {min: 1020034823047, max: 1020036087961, range: 1264914},\n child: {window: {min: 1020034823047, max: 1020035228006.5569, range: 404959.5568847656}, child: null},\n } as Trace.Types.File.Breadcrumb);\n // Make sure the saved Label Annotation is applied\n const labelAnnotation = modificationsManager.getAnnotations()[0];\n const label = (labelAnnotation.type === 'ENTRY_LABEL') ? labelAnnotation.label : '';\n assert.deepEqual(labelAnnotation.type, 'ENTRY_LABEL');\n assert.deepEqual(label, 'Initialize App');\n // Make sure the saved Range Annotation is applied\n const timeRangeAnnotation = modificationsManager.getAnnotations()[1];\n const rangeLabel = (timeRangeAnnotation.type === 'TIME_RANGE') ? timeRangeAnnotation.label : '';\n assert.deepEqual(modificationsManager.getAnnotations()[1].type, 'TIME_RANGE');\n assert.deepEqual(rangeLabel, 'Visibility change 1');\n });\n\n it('generates a serializable modifications json ', async function() {\n await TraceLoader.traceEngine(null, 'web-dev-modifications.json.gz');\n const modificationsManager = Timeline.ModificationsManager.ModificationsManager.activeManager();\n if (!modificationsManager) {\n throw new Error('Modifications manager does not exist.');\n }\n const entriesFilter = modificationsManager.getEntriesFilter();\n const modifications = modificationsManager.toJSON();\n assert.lengthOf(entriesFilter.expandableEntries(), 1);\n assert.lengthOf(modifications.entriesModifications.expandableEntries, 1);\n assert.lengthOf(modifications.entriesModifications.hiddenEntries, 108);\n assert.deepEqual(modifications.initialBreadcrumb, {\n window: {min: 1020034823047, max: 1020036087961, range: 1264914},\n child: {window: {min: 1020034823047, max: 1020035228006.5569, range: 404959.5568847656}, child: null},\n } as Trace.Types.File.Breadcrumb);\n assert.deepEqual(modifications.annotations.entryLabels, [\n {entry: 'p-73704-775-2151-457', label: 'Initialize App'},\n ]);\n assert.deepEqual(modifications.annotations.labelledTimeRanges, [\n {\n bounds: {min: 1020034870460.4769, max: 1020034880507.9258, range: 10047.448852539062},\n label: 'Visibility change 1',\n },\n ]);\n });\n\n it('creates annotations and generates correct json for annotations', async function() {\n const parsedTrace = (await TraceLoader.traceEngine(null, 'web-dev-with-commit.json.gz')).parsedTrace;\n // Get any entres to create a label and a link with.\n const entry = parsedTrace.Renderer.allTraceEntries[0];\n const entry2 = parsedTrace.Renderer.allTraceEntries[1];\n\n const modificationsManager = Timeline.ModificationsManager.ModificationsManager.activeManager();\n assert.isOk(modificationsManager);\n\n modificationsManager.createAnnotation({\n type: 'ENTRY_LABEL',\n entry,\n label: 'entry label',\n });\n\n modificationsManager.createAnnotation({\n type: 'ENTRIES_LINK',\n state: Trace.Types.File.EntriesLinkState.CONNECTED,\n entryFrom: entry,\n entryTo: entry2,\n });\n\n modificationsManager.createAnnotation({\n type: 'TIME_RANGE',\n bounds: {\n min: Trace.Types.Timing.MicroSeconds(0),\n max: Trace.Types.Timing.MicroSeconds(10),\n range: Trace.Types.Timing.MicroSeconds(10),\n },\n label: 'range label',\n });\n\n const modifications = modificationsManager.toJSON().annotations;\n assert.deepEqual(modifications, {\n entryLabels: [{\n entry: 'r-38',\n label: 'entry label',\n }],\n labelledTimeRanges: [{\n bounds: {\n min: Trace.Types.Timing.MicroSeconds(0),\n max: Trace.Types.Timing.MicroSeconds(10),\n range: Trace.Types.Timing.MicroSeconds(10),\n },\n label: 'range label',\n }],\n linksBetweenEntries: [{\n entryFrom: 'r-38',\n entryTo: 'r-39',\n }],\n });\n });\n\n it('does not add the annotation link between entries into the json saved into metadata if `entryTo` does not exist',\n async function() {\n const parsedTrace = (await TraceLoader.traceEngine(null, 'web-dev-with-commit.json.gz')).parsedTrace;\n // Get any entry to create links with.\n const entry = parsedTrace.Renderer.allTraceEntries[0];\n const entry2 = parsedTrace.Renderer.allTraceEntries[1];\n\n const modificationsManager = Timeline.ModificationsManager.ModificationsManager.activeManager();\n assert.isOk(modificationsManager);\n\n modificationsManager.createAnnotation({\n type: 'ENTRIES_LINK',\n state: Trace.Types.File.EntriesLinkState.CONNECTED,\n entryFrom: entry,\n entryTo: entry2,\n });\n\n modificationsManager.createAnnotation({\n type: 'ENTRIES_LINK',\n state: Trace.Types.File.EntriesLinkState.PENDING_TO_EVENT,\n entryFrom: entry2,\n });\n\n // Make sure only the link with both 'to' and 'from' entries in in the generated JSON\n const modifications = modificationsManager.toJSON().annotations;\n assert.deepEqual(modifications, {\n entryLabels: [],\n labelledTimeRanges: [],\n linksBetweenEntries: [{\n entryFrom: 'r-38',\n entryTo: 'r-39',\n }],\n });\n });\n\n it('correctly identifies if a connection between entries already exists', async function() {\n const parsedTrace = (await TraceLoader.traceEngine(null, 'web-dev-with-commit.json.gz')).parsedTrace;\n // Get any entry to create links with.\n const entry1 = parsedTrace.Renderer.allTraceEntries[0];\n const entry2 = parsedTrace.Renderer.allTraceEntries[1];\n const entry3 = parsedTrace.Renderer.allTraceEntries[2];\n\n const modificationsManager = Timeline.ModificationsManager.ModificationsManager.activeManager();\n assert.isOk(modificationsManager);\n\n // Create a connection between entry 1 and entry 2\n modificationsManager.createAnnotation({\n type: 'ENTRIES_LINK',\n state: Trace.Types.File.EntriesLinkState.CONNECTED,\n entryFrom: entry1,\n entryTo: entry2,\n });\n\n // Chech if a connection between entries 1 and 3 exists\n const existsBetween1And3 = modificationsManager.linkAnnotationBetweenEntriesExists(entry1, entry3);\n // Make sure the link does not exists\n assert.isFalse(existsBetween1And3);\n\n // Chech if a connection between entries 1 and 2 exists\n const existsBetween1And2 = modificationsManager.linkAnnotationBetweenEntriesExists(entry1, entry2);\n // Make sure the link exists\n assert.isTrue(existsBetween1And2);\n\n // Chech if a connection between entries 2 and 1 exists. It should since the order of entries does not matter.\n const existsBetween2And1 = modificationsManager.linkAnnotationBetweenEntriesExists(entry1, entry2);\n // Make sure the link exists\n assert.isTrue(existsBetween2And1);\n });\n\n it('deletes time ranges with an empty label from the annotations list', async function() {\n await TraceLoader.traceEngine(null, 'web-dev-with-commit.json.gz');\n const modificationsManager = Timeline.ModificationsManager.ModificationsManager.activeManager();\n assert.isOk(modificationsManager);\n\n modificationsManager.createAnnotation({\n type: 'TIME_RANGE',\n bounds: {\n min: Trace.Types.Timing.MicroSeconds(0),\n max: Trace.Types.Timing.MicroSeconds(10),\n range: Trace.Types.Timing.MicroSeconds(10),\n },\n label: 'label',\n });\n\n // Create time range with empty label that shoud be removed\n modificationsManager.createAnnotation({\n type: 'TIME_RANGE',\n bounds: {\n min: Trace.Types.Timing.MicroSeconds(3),\n max: Trace.Types.Timing.MicroSeconds(10),\n range: Trace.Types.Timing.MicroSeconds(7),\n },\n label: '',\n });\n\n // Create time range with empty label that shoud be removed\n modificationsManager.createAnnotation({\n type: 'TIME_RANGE',\n bounds: {\n min: Trace.Types.Timing.MicroSeconds(5),\n max: Trace.Types.Timing.MicroSeconds(10),\n range: Trace.Types.Timing.MicroSeconds(5),\n },\n label: '',\n });\n\n modificationsManager.deleteEmptyRangeAnnotations();\n const modifications = modificationsManager.toJSON().annotations;\n\n // Make sure that the annotations with an empty label were deleted\n assert.deepEqual(modifications.labelledTimeRanges, [{\n bounds: {\n min: Trace.Types.Timing.MicroSeconds(0),\n max: Trace.Types.Timing.MicroSeconds(10),\n range: Trace.Types.Timing.MicroSeconds(10),\n },\n label: 'label',\n }]);\n });\n\n it('correctly gets all annotations associated with an entry', async function() {\n const parsedTrace = (await TraceLoader.traceEngine(null, 'web-dev-with-commit.json.gz')).parsedTrace;\n const modificationsManager = Timeline.ModificationsManager.ModificationsManager.activeManager();\n assert.isOk(modificationsManager);\n\n // Get any entry to create annotations with.\n const entryToFindAnnotationsFor = parsedTrace.Renderer.allTraceEntries[0];\n const entry2 = parsedTrace.Renderer.allTraceEntries[1];\n const entry3 = parsedTrace.Renderer.allTraceEntries[2];\n\n // Create a connection between entry we are looking for annotations for and another entry.\n // This link should be a part of associated with the entry annotations.\n modificationsManager.createAnnotation({\n type: 'ENTRIES_LINK',\n state: Trace.Types.File.EntriesLinkState.CONNECTED,\n entryFrom: entry2,\n entryTo: entryToFindAnnotationsFor,\n });\n\n // Create a link between random entries\n modificationsManager.createAnnotation({\n type: 'ENTRIES_LINK',\n state: Trace.Types.File.EntriesLinkState.CONNECTED,\n entryFrom: entry3,\n entryTo: entry2,\n });\n\n // Label for the entry we are looking for annotations for.\n // This label should be a part of associated with the entry annotations.\n modificationsManager.createAnnotation({\n type: 'ENTRY_LABEL',\n entry: entryToFindAnnotationsFor,\n label: 'entry label',\n });\n\n const annotationsForEntry = modificationsManager.annotationsForEntry(entryToFindAnnotationsFor);\n\n // Make sure the method returns annotations that `entryToFindAnnotationsFor` is a part of\n assert.deepEqual(\n annotationsForEntry,\n [\n {\n type: 'ENTRIES_LINK',\n state: Trace.Types.File.EntriesLinkState.CONNECTED,\n entryFrom: entry2,\n entryTo: entryToFindAnnotationsFor,\n },\n {\n type: 'ENTRY_LABEL',\n entry: entryToFindAnnotationsFor,\n label: 'entry label',\n },\n ],\n );\n });\n\n it('deletes all annotations associated with an entry', async function() {\n const parsedTrace = (await TraceLoader.traceEngine(null, 'web-dev-with-commit.json.gz')).parsedTrace;\n const modificationsManager = Timeline.ModificationsManager.ModificationsManager.activeManager();\n assert.isOk(modificationsManager);\n\n // Get any entry to create annotations with.\n const entryToFindAnnotationsFor = parsedTrace.Renderer.allTraceEntries[0];\n const entry2 = parsedTrace.Renderer.allTraceEntries[1];\n const entry3 = parsedTrace.Renderer.allTraceEntries[2];\n\n // Create a connection between entry we are looking for annotations for and another entry.\n // This link should be deleted.\n modificationsManager.createAnnotation({\n type: 'ENTRIES_LINK',\n state: Trace.Types.File.EntriesLinkState.CONNECTED,\n entryFrom: entry2,\n entryTo: entryToFindAnnotationsFor,\n });\n\n // Create a link between random entries.\n // This annotation should not be deleted/\n modificationsManager.createAnnotation({\n type: 'ENTRIES_LINK',\n state: Trace.Types.File.EntriesLinkState.CONNECTED,\n entryFrom: entry3,\n entryTo: entry2,\n });\n\n // Label for the entry we are looking for annotations for.\n // This link should be deleted.\n modificationsManager.createAnnotation({\n type: 'ENTRY_LABEL',\n entry: entryToFindAnnotationsFor,\n label: 'entry label',\n });\n\n modificationsManager.deleteEntryAnnotations(entryToFindAnnotationsFor);\n const annotationsForEntry = modificationsManager.getAnnotations();\n\n // Make sure the method deleted all annotations that `entryToFindAnnotationsFor` is a part of\n assert.deepEqual(\n annotationsForEntry,\n [\n {\n type: 'ENTRIES_LINK',\n state: Trace.Types.File.EntriesLinkState.CONNECTED,\n entryFrom: entry3,\n entryTo: entry2,\n },\n ],\n );\n });\n});\n"]} \ No newline at end of file diff --git a/public/panels/timeline/TimelineDetailsView.test.js b/public/panels/timeline/TimelineDetailsView.test.js index 4b953b9b7..a705b8649 100644 --- a/public/panels/timeline/TimelineDetailsView.test.js +++ b/public/panels/timeline/TimelineDetailsView.test.js @@ -32,7 +32,7 @@ describeWithEnvironment('TimelineDetailsView', function () { await detailsView.setSelection(selection); const detailsContentElement = detailsView.getDetailsContentElementForTest(); // NetworkRequestDetails and RelatedInsightsChips nodes. - assert.strictEqual(detailsContentElement.childNodes.length, 2); + assert.lengthOf(detailsContentElement.childNodes, 2); }); it('displays the details for a frame correctly', async function () { const { parsedTrace } = await TraceLoader.traceEngine(this, 'web-dev-with-commit.json.gz'); diff --git a/public/panels/timeline/TimelineDetailsView.test.js.map b/public/panels/timeline/TimelineDetailsView.test.js.map index b9fe87ffe..85a4273ea 100644 --- a/public/panels/timeline/TimelineDetailsView.test.js.map +++ b/public/panels/timeline/TimelineDetailsView.test.js.map @@ -1 +1 @@ -{"version":3,"file":"TimelineDetailsView.test.js","sourceRoot":"","sources":["../../../../../../front_end/panels/timeline/TimelineDetailsView.test.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,KAAK,KAAK,MAAM,6BAA6B,CAAC;AACrD,OAAO,EAAC,SAAS,EAAC,MAAM,6BAA6B,CAAC;AACtD,OAAO,EAAC,uBAAuB,EAAC,MAAM,qCAAqC,CAAC;AAC5E,OAAO,EAAC,WAAW,EAAC,MAAM,8BAA8B,CAAC;AAEzD,OAAO,KAAK,QAAQ,MAAM,eAAe,CAAC;AAE1C,MAAM,gBAAgB;IACpB,MAAM,CAAC,UAA6D;IACpE,CAAC;IACD,iBAAiB,CAAC,OAAwC,EAAE,KAAa;IACzE,CAAC;IACD,cAAc,CAAC,MAAqC;IACpD,CAAC;IACD,OAAO,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;CACzC;AAED,uBAAuB,CAAC,qBAAqB,EAAE;IAC7C,MAAM,gBAAgB,GAAG,IAAI,gBAAgB,EAAE,CAAC;IAEhD,EAAE,CAAC,2DAA2D,EAAE,KAAK;QACnE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a,CAAc,gBAAgB,CAAC,CAAC;QAClF,MAAM,CAAC,WAAW,CAAC,KAAK,EAAE,SAAS,EAAE,uBAAuB,CAAC,CAAC;IAChE,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["// Copyright 2021 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport * as Trace from '../../models/trace/trace.js';\nimport {doubleRaf} from '../../testing/DOMHelpers.js';\nimport {describeWithEnvironment} from '../../testing/EnvironmentHelpers.js';\nimport {TraceLoader} from '../../testing/TraceLoader.js';\n\nimport * as Timeline from './timeline.js';\n\nclass MockViewDelegate implements Timeline.TimelinePanel.TimelineModeViewDelegate {\n select(_selection: Timeline.TimelineSelection.TimelineSelection|null): void {\n }\n selectEntryAtTime(_events: Trace.Types.Events.Event[]|null, _time: number): void {\n }\n highlightEvent(_event: Trace.Types.Events.Event|null): void {\n }\n element = document.createElement('div');\n}\n\ndescribeWithEnvironment('TimelineDetailsView', function() {\n const mockViewDelegate = new MockViewDelegate();\n\n it('displays the details of a network request event correctly', async function() {\n const {parsedTrace, insights} = await TraceLoader.traceEngine(this, 'lcp-web-font.json.gz');\n const detailsView = new Timeline.TimelineDetailsView.TimelineDetailsView(mockViewDelegate);\n\n const networkRequests = parsedTrace.NetworkRequests.byTime;\n const cssRequest = networkRequests.find(request => {\n return request.args.data.url === 'https://chromedevtools.github.io/performance-stories/lcp-web-font/app.css';\n });\n if (!cssRequest) {\n throw new Error('Could not find expected network request.');\n }\n const selection = Timeline.TimelineSelection.selectionFromEvent(cssRequest);\n\n await detailsView.setModel(\n {parsedTrace, selectedEvents: null, traceInsightsSets: insights, eventToRelatedInsightsMap: null});\n await detailsView.setSelection(selection);\n\n const detailsContentElement = detailsView.getDetailsContentElementForTest();\n // NetworkRequestDetails and RelatedInsightsChips nodes.\n assert.strictEqual(detailsContentElement.childNodes.length, 2);\n });\n\n it('displays the details for a frame correctly', async function() {\n const {parsedTrace} = await TraceLoader.traceEngine(this, 'web-dev-with-commit.json.gz');\n const detailsView = new Timeline.TimelineDetailsView.TimelineDetailsView(mockViewDelegate);\n await detailsView.setModel(\n {parsedTrace, selectedEvents: null, traceInsightsSets: null, eventToRelatedInsightsMap: null});\n\n const frame = parsedTrace.Frames.frames.at(0);\n assert.isOk(frame);\n const selection = Timeline.TimelineSelection.selectionFromEvent(frame);\n await detailsView.setSelection(selection);\n await doubleRaf(); // to let the image be fetched + rendered.\n const detailsContentElement = detailsView.getDetailsContentElementForTest();\n const frameImg = detailsContentElement.querySelector('.timeline-filmstrip-preview img');\n assert.instanceOf(frameImg, HTMLImageElement);\n assert.isDefined(frameImg.src);\n\n const duration = detailsContentElement.querySelector('[data-row-title=\"Duration\"]');\n assert.isOk(duration);\n assert.strictEqual(duration.innerText, 'Duration37.85 ms (at 109.82 ms)');\n });\n\n it('renders the layout shift component for a single layout shift', async function() {\n const {parsedTrace} = await TraceLoader.traceEngine(this, 'shift-attribution.json.gz');\n const detailsView = new Timeline.TimelineDetailsView.TimelineDetailsView(mockViewDelegate);\n await detailsView.setModel(\n {parsedTrace, selectedEvents: null, traceInsightsSets: null, eventToRelatedInsightsMap: null});\n\n const layoutShift = parsedTrace.LayoutShifts.clusters.at(0)?.events.at(0);\n assert.isOk(layoutShift);\n const selection = Timeline.TimelineSelection.selectionFromEvent(layoutShift);\n await detailsView.setSelection(selection);\n const detailsContentElement = detailsView.getDetailsContentElementForTest();\n // Assert that the right component is rendered. This component has its own\n // tests for its contents so no need to duplicate those here.\n const layoutShiftDetails = detailsContentElement.querySelector('devtools-performance-layout-shift-details');\n assert.isNotNull(layoutShiftDetails);\n });\n\n it('renders the layout shift component for a selected cluster', async function() {\n const {parsedTrace} = await TraceLoader.traceEngine(this, 'shift-attribution.json.gz');\n const detailsView = new Timeline.TimelineDetailsView.TimelineDetailsView(mockViewDelegate);\n await detailsView.setModel(\n {parsedTrace, selectedEvents: null, traceInsightsSets: null, eventToRelatedInsightsMap: null});\n\n const layoutShiftCluster = parsedTrace.LayoutShifts.clusters.at(0);\n assert.isOk(layoutShiftCluster);\n const selection = Timeline.TimelineSelection.selectionFromEvent(layoutShiftCluster);\n await detailsView.setSelection(selection);\n const detailsContentElement = detailsView.getDetailsContentElementForTest();\n // Assert that the right component is rendered. This component has its own\n // tests for its contents so no need to duplicate those here.\n const layoutShiftDetails = detailsContentElement.querySelector('devtools-performance-layout-shift-details');\n assert.isNotNull(layoutShiftDetails);\n });\n\n it('updates the range details when the user has a range selected', async function() {\n const {parsedTrace} = await TraceLoader.traceEngine(this, 'web-dev-with-commit.json.gz');\n const detailsView = new Timeline.TimelineDetailsView.TimelineDetailsView(mockViewDelegate);\n await detailsView.setModel({\n parsedTrace,\n // We have to set selected events for the range selection UI to be drawn\n // (without the set of events we can't generate the range stats)\n selectedEvents: parsedTrace.Renderer.allTraceEntries,\n traceInsightsSets: null,\n eventToRelatedInsightsMap: null,\n });\n const bounds = Trace.Helpers.Timing.traceWindowMilliSeconds(parsedTrace.Meta.traceBounds);\n const selection = Timeline.TimelineSelection.selectionFromRangeMilliSeconds(\n bounds.min,\n bounds.max,\n );\n await detailsView.setSelection(selection);\n const detailsContentElement = detailsView.getDetailsContentElementForTest();\n const component = detailsContentElement.querySelector('devtools-performance-timeline-summary');\n const range = component?.shadowRoot?.querySelector('.summary-range');\n assert.strictEqual(range?.innerText, 'Range: 0 ms – 5.39 s');\n });\n});\n"]} \ No newline at end of file +{"version":3,"file":"TimelineDetailsView.test.js","sourceRoot":"","sources":["../../../../../../front_end/panels/timeline/TimelineDetailsView.test.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,KAAK,KAAK,MAAM,6BAA6B,CAAC;AACrD,OAAO,EAAC,SAAS,EAAC,MAAM,6BAA6B,CAAC;AACtD,OAAO,EAAC,uBAAuB,EAAC,MAAM,qCAAqC,CAAC;AAC5E,OAAO,EAAC,WAAW,EAAC,MAAM,8BA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,IAAI,CAAC,WAAW,CAAC,CAAC;QAC1F,MAAM,SAAS,GAAG,QAAQ,CAAC,iBAAiB,CAAC,8BAA8B,CACvE,MAAM,CAAC,GAAG,EACV,MAAM,CAAC,GAAG,CACb,CAAC;QACF,MAAM,WAAW,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC;QAC1C,MAAM,qBAAqB,GAAG,WAAW,CAAC,+BAA+B,EAAE,CAAC;QAC5E,MAAM,SAAS,GAAG,qBAAqB,CAAC,aAAa,CAAc,uCAAuC,CAAC,CAAC;QAC5G,MAAM,KAAK,GAAG,SAAS,EAAE,UAAU,EAAE,aAAa,CAAc,gBAAgB,CAAC,CAAC;QAClF,MAAM,CAAC,WAAW,CAAC,KAAK,EAAE,SAAS,EAAE,uBAAuB,CAAC,CAAC;IAChE,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["// Copyright 2021 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport * as Trace from '../../models/trace/trace.js';\nimport {doubleRaf} from '../../testing/DOMHelpers.js';\nimport {describeWithEnvironment} from '../../testing/EnvironmentHelpers.js';\nimport {TraceLoader} from '../../testing/TraceLoader.js';\n\nimport * as Timeline from './timeline.js';\n\nclass MockViewDelegate implements Timeline.TimelinePanel.TimelineModeViewDelegate {\n select(_selection: Timeline.TimelineSelection.TimelineSelection|null): void {\n }\n selectEntryAtTime(_events: Trace.Types.Events.Event[]|null, _time: number): void {\n }\n highlightEvent(_event: Trace.Types.Events.Event|null): void {\n }\n element = document.createElement('div');\n}\n\ndescribeWithEnvironment('TimelineDetailsView', function() {\n const mockViewDelegate = new MockViewDelegate();\n\n it('displays the details of a network request event correctly', async function() {\n const {parsedTrace, insights} = await TraceLoader.traceEngine(this, 'lcp-web-font.json.gz');\n const detailsView = new Timeline.TimelineDetailsView.TimelineDetailsView(mockViewDelegate);\n\n const networkRequests = parsedTrace.NetworkRequests.byTime;\n const cssRequest = networkRequests.find(request => {\n return request.args.data.url === 'https://chromedevtools.github.io/performance-stories/lcp-web-font/app.css';\n });\n if (!cssRequest) {\n throw new Error('Could not find expected network request.');\n }\n const selection = Timeline.TimelineSelection.selectionFromEvent(cssRequest);\n\n await detailsView.setModel(\n {parsedTrace, selectedEvents: null, traceInsightsSets: insights, eventToRelatedInsightsMap: null});\n await detailsView.setSelection(selection);\n\n const detailsContentElement = detailsView.getDetailsContentElementForTest();\n // NetworkRequestDetails and RelatedInsightsChips nodes.\n assert.lengthOf(detailsContentElement.childNodes, 2);\n });\n\n it('displays the details for a frame correctly', async function() {\n const {parsedTrace} = await TraceLoader.traceEngine(this, 'web-dev-with-commit.json.gz');\n const detailsView = new Timeline.TimelineDetailsView.TimelineDetailsView(mockViewDelegate);\n await detailsView.setModel(\n {parsedTrace, selectedEvents: null, traceInsightsSets: null, eventToRelatedInsightsMap: null});\n\n const frame = parsedTrace.Frames.frames.at(0);\n assert.isOk(frame);\n const selection = Timeline.TimelineSelection.selectionFromEvent(frame);\n await detailsView.setSelection(selection);\n await doubleRaf(); // to let the image be fetched + rendered.\n const detailsContentElement = detailsView.getDetailsContentElementForTest();\n const frameImg = detailsContentElement.querySelector('.timeline-filmstrip-preview img');\n assert.instanceOf(frameImg, HTMLImageElement);\n assert.isDefined(frameImg.src);\n\n const duration = detailsContentElement.querySelector('[data-row-title=\"Duration\"]');\n assert.isOk(duration);\n assert.strictEqual(duration.innerText, 'Duration37.85 ms (at 109.82 ms)');\n });\n\n it('renders the layout shift component for a single layout shift', async function() {\n const {parsedTrace} = await TraceLoader.traceEngine(this, 'shift-attribution.json.gz');\n const detailsView = new Timeline.TimelineDetailsView.TimelineDetailsView(mockViewDelegate);\n await detailsView.setModel(\n {parsedTrace, selectedEvents: null, traceInsightsSets: null, eventToRelatedInsightsMap: null});\n\n const layoutShift = parsedTrace.LayoutShifts.clusters.at(0)?.events.at(0);\n assert.isOk(layoutShift);\n const selection = Timeline.TimelineSelection.selectionFromEvent(layoutShift);\n await detailsView.setSelection(selection);\n const detailsContentElement = detailsView.getDetailsContentElementForTest();\n // Assert that the right component is rendered. This component has its own\n // tests for its contents so no need to duplicate those here.\n const layoutShiftDetails = detailsContentElement.querySelector('devtools-performance-layout-shift-details');\n assert.isNotNull(layoutShiftDetails);\n });\n\n it('renders the layout shift component for a selected cluster', async function() {\n const {parsedTrace} = await TraceLoader.traceEngine(this, 'shift-attribution.json.gz');\n const detailsView = new Timeline.TimelineDetailsView.TimelineDetailsView(mockViewDelegate);\n await detailsView.setModel(\n {parsedTrace, selectedEvents: null, traceInsightsSets: null, eventToRelatedInsightsMap: null});\n\n const layoutShiftCluster = parsedTrace.LayoutShifts.clusters.at(0);\n assert.isOk(layoutShiftCluster);\n const selection = Timeline.TimelineSelection.selectionFromEvent(layoutShiftCluster);\n await detailsView.setSelection(selection);\n const detailsContentElement = detailsView.getDetailsContentElementForTest();\n // Assert that the right component is rendered. This component has its own\n // tests for its contents so no need to duplicate those here.\n const layoutShiftDetails = detailsContentElement.querySelector('devtools-performance-layout-shift-details');\n assert.isNotNull(layoutShiftDetails);\n });\n\n it('updates the range details when the user has a range selected', async function() {\n const {parsedTrace} = await TraceLoader.traceEngine(this, 'web-dev-with-commit.json.gz');\n const detailsView = new Timeline.TimelineDetailsView.TimelineDetailsView(mockViewDelegate);\n await detailsView.setModel({\n parsedTrace,\n // We have to set selected events for the range selection UI to be drawn\n // (without the set of events we can't generate the range stats)\n selectedEvents: parsedTrace.Renderer.allTraceEntries,\n traceInsightsSets: null,\n eventToRelatedInsightsMap: null,\n });\n const bounds = Trace.Helpers.Timing.traceWindowMilliSeconds(parsedTrace.Meta.traceBounds);\n const selection = Timeline.TimelineSelection.selectionFromRangeMilliSeconds(\n bounds.min,\n bounds.max,\n );\n await detailsView.setSelection(selection);\n const detailsContentElement = detailsView.getDetailsContentElementForTest();\n const component = detailsContentElement.querySelector('devtools-performance-timeline-summary');\n const range = component?.shadowRoot?.querySelector('.summary-range');\n assert.strictEqual(range?.innerText, 'Range: 0 ms – 5.39 s');\n });\n});\n"]} \ No newline at end of file diff --git a/public/panels/timeline/TimelineEventOverview.js.map b/public/panels/timeline/TimelineEventOverview.js.map index bf2f70385..2a19d4356 100644 --- a/public/panels/timeline/TimelineEventOverview.js.map +++ b/public/panels/timeline/TimelineEventOverview.js.map @@ -1 +1 @@ -{"version":3,"file":"TimelineEventOverview.js","sourceRoot":"","sources":["../../../../../../front_end/panels/timeline/TimelineEventOverview.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,OAAO,KAAK,IAAI,MAAM,yBAAyB,CAAC;AAEhD,OAAO,KAAK,KAAK,MAAM,6BAA6B,CAAC;AACrD,OAAO,KAAK,WAAW,MAAM,6CAA6C,CAAC;AAC3E,OAAO,KAAK,MAAM,MAAM,+CAA+C,CAAC;AACxE,OAAO,KAAK,EAAE,MAAM,2BAA2B,CAAC;AAChD,OAAO,KAAK,aAAa,MAAM,2CAA2C,CAAC;AAE3E,OAAO,KAAK,KAAK,MAAM,kBAAkB,CAAC;AAE1C,MAAM,SAAS,GAAG;IAChB;;OAEG;IACH,GAAG,EAAE,KAAK;IACV;;OAEG;IACH,GAAG,EAAE,KAAK;IACV;;OAEG;IACH,IAAI,EAAE,MAAM;IACZ;;;;OAIG;IACH,MAAM,EAAE,eAAe;CACxB,CAAC;AACF,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,iBAAiB,CAAC,0CAA0C,EAAE,SAAS,CAAC,CAAC;AAChG,MAAM,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC;AACtE,MAAM,OAAgB,qBAAsB,SAAQ,MAAM,CAAC,oBAAoB,CAAC,oBAAoB;IAClG,YAAY,EAAU,EAAE,KAAkB;QACxC,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,OAAO,CAAC,EAAE,GAAG,oBAAoB,GAAG,E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;QACrB,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,aAAa,GAAG,QAAQ,CAAC;IACjD,CAAC;CACF","sourcesContent":["/*\n * Copyright (C) 2013 Google Inc. All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are\n * met:\n *\n * * Redistributions of source code must retain the above copyright\n * notice, this list of conditions and the following disclaimer.\n * * Redistributions in binary form must reproduce the above\n * copyright notice, this list of conditions and the following disclaimer\n * in the documentation and/or other materials provided with the\n * distribution.\n * * Neither the name of Google Inc. nor the names of its\n * contributors may be used to endorse or promote products derived from\n * this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nimport * as i18n from '../../core/i18n/i18n.js';\nimport * as Protocol from '../../generated/protocol.js';\nimport * as Trace from '../../models/trace/trace.js';\nimport * as TraceBounds from '../../services/trace_bounds/trace_bounds.js';\nimport * as PerfUI from '../../ui/legacy/components/perf_ui/perf_ui.js';\nimport * as UI from '../../ui/legacy/legacy.js';\nimport * as VisualLogging from '../../ui/visual_logging/visual_logging.js';\n\nimport * as Utils from './utils/utils.js';\n\nconst UIStrings = {\n /**\n *@description Short for Network. Label for the network requests section of the Performance panel.\n */\n net: 'NET',\n /**\n *@description Text in Timeline Event Overview of the Performance panel\n */\n cpu: 'CPU',\n /**\n *@description Text in Timeline Event Overview of the Performance panel\n */\n heap: 'HEAP',\n /**\n *@description Heap size label text content in Timeline Event Overview of the Performance panel\n *@example {10 MB} PH1\n *@example {30 MB} PH2\n */\n sSDash: '{PH1} – {PH2}',\n};\nconst str_ = i18n.i18n.registerUIStrings('panels/timeline/TimelineEventOverview.ts', UIStrings);\nconst i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);\nexport abstract class TimelineEventOverview extends PerfUI.TimelineOverviewPane.TimelineOverviewBase {\n constructor(id: string, title: string|null) {\n super();\n this.element.id = 'timeline-overview-' + id;\n this.element.classList.add('overview-strip');\n if (title) {\n this.element.createChild('div', 'timeline-overview-strip-title').textContent = title;\n }\n }\n\n renderBar(begin: number, end: number, position: number, height: number, color: string): void {\n const x = begin;\n const width = end - begin;\n const ctx = this.context();\n ctx.fillStyle = color;\n ctx.fillRect(x, position, width, height);\n }\n}\n\nconst HIGH_NETWORK_PRIORITIES = new Set([\n Protocol.Network.ResourcePriority.VeryHigh,\n Protocol.Network.ResourcePriority.High,\n Protocol.Network.ResourcePriority.Medium,\n]);\n\nexport class TimelineEventOverviewNetwork extends TimelineEventOverview {\n #parsedTrace: Trace.Handlers.Types.ParsedTrace;\n constructor(parsedTrace: Trace.Handlers.Types.ParsedTrace) {\n super('network', i18nString(UIStrings.net));\n this.#parsedTrace = parsedTrace;\n }\n\n override update(start?: Trace.Types.Timing.MilliSeconds, end?: Trace.Types.Timing.MilliSeconds): void {\n this.resetCanvas();\n this.#renderWithParsedTrace(start, end);\n }\n\n #renderWithParsedTrace(start?: Trace.Types.Timing.MilliSeconds, end?: Trace.Types.Timing.MilliSeconds): void {\n if (!this.#parsedTrace) {\n return;\n }\n\n // Because the UI is in milliseconds, we work with milliseconds through\n // this function to get the right scale and sizing\n const traceBoundsMilli = (start && end) ?\n {\n min: start,\n max: end,\n range: end - start,\n } :\n Trace.Helpers.Timing.traceWindowMilliSeconds(this.#parsedTrace.Meta.traceBounds);\n\n // We draw two paths, so each can take up half the height\n const pathHeight = this.height() / 2;\n\n const canvasWidth = this.width();\n const scale = canvasWidth / traceBoundsMilli.range;\n\n // We draw network requests in two chunks:\n // Requests with a priority of Medium or higher go onto the first path\n // Other requests go onto the second path.\n const highPath = new Path2D();\n const lowPath = new Path2D();\n\n for (const request of this.#parsedTrace.NetworkRequests.byTime) {\n const path = HIGH_NETWORK_PRIORITIES.has(request.args.data.priority) ? highPath : lowPath;\n const {startTime, endTime} = Trace.Helpers.Timing.eventTimingsMilliSeconds(request);\n const rectStart = Math.max(Math.floor((startTime - traceBoundsMilli.min) * scale), 0);\n const rectEnd = Math.min(Math.ceil((endTime - traceBoundsMilli.min) * scale + 1), canvasWidth);\n\n path.rect(rectStart, 0, rectEnd - rectStart, pathHeight - 1);\n }\n\n const ctx = this.context();\n ctx.save();\n // Draw the high path onto the canvas.\n ctx.fillStyle = 'hsl(214, 60%, 60%)';\n ctx.fill(highPath);\n // Now jump down by the height of the high path, and then draw the low path.\n ctx.translate(0, pathHeight);\n ctx.fillStyle = 'hsl(214, 80%, 80%)';\n ctx.fill(lowPath);\n ctx.restore();\n }\n}\n\nconst categoryToIndex = new WeakMap();\n\nexport class TimelineEventOverviewCPUActivity extends TimelineEventOverview {\n private backgroundCanvas: HTMLCanvasElement;\n #parsedTrace: Trace.Handlers.Types.ParsedTrace;\n #drawn = false;\n #start: Trace.Types.Timing.MilliSeconds;\n #end: Trace.Types.Timing.MilliSeconds;\n\n constructor(parsedTrace: Trace.Handlers.Types.ParsedTrace) {\n // During the sync tracks migration this component can use either legacy\n // Performance Model data or the new engine's data. Once the migration is\n // complete this will be updated to only use the new engine and mentions of\n // the PerformanceModel will be removed.\n super('cpu-activity', i18nString(UIStrings.cpu));\n this.#parsedTrace = parsedTrace;\n this.backgroundCanvas = (this.element.createChild('canvas', 'fill background') as HTMLCanvasElement);\n this.#start = Trace.Helpers.Timing.traceWindowMilliSeconds(parsedTrace.Meta.traceBounds).min;\n this.#end = Trace.Helpers.Timing.traceWindowMilliSeconds(parsedTrace.Meta.traceBounds).max;\n }\n\n #entryCategory(entry: Trace.Types.Events.Event): Utils.EntryStyles.EventCategory|undefined {\n // Special case: in CPU Profiles we get a lot of ProfileCalls that\n // represent Idle time. We typically represent ProfileCalls in the\n // Scripting Category, but if they represent idle time, we do not want\n // that.\n if (Trace.Types.Events.isProfileCall(entry) && entry.callFrame.functionName === '(idle)') {\n return Utils.EntryStyles.EventCategory.IDLE;\n }\n const eventStyle = Utils.EntryStyles.getEventStyle(entry.name as Trace.Types.Events.Name)?.category ||\n Utils.EntryStyles.getCategoryStyles().other;\n const categoryName = eventStyle.name;\n return categoryName;\n }\n\n override resetCanvas(): void {\n super.resetCanvas();\n this.#drawn = false;\n this.backgroundCanvas.width = this.element.clientWidth * window.devicePixelRatio;\n this.backgroundCanvas.height = this.element.clientHeight * window.devicePixelRatio;\n }\n\n #draw(parsedTrace: Trace.Handlers.Types.ParsedTrace): void {\n const quantSizePx = 4 * window.devicePixelRatio;\n const width = this.width();\n const height = this.height();\n const baseLine = height;\n const timeRange = this.#end - this.#start;\n const scale = width / timeRange;\n const quantTime = quantSizePx / scale;\n const categories = Utils.EntryStyles.getCategoryStyles();\n const categoryOrder = Utils.EntryStyles.getTimelineMainEventCategories();\n const otherIndex = categoryOrder.indexOf(Utils.EntryStyles.EventCategory.OTHER);\n const idleIndex = 0;\n console.assert(idleIndex === categoryOrder.indexOf(Utils.EntryStyles.EventCategory.IDLE));\n for (let i = 0; i < categoryOrder.length; ++i) {\n categoryToIndex.set(categories[categoryOrder[i]], i);\n }\n\n const drawThreadEntries =\n (context: CanvasRenderingContext2D, threadData: Trace.Handlers.Threads.ThreadData): void => {\n const quantizer = new Quantizer(this.#start, quantTime, drawSample);\n let x = 0;\n const categoryIndexStack: number[] = [];\n const paths: Path2D[] = [];\n const lastY: number[] = [];\n for (let i = 0; i < categoryOrder.length; ++i) {\n paths[i] = new Path2D();\n paths[i].moveTo(0, height);\n lastY[i] = height;\n }\n\n function drawSample(counters: number[]): void {\n let y = baseLine;\n for (let i = idleIndex + 1; i < categoryOrder.length; ++i) {\n const h = (counters[i] || 0) / quantTime * height;\n y -= h;\n paths[i].bezierCurveTo(x, lastY[i], x, y, x + quantSizePx / 2, y);\n lastY[i] = y;\n }\n x += quantSizePx;\n }\n\n const onEntryStart = (entry: Trace.Types.Events.Event): void => {\n const category = this.#entryCategory(entry);\n if (!category || category === 'idle') {\n // Idle event won't show in CPU activity, so just skip them.\n return;\n }\n const startTimeMilli = Trace.Helpers.Timing.microSecondsToMilliseconds(entry.ts);\n const index = categoryIndexStack.length ? categoryIndexStack[categoryIndexStack.length - 1] : idleIndex;\n quantizer.appendInterval(startTimeMilli, index);\n const categoryIndex = categoryOrder.indexOf(category);\n categoryIndexStack.push(categoryIndex || otherIndex);\n };\n\n function onEntryEnd(entry: Trace.Types.Events.Event): void {\n const endTimeMilli = Trace.Helpers.Timing.microSecondsToMilliseconds(entry.ts) +\n Trace.Helpers.Timing.microSecondsToMilliseconds(Trace.Types.Timing.MicroSeconds(entry.dur || 0));\n const lastCategoryIndex = categoryIndexStack.pop();\n if (endTimeMilli !== undefined && lastCategoryIndex) {\n quantizer.appendInterval(endTimeMilli, lastCategoryIndex);\n }\n }\n const startMicro = Trace.Helpers.Timing.millisecondsToMicroseconds(this.#start);\n const endMicro = Trace.Helpers.Timing.millisecondsToMicroseconds(this.#end);\n const bounds = {\n min: startMicro,\n max: endMicro,\n range: Trace.Types.Timing.MicroSeconds(endMicro - startMicro),\n };\n\n // Filter out tiny events - they don't make a visual impact to the\n // canvas as they are so small, but they do impact the time it takes\n // to walk the tree and render the events.\n // However, if the entire range we are showing is 200ms or less, then show all events.\n const minDuration = Trace.Types.Timing.MicroSeconds(\n bounds.range > 200_000 ? 16_000 : 0,\n );\n Trace.Helpers.TreeHelpers.walkEntireTree(\n threadData.entryToNode, threadData.tree, onEntryStart, onEntryEnd, bounds, minDuration);\n quantizer.appendInterval(this.#start + timeRange + quantTime, idleIndex); // Kick drawing the last bucket.\n for (let i = categoryOrder.length - 1; i > 0; --i) {\n paths[i].lineTo(width, height);\n const computedColorValue = categories[categoryOrder[i]].getComputedColorValue();\n context.fillStyle = computedColorValue;\n context.fill(paths[i]);\n context.strokeStyle = 'white';\n context.lineWidth = 1;\n context.stroke(paths[i]);\n }\n };\n const backgroundContext = (this.backgroundCanvas.getContext('2d') as CanvasRenderingContext2D | null);\n if (!backgroundContext) {\n throw new Error('Could not find 2d canvas');\n }\n\n const threads = Trace.Handlers.Threads.threadsInTrace(parsedTrace);\n const mainThreadContext = this.context();\n for (const thread of threads) {\n // We treat CPU_PROFILE as main thread because in a CPU Profile trace there is only ever one thread.\n const isMainThread = thread.type === Trace.Handlers.Threads.ThreadType.MAIN_THREAD ||\n thread.type === Trace.Handlers.Threads.ThreadType.CPU_PROFILE;\n if (isMainThread) {\n drawThreadEntries(mainThreadContext, thread);\n } else {\n drawThreadEntries(backgroundContext, thread);\n }\n }\n\n function applyPattern(ctx: CanvasRenderingContext2D): void {\n const step = 4 * window.devicePixelRatio;\n ctx.save();\n ctx.lineWidth = step / Math.sqrt(8);\n for (let x = 0.5; x < width + height; x += step) {\n ctx.moveTo(x, 0);\n ctx.lineTo(x - height, height);\n }\n ctx.globalCompositeOperation = 'destination-out';\n ctx.stroke();\n ctx.restore();\n }\n\n applyPattern(backgroundContext);\n }\n\n override update(): void {\n const traceBoundsState = TraceBounds.TraceBounds.BoundsManager.instance().state();\n const bounds = traceBoundsState?.milli.minimapTraceBounds;\n if (!bounds) {\n return;\n }\n if (bounds.min === this.#start && bounds.max === this.#end && this.#drawn) {\n return;\n }\n this.#start = bounds.min;\n this.#end = bounds.max;\n // Order matters here, resetCanvas will set this.#drawn to false.\n this.resetCanvas();\n this.#drawn = true;\n this.#draw(this.#parsedTrace);\n }\n}\n\nexport class TimelineEventOverviewResponsiveness extends TimelineEventOverview {\n #parsedTrace: Trace.Handlers.Types.ParsedTrace;\n constructor(parsedTrace: Trace.Handlers.Types.ParsedTrace) {\n super('responsiveness', null);\n this.#parsedTrace = parsedTrace;\n }\n\n #gatherEventsWithRelevantWarnings(): Set {\n const {topLevelRendererIds} = this.#parsedTrace.Meta;\n\n // All the warnings that we care about regarding responsiveness and want to represent on the overview.\n const warningsForResponsiveness = new Set([\n 'LONG_TASK',\n 'FORCED_REFLOW',\n 'IDLE_CALLBACK_OVER_TIME',\n ]);\n\n const allWarningEvents = new Set();\n for (const warning of warningsForResponsiveness) {\n const eventsForWarning = this.#parsedTrace.Warnings.perWarning.get(warning);\n if (!eventsForWarning) {\n continue;\n }\n\n for (const event of eventsForWarning) {\n // Only keep events whose PID is a top level renderer, which means it\n // was on the main thread. This avoids showing issues from iframes or\n // other sub-frames in the minimap overview.\n if (topLevelRendererIds.has(event.pid)) {\n allWarningEvents.add(event);\n }\n }\n }\n return allWarningEvents;\n }\n\n override update(start?: Trace.Types.Timing.MilliSeconds, end?: Trace.Types.Timing.MilliSeconds): void {\n this.resetCanvas();\n\n const height = this.height();\n const visibleTimeWindow = !(start && end) ? this.#parsedTrace.Meta.traceBounds : {\n min: Trace.Helpers.Timing.millisecondsToMicroseconds(start),\n max: Trace.Helpers.Timing.millisecondsToMicroseconds(end),\n range: Trace.Helpers.Timing.millisecondsToMicroseconds(Trace.Types.Timing.MilliSeconds(end - start)),\n };\n const timeSpan = visibleTimeWindow.range;\n const scale = this.width() / timeSpan;\n const ctx = this.context();\n const fillPath = new Path2D();\n const markersPath = new Path2D();\n\n const eventsWithWarning = this.#gatherEventsWithRelevantWarnings();\n for (const event of eventsWithWarning) {\n paintWarningDecoration(event);\n }\n\n ctx.fillStyle = 'hsl(0, 80%, 90%)';\n ctx.strokeStyle = 'red';\n ctx.lineWidth = 2 * window.devicePixelRatio;\n ctx.fill(fillPath);\n ctx.stroke(markersPath);\n\n function paintWarningDecoration(event: Trace.Types.Events.Event): void {\n const {startTime, duration} = Trace.Helpers.Timing.eventTimingsMicroSeconds(event);\n const x = Math.round(scale * (startTime - visibleTimeWindow.min));\n const width = Math.round(scale * duration);\n fillPath.rect(x, 0, width, height);\n markersPath.moveTo(x + width, 0);\n markersPath.lineTo(x + width, height);\n }\n }\n}\n\nexport class TimelineFilmStripOverview extends TimelineEventOverview {\n private frameToImagePromise: Map>;\n private lastFrame: Trace.Extras.FilmStrip.Frame|null = null;\n private lastElement: Element|null;\n private drawGeneration?: symbol;\n private emptyImage?: HTMLImageElement;\n #filmStrip: Trace.Extras.FilmStrip.Data|null = null;\n\n constructor(filmStrip: Trace.Extras.FilmStrip.Data) {\n super('filmstrip', null);\n this.element.setAttribute('jslog', `${VisualLogging.section('film-strip')}`);\n this.frameToImagePromise = new Map();\n this.#filmStrip = filmStrip;\n this.lastFrame = null;\n this.lastElement = null;\n this.reset();\n }\n\n override update(customStartTime?: Trace.Types.Timing.MilliSeconds, customEndTime?: Trace.Types.Timing.MilliSeconds):\n void {\n this.resetCanvas();\n const frames = this.#filmStrip ? this.#filmStrip.frames : [];\n if (!frames.length) {\n return;\n }\n\n if (this.height() === 0) {\n // Height of 0 causes the maths below to get off and generate very large\n // negative numbers that cause an extremely long loop when attempting to\n // draw images by frame. Rather than that, let's warn and exist early.\n console.warn('TimelineFilmStrip could not be drawn as its canvas height is 0');\n return;\n }\n\n const drawGeneration = Symbol('drawGeneration');\n this.drawGeneration = drawGeneration;\n void this.imageByFrame(frames[0]).then(image => {\n if (this.drawGeneration !== drawGeneration) {\n return;\n }\n if (!image || !image.naturalWidth || !image.naturalHeight) {\n return;\n }\n const imageHeight = this.height() - 2 * TimelineFilmStripOverview.Padding;\n const imageWidth = Math.ceil(imageHeight * image.naturalWidth / image.naturalHeight);\n const popoverScale = Math.min(200 / image.naturalWidth, 1);\n this.emptyImage = new Image(image.naturalWidth * popoverScale, image.naturalHeight * popoverScale);\n this.drawFrames(imageWidth, imageHeight, customStartTime, customEndTime);\n });\n }\n\n private async imageByFrame(frame: Trace.Extras.FilmStrip.Frame): Promise {\n let imagePromise: Promise|undefined = this.frameToImagePromise.get(frame);\n if (!imagePromise) {\n // TODO(paulirish): Adopt Util.ImageCache\n imagePromise = UI.UIUtils.loadImage(frame.screenshotEvent.args.dataUri);\n this.frameToImagePromise.set(frame, (imagePromise as Promise));\n }\n return imagePromise;\n }\n\n private drawFrames(\n imageWidth: number, imageHeight: number, customStartTime?: Trace.Types.Timing.MilliSeconds,\n customEndTime?: Trace.Types.Timing.MilliSeconds): void {\n if (!imageWidth) {\n return;\n }\n if (!this.#filmStrip || this.#filmStrip.frames.length < 1) {\n return;\n }\n const padding = TimelineFilmStripOverview.Padding;\n const width = this.width();\n\n const zeroTime = customStartTime ?? Trace.Helpers.Timing.microSecondsToMilliseconds(this.#filmStrip.zeroTime);\n const spanTime = customEndTime ? customEndTime - zeroTime :\n Trace.Helpers.Timing.microSecondsToMilliseconds(this.#filmStrip.spanTime);\n const scale = spanTime / width;\n const context = this.context();\n const drawGeneration = this.drawGeneration;\n\n context.beginPath();\n for (let x = padding; x < width; x += imageWidth + 2 * padding) {\n const time = Trace.Types.Timing.MilliSeconds(zeroTime + (x + imageWidth / 2) * scale);\n const timeMicroSeconds = Trace.Helpers.Timing.millisecondsToMicroseconds(time);\n const frame = Trace.Extras.FilmStrip.frameClosestToTimestamp(this.#filmStrip, timeMicroSeconds);\n if (!frame) {\n continue;\n }\n context.rect(x - 0.5, 0.5, imageWidth + 1, imageHeight + 1);\n void this.imageByFrame(frame).then(drawFrameImage.bind(this, x));\n }\n context.strokeStyle = '#ddd';\n context.stroke();\n\n function drawFrameImage(this: TimelineFilmStripOverview, x: number, image: HTMLImageElement|null): void {\n // Ignore draws deferred from a previous update call.\n if (this.drawGeneration !== drawGeneration || !image) {\n return;\n }\n context.drawImage(image, x, 1, imageWidth, imageHeight);\n }\n }\n\n override async overviewInfoPromise(x: number): Promise {\n if (!this.#filmStrip || this.#filmStrip.frames.length === 0) {\n return null;\n }\n\n const calculator = this.calculator();\n if (!calculator) {\n return null;\n }\n const timeMilliSeconds = calculator.positionToTime(x);\n const timeMicroSeconds = Trace.Helpers.Timing.millisecondsToMicroseconds(timeMilliSeconds);\n const frame = Trace.Extras.FilmStrip.frameClosestToTimestamp(this.#filmStrip, timeMicroSeconds);\n if (frame === this.lastFrame) {\n return this.lastElement;\n }\n const imagePromise = frame ? this.imageByFrame(frame) : Promise.resolve(this.emptyImage);\n const image = await imagePromise;\n const element = document.createElement('div');\n element.classList.add('frame');\n if (image) {\n element.createChild('div', 'thumbnail').appendChild(image);\n }\n this.lastFrame = frame;\n this.lastElement = element;\n return element;\n }\n\n override reset(): void {\n this.lastFrame = null;\n this.lastElement = null;\n this.frameToImagePromise = new Map();\n }\n\n // TODO(crbug.com/1172300) Ignored during the jsdoc to ts migration\n // eslint-disable-next-line @typescript-eslint/naming-convention\n static readonly Padding = 2;\n}\n\nexport class TimelineEventOverviewMemory extends TimelineEventOverview {\n private heapSizeLabel: HTMLElement;\n #parsedTrace: Trace.Handlers.Types.ParsedTrace;\n\n constructor(parsedTrace: Trace.Handlers.Types.ParsedTrace) {\n super('memory', i18nString(UIStrings.heap));\n this.heapSizeLabel = this.element.createChild('div', 'memory-graph-label');\n this.#parsedTrace = parsedTrace;\n }\n\n resetHeapSizeLabels(): void {\n this.heapSizeLabel.textContent = '';\n }\n\n override update(start?: Trace.Types.Timing.MilliSeconds, end?: Trace.Types.Timing.MilliSeconds): void {\n this.resetCanvas();\n const ratio = window.devicePixelRatio;\n\n if (this.#parsedTrace.Memory.updateCountersByProcess.size === 0) {\n this.resetHeapSizeLabels();\n return;\n }\n\n const mainRendererIds = Array.from(this.#parsedTrace.Meta.topLevelRendererIds);\n const counterEventsPerTrack =\n mainRendererIds.map(pid => this.#parsedTrace.Memory.updateCountersByProcess.get(pid) || [])\n .filter(eventsPerRenderer => eventsPerRenderer.length > 0);\n\n const lowerOffset = 3 * ratio;\n let maxUsedHeapSize = 0;\n let minUsedHeapSize = 100000000000;\n\n const boundsMs = (start && end) ? {\n min: start,\n max: end,\n range: end - start,\n } :\n Trace.Helpers.Timing.traceWindowMilliSeconds(this.#parsedTrace.Meta.traceBounds);\n const minTime = boundsMs.min;\n const maxTime = boundsMs.max;\n\n function calculateMinMaxSizes(event: Trace.Types.Events.UpdateCounters): void {\n const counters = event.args.data;\n if (!counters || !counters.jsHeapSizeUsed) {\n return;\n }\n maxUsedHeapSize = Math.max(maxUsedHeapSize, counters.jsHeapSizeUsed);\n minUsedHeapSize = Math.min(minUsedHeapSize, counters.jsHeapSizeUsed);\n }\n\n for (let i = 0; i < counterEventsPerTrack.length; i++) {\n counterEventsPerTrack[i].forEach(calculateMinMaxSizes);\n }\n\n minUsedHeapSize = Math.min(minUsedHeapSize, maxUsedHeapSize);\n\n const lineWidth = 1;\n const width = this.width();\n const height = this.height() - lowerOffset;\n const xFactor = width / (maxTime - minTime);\n const yFactor = (height - lineWidth) / Math.max(maxUsedHeapSize - minUsedHeapSize, 1);\n\n const histogram = new Array(width);\n\n function buildHistogram(event: Trace.Types.Events.UpdateCounters): void {\n const counters = event.args.data;\n if (!counters || !counters.jsHeapSizeUsed) {\n return;\n }\n const {startTime} = Trace.Helpers.Timing.eventTimingsMilliSeconds(event);\n const x = Math.round((startTime - minTime) * xFactor);\n const y = Math.round((counters.jsHeapSizeUsed - minUsedHeapSize) * yFactor);\n histogram[x] = Math.max(histogram[x] || 0, y);\n }\n for (let i = 0; i < counterEventsPerTrack.length; i++) {\n counterEventsPerTrack[i].forEach(buildHistogram);\n }\n\n const ctx = this.context();\n const heightBeyondView = height + lowerOffset + lineWidth;\n\n ctx.translate(0.5, 0.5);\n ctx.beginPath();\n ctx.moveTo(-lineWidth, heightBeyondView);\n let y = 0;\n let isFirstPoint = true;\n let lastX = 0;\n for (let x = 0; x < histogram.length; x++) {\n if (typeof histogram[x] === 'undefined') {\n continue;\n }\n if (isFirstPoint) {\n isFirstPoint = false;\n y = histogram[x];\n ctx.lineTo(-lineWidth, height - y);\n }\n const nextY = histogram[x];\n if (Math.abs(nextY - y) > 2 && Math.abs(x - lastX) > 1) {\n ctx.lineTo(x, height - y);\n }\n y = nextY;\n ctx.lineTo(x, height - y);\n lastX = x;\n }\n ctx.lineTo(width + lineWidth, height - y);\n ctx.lineTo(width + lineWidth, heightBeyondView);\n ctx.closePath();\n\n ctx.fillStyle = 'hsla(220, 90%, 70%, 0.2)';\n ctx.fill();\n ctx.lineWidth = lineWidth;\n ctx.strokeStyle = 'hsl(220, 90%, 70%)';\n ctx.stroke();\n\n this.heapSizeLabel.textContent = i18nString(UIStrings.sSDash, {\n PH1: i18n.ByteUtilities.bytesToString(minUsedHeapSize),\n PH2: i18n.ByteUtilities.bytesToString(maxUsedHeapSize),\n });\n }\n}\n\nexport class Quantizer {\n private lastTime: number;\n private quantDuration: number;\n private readonly callback: (arg0: Array) => void;\n private counters: number[];\n private remainder: number;\n constructor(startTime: number, quantDuration: number, callback: (arg0: Array) => void) {\n this.lastTime = startTime;\n this.quantDuration = quantDuration;\n this.callback = callback;\n this.counters = [];\n this.remainder = quantDuration;\n }\n\n appendInterval(time: number, group: number): void {\n let interval = time - this.lastTime;\n if (interval <= this.remainder) {\n this.counters[group] = (this.counters[group] || 0) + interval;\n this.remainder -= interval;\n this.lastTime = time;\n return;\n }\n this.counters[group] = (this.counters[group] || 0) + this.remainder;\n this.callback(this.counters);\n interval -= this.remainder;\n while (interval >= this.quantDuration) {\n const counters = [];\n counters[group] = this.quantDuration;\n this.callback(counters);\n interval -= this.quantDuration;\n }\n this.counters = [];\n this.counters[group] = interval;\n this.lastTime = time;\n this.remainder = this.quantDuration - interval;\n }\n}\n"]} \ No newline at end of file +{"version":3,"file":"TimelineEventOverview.js","sourceRoot":"","sources":["../../../../../../front_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AQ,CAAC;QACpC,IAAI,QAAQ,IAAI,IAAI,CAAC,SAAS,EAAE,CAAC;YAC/B,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,GAAG,QAAQ,CAAC;YAC9D,IAAI,CAAC,SAAS,IAAI,QAAQ,CAAC;YAC3B,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;YACrB,OAAO;QACT,CAAC;QACD,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,SAAS,CAAC;QACpE,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAC7B,QAAQ,IAAI,IAAI,CAAC,SAAS,CAAC;QAC3B,OAAO,QAAQ,IAAI,IAAI,CAAC,aAAa,EAAE,CAAC;YACtC,MAAM,QAAQ,GAAG,EAAE,CAAC;YACpB,QAAQ,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC,aAAa,CAAC;YACrC,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;YACxB,QAAQ,IAAI,IAAI,CAAC,aAAa,CAAC;QACjC,CAAC;QACD,IAAI,CAAC,QAAQ,GAAG,EAAE,CAAC;QACnB,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,GAAG,QAAQ,CAAC;QAChC,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;QACrB,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,aAAa,GAAG,QAAQ,CAAC;IACjD,CAAC;CACF","sourcesContent":["/*\n * Copyright (C) 2013 Google Inc. All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are\n * met:\n *\n * * Redistributions of source code must retain the above copyright\n * notice, this list of conditions and the following disclaimer.\n * * Redistributions in binary form must reproduce the above\n * copyright notice, this list of conditions and the following disclaimer\n * in the documentation and/or other materials provided with the\n * distribution.\n * * Neither the name of Google Inc. nor the names of its\n * contributors may be used to endorse or promote products derived from\n * this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nimport * as i18n from '../../core/i18n/i18n.js';\nimport * as Protocol from '../../generated/protocol.js';\nimport * as Trace from '../../models/trace/trace.js';\nimport * as TraceBounds from '../../services/trace_bounds/trace_bounds.js';\nimport * as PerfUI from '../../ui/legacy/components/perf_ui/perf_ui.js';\nimport * as UI from '../../ui/legacy/legacy.js';\nimport * as VisualLogging from '../../ui/visual_logging/visual_logging.js';\n\nimport * as Utils from './utils/utils.js';\n\nconst UIStrings = {\n /**\n *@description Short for Network. Label for the network requests section of the Performance panel.\n */\n net: 'NET',\n /**\n *@description Text in Timeline Event Overview of the Performance panel\n */\n cpu: 'CPU',\n /**\n *@description Text in Timeline Event Overview of the Performance panel\n */\n heap: 'HEAP',\n /**\n *@description Heap size label text content in Timeline Event Overview of the Performance panel\n *@example {10 MB} PH1\n *@example {30 MB} PH2\n */\n sSDash: '{PH1} – {PH2}',\n};\nconst str_ = i18n.i18n.registerUIStrings('panels/timeline/TimelineEventOverview.ts', UIStrings);\nconst i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);\nexport abstract class TimelineEventOverview extends PerfUI.TimelineOverviewPane.TimelineOverviewBase {\n constructor(id: string, title: string|null) {\n super();\n this.element.id = 'timeline-overview-' + id;\n this.element.classList.add('overview-strip');\n if (title) {\n this.element.createChild('div', 'timeline-overview-strip-title').textContent = title;\n }\n }\n\n renderBar(begin: number, end: number, position: number, height: number, color: string): void {\n const x = begin;\n const width = end - begin;\n const ctx = this.context();\n ctx.fillStyle = color;\n ctx.fillRect(x, position, width, height);\n }\n}\n\nconst HIGH_NETWORK_PRIORITIES = new Set([\n Protocol.Network.ResourcePriority.VeryHigh,\n Protocol.Network.ResourcePriority.High,\n Protocol.Network.ResourcePriority.Medium,\n]);\n\nexport class TimelineEventOverviewNetwork extends TimelineEventOverview {\n #parsedTrace: Trace.Handlers.Types.ParsedTrace;\n constructor(parsedTrace: Trace.Handlers.Types.ParsedTrace) {\n super('network', i18nString(UIStrings.net));\n this.#parsedTrace = parsedTrace;\n }\n\n override update(start?: Trace.Types.Timing.MilliSeconds, end?: Trace.Types.Timing.MilliSeconds): void {\n this.resetCanvas();\n this.#renderWithParsedTrace(start, end);\n }\n\n #renderWithParsedTrace(start?: Trace.Types.Timing.MilliSeconds, end?: Trace.Types.Timing.MilliSeconds): void {\n if (!this.#parsedTrace) {\n return;\n }\n\n // Because the UI is in milliseconds, we work with milliseconds through\n // this function to get the right scale and sizing\n const traceBoundsMilli = (start && end) ?\n {\n min: start,\n max: end,\n range: end - start,\n } :\n Trace.Helpers.Timing.traceWindowMilliSeconds(this.#parsedTrace.Meta.traceBounds);\n\n // We draw two paths, so each can take up half the height\n const pathHeight = this.height() / 2;\n\n const canvasWidth = this.width();\n const scale = canvasWidth / traceBoundsMilli.range;\n\n // We draw network requests in two chunks:\n // Requests with a priority of Medium or higher go onto the first path\n // Other requests go onto the second path.\n const highPath = new Path2D();\n const lowPath = new Path2D();\n\n for (const request of this.#parsedTrace.NetworkRequests.byTime) {\n const path = HIGH_NETWORK_PRIORITIES.has(request.args.data.priority) ? highPath : lowPath;\n const {startTime, endTime} = Trace.Helpers.Timing.eventTimingsMilliSeconds(request);\n const rectStart = Math.max(Math.floor((startTime - traceBoundsMilli.min) * scale), 0);\n const rectEnd = Math.min(Math.ceil((endTime - traceBoundsMilli.min) * scale + 1), canvasWidth);\n\n path.rect(rectStart, 0, rectEnd - rectStart, pathHeight - 1);\n }\n\n const ctx = this.context();\n ctx.save();\n // Draw the high path onto the canvas.\n ctx.fillStyle = 'hsl(214, 60%, 60%)';\n ctx.fill(highPath);\n // Now jump down by the height of the high path, and then draw the low path.\n ctx.translate(0, pathHeight);\n ctx.fillStyle = 'hsl(214, 80%, 80%)';\n ctx.fill(lowPath);\n ctx.restore();\n }\n}\n\nconst categoryToIndex = new WeakMap();\n\nexport class TimelineEventOverviewCPUActivity extends TimelineEventOverview {\n private backgroundCanvas: HTMLCanvasElement;\n #parsedTrace: Trace.Handlers.Types.ParsedTrace;\n #drawn = false;\n #start: Trace.Types.Timing.MilliSeconds;\n #end: Trace.Types.Timing.MilliSeconds;\n\n constructor(parsedTrace: Trace.Handlers.Types.ParsedTrace) {\n // During the sync tracks migration this component can use either legacy\n // Performance Model data or the new engine's data. Once the migration is\n // complete this will be updated to only use the new engine and mentions of\n // the PerformanceModel will be removed.\n super('cpu-activity', i18nString(UIStrings.cpu));\n this.#parsedTrace = parsedTrace;\n this.backgroundCanvas = this.element.createChild('canvas', 'fill background');\n this.#start = Trace.Helpers.Timing.traceWindowMilliSeconds(parsedTrace.Meta.traceBounds).min;\n this.#end = Trace.Helpers.Timing.traceWindowMilliSeconds(parsedTrace.Meta.traceBounds).max;\n }\n\n #entryCategory(entry: Trace.Types.Events.Event): Utils.EntryStyles.EventCategory|undefined {\n // Special case: in CPU Profiles we get a lot of ProfileCalls that\n // represent Idle time. We typically represent ProfileCalls in the\n // Scripting Category, but if they represent idle time, we do not want\n // that.\n if (Trace.Types.Events.isProfileCall(entry) && entry.callFrame.functionName === '(idle)') {\n return Utils.EntryStyles.EventCategory.IDLE;\n }\n const eventStyle = Utils.EntryStyles.getEventStyle(entry.name as Trace.Types.Events.Name)?.category ||\n Utils.EntryStyles.getCategoryStyles().other;\n const categoryName = eventStyle.name;\n return categoryName;\n }\n\n override resetCanvas(): void {\n super.resetCanvas();\n this.#drawn = false;\n this.backgroundCanvas.width = this.element.clientWidth * window.devicePixelRatio;\n this.backgroundCanvas.height = this.element.clientHeight * window.devicePixelRatio;\n }\n\n #draw(parsedTrace: Trace.Handlers.Types.ParsedTrace): void {\n const quantSizePx = 4 * window.devicePixelRatio;\n const width = this.width();\n const height = this.height();\n const baseLine = height;\n const timeRange = this.#end - this.#start;\n const scale = width / timeRange;\n const quantTime = quantSizePx / scale;\n const categories = Utils.EntryStyles.getCategoryStyles();\n const categoryOrder = Utils.EntryStyles.getTimelineMainEventCategories();\n const otherIndex = categoryOrder.indexOf(Utils.EntryStyles.EventCategory.OTHER);\n const idleIndex = 0;\n console.assert(idleIndex === categoryOrder.indexOf(Utils.EntryStyles.EventCategory.IDLE));\n for (let i = 0; i < categoryOrder.length; ++i) {\n categoryToIndex.set(categories[categoryOrder[i]], i);\n }\n\n const drawThreadEntries =\n (context: CanvasRenderingContext2D, threadData: Trace.Handlers.Threads.ThreadData): void => {\n const quantizer = new Quantizer(this.#start, quantTime, drawSample);\n let x = 0;\n const categoryIndexStack: number[] = [];\n const paths: Path2D[] = [];\n const lastY: number[] = [];\n for (let i = 0; i < categoryOrder.length; ++i) {\n paths[i] = new Path2D();\n paths[i].moveTo(0, height);\n lastY[i] = height;\n }\n\n function drawSample(counters: number[]): void {\n let y = baseLine;\n for (let i = idleIndex + 1; i < categoryOrder.length; ++i) {\n const h = (counters[i] || 0) / quantTime * height;\n y -= h;\n paths[i].bezierCurveTo(x, lastY[i], x, y, x + quantSizePx / 2, y);\n lastY[i] = y;\n }\n x += quantSizePx;\n }\n\n const onEntryStart = (entry: Trace.Types.Events.Event): void => {\n const category = this.#entryCategory(entry);\n if (!category || category === 'idle') {\n // Idle event won't show in CPU activity, so just skip them.\n return;\n }\n const startTimeMilli = Trace.Helpers.Timing.microSecondsToMilliseconds(entry.ts);\n const index = categoryIndexStack.length ? categoryIndexStack[categoryIndexStack.length - 1] : idleIndex;\n quantizer.appendInterval(startTimeMilli, index);\n const categoryIndex = categoryOrder.indexOf(category);\n categoryIndexStack.push(categoryIndex || otherIndex);\n };\n\n function onEntryEnd(entry: Trace.Types.Events.Event): void {\n const endTimeMilli = Trace.Helpers.Timing.microSecondsToMilliseconds(entry.ts) +\n Trace.Helpers.Timing.microSecondsToMilliseconds(Trace.Types.Timing.MicroSeconds(entry.dur || 0));\n const lastCategoryIndex = categoryIndexStack.pop();\n if (endTimeMilli !== undefined && lastCategoryIndex) {\n quantizer.appendInterval(endTimeMilli, lastCategoryIndex);\n }\n }\n const startMicro = Trace.Helpers.Timing.millisecondsToMicroseconds(this.#start);\n const endMicro = Trace.Helpers.Timing.millisecondsToMicroseconds(this.#end);\n const bounds = {\n min: startMicro,\n max: endMicro,\n range: Trace.Types.Timing.MicroSeconds(endMicro - startMicro),\n };\n\n // Filter out tiny events - they don't make a visual impact to the\n // canvas as they are so small, but they do impact the time it takes\n // to walk the tree and render the events.\n // However, if the entire range we are showing is 200ms or less, then show all events.\n const minDuration = Trace.Types.Timing.MicroSeconds(\n bounds.range > 200_000 ? 16_000 : 0,\n );\n Trace.Helpers.TreeHelpers.walkEntireTree(\n threadData.entryToNode, threadData.tree, onEntryStart, onEntryEnd, bounds, minDuration);\n quantizer.appendInterval(this.#start + timeRange + quantTime, idleIndex); // Kick drawing the last bucket.\n for (let i = categoryOrder.length - 1; i > 0; --i) {\n paths[i].lineTo(width, height);\n const computedColorValue = categories[categoryOrder[i]].getComputedColorValue();\n context.fillStyle = computedColorValue;\n context.fill(paths[i]);\n context.strokeStyle = 'white';\n context.lineWidth = 1;\n context.stroke(paths[i]);\n }\n };\n const backgroundContext = (this.backgroundCanvas.getContext('2d') as CanvasRenderingContext2D | null);\n if (!backgroundContext) {\n throw new Error('Could not find 2d canvas');\n }\n\n const threads = Trace.Handlers.Threads.threadsInTrace(parsedTrace);\n const mainThreadContext = this.context();\n for (const thread of threads) {\n // We treat CPU_PROFILE as main thread because in a CPU Profile trace there is only ever one thread.\n const isMainThread = thread.type === Trace.Handlers.Threads.ThreadType.MAIN_THREAD ||\n thread.type === Trace.Handlers.Threads.ThreadType.CPU_PROFILE;\n if (isMainThread) {\n drawThreadEntries(mainThreadContext, thread);\n } else {\n drawThreadEntries(backgroundContext, thread);\n }\n }\n\n function applyPattern(ctx: CanvasRenderingContext2D): void {\n const step = 4 * window.devicePixelRatio;\n ctx.save();\n ctx.lineWidth = step / Math.sqrt(8);\n for (let x = 0.5; x < width + height; x += step) {\n ctx.moveTo(x, 0);\n ctx.lineTo(x - height, height);\n }\n ctx.globalCompositeOperation = 'destination-out';\n ctx.stroke();\n ctx.restore();\n }\n\n applyPattern(backgroundContext);\n }\n\n override update(): void {\n const traceBoundsState = TraceBounds.TraceBounds.BoundsManager.instance().state();\n const bounds = traceBoundsState?.milli.minimapTraceBounds;\n if (!bounds) {\n return;\n }\n if (bounds.min === this.#start && bounds.max === this.#end && this.#drawn) {\n return;\n }\n this.#start = bounds.min;\n this.#end = bounds.max;\n // Order matters here, resetCanvas will set this.#drawn to false.\n this.resetCanvas();\n this.#drawn = true;\n this.#draw(this.#parsedTrace);\n }\n}\n\nexport class TimelineEventOverviewResponsiveness extends TimelineEventOverview {\n #parsedTrace: Trace.Handlers.Types.ParsedTrace;\n constructor(parsedTrace: Trace.Handlers.Types.ParsedTrace) {\n super('responsiveness', null);\n this.#parsedTrace = parsedTrace;\n }\n\n #gatherEventsWithRelevantWarnings(): Set {\n const {topLevelRendererIds} = this.#parsedTrace.Meta;\n\n // All the warnings that we care about regarding responsiveness and want to represent on the overview.\n const warningsForResponsiveness = new Set([\n 'LONG_TASK',\n 'FORCED_REFLOW',\n 'IDLE_CALLBACK_OVER_TIME',\n ]);\n\n const allWarningEvents = new Set();\n for (const warning of warningsForResponsiveness) {\n const eventsForWarning = this.#parsedTrace.Warnings.perWarning.get(warning);\n if (!eventsForWarning) {\n continue;\n }\n\n for (const event of eventsForWarning) {\n // Only keep events whose PID is a top level renderer, which means it\n // was on the main thread. This avoids showing issues from iframes or\n // other sub-frames in the minimap overview.\n if (topLevelRendererIds.has(event.pid)) {\n allWarningEvents.add(event);\n }\n }\n }\n return allWarningEvents;\n }\n\n override update(start?: Trace.Types.Timing.MilliSeconds, end?: Trace.Types.Timing.MilliSeconds): void {\n this.resetCanvas();\n\n const height = this.height();\n const visibleTimeWindow = !(start && end) ? this.#parsedTrace.Meta.traceBounds : {\n min: Trace.Helpers.Timing.millisecondsToMicroseconds(start),\n max: Trace.Helpers.Timing.millisecondsToMicroseconds(end),\n range: Trace.Helpers.Timing.millisecondsToMicroseconds(Trace.Types.Timing.MilliSeconds(end - start)),\n };\n const timeSpan = visibleTimeWindow.range;\n const scale = this.width() / timeSpan;\n const ctx = this.context();\n const fillPath = new Path2D();\n const markersPath = new Path2D();\n\n const eventsWithWarning = this.#gatherEventsWithRelevantWarnings();\n for (const event of eventsWithWarning) {\n paintWarningDecoration(event);\n }\n\n ctx.fillStyle = 'hsl(0, 80%, 90%)';\n ctx.strokeStyle = 'red';\n ctx.lineWidth = 2 * window.devicePixelRatio;\n ctx.fill(fillPath);\n ctx.stroke(markersPath);\n\n function paintWarningDecoration(event: Trace.Types.Events.Event): void {\n const {startTime, duration} = Trace.Helpers.Timing.eventTimingsMicroSeconds(event);\n const x = Math.round(scale * (startTime - visibleTimeWindow.min));\n const width = Math.round(scale * duration);\n fillPath.rect(x, 0, width, height);\n markersPath.moveTo(x + width, 0);\n markersPath.lineTo(x + width, height);\n }\n }\n}\n\nexport class TimelineFilmStripOverview extends TimelineEventOverview {\n private frameToImagePromise: Map>;\n private lastFrame: Trace.Extras.FilmStrip.Frame|null = null;\n private lastElement: Element|null;\n private drawGeneration?: symbol;\n private emptyImage?: HTMLImageElement;\n #filmStrip: Trace.Extras.FilmStrip.Data|null = null;\n\n constructor(filmStrip: Trace.Extras.FilmStrip.Data) {\n super('filmstrip', null);\n this.element.setAttribute('jslog', `${VisualLogging.section('film-strip')}`);\n this.frameToImagePromise = new Map();\n this.#filmStrip = filmStrip;\n this.lastFrame = null;\n this.lastElement = null;\n this.reset();\n }\n\n override update(customStartTime?: Trace.Types.Timing.MilliSeconds, customEndTime?: Trace.Types.Timing.MilliSeconds):\n void {\n this.resetCanvas();\n const frames = this.#filmStrip ? this.#filmStrip.frames : [];\n if (!frames.length) {\n return;\n }\n\n if (this.height() === 0) {\n // Height of 0 causes the maths below to get off and generate very large\n // negative numbers that cause an extremely long loop when attempting to\n // draw images by frame. Rather than that, let's warn and exist early.\n console.warn('TimelineFilmStrip could not be drawn as its canvas height is 0');\n return;\n }\n\n const drawGeneration = Symbol('drawGeneration');\n this.drawGeneration = drawGeneration;\n void this.imageByFrame(frames[0]).then(image => {\n if (this.drawGeneration !== drawGeneration) {\n return;\n }\n if (!image || !image.naturalWidth || !image.naturalHeight) {\n return;\n }\n const imageHeight = this.height() - 2 * TimelineFilmStripOverview.Padding;\n const imageWidth = Math.ceil(imageHeight * image.naturalWidth / image.naturalHeight);\n const popoverScale = Math.min(200 / image.naturalWidth, 1);\n this.emptyImage = new Image(image.naturalWidth * popoverScale, image.naturalHeight * popoverScale);\n this.drawFrames(imageWidth, imageHeight, customStartTime, customEndTime);\n });\n }\n\n private async imageByFrame(frame: Trace.Extras.FilmStrip.Frame): Promise {\n let imagePromise: Promise|undefined = this.frameToImagePromise.get(frame);\n if (!imagePromise) {\n // TODO(paulirish): Adopt Util.ImageCache\n imagePromise = UI.UIUtils.loadImage(frame.screenshotEvent.args.dataUri);\n this.frameToImagePromise.set(frame, (imagePromise as Promise));\n }\n return imagePromise;\n }\n\n private drawFrames(\n imageWidth: number, imageHeight: number, customStartTime?: Trace.Types.Timing.MilliSeconds,\n customEndTime?: Trace.Types.Timing.MilliSeconds): void {\n if (!imageWidth) {\n return;\n }\n if (!this.#filmStrip || this.#filmStrip.frames.length < 1) {\n return;\n }\n const padding = TimelineFilmStripOverview.Padding;\n const width = this.width();\n\n const zeroTime = customStartTime ?? Trace.Helpers.Timing.microSecondsToMilliseconds(this.#filmStrip.zeroTime);\n const spanTime = customEndTime ? customEndTime - zeroTime :\n Trace.Helpers.Timing.microSecondsToMilliseconds(this.#filmStrip.spanTime);\n const scale = spanTime / width;\n const context = this.context();\n const drawGeneration = this.drawGeneration;\n\n context.beginPath();\n for (let x = padding; x < width; x += imageWidth + 2 * padding) {\n const time = Trace.Types.Timing.MilliSeconds(zeroTime + (x + imageWidth / 2) * scale);\n const timeMicroSeconds = Trace.Helpers.Timing.millisecondsToMicroseconds(time);\n const frame = Trace.Extras.FilmStrip.frameClosestToTimestamp(this.#filmStrip, timeMicroSeconds);\n if (!frame) {\n continue;\n }\n context.rect(x - 0.5, 0.5, imageWidth + 1, imageHeight + 1);\n void this.imageByFrame(frame).then(drawFrameImage.bind(this, x));\n }\n context.strokeStyle = '#ddd';\n context.stroke();\n\n function drawFrameImage(this: TimelineFilmStripOverview, x: number, image: HTMLImageElement|null): void {\n // Ignore draws deferred from a previous update call.\n if (this.drawGeneration !== drawGeneration || !image) {\n return;\n }\n context.drawImage(image, x, 1, imageWidth, imageHeight);\n }\n }\n\n override async overviewInfoPromise(x: number): Promise {\n if (!this.#filmStrip || this.#filmStrip.frames.length === 0) {\n return null;\n }\n\n const calculator = this.calculator();\n if (!calculator) {\n return null;\n }\n const timeMilliSeconds = calculator.positionToTime(x);\n const timeMicroSeconds = Trace.Helpers.Timing.millisecondsToMicroseconds(timeMilliSeconds);\n const frame = Trace.Extras.FilmStrip.frameClosestToTimestamp(this.#filmStrip, timeMicroSeconds);\n if (frame === this.lastFrame) {\n return this.lastElement;\n }\n const imagePromise = frame ? this.imageByFrame(frame) : Promise.resolve(this.emptyImage);\n const image = await imagePromise;\n const element = document.createElement('div');\n element.classList.add('frame');\n if (image) {\n element.createChild('div', 'thumbnail').appendChild(image);\n }\n this.lastFrame = frame;\n this.lastElement = element;\n return element;\n }\n\n override reset(): void {\n this.lastFrame = null;\n this.lastElement = null;\n this.frameToImagePromise = new Map();\n }\n\n // TODO(crbug.com/1172300) Ignored during the jsdoc to ts migration\n // eslint-disable-next-line @typescript-eslint/naming-convention\n static readonly Padding = 2;\n}\n\nexport class TimelineEventOverviewMemory extends TimelineEventOverview {\n private heapSizeLabel: HTMLElement;\n #parsedTrace: Trace.Handlers.Types.ParsedTrace;\n\n constructor(parsedTrace: Trace.Handlers.Types.ParsedTrace) {\n super('memory', i18nString(UIStrings.heap));\n this.heapSizeLabel = this.element.createChild('div', 'memory-graph-label');\n this.#parsedTrace = parsedTrace;\n }\n\n resetHeapSizeLabels(): void {\n this.heapSizeLabel.textContent = '';\n }\n\n override update(start?: Trace.Types.Timing.MilliSeconds, end?: Trace.Types.Timing.MilliSeconds): void {\n this.resetCanvas();\n const ratio = window.devicePixelRatio;\n\n if (this.#parsedTrace.Memory.updateCountersByProcess.size === 0) {\n this.resetHeapSizeLabels();\n return;\n }\n\n const mainRendererIds = Array.from(this.#parsedTrace.Meta.topLevelRendererIds);\n const counterEventsPerTrack =\n mainRendererIds.map(pid => this.#parsedTrace.Memory.updateCountersByProcess.get(pid) || [])\n .filter(eventsPerRenderer => eventsPerRenderer.length > 0);\n\n const lowerOffset = 3 * ratio;\n let maxUsedHeapSize = 0;\n let minUsedHeapSize = 100000000000;\n\n const boundsMs = (start && end) ? {\n min: start,\n max: end,\n range: end - start,\n } :\n Trace.Helpers.Timing.traceWindowMilliSeconds(this.#parsedTrace.Meta.traceBounds);\n const minTime = boundsMs.min;\n const maxTime = boundsMs.max;\n\n function calculateMinMaxSizes(event: Trace.Types.Events.UpdateCounters): void {\n const counters = event.args.data;\n if (!counters || !counters.jsHeapSizeUsed) {\n return;\n }\n maxUsedHeapSize = Math.max(maxUsedHeapSize, counters.jsHeapSizeUsed);\n minUsedHeapSize = Math.min(minUsedHeapSize, counters.jsHeapSizeUsed);\n }\n\n for (let i = 0; i < counterEventsPerTrack.length; i++) {\n counterEventsPerTrack[i].forEach(calculateMinMaxSizes);\n }\n\n minUsedHeapSize = Math.min(minUsedHeapSize, maxUsedHeapSize);\n\n const lineWidth = 1;\n const width = this.width();\n const height = this.height() - lowerOffset;\n const xFactor = width / (maxTime - minTime);\n const yFactor = (height - lineWidth) / Math.max(maxUsedHeapSize - minUsedHeapSize, 1);\n\n const histogram = new Array(width);\n\n function buildHistogram(event: Trace.Types.Events.UpdateCounters): void {\n const counters = event.args.data;\n if (!counters || !counters.jsHeapSizeUsed) {\n return;\n }\n const {startTime} = Trace.Helpers.Timing.eventTimingsMilliSeconds(event);\n const x = Math.round((startTime - minTime) * xFactor);\n const y = Math.round((counters.jsHeapSizeUsed - minUsedHeapSize) * yFactor);\n histogram[x] = Math.max(histogram[x] || 0, y);\n }\n for (let i = 0; i < counterEventsPerTrack.length; i++) {\n counterEventsPerTrack[i].forEach(buildHistogram);\n }\n\n const ctx = this.context();\n const heightBeyondView = height + lowerOffset + lineWidth;\n\n ctx.translate(0.5, 0.5);\n ctx.beginPath();\n ctx.moveTo(-lineWidth, heightBeyondView);\n let y = 0;\n let isFirstPoint = true;\n let lastX = 0;\n for (let x = 0; x < histogram.length; x++) {\n if (typeof histogram[x] === 'undefined') {\n continue;\n }\n if (isFirstPoint) {\n isFirstPoint = false;\n y = histogram[x];\n ctx.lineTo(-lineWidth, height - y);\n }\n const nextY = histogram[x];\n if (Math.abs(nextY - y) > 2 && Math.abs(x - lastX) > 1) {\n ctx.lineTo(x, height - y);\n }\n y = nextY;\n ctx.lineTo(x, height - y);\n lastX = x;\n }\n ctx.lineTo(width + lineWidth, height - y);\n ctx.lineTo(width + lineWidth, heightBeyondView);\n ctx.closePath();\n\n ctx.fillStyle = 'hsla(220, 90%, 70%, 0.2)';\n ctx.fill();\n ctx.lineWidth = lineWidth;\n ctx.strokeStyle = 'hsl(220, 90%, 70%)';\n ctx.stroke();\n\n this.heapSizeLabel.textContent = i18nString(UIStrings.sSDash, {\n PH1: i18n.ByteUtilities.bytesToString(minUsedHeapSize),\n PH2: i18n.ByteUtilities.bytesToString(maxUsedHeapSize),\n });\n }\n}\n\nexport class Quantizer {\n private lastTime: number;\n private quantDuration: number;\n private readonly callback: (arg0: Array) => void;\n private counters: number[];\n private remainder: number;\n constructor(startTime: number, quantDuration: number, callback: (arg0: Array) => void) {\n this.lastTime = startTime;\n this.quantDuration = quantDuration;\n this.callback = callback;\n this.counters = [];\n this.remainder = quantDuration;\n }\n\n appendInterval(time: number, group: number): void {\n let interval = time - this.lastTime;\n if (interval <= this.remainder) {\n this.counters[group] = (this.counters[group] || 0) + interval;\n this.remainder -= interval;\n this.lastTime = time;\n return;\n }\n this.counters[group] = (this.counters[group] || 0) + this.remainder;\n this.callback(this.counters);\n interval -= this.remainder;\n while (interval >= this.quantDuration) {\n const counters = [];\n counters[group] = this.quantDuration;\n this.callback(counters);\n interval -= this.quantDuration;\n }\n this.counters = [];\n this.counters[group] = interval;\n this.lastTime = time;\n this.remainder = this.quantDuration - interval;\n }\n}\n"]} \ No newline at end of file diff --git a/public/panels/timeline/TimelineFlameChartDataProvider.js b/public/panels/timeline/TimelineFlameChartDataProvider.js index a86e91eb9..9839fab0b 100644 --- a/public/panels/timeline/TimelineFlameChartDataProvider.js +++ b/public/panels/timeline/TimelineFlameChartDataProvider.js @@ -693,10 +693,7 @@ export class TimelineFlameChartDataProvider extends Common.ObjectWrapper.ObjectW return null; } const popoverElement = document.createElement('div'); - const root = UI.UIUtils.createShadowRootWithCoreStyles(popoverElement, { - cssFile: [timelineFlamechartPopoverStyles], - delegatesFocus: undefined, - }); + const root = UI.UIUtils.createShadowRootWithCoreStyles(popoverElement, { cssFile: [timelineFlamechartPopoverStyles] }); const popoverContents = root.createChild('div', 'timeline-flamechart-popover'); popoverContents.createChild('span', timeElementClassName).textContent = time; popoverContents.createChild('span', 'popoverinfo-title').textContent = title; @@ -711,10 +708,7 @@ export class TimelineFlameChartDataProvider extends Common.ObjectWrapper.ObjectW } preparePopoverForCollapsedArrow(entryIndex) { const element = document.createElement('div'); - const root = UI.UIUtils.createShadowRootWithCoreStyles(element, { - cssFile: [timelineFlamechartPopoverStyles], - delegatesFocus: undefined, - }); + const root = UI.UIUtils.createShadowRootWithCoreStyles(element, { cssFile: [timelineFlamechartPopoverStyles] }); const entry = this.entryData[entryIndex]; const hiddenEntriesAmount = ModificationsManager.activeManager()?.getEntriesFilter().findHiddenDescendantsAmount(entry); if (!hiddenEntriesAmount) { diff --git a/public/panels/timeline/TimelineFlameChartDataProvider.js.map b/public/panels/timeline/TimelineFlameChartDataProvider.js.map index dddea615f..c739fb3a6 100644 --- a/public/panels/timeline/TimelineFlameChartDataProvider.js.map +++ b/public/panels/timeline/TimelineFlameChartDataProvider.js.map @@ -1 +1 @@ -{"version":3,"file":"TimelineFlameChartDataProvider.js","sourceRoot":"","sources":["../../../../../../front_end/panels/timeline/TimelineFlameChartDataProvider.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,OAAO,KAAK,MAAM,MAAM,6BAA6B,CAAC;AACtD,OAAO,KAAK,IAAI,MAAM,yBAAyB,CAAC;AAChD,OAAO,KAAK,IAAI,MAAM,yBAAyB,CAAC;AAChD,OAAO,KAAK,QAAQ,MAAM,mCAAmC,CAAC;AAC9D,OAAO,KAAK,KAAK,MAAM,6BAA6B,CAAC;AACrD,OAAO,KAAK,MAAM,MAAM,+CAA+C,CAAC;AACxE,OAAO,KAAK,EAAE,MAAM,2BAA2B,CAAC;AAChD,OAAO,KAAK,YAAY,MAAM,gDAAgD,CAAC;A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AM,CAAC,MAAM,6BAA6B,GAAG,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC","sourcesContent":["/*\n * Copyright (C) 2014 Google Inc. All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are\n * met:\n *\n * * Redistributions of source code must retain the above copyright\n * notice, this list of conditions and the following disclaimer.\n * * Redistributions in binary form must reproduce the above\n * copyright notice, this list of conditions and the following disclaimer\n * in the documentation and/or other materials provided with the\n * distribution.\n * * Neither the name of Google Inc. nor the names of its\n * contributors may be used to endorse or promote products derived from\n * this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nimport * as Common from '../../core/common/common.js';\nimport * as i18n from '../../core/i18n/i18n.js';\nimport * as Root from '../../core/root/root.js';\nimport * as Bindings from '../../models/bindings/bindings.js';\nimport * as Trace from '../../models/trace/trace.js';\nimport * as PerfUI from '../../ui/legacy/components/perf_ui/perf_ui.js';\nimport * as UI from '../../ui/legacy/legacy.js';\nimport * as ThemeSupport from '../../ui/legacy/theme_support/theme_support.js';\n\nimport {CompatibilityTracksAppender, type DrawOverride, type TrackAppenderName} from './CompatibilityTracksAppender.js';\nimport {initiatorsDataToDraw} from './Initiators.js';\nimport {ModificationsManager} from './ModificationsManager.js';\nimport {ThreadAppender} from './ThreadAppender.js';\nimport timelineFlamechartPopoverStyles from './timelineFlamechartPopover.css.js';\nimport {FlameChartStyle, Selection} from './TimelineFlameChartView.js';\nimport {\n selectionFromEvent,\n selectionIsRange,\n selectionsEqual,\n type TimelineSelection,\n} from './TimelineSelection.js';\nimport * as Utils from './utils/utils.js';\n\nconst UIStrings = {\n /**\n *@description Text for rendering frames\n */\n frames: 'Frames',\n /**\n *@description Text in Timeline Flame Chart Data Provider of the Performance panel\n */\n idleFrame: 'Idle frame',\n /**\n *@description Text in Timeline Frame Chart Data Provider of the Performance panel\n */\n droppedFrame: 'Dropped frame',\n /**\n *@description Text in Timeline Frame Chart Data Provider of the Performance panel\n */\n partiallyPresentedFrame: 'Partially-presented frame',\n /**\n *@description Text for a rendering frame\n */\n frame: 'Frame',\n /**\n *@description Text for Hiding a function from the Flame Chart\n */\n hideFunction: 'Hide function',\n /**\n *@description Text for Hiding all children of a function from the Flame Chart\n */\n hideChildren: 'Hide children',\n /**\n *@description Text for Hiding all child entries that are identical to the selected entry from the Flame Chart\n */\n hideRepeatingChildren: 'Hide repeating children',\n /**\n *@description Text for remove script from ignore list from the Flame Chart\n */\n removeScriptFromIgnoreList: 'Remove script from ignore list',\n /**\n *@description Text for add script to ignore list from the Flame Chart\n */\n addScriptToIgnoreList: 'Add script to ignore list',\n /**\n *@description Text for an action that shows all of the hidden children of an entry\n */\n resetChildren: 'Reset children',\n /**\n *@description Text for an action that shows all of the hidden entries of the Flame Chart\n */\n resetTrace: 'Reset trace',\n};\nconst str_ = i18n.i18n.registerUIStrings('panels/timeline/TimelineFlameChartDataProvider.ts', UIStrings);\nconst i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);\n\nexport class TimelineFlameChartDataProvider extends Common.ObjectWrapper.ObjectWrapper implements\n PerfUI.FlameChart.FlameChartDataProvider {\n private droppedFramePatternCanvas: HTMLCanvasElement;\n private partialFramePatternCanvas: HTMLCanvasElement;\n private timelineDataInternal: PerfUI.FlameChart.FlameChartTimelineData|null = null;\n private currentLevel = 0;\n\n private compatibilityTracksAppender: CompatibilityTracksAppender|null = null;\n private parsedTrace: Trace.Handlers.Types.ParsedTrace|null = null;\n private isCpuProfile = false;\n\n #minimumBoundary: number = 0;\n private timeSpan: number = 0;\n private readonly framesGroupStyle: PerfUI.FlameChart.GroupStyle;\n private readonly screenshotsGroupStyle: PerfUI.FlameChart.GroupStyle;\n\n // Contains all the entries that are DRAWN onto the track. Entries that have\n // been hidden - either by a user action, or because they aren't visible at\n // all - will not appear in this array and it will change per-render. For\n // example, if a user collapses an icicle in the flamechart, those entries\n // that are now hidden will no longer be in this array.\n // This also includes entrys that used to be special cased (e.g.\n // TimelineFrames) that are now of type Types.Events.Event and so the old\n // `TimelineFlameChartEntry` type has been removed in faovur of using\n // Trace.Types.Events.Event directly. See crrev.com/c/5973695 for details.\n private entryData: Trace.Types.Events.Event[] = [];\n\n private entryTypeByLevel: EntryType[] = [];\n private entryIndexToTitle: string[] = [];\n private lastInitiatorEntry: number = -1;\n private lastInitiatorsData: PerfUI.FlameChart.FlameChartInitiatorData[] = [];\n\n private lastSelection: Selection|null = null;\n readonly #font = `${PerfUI.Font.DEFAULT_FONT_SIZE} ${PerfUI.Font.getFontFamilyForCanvas()}`;\n #eventIndexByEvent: WeakMap = new WeakMap();\n\n constructor() {\n super();\n this.reset();\n\n this.droppedFramePatternCanvas = document.createElement('canvas');\n this.partialFramePatternCanvas = document.createElement('canvas');\n this.preparePatternCanvas();\n\n this.framesGroupStyle = this.buildGroupStyle({useFirstLineForOverview: true});\n this.screenshotsGroupStyle =\n this.buildGroupStyle({useFirstLineForOverview: true, nestingLevel: 1, collapsible: false, itemsHeight: 150});\n\n ThemeSupport.ThemeSupport.instance().addEventListener(ThemeSupport.ThemeChangeEvent.eventName, () => {\n const headers = [\n this.framesGroupStyle,\n this.screenshotsGroupStyle,\n ];\n for (const header of headers) {\n header.color = ThemeSupport.ThemeSupport.instance().getComputedValue('--sys-color-on-surface');\n header.backgroundColor =\n ThemeSupport.ThemeSupport.instance().getComputedValue('--sys-color-cdt-base-container');\n }\n });\n Utils.ImageCache.emitter.addEventListener(\n 'screenshot-loaded', () => this.dispatchEventToListeners(Events.DATA_CHANGED));\n\n Common.Settings.Settings.instance()\n .moduleSetting('skip-stack-frames-pattern')\n .addChangeListener(this.#onIgnoreListChanged.bind(this));\n Common.Settings.Settings.instance()\n .moduleSetting('skip-content-scripts')\n .addChangeListener(this.#onIgnoreListChanged.bind(this));\n Common.Settings.Settings.instance()\n .moduleSetting('automatically-ignore-list-known-third-party-scripts')\n .addChangeListener(this.#onIgnoreListChanged.bind(this));\n Common.Settings.Settings.instance()\n .moduleSetting('enable-ignore-listing')\n .addChangeListener(this.#onIgnoreListChanged.bind(this));\n Common.Settings.Settings.instance()\n .moduleSetting('skip-anonymous-scripts')\n .addChangeListener(this.#onIgnoreListChanged.bind(this));\n }\n\n hasTrackConfigurationMode(): boolean {\n return true;\n }\n\n getPossibleActions(entryIndex: number, groupIndex: number): PerfUI.FlameChart.PossibleFilterActions|void {\n const data = this.timelineData();\n if (!data) {\n return;\n }\n const group = data.groups.at(groupIndex);\n // Early exit here if there is no group or:\n // 1. The group is not expanded: it needs to be expanded to allow the\n // context menu actions to occur.\n // 2. The group does not have the showStackContextMenu flag which indicates\n // that it does not show entries that support the stack actions.\n if (!group || !group.expanded || !group.showStackContextMenu) {\n return;\n }\n\n // Check which actions are possible on an entry.\n // If an action would not change the entries (for example it has no children to collapse), we do not need to show it.\n return this.findPossibleContextMenuActions(entryIndex);\n }\n\n customizedContextMenu(event: MouseEvent, entryIndex: number, groupIndex: number): UI.ContextMenu.ContextMenu\n |undefined {\n const possibleActions = this.getPossibleActions(entryIndex, groupIndex);\n if (!possibleActions) {\n return;\n }\n\n const contextMenu = new UI.ContextMenu.ContextMenu(event);\n\n // This action and its 'execute' is defined in `freestyler-meta`\n const actionIdDrJ = 'drjones.performance-panel-context';\n if (UI.ActionRegistry.ActionRegistry.instance().hasAction(actionIdDrJ)) {\n const action = UI.ActionRegistry.ActionRegistry.instance().getAction(actionIdDrJ);\n contextMenu.headerSection().appendItem(action.title(), () => {\n const event = this.eventByIndex(entryIndex);\n if (!event || !this.parsedTrace) {\n return;\n }\n const allEvents = Array.from(this.entryData.values());\n const aiCallTree = Utils.AICallTree.AICallTree.from(event, allEvents, this.parsedTrace);\n\n // The other side of setFlavor is handleTraceEntryNodeFlavorChange() in FreestylerPanel\n UI.Context.Context.instance().setFlavor(Utils.AICallTree.AICallTree, aiCallTree);\n return action.execute();\n }, {jslogContext: actionIdDrJ});\n }\n\n const hideEntryOption = contextMenu.defaultSection().appendItem(i18nString(UIStrings.hideFunction), () => {\n this.modifyTree(PerfUI.FlameChart.FilterAction.MERGE_FUNCTION, entryIndex);\n }, {\n disabled: !possibleActions?.[PerfUI.FlameChart.FilterAction.MERGE_FUNCTION],\n jslogContext: 'hide-function',\n });\n hideEntryOption.setAccelerator(UI.KeyboardShortcut.Keys.H, [UI.KeyboardShortcut.Modifiers.None]);\n hideEntryOption.setIsDevToolsPerformanceMenuItem(true);\n\n const hideChildrenOption = contextMenu.defaultSection().appendItem(i18nString(UIStrings.hideChildren), () => {\n this.modifyTree(PerfUI.FlameChart.FilterAction.COLLAPSE_FUNCTION, entryIndex);\n }, {\n disabled: !possibleActions?.[PerfUI.FlameChart.FilterAction.COLLAPSE_FUNCTION],\n jslogContext: 'hide-children',\n });\n hideChildrenOption.setAccelerator(UI.KeyboardShortcut.Keys.C, [UI.KeyboardShortcut.Modifiers.None]);\n hideChildrenOption.setIsDevToolsPerformanceMenuItem(true);\n\n const hideRepeatingChildrenOption =\n contextMenu.defaultSection().appendItem(i18nString(UIStrings.hideRepeatingChildren), () => {\n this.modifyTree(PerfUI.FlameChart.FilterAction.COLLAPSE_REPEATING_DESCENDANTS, entryIndex);\n }, {\n disabled: !possibleActions?.[PerfUI.FlameChart.FilterAction.COLLAPSE_REPEATING_DESCENDANTS],\n jslogContext: 'hide-repeating-children',\n });\n hideRepeatingChildrenOption.setAccelerator(UI.KeyboardShortcut.Keys.R, [UI.KeyboardShortcut.Modifiers.None]);\n hideRepeatingChildrenOption.setIsDevToolsPerformanceMenuItem(true);\n\n const resetChildrenOption = contextMenu.defaultSection().appendItem(i18nString(UIStrings.resetChildren), () => {\n this.modifyTree(PerfUI.FlameChart.FilterAction.RESET_CHILDREN, entryIndex);\n }, {\n disabled: !possibleActions?.[PerfUI.FlameChart.FilterAction.RESET_CHILDREN],\n jslogContext: 'reset-children',\n });\n resetChildrenOption.setAccelerator(UI.KeyboardShortcut.Keys.U, [UI.KeyboardShortcut.Modifiers.None]);\n resetChildrenOption.setIsDevToolsPerformanceMenuItem(true);\n\n contextMenu.defaultSection().appendItem(i18nString(UIStrings.resetTrace), () => {\n this.modifyTree(PerfUI.FlameChart.FilterAction.UNDO_ALL_ACTIONS, entryIndex);\n }, {\n disabled: !possibleActions?.[PerfUI.FlameChart.FilterAction.UNDO_ALL_ACTIONS],\n jslogContext: 'reset-trace',\n });\n\n const entry = this.eventByIndex(entryIndex);\n if (!entry || !this.parsedTrace || Trace.Types.Events.isLegacyTimelineFrame(entry)) {\n return contextMenu;\n }\n const url = Utils.SourceMapsResolver.SourceMapsResolver.resolvedURLForEntry(this.parsedTrace, entry);\n if (!url) {\n return contextMenu;\n }\n if (Utils.IgnoreList.isIgnoreListedEntry(entry)) {\n contextMenu.defaultSection().appendItem(i18nString(UIStrings.removeScriptFromIgnoreList), () => {\n Bindings.IgnoreListManager.IgnoreListManager.instance().unIgnoreListURL(url);\n this.#onIgnoreListChanged();\n }, {\n jslogContext: 'remove-from-ignore-list',\n });\n } else {\n contextMenu.defaultSection().appendItem(i18nString(UIStrings.addScriptToIgnoreList), () => {\n Bindings.IgnoreListManager.IgnoreListManager.instance().ignoreListURL(url);\n this.#onIgnoreListChanged();\n }, {\n jslogContext: 'add-to-ignore-list',\n });\n }\n\n return contextMenu;\n }\n\n #onIgnoreListChanged(): void {\n this.timelineData(/* rebuild= */ true);\n this.dispatchEventToListeners(Events.DATA_CHANGED);\n }\n\n entryHasAnnotations(entryIndex: number): boolean {\n const event = this.eventByIndex(entryIndex);\n if (!event) {\n return false;\n }\n const annotations = ModificationsManager.activeManager()?.annotationsForEntry(event);\n return annotations ? annotations.length > 0 : false;\n }\n\n deleteAnnotationsForEntry(entryIndex: number): void {\n const event = this.eventByIndex(entryIndex);\n if (!event) {\n return;\n }\n ModificationsManager.activeManager()?.deleteEntryAnnotations(event);\n }\n\n modifyTree(action: PerfUI.FlameChart.FilterAction, entryIndex: number): void {\n const entry = this.entryData[entryIndex] as Trace.Types.Events.Event;\n\n ModificationsManager.activeManager()?.getEntriesFilter().applyFilterAction({type: action, entry});\n this.timelineData(true);\n this.buildFlowForInitiator(entryIndex);\n this.dispatchEventToListeners(Events.DATA_CHANGED);\n }\n\n findPossibleContextMenuActions(entryIndex: number): PerfUI.FlameChart.PossibleFilterActions|void {\n const entry = this.entryData[entryIndex] as Trace.Types.Events.Event;\n return ModificationsManager.activeManager()?.getEntriesFilter().findPossibleActions(entry);\n }\n\n handleFlameChartTransformKeyboardEvent(event: KeyboardEvent, entryIndex: number, groupIndex: number): void {\n const possibleActions = this.getPossibleActions(entryIndex, groupIndex);\n if (!possibleActions) {\n return;\n }\n\n let handled = false;\n\n if (event.code === 'KeyH' && possibleActions[PerfUI.FlameChart.FilterAction.MERGE_FUNCTION]) {\n this.modifyTree(PerfUI.FlameChart.FilterAction.MERGE_FUNCTION, entryIndex);\n handled = true;\n } else if (event.code === 'KeyC' && possibleActions[PerfUI.FlameChart.FilterAction.COLLAPSE_FUNCTION]) {\n this.modifyTree(PerfUI.FlameChart.FilterAction.COLLAPSE_FUNCTION, entryIndex);\n handled = true;\n } else if (\n event.code === 'KeyR' && possibleActions[PerfUI.FlameChart.FilterAction.COLLAPSE_REPEATING_DESCENDANTS]) {\n this.modifyTree(PerfUI.FlameChart.FilterAction.COLLAPSE_REPEATING_DESCENDANTS, entryIndex);\n handled = true;\n } else if (event.code === 'KeyU') {\n this.modifyTree(PerfUI.FlameChart.FilterAction.RESET_CHILDREN, entryIndex);\n handled = true;\n }\n\n if (handled) {\n event.consume(true);\n }\n }\n\n private buildGroupStyle(extra: Object): PerfUI.FlameChart.GroupStyle {\n const defaultGroupStyle = {\n padding: 4,\n height: 17,\n collapsible: true,\n color: ThemeSupport.ThemeSupport.instance().getComputedValue('--sys-color-on-surface'),\n backgroundColor: ThemeSupport.ThemeSupport.instance().getComputedValue('--sys-color-cdt-base-container'),\n nestingLevel: 0,\n shareHeaderLine: true,\n };\n return Object.assign(defaultGroupStyle, extra);\n }\n\n setModel(parsedTrace: Trace.Handlers.Types.ParsedTrace, isCpuProfile = false): void {\n this.reset();\n this.parsedTrace = parsedTrace;\n this.isCpuProfile = isCpuProfile;\n const {traceBounds} = parsedTrace.Meta;\n const minTime = Trace.Helpers.Timing.microSecondsToMilliseconds(traceBounds.min);\n const maxTime = Trace.Helpers.Timing.microSecondsToMilliseconds(traceBounds.max);\n this.#minimumBoundary = minTime;\n this.timeSpan = minTime === maxTime ? 1000 : maxTime - this.#minimumBoundary;\n }\n\n /**\n * Instances and caches a CompatibilityTracksAppender using the\n * internal flame chart data and the trace parsed data coming from the\n * trace engine.\n * The model data must have been set to the data provider instance before\n * attempting to instance the CompatibilityTracksAppender.\n */\n compatibilityTracksAppenderInstance(forceNew = false): CompatibilityTracksAppender {\n if (!this.compatibilityTracksAppender || forceNew) {\n if (!this.parsedTrace) {\n throw new Error(\n 'Attempted to instantiate a CompatibilityTracksAppender without having set the trace parse data first.');\n }\n this.timelineDataInternal = this.#instantiateTimelineData();\n this.compatibilityTracksAppender = new CompatibilityTracksAppender(\n this.timelineDataInternal, this.parsedTrace, this.entryData, this.entryTypeByLevel);\n }\n return this.compatibilityTracksAppender;\n }\n\n /**\n * Returns the instance of the timeline flame chart data, without\n * adding data to it. In case the timeline data hasn't been instanced\n * creates a new instance and returns it.\n */\n #instantiateTimelineData(): PerfUI.FlameChart.FlameChartTimelineData {\n if (!this.timelineDataInternal) {\n this.timelineDataInternal = PerfUI.FlameChart.FlameChartTimelineData.createEmpty();\n }\n return this.timelineDataInternal;\n }\n\n /**\n * Builds the flame chart data using the track appenders\n */\n buildFromTrackAppendersForTest(options?: {filterThreadsByName?: string, expandedTracks?: Set}):\n void {\n if (!this.compatibilityTracksAppender) {\n return;\n }\n const appenders = this.compatibilityTracksAppender.allVisibleTrackAppenders();\n for (const appender of appenders) {\n const skipThreadAppenderByName =\n appender instanceof ThreadAppender && !appender.trackName().includes(options?.filterThreadsByName || '');\n if (skipThreadAppenderByName) {\n continue;\n }\n const expanded = Boolean(options?.expandedTracks?.has(appender.appenderName));\n this.currentLevel = appender.appendTrackAtLevel(this.currentLevel, expanded);\n }\n }\n\n groupTreeEvents(group: PerfUI.FlameChart.Group): Trace.Types.Events.Event[]|null {\n return this.compatibilityTracksAppender?.groupEventsForTreeView(group) ?? null;\n }\n\n mainFrameNavigationStartEvents(): readonly Trace.Types.Events.NavigationStart[] {\n if (!this.parsedTrace) {\n return [];\n }\n return this.parsedTrace.Meta.mainFrameNavigations;\n }\n\n entryTitle(entryIndex: number): string|null {\n const entryType = this.#entryTypeForIndex(entryIndex);\n if (entryType === EntryType.SCREENSHOT) {\n return '';\n }\n if (entryType === EntryType.TRACK_APPENDER) {\n const timelineData = (this.timelineDataInternal as PerfUI.FlameChart.FlameChartTimelineData);\n const eventLevel = timelineData.entryLevels[entryIndex];\n const event = (this.entryData[entryIndex] as Trace.Types.Events.Event);\n return this.compatibilityTracksAppender?.titleForEvent(event, eventLevel) || null;\n }\n let title: Common.UIString.LocalizedString|string = this.entryIndexToTitle[entryIndex];\n if (!title) {\n title = `Unexpected entryIndex ${entryIndex}`;\n console.error(title);\n }\n return title;\n }\n\n textColor(index: number): string {\n const event = this.entryData[index];\n return Utils.IgnoreList.isIgnoreListedEntry(event) ? '#888' : FlameChartStyle.textColor;\n }\n\n entryFont(_index: number): string|null {\n return this.#font;\n }\n\n // Clear the cache and rebuild the timeline data\n // This should be called when the trace file is the same but we want to rebuild the timeline date.\n // Some possible example: when we hide/unhide an event, or the ignore list is changed etc.\n clearTimelineDataCache(): void {\n this.currentLevel = 0;\n this.entryData = [];\n this.entryTypeByLevel = [];\n this.entryIndexToTitle = [];\n this.#eventIndexByEvent = new Map();\n\n if (this.timelineDataInternal) {\n this.compatibilityTracksAppender?.setFlameChartDataAndEntryData(\n this.timelineDataInternal, this.entryData, this.entryTypeByLevel);\n this.compatibilityTracksAppender?.threadAppenders().forEach(\n threadAppender => threadAppender.setHeaderAppended(false));\n }\n }\n\n // Reset all data other than the UI elements.\n // This should be called when\n // - initialized the data provider\n // - a new trace file is coming (when `setModel()` is called)\n // etc.\n reset(): void {\n this.currentLevel = 0;\n this.entryData = [];\n this.entryTypeByLevel = [];\n this.entryIndexToTitle = [];\n this.#eventIndexByEvent = new Map();\n this.#minimumBoundary = 0;\n this.timeSpan = 0;\n\n this.compatibilityTracksAppender?.reset();\n this.compatibilityTracksAppender = null;\n this.timelineDataInternal = null;\n this.parsedTrace = null;\n }\n\n maxStackDepth(): number {\n return this.currentLevel;\n }\n\n /**\n * Builds the flame chart data using the tracks appender (which use\n * the new trace engine). The result built data is cached and returned.\n */\n timelineData(rebuild: boolean = false): PerfUI.FlameChart.FlameChartTimelineData {\n if (!rebuild && this.timelineDataInternal && this.timelineDataInternal.entryLevels.length !== 0) {\n // If the flame chart data is built already and we don't want to rebuild, we can return the cached data.\n // |entryLevels.length| is used to check if the cached data is not empty (correctly built),\n return this.timelineDataInternal;\n }\n\n this.timelineDataInternal = PerfUI.FlameChart.FlameChartTimelineData.createEmpty();\n\n if (rebuild) {\n // This function will interact with the |compatibilityTracksAppender|, which needs the reference of\n // |timelineDataInternal|, so make sure this is called after the correct |timelineDataInternal|.\n this.clearTimelineDataCache();\n }\n\n this.currentLevel = 0;\n\n if (this.parsedTrace) {\n this.compatibilityTracksAppender = this.compatibilityTracksAppenderInstance();\n if (this.parsedTrace.Meta.traceIsGeneric) {\n this.#processGenericTrace();\n } else {\n this.#processInspectorTrace();\n }\n }\n return this.timelineDataInternal;\n }\n\n /**\n * Register the groups (aka tracks) with the VisualElements framework so\n * later on we can log when an entry inside this group is selected.\n */\n #processGenericTrace(): void {\n if (!this.compatibilityTracksAppender) {\n return;\n }\n\n const appendersByProcess = this.compatibilityTracksAppender.allThreadAppendersByProcess();\n\n for (const [pid, threadAppenders] of appendersByProcess) {\n const processGroupStyle = this.buildGroupStyle({shareHeaderLine: false});\n const processName = this.parsedTrace?.Meta.processNames.get(pid)?.args.name || 'Process';\n this.appendHeader(`${processName} (${pid})`, processGroupStyle, true, false);\n for (const appender of threadAppenders) {\n appender.setHeaderNestingLevel(1);\n this.currentLevel = appender.appendTrackAtLevel(this.currentLevel);\n }\n }\n }\n\n #processInspectorTrace(): void {\n if (!this.isCpuProfile) {\n // CPU Profiles do not have frames and screenshots.\n this.#appendFramesAndScreenshotsTrack();\n }\n\n const weight = (track: {type?: string, forMainFrame?: boolean, appenderName?: TrackAppenderName}): number => {\n switch (track.appenderName) {\n case 'Animations':\n return 0;\n case 'Timings':\n return 1;\n case 'Interactions':\n return 2;\n case 'LayoutShifts':\n return 3;\n case 'Extension':\n return 4;\n case 'Thread':\n return 5;\n case 'ServerTimings':\n return 6;\n case 'GPU':\n return 7;\n case 'Thread_AuctionWorklet':\n return 8;\n default:\n return 9;\n }\n };\n\n const allTrackAppenders =\n this.compatibilityTracksAppender ? this.compatibilityTracksAppender.allVisibleTrackAppenders() : [];\n\n allTrackAppenders.sort((a, b) => weight(a) - weight(b));\n\n for (const appender of allTrackAppenders) {\n if (!this.parsedTrace) {\n continue;\n }\n\n this.currentLevel = appender.appendTrackAtLevel(this.currentLevel);\n\n // If there is not a selected group, we want to default to selecting the\n // main thread track. Therefore in this check we look to see if the\n // current appender is a ThreadAppender and represnets the Main Thread.\n // If it is, we mark the group as selected.\n if (this.timelineDataInternal && !this.timelineDataInternal.selectedGroup) {\n if (appender instanceof ThreadAppender &&\n (appender.threadType === Trace.Handlers.Threads.ThreadType.MAIN_THREAD ||\n appender.threadType === Trace.Handlers.Threads.ThreadType.CPU_PROFILE)) {\n const group = this.compatibilityTracksAppender?.groupForAppender(appender);\n if (group) {\n this.timelineDataInternal.selectedGroup = group;\n }\n }\n }\n }\n if (this.timelineDataInternal && this.timelineDataInternal.selectedGroup) {\n this.timelineDataInternal.selectedGroup.expanded = true;\n }\n }\n\n minimumBoundary(): number {\n return this.#minimumBoundary;\n }\n\n totalTime(): number {\n return this.timeSpan;\n }\n\n search(visibleWindow: Trace.Types.Timing.TraceWindowMicroSeconds, filter?: Trace.Extras.TraceFilter.TraceFilter):\n PerfUI.FlameChart.DataProviderSearchResult[] {\n const results: PerfUI.FlameChart.DataProviderSearchResult[] = [];\n this.timelineData();\n for (let i = 0; i < this.entryData.length; ++i) {\n const entry = this.entryData[i];\n if (!entry) {\n continue;\n }\n\n if (Trace.Types.Events.isLegacyTimelineFrame(entry)) {\n continue;\n }\n\n if (Trace.Types.Events.isScreenshot(entry)) {\n // Screenshots are represented as trace events, but you can't search for them, so skip.\n continue;\n }\n if (!Trace.Helpers.Timing.eventIsInBounds(entry, visibleWindow)) {\n continue;\n }\n if (!filter || filter.accept(entry, this.parsedTrace || undefined)) {\n const startTimeMilli = Trace.Helpers.Timing.microSecondsToMilliseconds(entry.ts);\n results.push({index: i, startTimeMilli, provider: 'main'});\n }\n }\n return results;\n }\n\n getEntryTypeForLevel(level: number): EntryType {\n return this.entryTypeByLevel[level];\n }\n\n /**\n * The frames and screenshots track is special cased because it is rendered\n * differently to the rest of the tracks and not as a series of events. This\n * is why it is not done via the appender system; we track frames &\n * screenshots as a different EntryType to the TrackAppender entries,\n * because then when it comes to drawing we can decorate them differently.\n **/\n #appendFramesAndScreenshotsTrack(): void {\n if (!this.parsedTrace) {\n return;\n }\n const filmStrip = Trace.Extras.FilmStrip.fromParsedTrace(this.parsedTrace);\n const hasScreenshots = filmStrip.frames.length > 0;\n\n this.framesGroupStyle.collapsible = hasScreenshots;\n const expanded = Root.Runtime.Runtime.queryParam('flamechart-force-expand') === 'frames';\n\n this.appendHeader(i18nString(UIStrings.frames), this.framesGroupStyle, false /* selectable */, expanded);\n\n this.entryTypeByLevel[this.currentLevel] = EntryType.FRAME;\n for (const frame of this.parsedTrace.Frames.frames) {\n this.#appendFrame(frame);\n }\n ++this.currentLevel;\n\n if (!hasScreenshots) {\n return;\n }\n this.#appendScreenshots(filmStrip);\n }\n\n #appendScreenshots(filmStrip: Trace.Extras.FilmStrip.Data): void {\n if (!this.timelineDataInternal || !this.parsedTrace) {\n return;\n }\n this.appendHeader('', this.screenshotsGroupStyle, false /* selectable */);\n this.entryTypeByLevel[this.currentLevel] = EntryType.SCREENSHOT;\n let prevTimestamp: Trace.Types.Timing.MilliSeconds|undefined = undefined;\n\n for (const filmStripFrame of filmStrip.frames) {\n const screenshotTimeInMilliSeconds =\n Trace.Helpers.Timing.microSecondsToMilliseconds(filmStripFrame.screenshotEvent.ts);\n this.entryData.push(filmStripFrame.screenshotEvent);\n (this.timelineDataInternal.entryLevels as number[]).push(this.currentLevel);\n (this.timelineDataInternal.entryStartTimes as number[]).push(screenshotTimeInMilliSeconds);\n if (prevTimestamp) {\n (this.timelineDataInternal.entryTotalTimes as number[]).push(screenshotTimeInMilliSeconds - prevTimestamp);\n }\n prevTimestamp = screenshotTimeInMilliSeconds;\n }\n if (filmStrip.frames.length && prevTimestamp !== undefined) {\n const maxRecordTimeMillis = Trace.Helpers.Timing.traceWindowMilliSeconds(this.parsedTrace.Meta.traceBounds).max;\n\n // Set the total time of the final screenshot so it takes up the remainder of the trace.\n (this.timelineDataInternal.entryTotalTimes as number[]).push(maxRecordTimeMillis - prevTimestamp);\n }\n ++this.currentLevel;\n }\n\n #entryTypeForIndex(entryIndex: number): EntryType {\n const level = this.timelineData().entryLevels[entryIndex];\n return this.entryTypeByLevel[level];\n }\n\n preparePopoverElement(entryIndex: number): Element|null {\n let time = '';\n let title;\n let warningElements: Element[] = [];\n let timeElementClassName = 'popoverinfo-time';\n const additionalContent: HTMLElement[] = [];\n\n const entryType = this.#entryTypeForIndex(entryIndex);\n if (entryType === EntryType.TRACK_APPENDER) {\n if (!this.compatibilityTracksAppender) {\n return null;\n }\n const event = (this.entryData[entryIndex] as Trace.Types.Events.Event);\n const timelineData = (this.timelineDataInternal as PerfUI.FlameChart.FlameChartTimelineData);\n const eventLevel = timelineData.entryLevels[entryIndex];\n const popoverInfo = this.compatibilityTracksAppender.popoverInfo(event, eventLevel);\n title = popoverInfo.title;\n time = popoverInfo.formattedTime;\n warningElements = popoverInfo.warningElements || warningElements;\n if (popoverInfo.additionalElements?.length) {\n additionalContent.push(...popoverInfo.additionalElements);\n }\n\n this.dispatchEventToListeners(Events.FLAME_CHART_ITEM_HOVERED, event);\n\n } else if (entryType === EntryType.FRAME) {\n const frame = (this.entryData[entryIndex] as Trace.Types.Events.LegacyTimelineFrame);\n time =\n i18n.TimeUtilities.preciseMillisToString(Trace.Helpers.Timing.microSecondsToMilliseconds(frame.duration), 1);\n\n if (frame.idle) {\n title = i18nString(UIStrings.idleFrame);\n } else if (frame.dropped) {\n title = frame.isPartial ? i18nString(UIStrings.partiallyPresentedFrame) : i18nString(UIStrings.droppedFrame);\n timeElementClassName = 'popoverinfo-warning';\n } else {\n title = i18nString(UIStrings.frame);\n }\n } else {\n this.dispatchEventToListeners(Events.FLAME_CHART_ITEM_HOVERED, null);\n return null;\n }\n\n const popoverElement = document.createElement('div');\n const root = UI.UIUtils.createShadowRootWithCoreStyles(popoverElement, {\n cssFile: [timelineFlamechartPopoverStyles],\n delegatesFocus: undefined,\n });\n const popoverContents = root.createChild('div', 'timeline-flamechart-popover');\n popoverContents.createChild('span', timeElementClassName).textContent = time;\n popoverContents.createChild('span', 'popoverinfo-title').textContent = title;\n for (const warningElement of warningElements) {\n warningElement.classList.add('popoverinfo-warning');\n popoverContents.appendChild(warningElement);\n }\n for (const elem of additionalContent) {\n popoverContents.appendChild(elem);\n }\n return popoverElement;\n }\n\n preparePopoverForCollapsedArrow(entryIndex: number): Element|null {\n const element = document.createElement('div');\n const root = UI.UIUtils.createShadowRootWithCoreStyles(element, {\n cssFile: [timelineFlamechartPopoverStyles],\n delegatesFocus: undefined,\n });\n\n const entry = this.entryData[entryIndex] as Trace.Types.Events.Event;\n const hiddenEntriesAmount =\n ModificationsManager.activeManager()?.getEntriesFilter().findHiddenDescendantsAmount(entry);\n\n if (!hiddenEntriesAmount) {\n return null;\n }\n const contents = root.createChild('div', 'timeline-flamechart-popover');\n contents.createChild('span', 'popoverinfo-title').textContent = hiddenEntriesAmount + ' hidden';\n\n return element;\n }\n\n getDrawOverride(entryIndex: number): DrawOverride|undefined {\n const entryType = this.#entryTypeForIndex(entryIndex);\n if (entryType !== EntryType.TRACK_APPENDER) {\n return;\n }\n\n const timelineData = (this.timelineDataInternal as PerfUI.FlameChart.FlameChartTimelineData);\n const eventLevel = timelineData.entryLevels[entryIndex];\n const event = (this.entryData[entryIndex] as Trace.Types.Events.Event);\n return this.compatibilityTracksAppender?.getDrawOverride(event, eventLevel);\n }\n\n #entryColorForFrame(entryIndex: number): string {\n const frame = (this.entryData[entryIndex] as Trace.Types.Events.LegacyTimelineFrame);\n if (frame.idle) {\n return 'white';\n }\n if (frame.dropped) {\n if (frame.isPartial) {\n // For partially presented frame boxes, paint a yellow background with\n // a sparse white dashed-line pattern overlay.\n return '#f0e442';\n }\n // For dropped frame boxes, paint a red background with a dense white\n // solid-line pattern overlay.\n return '#f08080';\n }\n return '#d7f0d1';\n }\n\n entryColor(entryIndex: number): string {\n const entryType = this.#entryTypeForIndex(entryIndex);\n if (entryType === EntryType.FRAME) {\n return this.#entryColorForFrame(entryIndex);\n }\n if (entryType === EntryType.TRACK_APPENDER) {\n const timelineData = (this.timelineDataInternal as PerfUI.FlameChart.FlameChartTimelineData);\n const eventLevel = timelineData.entryLevels[entryIndex];\n const event = (this.entryData[entryIndex] as Trace.Types.Events.Event);\n return this.compatibilityTracksAppender?.colorForEvent(event, eventLevel) || '';\n }\n return '';\n }\n\n private preparePatternCanvas(): void {\n // Set the candy stripe pattern to 17px so it repeats well.\n const size = 17;\n this.droppedFramePatternCanvas.width = size;\n this.droppedFramePatternCanvas.height = size;\n\n this.partialFramePatternCanvas.width = size;\n this.partialFramePatternCanvas.height = size;\n\n const ctx = this.droppedFramePatternCanvas.getContext('2d');\n if (ctx) {\n // Make a dense solid-line pattern.\n ctx.translate(size * 0.5, size * 0.5);\n ctx.rotate(Math.PI * 0.25);\n ctx.translate(-size * 0.5, -size * 0.5);\n\n ctx.fillStyle = 'rgb(255, 255, 255)';\n for (let x = -size; x < size * 2; x += 3) {\n ctx.fillRect(x, -size, 1, size * 3);\n }\n }\n\n const ctx2 = this.partialFramePatternCanvas.getContext('2d');\n if (ctx2) {\n // Make a sparse dashed-line pattern.\n ctx2.strokeStyle = 'rgb(255, 255, 255)';\n ctx2.lineWidth = 2;\n ctx2.beginPath();\n ctx2.moveTo(17, 0);\n ctx2.lineTo(10, 7);\n ctx2.moveTo(8, 9);\n ctx2.lineTo(2, 15);\n ctx2.stroke();\n }\n }\n\n private drawFrame(\n entryIndex: number, context: CanvasRenderingContext2D, barX: number, barY: number, barWidth: number,\n barHeight: number, transformColor: (color: string) => string): void {\n const hPadding = 1;\n const frame = this.entryData[entryIndex] as Trace.Types.Events.LegacyTimelineFrame;\n barX += hPadding;\n barWidth -= 2 * hPadding;\n context.fillStyle = transformColor(this.entryColor(entryIndex));\n\n if (frame.dropped) {\n if (frame.isPartial) {\n // For partially presented frame boxes, paint a yellow background with\n // a sparse white dashed-line pattern overlay.\n context.fillRect(barX, barY, barWidth, barHeight);\n\n const overlay = context.createPattern(this.partialFramePatternCanvas, 'repeat');\n context.fillStyle = overlay || context.fillStyle;\n } else {\n // For dropped frame boxes, paint a red background with a dense white\n // solid-line pattern overlay.\n context.fillRect(barX, barY, barWidth, barHeight);\n\n const overlay = context.createPattern(this.droppedFramePatternCanvas, 'repeat');\n context.fillStyle = overlay || context.fillStyle;\n }\n }\n context.fillRect(barX, barY, barWidth, barHeight);\n\n const frameDurationText =\n i18n.TimeUtilities.preciseMillisToString(Trace.Helpers.Timing.microSecondsToMilliseconds(frame.duration), 1);\n const textWidth = context.measureText(frameDurationText).width;\n if (textWidth <= barWidth) {\n context.fillStyle = this.textColor(entryIndex);\n context.fillText(frameDurationText, barX + (barWidth - textWidth) / 2, barY + barHeight - 4);\n }\n }\n\n private async drawScreenshot(\n entryIndex: number, context: CanvasRenderingContext2D, barX: number, barY: number, barWidth: number,\n barHeight: number): Promise {\n const screenshot = (this.entryData[entryIndex] as Trace.Types.Events.SyntheticScreenshot);\n const image = Utils.ImageCache.getOrQueue(screenshot);\n if (!image) {\n return;\n }\n const imageX = barX + 1;\n const imageY = barY + 1;\n const imageHeight = barHeight - 2;\n const scale = imageHeight / image.naturalHeight;\n const imageWidth = Math.floor(image.naturalWidth * scale);\n context.save();\n context.beginPath();\n context.rect(barX, barY, barWidth, barHeight);\n context.clip();\n context.drawImage(image, imageX, imageY, imageWidth, imageHeight);\n context.strokeStyle = '#ccc';\n context.strokeRect(imageX - 0.5, imageY - 0.5, Math.min(barWidth - 1, imageWidth + 1), imageHeight);\n context.restore();\n }\n\n decorateEntry(\n entryIndex: number, context: CanvasRenderingContext2D, text: string|null, barX: number, barY: number,\n barWidth: number, barHeight: number, unclippedBarX: number, timeToPixelRatio: number,\n transformColor: (color: string) => string): boolean {\n const entryType = this.#entryTypeForIndex(entryIndex);\n\n if (entryType === EntryType.FRAME) {\n this.drawFrame(entryIndex, context, barX, barY, barWidth, barHeight, transformColor);\n return true;\n }\n\n if (entryType === EntryType.SCREENSHOT) {\n void this.drawScreenshot(entryIndex, context, barX, barY, barWidth, barHeight);\n return true;\n }\n\n if (entryType === EntryType.TRACK_APPENDER) {\n const entry = this.entryData[entryIndex] as Trace.Types.Events.Event;\n if (Trace.Types.Events.isSyntheticInteraction(entry)) {\n this.#drawInteractionEventWithWhiskers(\n context, entryIndex, text, entry, barX, barY, unclippedBarX, barWidth, barHeight, timeToPixelRatio);\n return true;\n }\n }\n\n return false;\n }\n\n /**\n * Draws the left and right whiskers around an interaction in the timeline.\n * @param context - the canvas that will be drawn onto\n * @param entryIndex\n * @param entryTitle - the title of the entry\n * @param entry - the entry itself\n * @param barX - the starting X pixel position of the bar representing this event. This is clipped: if the bar is off the left side of the screen, this value will be 0\n * @param barY - the starting Y pixel position of the bar representing this event.\n * @param unclippedBarXStartPixel - the starting X pixel position of the bar representing this event, not clipped. This means if the bar is off the left of the screen this will be a negative number.\n * @param barWidth - the width of the full bar in pixels\n * @param barHeight - the height of the full bar in pixels\n * @param timeToPixelRatio - the ratio required to convert a millisecond time to a pixel value.\n **/\n #drawInteractionEventWithWhiskers(\n context: CanvasRenderingContext2D, entryIndex: number, entryTitle: string|null,\n entry: Trace.Types.Events.SyntheticInteractionPair, barX: number, barY: number, unclippedBarXStartPixel: number,\n barWidth: number, barHeight: number, timeToPixelRatio: number): void {\n /**\n * An interaction is drawn with whiskers as so:\n * |----------[=======]-------------|\n * => The left whisker is the event's start time (event.ts)\n * => The box start is the event's processingStart time\n * => The box end is the event's processingEnd time\n * => The right whisker is the event's end time (event.ts + event.dur)\n *\n * When we draw the event in the InteractionsAppender, we draw a huge box\n * that spans the entire of the above. So here we need to draw over the\n * rectangle that is outside of {processingStart, processingEnd} and\n * replace it with the whiskers.\n * TODO(crbug.com/1495248): rework how we draw whiskers to avoid this inefficiency\n */\n\n const beginTime = Trace.Helpers.Timing.microSecondsToMilliseconds(entry.ts);\n const entireBarEndXPixel = barX + barWidth;\n\n function timeToPixel(time: Trace.Types.Timing.MicroSeconds): number {\n const timeMilli = Trace.Helpers.Timing.microSecondsToMilliseconds(time);\n return Math.floor(unclippedBarXStartPixel + (timeMilli - beginTime) * timeToPixelRatio);\n }\n\n context.save();\n\n // Clear portions of initial rect to prepare for the ticks.\n context.fillStyle = ThemeSupport.ThemeSupport.instance().getComputedValue('--sys-color-cdt-base-container');\n let desiredBoxStartX = timeToPixel(entry.processingStart);\n const desiredBoxEndX = timeToPixel(entry.processingEnd);\n\n // If the entry has no processing duration, ensure the box is 1px wide so at least it is visible.\n if (entry.processingEnd - entry.processingStart === 0) {\n desiredBoxStartX -= 1;\n }\n\n context.fillRect(barX, barY - 0.5, desiredBoxStartX - barX, barHeight);\n context.fillRect(desiredBoxEndX, barY - 0.5, entireBarEndXPixel - desiredBoxEndX, barHeight);\n\n // Draws left and right whiskers\n function drawTick(begin: number, end: number, y: number): void {\n const tickHeightPx = 6;\n context.moveTo(begin, y - tickHeightPx / 2);\n context.lineTo(begin, y + tickHeightPx / 2);\n context.moveTo(begin, y);\n context.lineTo(end, y);\n }\n\n // The left whisker starts at the enty timestamp, and continues until the start of the box (processingStart).\n const leftWhiskerX = timeToPixel(entry.ts);\n // The right whisker ends at (entry.ts + entry.dur). We draw the line from the end of the box (processingEnd).\n const rightWhiskerX = timeToPixel(Trace.Types.Timing.MicroSeconds(entry.ts + entry.dur));\n context.beginPath();\n context.lineWidth = 1;\n context.strokeStyle = '#ccc';\n const lineY = Math.floor(barY + barHeight / 2) + 0.5;\n const leftTick = leftWhiskerX + 0.5;\n const rightTick = rightWhiskerX - 0.5;\n drawTick(leftTick, desiredBoxStartX, lineY);\n drawTick(rightTick, desiredBoxEndX, lineY);\n context.stroke();\n\n if (entryTitle) {\n // BarX will be set to 0 if the start of the box if off the screen to the\n // left. If this happens, the desiredBoxStartX will be negative. In that\n // case, we fallback to the BarX. This ensures that even if the box\n // starts off-screen, we draw the text at the first visible on screen\n // pixels, so the user can still see the event's title.\n const textStartX = desiredBoxStartX > 0 ? desiredBoxStartX : barX;\n context.font = this.#font;\n const textWidth = UI.UIUtils.measureTextWidth(context, entryTitle);\n\n // These numbers are duplicated from FlameChart.ts.\n const textPadding = 5;\n const textBaseline = 5;\n\n // Only draw the text if it can fit in the amount of box that is visible.\n if (textWidth <= desiredBoxEndX - textStartX + textPadding) {\n context.fillStyle = this.textColor(entryIndex);\n context.fillText(entryTitle, textStartX + textPadding, barY + barHeight - textBaseline);\n }\n }\n context.restore();\n }\n\n forceDecoration(entryIndex: number): boolean {\n const entryType = this.#entryTypeForIndex(entryIndex);\n if (entryType === EntryType.FRAME) {\n return true;\n }\n if (entryType === EntryType.SCREENSHOT) {\n return true;\n }\n const event = (this.entryData[entryIndex] as Trace.Types.Events.Event);\n\n if (Trace.Types.Events.isSyntheticInteraction(event)) {\n // We draw interactions with whiskers, which are done via the\n // decorateEntry() method, hence we always want to force these to be\n // decorated.\n return true;\n }\n return Boolean(this.parsedTrace?.Warnings.perEvent.get(event));\n }\n\n private appendHeader(title: string, style: PerfUI.FlameChart.GroupStyle, selectable: boolean, expanded?: boolean):\n PerfUI.FlameChart.Group {\n const group =\n ({startLevel: this.currentLevel, name: title, style, selectable, expanded} as PerfUI.FlameChart.Group);\n (this.timelineDataInternal as PerfUI.FlameChart.FlameChartTimelineData).groups.push(group);\n return group;\n }\n\n #appendFrame(frame: Trace.Types.Events.LegacyTimelineFrame): void {\n const index = this.entryData.length;\n this.entryData.push(frame);\n const durationMilliseconds = Trace.Helpers.Timing.microSecondsToMilliseconds(frame.duration);\n this.entryIndexToTitle[index] = i18n.TimeUtilities.millisToString(durationMilliseconds, true);\n if (!this.timelineDataInternal) {\n return;\n }\n this.timelineDataInternal.entryLevels[index] = this.currentLevel;\n this.timelineDataInternal.entryTotalTimes[index] = durationMilliseconds;\n this.timelineDataInternal.entryStartTimes[index] = Trace.Helpers.Timing.microSecondsToMilliseconds(frame.startTime);\n }\n\n createSelection(entryIndex: number): TimelineSelection|null {\n const entry = this.entryData[entryIndex];\n const timelineSelection: TimelineSelection|null = entry ? selectionFromEvent(entry) : null;\n if (timelineSelection) {\n this.lastSelection = new Selection(timelineSelection, entryIndex);\n }\n return timelineSelection;\n }\n\n formatValue(value: number, precision?: number): string {\n return i18n.TimeUtilities.preciseMillisToString(value, precision);\n }\n\n groupForEvent(entryIndex: number): PerfUI.FlameChart.Group|null {\n if (!this.compatibilityTracksAppender) {\n return null;\n }\n const level = this.timelineDataInternal?.entryLevels[entryIndex] ?? null;\n if (level === null) {\n return null;\n }\n const groupForLevel = this.compatibilityTracksAppender.groupForLevel(level);\n if (!groupForLevel) {\n return null;\n }\n return groupForLevel;\n }\n\n canJumpToEntry(_entryIndex: number): boolean {\n return false;\n }\n\n entryIndexForSelection(selection: TimelineSelection|null): number {\n if (!selection || selectionIsRange(selection) || Trace.Types.Events.isNetworkTrackEntry(selection.event)) {\n return -1;\n }\n\n if (this.lastSelection && selectionsEqual(this.lastSelection.timelineSelection, selection)) {\n return this.lastSelection.entryIndex;\n }\n\n const index = this.entryData.indexOf(selection.event);\n // If the index is -1 and the selection is a TraceEvent, it might be\n // the case that this Entry is hidden by the Context Menu action.\n // Try revealing the entry and getting the index again.\n if (index > -1) {\n if (this.timelineDataInternal?.selectedGroup) {\n ModificationsManager.activeManager()?.getEntriesFilter().revealEntry(selection.event);\n this.timelineData(true);\n }\n }\n\n if (index !== -1) {\n this.lastSelection = new Selection(selection, index);\n }\n return index;\n }\n\n /**\n * Return the index for the given entry. Note that this method assumes that\n * timelineData() has been generated. If it hasn't, this method will return\n * null.\n */\n indexForEvent(targetEvent: Trace.Types.Events.Event): number|null {\n // Gets the index for the given event by walking through the array of entryData.\n // This may seem inefficient - but we have seen that by building up large\n // maps keyed by trace events that this has a significant impact on the\n // performance of the panel.\n // Therefore, we strike a middle ground: look up the event the first time,\n // but then cache the result.\n const fromCache = this.#eventIndexByEvent.get(targetEvent);\n if (typeof fromCache === 'number') {\n return fromCache;\n }\n const index = this.entryData.indexOf(targetEvent);\n const result = index > -1 ? index : null;\n this.#eventIndexByEvent.set(targetEvent, result);\n return result;\n }\n\n /**\n * Build the data for initiators and initiated entries.\n * @param entryIndex\n * @returns if we should re-render the flame chart (canvas)\n */\n buildFlowForInitiator(entryIndex: number): boolean {\n if (!this.parsedTrace) {\n return false;\n }\n if (!this.timelineDataInternal) {\n return false;\n }\n if (this.lastInitiatorEntry === entryIndex) {\n if (this.lastInitiatorsData) {\n this.timelineDataInternal.initiatorsData = this.lastInitiatorsData;\n }\n return false;\n }\n if (!this.compatibilityTracksAppender) {\n return false;\n }\n\n // Remove all previously assigned decorations indicating that the flow event entries are hidden\n const previousInitiatorsDataLength = this.timelineDataInternal.initiatorsData.length;\n // |entryIndex| equals -1 means there is no entry selected, just clear the\n // initiator cache if there is any previous arrow and return true to\n // re-render.\n if (entryIndex === -1) {\n this.lastInitiatorEntry = entryIndex;\n if (previousInitiatorsDataLength === 0) {\n // This means there is no arrow before, so we don't need to re-render.\n return false;\n }\n // Reset to clear any previous arrows from the last event.\n this.timelineDataInternal.resetFlowData();\n return true;\n }\n\n const entryType = this.#entryTypeForIndex(entryIndex);\n if (entryType !== EntryType.TRACK_APPENDER) {\n return false;\n }\n const event = this.entryData[entryIndex] as Trace.Types.Events.Event;\n // Reset to clear any previous arrows from the last event.\n this.timelineDataInternal.resetFlowData();\n this.lastInitiatorEntry = entryIndex;\n\n const hiddenEvents: Trace.Types.Events.Event[] =\n ModificationsManager.activeManager()?.getEntriesFilter().invisibleEntries() ?? [];\n const expandableEntries: Trace.Types.Events.Event[] =\n ModificationsManager.activeManager()?.getEntriesFilter().expandableEntries() ?? [];\n\n const initiatorsData = initiatorsDataToDraw(\n this.parsedTrace,\n event,\n hiddenEvents,\n expandableEntries,\n );\n // This means there is no change for arrows.\n if (previousInitiatorsDataLength === 0 && initiatorsData.length === 0) {\n return false;\n }\n for (const initiatorData of initiatorsData) {\n const eventIndex = this.indexForEvent(initiatorData.event);\n const initiatorIndex = this.indexForEvent(initiatorData.initiator);\n if (eventIndex === null || initiatorIndex === null) {\n continue;\n }\n this.timelineDataInternal.initiatorsData.push({\n initiatorIndex,\n eventIndex,\n isInitiatorHidden: initiatorData.isInitiatorHidden,\n isEntryHidden: initiatorData.isEntryHidden,\n });\n }\n this.lastInitiatorsData = this.timelineDataInternal.initiatorsData;\n return true;\n }\n\n eventByIndex(entryIndex: number): Trace.Types.Events.Event|null {\n if (entryIndex < 0) {\n return null;\n }\n const entryType = this.#entryTypeForIndex(entryIndex);\n if (entryType === EntryType.TRACK_APPENDER) {\n return this.entryData[entryIndex] as Trace.Types.Events.Event;\n }\n if (entryType === EntryType.FRAME) {\n return this.entryData[entryIndex] as Trace.Types.Events.LegacyTimelineFrame;\n }\n return null;\n }\n}\n\nexport const InstantEventVisibleDurationMs = Trace.Types.Timing.MilliSeconds(0.001);\n\nexport const enum Events {\n DATA_CHANGED = 'DataChanged',\n FLAME_CHART_ITEM_HOVERED = 'FlameChartItemHovered',\n}\n\nexport type EventTypes = {\n [Events.DATA_CHANGED]: void,\n [Events.FLAME_CHART_ITEM_HOVERED]: Trace.Types.Events.Event|null,\n};\n\n// an entry is a trace event, they are classified into \"entry types\"\n// because some events are rendered differently. For example, screenshot\n// events are rendered as images. Checks for entry types allow to have\n// different styles, names, etc. for events that look differently.\n// In the future we won't have this checks: instead we will forward\n// the event to the corresponding \"track appender\" and it will determine\n// how the event shall be rendered.\nexport const enum EntryType {\n FRAME = 'Frame',\n TRACK_APPENDER = 'TrackAppender',\n SCREENSHOT = 'Screenshot',\n}\n"]} \ No newline at end of file +{"version":3,"file":"TimelineFlameChartDataProvider.js","sourceRoot":"","sources":["../../../../../../front_end/panels/timeline/TimelineFlameChartDataProvider.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,OAAO,KAAK,MAAM,MAAM,6BAA6B,CAAC;AACtD,OAAO,KAAK,IAAI,MAAM,yBAAyB,CAAC;AAChD,OAAO,KAAK,IAAI,MAAM,yBAAyB,CAAC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AA6B,CAAC;QAChE,CAAC;QACD,IAAI,SAAS,kCAAoB,EAAE,CAAC;YAClC,OAAO,IAAI,CAAC,SAAS,CAAC,UAAU,CAA2C,CAAC;QAC9E,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;CACF;AAED,MAAM,CAAC,MAAM,6BAA6B,GAAG,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC","sourcesContent":["/*\n * Copyright (C) 2014 Google Inc. All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are\n * met:\n *\n * * Redistributions of source code must retain the above copyright\n * notice, this list of conditions and the following disclaimer.\n * * Redistributions in binary form must reproduce the above\n * copyright notice, this list of conditions and the following disclaimer\n * in the documentation and/or other materials provided with the\n * distribution.\n * * Neither the name of Google Inc. nor the names of its\n * contributors may be used to endorse or promote products derived from\n * this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nimport * as Common from '../../core/common/common.js';\nimport * as i18n from '../../core/i18n/i18n.js';\nimport * as Root from '../../core/root/root.js';\nimport * as Bindings from '../../models/bindings/bindings.js';\nimport * as Trace from '../../models/trace/trace.js';\nimport * as PerfUI from '../../ui/legacy/components/perf_ui/perf_ui.js';\nimport * as UI from '../../ui/legacy/legacy.js';\nimport * as ThemeSupport from '../../ui/legacy/theme_support/theme_support.js';\n\nimport {CompatibilityTracksAppender, type DrawOverride, type TrackAppenderName} from './CompatibilityTracksAppender.js';\nimport {initiatorsDataToDraw} from './Initiators.js';\nimport {ModificationsManager} from './ModificationsManager.js';\nimport {ThreadAppender} from './ThreadAppender.js';\nimport timelineFlamechartPopoverStyles from './timelineFlamechartPopover.css.js';\nimport {FlameChartStyle, Selection} from './TimelineFlameChartView.js';\nimport {\n selectionFromEvent,\n selectionIsRange,\n selectionsEqual,\n type TimelineSelection,\n} from './TimelineSelection.js';\nimport * as Utils from './utils/utils.js';\n\nconst UIStrings = {\n /**\n *@description Text for rendering frames\n */\n frames: 'Frames',\n /**\n *@description Text in Timeline Flame Chart Data Provider of the Performance panel\n */\n idleFrame: 'Idle frame',\n /**\n *@description Text in Timeline Frame Chart Data Provider of the Performance panel\n */\n droppedFrame: 'Dropped frame',\n /**\n *@description Text in Timeline Frame Chart Data Provider of the Performance panel\n */\n partiallyPresentedFrame: 'Partially-presented frame',\n /**\n *@description Text for a rendering frame\n */\n frame: 'Frame',\n /**\n *@description Text for Hiding a function from the Flame Chart\n */\n hideFunction: 'Hide function',\n /**\n *@description Text for Hiding all children of a function from the Flame Chart\n */\n hideChildren: 'Hide children',\n /**\n *@description Text for Hiding all child entries that are identical to the selected entry from the Flame Chart\n */\n hideRepeatingChildren: 'Hide repeating children',\n /**\n *@description Text for remove script from ignore list from the Flame Chart\n */\n removeScriptFromIgnoreList: 'Remove script from ignore list',\n /**\n *@description Text for add script to ignore list from the Flame Chart\n */\n addScriptToIgnoreList: 'Add script to ignore list',\n /**\n *@description Text for an action that shows all of the hidden children of an entry\n */\n resetChildren: 'Reset children',\n /**\n *@description Text for an action that shows all of the hidden entries of the Flame Chart\n */\n resetTrace: 'Reset trace',\n};\nconst str_ = i18n.i18n.registerUIStrings('panels/timeline/TimelineFlameChartDataProvider.ts', UIStrings);\nconst i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);\n\nexport class TimelineFlameChartDataProvider extends Common.ObjectWrapper.ObjectWrapper implements\n PerfUI.FlameChart.FlameChartDataProvider {\n private droppedFramePatternCanvas: HTMLCanvasElement;\n private partialFramePatternCanvas: HTMLCanvasElement;\n private timelineDataInternal: PerfUI.FlameChart.FlameChartTimelineData|null = null;\n private currentLevel = 0;\n\n private compatibilityTracksAppender: CompatibilityTracksAppender|null = null;\n private parsedTrace: Trace.Handlers.Types.ParsedTrace|null = null;\n private isCpuProfile = false;\n\n #minimumBoundary: number = 0;\n private timeSpan: number = 0;\n private readonly framesGroupStyle: PerfUI.FlameChart.GroupStyle;\n private readonly screenshotsGroupStyle: PerfUI.FlameChart.GroupStyle;\n\n // Contains all the entries that are DRAWN onto the track. Entries that have\n // been hidden - either by a user action, or because they aren't visible at\n // all - will not appear in this array and it will change per-render. For\n // example, if a user collapses an icicle in the flamechart, those entries\n // that are now hidden will no longer be in this array.\n // This also includes entrys that used to be special cased (e.g.\n // TimelineFrames) that are now of type Types.Events.Event and so the old\n // `TimelineFlameChartEntry` type has been removed in faovur of using\n // Trace.Types.Events.Event directly. See crrev.com/c/5973695 for details.\n private entryData: Trace.Types.Events.Event[] = [];\n\n private entryTypeByLevel: EntryType[] = [];\n private entryIndexToTitle: string[] = [];\n private lastInitiatorEntry: number = -1;\n private lastInitiatorsData: PerfUI.FlameChart.FlameChartInitiatorData[] = [];\n\n private lastSelection: Selection|null = null;\n readonly #font = `${PerfUI.Font.DEFAULT_FONT_SIZE} ${PerfUI.Font.getFontFamilyForCanvas()}`;\n #eventIndexByEvent: WeakMap = new WeakMap();\n\n constructor() {\n super();\n this.reset();\n\n this.droppedFramePatternCanvas = document.createElement('canvas');\n this.partialFramePatternCanvas = document.createElement('canvas');\n this.preparePatternCanvas();\n\n this.framesGroupStyle = this.buildGroupStyle({useFirstLineForOverview: true});\n this.screenshotsGroupStyle =\n this.buildGroupStyle({useFirstLineForOverview: true, nestingLevel: 1, collapsible: false, itemsHeight: 150});\n\n ThemeSupport.ThemeSupport.instance().addEventListener(ThemeSupport.ThemeChangeEvent.eventName, () => {\n const headers = [\n this.framesGroupStyle,\n this.screenshotsGroupStyle,\n ];\n for (const header of headers) {\n header.color = ThemeSupport.ThemeSupport.instance().getComputedValue('--sys-color-on-surface');\n header.backgroundColor =\n ThemeSupport.ThemeSupport.instance().getComputedValue('--sys-color-cdt-base-container');\n }\n });\n Utils.ImageCache.emitter.addEventListener(\n 'screenshot-loaded', () => this.dispatchEventToListeners(Events.DATA_CHANGED));\n\n Common.Settings.Settings.instance()\n .moduleSetting('skip-stack-frames-pattern')\n .addChangeListener(this.#onIgnoreListChanged.bind(this));\n Common.Settings.Settings.instance()\n .moduleSetting('skip-content-scripts')\n .addChangeListener(this.#onIgnoreListChanged.bind(this));\n Common.Settings.Settings.instance()\n .moduleSetting('automatically-ignore-list-known-third-party-scripts')\n .addChangeListener(this.#onIgnoreListChanged.bind(this));\n Common.Settings.Settings.instance()\n .moduleSetting('enable-ignore-listing')\n .addChangeListener(this.#onIgnoreListChanged.bind(this));\n Common.Settings.Settings.instance()\n .moduleSetting('skip-anonymous-scripts')\n .addChangeListener(this.#onIgnoreListChanged.bind(this));\n }\n\n hasTrackConfigurationMode(): boolean {\n return true;\n }\n\n getPossibleActions(entryIndex: number, groupIndex: number): PerfUI.FlameChart.PossibleFilterActions|void {\n const data = this.timelineData();\n if (!data) {\n return;\n }\n const group = data.groups.at(groupIndex);\n // Early exit here if there is no group or:\n // 1. The group is not expanded: it needs to be expanded to allow the\n // context menu actions to occur.\n // 2. The group does not have the showStackContextMenu flag which indicates\n // that it does not show entries that support the stack actions.\n if (!group || !group.expanded || !group.showStackContextMenu) {\n return;\n }\n\n // Check which actions are possible on an entry.\n // If an action would not change the entries (for example it has no children to collapse), we do not need to show it.\n return this.findPossibleContextMenuActions(entryIndex);\n }\n\n customizedContextMenu(event: MouseEvent, entryIndex: number, groupIndex: number): UI.ContextMenu.ContextMenu\n |undefined {\n const possibleActions = this.getPossibleActions(entryIndex, groupIndex);\n if (!possibleActions) {\n return;\n }\n\n const contextMenu = new UI.ContextMenu.ContextMenu(event);\n\n // This action and its 'execute' is defined in `freestyler-meta`\n const actionIdDrJ = 'drjones.performance-panel-context';\n if (UI.ActionRegistry.ActionRegistry.instance().hasAction(actionIdDrJ)) {\n const action = UI.ActionRegistry.ActionRegistry.instance().getAction(actionIdDrJ);\n contextMenu.headerSection().appendItem(action.title(), () => {\n const event = this.eventByIndex(entryIndex);\n if (!event || !this.parsedTrace) {\n return;\n }\n const allEvents = Array.from(this.entryData.values());\n const aiCallTree = Utils.AICallTree.AICallTree.from(event, allEvents, this.parsedTrace);\n\n // The other side of setFlavor is handleTraceEntryNodeFlavorChange() in FreestylerPanel\n UI.Context.Context.instance().setFlavor(Utils.AICallTree.AICallTree, aiCallTree);\n return action.execute();\n }, {jslogContext: actionIdDrJ});\n }\n\n const hideEntryOption = contextMenu.defaultSection().appendItem(i18nString(UIStrings.hideFunction), () => {\n this.modifyTree(PerfUI.FlameChart.FilterAction.MERGE_FUNCTION, entryIndex);\n }, {\n disabled: !possibleActions?.[PerfUI.FlameChart.FilterAction.MERGE_FUNCTION],\n jslogContext: 'hide-function',\n });\n hideEntryOption.setAccelerator(UI.KeyboardShortcut.Keys.H, [UI.KeyboardShortcut.Modifiers.None]);\n hideEntryOption.setIsDevToolsPerformanceMenuItem(true);\n\n const hideChildrenOption = contextMenu.defaultSection().appendItem(i18nString(UIStrings.hideChildren), () => {\n this.modifyTree(PerfUI.FlameChart.FilterAction.COLLAPSE_FUNCTION, entryIndex);\n }, {\n disabled: !possibleActions?.[PerfUI.FlameChart.FilterAction.COLLAPSE_FUNCTION],\n jslogContext: 'hide-children',\n });\n hideChildrenOption.setAccelerator(UI.KeyboardShortcut.Keys.C, [UI.KeyboardShortcut.Modifiers.None]);\n hideChildrenOption.setIsDevToolsPerformanceMenuItem(true);\n\n const hideRepeatingChildrenOption =\n contextMenu.defaultSection().appendItem(i18nString(UIStrings.hideRepeatingChildren), () => {\n this.modifyTree(PerfUI.FlameChart.FilterAction.COLLAPSE_REPEATING_DESCENDANTS, entryIndex);\n }, {\n disabled: !possibleActions?.[PerfUI.FlameChart.FilterAction.COLLAPSE_REPEATING_DESCENDANTS],\n jslogContext: 'hide-repeating-children',\n });\n hideRepeatingChildrenOption.setAccelerator(UI.KeyboardShortcut.Keys.R, [UI.KeyboardShortcut.Modifiers.None]);\n hideRepeatingChildrenOption.setIsDevToolsPerformanceMenuItem(true);\n\n const resetChildrenOption = contextMenu.defaultSection().appendItem(i18nString(UIStrings.resetChildren), () => {\n this.modifyTree(PerfUI.FlameChart.FilterAction.RESET_CHILDREN, entryIndex);\n }, {\n disabled: !possibleActions?.[PerfUI.FlameChart.FilterAction.RESET_CHILDREN],\n jslogContext: 'reset-children',\n });\n resetChildrenOption.setAccelerator(UI.KeyboardShortcut.Keys.U, [UI.KeyboardShortcut.Modifiers.None]);\n resetChildrenOption.setIsDevToolsPerformanceMenuItem(true);\n\n contextMenu.defaultSection().appendItem(i18nString(UIStrings.resetTrace), () => {\n this.modifyTree(PerfUI.FlameChart.FilterAction.UNDO_ALL_ACTIONS, entryIndex);\n }, {\n disabled: !possibleActions?.[PerfUI.FlameChart.FilterAction.UNDO_ALL_ACTIONS],\n jslogContext: 'reset-trace',\n });\n\n const entry = this.eventByIndex(entryIndex);\n if (!entry || !this.parsedTrace || Trace.Types.Events.isLegacyTimelineFrame(entry)) {\n return contextMenu;\n }\n const url = Utils.SourceMapsResolver.SourceMapsResolver.resolvedURLForEntry(this.parsedTrace, entry);\n if (!url) {\n return contextMenu;\n }\n if (Utils.IgnoreList.isIgnoreListedEntry(entry)) {\n contextMenu.defaultSection().appendItem(i18nString(UIStrings.removeScriptFromIgnoreList), () => {\n Bindings.IgnoreListManager.IgnoreListManager.instance().unIgnoreListURL(url);\n this.#onIgnoreListChanged();\n }, {\n jslogContext: 'remove-from-ignore-list',\n });\n } else {\n contextMenu.defaultSection().appendItem(i18nString(UIStrings.addScriptToIgnoreList), () => {\n Bindings.IgnoreListManager.IgnoreListManager.instance().ignoreListURL(url);\n this.#onIgnoreListChanged();\n }, {\n jslogContext: 'add-to-ignore-list',\n });\n }\n\n return contextMenu;\n }\n\n #onIgnoreListChanged(): void {\n this.timelineData(/* rebuild= */ true);\n this.dispatchEventToListeners(Events.DATA_CHANGED);\n }\n\n entryHasAnnotations(entryIndex: number): boolean {\n const event = this.eventByIndex(entryIndex);\n if (!event) {\n return false;\n }\n const annotations = ModificationsManager.activeManager()?.annotationsForEntry(event);\n return annotations ? annotations.length > 0 : false;\n }\n\n deleteAnnotationsForEntry(entryIndex: number): void {\n const event = this.eventByIndex(entryIndex);\n if (!event) {\n return;\n }\n ModificationsManager.activeManager()?.deleteEntryAnnotations(event);\n }\n\n modifyTree(action: PerfUI.FlameChart.FilterAction, entryIndex: number): void {\n const entry = this.entryData[entryIndex] as Trace.Types.Events.Event;\n\n ModificationsManager.activeManager()?.getEntriesFilter().applyFilterAction({type: action, entry});\n this.timelineData(true);\n this.buildFlowForInitiator(entryIndex);\n this.dispatchEventToListeners(Events.DATA_CHANGED);\n }\n\n findPossibleContextMenuActions(entryIndex: number): PerfUI.FlameChart.PossibleFilterActions|void {\n const entry = this.entryData[entryIndex] as Trace.Types.Events.Event;\n return ModificationsManager.activeManager()?.getEntriesFilter().findPossibleActions(entry);\n }\n\n handleFlameChartTransformKeyboardEvent(event: KeyboardEvent, entryIndex: number, groupIndex: number): void {\n const possibleActions = this.getPossibleActions(entryIndex, groupIndex);\n if (!possibleActions) {\n return;\n }\n\n let handled = false;\n\n if (event.code === 'KeyH' && possibleActions[PerfUI.FlameChart.FilterAction.MERGE_FUNCTION]) {\n this.modifyTree(PerfUI.FlameChart.FilterAction.MERGE_FUNCTION, entryIndex);\n handled = true;\n } else if (event.code === 'KeyC' && possibleActions[PerfUI.FlameChart.FilterAction.COLLAPSE_FUNCTION]) {\n this.modifyTree(PerfUI.FlameChart.FilterAction.COLLAPSE_FUNCTION, entryIndex);\n handled = true;\n } else if (\n event.code === 'KeyR' && possibleActions[PerfUI.FlameChart.FilterAction.COLLAPSE_REPEATING_DESCENDANTS]) {\n this.modifyTree(PerfUI.FlameChart.FilterAction.COLLAPSE_REPEATING_DESCENDANTS, entryIndex);\n handled = true;\n } else if (event.code === 'KeyU') {\n this.modifyTree(PerfUI.FlameChart.FilterAction.RESET_CHILDREN, entryIndex);\n handled = true;\n }\n\n if (handled) {\n event.consume(true);\n }\n }\n\n private buildGroupStyle(extra: Object): PerfUI.FlameChart.GroupStyle {\n const defaultGroupStyle = {\n padding: 4,\n height: 17,\n collapsible: true,\n color: ThemeSupport.ThemeSupport.instance().getComputedValue('--sys-color-on-surface'),\n backgroundColor: ThemeSupport.ThemeSupport.instance().getComputedValue('--sys-color-cdt-base-container'),\n nestingLevel: 0,\n shareHeaderLine: true,\n };\n return Object.assign(defaultGroupStyle, extra);\n }\n\n setModel(parsedTrace: Trace.Handlers.Types.ParsedTrace, isCpuProfile = false): void {\n this.reset();\n this.parsedTrace = parsedTrace;\n this.isCpuProfile = isCpuProfile;\n const {traceBounds} = parsedTrace.Meta;\n const minTime = Trace.Helpers.Timing.microSecondsToMilliseconds(traceBounds.min);\n const maxTime = Trace.Helpers.Timing.microSecondsToMilliseconds(traceBounds.max);\n this.#minimumBoundary = minTime;\n this.timeSpan = minTime === maxTime ? 1000 : maxTime - this.#minimumBoundary;\n }\n\n /**\n * Instances and caches a CompatibilityTracksAppender using the\n * internal flame chart data and the trace parsed data coming from the\n * trace engine.\n * The model data must have been set to the data provider instance before\n * attempting to instance the CompatibilityTracksAppender.\n */\n compatibilityTracksAppenderInstance(forceNew = false): CompatibilityTracksAppender {\n if (!this.compatibilityTracksAppender || forceNew) {\n if (!this.parsedTrace) {\n throw new Error(\n 'Attempted to instantiate a CompatibilityTracksAppender without having set the trace parse data first.');\n }\n this.timelineDataInternal = this.#instantiateTimelineData();\n this.compatibilityTracksAppender = new CompatibilityTracksAppender(\n this.timelineDataInternal, this.parsedTrace, this.entryData, this.entryTypeByLevel);\n }\n return this.compatibilityTracksAppender;\n }\n\n /**\n * Returns the instance of the timeline flame chart data, without\n * adding data to it. In case the timeline data hasn't been instanced\n * creates a new instance and returns it.\n */\n #instantiateTimelineData(): PerfUI.FlameChart.FlameChartTimelineData {\n if (!this.timelineDataInternal) {\n this.timelineDataInternal = PerfUI.FlameChart.FlameChartTimelineData.createEmpty();\n }\n return this.timelineDataInternal;\n }\n\n /**\n * Builds the flame chart data using the track appenders\n */\n buildFromTrackAppendersForTest(options?: {filterThreadsByName?: string, expandedTracks?: Set}):\n void {\n if (!this.compatibilityTracksAppender) {\n return;\n }\n const appenders = this.compatibilityTracksAppender.allVisibleTrackAppenders();\n for (const appender of appenders) {\n const skipThreadAppenderByName =\n appender instanceof ThreadAppender && !appender.trackName().includes(options?.filterThreadsByName || '');\n if (skipThreadAppenderByName) {\n continue;\n }\n const expanded = Boolean(options?.expandedTracks?.has(appender.appenderName));\n this.currentLevel = appender.appendTrackAtLevel(this.currentLevel, expanded);\n }\n }\n\n groupTreeEvents(group: PerfUI.FlameChart.Group): Trace.Types.Events.Event[]|null {\n return this.compatibilityTracksAppender?.groupEventsForTreeView(group) ?? null;\n }\n\n mainFrameNavigationStartEvents(): readonly Trace.Types.Events.NavigationStart[] {\n if (!this.parsedTrace) {\n return [];\n }\n return this.parsedTrace.Meta.mainFrameNavigations;\n }\n\n entryTitle(entryIndex: number): string|null {\n const entryType = this.#entryTypeForIndex(entryIndex);\n if (entryType === EntryType.SCREENSHOT) {\n return '';\n }\n if (entryType === EntryType.TRACK_APPENDER) {\n const timelineData = (this.timelineDataInternal as PerfUI.FlameChart.FlameChartTimelineData);\n const eventLevel = timelineData.entryLevels[entryIndex];\n const event = (this.entryData[entryIndex] as Trace.Types.Events.Event);\n return this.compatibilityTracksAppender?.titleForEvent(event, eventLevel) || null;\n }\n let title: Common.UIString.LocalizedString|string = this.entryIndexToTitle[entryIndex];\n if (!title) {\n title = `Unexpected entryIndex ${entryIndex}`;\n console.error(title);\n }\n return title;\n }\n\n textColor(index: number): string {\n const event = this.entryData[index];\n return Utils.IgnoreList.isIgnoreListedEntry(event) ? '#888' : FlameChartStyle.textColor;\n }\n\n entryFont(_index: number): string|null {\n return this.#font;\n }\n\n // Clear the cache and rebuild the timeline data\n // This should be called when the trace file is the same but we want to rebuild the timeline date.\n // Some possible example: when we hide/unhide an event, or the ignore list is changed etc.\n clearTimelineDataCache(): void {\n this.currentLevel = 0;\n this.entryData = [];\n this.entryTypeByLevel = [];\n this.entryIndexToTitle = [];\n this.#eventIndexByEvent = new Map();\n\n if (this.timelineDataInternal) {\n this.compatibilityTracksAppender?.setFlameChartDataAndEntryData(\n this.timelineDataInternal, this.entryData, this.entryTypeByLevel);\n this.compatibilityTracksAppender?.threadAppenders().forEach(\n threadAppender => threadAppender.setHeaderAppended(false));\n }\n }\n\n // Reset all data other than the UI elements.\n // This should be called when\n // - initialized the data provider\n // - a new trace file is coming (when `setModel()` is called)\n // etc.\n reset(): void {\n this.currentLevel = 0;\n this.entryData = [];\n this.entryTypeByLevel = [];\n this.entryIndexToTitle = [];\n this.#eventIndexByEvent = new Map();\n this.#minimumBoundary = 0;\n this.timeSpan = 0;\n\n this.compatibilityTracksAppender?.reset();\n this.compatibilityTracksAppender = null;\n this.timelineDataInternal = null;\n this.parsedTrace = null;\n }\n\n maxStackDepth(): number {\n return this.currentLevel;\n }\n\n /**\n * Builds the flame chart data using the tracks appender (which use\n * the new trace engine). The result built data is cached and returned.\n */\n timelineData(rebuild: boolean = false): PerfUI.FlameChart.FlameChartTimelineData {\n if (!rebuild && this.timelineDataInternal && this.timelineDataInternal.entryLevels.length !== 0) {\n // If the flame chart data is built already and we don't want to rebuild, we can return the cached data.\n // |entryLevels.length| is used to check if the cached data is not empty (correctly built),\n return this.timelineDataInternal;\n }\n\n this.timelineDataInternal = PerfUI.FlameChart.FlameChartTimelineData.createEmpty();\n\n if (rebuild) {\n // This function will interact with the |compatibilityTracksAppender|, which needs the reference of\n // |timelineDataInternal|, so make sure this is called after the correct |timelineDataInternal|.\n this.clearTimelineDataCache();\n }\n\n this.currentLevel = 0;\n\n if (this.parsedTrace) {\n this.compatibilityTracksAppender = this.compatibilityTracksAppenderInstance();\n if (this.parsedTrace.Meta.traceIsGeneric) {\n this.#processGenericTrace();\n } else {\n this.#processInspectorTrace();\n }\n }\n return this.timelineDataInternal;\n }\n\n /**\n * Register the groups (aka tracks) with the VisualElements framework so\n * later on we can log when an entry inside this group is selected.\n */\n #processGenericTrace(): void {\n if (!this.compatibilityTracksAppender) {\n return;\n }\n\n const appendersByProcess = this.compatibilityTracksAppender.allThreadAppendersByProcess();\n\n for (const [pid, threadAppenders] of appendersByProcess) {\n const processGroupStyle = this.buildGroupStyle({shareHeaderLine: false});\n const processName = this.parsedTrace?.Meta.processNames.get(pid)?.args.name || 'Process';\n this.appendHeader(`${processName} (${pid})`, processGroupStyle, true, false);\n for (const appender of threadAppenders) {\n appender.setHeaderNestingLevel(1);\n this.currentLevel = appender.appendTrackAtLevel(this.currentLevel);\n }\n }\n }\n\n #processInspectorTrace(): void {\n if (!this.isCpuProfile) {\n // CPU Profiles do not have frames and screenshots.\n this.#appendFramesAndScreenshotsTrack();\n }\n\n const weight = (track: {type?: string, forMainFrame?: boolean, appenderName?: TrackAppenderName}): number => {\n switch (track.appenderName) {\n case 'Animations':\n return 0;\n case 'Timings':\n return 1;\n case 'Interactions':\n return 2;\n case 'LayoutShifts':\n return 3;\n case 'Extension':\n return 4;\n case 'Thread':\n return 5;\n case 'ServerTimings':\n return 6;\n case 'GPU':\n return 7;\n case 'Thread_AuctionWorklet':\n return 8;\n default:\n return 9;\n }\n };\n\n const allTrackAppenders =\n this.compatibilityTracksAppender ? this.compatibilityTracksAppender.allVisibleTrackAppenders() : [];\n\n allTrackAppenders.sort((a, b) => weight(a) - weight(b));\n\n for (const appender of allTrackAppenders) {\n if (!this.parsedTrace) {\n continue;\n }\n\n this.currentLevel = appender.appendTrackAtLevel(this.currentLevel);\n\n // If there is not a selected group, we want to default to selecting the\n // main thread track. Therefore in this check we look to see if the\n // current appender is a ThreadAppender and represnets the Main Thread.\n // If it is, we mark the group as selected.\n if (this.timelineDataInternal && !this.timelineDataInternal.selectedGroup) {\n if (appender instanceof ThreadAppender &&\n (appender.threadType === Trace.Handlers.Threads.ThreadType.MAIN_THREAD ||\n appender.threadType === Trace.Handlers.Threads.ThreadType.CPU_PROFILE)) {\n const group = this.compatibilityTracksAppender?.groupForAppender(appender);\n if (group) {\n this.timelineDataInternal.selectedGroup = group;\n }\n }\n }\n }\n if (this.timelineDataInternal && this.timelineDataInternal.selectedGroup) {\n this.timelineDataInternal.selectedGroup.expanded = true;\n }\n }\n\n minimumBoundary(): number {\n return this.#minimumBoundary;\n }\n\n totalTime(): number {\n return this.timeSpan;\n }\n\n search(visibleWindow: Trace.Types.Timing.TraceWindowMicroSeconds, filter?: Trace.Extras.TraceFilter.TraceFilter):\n PerfUI.FlameChart.DataProviderSearchResult[] {\n const results: PerfUI.FlameChart.DataProviderSearchResult[] = [];\n this.timelineData();\n for (let i = 0; i < this.entryData.length; ++i) {\n const entry = this.entryData[i];\n if (!entry) {\n continue;\n }\n\n if (Trace.Types.Events.isLegacyTimelineFrame(entry)) {\n continue;\n }\n\n if (Trace.Types.Events.isScreenshot(entry)) {\n // Screenshots are represented as trace events, but you can't search for them, so skip.\n continue;\n }\n if (!Trace.Helpers.Timing.eventIsInBounds(entry, visibleWindow)) {\n continue;\n }\n if (!filter || filter.accept(entry, this.parsedTrace || undefined)) {\n const startTimeMilli = Trace.Helpers.Timing.microSecondsToMilliseconds(entry.ts);\n results.push({index: i, startTimeMilli, provider: 'main'});\n }\n }\n return results;\n }\n\n getEntryTypeForLevel(level: number): EntryType {\n return this.entryTypeByLevel[level];\n }\n\n /**\n * The frames and screenshots track is special cased because it is rendered\n * differently to the rest of the tracks and not as a series of events. This\n * is why it is not done via the appender system; we track frames &\n * screenshots as a different EntryType to the TrackAppender entries,\n * because then when it comes to drawing we can decorate them differently.\n **/\n #appendFramesAndScreenshotsTrack(): void {\n if (!this.parsedTrace) {\n return;\n }\n const filmStrip = Trace.Extras.FilmStrip.fromParsedTrace(this.parsedTrace);\n const hasScreenshots = filmStrip.frames.length > 0;\n\n this.framesGroupStyle.collapsible = hasScreenshots;\n const expanded = Root.Runtime.Runtime.queryParam('flamechart-force-expand') === 'frames';\n\n this.appendHeader(i18nString(UIStrings.frames), this.framesGroupStyle, false /* selectable */, expanded);\n\n this.entryTypeByLevel[this.currentLevel] = EntryType.FRAME;\n for (const frame of this.parsedTrace.Frames.frames) {\n this.#appendFrame(frame);\n }\n ++this.currentLevel;\n\n if (!hasScreenshots) {\n return;\n }\n this.#appendScreenshots(filmStrip);\n }\n\n #appendScreenshots(filmStrip: Trace.Extras.FilmStrip.Data): void {\n if (!this.timelineDataInternal || !this.parsedTrace) {\n return;\n }\n this.appendHeader('', this.screenshotsGroupStyle, false /* selectable */);\n this.entryTypeByLevel[this.currentLevel] = EntryType.SCREENSHOT;\n let prevTimestamp: Trace.Types.Timing.MilliSeconds|undefined = undefined;\n\n for (const filmStripFrame of filmStrip.frames) {\n const screenshotTimeInMilliSeconds =\n Trace.Helpers.Timing.microSecondsToMilliseconds(filmStripFrame.screenshotEvent.ts);\n this.entryData.push(filmStripFrame.screenshotEvent);\n (this.timelineDataInternal.entryLevels as number[]).push(this.currentLevel);\n (this.timelineDataInternal.entryStartTimes as number[]).push(screenshotTimeInMilliSeconds);\n if (prevTimestamp) {\n (this.timelineDataInternal.entryTotalTimes as number[]).push(screenshotTimeInMilliSeconds - prevTimestamp);\n }\n prevTimestamp = screenshotTimeInMilliSeconds;\n }\n if (filmStrip.frames.length && prevTimestamp !== undefined) {\n const maxRecordTimeMillis = Trace.Helpers.Timing.traceWindowMilliSeconds(this.parsedTrace.Meta.traceBounds).max;\n\n // Set the total time of the final screenshot so it takes up the remainder of the trace.\n (this.timelineDataInternal.entryTotalTimes as number[]).push(maxRecordTimeMillis - prevTimestamp);\n }\n ++this.currentLevel;\n }\n\n #entryTypeForIndex(entryIndex: number): EntryType {\n const level = this.timelineData().entryLevels[entryIndex];\n return this.entryTypeByLevel[level];\n }\n\n preparePopoverElement(entryIndex: number): Element|null {\n let time = '';\n let title;\n let warningElements: Element[] = [];\n let timeElementClassName = 'popoverinfo-time';\n const additionalContent: HTMLElement[] = [];\n\n const entryType = this.#entryTypeForIndex(entryIndex);\n if (entryType === EntryType.TRACK_APPENDER) {\n if (!this.compatibilityTracksAppender) {\n return null;\n }\n const event = (this.entryData[entryIndex] as Trace.Types.Events.Event);\n const timelineData = (this.timelineDataInternal as PerfUI.FlameChart.FlameChartTimelineData);\n const eventLevel = timelineData.entryLevels[entryIndex];\n const popoverInfo = this.compatibilityTracksAppender.popoverInfo(event, eventLevel);\n title = popoverInfo.title;\n time = popoverInfo.formattedTime;\n warningElements = popoverInfo.warningElements || warningElements;\n if (popoverInfo.additionalElements?.length) {\n additionalContent.push(...popoverInfo.additionalElements);\n }\n\n this.dispatchEventToListeners(Events.FLAME_CHART_ITEM_HOVERED, event);\n\n } else if (entryType === EntryType.FRAME) {\n const frame = (this.entryData[entryIndex] as Trace.Types.Events.LegacyTimelineFrame);\n time =\n i18n.TimeUtilities.preciseMillisToString(Trace.Helpers.Timing.microSecondsToMilliseconds(frame.duration), 1);\n\n if (frame.idle) {\n title = i18nString(UIStrings.idleFrame);\n } else if (frame.dropped) {\n title = frame.isPartial ? i18nString(UIStrings.partiallyPresentedFrame) : i18nString(UIStrings.droppedFrame);\n timeElementClassName = 'popoverinfo-warning';\n } else {\n title = i18nString(UIStrings.frame);\n }\n } else {\n this.dispatchEventToListeners(Events.FLAME_CHART_ITEM_HOVERED, null);\n return null;\n }\n\n const popoverElement = document.createElement('div');\n const root =\n UI.UIUtils.createShadowRootWithCoreStyles(popoverElement, {cssFile: [timelineFlamechartPopoverStyles]});\n const popoverContents = root.createChild('div', 'timeline-flamechart-popover');\n popoverContents.createChild('span', timeElementClassName).textContent = time;\n popoverContents.createChild('span', 'popoverinfo-title').textContent = title;\n for (const warningElement of warningElements) {\n warningElement.classList.add('popoverinfo-warning');\n popoverContents.appendChild(warningElement);\n }\n for (const elem of additionalContent) {\n popoverContents.appendChild(elem);\n }\n return popoverElement;\n }\n\n preparePopoverForCollapsedArrow(entryIndex: number): Element|null {\n const element = document.createElement('div');\n const root = UI.UIUtils.createShadowRootWithCoreStyles(element, {cssFile: [timelineFlamechartPopoverStyles]});\n\n const entry = this.entryData[entryIndex] as Trace.Types.Events.Event;\n const hiddenEntriesAmount =\n ModificationsManager.activeManager()?.getEntriesFilter().findHiddenDescendantsAmount(entry);\n\n if (!hiddenEntriesAmount) {\n return null;\n }\n const contents = root.createChild('div', 'timeline-flamechart-popover');\n contents.createChild('span', 'popoverinfo-title').textContent = hiddenEntriesAmount + ' hidden';\n\n return element;\n }\n\n getDrawOverride(entryIndex: number): DrawOverride|undefined {\n const entryType = this.#entryTypeForIndex(entryIndex);\n if (entryType !== EntryType.TRACK_APPENDER) {\n return;\n }\n\n const timelineData = (this.timelineDataInternal as PerfUI.FlameChart.FlameChartTimelineData);\n const eventLevel = timelineData.entryLevels[entryIndex];\n const event = (this.entryData[entryIndex] as Trace.Types.Events.Event);\n return this.compatibilityTracksAppender?.getDrawOverride(event, eventLevel);\n }\n\n #entryColorForFrame(entryIndex: number): string {\n const frame = (this.entryData[entryIndex] as Trace.Types.Events.LegacyTimelineFrame);\n if (frame.idle) {\n return 'white';\n }\n if (frame.dropped) {\n if (frame.isPartial) {\n // For partially presented frame boxes, paint a yellow background with\n // a sparse white dashed-line pattern overlay.\n return '#f0e442';\n }\n // For dropped frame boxes, paint a red background with a dense white\n // solid-line pattern overlay.\n return '#f08080';\n }\n return '#d7f0d1';\n }\n\n entryColor(entryIndex: number): string {\n const entryType = this.#entryTypeForIndex(entryIndex);\n if (entryType === EntryType.FRAME) {\n return this.#entryColorForFrame(entryIndex);\n }\n if (entryType === EntryType.TRACK_APPENDER) {\n const timelineData = (this.timelineDataInternal as PerfUI.FlameChart.FlameChartTimelineData);\n const eventLevel = timelineData.entryLevels[entryIndex];\n const event = (this.entryData[entryIndex] as Trace.Types.Events.Event);\n return this.compatibilityTracksAppender?.colorForEvent(event, eventLevel) || '';\n }\n return '';\n }\n\n private preparePatternCanvas(): void {\n // Set the candy stripe pattern to 17px so it repeats well.\n const size = 17;\n this.droppedFramePatternCanvas.width = size;\n this.droppedFramePatternCanvas.height = size;\n\n this.partialFramePatternCanvas.width = size;\n this.partialFramePatternCanvas.height = size;\n\n const ctx = this.droppedFramePatternCanvas.getContext('2d');\n if (ctx) {\n // Make a dense solid-line pattern.\n ctx.translate(size * 0.5, size * 0.5);\n ctx.rotate(Math.PI * 0.25);\n ctx.translate(-size * 0.5, -size * 0.5);\n\n ctx.fillStyle = 'rgb(255, 255, 255)';\n for (let x = -size; x < size * 2; x += 3) {\n ctx.fillRect(x, -size, 1, size * 3);\n }\n }\n\n const ctx2 = this.partialFramePatternCanvas.getContext('2d');\n if (ctx2) {\n // Make a sparse dashed-line pattern.\n ctx2.strokeStyle = 'rgb(255, 255, 255)';\n ctx2.lineWidth = 2;\n ctx2.beginPath();\n ctx2.moveTo(17, 0);\n ctx2.lineTo(10, 7);\n ctx2.moveTo(8, 9);\n ctx2.lineTo(2, 15);\n ctx2.stroke();\n }\n }\n\n private drawFrame(\n entryIndex: number, context: CanvasRenderingContext2D, barX: number, barY: number, barWidth: number,\n barHeight: number, transformColor: (color: string) => string): void {\n const hPadding = 1;\n const frame = this.entryData[entryIndex] as Trace.Types.Events.LegacyTimelineFrame;\n barX += hPadding;\n barWidth -= 2 * hPadding;\n context.fillStyle = transformColor(this.entryColor(entryIndex));\n\n if (frame.dropped) {\n if (frame.isPartial) {\n // For partially presented frame boxes, paint a yellow background with\n // a sparse white dashed-line pattern overlay.\n context.fillRect(barX, barY, barWidth, barHeight);\n\n const overlay = context.createPattern(this.partialFramePatternCanvas, 'repeat');\n context.fillStyle = overlay || context.fillStyle;\n } else {\n // For dropped frame boxes, paint a red background with a dense white\n // solid-line pattern overlay.\n context.fillRect(barX, barY, barWidth, barHeight);\n\n const overlay = context.createPattern(this.droppedFramePatternCanvas, 'repeat');\n context.fillStyle = overlay || context.fillStyle;\n }\n }\n context.fillRect(barX, barY, barWidth, barHeight);\n\n const frameDurationText =\n i18n.TimeUtilities.preciseMillisToString(Trace.Helpers.Timing.microSecondsToMilliseconds(frame.duration), 1);\n const textWidth = context.measureText(frameDurationText).width;\n if (textWidth <= barWidth) {\n context.fillStyle = this.textColor(entryIndex);\n context.fillText(frameDurationText, barX + (barWidth - textWidth) / 2, barY + barHeight - 4);\n }\n }\n\n private async drawScreenshot(\n entryIndex: number, context: CanvasRenderingContext2D, barX: number, barY: number, barWidth: number,\n barHeight: number): Promise {\n const screenshot = (this.entryData[entryIndex] as Trace.Types.Events.SyntheticScreenshot);\n const image = Utils.ImageCache.getOrQueue(screenshot);\n if (!image) {\n return;\n }\n const imageX = barX + 1;\n const imageY = barY + 1;\n const imageHeight = barHeight - 2;\n const scale = imageHeight / image.naturalHeight;\n const imageWidth = Math.floor(image.naturalWidth * scale);\n context.save();\n context.beginPath();\n context.rect(barX, barY, barWidth, barHeight);\n context.clip();\n context.drawImage(image, imageX, imageY, imageWidth, imageHeight);\n context.strokeStyle = '#ccc';\n context.strokeRect(imageX - 0.5, imageY - 0.5, Math.min(barWidth - 1, imageWidth + 1), imageHeight);\n context.restore();\n }\n\n decorateEntry(\n entryIndex: number, context: CanvasRenderingContext2D, text: string|null, barX: number, barY: number,\n barWidth: number, barHeight: number, unclippedBarX: number, timeToPixelRatio: number,\n transformColor: (color: string) => string): boolean {\n const entryType = this.#entryTypeForIndex(entryIndex);\n\n if (entryType === EntryType.FRAME) {\n this.drawFrame(entryIndex, context, barX, barY, barWidth, barHeight, transformColor);\n return true;\n }\n\n if (entryType === EntryType.SCREENSHOT) {\n void this.drawScreenshot(entryIndex, context, barX, barY, barWidth, barHeight);\n return true;\n }\n\n if (entryType === EntryType.TRACK_APPENDER) {\n const entry = this.entryData[entryIndex] as Trace.Types.Events.Event;\n if (Trace.Types.Events.isSyntheticInteraction(entry)) {\n this.#drawInteractionEventWithWhiskers(\n context, entryIndex, text, entry, barX, barY, unclippedBarX, barWidth, barHeight, timeToPixelRatio);\n return true;\n }\n }\n\n return false;\n }\n\n /**\n * Draws the left and right whiskers around an interaction in the timeline.\n * @param context - the canvas that will be drawn onto\n * @param entryIndex\n * @param entryTitle - the title of the entry\n * @param entry - the entry itself\n * @param barX - the starting X pixel position of the bar representing this event. This is clipped: if the bar is off the left side of the screen, this value will be 0\n * @param barY - the starting Y pixel position of the bar representing this event.\n * @param unclippedBarXStartPixel - the starting X pixel position of the bar representing this event, not clipped. This means if the bar is off the left of the screen this will be a negative number.\n * @param barWidth - the width of the full bar in pixels\n * @param barHeight - the height of the full bar in pixels\n * @param timeToPixelRatio - the ratio required to convert a millisecond time to a pixel value.\n **/\n #drawInteractionEventWithWhiskers(\n context: CanvasRenderingContext2D, entryIndex: number, entryTitle: string|null,\n entry: Trace.Types.Events.SyntheticInteractionPair, barX: number, barY: number, unclippedBarXStartPixel: number,\n barWidth: number, barHeight: number, timeToPixelRatio: number): void {\n /**\n * An interaction is drawn with whiskers as so:\n * |----------[=======]-------------|\n * => The left whisker is the event's start time (event.ts)\n * => The box start is the event's processingStart time\n * => The box end is the event's processingEnd time\n * => The right whisker is the event's end time (event.ts + event.dur)\n *\n * When we draw the event in the InteractionsAppender, we draw a huge box\n * that spans the entire of the above. So here we need to draw over the\n * rectangle that is outside of {processingStart, processingEnd} and\n * replace it with the whiskers.\n * TODO(crbug.com/1495248): rework how we draw whiskers to avoid this inefficiency\n */\n\n const beginTime = Trace.Helpers.Timing.microSecondsToMilliseconds(entry.ts);\n const entireBarEndXPixel = barX + barWidth;\n\n function timeToPixel(time: Trace.Types.Timing.MicroSeconds): number {\n const timeMilli = Trace.Helpers.Timing.microSecondsToMilliseconds(time);\n return Math.floor(unclippedBarXStartPixel + (timeMilli - beginTime) * timeToPixelRatio);\n }\n\n context.save();\n\n // Clear portions of initial rect to prepare for the ticks.\n context.fillStyle = ThemeSupport.ThemeSupport.instance().getComputedValue('--sys-color-cdt-base-container');\n let desiredBoxStartX = timeToPixel(entry.processingStart);\n const desiredBoxEndX = timeToPixel(entry.processingEnd);\n\n // If the entry has no processing duration, ensure the box is 1px wide so at least it is visible.\n if (entry.processingEnd - entry.processingStart === 0) {\n desiredBoxStartX -= 1;\n }\n\n context.fillRect(barX, barY - 0.5, desiredBoxStartX - barX, barHeight);\n context.fillRect(desiredBoxEndX, barY - 0.5, entireBarEndXPixel - desiredBoxEndX, barHeight);\n\n // Draws left and right whiskers\n function drawTick(begin: number, end: number, y: number): void {\n const tickHeightPx = 6;\n context.moveTo(begin, y - tickHeightPx / 2);\n context.lineTo(begin, y + tickHeightPx / 2);\n context.moveTo(begin, y);\n context.lineTo(end, y);\n }\n\n // The left whisker starts at the enty timestamp, and continues until the start of the box (processingStart).\n const leftWhiskerX = timeToPixel(entry.ts);\n // The right whisker ends at (entry.ts + entry.dur). We draw the line from the end of the box (processingEnd).\n const rightWhiskerX = timeToPixel(Trace.Types.Timing.MicroSeconds(entry.ts + entry.dur));\n context.beginPath();\n context.lineWidth = 1;\n context.strokeStyle = '#ccc';\n const lineY = Math.floor(barY + barHeight / 2) + 0.5;\n const leftTick = leftWhiskerX + 0.5;\n const rightTick = rightWhiskerX - 0.5;\n drawTick(leftTick, desiredBoxStartX, lineY);\n drawTick(rightTick, desiredBoxEndX, lineY);\n context.stroke();\n\n if (entryTitle) {\n // BarX will be set to 0 if the start of the box if off the screen to the\n // left. If this happens, the desiredBoxStartX will be negative. In that\n // case, we fallback to the BarX. This ensures that even if the box\n // starts off-screen, we draw the text at the first visible on screen\n // pixels, so the user can still see the event's title.\n const textStartX = desiredBoxStartX > 0 ? desiredBoxStartX : barX;\n context.font = this.#font;\n const textWidth = UI.UIUtils.measureTextWidth(context, entryTitle);\n\n // These numbers are duplicated from FlameChart.ts.\n const textPadding = 5;\n const textBaseline = 5;\n\n // Only draw the text if it can fit in the amount of box that is visible.\n if (textWidth <= desiredBoxEndX - textStartX + textPadding) {\n context.fillStyle = this.textColor(entryIndex);\n context.fillText(entryTitle, textStartX + textPadding, barY + barHeight - textBaseline);\n }\n }\n context.restore();\n }\n\n forceDecoration(entryIndex: number): boolean {\n const entryType = this.#entryTypeForIndex(entryIndex);\n if (entryType === EntryType.FRAME) {\n return true;\n }\n if (entryType === EntryType.SCREENSHOT) {\n return true;\n }\n const event = (this.entryData[entryIndex] as Trace.Types.Events.Event);\n\n if (Trace.Types.Events.isSyntheticInteraction(event)) {\n // We draw interactions with whiskers, which are done via the\n // decorateEntry() method, hence we always want to force these to be\n // decorated.\n return true;\n }\n return Boolean(this.parsedTrace?.Warnings.perEvent.get(event));\n }\n\n private appendHeader(title: string, style: PerfUI.FlameChart.GroupStyle, selectable: boolean, expanded?: boolean):\n PerfUI.FlameChart.Group {\n const group =\n ({startLevel: this.currentLevel, name: title, style, selectable, expanded} as PerfUI.FlameChart.Group);\n (this.timelineDataInternal as PerfUI.FlameChart.FlameChartTimelineData).groups.push(group);\n return group;\n }\n\n #appendFrame(frame: Trace.Types.Events.LegacyTimelineFrame): void {\n const index = this.entryData.length;\n this.entryData.push(frame);\n const durationMilliseconds = Trace.Helpers.Timing.microSecondsToMilliseconds(frame.duration);\n this.entryIndexToTitle[index] = i18n.TimeUtilities.millisToString(durationMilliseconds, true);\n if (!this.timelineDataInternal) {\n return;\n }\n this.timelineDataInternal.entryLevels[index] = this.currentLevel;\n this.timelineDataInternal.entryTotalTimes[index] = durationMilliseconds;\n this.timelineDataInternal.entryStartTimes[index] = Trace.Helpers.Timing.microSecondsToMilliseconds(frame.startTime);\n }\n\n createSelection(entryIndex: number): TimelineSelection|null {\n const entry = this.entryData[entryIndex];\n const timelineSelection: TimelineSelection|null = entry ? selectionFromEvent(entry) : null;\n if (timelineSelection) {\n this.lastSelection = new Selection(timelineSelection, entryIndex);\n }\n return timelineSelection;\n }\n\n formatValue(value: number, precision?: number): string {\n return i18n.TimeUtilities.preciseMillisToString(value, precision);\n }\n\n groupForEvent(entryIndex: number): PerfUI.FlameChart.Group|null {\n if (!this.compatibilityTracksAppender) {\n return null;\n }\n const level = this.timelineDataInternal?.entryLevels[entryIndex] ?? null;\n if (level === null) {\n return null;\n }\n const groupForLevel = this.compatibilityTracksAppender.groupForLevel(level);\n if (!groupForLevel) {\n return null;\n }\n return groupForLevel;\n }\n\n canJumpToEntry(_entryIndex: number): boolean {\n return false;\n }\n\n entryIndexForSelection(selection: TimelineSelection|null): number {\n if (!selection || selectionIsRange(selection) || Trace.Types.Events.isNetworkTrackEntry(selection.event)) {\n return -1;\n }\n\n if (this.lastSelection && selectionsEqual(this.lastSelection.timelineSelection, selection)) {\n return this.lastSelection.entryIndex;\n }\n\n const index = this.entryData.indexOf(selection.event);\n // If the index is -1 and the selection is a TraceEvent, it might be\n // the case that this Entry is hidden by the Context Menu action.\n // Try revealing the entry and getting the index again.\n if (index > -1) {\n if (this.timelineDataInternal?.selectedGroup) {\n ModificationsManager.activeManager()?.getEntriesFilter().revealEntry(selection.event);\n this.timelineData(true);\n }\n }\n\n if (index !== -1) {\n this.lastSelection = new Selection(selection, index);\n }\n return index;\n }\n\n /**\n * Return the index for the given entry. Note that this method assumes that\n * timelineData() has been generated. If it hasn't, this method will return\n * null.\n */\n indexForEvent(targetEvent: Trace.Types.Events.Event): number|null {\n // Gets the index for the given event by walking through the array of entryData.\n // This may seem inefficient - but we have seen that by building up large\n // maps keyed by trace events that this has a significant impact on the\n // performance of the panel.\n // Therefore, we strike a middle ground: look up the event the first time,\n // but then cache the result.\n const fromCache = this.#eventIndexByEvent.get(targetEvent);\n if (typeof fromCache === 'number') {\n return fromCache;\n }\n const index = this.entryData.indexOf(targetEvent);\n const result = index > -1 ? index : null;\n this.#eventIndexByEvent.set(targetEvent, result);\n return result;\n }\n\n /**\n * Build the data for initiators and initiated entries.\n * @param entryIndex\n * @returns if we should re-render the flame chart (canvas)\n */\n buildFlowForInitiator(entryIndex: number): boolean {\n if (!this.parsedTrace) {\n return false;\n }\n if (!this.timelineDataInternal) {\n return false;\n }\n if (this.lastInitiatorEntry === entryIndex) {\n if (this.lastInitiatorsData) {\n this.timelineDataInternal.initiatorsData = this.lastInitiatorsData;\n }\n return false;\n }\n if (!this.compatibilityTracksAppender) {\n return false;\n }\n\n // Remove all previously assigned decorations indicating that the flow event entries are hidden\n const previousInitiatorsDataLength = this.timelineDataInternal.initiatorsData.length;\n // |entryIndex| equals -1 means there is no entry selected, just clear the\n // initiator cache if there is any previous arrow and return true to\n // re-render.\n if (entryIndex === -1) {\n this.lastInitiatorEntry = entryIndex;\n if (previousInitiatorsDataLength === 0) {\n // This means there is no arrow before, so we don't need to re-render.\n return false;\n }\n // Reset to clear any previous arrows from the last event.\n this.timelineDataInternal.resetFlowData();\n return true;\n }\n\n const entryType = this.#entryTypeForIndex(entryIndex);\n if (entryType !== EntryType.TRACK_APPENDER) {\n return false;\n }\n const event = this.entryData[entryIndex] as Trace.Types.Events.Event;\n // Reset to clear any previous arrows from the last event.\n this.timelineDataInternal.resetFlowData();\n this.lastInitiatorEntry = entryIndex;\n\n const hiddenEvents: Trace.Types.Events.Event[] =\n ModificationsManager.activeManager()?.getEntriesFilter().invisibleEntries() ?? [];\n const expandableEntries: Trace.Types.Events.Event[] =\n ModificationsManager.activeManager()?.getEntriesFilter().expandableEntries() ?? [];\n\n const initiatorsData = initiatorsDataToDraw(\n this.parsedTrace,\n event,\n hiddenEvents,\n expandableEntries,\n );\n // This means there is no change for arrows.\n if (previousInitiatorsDataLength === 0 && initiatorsData.length === 0) {\n return false;\n }\n for (const initiatorData of initiatorsData) {\n const eventIndex = this.indexForEvent(initiatorData.event);\n const initiatorIndex = this.indexForEvent(initiatorData.initiator);\n if (eventIndex === null || initiatorIndex === null) {\n continue;\n }\n this.timelineDataInternal.initiatorsData.push({\n initiatorIndex,\n eventIndex,\n isInitiatorHidden: initiatorData.isInitiatorHidden,\n isEntryHidden: initiatorData.isEntryHidden,\n });\n }\n this.lastInitiatorsData = this.timelineDataInternal.initiatorsData;\n return true;\n }\n\n eventByIndex(entryIndex: number): Trace.Types.Events.Event|null {\n if (entryIndex < 0) {\n return null;\n }\n const entryType = this.#entryTypeForIndex(entryIndex);\n if (entryType === EntryType.TRACK_APPENDER) {\n return this.entryData[entryIndex] as Trace.Types.Events.Event;\n }\n if (entryType === EntryType.FRAME) {\n return this.entryData[entryIndex] as Trace.Types.Events.LegacyTimelineFrame;\n }\n return null;\n }\n}\n\nexport const InstantEventVisibleDurationMs = Trace.Types.Timing.MilliSeconds(0.001);\n\nexport const enum Events {\n DATA_CHANGED = 'DataChanged',\n FLAME_CHART_ITEM_HOVERED = 'FlameChartItemHovered',\n}\n\nexport type EventTypes = {\n [Events.DATA_CHANGED]: void,\n [Events.FLAME_CHART_ITEM_HOVERED]: Trace.Types.Events.Event|null,\n};\n\n// an entry is a trace event, they are classified into \"entry types\"\n// because some events are rendered differently. For example, screenshot\n// events are rendered as images. Checks for entry types allow to have\n// different styles, names, etc. for events that look differently.\n// In the future we won't have this checks: instead we will forward\n// the event to the corresponding \"track appender\" and it will determine\n// how the event shall be rendered.\nexport const enum EntryType {\n FRAME = 'Frame',\n TRACK_APPENDER = 'TrackAppender',\n SCREENSHOT = 'Screenshot',\n}\n"]} \ No newline at end of file diff --git a/public/panels/timeline/TimelineFlameChartNetworkDataProvider.js b/public/panels/timeline/TimelineFlameChartNetworkDataProvider.js index c12fd4a2e..c18393525 100644 --- a/public/panels/timeline/TimelineFlameChartNetworkDataProvider.js +++ b/public/panels/timeline/TimelineFlameChartNetworkDataProvider.js @@ -343,10 +343,7 @@ export class TimelineFlameChartNetworkDataProvider { const event = this.#events[index]; if (Trace.Types.Events.isSyntheticNetworkRequest(event)) { const element = document.createElement('div'); - const root = UI.UIUtils.createShadowRootWithCoreStyles(element, { - cssFile: [timelineFlamechartPopoverStyles], - delegatesFocus: undefined, - }); + const root = UI.UIUtils.createShadowRootWithCoreStyles(element, { cssFile: [timelineFlamechartPopoverStyles] }); const contents = root.createChild('div', 'timeline-flamechart-popover'); const infoElement = new TimelineComponents.NetworkRequestTooltip.NetworkRequestTooltip(); infoElement.networkRequest = event; diff --git a/public/panels/timeline/TimelineFlameChartNetworkDataProvider.js.map b/public/panels/timeline/TimelineFlameChartNetworkDataProvider.js.map index 83e54de22..eec186a18 100644 --- a/public/panels/timeline/TimelineFlameChartNetworkDataProvider.js.map +++ b/public/panels/timeline/TimelineFlameChartNetworkDataProvider.js.map @@ -1 +1 @@ -{"version":3,"file":"TimelineFlameChartNetworkDataProvider.js","sourceRoot":"","sources":["../../../../../../front_end/panels/timeline/TimelineFlameChartNetworkDataProvider.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,KAAK,IAAI,MAAM,yBAAyB,CAAC;AAChD,OAAO,KAAK,QAAQ,MAAM,iCAAiC,CAAC;AAC5D,OAAO,KAAK,KAAK,MAAM,6BAA6B,CAAC;AACrD,OAAO,KAAK,MAAM,MAAM,+CAA+C,CAAC;AACxE,OAAO,KAAK,EAAE,MAAM,2BAA2B,CAAC;AAChD,OAAO,KAAK,YAAY,MAAM,gDAAgD,CAAC;AAE/E,OAAO,KAAK,kBAAkB,MAAM,4BAA4B,CAAC;AACjE,OAAO,EAAC,8BAA8B,EAAC,MAAM,iBAAiB,CAAC;AAC/D,OAAO,EAAC,oBAAoB,EAAC,MAAM,2BAA2B,CAAC;AAC/D,OAAO,EAAC,oBAAoB,EAAyB,MAAM,2BAA2B,CAAC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I,CAAC,mBAAmB,GAAG,UAAU,CAAC;QAEtC,MAAM,cAAc,GAAG,8BAA8B,CAAC,IAAI,CAAC,YAAY,EAAE,KAAK,CAAC,CAAC;QAChF,4CAA4C;QAC5C,IAAI,4BAA4B,KAAK,CAAC,IAAI,cAAc,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACtE,OAAO,KAAK,CAAC;QACf,CAAC;QACD,KAAK,MAAM,aAAa,IAAI,cAAc,EAAE,CAAC;YAC3C,MAAM,UAAU,GAAG,IAAI,CAAC,aAAa,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;YAC3D,MAAM,cAAc,GAAG,IAAI,CAAC,aAAa,CAAC,aAAa,CAAC,SAAS,CAAC,CAAC;YACnE,IAAI,UAAU,KAAK,IAAI,IAAI,cAAc,KAAK,IAAI,EAAE,CAAC;gBACnD,SAAS;YACX,CAAC;YACD,IAAI,CAAC,qBAAqB,CAAC,cAAc,CAAC,IAAI,CAAC;gBAC7C,cAAc;gBACd,UAAU;aACX,CAAC,CAAC;QACL,CAAC;QACD,IAAI,CAAC,mBAAmB,GAAG,IAAI,CAAC,qBAAqB,CAAC,cAAc,CAAC;QACrE,OAAO,IAAI,CAAC;IACd,CAAC;CACF","sourcesContent":["// Copyright 2016 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport * as i18n from '../../core/i18n/i18n.js';\nimport * as Platform from '../../core/platform/platform.js';\nimport * as Trace from '../../models/trace/trace.js';\nimport * as PerfUI from '../../ui/legacy/components/perf_ui/perf_ui.js';\nimport * as UI from '../../ui/legacy/legacy.js';\nimport * as ThemeSupport from '../../ui/legacy/theme_support/theme_support.js';\n\nimport * as TimelineComponents from './components/components.js';\nimport {initiatorsDataToDrawForNetwork} from './Initiators.js';\nimport {ModificationsManager} from './ModificationsManager.js';\nimport {NetworkTrackAppender, type NetworkTrackEvent} from './NetworkTrackAppender.js';\nimport timelineFlamechartPopoverStyles from './timelineFlamechartPopover.css.js';\nimport {FlameChartStyle, Selection} from './TimelineFlameChartView.js';\nimport {\n selectionFromEvent,\n selectionIsRange,\n selectionsEqual,\n type TimelineSelection,\n} from './TimelineSelection.js';\nimport * as TimelineUtils from './utils/utils.js';\n\nexport class TimelineFlameChartNetworkDataProvider implements PerfUI.FlameChart.FlameChartDataProvider {\n #minimumBoundary: number = 0;\n #timeSpan: number = 0;\n #events: NetworkTrackEvent[] = [];\n #maxLevel: number = 0;\n #networkTrackAppender: NetworkTrackAppender|null = null;\n\n #timelineDataInternal: PerfUI.FlameChart.FlameChartTimelineData|null = null;\n #lastSelection: Selection|null = null;\n #parsedTrace: Trace.Handlers.Types.ParsedTrace|null = null;\n #eventIndexByEvent: Map = new Map();\n // -1 means no entry is selected.\n #lastInitiatorEntry: number = -1;\n #lastInitiatorsData: PerfUI.FlameChart.FlameChartInitiatorData[] = [];\n\n constructor() {\n this.reset();\n }\n\n // Reset all data other than the UI elements.\n // This should be called when\n // - initialized the data provider\n // - a new trace file is coming (when `setModel()` is called)\n // etc.\n reset(): void {\n this.#maxLevel = 0;\n this.#minimumBoundary = 0;\n this.#timeSpan = 0;\n this.#eventIndexByEvent.clear();\n this.#events = [];\n this.#timelineDataInternal = null;\n this.#parsedTrace = null;\n\n this.#networkTrackAppender = null;\n }\n\n setModel(parsedTrace: Trace.Handlers.Types.ParsedTrace): void {\n this.reset();\n this.#parsedTrace = parsedTrace;\n\n this.setEvents(this.#parsedTrace);\n this.#setTimingBoundsData(this.#parsedTrace);\n }\n\n setEvents(parsedTrace: Trace.Handlers.Types.ParsedTrace): void {\n if (parsedTrace.NetworkRequests.webSocket) {\n parsedTrace.NetworkRequests.webSocket.forEach(webSocketData => {\n if (webSocketData.syntheticConnection) {\n this.#events.push(webSocketData.syntheticConnection);\n }\n this.#events.push(...webSocketData.events);\n });\n }\n if (parsedTrace.NetworkRequests.byTime) {\n this.#events.push(...parsedTrace.NetworkRequests.byTime);\n }\n }\n\n isEmpty(): boolean {\n this.timelineData();\n return !this.#events.length;\n }\n\n maxStackDepth(): number {\n return this.#maxLevel;\n }\n\n hasTrackConfigurationMode(): boolean {\n return false;\n }\n\n timelineData(): PerfUI.FlameChart.FlameChartTimelineData {\n if (this.#timelineDataInternal && this.#timelineDataInternal.entryLevels.length !== 0) {\n // The flame chart data is built already, so return the cached data.\n return this.#timelineDataInternal;\n }\n\n this.#timelineDataInternal = PerfUI.FlameChart.FlameChartTimelineData.createEmpty();\n if (!this.#parsedTrace) {\n return this.#timelineDataInternal;\n }\n\n if (!this.#events.length) {\n this.setEvents(this.#parsedTrace);\n }\n this.#networkTrackAppender = new NetworkTrackAppender(this.#timelineDataInternal, this.#events);\n this.#maxLevel = this.#networkTrackAppender.appendTrackAtLevel(0);\n\n return this.#timelineDataInternal;\n }\n\n minimumBoundary(): number {\n return this.#minimumBoundary;\n }\n\n totalTime(): number {\n return this.#timeSpan;\n }\n\n setWindowTimes(startTime: Trace.Types.Timing.MilliSeconds, endTime: Trace.Types.Timing.MilliSeconds): void {\n this.#updateTimelineData(startTime, endTime);\n }\n\n createSelection(index: number): TimelineSelection|null {\n if (index === -1) {\n return null;\n }\n const event = this.#events[index];\n this.#lastSelection = new Selection(selectionFromEvent(event), index);\n return this.#lastSelection.timelineSelection;\n }\n\n customizedContextMenu(event: MouseEvent, eventIndex: number, _groupIndex: number): UI.ContextMenu.ContextMenu\n |undefined {\n const networkRequest = this.eventByIndex(eventIndex);\n if (!networkRequest || !Trace.Types.Events.isSyntheticNetworkRequest(networkRequest)) {\n return;\n }\n const timelineNetworkRequest = TimelineUtils.NetworkRequest.createTimelineNetworkRequest(networkRequest);\n const contextMenu = new UI.ContextMenu.ContextMenu(event);\n contextMenu.appendApplicableItems(timelineNetworkRequest);\n return contextMenu;\n }\n\n indexForEvent(event: Trace.Types.Events.Event): number|null {\n if (!Trace.Types.Events.isNetworkTrackEntry(event)) {\n return null;\n }\n const fromCache = this.#eventIndexByEvent.get(event);\n // Cached value might be null, which is OK.\n if (fromCache !== undefined) {\n return fromCache;\n }\n const index = this.#events.indexOf(event);\n const result = index > -1 ? index : null;\n this.#eventIndexByEvent.set(event, result);\n return result;\n }\n\n eventByIndex(entryIndex: number): Trace.Types.Events.SyntheticNetworkRequest|Trace.Types.Events.WebSocketEvent|null {\n return this.#events.at(entryIndex) ?? null;\n }\n\n entryHasAnnotations(entryIndex: number): boolean {\n const event = this.eventByIndex(entryIndex);\n if (!event) {\n return false;\n }\n const entryAnnotations = ModificationsManager.activeManager()?.annotationsForEntry(event);\n return entryAnnotations !== undefined && entryAnnotations.length > 0;\n }\n\n deleteAnnotationsForEntry(entryIndex: number): void {\n const event = this.eventByIndex(entryIndex);\n if (!event) {\n return;\n }\n ModificationsManager.activeManager()?.deleteEntryAnnotations(event);\n }\n\n entryIndexForSelection(selection: TimelineSelection|null): number {\n if (!selection || selectionIsRange(selection)) {\n return -1;\n }\n\n if (this.#lastSelection && selectionsEqual(this.#lastSelection.timelineSelection, selection)) {\n return this.#lastSelection.entryIndex;\n }\n\n if (!Trace.Types.Events.isNetworkTrackEntry(selection.event)) {\n return -1;\n }\n\n const index = this.#events.indexOf(selection.event);\n if (index !== -1) {\n this.#lastSelection = new Selection(selectionFromEvent(selection.event), index);\n }\n return index;\n }\n\n groupForEvent(_entryIndex: number): PerfUI.FlameChart.Group|null {\n // Because the network track only contains one group, we don't actually\n // need to do any lookups here.\n const group = this.#networkTrackAppender?.group() ?? null;\n return group;\n }\n\n entryColor(index: number): string {\n if (!this.#networkTrackAppender) {\n throw new Error('networkTrackAppender should not be empty');\n }\n return this.#networkTrackAppender.colorForEvent(this.#events[index]);\n }\n\n textColor(_index: number): string {\n return FlameChartStyle.textColor;\n }\n\n entryTitle(index: number): string|null {\n const event = this.#events[index];\n return TimelineUtils.EntryName.nameForEntry(event);\n }\n\n entryFont(_index: number): string|null {\n return this.#networkTrackAppender?.font() || null;\n }\n\n /**\n * Returns the pixels needed to decorate the event.\n * The pixels compare to the start of the earliest event of the request.\n *\n * Request.beginTime(), which is used in FlameChart to calculate the unclippedBarX\n * v\n * |----------------[ (URL text) waiting time | request ]--------|\n * ^start ^sendStart ^headersEnd ^Finish ^end\n * @param request\n * @param unclippedBarX The start pixel of the request. It is calculated with request.beginTime() in FlameChart.\n * @param timeToPixelRatio\n * @returns the pixels to draw waiting time and left and right whiskers and url text\n */\n getDecorationPixels(\n event: Trace.Types.Events.SyntheticNetworkRequest, unclippedBarX: number,\n timeToPixelRatio: number): {sendStart: number, headersEnd: number, finish: number, start: number, end: number} {\n const beginTime = Trace.Helpers.Timing.microSecondsToMilliseconds(event.ts);\n const timeToPixel = (time: number): number => unclippedBarX + (time - beginTime) * timeToPixelRatio;\n const startTime = Trace.Helpers.Timing.microSecondsToMilliseconds(event.ts);\n const endTime =\n Trace.Helpers.Timing.microSecondsToMilliseconds((event.ts + event.dur) as Trace.Types.Timing.MicroSeconds);\n const sendStartTime = Trace.Helpers.Timing.microSecondsToMilliseconds(event.args.data.syntheticData.sendStartTime);\n const headersEndTime = Trace.Helpers.Timing.microSecondsToMilliseconds(event.args.data.syntheticData.downloadStart);\n const sendStart = Math.max(timeToPixel(sendStartTime), unclippedBarX);\n const headersEnd = Math.max(timeToPixel(headersEndTime), sendStart);\n const finish = Math.max(\n timeToPixel(Trace.Helpers.Timing.microSecondsToMilliseconds(event.args.data.syntheticData.finishTime)),\n headersEnd);\n const start = timeToPixel(startTime);\n const end = Math.max(timeToPixel(endTime), finish);\n\n return {sendStart, headersEnd, finish, start, end};\n }\n\n /**\n * Decorates the entry depends on the type of the event:\n * @param index\n * @param context\n * @param barX The x pixel of the visible part request\n * @param barY The y pixel of the visible part request\n * @param barWidth The width of the visible part request\n * @param barHeight The height of the visible part request\n * @param unclippedBarX The start pixel of the request compare to the visible area. It is calculated with request.beginTime() in FlameChart.\n * @param timeToPixelRatio\n * @returns if the entry needs to be decorate, which is alway true if the request has \"timing\" field\n */\n decorateEntry(\n index: number, context: CanvasRenderingContext2D, _text: string|null, barX: number, barY: number,\n barWidth: number, barHeight: number, unclippedBarX: number, timeToPixelRatio: number): boolean {\n const event = this.#events[index];\n if (Trace.Types.Events.isSyntheticWebSocketConnection(event)) {\n return this.#decorateSyntheticWebSocketConnection(\n index, context, barY, barHeight, unclippedBarX, timeToPixelRatio);\n }\n if (!Trace.Types.Events.isSyntheticNetworkRequest(event)) {\n return false;\n }\n return this.#decorateNetworkRequest(\n index, context, _text, barX, barY, barWidth, barHeight, unclippedBarX, timeToPixelRatio);\n }\n\n /**\n * Decorates the Network Request entry with the following steps:\n * Draw a waiting time between |sendStart| and |headersEnd|\n * By adding a extra transparent white layer\n * Draw a whisk between |start| and |sendStart|\n * Draw a whisk between |finish| and |end|\n * By draw another layer of background color to \"clear\" the area\n * Then draw the whisk\n * Draw the URL after the |sendStart|\n *\n * |----------------[ (URL text) waiting time | request ]--------|\n * ^start ^sendStart ^headersEnd ^Finish ^end\n * */\n #decorateNetworkRequest(\n index: number, context: CanvasRenderingContext2D, _text: string|null, barX: number, barY: number,\n barWidth: number, barHeight: number, unclippedBarX: number, timeToPixelRatio: number): boolean {\n const event = this.#events[index];\n if (!Trace.Types.Events.isSyntheticNetworkRequest(event)) {\n return false;\n }\n const {sendStart, headersEnd, finish, start, end} =\n this.getDecorationPixels(event, unclippedBarX, timeToPixelRatio);\n\n // Draw waiting time.\n context.fillStyle = 'hsla(0, 100%, 100%, 0.8)';\n context.fillRect(sendStart + 0.5, barY + 0.5, headersEnd - sendStart - 0.5, barHeight - 2);\n // Clear portions of initial rect to prepare for the ticks.\n context.fillStyle = ThemeSupport.ThemeSupport.instance().getComputedValue('--sys-color-cdt-base-container');\n context.fillRect(barX, barY - 0.5, sendStart - barX, barHeight);\n context.fillRect(finish, barY - 0.5, barX + barWidth - finish, barHeight);\n\n // Draws left and right whiskers\n function drawTick(begin: number, end: number, y: number): void {\n const /** @const */ tickHeightPx = 6;\n context.moveTo(begin, y - tickHeightPx / 2);\n context.lineTo(begin, y + tickHeightPx / 2);\n context.moveTo(begin, y);\n context.lineTo(end, y);\n }\n\n context.beginPath();\n context.lineWidth = 1;\n context.strokeStyle = '#ccc';\n const lineY = Math.floor(barY + barHeight / 2) + 0.5;\n const leftTick = start + 0.5;\n const rightTick = end - 0.5;\n drawTick(leftTick, sendStart, lineY);\n drawTick(rightTick, finish, lineY);\n context.stroke();\n\n // Draw request URL as text\n const textStart = Math.max(sendStart, 0);\n const textWidth = finish - textStart;\n const /** @const */ minTextWidthPx = 20;\n if (textWidth >= minTextWidthPx) {\n let title = this.entryTitle(index) || '';\n if (event.args.data.fromServiceWorker) {\n title = '⚙ ' + title;\n }\n if (title) {\n const /** @const */ textPadding = 4;\n const /** @const */ textBaseline = 5;\n const textBaseHeight = barHeight - textBaseline;\n const trimmedText = UI.UIUtils.trimTextEnd(context, title, textWidth - 2 * textPadding);\n context.fillStyle = '#333';\n context.fillText(trimmedText, textStart + textPadding, barY + textBaseHeight);\n }\n }\n\n return true;\n }\n\n /**\n * Decorates the synthetic websocket event entry with a whisk from the start to the end.\n * ------------------------\n * ^start ^end\n * */\n #decorateSyntheticWebSocketConnection(\n index: number, context: CanvasRenderingContext2D, barY: number, barHeight: number, unclippedBarX: number,\n timeToPixelRatio: number): boolean {\n context.save();\n const event = this.#events[index] as Trace.Types.Events.SyntheticWebSocketConnection;\n const beginTime = Trace.Helpers.Timing.microSecondsToMilliseconds(event.ts);\n const timeToPixel = (time: number): number => Math.floor(unclippedBarX + (time - beginTime) * timeToPixelRatio);\n const endTime =\n Trace.Helpers.Timing.microSecondsToMilliseconds((event.ts + event.dur) as Trace.Types.Timing.MicroSeconds);\n const start = timeToPixel(beginTime) + 0.5;\n const end = timeToPixel(endTime) - 0.5;\n context.strokeStyle = ThemeSupport.ThemeSupport.instance().getComputedValue('--app-color-rendering');\n\n const lineY = Math.floor(barY + barHeight / 2) + 0.5;\n context.setLineDash([3, 2]);\n context.moveTo(start, lineY - 1);\n context.lineTo(end, lineY - 1);\n context.moveTo(start, lineY + 1);\n context.lineTo(end, lineY + 1);\n context.stroke();\n context.restore();\n return true;\n }\n\n forceDecoration(_index: number): boolean {\n return true;\n }\n\n /**\n *In the FlameChart.ts, when filtering through the events for a level, it starts\n * from the last event of that level and stops when it hit an event that has start\n * time greater than the filtering window.\n * For example, in this websocket level we have A(socket event), B, C, D. If C\n * event has start time greater than the window, the rest of the events (A and B)\n * wont be drawn. So if this level is the force Drawable level, we wont stop at\n * event C and will include the socket event A.\n * */\n forceDrawableLevel(levelIndex: number): boolean {\n return this.#networkTrackAppender?.webSocketIdToLevel.has(levelIndex) || false;\n }\n\n preparePopoverElement(index: number): Element|null {\n const event = this.#events[index];\n if (Trace.Types.Events.isSyntheticNetworkRequest(event)) {\n const element = document.createElement('div');\n const root = UI.UIUtils.createShadowRootWithCoreStyles(element, {\n cssFile: [timelineFlamechartPopoverStyles],\n delegatesFocus: undefined,\n });\n\n const contents = root.createChild('div', 'timeline-flamechart-popover');\n const infoElement = new TimelineComponents.NetworkRequestTooltip.NetworkRequestTooltip();\n infoElement.networkRequest = event;\n contents.appendChild(infoElement);\n return element;\n }\n return null;\n }\n\n /**\n * Sets the minimum time and total time span of a trace using the\n * new engine data.\n */\n #setTimingBoundsData(newParsedTrace: Trace.Handlers.Types.ParsedTrace): void {\n const {traceBounds} = newParsedTrace.Meta;\n const minTime = Trace.Helpers.Timing.microSecondsToMilliseconds(traceBounds.min);\n const maxTime = Trace.Helpers.Timing.microSecondsToMilliseconds(traceBounds.max);\n this.#minimumBoundary = minTime;\n this.#timeSpan = minTime === maxTime ? 1000 : maxTime - this.#minimumBoundary;\n }\n\n /**\n * When users zoom in the flamechart, we only want to show them the network\n * requests between startTime and endTime. This function will call the\n * trackAppender to update the timeline data, and then force to create a new\n * PerfUI.FlameChart.FlameChartTimelineData instance to force the flamechart\n * to re-render.\n */\n #updateTimelineData(startTime: Trace.Types.Timing.MilliSeconds, endTime: Trace.Types.Timing.MilliSeconds): void {\n if (!this.#networkTrackAppender || !this.#timelineDataInternal) {\n return;\n }\n this.#maxLevel = this.#networkTrackAppender.relayoutEntriesWithinBounds(this.#events, startTime, endTime);\n\n // TODO(crbug.com/1459225): Remove this recreating code.\n // Force to create a new PerfUI.FlameChart.FlameChartTimelineData instance\n // to force the flamechart to re-render. This also causes crbug.com/1459225.\n this.#timelineDataInternal = PerfUI.FlameChart.FlameChartTimelineData.create({\n entryLevels: this.#timelineDataInternal?.entryLevels,\n entryTotalTimes: this.#timelineDataInternal?.entryTotalTimes,\n entryStartTimes: this.#timelineDataInternal?.entryStartTimes,\n groups: this.#timelineDataInternal?.groups,\n initiatorsData: this.#timelineDataInternal.initiatorsData,\n entryDecorations: this.#timelineDataInternal.entryDecorations,\n });\n }\n\n preferredHeight(): number {\n if (!this.#networkTrackAppender || this.#maxLevel === 0) {\n return 0;\n }\n const group = this.#networkTrackAppender.group();\n if (!group) {\n return 0;\n }\n // Bump up to 7 because the tooltip is around 7 rows' height.\n return group.style.height * (this.isExpanded() ? Platform.NumberUtilities.clamp(this.#maxLevel + 1, 7, 8.5) : 1);\n }\n\n isExpanded(): boolean {\n return Boolean(this.#networkTrackAppender?.group()?.expanded);\n }\n\n formatValue(value: number, precision?: number): string {\n return i18n.TimeUtilities.preciseMillisToString(value, precision);\n }\n\n canJumpToEntry(_entryIndex: number): boolean {\n return false;\n }\n\n /**\n * searches entries within the specified time and returns a list of entry\n * indexes\n */\n search(\n visibleWindow: Trace.Types.Timing.TraceWindowMicroSeconds,\n filter?: Trace.Extras.TraceFilter.TraceFilter,\n ): PerfUI.FlameChart.DataProviderSearchResult[] {\n const results: PerfUI.FlameChart.DataProviderSearchResult[] = [];\n for (let i = 0; i < this.#events.length; i++) {\n const entry = this.#events.at(i);\n if (!entry) {\n continue;\n }\n\n if (!Trace.Helpers.Timing.eventIsInBounds(entry, visibleWindow)) {\n continue;\n }\n\n if (!filter || filter.accept(entry, this.#parsedTrace ?? undefined)) {\n const startTimeMilli = Trace.Helpers.Timing.microSecondsToMilliseconds(entry.ts);\n results.push({startTimeMilli, index: i, provider: 'network'});\n }\n }\n return results;\n }\n\n /**\n * Returns a map of navigations that happened in the main frame, ignoring any\n * that happened in other frames.\n * The map's key is the frame ID.\n **/\n mainFrameNavigationStartEvents(): readonly Trace.Types.Events.NavigationStart[] {\n if (!this.#parsedTrace) {\n return [];\n }\n return this.#parsedTrace.Meta.mainFrameNavigations;\n }\n\n buildFlowForInitiator(entryIndex: number): boolean {\n if (!this.#parsedTrace) {\n return false;\n }\n if (!this.#timelineDataInternal) {\n return false;\n }\n if (this.#lastInitiatorEntry === entryIndex) {\n if (this.#lastInitiatorsData) {\n this.#timelineDataInternal.initiatorsData = this.#lastInitiatorsData;\n }\n return true;\n }\n if (!this.#networkTrackAppender) {\n return false;\n }\n\n // Remove all previously assigned decorations indicating that the flow event entries are hidden\n const previousInitiatorsDataLength = this.#timelineDataInternal.initiatorsData.length;\n // |entryIndex| equals -1 means there is no entry selected, just clear the\n // initiator cache if there is any previous arrow and return true to\n // re-render.\n if (entryIndex === -1) {\n this.#lastInitiatorEntry = entryIndex;\n if (previousInitiatorsDataLength === 0) {\n // This means there is no arrow before, so we don't need to re-render.\n return false;\n }\n // Reset to clear any previous arrows from the last event.\n this.#timelineDataInternal.resetFlowData();\n return true;\n }\n\n const event = this.#events[entryIndex];\n // Reset to clear any previous arrows from the last event.\n this.#timelineDataInternal.resetFlowData();\n this.#lastInitiatorEntry = entryIndex;\n\n const initiatorsData = initiatorsDataToDrawForNetwork(this.#parsedTrace, event);\n // This means there is no change for arrows.\n if (previousInitiatorsDataLength === 0 && initiatorsData.length === 0) {\n return false;\n }\n for (const initiatorData of initiatorsData) {\n const eventIndex = this.indexForEvent(initiatorData.event);\n const initiatorIndex = this.indexForEvent(initiatorData.initiator);\n if (eventIndex === null || initiatorIndex === null) {\n continue;\n }\n this.#timelineDataInternal.initiatorsData.push({\n initiatorIndex,\n eventIndex,\n });\n }\n this.#lastInitiatorsData = this.#timelineDataInternal.initiatorsData;\n return true;\n }\n}\n"]} \ No newline at end of file +{"version":3,"file":"TimelineFlameChartNetworkDataProvider.js","sourceRoot":"","sources":["../../../../../../front_end/panels/timeline/TimelineFlameChartNetworkDataProvider.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,KAAK,IAAI,MAAM,yBAAyB,CAAC;AAChD,OAAO,KAAK,QAAQ,MAAM,iCAAiC,CAAC;AAC5D,OAAO,KAAK,KAAK,MAAM,6BAA6B,CAAC;AACrD,OAAO,KAAK,MAAM,MAAM,+CAA+C,CAAC;AACxE,OAAO,KAAK,EAAE,MAAM,2BAA2B,CAAC;AAChD,OAAO,KAAK,YAAY,MAAM,gDAAgD,CAAC;AAE/E,OAAO,KAAK,kBAAkB,MAAM,4BAA4B,CAAC;AACjE,OAAO,EAAC,8BAA8B,EAAC,MAAM,iBAAiB,CAAC;AAC/D,OAAO,EAAC,oBAAoB,EAAC,MAAM,2BAA2B,CAAC;AAC/D,OAAO,EAAC,oBAAoB,EAAyB,MAAM,2BAA2B,CAAC;AACvF,OAAO,+BAA+B,MAAM,oCAAoC,CAAC;AACjF,OAAO,EAAC,eAAe,EAAE,SAAS,EAAC,MAAM,6BAA6B,CAAC;AACvE,OAAO,EACL,kBAAkB,EAClB,gBAAgB,EAChB,eAAe,GAEhB,MAAM,wBAAwB,CAAC;AAChC,OAAO,KAAK,aAAa,MAAM,kBAAkB,CAAC;AAElD,MAAM,OAAO,qCAAqC;IAChD,gBAAgB,GAAW,CAAC,CAAC;IAC7B,SAAS,GAAW,CAAC,CAAC;IACtB,OAAO,GAAwB,EAAE,CAAC;IAClC,SAAS,GAAW,CAAC,CAAC;IACtB,qBAAqB,GAA8B,IAAI,CAAC;IAExD,qBAAqB,GAAkD,IAAI,CAAC;IAC5E,cAAc,GAAmB,IAAI,CAAC;IACtC,YAAY,GAA0C,IAAI,CAAC;IAC3D,kBAAkB,GAAwC,IAAI,GAAG,EAAE,CAAC;IACpE,iCAAiC;IACjC,mBAAmB,GAAW,C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U;aACX,CAAC,CAAC;QACL,CAAC;QACD,IAAI,CAAC,mBAAmB,GAAG,IAAI,CAAC,qBAAqB,CAAC,cAAc,CAAC;QACrE,OAAO,IAAI,CAAC;IACd,CAAC;CACF","sourcesContent":["// Copyright 2016 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport * as i18n from '../../core/i18n/i18n.js';\nimport * as Platform from '../../core/platform/platform.js';\nimport * as Trace from '../../models/trace/trace.js';\nimport * as PerfUI from '../../ui/legacy/components/perf_ui/perf_ui.js';\nimport * as UI from '../../ui/legacy/legacy.js';\nimport * as ThemeSupport from '../../ui/legacy/theme_support/theme_support.js';\n\nimport * as TimelineComponents from './components/components.js';\nimport {initiatorsDataToDrawForNetwork} from './Initiators.js';\nimport {ModificationsManager} from './ModificationsManager.js';\nimport {NetworkTrackAppender, type NetworkTrackEvent} from './NetworkTrackAppender.js';\nimport timelineFlamechartPopoverStyles from './timelineFlamechartPopover.css.js';\nimport {FlameChartStyle, Selection} from './TimelineFlameChartView.js';\nimport {\n selectionFromEvent,\n selectionIsRange,\n selectionsEqual,\n type TimelineSelection,\n} from './TimelineSelection.js';\nimport * as TimelineUtils from './utils/utils.js';\n\nexport class TimelineFlameChartNetworkDataProvider implements PerfUI.FlameChart.FlameChartDataProvider {\n #minimumBoundary: number = 0;\n #timeSpan: number = 0;\n #events: NetworkTrackEvent[] = [];\n #maxLevel: number = 0;\n #networkTrackAppender: NetworkTrackAppender|null = null;\n\n #timelineDataInternal: PerfUI.FlameChart.FlameChartTimelineData|null = null;\n #lastSelection: Selection|null = null;\n #parsedTrace: Trace.Handlers.Types.ParsedTrace|null = null;\n #eventIndexByEvent: Map = new Map();\n // -1 means no entry is selected.\n #lastInitiatorEntry: number = -1;\n #lastInitiatorsData: PerfUI.FlameChart.FlameChartInitiatorData[] = [];\n\n constructor() {\n this.reset();\n }\n\n // Reset all data other than the UI elements.\n // This should be called when\n // - initialized the data provider\n // - a new trace file is coming (when `setModel()` is called)\n // etc.\n reset(): void {\n this.#maxLevel = 0;\n this.#minimumBoundary = 0;\n this.#timeSpan = 0;\n this.#eventIndexByEvent.clear();\n this.#events = [];\n this.#timelineDataInternal = null;\n this.#parsedTrace = null;\n\n this.#networkTrackAppender = null;\n }\n\n setModel(parsedTrace: Trace.Handlers.Types.ParsedTrace): void {\n this.reset();\n this.#parsedTrace = parsedTrace;\n\n this.setEvents(this.#parsedTrace);\n this.#setTimingBoundsData(this.#parsedTrace);\n }\n\n setEvents(parsedTrace: Trace.Handlers.Types.ParsedTrace): void {\n if (parsedTrace.NetworkRequests.webSocket) {\n parsedTrace.NetworkRequests.webSocket.forEach(webSocketData => {\n if (webSocketData.syntheticConnection) {\n this.#events.push(webSocketData.syntheticConnection);\n }\n this.#events.push(...webSocketData.events);\n });\n }\n if (parsedTrace.NetworkRequests.byTime) {\n this.#events.push(...parsedTrace.NetworkRequests.byTime);\n }\n }\n\n isEmpty(): boolean {\n this.timelineData();\n return !this.#events.length;\n }\n\n maxStackDepth(): number {\n return this.#maxLevel;\n }\n\n hasTrackConfigurationMode(): boolean {\n return false;\n }\n\n timelineData(): PerfUI.FlameChart.FlameChartTimelineData {\n if (this.#timelineDataInternal && this.#timelineDataInternal.entryLevels.length !== 0) {\n // The flame chart data is built already, so return the cached data.\n return this.#timelineDataInternal;\n }\n\n this.#timelineDataInternal = PerfUI.FlameChart.FlameChartTimelineData.createEmpty();\n if (!this.#parsedTrace) {\n return this.#timelineDataInternal;\n }\n\n if (!this.#events.length) {\n this.setEvents(this.#parsedTrace);\n }\n this.#networkTrackAppender = new NetworkTrackAppender(this.#timelineDataInternal, this.#events);\n this.#maxLevel = this.#networkTrackAppender.appendTrackAtLevel(0);\n\n return this.#timelineDataInternal;\n }\n\n minimumBoundary(): number {\n return this.#minimumBoundary;\n }\n\n totalTime(): number {\n return this.#timeSpan;\n }\n\n setWindowTimes(startTime: Trace.Types.Timing.MilliSeconds, endTime: Trace.Types.Timing.MilliSeconds): void {\n this.#updateTimelineData(startTime, endTime);\n }\n\n createSelection(index: number): TimelineSelection|null {\n if (index === -1) {\n return null;\n }\n const event = this.#events[index];\n this.#lastSelection = new Selection(selectionFromEvent(event), index);\n return this.#lastSelection.timelineSelection;\n }\n\n customizedContextMenu(event: MouseEvent, eventIndex: number, _groupIndex: number): UI.ContextMenu.ContextMenu\n |undefined {\n const networkRequest = this.eventByIndex(eventIndex);\n if (!networkRequest || !Trace.Types.Events.isSyntheticNetworkRequest(networkRequest)) {\n return;\n }\n const timelineNetworkRequest = TimelineUtils.NetworkRequest.createTimelineNetworkRequest(networkRequest);\n const contextMenu = new UI.ContextMenu.ContextMenu(event);\n contextMenu.appendApplicableItems(timelineNetworkRequest);\n return contextMenu;\n }\n\n indexForEvent(event: Trace.Types.Events.Event): number|null {\n if (!Trace.Types.Events.isNetworkTrackEntry(event)) {\n return null;\n }\n const fromCache = this.#eventIndexByEvent.get(event);\n // Cached value might be null, which is OK.\n if (fromCache !== undefined) {\n return fromCache;\n }\n const index = this.#events.indexOf(event);\n const result = index > -1 ? index : null;\n this.#eventIndexByEvent.set(event, result);\n return result;\n }\n\n eventByIndex(entryIndex: number): Trace.Types.Events.SyntheticNetworkRequest|Trace.Types.Events.WebSocketEvent|null {\n return this.#events.at(entryIndex) ?? null;\n }\n\n entryHasAnnotations(entryIndex: number): boolean {\n const event = this.eventByIndex(entryIndex);\n if (!event) {\n return false;\n }\n const entryAnnotations = ModificationsManager.activeManager()?.annotationsForEntry(event);\n return entryAnnotations !== undefined && entryAnnotations.length > 0;\n }\n\n deleteAnnotationsForEntry(entryIndex: number): void {\n const event = this.eventByIndex(entryIndex);\n if (!event) {\n return;\n }\n ModificationsManager.activeManager()?.deleteEntryAnnotations(event);\n }\n\n entryIndexForSelection(selection: TimelineSelection|null): number {\n if (!selection || selectionIsRange(selection)) {\n return -1;\n }\n\n if (this.#lastSelection && selectionsEqual(this.#lastSelection.timelineSelection, selection)) {\n return this.#lastSelection.entryIndex;\n }\n\n if (!Trace.Types.Events.isNetworkTrackEntry(selection.event)) {\n return -1;\n }\n\n const index = this.#events.indexOf(selection.event);\n if (index !== -1) {\n this.#lastSelection = new Selection(selectionFromEvent(selection.event), index);\n }\n return index;\n }\n\n groupForEvent(_entryIndex: number): PerfUI.FlameChart.Group|null {\n // Because the network track only contains one group, we don't actually\n // need to do any lookups here.\n const group = this.#networkTrackAppender?.group() ?? null;\n return group;\n }\n\n entryColor(index: number): string {\n if (!this.#networkTrackAppender) {\n throw new Error('networkTrackAppender should not be empty');\n }\n return this.#networkTrackAppender.colorForEvent(this.#events[index]);\n }\n\n textColor(_index: number): string {\n return FlameChartStyle.textColor;\n }\n\n entryTitle(index: number): string|null {\n const event = this.#events[index];\n return TimelineUtils.EntryName.nameForEntry(event);\n }\n\n entryFont(_index: number): string|null {\n return this.#networkTrackAppender?.font() || null;\n }\n\n /**\n * Returns the pixels needed to decorate the event.\n * The pixels compare to the start of the earliest event of the request.\n *\n * Request.beginTime(), which is used in FlameChart to calculate the unclippedBarX\n * v\n * |----------------[ (URL text) waiting time | request ]--------|\n * ^start ^sendStart ^headersEnd ^Finish ^end\n * @param request\n * @param unclippedBarX The start pixel of the request. It is calculated with request.beginTime() in FlameChart.\n * @param timeToPixelRatio\n * @returns the pixels to draw waiting time and left and right whiskers and url text\n */\n getDecorationPixels(\n event: Trace.Types.Events.SyntheticNetworkRequest, unclippedBarX: number,\n timeToPixelRatio: number): {sendStart: number, headersEnd: number, finish: number, start: number, end: number} {\n const beginTime = Trace.Helpers.Timing.microSecondsToMilliseconds(event.ts);\n const timeToPixel = (time: number): number => unclippedBarX + (time - beginTime) * timeToPixelRatio;\n const startTime = Trace.Helpers.Timing.microSecondsToMilliseconds(event.ts);\n const endTime =\n Trace.Helpers.Timing.microSecondsToMilliseconds((event.ts + event.dur) as Trace.Types.Timing.MicroSeconds);\n const sendStartTime = Trace.Helpers.Timing.microSecondsToMilliseconds(event.args.data.syntheticData.sendStartTime);\n const headersEndTime = Trace.Helpers.Timing.microSecondsToMilliseconds(event.args.data.syntheticData.downloadStart);\n const sendStart = Math.max(timeToPixel(sendStartTime), unclippedBarX);\n const headersEnd = Math.max(timeToPixel(headersEndTime), sendStart);\n const finish = Math.max(\n timeToPixel(Trace.Helpers.Timing.microSecondsToMilliseconds(event.args.data.syntheticData.finishTime)),\n headersEnd);\n const start = timeToPixel(startTime);\n const end = Math.max(timeToPixel(endTime), finish);\n\n return {sendStart, headersEnd, finish, start, end};\n }\n\n /**\n * Decorates the entry depends on the type of the event:\n * @param index\n * @param context\n * @param barX The x pixel of the visible part request\n * @param barY The y pixel of the visible part request\n * @param barWidth The width of the visible part request\n * @param barHeight The height of the visible part request\n * @param unclippedBarX The start pixel of the request compare to the visible area. It is calculated with request.beginTime() in FlameChart.\n * @param timeToPixelRatio\n * @returns if the entry needs to be decorate, which is alway true if the request has \"timing\" field\n */\n decorateEntry(\n index: number, context: CanvasRenderingContext2D, _text: string|null, barX: number, barY: number,\n barWidth: number, barHeight: number, unclippedBarX: number, timeToPixelRatio: number): boolean {\n const event = this.#events[index];\n if (Trace.Types.Events.isSyntheticWebSocketConnection(event)) {\n return this.#decorateSyntheticWebSocketConnection(\n index, context, barY, barHeight, unclippedBarX, timeToPixelRatio);\n }\n if (!Trace.Types.Events.isSyntheticNetworkRequest(event)) {\n return false;\n }\n return this.#decorateNetworkRequest(\n index, context, _text, barX, barY, barWidth, barHeight, unclippedBarX, timeToPixelRatio);\n }\n\n /**\n * Decorates the Network Request entry with the following steps:\n * Draw a waiting time between |sendStart| and |headersEnd|\n * By adding a extra transparent white layer\n * Draw a whisk between |start| and |sendStart|\n * Draw a whisk between |finish| and |end|\n * By draw another layer of background color to \"clear\" the area\n * Then draw the whisk\n * Draw the URL after the |sendStart|\n *\n * |----------------[ (URL text) waiting time | request ]--------|\n * ^start ^sendStart ^headersEnd ^Finish ^end\n * */\n #decorateNetworkRequest(\n index: number, context: CanvasRenderingContext2D, _text: string|null, barX: number, barY: number,\n barWidth: number, barHeight: number, unclippedBarX: number, timeToPixelRatio: number): boolean {\n const event = this.#events[index];\n if (!Trace.Types.Events.isSyntheticNetworkRequest(event)) {\n return false;\n }\n const {sendStart, headersEnd, finish, start, end} =\n this.getDecorationPixels(event, unclippedBarX, timeToPixelRatio);\n\n // Draw waiting time.\n context.fillStyle = 'hsla(0, 100%, 100%, 0.8)';\n context.fillRect(sendStart + 0.5, barY + 0.5, headersEnd - sendStart - 0.5, barHeight - 2);\n // Clear portions of initial rect to prepare for the ticks.\n context.fillStyle = ThemeSupport.ThemeSupport.instance().getComputedValue('--sys-color-cdt-base-container');\n context.fillRect(barX, barY - 0.5, sendStart - barX, barHeight);\n context.fillRect(finish, barY - 0.5, barX + barWidth - finish, barHeight);\n\n // Draws left and right whiskers\n function drawTick(begin: number, end: number, y: number): void {\n const /** @const */ tickHeightPx = 6;\n context.moveTo(begin, y - tickHeightPx / 2);\n context.lineTo(begin, y + tickHeightPx / 2);\n context.moveTo(begin, y);\n context.lineTo(end, y);\n }\n\n context.beginPath();\n context.lineWidth = 1;\n context.strokeStyle = '#ccc';\n const lineY = Math.floor(barY + barHeight / 2) + 0.5;\n const leftTick = start + 0.5;\n const rightTick = end - 0.5;\n drawTick(leftTick, sendStart, lineY);\n drawTick(rightTick, finish, lineY);\n context.stroke();\n\n // Draw request URL as text\n const textStart = Math.max(sendStart, 0);\n const textWidth = finish - textStart;\n const /** @const */ minTextWidthPx = 20;\n if (textWidth >= minTextWidthPx) {\n let title = this.entryTitle(index) || '';\n if (event.args.data.fromServiceWorker) {\n title = '⚙ ' + title;\n }\n if (title) {\n const /** @const */ textPadding = 4;\n const /** @const */ textBaseline = 5;\n const textBaseHeight = barHeight - textBaseline;\n const trimmedText = UI.UIUtils.trimTextEnd(context, title, textWidth - 2 * textPadding);\n context.fillStyle = '#333';\n context.fillText(trimmedText, textStart + textPadding, barY + textBaseHeight);\n }\n }\n\n return true;\n }\n\n /**\n * Decorates the synthetic websocket event entry with a whisk from the start to the end.\n * ------------------------\n * ^start ^end\n * */\n #decorateSyntheticWebSocketConnection(\n index: number, context: CanvasRenderingContext2D, barY: number, barHeight: number, unclippedBarX: number,\n timeToPixelRatio: number): boolean {\n context.save();\n const event = this.#events[index] as Trace.Types.Events.SyntheticWebSocketConnection;\n const beginTime = Trace.Helpers.Timing.microSecondsToMilliseconds(event.ts);\n const timeToPixel = (time: number): number => Math.floor(unclippedBarX + (time - beginTime) * timeToPixelRatio);\n const endTime =\n Trace.Helpers.Timing.microSecondsToMilliseconds((event.ts + event.dur) as Trace.Types.Timing.MicroSeconds);\n const start = timeToPixel(beginTime) + 0.5;\n const end = timeToPixel(endTime) - 0.5;\n context.strokeStyle = ThemeSupport.ThemeSupport.instance().getComputedValue('--app-color-rendering');\n\n const lineY = Math.floor(barY + barHeight / 2) + 0.5;\n context.setLineDash([3, 2]);\n context.moveTo(start, lineY - 1);\n context.lineTo(end, lineY - 1);\n context.moveTo(start, lineY + 1);\n context.lineTo(end, lineY + 1);\n context.stroke();\n context.restore();\n return true;\n }\n\n forceDecoration(_index: number): boolean {\n return true;\n }\n\n /**\n *In the FlameChart.ts, when filtering through the events for a level, it starts\n * from the last event of that level and stops when it hit an event that has start\n * time greater than the filtering window.\n * For example, in this websocket level we have A(socket event), B, C, D. If C\n * event has start time greater than the window, the rest of the events (A and B)\n * wont be drawn. So if this level is the force Drawable level, we wont stop at\n * event C and will include the socket event A.\n * */\n forceDrawableLevel(levelIndex: number): boolean {\n return this.#networkTrackAppender?.webSocketIdToLevel.has(levelIndex) || false;\n }\n\n preparePopoverElement(index: number): Element|null {\n const event = this.#events[index];\n if (Trace.Types.Events.isSyntheticNetworkRequest(event)) {\n const element = document.createElement('div');\n const root = UI.UIUtils.createShadowRootWithCoreStyles(element, {cssFile: [timelineFlamechartPopoverStyles]});\n\n const contents = root.createChild('div', 'timeline-flamechart-popover');\n const infoElement = new TimelineComponents.NetworkRequestTooltip.NetworkRequestTooltip();\n infoElement.networkRequest = event;\n contents.appendChild(infoElement);\n return element;\n }\n return null;\n }\n\n /**\n * Sets the minimum time and total time span of a trace using the\n * new engine data.\n */\n #setTimingBoundsData(newParsedTrace: Trace.Handlers.Types.ParsedTrace): void {\n const {traceBounds} = newParsedTrace.Meta;\n const minTime = Trace.Helpers.Timing.microSecondsToMilliseconds(traceBounds.min);\n const maxTime = Trace.Helpers.Timing.microSecondsToMilliseconds(traceBounds.max);\n this.#minimumBoundary = minTime;\n this.#timeSpan = minTime === maxTime ? 1000 : maxTime - this.#minimumBoundary;\n }\n\n /**\n * When users zoom in the flamechart, we only want to show them the network\n * requests between startTime and endTime. This function will call the\n * trackAppender to update the timeline data, and then force to create a new\n * PerfUI.FlameChart.FlameChartTimelineData instance to force the flamechart\n * to re-render.\n */\n #updateTimelineData(startTime: Trace.Types.Timing.MilliSeconds, endTime: Trace.Types.Timing.MilliSeconds): void {\n if (!this.#networkTrackAppender || !this.#timelineDataInternal) {\n return;\n }\n this.#maxLevel = this.#networkTrackAppender.relayoutEntriesWithinBounds(this.#events, startTime, endTime);\n\n // TODO(crbug.com/1459225): Remove this recreating code.\n // Force to create a new PerfUI.FlameChart.FlameChartTimelineData instance\n // to force the flamechart to re-render. This also causes crbug.com/1459225.\n this.#timelineDataInternal = PerfUI.FlameChart.FlameChartTimelineData.create({\n entryLevels: this.#timelineDataInternal?.entryLevels,\n entryTotalTimes: this.#timelineDataInternal?.entryTotalTimes,\n entryStartTimes: this.#timelineDataInternal?.entryStartTimes,\n groups: this.#timelineDataInternal?.groups,\n initiatorsData: this.#timelineDataInternal.initiatorsData,\n entryDecorations: this.#timelineDataInternal.entryDecorations,\n });\n }\n\n preferredHeight(): number {\n if (!this.#networkTrackAppender || this.#maxLevel === 0) {\n return 0;\n }\n const group = this.#networkTrackAppender.group();\n if (!group) {\n return 0;\n }\n // Bump up to 7 because the tooltip is around 7 rows' height.\n return group.style.height * (this.isExpanded() ? Platform.NumberUtilities.clamp(this.#maxLevel + 1, 7, 8.5) : 1);\n }\n\n isExpanded(): boolean {\n return Boolean(this.#networkTrackAppender?.group()?.expanded);\n }\n\n formatValue(value: number, precision?: number): string {\n return i18n.TimeUtilities.preciseMillisToString(value, precision);\n }\n\n canJumpToEntry(_entryIndex: number): boolean {\n return false;\n }\n\n /**\n * searches entries within the specified time and returns a list of entry\n * indexes\n */\n search(\n visibleWindow: Trace.Types.Timing.TraceWindowMicroSeconds,\n filter?: Trace.Extras.TraceFilter.TraceFilter,\n ): PerfUI.FlameChart.DataProviderSearchResult[] {\n const results: PerfUI.FlameChart.DataProviderSearchResult[] = [];\n for (let i = 0; i < this.#events.length; i++) {\n const entry = this.#events.at(i);\n if (!entry) {\n continue;\n }\n\n if (!Trace.Helpers.Timing.eventIsInBounds(entry, visibleWindow)) {\n continue;\n }\n\n if (!filter || filter.accept(entry, this.#parsedTrace ?? undefined)) {\n const startTimeMilli = Trace.Helpers.Timing.microSecondsToMilliseconds(entry.ts);\n results.push({startTimeMilli, index: i, provider: 'network'});\n }\n }\n return results;\n }\n\n /**\n * Returns a map of navigations that happened in the main frame, ignoring any\n * that happened in other frames.\n * The map's key is the frame ID.\n **/\n mainFrameNavigationStartEvents(): readonly Trace.Types.Events.NavigationStart[] {\n if (!this.#parsedTrace) {\n return [];\n }\n return this.#parsedTrace.Meta.mainFrameNavigations;\n }\n\n buildFlowForInitiator(entryIndex: number): boolean {\n if (!this.#parsedTrace) {\n return false;\n }\n if (!this.#timelineDataInternal) {\n return false;\n }\n if (this.#lastInitiatorEntry === entryIndex) {\n if (this.#lastInitiatorsData) {\n this.#timelineDataInternal.initiatorsData = this.#lastInitiatorsData;\n }\n return true;\n }\n if (!this.#networkTrackAppender) {\n return false;\n }\n\n // Remove all previously assigned decorations indicating that the flow event entries are hidden\n const previousInitiatorsDataLength = this.#timelineDataInternal.initiatorsData.length;\n // |entryIndex| equals -1 means there is no entry selected, just clear the\n // initiator cache if there is any previous arrow and return true to\n // re-render.\n if (entryIndex === -1) {\n this.#lastInitiatorEntry = entryIndex;\n if (previousInitiatorsDataLength === 0) {\n // This means there is no arrow before, so we don't need to re-render.\n return false;\n }\n // Reset to clear any previous arrows from the last event.\n this.#timelineDataInternal.resetFlowData();\n return true;\n }\n\n const event = this.#events[entryIndex];\n // Reset to clear any previous arrows from the last event.\n this.#timelineDataInternal.resetFlowData();\n this.#lastInitiatorEntry = entryIndex;\n\n const initiatorsData = initiatorsDataToDrawForNetwork(this.#parsedTrace, event);\n // This means there is no change for arrows.\n if (previousInitiatorsDataLength === 0 && initiatorsData.length === 0) {\n return false;\n }\n for (const initiatorData of initiatorsData) {\n const eventIndex = this.indexForEvent(initiatorData.event);\n const initiatorIndex = this.indexForEvent(initiatorData.initiator);\n if (eventIndex === null || initiatorIndex === null) {\n continue;\n }\n this.#timelineDataInternal.initiatorsData.push({\n initiatorIndex,\n eventIndex,\n });\n }\n this.#lastInitiatorsData = this.#timelineDataInternal.initiatorsData;\n return true;\n }\n}\n"]} \ No newline at end of file diff --git a/public/panels/timeline/TimelineFlameChartNetworkDataProvider.test.js b/public/panels/timeline/TimelineFlameChartNetworkDataProvider.test.js index a7a57c506..089cbb2de 100644 --- a/public/panels/timeline/TimelineFlameChartNetworkDataProvider.test.js +++ b/public/panels/timeline/TimelineFlameChartNetworkDataProvider.test.js @@ -14,7 +14,7 @@ describeWithEnvironment('TimelineFlameChartNetworkDataProvider', function () { dataProvider.setModel(parsedTrace); dataProvider.setWindowTimes(minTime, maxTime); // TimelineFlameChartNetworkDataProvider only has network track, so should always be one track group. - assert.strictEqual(dataProvider.timelineData().groups.length, 1); + assert.lengthOf(dataProvider.timelineData().groups, 1); const networkTrackGroup = dataProvider.timelineData().groups[0]; assert.deepEqual(dataProvider.minimumBoundary(), minTime); assert.deepEqual(dataProvider.totalTime(), maxTime - minTime); @@ -24,7 +24,7 @@ describeWithEnvironment('TimelineFlameChartNetworkDataProvider', function () { const { startTime, endTime } = Trace.Helpers.Timing.eventTimingsMilliSeconds(request); return endTime - startTime; }); - assert.deepEqual(dataProvider.timelineData().entryLevels.length, 6); + assert.lengthOf(dataProvider.timelineData().entryLevels, 6); assert.deepEqual(dataProvider.timelineData().entryLevels, [0, 1, 1, 1, 1, 2]); assertTimestampsEqual(dataProvider.timelineData().entryStartTimes, networkEventsStartTimes); assertTimestampsEqual(dataProvider.timelineData().entryTotalTimes, networkEventsTotalTimes); @@ -78,7 +78,7 @@ describeWithEnvironment('TimelineFlameChartNetworkDataProvider', function () { dataProvider.setModel(parsedTrace); dataProvider.setWindowTimes(minTime, maxTime); // Network track appender won't append the network track if there is no network requests. - assert.strictEqual(dataProvider.timelineData().groups.length, 0); + assert.lengthOf(dataProvider.timelineData().groups, 0); assert.deepEqual(dataProvider.minimumBoundary(), minTime); assert.deepEqual(dataProvider.totalTime(), maxTime - minTime); assert.deepEqual(dataProvider.timelineData().entryLevels, []); diff --git a/public/panels/timeline/TimelineFlameChartNetworkDataProvider.test.js.map b/public/panels/timeline/TimelineFlameChartNetworkDataProvider.test.js.map index b3e8890bb..ab9029f08 100644 --- a/public/panels/timeline/TimelineFlameChartNetworkDataProvider.test.js.map +++ b/public/panels/timeline/TimelineFlameChartNetworkDataProvider.test.js.map @@ -1 +1 @@ -{"version":3,"file":"TimelineFlameChartNetworkDataProvider.test.js","sourceRoot":"","sources":["../../../../../../front_end/panels/timeline/TimelineFlameChartNetworkDataProvider.test.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,KAAK,KAAK,MAAM,6BAA6B,CAAC;AACrD,OAAO,EAAC,uBAAuB,EAAC,MAAM,qCAAqC,CAAC;AAC5E,OAAO,EAAC,WAAW,EAAC,MAAM,8BAA8B,CAAC;AAEzD,OAAO,KAAK,QAAQ,MAAM,eAAe,CAAC;AAE1C,uBAAuB,CAAC,uCAAuC,EAAE;IAC/D,EAAE,CAAC,qCAAqC,EAAE,KAAK;QAC7C,MAAM,YAAY,GAAG,IAAI,QAAQ,CAAC,qCAAqC,CAAC,qCAAqC,EAAE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C,UAAU,CAAC,CAAC,CAAC;QAE5D,mCAAmC;QACnC,YAAY,CAAC,yBAAyB,CAAC,UAAU,CAAC,CAAC;QAEnD,gDAAgD;QAChD,MAAM,CAAC,OAAO,CAAC,YAAY,CAAC,mBAAmB,CAAC,UAAU,CAAC,CAAC,CAAC;IAC/D,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC;AAEH,SAAS,oBAAoB,CAAC,MAAc,EAAE,QAAgB;IAC5D,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC;AAC7D,CAAC;AAED,SAAS,qBAAqB,CAAC,MAA0C,EAAE,QAAkB;IAC3F,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;IAEnD,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QACvC,oBAAoB,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;IAC/C,CAAC;AACH,CAAC","sourcesContent":["// Copyright 2023 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport * as Trace from '../../models/trace/trace.js';\nimport {describeWithEnvironment} from '../../testing/EnvironmentHelpers.js';\nimport {TraceLoader} from '../../testing/TraceLoader.js';\n\nimport * as Timeline from './timeline.js';\n\ndescribeWithEnvironment('TimelineFlameChartNetworkDataProvider', function() {\n it('renders the network track correctly', async function() {\n const dataProvider = new Timeline.TimelineFlameChartNetworkDataProvider.TimelineFlameChartNetworkDataProvider();\n const {parsedTrace} = await TraceLoader.traceEngine(this, 'load-simple.json.gz');\n\n const minTime = Trace.Helpers.Timing.microSecondsToMilliseconds(parsedTrace.Meta.traceBounds.min);\n const maxTime = Trace.Helpers.Timing.microSecondsToMilliseconds(parsedTrace.Meta.traceBounds.max);\n\n dataProvider.setModel(parsedTrace);\n dataProvider.setWindowTimes(minTime, maxTime);\n\n // TimelineFlameChartNetworkDataProvider only has network track, so should always be one track group.\n assert.strictEqual(dataProvider.timelineData().groups.length, 1);\n const networkTrackGroup = dataProvider.timelineData().groups[0];\n\n assert.deepEqual(dataProvider.minimumBoundary(), minTime);\n assert.deepEqual(dataProvider.totalTime(), maxTime - minTime);\n\n const networkEvents = parsedTrace.NetworkRequests.byTime;\n const networkEventsStartTimes =\n networkEvents.map(request => Trace.Helpers.Timing.microSecondsToMilliseconds(request.ts));\n const networkEventsTotalTimes = networkEvents.map(request => {\n const {startTime, endTime} = Trace.Helpers.Timing.eventTimingsMilliSeconds(request);\n return endTime - startTime;\n });\n assert.deepEqual(dataProvider.timelineData().entryLevels.length, 6);\n assert.deepEqual(dataProvider.timelineData().entryLevels, [0, 1, 1, 1, 1, 2]);\n assertTimestampsEqual(dataProvider.timelineData().entryStartTimes, networkEventsStartTimes);\n assertTimestampsEqual(dataProvider.timelineData().entryTotalTimes, networkEventsTotalTimes);\n\n assert.deepEqual(dataProvider.maxStackDepth(), 3);\n\n // The decorateEntry() will be handled in the TimelineFlameChartNetworkDataProvider, so this function always returns true.\n assert.isTrue(dataProvider.forceDecoration(0));\n\n assert.isFalse(dataProvider.isEmpty());\n\n // The network track is default to collapsed.\n assert.isFalse(dataProvider.isExpanded());\n // The height of collapsed network track style is 17.\n assert.strictEqual(dataProvider.preferredHeight(), 17);\n networkTrackGroup.expanded = true;\n assert.isTrue(dataProvider.isExpanded());\n // The max level here is 3, so `clamp(this.#maxLevel + 1, 7, 8.5)` = 7\n assert.strictEqual(dataProvider.preferredHeight(), 17 * 7);\n });\n\n it('can return the group for a given entryIndex', async function() {\n const dataProvider = new Timeline.TimelineFlameChartNetworkDataProvider.TimelineFlameChartNetworkDataProvider();\n const {parsedTrace} = await TraceLoader.traceEngine(this, 'load-simple.json.gz');\n dataProvider.setModel(parsedTrace);\n dataProvider.timelineData();\n\n assert.strictEqual(\n dataProvider.groupForEvent(0)?.name,\n 'Network',\n );\n });\n\n it('filters navigations to only return those that happen on the main frame', async function() {\n const dataProvider = new Timeline.TimelineFlameChartNetworkDataProvider.TimelineFlameChartNetworkDataProvider();\n const {parsedTrace} = await TraceLoader.traceEngine(this, 'multiple-navigations-with-iframes.json.gz');\n\n const minTime = Trace.Helpers.Timing.microSecondsToMilliseconds(parsedTrace.Meta.traceBounds.min);\n const maxTime = Trace.Helpers.Timing.microSecondsToMilliseconds(parsedTrace.Meta.traceBounds.max);\n\n dataProvider.setModel(parsedTrace);\n dataProvider.setWindowTimes(minTime, maxTime);\n\n const mainFrameID = parsedTrace.Meta.mainFrameId;\n const navigationEvents = dataProvider.mainFrameNavigationStartEvents();\n // Ensure that every navigation event that we return is for the main frame.\n assert.isTrue(navigationEvents.every(navEvent => {\n return navEvent.args.frame === mainFrameID;\n }));\n });\n\n it('can provide the index for an event and the event for a given index', async function() {\n const dataProvider = new Timeline.TimelineFlameChartNetworkDataProvider.TimelineFlameChartNetworkDataProvider();\n const {parsedTrace} = await TraceLoader.traceEngine(this, 'web-dev.json.gz');\n dataProvider.setModel(parsedTrace);\n\n const event = dataProvider.eventByIndex(0);\n assert.isOk(event);\n assert.strictEqual(dataProvider.indexForEvent(event), 0);\n });\n\n it('does not render the network track if there is no network requests', async function() {\n const dataProvider = new Timeline.TimelineFlameChartNetworkDataProvider.TimelineFlameChartNetworkDataProvider();\n const {parsedTrace} = await TraceLoader.traceEngine(this, 'basic.json.gz');\n\n const minTime = Trace.Helpers.Timing.microSecondsToMilliseconds(parsedTrace.Meta.traceBounds.min);\n const maxTime = Trace.Helpers.Timing.microSecondsToMilliseconds(parsedTrace.Meta.traceBounds.max);\n\n dataProvider.setModel(parsedTrace);\n dataProvider.setWindowTimes(minTime, maxTime);\n\n // Network track appender won't append the network track if there is no network requests.\n assert.strictEqual(dataProvider.timelineData().groups.length, 0);\n\n assert.deepEqual(dataProvider.minimumBoundary(), minTime);\n assert.deepEqual(dataProvider.totalTime(), maxTime - minTime);\n\n assert.deepEqual(dataProvider.timelineData().entryLevels, []);\n assert.deepEqual(dataProvider.timelineData().entryStartTimes, []);\n assert.deepEqual(dataProvider.timelineData().entryTotalTimes, []);\n\n assert.deepEqual(dataProvider.maxStackDepth(), 0);\n\n // The decorateEntry() will be handled in the TimelineFlameChartNetworkDataProvider, so this function always returns true.\n assert.isTrue(dataProvider.forceDecoration(0));\n\n // The network track won't show if it is empty.\n assert.isTrue(dataProvider.isEmpty());\n\n assert.strictEqual(dataProvider.preferredHeight(), 0);\n });\n\n it('decorate a event correctly', async function() {\n const dataProvider = new Timeline.TimelineFlameChartNetworkDataProvider.TimelineFlameChartNetworkDataProvider();\n const {parsedTrace} = await TraceLoader.traceEngine(this, 'cls-cluster-max-timeout.json.gz');\n // The field that is important of this test:\n // {\n // \"ts\": 183752441.977,\n // \"dur\": 183752670.454,\n // \"finishTime\": 183752669.23299998,\n // ...\n // \"timing\": {\n // \"pushStart\": 0,\n // \"receiveHeadersEnd\": 218.084,\n // \"requestTime\": 183752.449687,\n // \"sendEnd\": 13.01,\n // \"sendStart\": 12.792,\n // ...\n // },\n // \"priority\": \"VeryHigh\",\n // \"responseTime\": 1634222299.776\n // ...\n // }\n const event = parsedTrace.NetworkRequests.byTime[1];\n // So for this request:\n // The earliest event belonging to this request starts at 183752441.977.\n // This is used in flamechart to calculate unclippedBarX.\n // Start time is 183752441.977\n // End time is 183752670.454\n // Finish time is 183752669.233\n // request time is 183752.449687, but it is in second, so 183752449.687\n // in milliseconds.\n // sendStartTime is requestTime + sendStart = 183752462.479\n // headersEndTime is requestTime + receiveHeadersEnd = 183752667.771\n //\n // To calculate the pixel of a timestamp, we substrate the begin time from\n // it, then multiple the timeToPixelRatio and then add the unclippedBarX.\n // Then get the floor of the pixel.\n // So the pixel of sendStart is (183752462.479 - 183752441.977) + 10, in ts it will be 30.502000004053116.\n // So the pixel of headersEnd is (183752667.771 - 183752441.977) + 10, in ts it will be 235.79399999976158.\n // So the pixel of finish is (183752669.233 - 183752441.977) + 10, in ts it will be 237.25600001215935.\n // So the pixel of start is (183752441.977 - 183752441.977) + 10 = 10.\n // So the pixel of end is (183752670.454 - 183752441.977) + 10, in ts it will be 238.47699999809265.\n assert.deepEqual(dataProvider.getDecorationPixels(event, /* unclippedBarX= */ 10, /* timeToPixelRatio= */ 1), {\n sendStart: (183752462.479 - 183752441.977) + 10,\n headersEnd: (183752667.771 - 183752441.977) + 10,\n finish: (183752669.233 - 183752441.977) + 10,\n start: 10,\n end: (183752670.454 - 183752441.977) + 10,\n });\n });\n\n it('can search for entries within a given time-range', async function() {\n const dataProvider = new Timeline.TimelineFlameChartNetworkDataProvider.TimelineFlameChartNetworkDataProvider();\n const {parsedTrace} = await TraceLoader.traceEngine(this, 'web-dev-with-commit.json.gz');\n dataProvider.setModel(parsedTrace);\n const boundsMs = Trace.Helpers.Timing.traceWindowMilliSeconds(parsedTrace.Meta.traceBounds);\n dataProvider.setWindowTimes(boundsMs.min, boundsMs.max);\n\n const filter = new Timeline.TimelineFilters.TimelineRegExp(/app\\.js/i);\n const results = dataProvider.search(parsedTrace.Meta.traceBounds, filter);\n assert.lengthOf(results, 1);\n assert.deepEqual(results[0], {index: 8, startTimeMilli: 122411056.533, provider: 'network'});\n });\n\n it('delete annotations associated with an event', async function() {\n const dataProvider = new Timeline.TimelineFlameChartNetworkDataProvider.TimelineFlameChartNetworkDataProvider();\n const {parsedTrace} = await TraceLoader.traceEngine(this, 'web-dev-with-commit.json.gz');\n dataProvider.setModel(parsedTrace);\n const entryIndex = 0;\n const eventToFindAssociatedEntriesFor = dataProvider.eventByIndex(entryIndex);\n const event = dataProvider.eventByIndex(1);\n assert.exists(eventToFindAssociatedEntriesFor);\n assert.exists(event);\n\n // This link annotation should be deleted\n Timeline.ModificationsManager.ModificationsManager.activeManager()?.createAnnotation({\n type: 'ENTRIES_LINK',\n entryFrom: eventToFindAssociatedEntriesFor,\n entryTo: event,\n state: Trace.Types.File.EntriesLinkState.CONNECTED,\n });\n\n Timeline.ModificationsManager.ModificationsManager.activeManager()?.createAnnotation({\n type: 'ENTRY_LABEL',\n entry: event,\n label: 'label',\n });\n\n dataProvider.deleteAnnotationsForEntry(entryIndex);\n // Make sure one of the annotations was deleted\n assert.deepEqual(Timeline.ModificationsManager.ModificationsManager.activeManager()?.getAnnotations().length, 1);\n });\n\n it('correctly identifies if an event has annotations', async function() {\n const dataProvider = new Timeline.TimelineFlameChartNetworkDataProvider.TimelineFlameChartNetworkDataProvider();\n const {parsedTrace} = await TraceLoader.traceEngine(this, 'web-dev-with-commit.json.gz');\n dataProvider.setModel(parsedTrace);\n const eventIndex = 0;\n const event = dataProvider.eventByIndex(eventIndex);\n const event2 = dataProvider.eventByIndex(1);\n assert.exists(event);\n assert.exists(event2);\n\n // Create a link between events\n Timeline.ModificationsManager.ModificationsManager.activeManager()?.createAnnotation({\n type: 'ENTRIES_LINK',\n entryFrom: event,\n entryTo: event2,\n state: Trace.Types.File.EntriesLinkState.CONNECTED,\n });\n\n // Made sure the event has annotations\n assert.isTrue(dataProvider.entryHasAnnotations(eventIndex));\n\n // Delete annotations for the event\n dataProvider.deleteAnnotationsForEntry(eventIndex);\n\n // Made sure the event does not have annotations\n assert.isFalse(dataProvider.entryHasAnnotations(eventIndex));\n });\n});\n\nfunction assertTimestampEqual(actual: number, expected: number): void {\n assert.strictEqual(actual.toFixed(2), expected.toFixed(2));\n}\n\nfunction assertTimestampsEqual(actual: number[]|Float32Array|Float64Array, expected: number[]): void {\n assert.strictEqual(actual.length, expected.length);\n\n for (let i = 0; i < actual.length; i++) {\n assertTimestampEqual(actual[i], expected[i]);\n }\n}\n"]} \ No newline at end of file +{"version":3,"file":"TimelineFlameChartNetworkDataProvider.test.js","sourceRoot":"","sources":["../../../../../../front_end/panels/timeline/TimelineFlameChartNetworkDataProvider.test.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC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K,CAAC,CAAC;QACrB,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;QAEtB,+BAA+B;QAC/B,QAAQ,CAAC,oBAAoB,CAAC,oBAAoB,CAAC,aAAa,EAAE,EAAE,gBAAgB,CAAC;YACnF,IAAI,EAAE,cAAc;YACpB,SAAS,EAAE,KAAK;YAChB,OAAO,EAAE,MAAM;YACf,KAAK,+DAA6C;SACnD,CAAC,CAAC;QAEH,sCAAsC;QACtC,MAAM,CAAC,MAAM,CAAC,YAAY,CAAC,mBAAmB,CAAC,UAAU,CAAC,CAAC,CAAC;QAE5D,mCAAmC;QACnC,YAAY,CAAC,yBAAyB,CAAC,UAAU,CAAC,CAAC;QAEnD,gDAAgD;QAChD,MAAM,CAAC,OAAO,CAAC,YAAY,CAAC,mBAAmB,CAAC,UAAU,CAAC,CAAC,CAAC;IAC/D,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC;AAEH,SAAS,oBAAoB,CAAC,MAAc,EAAE,QAAgB;IAC5D,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC;AAC7D,CAAC;AAED,SAAS,qBAAqB,CAAC,MAA0C,EAAE,QAAkB;IAC3F,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;IAEnD,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QACvC,oBAAoB,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;IAC/C,CAAC;AACH,CAAC","sourcesContent":["// Copyright 2023 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport * as Trace from '../../models/trace/trace.js';\nimport {describeWithEnvironment} from '../../testing/EnvironmentHelpers.js';\nimport {TraceLoader} from '../../testing/TraceLoader.js';\n\nimport * as Timeline from './timeline.js';\n\ndescribeWithEnvironment('TimelineFlameChartNetworkDataProvider', function() {\n it('renders the network track correctly', async function() {\n const dataProvider = new Timeline.TimelineFlameChartNetworkDataProvider.TimelineFlameChartNetworkDataProvider();\n const {parsedTrace} = await TraceLoader.traceEngine(this, 'load-simple.json.gz');\n\n const minTime = Trace.Helpers.Timing.microSecondsToMilliseconds(parsedTrace.Meta.traceBounds.min);\n const maxTime = Trace.Helpers.Timing.microSecondsToMilliseconds(parsedTrace.Meta.traceBounds.max);\n\n dataProvider.setModel(parsedTrace);\n dataProvider.setWindowTimes(minTime, maxTime);\n\n // TimelineFlameChartNetworkDataProvider only has network track, so should always be one track group.\n assert.lengthOf(dataProvider.timelineData().groups, 1);\n const networkTrackGroup = dataProvider.timelineData().groups[0];\n\n assert.deepEqual(dataProvider.minimumBoundary(), minTime);\n assert.deepEqual(dataProvider.totalTime(), maxTime - minTime);\n\n const networkEvents = parsedTrace.NetworkRequests.byTime;\n const networkEventsStartTimes =\n networkEvents.map(request => Trace.Helpers.Timing.microSecondsToMilliseconds(request.ts));\n const networkEventsTotalTimes = networkEvents.map(request => {\n const {startTime, endTime} = Trace.Helpers.Timing.eventTimingsMilliSeconds(request);\n return endTime - startTime;\n });\n assert.lengthOf(dataProvider.timelineData().entryLevels, 6);\n assert.deepEqual(dataProvider.timelineData().entryLevels, [0, 1, 1, 1, 1, 2]);\n assertTimestampsEqual(dataProvider.timelineData().entryStartTimes, networkEventsStartTimes);\n assertTimestampsEqual(dataProvider.timelineData().entryTotalTimes, networkEventsTotalTimes);\n\n assert.deepEqual(dataProvider.maxStackDepth(), 3);\n\n // The decorateEntry() will be handled in the TimelineFlameChartNetworkDataProvider, so this function always returns true.\n assert.isTrue(dataProvider.forceDecoration(0));\n\n assert.isFalse(dataProvider.isEmpty());\n\n // The network track is default to collapsed.\n assert.isFalse(dataProvider.isExpanded());\n // The height of collapsed network track style is 17.\n assert.strictEqual(dataProvider.preferredHeight(), 17);\n networkTrackGroup.expanded = true;\n assert.isTrue(dataProvider.isExpanded());\n // The max level here is 3, so `clamp(this.#maxLevel + 1, 7, 8.5)` = 7\n assert.strictEqual(dataProvider.preferredHeight(), 17 * 7);\n });\n\n it('can return the group for a given entryIndex', async function() {\n const dataProvider = new Timeline.TimelineFlameChartNetworkDataProvider.TimelineFlameChartNetworkDataProvider();\n const {parsedTrace} = await TraceLoader.traceEngine(this, 'load-simple.json.gz');\n dataProvider.setModel(parsedTrace);\n dataProvider.timelineData();\n\n assert.strictEqual(\n dataProvider.groupForEvent(0)?.name,\n 'Network',\n );\n });\n\n it('filters navigations to only return those that happen on the main frame', async function() {\n const dataProvider = new Timeline.TimelineFlameChartNetworkDataProvider.TimelineFlameChartNetworkDataProvider();\n const {parsedTrace} = await TraceLoader.traceEngine(this, 'multiple-navigations-with-iframes.json.gz');\n\n const minTime = Trace.Helpers.Timing.microSecondsToMilliseconds(parsedTrace.Meta.traceBounds.min);\n const maxTime = Trace.Helpers.Timing.microSecondsToMilliseconds(parsedTrace.Meta.traceBounds.max);\n\n dataProvider.setModel(parsedTrace);\n dataProvider.setWindowTimes(minTime, maxTime);\n\n const mainFrameID = parsedTrace.Meta.mainFrameId;\n const navigationEvents = dataProvider.mainFrameNavigationStartEvents();\n // Ensure that every navigation event that we return is for the main frame.\n assert.isTrue(navigationEvents.every(navEvent => {\n return navEvent.args.frame === mainFrameID;\n }));\n });\n\n it('can provide the index for an event and the event for a given index', async function() {\n const dataProvider = new Timeline.TimelineFlameChartNetworkDataProvider.TimelineFlameChartNetworkDataProvider();\n const {parsedTrace} = await TraceLoader.traceEngine(this, 'web-dev.json.gz');\n dataProvider.setModel(parsedTrace);\n\n const event = dataProvider.eventByIndex(0);\n assert.isOk(event);\n assert.strictEqual(dataProvider.indexForEvent(event), 0);\n });\n\n it('does not render the network track if there is no network requests', async function() {\n const dataProvider = new Timeline.TimelineFlameChartNetworkDataProvider.TimelineFlameChartNetworkDataProvider();\n const {parsedTrace} = await TraceLoader.traceEngine(this, 'basic.json.gz');\n\n const minTime = Trace.Helpers.Timing.microSecondsToMilliseconds(parsedTrace.Meta.traceBounds.min);\n const maxTime = Trace.Helpers.Timing.microSecondsToMilliseconds(parsedTrace.Meta.traceBounds.max);\n\n dataProvider.setModel(parsedTrace);\n dataProvider.setWindowTimes(minTime, maxTime);\n\n // Network track appender won't append the network track if there is no network requests.\n assert.lengthOf(dataProvider.timelineData().groups, 0);\n\n assert.deepEqual(dataProvider.minimumBoundary(), minTime);\n assert.deepEqual(dataProvider.totalTime(), maxTime - minTime);\n\n assert.deepEqual(dataProvider.timelineData().entryLevels, []);\n assert.deepEqual(dataProvider.timelineData().entryStartTimes, []);\n assert.deepEqual(dataProvider.timelineData().entryTotalTimes, []);\n\n assert.deepEqual(dataProvider.maxStackDepth(), 0);\n\n // The decorateEntry() will be handled in the TimelineFlameChartNetworkDataProvider, so this function always returns true.\n assert.isTrue(dataProvider.forceDecoration(0));\n\n // The network track won't show if it is empty.\n assert.isTrue(dataProvider.isEmpty());\n\n assert.strictEqual(dataProvider.preferredHeight(), 0);\n });\n\n it('decorate a event correctly', async function() {\n const dataProvider = new Timeline.TimelineFlameChartNetworkDataProvider.TimelineFlameChartNetworkDataProvider();\n const {parsedTrace} = await TraceLoader.traceEngine(this, 'cls-cluster-max-timeout.json.gz');\n // The field that is important of this test:\n // {\n // \"ts\": 183752441.977,\n // \"dur\": 183752670.454,\n // \"finishTime\": 183752669.23299998,\n // ...\n // \"timing\": {\n // \"pushStart\": 0,\n // \"receiveHeadersEnd\": 218.084,\n // \"requestTime\": 183752.449687,\n // \"sendEnd\": 13.01,\n // \"sendStart\": 12.792,\n // ...\n // },\n // \"priority\": \"VeryHigh\",\n // \"responseTime\": 1634222299.776\n // ...\n // }\n const event = parsedTrace.NetworkRequests.byTime[1];\n // So for this request:\n // The earliest event belonging to this request starts at 183752441.977.\n // This is used in flamechart to calculate unclippedBarX.\n // Start time is 183752441.977\n // End time is 183752670.454\n // Finish time is 183752669.233\n // request time is 183752.449687, but it is in second, so 183752449.687\n // in milliseconds.\n // sendStartTime is requestTime + sendStart = 183752462.479\n // headersEndTime is requestTime + receiveHeadersEnd = 183752667.771\n //\n // To calculate the pixel of a timestamp, we substrate the begin time from\n // it, then multiple the timeToPixelRatio and then add the unclippedBarX.\n // Then get the floor of the pixel.\n // So the pixel of sendStart is (183752462.479 - 183752441.977) + 10, in ts it will be 30.502000004053116.\n // So the pixel of headersEnd is (183752667.771 - 183752441.977) + 10, in ts it will be 235.79399999976158.\n // So the pixel of finish is (183752669.233 - 183752441.977) + 10, in ts it will be 237.25600001215935.\n // So the pixel of start is (183752441.977 - 183752441.977) + 10 = 10.\n // So the pixel of end is (183752670.454 - 183752441.977) + 10, in ts it will be 238.47699999809265.\n assert.deepEqual(dataProvider.getDecorationPixels(event, /* unclippedBarX= */ 10, /* timeToPixelRatio= */ 1), {\n sendStart: (183752462.479 - 183752441.977) + 10,\n headersEnd: (183752667.771 - 183752441.977) + 10,\n finish: (183752669.233 - 183752441.977) + 10,\n start: 10,\n end: (183752670.454 - 183752441.977) + 10,\n });\n });\n\n it('can search for entries within a given time-range', async function() {\n const dataProvider = new Timeline.TimelineFlameChartNetworkDataProvider.TimelineFlameChartNetworkDataProvider();\n const {parsedTrace} = await TraceLoader.traceEngine(this, 'web-dev-with-commit.json.gz');\n dataProvider.setModel(parsedTrace);\n const boundsMs = Trace.Helpers.Timing.traceWindowMilliSeconds(parsedTrace.Meta.traceBounds);\n dataProvider.setWindowTimes(boundsMs.min, boundsMs.max);\n\n const filter = new Timeline.TimelineFilters.TimelineRegExp(/app\\.js/i);\n const results = dataProvider.search(parsedTrace.Meta.traceBounds, filter);\n assert.lengthOf(results, 1);\n assert.deepEqual(results[0], {index: 8, startTimeMilli: 122411056.533, provider: 'network'});\n });\n\n it('delete annotations associated with an event', async function() {\n const dataProvider = new Timeline.TimelineFlameChartNetworkDataProvider.TimelineFlameChartNetworkDataProvider();\n const {parsedTrace} = await TraceLoader.traceEngine(this, 'web-dev-with-commit.json.gz');\n dataProvider.setModel(parsedTrace);\n const entryIndex = 0;\n const eventToFindAssociatedEntriesFor = dataProvider.eventByIndex(entryIndex);\n const event = dataProvider.eventByIndex(1);\n assert.exists(eventToFindAssociatedEntriesFor);\n assert.exists(event);\n\n // This link annotation should be deleted\n Timeline.ModificationsManager.ModificationsManager.activeManager()?.createAnnotation({\n type: 'ENTRIES_LINK',\n entryFrom: eventToFindAssociatedEntriesFor,\n entryTo: event,\n state: Trace.Types.File.EntriesLinkState.CONNECTED,\n });\n\n Timeline.ModificationsManager.ModificationsManager.activeManager()?.createAnnotation({\n type: 'ENTRY_LABEL',\n entry: event,\n label: 'label',\n });\n\n dataProvider.deleteAnnotationsForEntry(entryIndex);\n // Make sure one of the annotations was deleted\n assert.deepEqual(Timeline.ModificationsManager.ModificationsManager.activeManager()?.getAnnotations().length, 1);\n });\n\n it('correctly identifies if an event has annotations', async function() {\n const dataProvider = new Timeline.TimelineFlameChartNetworkDataProvider.TimelineFlameChartNetworkDataProvider();\n const {parsedTrace} = await TraceLoader.traceEngine(this, 'web-dev-with-commit.json.gz');\n dataProvider.setModel(parsedTrace);\n const eventIndex = 0;\n const event = dataProvider.eventByIndex(eventIndex);\n const event2 = dataProvider.eventByIndex(1);\n assert.exists(event);\n assert.exists(event2);\n\n // Create a link between events\n Timeline.ModificationsManager.ModificationsManager.activeManager()?.createAnnotation({\n type: 'ENTRIES_LINK',\n entryFrom: event,\n entryTo: event2,\n state: Trace.Types.File.EntriesLinkState.CONNECTED,\n });\n\n // Made sure the event has annotations\n assert.isTrue(dataProvider.entryHasAnnotations(eventIndex));\n\n // Delete annotations for the event\n dataProvider.deleteAnnotationsForEntry(eventIndex);\n\n // Made sure the event does not have annotations\n assert.isFalse(dataProvider.entryHasAnnotations(eventIndex));\n });\n});\n\nfunction assertTimestampEqual(actual: number, expected: number): void {\n assert.strictEqual(actual.toFixed(2), expected.toFixed(2));\n}\n\nfunction assertTimestampsEqual(actual: number[]|Float32Array|Float64Array, expected: number[]): void {\n assert.strictEqual(actual.length, expected.length);\n\n for (let i = 0; i < actual.length; i++) {\n assertTimestampEqual(actual[i], expected[i]);\n }\n}\n"]} \ No newline at end of file diff --git a/public/panels/timeline/TimelineFlameChartView.js b/public/panels/timeline/TimelineFlameChartView.js index d445b1296..76f370444 100644 --- a/public/panels/timeline/TimelineFlameChartView.js +++ b/public/panels/timeline/TimelineFlameChartView.js @@ -266,6 +266,9 @@ export class TimelineFlameChartView extends Common.ObjectWrapper.eventMixin(UI.W this.networkFlameChart.addEventListener("EntryLabelAnnotationAdded" /* PerfUI.FlameChart.Events.ENTRY_LABEL_ANNOTATION_ADDED */, this.onNetworkAddEntryLabelAnnotation, this); this.mainFlameChart.addEventListener("EntriesLinkAnnotationCreated" /* PerfUI.FlameChart.Events.ENTRIES_LINK_ANNOTATION_CREATED */, this.#onMainEntriesLinkAnnotationCreated, this); this.networkFlameChart.addEventListener("EntriesLinkAnnotationCreated" /* PerfUI.FlameChart.Events.ENTRIES_LINK_ANNOTATION_CREATED */, this.#onNetworkEntriesLinkAnnotationCreated, this); + this.mainFlameChart.addEventListener("TracksReorderStateChange" /* PerfUI.FlameChart.Events.TRACKS_REORDER_STATE_CHANGED */, event => { + this.#overlays.toggleAllOverlaysDisplayed(!event.data); + }); this.detailsView.addEventListener("TreeRowHovered" /* TimelineTreeView.Events.TREE_ROW_HOVERED */, node => { if (!Root.Runtime.experiments.isEnabled("timeline-dim-unrelated-events" /* Root.Runtime.ExperimentName.TIMELINE_DIM_UNRELATED_EVENTS */)) { return; diff --git a/public/panels/timeline/TimelineFlameChartView.js.map b/public/panels/timeline/TimelineFlameChartView.js.map index dd049d850..fcb56be1f 100644 --- a/public/panels/timeline/TimelineFlameChartView.js.map +++ b/public/panels/timeline/TimelineFlameChartView.js.map @@ -1 +1 @@ -{"version":3,"file":"TimelineFlameChartView.js","sour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AAM,CAAC,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;QACzC,OAAO,CAAC,MAAM,EAAE,CAAC;QAEjB,OAAO,CAAC,OAAO,EAAE,CAAC;IACpB,CAAC;CACF;AAMD;;;GAGG;AACH,MAAM,UAAU,aAAa,CAAC,MAAiC,EAAE,KAAa;IAC5E,MAAM,aAAa,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,UAAU,EAAE,EAAE;QACtD,MAAM,SAAS,GAAG,MAAM,CAAC,EAAE,CAAC,UAAU,GAAG,CAAC,CAAC,CAAC;QAC5C,MAAM,aAAa,GAAG,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,UAAU,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC;QAEtE,OAAO,KAAK,CAAC,UAAU,IAAI,KAAK,IAAI,aAAa,IAAI,KAAK,CAAC;IAC7D,CAAC,CAAC,CAAC;IACH,OAAO,aAAa,IAAI,IAAI,CAAC;AAC/B,CAAC","sourcesContent":["// Copyright 2016 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport * as Common from '../../core/common/common.js';\nimport * as i18n from '../../core/i18n/i18n.js';\nimport * as Platform from '../../core/platform/platform.js';\nimport * as Root from '../../core/root/root.js';\nimport * as SDK from '../../core/sdk/sdk.js';\nimport * as Bindings from '../../models/bindings/bindings.js';\nimport * as Trace from '../../models/trace/trace.js';\nimport * as TraceBounds from '../../services/trace_bounds/trace_bounds.js';\nimport * as PerfUI from '../../ui/legacy/components/perf_ui/perf_ui.js';\nimport * as UI from '../../ui/legacy/legacy.js';\nimport * as VisualLogging from '../../ui/visual_logging/visual_logging.js';\n\nimport {getAnnotationEntries, getAnnotationWindow} from './AnnotationHelpers.js';\nimport type * as TimelineComponents from './components/components.js';\nimport {CountersGraph} from './CountersGraph.js';\nimport {SHOULD_SHOW_EASTER_EGG} from './EasterEgg.js';\nimport {ModificationsManager} from './ModificationsManager.js';\nimport * as OverlayComponents from './overlays/components/components.js';\nimport * as Overlays from './overlays/overlays.js';\nimport {targetForEvent} from './TargetForEvent.js';\nimport {TimelineDetailsView} from './TimelineDetailsView.js';\nimport {TimelineRegExp} from './TimelineFilters.js';\nimport {\n Events as TimelineFlameChartDataProviderEvents,\n TimelineFlameChartDataProvider,\n} from './TimelineFlameChartDataProvider.js';\nimport {TimelineFlameChartNetworkDataProvider} from './TimelineFlameChartNetworkDataProvider.js';\nimport timelineFlameChartViewStyles from './timelineFlameChartView.css.js';\nimport type {TimelineModeViewDelegate} from './TimelinePanel.js';\nimport {\n rangeForSelection,\n selectionFromEvent,\n selectionFromRangeMilliSeconds,\n selectionIsEvent,\n selectionIsRange,\n type TimelineSelection,\n} from './TimelineSelection.js';\nimport {AggregatedTimelineTreeView, TimelineTreeView} from './TimelineTreeView.js';\nimport type {TimelineMarkerStyle} from './TimelineUIUtils.js';\n\nconst UIStrings = {\n /**\n *@description Text in Timeline Flame Chart View of the Performance panel\n *@example {Frame} PH1\n *@example {10ms} PH2\n */\n sAtS: '{PH1} at {PH2}',\n};\nconst str_ = i18n.i18n.registerUIStrings('panels/timeline/TimelineFlameChartView.ts', UIStrings);\nconst i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);\n\n/**\n * This defines the order these markers will be rendered if they are at the\n * same timestamp. The smaller number will be shown first - e.g. so if NavigationStart, MarkFCP,\n * MarkLCPCandidate have the same timestamp, visually we\n * will render [Nav][FCP][DCL][LCP] everytime.\n */\nexport const SORT_ORDER_PAGE_LOAD_MARKERS: Readonly> = {\n [Trace.Types.Events.Name.NAVIGATION_START]: 0,\n [Trace.Types.Events.Name.MARK_LOAD]: 1,\n [Trace.Types.Events.Name.MARK_FCP]: 2,\n [Trace.Types.Events.Name.MARK_DOM_CONTENT]: 3,\n [Trace.Types.Events.Name.MARK_LCP_CANDIDATE]: 4,\n};\n\n// Threshold to match up overlay markers that are off by a tiny amount so they aren't rendered\n// on top of each other.\nconst TIMESTAMP_THRESHOLD_MS = Trace.Types.Timing.MicroSeconds(10);\n\nexport class TimelineFlameChartView extends\n Common.ObjectWrapper.eventMixin(UI.Widget.VBox)\n implements PerfUI.FlameChart.FlameChartDelegate, UI.SearchableView.Searchable {\n private readonly delegate: TimelineModeViewDelegate;\n /**\n * Tracks the indexes of matched entries when the user searches the panel.\n * Defaults to undefined which indicates the user has not searched.\n */\n private searchResults: PerfUI.FlameChart.DataProviderSearchResult[]|undefined = undefined;\n private eventListeners: Common.EventTarget.EventDescriptor[];\n // TODO(crbug.com/1172300) Ignored during the jsdoc to ts migration\n private readonly networkSplitWidget: UI.SplitWidget.SplitWidget;\n private mainDataProvider: TimelineFlameChartDataProvider;\n private readonly mainFlameChart: PerfUI.FlameChart.FlameChart;\n // TODO(crbug.com/1172300) Ignored during the jsdoc to ts migration\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n private readonly networkFlameChartGroupExpansionSetting: Common.Settings.Setting;\n private networkDataProvider: TimelineFlameChartNetworkDataProvider;\n private readonly networkFlameChart: PerfUI.FlameChart.FlameChart;\n private readonly networkPane: UI.Widget.VBox;\n private readonly splitResizer: HTMLElement;\n private readonly chartSplitWidget: UI.SplitWidget.SplitWidget;\n private brickGame?: PerfUI.BrickBreaker.BrickBreaker;\n private readonly countersView: CountersGraph;\n private readonly detailsSplitWidget: UI.SplitWidget.SplitWidget;\n private readonly detailsView: TimelineDetailsView;\n private readonly onMainAddEntryLabelAnnotation: (event: Common.EventTarget.EventTargetEvent<{\n entryIndex: number,\n withLinkCreationButton: boolean,\n }>) => void;\n private readonly onNetworkAddEntryLabelAnnotation: (event: Common.EventTarget.EventTargetEvent<{\n entryIndex: number,\n withLinkCreationButton: boolean,\n }>) => void;\n readonly #onMainEntriesLinkAnnotationCreated:\n (event: Common.EventTarget.EventTargetEvent<{entryFromIndex: number}>) => void;\n readonly #onNetworkEntriesLinkAnnotationCreated:\n (event: Common.EventTarget.EventTargetEvent<{entryFromIndex: number}>) => void;\n private readonly onMainEntrySelected: (event: Common.EventTarget.EventTargetEvent) => void;\n private readonly onNetworkEntrySelected: (event: Common.EventTarget.EventTargetEvent) => void;\n readonly #boundRefreshAfterIgnoreList: () => void;\n #selectedEvents: Trace.Types.Events.Event[]|null;\n // TODO(crbug.com/1172300) Ignored during the jsdoc to ts migration\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n private readonly groupBySetting: Common.Settings.Setting;\n private searchableView!: UI.SearchableView.SearchableView;\n private needsResizeToPreferredHeights?: boolean;\n private selectedSearchResult?: PerfUI.FlameChart.DataProviderSearchResult;\n private searchRegex?: RegExp;\n #parsedTrace: Trace.Handlers.Types.ParsedTrace|null;\n #traceInsightSets: Trace.Insights.Types.TraceInsightSets|null = null;\n #eventToRelatedInsightsMap: TimelineComponents.RelatedInsightChips.EventToRelatedInsightsMap|null = null;\n #selectedGroupName: string|null = null;\n #onTraceBoundsChangeBound = this.#onTraceBoundsChange.bind(this);\n #gameKeyMatches = 0;\n #gameTimeout = setTimeout(() => ({}), 0);\n\n #overlaysContainer: HTMLElement = document.createElement('div');\n #overlays: Overlays.Overlays.Overlays;\n\n // Tracks the in-progress time range annotation when the user alt/option clicks + drags, or when the user uses the keyboard\n #timeRangeSelectionAnnotation: Trace.Types.File.TimeRangeAnnotation|null = null;\n\n // Keep track of the link annotation that hasn't been fully selected yet.\n // We only store it here when only 'entryFrom' has been selected and\n // 'EntryTo' selection still needs to be updated.\n #linkSelectionAnnotation: Trace.Types.File.EntriesLinkAnnotation|null = null;\n\n #currentInsightOverlays: Array = [];\n #activeInsight: TimelineComponents.Sidebar.ActiveInsight|null = null;\n #markers: Array = [];\n\n #tooltipElement = document.createElement('div');\n\n // We use an symbol as the loggable for each group. This is because\n // groups can get re-built at times and we need a common reference to act as\n // the reference for each group that we log. By storing these symbols in\n // a map keyed off the context of the group, we ensure we persist the\n // loggable even if the group gets rebuilt at some point in time.\n #loggableForGroupByLogContext: Map = new Map();\n\n #onMainEntryInvoked: (event: Common.EventTarget.EventTargetEvent) => void;\n #onNetworkEntryInvoked: (event: Common.EventTarget.EventTargetEvent) => void;\n #currentSelection: TimelineSelection|null = null;\n\n constructor(delegate: TimelineModeViewDelegate) {\n super();\n this.element.classList.add('timeline-flamechart');\n\n this.delegate = delegate;\n this.eventListeners = [];\n this.#parsedTrace = null;\n\n const flameChartsContainer = new UI.Widget.VBox();\n flameChartsContainer.element.classList.add('flame-charts-container');\n\n // Create main and network flamecharts.\n this.networkSplitWidget = new UI.SplitWidget.SplitWidget(false, false, 'timeline-flamechart-main-view', 150);\n this.networkSplitWidget.show(flameChartsContainer.element);\n\n this.#overlaysContainer.classList.add('timeline-overlays-container');\n flameChartsContainer.element.appendChild(this.#overlaysContainer);\n\n this.#tooltipElement.classList.add('timeline-entry-tooltip-element');\n flameChartsContainer.element.appendChild(this.#tooltipElement);\n\n // Ensure that the network panel & resizer appears above the main thread.\n this.networkSplitWidget.sidebarElement().style.zIndex = '120';\n\n const mainViewGroupExpansionSetting =\n Common.Settings.Settings.instance().createSetting('timeline-flamechart-main-view-group-expansion', {});\n this.mainDataProvider = new TimelineFlameChartDataProvider();\n this.mainDataProvider.addEventListener(\n TimelineFlameChartDataProviderEvents.DATA_CHANGED, () => this.mainFlameChart.scheduleUpdate());\n this.mainDataProvider.addEventListener(\n TimelineFlameChartDataProviderEvents.FLAME_CHART_ITEM_HOVERED,\n e => this.detailsView.revealEventInTreeView(e.data));\n\n this.mainFlameChart = new PerfUI.FlameChart.FlameChart(this.mainDataProvider, this, {\n groupExpansionSetting: mainViewGroupExpansionSetting,\n // The TimelineOverlays are used for selected elements\n selectedElementOutline: false,\n tooltipElement: this.#tooltipElement,\n useOverlaysForCursorRuler: true,\n });\n this.mainFlameChart.alwaysShowVerticalScroll();\n this.mainFlameChart.enableRuler(false);\n\n this.mainFlameChart.addEventListener(PerfUI.FlameChart.Events.LATEST_DRAW_DIMENSIONS, dimensions => {\n this.#overlays.updateChartDimensions('main', dimensions.data.chart);\n this.#overlays.updateVisibleWindow(dimensions.data.traceWindow);\n void this.#overlays.update();\n });\n\n this.networkFlameChartGroupExpansionSetting =\n Common.Settings.Settings.instance().createSetting('timeline-flamechart-network-view-group-expansion', {});\n this.networkDataProvider = new TimelineFlameChartNetworkDataProvider();\n this.networkFlameChart = new PerfUI.FlameChart.FlameChart(this.networkDataProvider, this, {\n groupExpansionSetting: this.networkFlameChartGroupExpansionSetting,\n // The TimelineOverlays are used for selected elements\n selectedElementOutline: false,\n tooltipElement: this.#tooltipElement,\n useOverlaysForCursorRuler: true,\n });\n this.networkFlameChart.alwaysShowVerticalScroll();\n this.networkFlameChart.addEventListener(PerfUI.FlameChart.Events.LATEST_DRAW_DIMENSIONS, dimensions => {\n this.#overlays.updateChartDimensions('network', dimensions.data.chart);\n this.#overlays.updateVisibleWindow(dimensions.data.traceWindow);\n void this.#overlays.update();\n\n // If the height of the network chart has changed, we need to tell the\n // main flame chart because its tooltips are positioned based in part on\n // the height of the network chart.\n this.mainFlameChart.setTooltipYPixelAdjustment(this.#overlays.networkChartOffsetHeight());\n });\n\n this.mainFlameChart.addEventListener(PerfUI.FlameChart.Events.MOUSE_MOVE, event => {\n void this.#processFlameChartMouseMoveEvent(event.data);\n });\n\n this.networkFlameChart.addEventListener(PerfUI.FlameChart.Events.MOUSE_MOVE, event => {\n void this.#processFlameChartMouseMoveEvent(event.data);\n });\n\n this.#overlays = new Overlays.Overlays.Overlays({\n container: this.#overlaysContainer,\n flameChartsContainers: {\n main: this.mainFlameChart.element,\n network: this.networkFlameChart.element,\n },\n charts: {\n mainChart: this.mainFlameChart,\n mainProvider: this.mainDataProvider,\n networkChart: this.networkFlameChart,\n networkProvider: this.networkDataProvider,\n },\n entryQueries: {\n isEntryCollapsedByUser: (entry: Trace.Types.Events.Event): boolean => {\n return ModificationsManager.activeManager()?.getEntriesFilter().entryIsInvisible(entry) ?? false;\n },\n firstVisibleParentForEntry(entry) {\n return ModificationsManager.activeManager()?.getEntriesFilter().firstVisibleParentEntryForEntry(entry) ??\n null;\n },\n },\n });\n\n this.#overlays.addEventListener(Overlays.Overlays.AnnotationOverlayActionEvent.eventName, event => {\n const {overlay, action} = (event as Overlays.Overlays.AnnotationOverlayActionEvent);\n if (action === 'Remove') {\n // If the overlay removed is the current time range, set it to null so that\n // we would create a new time range overlay and annotation on the next time range selection instead\n // of trying to update the current overlay that does not exist.\n if (ModificationsManager.activeManager()?.getAnnotationByOverlay(overlay) ===\n this.#timeRangeSelectionAnnotation) {\n this.#timeRangeSelectionAnnotation = null;\n }\n ModificationsManager.activeManager()?.removeAnnotationOverlay(overlay);\n } else if (action === 'Update') {\n ModificationsManager.activeManager()?.updateAnnotationOverlay(overlay);\n }\n });\n\n this.element.addEventListener(OverlayComponents.EntriesLinkOverlay.EntryLinkStartCreating.eventName, () => {\n /**\n * When the user creates an entries link, they click on the arrow icon to\n * begin creating it. At this point the arrow icon gets deleted. This\n * causes the focus of the page by default to jump to the entire Timeline\n * Panel. This is a bit aggressive; and problematic as it means we cannot\n * use to cancel the creation of the entry. So instead we focus the\n * TimelineFlameChartView instead. This means that the user's gets\n * dealt with in its keydown.\n * If the user goes ahead and creates the entry, they will end up\n * focused on whichever target entry they pick, so this only matters for\n * the case where the user hits to cancel.\n */\n this.focus();\n });\n\n this.element.setAttribute('jslog', `${VisualLogging.section('timeline.flame-chart-view')}`);\n\n this.networkPane = new UI.Widget.VBox();\n this.networkPane.setMinimumSize(23, 23);\n this.networkFlameChart.show(this.networkPane.element);\n this.splitResizer = this.networkPane.element.createChild('div', 'timeline-flamechart-resizer');\n this.networkSplitWidget.hideDefaultResizer(true);\n this.networkSplitWidget.installResizer(this.splitResizer);\n this.networkSplitWidget.setMainWidget(this.mainFlameChart);\n this.networkSplitWidget.setSidebarWidget(this.networkPane);\n\n // Create counters chart splitter.\n this.chartSplitWidget = new UI.SplitWidget.SplitWidget(false, true, 'timeline-counters-split-view-state');\n this.countersView = new CountersGraph(this.delegate);\n this.chartSplitWidget.setMainWidget(flameChartsContainer);\n this.chartSplitWidget.setSidebarWidget(this.countersView);\n this.chartSplitWidget.hideDefaultResizer();\n this.chartSplitWidget.installResizer((this.countersView.resizerElement() as Element));\n\n // Create top level properties splitter.\n this.detailsSplitWidget = new UI.SplitWidget.SplitWidget(false, true, 'timeline-panel-details-split-view-state');\n this.detailsSplitWidget.element.classList.add('timeline-details-split');\n this.detailsView = new TimelineDetailsView(delegate);\n this.detailsSplitWidget.installResizer(this.detailsView.headerElement());\n this.detailsSplitWidget.setMainWidget(this.chartSplitWidget);\n this.detailsSplitWidget.setSidebarWidget(this.detailsView);\n this.detailsSplitWidget.show(this.element);\n\n // Event listeners for annotations.\n this.onMainAddEntryLabelAnnotation = this.onAddEntryLabelAnnotation.bind(this, this.mainDataProvider);\n this.onNetworkAddEntryLabelAnnotation = this.onAddEntryLabelAnnotation.bind(this, this.networkDataProvider);\n this.#onMainEntriesLinkAnnotationCreated = event =>\n this.onEntriesLinkAnnotationCreate(this.mainDataProvider, event.data.entryFromIndex);\n this.#onNetworkEntriesLinkAnnotationCreated = event =>\n this.onEntriesLinkAnnotationCreate(this.networkDataProvider, event.data.entryFromIndex);\n this.mainFlameChart.addEventListener(\n PerfUI.FlameChart.Events.ENTRY_LABEL_ANNOTATION_ADDED, this.onMainAddEntryLabelAnnotation, this);\n this.networkFlameChart.addEventListener(\n PerfUI.FlameChart.Events.ENTRY_LABEL_ANNOTATION_ADDED, this.onNetworkAddEntryLabelAnnotation, this);\n\n this.mainFlameChart.addEventListener(\n PerfUI.FlameChart.Events.ENTRIES_LINK_ANNOTATION_CREATED, this.#onMainEntriesLinkAnnotationCreated, this);\n this.networkFlameChart.addEventListener(\n PerfUI.FlameChart.Events.ENTRIES_LINK_ANNOTATION_CREATED, this.#onNetworkEntriesLinkAnnotationCreated, this);\n\n this.detailsView.addEventListener(TimelineTreeView.Events.TREE_ROW_HOVERED, node => {\n if (!Root.Runtime.experiments.isEnabled(Root.Runtime.ExperimentName.TIMELINE_DIM_UNRELATED_EVENTS)) {\n return;\n }\n const events = node?.data?.events;\n if (events) {\n this.#dimInsightRelatedEvents(events);\n } else {\n this.mainFlameChart.disableDimming();\n this.networkFlameChart.disableDimming();\n }\n });\n\n /**\n * NOTE: ENTRY_SELECTED, ENTRY_INVOKED and ENTRY_HOVERED are not always super obvious:\n * ENTRY_SELECTED: is KEYBOARD ONLY selection of events (e.g. navigating through the flamechart with your arrow keys)\n * ENTRY_HOVERED: is MOUSE ONLY when an event is hovered over with the mouse.\n * ENTRY_INVOKED: is when the user cilcks on an event, or hits the \"enter\" key whilst an event is selected.\n */\n this.onMainEntrySelected = this.onEntrySelected.bind(this, this.mainDataProvider);\n this.onNetworkEntrySelected = this.onEntrySelected.bind(this, this.networkDataProvider);\n this.mainFlameChart.addEventListener(PerfUI.FlameChart.Events.ENTRY_SELECTED, this.onMainEntrySelected, this);\n this.networkFlameChart.addEventListener(PerfUI.FlameChart.Events.ENTRY_SELECTED, this.onNetworkEntrySelected, this);\n\n this.#onMainEntryInvoked = this.#onEntryInvoked.bind(this, this.mainDataProvider);\n this.#onNetworkEntryInvoked = this.#onEntryInvoked.bind(this, this.networkDataProvider);\n this.mainFlameChart.addEventListener(PerfUI.FlameChart.Events.ENTRY_INVOKED, this.#onMainEntryInvoked, this);\n this.networkFlameChart.addEventListener(PerfUI.FlameChart.Events.ENTRY_INVOKED, this.#onNetworkEntryInvoked, this);\n\n this.mainFlameChart.addEventListener(PerfUI.FlameChart.Events.ENTRY_HOVERED, event => {\n this.onEntryHovered(event);\n this.updateLinkSelectionAnnotationWithToEntry(this.mainDataProvider, event.data);\n }, this);\n this.networkFlameChart.addEventListener(PerfUI.FlameChart.Events.ENTRY_HOVERED, event => {\n this.updateLinkSelectionAnnotationWithToEntry(this.networkDataProvider, event.data);\n }, this);\n\n this.#overlays.addEventListener(Overlays.Overlays.EventReferenceClick.eventName, event => {\n const eventRef = (event as Overlays.Overlays.EventReferenceClick);\n const fromTraceEvent = selectionFromEvent(eventRef.event);\n this.openSelectionDetailsView(fromTraceEvent);\n });\n\n this.element.addEventListener('keydown', this.#keydownHandler.bind(this));\n this.element.addEventListener('pointerdown', this.#pointerDownHandler.bind(this));\n this.#boundRefreshAfterIgnoreList = this.#refreshAfterIgnoreList.bind(this);\n this.#selectedEvents = null;\n\n this.groupBySetting = Common.Settings.Settings.instance().createSetting(\n 'timeline-tree-group-by', AggregatedTimelineTreeView.GroupBy.None);\n this.groupBySetting.addChangeListener(this.refreshMainFlameChart, this);\n this.refreshMainFlameChart();\n\n TraceBounds.TraceBounds.onChange(this.#onTraceBoundsChangeBound);\n }\n\n containingElement(): HTMLElement {\n return this.element;\n }\n\n dimEvents(events: Trace.Types.Events.Event[]): void {\n const relatedMainIndices = events.map(event => this.mainDataProvider.indexForEvent(event) ?? -1);\n const relatedNetworkIndices = events.map(event => this.networkDataProvider.indexForEvent(event) ?? -1);\n this.mainFlameChart.enableDimming(relatedMainIndices, false /** shouldAddOutlines */);\n this.networkFlameChart.enableDimming(relatedNetworkIndices, false /** shouldAddOutlines */);\n }\n\n #dimInsightRelatedEvents(relatedEvents: Trace.Types.Events.Event[]): void {\n // Dim all events except those related to the active insight.\n const relatedMainIndices = relatedEvents.map(event => this.mainDataProvider.indexForEvent(event) ?? -1);\n const relatedNetworkIndices = relatedEvents.map(event => this.networkDataProvider.indexForEvent(event) ?? -1);\n\n // Further, overlays defining a trace bounds do not dim an event that falls within those bounds.\n for (const overlay of this.#currentInsightOverlays) {\n let bounds;\n if (overlay.type === 'TIMESPAN_BREAKDOWN') {\n const firstSection = overlay.sections.at(0);\n const lastSection = overlay.sections.at(-1);\n if (firstSection && lastSection) {\n bounds = Trace.Helpers.Timing.traceWindowFromMicroSeconds(firstSection.bounds.min, lastSection.bounds.max);\n }\n } else if (overlay.type === 'TIME_RANGE') {\n bounds = overlay.bounds;\n }\n\n if (!bounds) {\n continue;\n }\n\n let provider, relevantEvents;\n\n // Using a relevant event for the overlay, determine which provider this overlay is for.\n const overlayEvent = Overlays.Overlays.entriesForOverlay(overlay).at(0);\n if (overlayEvent) {\n if (this.mainDataProvider.indexForEvent(overlayEvent) !== null) {\n provider = this.mainDataProvider;\n relevantEvents = relatedMainIndices;\n } else if (this.networkDataProvider.indexForEvent(overlayEvent) !== null) {\n provider = this.networkDataProvider;\n relevantEvents = relatedNetworkIndices;\n }\n } else if (overlay.type === 'TIMESPAN_BREAKDOWN') {\n // For this overlay type, if there is no associated event it is rendered on mainFlameChart.\n provider = this.mainDataProvider;\n relevantEvents = relatedMainIndices;\n }\n\n if (!provider || !relevantEvents) {\n continue;\n }\n\n relevantEvents.push(...provider.search(bounds).map(r => r.index));\n }\n this.mainFlameChart.enableDimmingForUnrelatedEntries(relatedMainIndices);\n this.networkFlameChart.enableDimmingForUnrelatedEntries(relatedNetworkIndices);\n }\n\n disableAllDimming(): void {\n this.mainFlameChart.disableDimming();\n this.networkFlameChart.disableDimming();\n }\n\n #sortMarkersForPreferredVisualOrder(markers: Trace.Types.Events.Event[]): void {\n markers.sort((m1, m2) => {\n const m1Index = SORT_ORDER_PAGE_LOAD_MARKERS[m1.name] ?? Infinity;\n const m2Index = SORT_ORDER_PAGE_LOAD_MARKERS[m2.name] ?? Infinity;\n return m1Index - m2Index;\n });\n }\n\n setMarkers(parsedTrace: Trace.Handlers.Types.ParsedTrace|null): void {\n if (!parsedTrace) {\n return;\n }\n // Clear out any markers.\n this.bulkRemoveOverlays(this.#markers);\n const markerEvents = parsedTrace.PageLoadMetrics.allMarkerEvents;\n // Set markers for Navigations, LCP, FCP, DCL, L.\n const markers = markerEvents.filter(\n event => event.name === Trace.Types.Events.Name.NAVIGATION_START ||\n event.name === Trace.Types.Events.Name.MARK_LCP_CANDIDATE ||\n event.name === Trace.Types.Events.Name.MARK_FCP ||\n event.name === Trace.Types.Events.Name.MARK_DOM_CONTENT ||\n event.name === Trace.Types.Events.Name.MARK_LOAD);\n\n this.#sortMarkersForPreferredVisualOrder(markers);\n const overlayByTs = new Map();\n markers.forEach(marker => {\n const adjustedTimestamp = Trace.Helpers.Timing.timeStampForEventAdjustedByClosestNavigation(\n marker,\n parsedTrace.Meta.traceBounds,\n parsedTrace.Meta.navigationsByNavigationId,\n parsedTrace.Meta.navigationsByFrameId,\n );\n // If any of the markers overlap in timing, lets put them on the same marker.\n let matchingOverlay = false;\n for (const [ts, overlay] of overlayByTs.entries()) {\n if (Math.abs(marker.ts - ts) <= TIMESTAMP_THRESHOLD_MS) {\n overlay.entries.push(marker);\n matchingOverlay = true;\n break;\n }\n }\n if (!matchingOverlay) {\n const overlay = {\n type: 'TIMINGS_MARKER',\n entries: [marker],\n adjustedTimestamp,\n } as Overlays.Overlays.TimingsMarker;\n overlayByTs.set(marker.ts, overlay);\n }\n });\n const markerOverlays: Overlays.Overlays.TimingsMarker[] = [...overlayByTs.values()];\n this.#markers = markerOverlays;\n if (this.#markers.length === 0) {\n return;\n }\n\n this.bulkAddOverlays(this.#markers);\n }\n\n setOverlays(overlays: Overlays.Overlays.TimelineOverlay[], options: Overlays.Overlays.TimelineOverlaySetOptions):\n void {\n this.bulkRemoveOverlays(this.#currentInsightOverlays);\n\n this.#currentInsightOverlays = overlays;\n if (this.#currentInsightOverlays.length === 0) {\n return;\n }\n\n const traceBounds = TraceBounds.TraceBounds.BoundsManager.instance().state()?.micro.entireTraceBounds;\n if (!traceBounds) {\n return;\n }\n\n this.bulkAddOverlays(this.#currentInsightOverlays);\n\n const entries: Trace.Types.Events.Event[] = [];\n for (const overlay of this.#currentInsightOverlays) {\n entries.push(...Overlays.Overlays.entriesForOverlay(overlay));\n }\n\n for (const entry of entries) {\n // Ensure that the track for the entries are open.\n this.#expandEntryTrack(entry);\n }\n\n if (Root.Runtime.experiments.isEnabled(Root.Runtime.ExperimentName.TIMELINE_DIM_UNRELATED_EVENTS)) {\n // The insight's `relatedEvents` property likely already includes the events associated with\n // and overlay, but just in case not, include both arrays. Duplicates are fine.\n let relatedEventsList = this.#activeInsight?.model.relatedEvents;\n if (!relatedEventsList) {\n relatedEventsList = [];\n } else if (relatedEventsList instanceof Map) {\n relatedEventsList = Array.from(relatedEventsList.keys());\n }\n this.#dimInsightRelatedEvents([...entries, ...relatedEventsList]);\n }\n\n if (options.updateTraceWindow) {\n const overlaysBounds = Overlays.Overlays.traceWindowContainingOverlays(this.#currentInsightOverlays);\n if (overlaysBounds) {\n // Trace window covering all overlays expanded by 100% so that the overlays cover 50% of the visible window.\n const expandedBounds =\n Trace.Helpers.Timing.expandWindowByPercentOrToOneMillisecond(overlaysBounds, traceBounds, 100);\n\n // Set the timeline visible window and ignore the minimap bounds. This\n // allows us to pick a visible window even if the overlays are outside of\n // the current breadcrumb. If this happens, the event listener for\n // BoundsManager changes in TimelineMiniMap will detect it and activate\n // the correct breadcrumb for us.\n TraceBounds.TraceBounds.BoundsManager.instance().setTimelineVisibleWindow(\n expandedBounds, {ignoreMiniMapBounds: true, shouldAnimate: true});\n }\n }\n\n // Reveal entry if we have one.\n if (entries.length !== 0) {\n const earliestEntry =\n entries.reduce((earliest, current) => (earliest.ts < current.ts ? earliest : current), entries[0]);\n this.revealEventVertically(earliestEntry);\n }\n }\n\n revealAnnotation(annotation: Trace.Types.File.Annotation): void {\n const traceBounds = TraceBounds.TraceBounds.BoundsManager.instance().state()?.micro.entireTraceBounds;\n if (!traceBounds) {\n return;\n }\n\n const annotationWindow = getAnnotationWindow(annotation);\n if (!annotationWindow) {\n return;\n }\n\n const annotationEntries = getAnnotationEntries(annotation);\n\n for (const entry of annotationEntries) {\n this.#expandEntryTrack(entry);\n }\n const firstEntry = annotationEntries.at(0);\n if (firstEntry) {\n this.revealEventVertically(firstEntry);\n }\n\n // Trace window covering all overlays expanded by 100% so that the overlays cover 50% of the visible window.\n const expandedBounds =\n Trace.Helpers.Timing.expandWindowByPercentOrToOneMillisecond(annotationWindow, traceBounds, 100);\n TraceBounds.TraceBounds.BoundsManager.instance().setTimelineVisibleWindow(\n expandedBounds, {ignoreMiniMapBounds: true, shouldAnimate: true});\n }\n\n setActiveInsight(insight: TimelineComponents.Sidebar.ActiveInsight|null): void {\n this.#activeInsight = insight;\n this.bulkRemoveOverlays(this.#currentInsightOverlays);\n\n if (!this.#activeInsight) {\n this.mainFlameChart.disableDimming();\n this.networkFlameChart.disableDimming();\n }\n }\n\n /**\n * Expands the track / group that the given entry is in.\n */\n #expandEntryTrack(entry: Trace.Types.Events.Event): void {\n const chartName = Overlays.Overlays.chartForEntry(entry);\n const provider = chartName === 'main' ? this.mainDataProvider : this.networkDataProvider;\n const entryChart = chartName === 'main' ? this.mainFlameChart : this.networkFlameChart;\n\n const entryIndex = provider.indexForEvent?.(entry) ?? null;\n if (entryIndex === null) {\n return;\n }\n\n const group = provider.groupForEvent?.(entryIndex) ?? null;\n if (!group) {\n return;\n }\n const groupIndex = provider.timelineData().groups.indexOf(group);\n\n if (!group.expanded && groupIndex > -1) {\n entryChart.toggleGroupExpand(groupIndex);\n }\n }\n\n addTimestampMarkerOverlay(timestamp: Trace.Types.Timing.MicroSeconds): void {\n // TIMESTAMP_MARKER is a singleton. If one already exists, it will\n // be updated instead of creating a new one.\n this.addOverlay({\n type: 'TIMESTAMP_MARKER',\n timestamp,\n });\n }\n\n async removeTimestampMarkerOverlay(): Promise {\n const removedCount = this.#overlays.removeOverlaysOfType('TIMESTAMP_MARKER');\n if (removedCount > 0) {\n // Don't trigger lots of updates on a mouse move if we didn't actually\n // remove any overlays.\n await this.#overlays.update();\n }\n }\n\n async #processFlameChartMouseMoveEvent(data: PerfUI.FlameChart.EventTypes['MouseMove']): Promise {\n const {mouseEvent, timeInMicroSeconds} = data;\n // If the user is no longer holding shift, remove any existing marker.\n if (!mouseEvent.shiftKey) {\n await this.removeTimestampMarkerOverlay();\n }\n\n if (!mouseEvent.metaKey && mouseEvent.shiftKey) {\n this.addTimestampMarkerOverlay(timeInMicroSeconds);\n }\n }\n\n #pointerDownHandler(event: PointerEvent): void {\n /**\n * If the user is in the middle of creating an entry link annotation and\n * right clicks, let's take that as a sign to exit and cancel.\n * (buttons === 2 indicates a right click)\n */\n if (event.buttons === 2 && this.#linkSelectionAnnotation) {\n this.#clearLinkSelectionAnnotation(true);\n event.stopPropagation();\n }\n }\n\n #clearLinkSelectionAnnotation(deleteCurrentLink: boolean): void {\n if (this.#linkSelectionAnnotation === null) {\n return;\n }\n // If the link in progress in cleared, make sure it's creation is complete. If not, delete it.\n if (deleteCurrentLink || this.#linkSelectionAnnotation.state !== Trace.Types.File.EntriesLinkState.CONNECTED) {\n ModificationsManager.activeManager()?.removeAnnotation(this.#linkSelectionAnnotation);\n }\n this.mainFlameChart.setLinkSelectionAnnotationIsInProgress(false);\n this.networkFlameChart.setLinkSelectionAnnotationIsInProgress(false);\n this.#linkSelectionAnnotation = null;\n }\n\n #setLinkSelectionAnnotation(linkSelectionAnnotation: Trace.Types.File.EntriesLinkAnnotation): void {\n this.mainFlameChart.setLinkSelectionAnnotationIsInProgress(true);\n this.networkFlameChart.setLinkSelectionAnnotationIsInProgress(true);\n this.#linkSelectionAnnotation = linkSelectionAnnotation;\n }\n\n #createNewTimeRangeFromKeyboard(startTime: Trace.Types.Timing.MicroSeconds, endTime: Trace.Types.Timing.MicroSeconds):\n void {\n if (this.#timeRangeSelectionAnnotation) {\n return;\n }\n\n this.#timeRangeSelectionAnnotation = {\n bounds: Trace.Helpers.Timing.traceWindowFromMicroSeconds(startTime, endTime),\n type: 'TIME_RANGE',\n label: '',\n };\n ModificationsManager.activeManager()?.createAnnotation(this.#timeRangeSelectionAnnotation);\n }\n\n /**\n * Handles key presses that could impact the creation of a time range overlay with the keyboard.\n * @returns `true` if the event should not be propogated + have its default behaviour stopped.\n */\n #handleTimeRangeKeyboardCreation(event: KeyboardEvent): boolean {\n const visibleWindow = TraceBounds.TraceBounds.BoundsManager.instance().state()?.micro.timelineTraceWindow;\n if (!visibleWindow) {\n return false;\n }\n\n // The amount we increment the time range by when using the arrow keys is\n // 2% of the visible window.\n const timeRangeIncrementValue = visibleWindow.range * 0.02;\n\n switch (event.key) {\n // ArrowLeft + ArrowRight adjusts the right hand bound (the max) of the time range\n // alt/option + ArrowRight also starts a range if there isn't one already\n case 'ArrowRight': {\n if (!this.#timeRangeSelectionAnnotation) {\n if (event.altKey) {\n let startTime = visibleWindow.min;\n // Prefer the start time of the selected event, if there is one.\n if (this.#currentSelection) {\n startTime = rangeForSelection(this.#currentSelection).min;\n }\n this.#createNewTimeRangeFromKeyboard(\n startTime, Trace.Types.Timing.MicroSeconds(startTime + timeRangeIncrementValue));\n return true;\n }\n return false;\n }\n\n // Grow the RHS of the range, but limit it to the visible window.\n this.#timeRangeSelectionAnnotation.bounds.max = Trace.Types.Timing.MicroSeconds(\n Math.min(this.#timeRangeSelectionAnnotation.bounds.max + timeRangeIncrementValue, visibleWindow.max),\n );\n this.#timeRangeSelectionAnnotation.bounds.range = Trace.Types.Timing.MicroSeconds(\n this.#timeRangeSelectionAnnotation.bounds.max - this.#timeRangeSelectionAnnotation.bounds.min,\n );\n ModificationsManager.activeManager()?.updateAnnotation(this.#timeRangeSelectionAnnotation);\n return true;\n }\n case 'ArrowLeft': {\n if (!this.#timeRangeSelectionAnnotation) {\n return false;\n }\n this.#timeRangeSelectionAnnotation.bounds.max = Trace.Types.Timing.MicroSeconds(\n // Shrink the RHS of the range, but make sure it cannot go below the min value.\n Math.max(\n this.#timeRangeSelectionAnnotation.bounds.max - timeRangeIncrementValue,\n this.#timeRangeSelectionAnnotation.bounds.min + 1),\n );\n this.#timeRangeSelectionAnnotation.bounds.range = Trace.Types.Timing.MicroSeconds(\n this.#timeRangeSelectionAnnotation.bounds.max - this.#timeRangeSelectionAnnotation.bounds.min,\n );\n ModificationsManager.activeManager()?.updateAnnotation(this.#timeRangeSelectionAnnotation);\n return true;\n }\n // ArrowDown + ArrowUp adjusts the left hand bound (the min) of the time range\n case 'ArrowUp': {\n if (!this.#timeRangeSelectionAnnotation) {\n return false;\n }\n this.#timeRangeSelectionAnnotation.bounds.min = Trace.Types.Timing.MicroSeconds(\n // Increase the LHS of the range, but make sure it cannot go above the max value.\n Math.min(\n this.#timeRangeSelectionAnnotation.bounds.min + timeRangeIncrementValue,\n this.#timeRangeSelectionAnnotation.bounds.max - 1),\n );\n this.#timeRangeSelectionAnnotation.bounds.range = Trace.Types.Timing.MicroSeconds(\n this.#timeRangeSelectionAnnotation.bounds.max - this.#timeRangeSelectionAnnotation.bounds.min,\n );\n ModificationsManager.activeManager()?.updateAnnotation(this.#timeRangeSelectionAnnotation);\n return true;\n }\n case 'ArrowDown': {\n if (!this.#timeRangeSelectionAnnotation) {\n return false;\n }\n this.#timeRangeSelectionAnnotation.bounds.min = Trace.Types.Timing.MicroSeconds(\n // Decrease the LHS, but make sure it cannot go beyond the minimum visible window.\n Math.max(this.#timeRangeSelectionAnnotation.bounds.min - timeRangeIncrementValue, visibleWindow.min),\n );\n this.#timeRangeSelectionAnnotation.bounds.range = Trace.Types.Timing.MicroSeconds(\n this.#timeRangeSelectionAnnotation.bounds.max - this.#timeRangeSelectionAnnotation.bounds.min,\n );\n ModificationsManager.activeManager()?.updateAnnotation(this.#timeRangeSelectionAnnotation);\n return true;\n }\n default: {\n // If we get any other key, we take that as a sign the user is done. Most likely the keys come from them typing into the label :)\n // If they do not type into the label, then the time range is not created.\n this.#timeRangeSelectionAnnotation = null;\n\n return false;\n }\n }\n }\n\n #keydownHandler(event: KeyboardEvent): void {\n const keyCombo = 'fixme';\n\n // `CREATION_NOT_STARTED` is only true in the state when both empty label and button to create connection are\n // created at the same time. If any key is typed in that state, it means that the label is in focus and the key\n // is typed into the label. This tells us that the user chose to create the\n // label, not the connection. In that case, delete the connection.\n if (this.#linkSelectionAnnotation &&\n this.#linkSelectionAnnotation.state === Trace.Types.File.EntriesLinkState.CREATION_NOT_STARTED) {\n this.#clearLinkSelectionAnnotation(true);\n // We have dealt with the keypress as the user is typing into the label, so do not let it propogate up.\n // This also ensures that if the user uses \"Escape\" they don't toggle the DevTools drawer.\n event.stopPropagation();\n }\n\n /**\n * If the user is in the middle of creating an entry link and hits Esc,\n * cancel and clear out the pending annotation.\n */\n if (event.key === 'Escape' && this.#linkSelectionAnnotation) {\n this.#clearLinkSelectionAnnotation(true);\n event.stopPropagation();\n event.preventDefault();\n }\n\n const eventHandledByKeyboardTimeRange = this.#handleTimeRangeKeyboardCreation(event);\n if (eventHandledByKeyboardTimeRange) {\n event.preventDefault();\n event.stopPropagation();\n return;\n }\n\n if (event.key === keyCombo[this.#gameKeyMatches]) {\n this.#gameKeyMatches++;\n clearTimeout(this.#gameTimeout);\n this.#gameTimeout = setTimeout(() => {\n this.#gameKeyMatches = 0;\n }, 2000);\n } else {\n this.#gameKeyMatches = 0;\n clearTimeout(this.#gameTimeout);\n }\n if (this.#gameKeyMatches !== keyCombo.length) {\n return;\n }\n this.runBrickBreakerGame();\n }\n\n runBrickBreakerGame(): void {\n if (!SHOULD_SHOW_EASTER_EGG) {\n return;\n }\n if ([...this.element.childNodes].find(child => child instanceof PerfUI.BrickBreaker.BrickBreaker)) {\n return;\n }\n this.brickGame = new PerfUI.BrickBreaker.BrickBreaker(this.mainFlameChart);\n this.brickGame.classList.add('brick-game');\n this.element.append(this.brickGame);\n }\n\n #onTraceBoundsChange(event: TraceBounds.TraceBounds.StateChangedEvent): void {\n if (event.updateType === 'MINIMAP_BOUNDS') {\n // If the update type was a changing of the minimap bounds, we do not\n // need to redraw the timeline.\n return;\n }\n\n const visibleWindow = event.state.milli.timelineTraceWindow;\n const shouldAnimate = Boolean(event.options.shouldAnimate);\n this.mainFlameChart.setWindowTimes(visibleWindow.min, visibleWindow.max, shouldAnimate);\n this.networkDataProvider.setWindowTimes(visibleWindow.min, visibleWindow.max);\n this.networkFlameChart.setWindowTimes(visibleWindow.min, visibleWindow.max, shouldAnimate);\n // Updating search results can be very expensive. Debounce to avoid over-calling it.\n const debouncedUpdate = Common.Debouncer.debounce(() => {\n this.updateSearchResults(false, false);\n }, 100);\n debouncedUpdate();\n }\n\n isNetworkTrackShownForTests(): boolean {\n return this.networkSplitWidget.showMode() !== UI.SplitWidget.ShowMode.ONLY_MAIN;\n }\n\n getLinkSelectionAnnotation(): Trace.Types.File.EntriesLinkAnnotation|null {\n return this.#linkSelectionAnnotation;\n }\n\n getMainDataProvider(): TimelineFlameChartDataProvider {\n return this.mainDataProvider;\n }\n\n getNetworkDataProvider(): TimelineFlameChartNetworkDataProvider {\n return this.networkDataProvider;\n }\n\n refreshMainFlameChart(): void {\n this.mainFlameChart.update();\n }\n\n extensionDataVisibilityChanged(): void {\n this.reset();\n this.setupWindowTimes();\n this.mainDataProvider.reset();\n this.mainDataProvider.timelineData(true);\n this.refreshMainFlameChart();\n }\n\n windowChanged(\n windowStartTime: Trace.Types.Timing.MilliSeconds, windowEndTime: Trace.Types.Timing.MilliSeconds,\n animate: boolean): void {\n TraceBounds.TraceBounds.BoundsManager.instance().setTimelineVisibleWindow(\n Trace.Helpers.Timing.traceWindowFromMilliSeconds(\n Trace.Types.Timing.MilliSeconds(windowStartTime),\n Trace.Types.Timing.MilliSeconds(windowEndTime),\n ),\n {shouldAnimate: animate},\n );\n }\n\n /**\n * @param startTime - the start time of the selection in MilliSeconds\n * @param endTime - the end time of the selection in MilliSeconds\n * TODO(crbug.com/346312365): update the type definitions in ChartViewport.ts\n */\n updateRangeSelection(startTime: number, endTime: number): void {\n this.delegate.select(selectionFromRangeMilliSeconds(\n Trace.Types.Timing.MilliSeconds(startTime), Trace.Types.Timing.MilliSeconds(endTime)));\n\n // We need to check if the user is updating the range because they are\n // creating a time range annotation.\n const bounds = Trace.Helpers.Timing.traceWindowFromMilliSeconds(\n Trace.Types.Timing.MilliSeconds(startTime),\n Trace.Types.Timing.MilliSeconds(endTime),\n );\n\n // If the current time range annotation exists, the range selection\n // for it is in progress and we need to update its bounds.\n //\n // When the range selection is finished, the current range is set to null.\n // If the current selection is null, create a new time range annotations.\n if (this.#timeRangeSelectionAnnotation) {\n this.#timeRangeSelectionAnnotation.bounds = bounds;\n ModificationsManager.activeManager()?.updateAnnotation(this.#timeRangeSelectionAnnotation);\n } else {\n this.#timeRangeSelectionAnnotation = {\n type: 'TIME_RANGE',\n label: '',\n bounds,\n };\n // Before creating a new range, make sure to delete the empty ranges.\n ModificationsManager.activeManager()?.deleteEmptyRangeAnnotations();\n ModificationsManager.activeManager()?.createAnnotation(this.#timeRangeSelectionAnnotation);\n }\n }\n\n getMainFlameChart(): PerfUI.FlameChart.FlameChart {\n return this.mainFlameChart;\n }\n\n // This function is public for test purpose.\n getNetworkFlameChart(): PerfUI.FlameChart.FlameChart {\n return this.networkFlameChart;\n }\n\n updateSelectedGroup(flameChart: PerfUI.FlameChart.FlameChart, group: PerfUI.FlameChart.Group|null): void {\n if (flameChart !== this.mainFlameChart || this.#selectedGroupName === group?.name) {\n return;\n }\n this.#selectedGroupName = group?.name || null;\n this.#selectedEvents = group ? this.mainDataProvider.groupTreeEvents(group) : null;\n this.#updateDetailViews();\n }\n\n setModel(newParsedTrace: Trace.Handlers.Types.ParsedTrace, isCpuProfile = false): void {\n if (newParsedTrace === this.#parsedTrace) {\n return;\n }\n this.#selectedGroupName = null;\n this.#parsedTrace = newParsedTrace;\n Common.EventTarget.removeEventListeners(this.eventListeners);\n this.#selectedEvents = null;\n this.mainDataProvider.setModel(newParsedTrace, isCpuProfile);\n this.networkDataProvider.setModel(newParsedTrace);\n this.reset();\n this.setupWindowTimes();\n this.updateSearchResults(false, false);\n this.refreshMainFlameChart();\n this.#updateFlameCharts();\n this.setMarkers(newParsedTrace);\n }\n\n setInsights(\n insights: Trace.Insights.Types.TraceInsightSets|null,\n eventToRelatedInsightsMap: TimelineComponents.RelatedInsightChips.EventToRelatedInsightsMap): void {\n if (this.#traceInsightSets === insights) {\n return;\n }\n\n this.#traceInsightSets = insights;\n this.#eventToRelatedInsightsMap = eventToRelatedInsightsMap;\n // The DetailsView is provided with the InsightSets, so make sure we update it.\n this.#updateDetailViews();\n }\n\n reset(): void {\n if (this.networkDataProvider.isEmpty()) {\n this.mainFlameChart.enableRuler(true);\n this.networkSplitWidget.hideSidebar();\n } else {\n this.mainFlameChart.enableRuler(false);\n this.networkSplitWidget.showBoth();\n this.resizeToPreferredHeights();\n }\n this.#overlays.reset();\n this.mainFlameChart.reset();\n this.networkFlameChart.reset();\n this.updateSearchResults(false, false);\n }\n\n // TODO(paulirish): It's possible this is being called more than necessary. Attempt to clean up the lifecycle.\n setupWindowTimes(): void {\n const traceBoundsState = TraceBounds.TraceBounds.BoundsManager.instance().state();\n if (!traceBoundsState) {\n throw new Error('TimelineFlameChartView could not set the window bounds.');\n }\n const visibleWindow = traceBoundsState.milli.timelineTraceWindow;\n this.mainFlameChart.setWindowTimes(visibleWindow.min, visibleWindow.max);\n this.networkDataProvider.setWindowTimes(visibleWindow.min, visibleWindow.max);\n this.networkFlameChart.setWindowTimes(visibleWindow.min, visibleWindow.max);\n }\n\n #refreshAfterIgnoreList(): void {\n // The ignore list will only affect Thread tracks, which will only be in main flame chart.\n // So just force recalculate and redraw the main flame chart here.\n this.mainDataProvider.timelineData(true);\n this.mainFlameChart.scheduleUpdate();\n }\n\n #updateDetailViews(): void {\n this.countersView.setModel(this.#parsedTrace, this.#selectedEvents);\n void this.detailsView.setModel({\n parsedTrace: this.#parsedTrace,\n selectedEvents: this.#selectedEvents,\n traceInsightsSets: this.#traceInsightSets,\n eventToRelatedInsightsMap: this.#eventToRelatedInsightsMap,\n });\n }\n\n #updateFlameCharts(): void {\n this.mainFlameChart.scheduleUpdate();\n this.networkFlameChart.scheduleUpdate();\n\n this.#registerLoggableGroups();\n }\n\n #registerLoggableGroups(): void {\n const groups = [\n ...this.mainFlameChart.timelineData()?.groups ?? [],\n ...this.networkFlameChart.timelineData()?.groups ?? [],\n ];\n for (const group of groups) {\n if (!group.jslogContext) {\n continue;\n }\n const loggable = this.#loggableForGroupByLogContext.get(group.jslogContext) ?? Symbol(group.jslogContext);\n\n if (!this.#loggableForGroupByLogContext.has(group.jslogContext)) {\n // This is the first time this group has been created, so register its loggable.\n this.#loggableForGroupByLogContext.set(group.jslogContext, loggable);\n VisualLogging.registerLoggable(\n loggable, `${VisualLogging.section().context(`timeline.${group.jslogContext}`)}`, this.delegate.element);\n }\n }\n }\n\n // If an entry is hovered over and a creation of link annotation is in progress, update that annotation with a hovered entry.\n updateLinkSelectionAnnotationWithToEntry(\n dataProvider: TimelineFlameChartDataProvider|TimelineFlameChartNetworkDataProvider, entryIndex: number): void {\n if (!this.#linkSelectionAnnotation ||\n this.#linkSelectionAnnotation.state === Trace.Types.File.EntriesLinkState.CREATION_NOT_STARTED) {\n return;\n }\n const toSelectionObject = this.#selectionIfTraceEvent(entryIndex, dataProvider);\n\n if (toSelectionObject) {\n // Prevent the user from creating a link that connects an entry to itself.\n if (toSelectionObject === this.#linkSelectionAnnotation.entryFrom) {\n return;\n }\n // Prevent the user from creating a link that connects an entry it's already connected to.\n const linkBetweenEntriesExists = ModificationsManager.activeManager()?.linkAnnotationBetweenEntriesExists(\n this.#linkSelectionAnnotation.entryFrom, toSelectionObject);\n if (linkBetweenEntriesExists) {\n return;\n }\n\n this.#linkSelectionAnnotation.state = Trace.Types.File.EntriesLinkState.CONNECTED;\n this.#linkSelectionAnnotation.entryTo = toSelectionObject;\n } else {\n this.#linkSelectionAnnotation.state = Trace.Types.File.EntriesLinkState.PENDING_TO_EVENT;\n delete this.#linkSelectionAnnotation['entryTo'];\n }\n ModificationsManager.activeManager()?.updateAnnotation(this.#linkSelectionAnnotation);\n }\n\n private onEntryHovered(commonEvent: Common.EventTarget.EventTargetEvent): void {\n SDK.OverlayModel.OverlayModel.hideDOMNodeHighlight();\n const entryIndex = commonEvent.data;\n const event = this.mainDataProvider.eventByIndex(entryIndex);\n if (!event || !this.#parsedTrace) {\n return;\n }\n if (Trace.Types.Events.isLegacyTimelineFrame(event)) {\n return;\n }\n\n const target = targetForEvent(this.#parsedTrace, event);\n if (!target) {\n return;\n }\n\n const nodeIds = Trace.Extras.FetchNodes.nodeIdsForEvent(this.#parsedTrace, event);\n for (const nodeId of nodeIds) {\n new SDK.DOMModel.DeferredDOMNode(target, nodeId).highlight();\n }\n }\n\n highlightEvent(event: Trace.Types.Events.Event|null): void {\n const entryIndex = event ? this.mainDataProvider.entryIndexForSelection(selectionFromEvent(event)) : -1;\n if (entryIndex >= 0) {\n this.mainFlameChart.highlightEntry(entryIndex);\n } else {\n this.mainFlameChart.hideHighlight();\n }\n }\n\n override willHide(): void {\n this.networkFlameChartGroupExpansionSetting.removeChangeListener(this.resizeToPreferredHeights, this);\n Bindings.IgnoreListManager.IgnoreListManager.instance().removeChangeListener(this.#boundRefreshAfterIgnoreList);\n }\n\n override wasShown(): void {\n this.registerCSSFiles([timelineFlameChartViewStyles]);\n this.networkFlameChartGroupExpansionSetting.addChangeListener(this.resizeToPreferredHeights, this);\n Bindings.IgnoreListManager.IgnoreListManager.instance().addChangeListener(this.#boundRefreshAfterIgnoreList);\n if (this.needsResizeToPreferredHeights) {\n this.resizeToPreferredHeights();\n }\n this.#updateFlameCharts();\n }\n\n updateCountersGraphToggle(showMemoryGraph: boolean): void {\n if (showMemoryGraph) {\n this.chartSplitWidget.showBoth();\n } else {\n this.chartSplitWidget.hideSidebar();\n }\n }\n\n revealEvent(event: Trace.Types.Events.Event): void {\n const mainIndex = this.mainDataProvider.indexForEvent(event);\n const networkIndex = this.networkDataProvider.indexForEvent(event);\n if (mainIndex !== null) {\n this.mainFlameChart.revealEntry(mainIndex);\n } else if (networkIndex !== null) {\n this.networkFlameChart.revealEntry(networkIndex);\n }\n }\n\n // Given an event, it reveals its position vertically\n revealEventVertically(event: Trace.Types.Events.Event): void {\n const mainIndex = this.mainDataProvider.indexForEvent(event);\n const networkIndex = this.networkDataProvider.indexForEvent(event);\n if (mainIndex !== null) {\n this.mainFlameChart.revealEntryVertically(mainIndex);\n } else if (networkIndex !== null) {\n this.networkFlameChart.revealEntryVertically(networkIndex);\n }\n }\n\n setSelectionAndReveal(selection: TimelineSelection|null): void {\n this.#currentSelection = selection;\n const mainIndex = this.mainDataProvider.entryIndexForSelection(selection);\n const networkIndex = this.networkDataProvider.entryIndexForSelection(selection);\n this.mainFlameChart.setSelectedEntry(mainIndex);\n this.networkFlameChart.setSelectedEntry(networkIndex);\n\n // Clear any existing entry selection.\n this.#overlays.removeOverlaysOfType('ENTRY_SELECTED');\n // If:\n // 1. There is no selection, or the selection is not a range selection\n // AND 2. we have an active time range selection overlay\n // AND 3. The label of the selection is empty\n // then we need to remove it.\n if ((selection === null || !selectionIsRange(selection)) && this.#timeRangeSelectionAnnotation &&\n !this.#timeRangeSelectionAnnotation.label) {\n ModificationsManager.activeManager()?.removeAnnotation(this.#timeRangeSelectionAnnotation);\n this.#timeRangeSelectionAnnotation = null;\n }\n\n let index = this.mainDataProvider.entryIndexForSelection(selection);\n this.mainFlameChart.setSelectedEntry(index);\n index = this.networkDataProvider.entryIndexForSelection(selection);\n this.networkFlameChart.setSelectedEntry(index);\n if (this.detailsView) {\n // TODO(crbug.com/1459265): Change to await after migration work.\n void this.detailsView.setSelection(selection);\n }\n\n // Create the entry selected overlay if the selection represents a trace event\n if (selectionIsEvent(selection)) {\n this.addOverlay({\n type: 'ENTRY_SELECTED',\n entry: selection.event,\n });\n }\n\n if (this.#linkSelectionAnnotation &&\n this.#linkSelectionAnnotation.state === Trace.Types.File.EntriesLinkState.CREATION_NOT_STARTED) {\n this.#clearLinkSelectionAnnotation(true);\n }\n }\n\n // Only opens the details view of a selection. This is used for Timing Markers. Timing markers replace\n // their entry with a new UI. Becuase of that, thier entries can no longer be \"selected\" in the timings track,\n // so if clicked, we only open their details view.\n openSelectionDetailsView(selection: TimelineSelection|null): void {\n if (this.detailsView) {\n void this.detailsView.setSelection(selection);\n }\n }\n\n /**\n * Used to create multiple overlays at once without triggering a redraw for each one.\n */\n bulkAddOverlays(overlays: Overlays.Overlays.TimelineOverlay[]): void {\n for (const overlay of overlays) {\n this.#overlays.add(overlay);\n }\n void this.#overlays.update();\n }\n\n addOverlay(newOverlay: T): T {\n const overlay = this.#overlays.add(newOverlay);\n void this.#overlays.update();\n return overlay;\n }\n\n bulkRemoveOverlays(overlays: Overlays.Overlays.TimelineOverlay[]): void {\n if (!overlays.length) {\n return;\n }\n\n for (const overlay of overlays) {\n this.#overlays.remove(overlay);\n }\n void this.#overlays.update();\n }\n\n removeOverlay(removedOverlay: Overlays.Overlays.TimelineOverlay): void {\n this.#overlays.remove(removedOverlay);\n void this.#overlays.update();\n }\n\n updateExistingOverlay(existingOverlay: T, newData: Partial): void {\n this.#overlays.updateExisting(existingOverlay, newData);\n void this.#overlays.update();\n }\n\n enterLabelEditMode(overlay: Overlays.Overlays.EntryLabel): void {\n this.#overlays.enterLabelEditMode(overlay);\n }\n\n private onAddEntryLabelAnnotation(\n dataProvider: TimelineFlameChartDataProvider|TimelineFlameChartNetworkDataProvider,\n event: Common.EventTarget.EventTargetEvent<{entryIndex: number, withLinkCreationButton: boolean}>): void {\n const selection = dataProvider.createSelection(event.data.entryIndex);\n if (selectionIsEvent(selection)) {\n this.setSelectionAndReveal(selection);\n ModificationsManager.activeManager()?.createAnnotation({\n type: 'ENTRY_LABEL',\n entry: selection.event,\n label: '',\n });\n if (event.data.withLinkCreationButton) {\n this.onEntriesLinkAnnotationCreate(dataProvider, event.data.entryIndex, true);\n }\n }\n }\n\n onEntriesLinkAnnotationCreate(\n dataProvider: TimelineFlameChartDataProvider|TimelineFlameChartNetworkDataProvider, entryFromIndex: number,\n linkCreateButton?: boolean): void {\n const fromSelectionObject = (entryFromIndex) ? this.#selectionIfTraceEvent(entryFromIndex, dataProvider) : null;\n\n if (fromSelectionObject) {\n this.#setLinkSelectionAnnotation({\n type: 'ENTRIES_LINK',\n entryFrom: fromSelectionObject,\n state: (linkCreateButton) ? Trace.Types.File.EntriesLinkState.CREATION_NOT_STARTED :\n Trace.Types.File.EntriesLinkState.PENDING_TO_EVENT,\n });\n if (this.#linkSelectionAnnotation) {\n ModificationsManager.activeManager()?.createAnnotation(this.#linkSelectionAnnotation);\n }\n }\n }\n\n #selectionIfTraceEvent(\n index: number, dataProvider: TimelineFlameChartDataProvider|TimelineFlameChartNetworkDataProvider):\n Trace.Types.Events.Event|null {\n const selection = dataProvider.createSelection(index);\n return selectionIsEvent(selection) ? selection.event : null;\n }\n\n /**\n * Called when the user either:\n * 1. clicks with their mouse on an entry\n * 2. Uses the keyboard and presses \"enter\" whilst an entry is selected\n */\n #onEntryInvoked(\n dataProvider: TimelineFlameChartDataProvider|TimelineFlameChartNetworkDataProvider,\n event: Common.EventTarget.EventTargetEvent): void {\n this.#updateSelectedEntryStatus(dataProvider, event);\n\n const entryIndex = event.data;\n // If we have a pending link connection, create it if we can now the final entry has been pressed.\n if (this.#linkSelectionAnnotation) {\n this.handleToEntryOfLinkBetweenEntriesSelection(entryIndex);\n }\n }\n\n #updateSelectedEntryStatus(\n dataProvider: TimelineFlameChartDataProvider|TimelineFlameChartNetworkDataProvider,\n event: Common.EventTarget.EventTargetEvent): void {\n const data = dataProvider.timelineData();\n if (!data) {\n return;\n }\n const entryIndex = event.data;\n\n const entryLevel = data.entryLevels[entryIndex];\n\n // Find the group that contains this level and log a click for it.\n const group = groupForLevel(data.groups, entryLevel);\n if (group && group.jslogContext) {\n const loggable = this.#loggableForGroupByLogContext.get(group.jslogContext) ?? null;\n if (loggable) {\n VisualLogging.logClick(loggable, new MouseEvent('click'));\n }\n }\n\n dataProvider.buildFlowForInitiator(entryIndex);\n this.delegate.select(dataProvider.createSelection(entryIndex));\n }\n\n /**\n * This is invoked when the user uses their KEYBOARD ONLY to navigate between\n * events.\n * It IS NOT called when the user uses the mouse. See `onEntryInvoked`.\n */\n private onEntrySelected(\n dataProvider: TimelineFlameChartDataProvider|TimelineFlameChartNetworkDataProvider,\n event: Common.EventTarget.EventTargetEvent): void {\n this.#updateSelectedEntryStatus(dataProvider, event);\n\n // Update any pending link selection to point the entryTo to what the user has selected.\n const entryIndex = event.data;\n const toSelectionObject = this.#selectionIfTraceEvent(entryIndex, dataProvider);\n if (toSelectionObject && toSelectionObject !== this.#linkSelectionAnnotation?.entryTo) {\n this.updateLinkSelectionAnnotationWithToEntry(dataProvider, entryIndex);\n }\n }\n\n handleToEntryOfLinkBetweenEntriesSelection(toIndex: number): void {\n // If there is a link annotation in the process of being created when an empty\n // space in the Flamechart is clicked, delete the link being created.\n //\n // If an entry is clicked when a link between entries in created and the entry that an arrow\n // is pointing to is earlier than the one it starts from, switch 'to' and 'from' entries to\n // reverse the arrow.\n if (this.#linkSelectionAnnotation && toIndex === -1) {\n ModificationsManager.activeManager()?.removeAnnotation(this.#linkSelectionAnnotation);\n } else if (\n this.#linkSelectionAnnotation && this.#linkSelectionAnnotation?.entryTo &&\n (this.#linkSelectionAnnotation?.entryFrom.ts > this.#linkSelectionAnnotation?.entryTo.ts)) {\n const entryFrom = this.#linkSelectionAnnotation.entryFrom;\n const entryTo = this.#linkSelectionAnnotation.entryTo;\n this.#linkSelectionAnnotation.entryTo = entryFrom;\n this.#linkSelectionAnnotation.entryFrom = entryTo;\n ModificationsManager.activeManager()?.updateAnnotation(this.#linkSelectionAnnotation);\n }\n // Regardless of if the link in progress was deleted or the clicked entry is the final selection,\n // set the link selection in progress to null so a new one is created if the an event to create\n // of update the current link is dispatched.\n this.#clearLinkSelectionAnnotation(false);\n }\n\n resizeToPreferredHeights(): void {\n if (!this.isShowing()) {\n this.needsResizeToPreferredHeights = true;\n return;\n }\n this.needsResizeToPreferredHeights = false;\n this.networkPane.element.classList.toggle(\n 'timeline-network-resizer-disabled', !this.networkDataProvider.isExpanded());\n this.networkSplitWidget.setSidebarSize(\n this.networkDataProvider.preferredHeight() + this.splitResizer.clientHeight + PerfUI.FlameChart.RulerHeight +\n 2);\n }\n\n setSearchableView(searchableView: UI.SearchableView.SearchableView): void {\n this.searchableView = searchableView;\n }\n\n // UI.SearchableView.Searchable implementation\n\n searchResultIndexForEntryIndex(index: number): number {\n if (!this.searchResults) {\n return -1;\n }\n return this.searchResults.findIndex(result => result.index === index);\n }\n\n jumpToNextSearchResult(): void {\n if (!this.searchResults || !this.searchResults.length) {\n return;\n }\n const index =\n typeof this.selectedSearchResult !== 'undefined' ? this.searchResults.indexOf(this.selectedSearchResult) : -1;\n this.#selectSearchResult(Platform.NumberUtilities.mod(index + 1, this.searchResults.length));\n }\n\n jumpToPreviousSearchResult(): void {\n if (!this.searchResults || !this.searchResults.length) {\n return;\n }\n const index =\n typeof this.selectedSearchResult !== 'undefined' ? this.searchResults.indexOf(this.selectedSearchResult) : 0;\n this.#selectSearchResult(Platform.NumberUtilities.mod(index - 1, this.searchResults.length));\n }\n\n supportsCaseSensitiveSearch(): boolean {\n return true;\n }\n\n supportsRegexSearch(): boolean {\n return true;\n }\n\n #selectSearchResult(searchResultIndex: number): void {\n this.searchableView.updateCurrentMatchIndex(searchResultIndex);\n const matchedResult = this.searchResults?.at(searchResultIndex) ?? null;\n if (!matchedResult) {\n return;\n }\n\n switch (matchedResult.provider) {\n case 'main': {\n this.delegate.select(this.mainDataProvider.createSelection(matchedResult.index));\n this.mainFlameChart.showPopoverForSearchResult(matchedResult.index);\n break;\n }\n case 'network': {\n this.delegate.select(this.networkDataProvider.createSelection(matchedResult.index));\n this.networkFlameChart.showPopoverForSearchResult(matchedResult.index);\n break;\n }\n case 'other':\n // TimelineFlameChartView only has main/network so we can ignore.\n break;\n default:\n Platform.assertNever(matchedResult.provider, `Unknown SearchResult[provider]: ${matchedResult.provider}`);\n }\n this.selectedSearchResult = matchedResult;\n }\n\n private updateSearchResults(shouldJump: boolean, jumpBackwards?: boolean): void {\n const traceBoundsState = TraceBounds.TraceBounds.BoundsManager.instance().state();\n if (!traceBoundsState) {\n return;\n }\n\n const oldSelectedSearchResult = this.selectedSearchResult;\n delete this.selectedSearchResult;\n this.searchResults = [];\n if (!this.searchRegex) {\n return;\n }\n this.mainFlameChart.removeSearchResultHighlights();\n this.networkFlameChart.removeSearchResultHighlights();\n const regExpFilter = new TimelineRegExp(this.searchRegex);\n const visibleWindow = traceBoundsState.micro.timelineTraceWindow;\n\n /**\n * Get the matches for the user's search result. We search both providers\n * but before storing the results we need to \"tag\" the results with the\n * provider they came from. We do this so that when the user highlights a\n * search result we know which flame chart to talk to to highlight it.\n */\n const mainMatches = this.mainDataProvider.search(visibleWindow, regExpFilter);\n const networkMatches = this.networkDataProvider.search(visibleWindow, regExpFilter);\n\n // Merge both result sets into one, sorted by start time. This means as the\n // user navigates back/forwards they will do so in time order and not do\n // all the main results before the network results, or some other\n // unexpected ordering.\n this.searchResults = mainMatches.concat(networkMatches).sort((m1, m2) => {\n return m1.startTimeMilli - m2.startTimeMilli;\n });\n\n this.searchableView.updateSearchMatchesCount(this.searchResults.length);\n\n this.mainFlameChart.highlightAllEntries(mainMatches.map(m => m.index));\n this.networkFlameChart.highlightAllEntries(networkMatches.map(m => m.index));\n if (!shouldJump || !this.searchResults.length) {\n return;\n }\n let selectedIndex = this.#indexOfSearchResult(oldSelectedSearchResult);\n if (selectedIndex === -1) {\n selectedIndex = jumpBackwards ? this.searchResults.length - 1 : 0;\n }\n this.#selectSearchResult(selectedIndex);\n }\n\n #indexOfSearchResult(target?: PerfUI.FlameChart.DataProviderSearchResult): number {\n if (!target) {\n return -1;\n }\n\n return this.searchResults?.findIndex(result => {\n return result.provider === target.provider && result.index === target.index;\n }) ??\n -1;\n }\n\n /**\n * Returns the indexes of the elements that matched the most recent\n * query. Elements are indexed by the data provider and correspond\n * to their position in the data provider entry data array.\n * Public only for tests.\n */\n getSearchResults(): PerfUI.FlameChart.DataProviderSearchResult[]|undefined {\n return this.searchResults;\n }\n\n onSearchCanceled(): void {\n if (typeof this.selectedSearchResult !== 'undefined') {\n this.delegate.select(null);\n }\n delete this.searchResults;\n delete this.selectedSearchResult;\n delete this.searchRegex;\n this.mainFlameChart.showPopoverForSearchResult(null);\n this.mainFlameChart.removeSearchResultHighlights();\n this.networkFlameChart.showPopoverForSearchResult(null);\n this.networkFlameChart.removeSearchResultHighlights();\n }\n\n performSearch(searchConfig: UI.SearchableView.SearchConfig, shouldJump: boolean, jumpBackwards?: boolean): void {\n this.searchRegex = searchConfig.toSearchRegex().regex;\n this.updateSearchResults(shouldJump, jumpBackwards);\n }\n\n togglePopover({event, show}: {event: Trace.Types.Events.Event, show: boolean}): void {\n const entryIndex = this.mainDataProvider.indexForEvent(event);\n if (show && entryIndex) {\n this.mainFlameChart.setSelectedEntry(entryIndex);\n this.mainFlameChart.showPopoverForSearchResult(entryIndex);\n } else {\n this.mainFlameChart.hideHighlight();\n }\n }\n\n overlays(): Overlays.Overlays.Overlays {\n return this.#overlays;\n }\n}\n\nexport class Selection {\n timelineSelection: TimelineSelection;\n entryIndex: number;\n constructor(selection: TimelineSelection, entryIndex: number) {\n this.timelineSelection = selection;\n this.entryIndex = entryIndex;\n }\n}\n\nexport const FlameChartStyle = {\n textColor: '#333',\n};\n\nexport class TimelineFlameChartMarker implements PerfUI.FlameChart.FlameChartMarker {\n private readonly startTimeInternal: number;\n private readonly startOffset: number;\n private style: TimelineMarkerStyle;\n constructor(startTime: number, startOffset: number, style: TimelineMarkerStyle) {\n this.startTimeInternal = startTime;\n this.startOffset = startOffset;\n this.style = style;\n }\n\n startTime(): number {\n return this.startTimeInternal;\n }\n\n color(): string {\n return this.style.color;\n }\n\n title(): string|null {\n if (this.style.lowPriority) {\n return null;\n }\n const startTime = i18n.TimeUtilities.millisToString(this.startOffset);\n return i18nString(UIStrings.sAtS, {PH1: this.style.title, PH2: startTime});\n }\n\n draw(context: CanvasRenderingContext2D, x: number, height: number, pixelsPerMillisecond: number): void {\n const lowPriorityVisibilityThresholdInPixelsPerMs = 4;\n\n if (this.style.lowPriority && pixelsPerMillisecond < lowPriorityVisibilityThresholdInPixelsPerMs) {\n return;\n }\n\n if (!this.style.tall) {\n return;\n }\n\n context.save();\n\n context.strokeStyle = this.style.color;\n context.lineWidth = this.style.lineWidth;\n context.translate(this.style.lineWidth < 1 || (this.style.lineWidth & 1) ? 0.5 : 0, 0.5);\n context.beginPath();\n context.moveTo(x, 0);\n context.setLineDash(this.style.dashStyle);\n context.lineTo(x, context.canvas.height);\n context.stroke();\n\n context.restore();\n }\n}\n\nexport const enum ColorBy {\n URL = 'URL',\n}\n\n/**\n * Find the Group that contains the provided level, or `null` if no group is\n * found.\n */\nexport function groupForLevel(groups: PerfUI.FlameChart.Group[], level: number): PerfUI.FlameChart.Group|null {\n const groupForLevel = groups.find((group, groupIndex) => {\n const nextGroup = groups.at(groupIndex + 1);\n const groupEndLevel = nextGroup ? nextGroup.startLevel - 1 : Infinity;\n\n return group.startLevel <= level && groupEndLevel >= level;\n });\n return groupForLevel ?? null;\n}\n"]} \ No newline at end of file +{"version":3,"file":"TimelineFlameChartView.js","sourceRoot":"","sources":["../../../../../../front_end/panels/timeline/TimelineFlameChartView.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,KAAK,MAAM,MAAM,6BAA6B,CAAC;AACtD,OAAO,KAAK,IAAI,MAAM,yBAAyB,CAAC;AAChD,OAAO,KAAK,QAAQ,MAAM,iCAAiC,CAAC;AAC5D,OAAO,KAAK,IAAI,MAAM,yBAAyB,CAAC;AAChD,OAAO,KAAK,GAAG,MAAM,uBAAuB,CAAC;AAC7C,OAAO,KAAK,QAAQ,MAAM,mCAAmC,CAAC;AAC9D,OAAO,KAAK,KAAK,MAAM,6BAA6B,CAAC;AACrD,OAAO,KAAK,WAAW,MAAM,6CAA6C,CAAC;AAC3E,OAAO,KAAK,MAAM,MAAM,+CAA+C,CAAC;AACxE,OAAO,KAAK,EAAE,MAAM,2BAA2B,CAAC;AAChD,OAAO,KAAK,aAAa,MAAM,2CAA2C,CAAC;AAE3E,OAAO,EAAC,oBAAoB,EAAE,mBAAmB,EAAC,MAAM,wBAAwB,CAAC;AAEjF,OAAO,EAAC,aAAa,EAAC,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAC,sBAAsB,EAAC,MAAM,gBAAgB,CAAC;AACtD,OAAO,EAAC,oBAAoB,EAAC,MAAM,2BAA2B,CAAC;AAC/D,OAAO,KAAK,iBAAiB,MAAM,qCAAqC,CAAC;AACzE,OAAO,KAAK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,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC;QACvC,OAAO,CAAC,SAAS,GAAG,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC;QACzC,OAAO,CAAC,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,SAAS,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,SAAS,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;QACzF,OAAO,CAAC,SAAS,EAAE,CAAC;QACpB,OAAO,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;QACrB,OAAO,CAAC,WAAW,CAAC,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;QAC1C,OAAO,CAAC,MAAM,CAAC,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;QACzC,OAAO,CAAC,MAAM,EAAE,CAAC;QAEjB,OAAO,CAAC,OAAO,EAAE,CAAC;IACpB,CAAC;CACF;AAMD;;;GAGG;AACH,MAAM,UAAU,aAAa,CAAC,MAAiC,EAAE,KAAa;IAC5E,MAAM,aAAa,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,UAAU,EAAE,EAAE;QACtD,MAAM,SAAS,GAAG,MAAM,CAAC,EAAE,CAAC,UAAU,GAAG,CAAC,CAAC,CAAC;QAC5C,MAAM,aAAa,GAAG,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,UAAU,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC;QAEtE,OAAO,KAAK,CAAC,UAAU,IAAI,KAAK,IAAI,aAAa,IAAI,KAAK,CAAC;IAC7D,CAAC,CAAC,CAAC;IACH,OAAO,aAAa,IAAI,IAAI,CAAC;AAC/B,CAAC","sourcesContent":["// Copyright 2016 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport * as Common from '../../core/common/common.js';\nimport * as i18n from '../../core/i18n/i18n.js';\nimport * as Platform from '../../core/platform/platform.js';\nimport * as Root from '../../core/root/root.js';\nimport * as SDK from '../../core/sdk/sdk.js';\nimport * as Bindings from '../../models/bindings/bindings.js';\nimport * as Trace from '../../models/trace/trace.js';\nimport * as TraceBounds from '../../services/trace_bounds/trace_bounds.js';\nimport * as PerfUI from '../../ui/legacy/components/perf_ui/perf_ui.js';\nimport * as UI from '../../ui/legacy/legacy.js';\nimport * as VisualLogging from '../../ui/visual_logging/visual_logging.js';\n\nimport {getAnnotationEntries, getAnnotationWindow} from './AnnotationHelpers.js';\nimport type * as TimelineComponents from './components/components.js';\nimport {CountersGraph} from './CountersGraph.js';\nimport {SHOULD_SHOW_EASTER_EGG} from './EasterEgg.js';\nimport {ModificationsManager} from './ModificationsManager.js';\nimport * as OverlayComponents from './overlays/components/components.js';\nimport * as Overlays from './overlays/overlays.js';\nimport {targetForEvent} from './TargetForEvent.js';\nimport {TimelineDetailsView} from './TimelineDetailsView.js';\nimport {TimelineRegExp} from './TimelineFilters.js';\nimport {\n Events as TimelineFlameChartDataProviderEvents,\n TimelineFlameChartDataProvider,\n} from './TimelineFlameChartDataProvider.js';\nimport {TimelineFlameChartNetworkDataProvider} from './TimelineFlameChartNetworkDataProvider.js';\nimport timelineFlameChartViewStyles from './timelineFlameChartView.css.js';\nimport type {TimelineModeViewDelegate} from './TimelinePanel.js';\nimport {\n rangeForSelection,\n selectionFromEvent,\n selectionFromRangeMilliSeconds,\n selectionIsEvent,\n selectionIsRange,\n type TimelineSelection,\n} from './TimelineSelection.js';\nimport {AggregatedTimelineTreeView, TimelineTreeView} from './TimelineTreeView.js';\nimport type {TimelineMarkerStyle} from './TimelineUIUtils.js';\n\nconst UIStrings = {\n /**\n *@description Text in Timeline Flame Chart View of the Performance panel\n *@example {Frame} PH1\n *@example {10ms} PH2\n */\n sAtS: '{PH1} at {PH2}',\n};\nconst str_ = i18n.i18n.registerUIStrings('panels/timeline/TimelineFlameChartView.ts', UIStrings);\nconst i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);\n\n/**\n * This defines the order these markers will be rendered if they are at the\n * same timestamp. The smaller number will be shown first - e.g. so if NavigationStart, MarkFCP,\n * MarkLCPCandidate have the same timestamp, visually we\n * will render [Nav][FCP][DCL][LCP] everytime.\n */\nexport const SORT_ORDER_PAGE_LOAD_MARKERS: Readonly> = {\n [Trace.Types.Events.Name.NAVIGATION_START]: 0,\n [Trace.Types.Events.Name.MARK_LOAD]: 1,\n [Trace.Types.Events.Name.MARK_FCP]: 2,\n [Trace.Types.Events.Name.MARK_DOM_CONTENT]: 3,\n [Trace.Types.Events.Name.MARK_LCP_CANDIDATE]: 4,\n};\n\n// Threshold to match up overlay markers that are off by a tiny amount so they aren't rendered\n// on top of each other.\nconst TIMESTAMP_THRESHOLD_MS = Trace.Types.Timing.MicroSeconds(10);\n\nexport class TimelineFlameChartView extends\n Common.ObjectWrapper.eventMixin(UI.Widget.VBox)\n implements PerfUI.FlameChart.FlameChartDelegate, UI.SearchableView.Searchable {\n private readonly delegate: TimelineModeViewDelegate;\n /**\n * Tracks the indexes of matched entries when the user searches the panel.\n * Defaults to undefined which indicates the user has not searched.\n */\n private searchResults: PerfUI.FlameChart.DataProviderSearchResult[]|undefined = undefined;\n private eventListeners: Common.EventTarget.EventDescriptor[];\n // TODO(crbug.com/1172300) Ignored during the jsdoc to ts migration\n private readonly networkSplitWidget: UI.SplitWidget.SplitWidget;\n private mainDataProvider: TimelineFlameChartDataProvider;\n private readonly mainFlameChart: PerfUI.FlameChart.FlameChart;\n // TODO(crbug.com/1172300) Ignored during the jsdoc to ts migration\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n private readonly networkFlameChartGroupExpansionSetting: Common.Settings.Setting;\n private networkDataProvider: TimelineFlameChartNetworkDataProvider;\n private readonly networkFlameChart: PerfUI.FlameChart.FlameChart;\n private readonly networkPane: UI.Widget.VBox;\n private readonly splitResizer: HTMLElement;\n private readonly chartSplitWidget: UI.SplitWidget.SplitWidget;\n private brickGame?: PerfUI.BrickBreaker.BrickBreaker;\n private readonly countersView: CountersGraph;\n private readonly detailsSplitWidget: UI.SplitWidget.SplitWidget;\n private readonly detailsView: TimelineDetailsView;\n private readonly onMainAddEntryLabelAnnotation: (event: Common.EventTarget.EventTargetEvent<{\n entryIndex: number,\n withLinkCreationButton: boolean,\n }>) => void;\n private readonly onNetworkAddEntryLabelAnnotation: (event: Common.EventTarget.EventTargetEvent<{\n entryIndex: number,\n withLinkCreationButton: boolean,\n }>) => void;\n readonly #onMainEntriesLinkAnnotationCreated:\n (event: Common.EventTarget.EventTargetEvent<{entryFromIndex: number}>) => void;\n readonly #onNetworkEntriesLinkAnnotationCreated:\n (event: Common.EventTarget.EventTargetEvent<{entryFromIndex: number}>) => void;\n private readonly onMainEntrySelected: (event: Common.EventTarget.EventTargetEvent) => void;\n private readonly onNetworkEntrySelected: (event: Common.EventTarget.EventTargetEvent) => void;\n readonly #boundRefreshAfterIgnoreList: () => void;\n #selectedEvents: Trace.Types.Events.Event[]|null;\n // TODO(crbug.com/1172300) Ignored during the jsdoc to ts migration\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n private readonly groupBySetting: Common.Settings.Setting;\n private searchableView!: UI.SearchableView.SearchableView;\n private needsResizeToPreferredHeights?: boolean;\n private selectedSearchResult?: PerfUI.FlameChart.DataProviderSearchResult;\n private searchRegex?: RegExp;\n #parsedTrace: Trace.Handlers.Types.ParsedTrace|null;\n #traceInsightSets: Trace.Insights.Types.TraceInsightSets|null = null;\n #eventToRelatedInsightsMap: TimelineComponents.RelatedInsightChips.EventToRelatedInsightsMap|null = null;\n #selectedGroupName: string|null = null;\n #onTraceBoundsChangeBound = this.#onTraceBoundsChange.bind(this);\n #gameKeyMatches = 0;\n #gameTimeout = setTimeout(() => ({}), 0);\n\n #overlaysContainer: HTMLElement = document.createElement('div');\n #overlays: Overlays.Overlays.Overlays;\n\n // Tracks the in-progress time range annotation when the user alt/option clicks + drags, or when the user uses the keyboard\n #timeRangeSelectionAnnotation: Trace.Types.File.TimeRangeAnnotation|null = null;\n\n // Keep track of the link annotation that hasn't been fully selected yet.\n // We only store it here when only 'entryFrom' has been selected and\n // 'EntryTo' selection still needs to be updated.\n #linkSelectionAnnotation: Trace.Types.File.EntriesLinkAnnotation|null = null;\n\n #currentInsightOverlays: Array = [];\n #activeInsight: TimelineComponents.Sidebar.ActiveInsight|null = null;\n #markers: Array = [];\n\n #tooltipElement = document.createElement('div');\n\n // We use an symbol as the loggable for each group. This is because\n // groups can get re-built at times and we need a common reference to act as\n // the reference for each group that we log. By storing these symbols in\n // a map keyed off the context of the group, we ensure we persist the\n // loggable even if the group gets rebuilt at some point in time.\n #loggableForGroupByLogContext: Map = new Map();\n\n #onMainEntryInvoked: (event: Common.EventTarget.EventTargetEvent) => void;\n #onNetworkEntryInvoked: (event: Common.EventTarget.EventTargetEvent) => void;\n #currentSelection: TimelineSelection|null = null;\n\n constructor(delegate: TimelineModeViewDelegate) {\n super();\n this.element.classList.add('timeline-flamechart');\n\n this.delegate = delegate;\n this.eventListeners = [];\n this.#parsedTrace = null;\n\n const flameChartsContainer = new UI.Widget.VBox();\n flameChartsContainer.element.classList.add('flame-charts-container');\n\n // Create main and network flamecharts.\n this.networkSplitWidget = new UI.SplitWidget.SplitWidget(false, false, 'timeline-flamechart-main-view', 150);\n this.networkSplitWidget.show(flameChartsContainer.element);\n\n this.#overlaysContainer.classList.add('timeline-overlays-container');\n flameChartsContainer.element.appendChild(this.#overlaysContainer);\n\n this.#tooltipElement.classList.add('timeline-entry-tooltip-element');\n flameChartsContainer.element.appendChild(this.#tooltipElement);\n\n // Ensure that the network panel & resizer appears above the main thread.\n this.networkSplitWidget.sidebarElement().style.zIndex = '120';\n\n const mainViewGroupExpansionSetting =\n Common.Settings.Settings.instance().createSetting('timeline-flamechart-main-view-group-expansion', {});\n this.mainDataProvider = new TimelineFlameChartDataProvider();\n this.mainDataProvider.addEventListener(\n TimelineFlameChartDataProviderEvents.DATA_CHANGED, () => this.mainFlameChart.scheduleUpdate());\n this.mainDataProvider.addEventListener(\n TimelineFlameChartDataProviderEvents.FLAME_CHART_ITEM_HOVERED,\n e => this.detailsView.revealEventInTreeView(e.data));\n\n this.mainFlameChart = new PerfUI.FlameChart.FlameChart(this.mainDataProvider, this, {\n groupExpansionSetting: mainViewGroupExpansionSetting,\n // The TimelineOverlays are used for selected elements\n selectedElementOutline: false,\n tooltipElement: this.#tooltipElement,\n useOverlaysForCursorRuler: true,\n });\n this.mainFlameChart.alwaysShowVerticalScroll();\n this.mainFlameChart.enableRuler(false);\n\n this.mainFlameChart.addEventListener(PerfUI.FlameChart.Events.LATEST_DRAW_DIMENSIONS, dimensions => {\n this.#overlays.updateChartDimensions('main', dimensions.data.chart);\n this.#overlays.updateVisibleWindow(dimensions.data.traceWindow);\n void this.#overlays.update();\n });\n\n this.networkFlameChartGroupExpansionSetting =\n Common.Settings.Settings.instance().createSetting('timeline-flamechart-network-view-group-expansion', {});\n this.networkDataProvider = new TimelineFlameChartNetworkDataProvider();\n this.networkFlameChart = new PerfUI.FlameChart.FlameChart(this.networkDataProvider, this, {\n groupExpansionSetting: this.networkFlameChartGroupExpansionSetting,\n // The TimelineOverlays are used for selected elements\n selectedElementOutline: false,\n tooltipElement: this.#tooltipElement,\n useOverlaysForCursorRuler: true,\n });\n this.networkFlameChart.alwaysShowVerticalScroll();\n this.networkFlameChart.addEventListener(PerfUI.FlameChart.Events.LATEST_DRAW_DIMENSIONS, dimensions => {\n this.#overlays.updateChartDimensions('network', dimensions.data.chart);\n this.#overlays.updateVisibleWindow(dimensions.data.traceWindow);\n void this.#overlays.update();\n\n // If the height of the network chart has changed, we need to tell the\n // main flame chart because its tooltips are positioned based in part on\n // the height of the network chart.\n this.mainFlameChart.setTooltipYPixelAdjustment(this.#overlays.networkChartOffsetHeight());\n });\n\n this.mainFlameChart.addEventListener(PerfUI.FlameChart.Events.MOUSE_MOVE, event => {\n void this.#processFlameChartMouseMoveEvent(event.data);\n });\n\n this.networkFlameChart.addEventListener(PerfUI.FlameChart.Events.MOUSE_MOVE, event => {\n void this.#processFlameChartMouseMoveEvent(event.data);\n });\n\n this.#overlays = new Overlays.Overlays.Overlays({\n container: this.#overlaysContainer,\n flameChartsContainers: {\n main: this.mainFlameChart.element,\n network: this.networkFlameChart.element,\n },\n charts: {\n mainChart: this.mainFlameChart,\n mainProvider: this.mainDataProvider,\n networkChart: this.networkFlameChart,\n networkProvider: this.networkDataProvider,\n },\n entryQueries: {\n isEntryCollapsedByUser: (entry: Trace.Types.Events.Event): boolean => {\n return ModificationsManager.activeManager()?.getEntriesFilter().entryIsInvisible(entry) ?? false;\n },\n firstVisibleParentForEntry(entry) {\n return ModificationsManager.activeManager()?.getEntriesFilter().firstVisibleParentEntryForEntry(entry) ??\n null;\n },\n },\n });\n\n this.#overlays.addEventListener(Overlays.Overlays.AnnotationOverlayActionEvent.eventName, event => {\n const {overlay, action} = (event as Overlays.Overlays.AnnotationOverlayActionEvent);\n if (action === 'Remove') {\n // If the overlay removed is the current time range, set it to null so that\n // we would create a new time range overlay and annotation on the next time range selection instead\n // of trying to update the current overlay that does not exist.\n if (ModificationsManager.activeManager()?.getAnnotationByOverlay(overlay) ===\n this.#timeRangeSelectionAnnotation) {\n this.#timeRangeSelectionAnnotation = null;\n }\n ModificationsManager.activeManager()?.removeAnnotationOverlay(overlay);\n } else if (action === 'Update') {\n ModificationsManager.activeManager()?.updateAnnotationOverlay(overlay);\n }\n });\n\n this.element.addEventListener(OverlayComponents.EntriesLinkOverlay.EntryLinkStartCreating.eventName, () => {\n /**\n * When the user creates an entries link, they click on the arrow icon to\n * begin creating it. At this point the arrow icon gets deleted. This\n * causes the focus of the page by default to jump to the entire Timeline\n * Panel. This is a bit aggressive; and problematic as it means we cannot\n * use to cancel the creation of the entry. So instead we focus the\n * TimelineFlameChartView instead. This means that the user's gets\n * dealt with in its keydown.\n * If the user goes ahead and creates the entry, they will end up\n * focused on whichever target entry they pick, so this only matters for\n * the case where the user hits to cancel.\n */\n this.focus();\n });\n\n this.element.setAttribute('jslog', `${VisualLogging.section('timeline.flame-chart-view')}`);\n\n this.networkPane = new UI.Widget.VBox();\n this.networkPane.setMinimumSize(23, 23);\n this.networkFlameChart.show(this.networkPane.element);\n this.splitResizer = this.networkPane.element.createChild('div', 'timeline-flamechart-resizer');\n this.networkSplitWidget.hideDefaultResizer(true);\n this.networkSplitWidget.installResizer(this.splitResizer);\n this.networkSplitWidget.setMainWidget(this.mainFlameChart);\n this.networkSplitWidget.setSidebarWidget(this.networkPane);\n\n // Create counters chart splitter.\n this.chartSplitWidget = new UI.SplitWidget.SplitWidget(false, true, 'timeline-counters-split-view-state');\n this.countersView = new CountersGraph(this.delegate);\n this.chartSplitWidget.setMainWidget(flameChartsContainer);\n this.chartSplitWidget.setSidebarWidget(this.countersView);\n this.chartSplitWidget.hideDefaultResizer();\n this.chartSplitWidget.installResizer((this.countersView.resizerElement() as Element));\n\n // Create top level properties splitter.\n this.detailsSplitWidget = new UI.SplitWidget.SplitWidget(false, true, 'timeline-panel-details-split-view-state');\n this.detailsSplitWidget.element.classList.add('timeline-details-split');\n this.detailsView = new TimelineDetailsView(delegate);\n this.detailsSplitWidget.installResizer(this.detailsView.headerElement());\n this.detailsSplitWidget.setMainWidget(this.chartSplitWidget);\n this.detailsSplitWidget.setSidebarWidget(this.detailsView);\n this.detailsSplitWidget.show(this.element);\n\n // Event listeners for annotations.\n this.onMainAddEntryLabelAnnotation = this.onAddEntryLabelAnnotation.bind(this, this.mainDataProvider);\n this.onNetworkAddEntryLabelAnnotation = this.onAddEntryLabelAnnotation.bind(this, this.networkDataProvider);\n this.#onMainEntriesLinkAnnotationCreated = event =>\n this.onEntriesLinkAnnotationCreate(this.mainDataProvider, event.data.entryFromIndex);\n this.#onNetworkEntriesLinkAnnotationCreated = event =>\n this.onEntriesLinkAnnotationCreate(this.networkDataProvider, event.data.entryFromIndex);\n this.mainFlameChart.addEventListener(\n PerfUI.FlameChart.Events.ENTRY_LABEL_ANNOTATION_ADDED, this.onMainAddEntryLabelAnnotation, this);\n this.networkFlameChart.addEventListener(\n PerfUI.FlameChart.Events.ENTRY_LABEL_ANNOTATION_ADDED, this.onNetworkAddEntryLabelAnnotation, this);\n\n this.mainFlameChart.addEventListener(\n PerfUI.FlameChart.Events.ENTRIES_LINK_ANNOTATION_CREATED, this.#onMainEntriesLinkAnnotationCreated, this);\n this.networkFlameChart.addEventListener(\n PerfUI.FlameChart.Events.ENTRIES_LINK_ANNOTATION_CREATED, this.#onNetworkEntriesLinkAnnotationCreated, this);\n\n this.mainFlameChart.addEventListener(PerfUI.FlameChart.Events.TRACKS_REORDER_STATE_CHANGED, event => {\n this.#overlays.toggleAllOverlaysDisplayed(!event.data);\n });\n\n this.detailsView.addEventListener(TimelineTreeView.Events.TREE_ROW_HOVERED, node => {\n if (!Root.Runtime.experiments.isEnabled(Root.Runtime.ExperimentName.TIMELINE_DIM_UNRELATED_EVENTS)) {\n return;\n }\n const events = node?.data?.events;\n if (events) {\n this.#dimInsightRelatedEvents(events);\n } else {\n this.mainFlameChart.disableDimming();\n this.networkFlameChart.disableDimming();\n }\n });\n\n /**\n * NOTE: ENTRY_SELECTED, ENTRY_INVOKED and ENTRY_HOVERED are not always super obvious:\n * ENTRY_SELECTED: is KEYBOARD ONLY selection of events (e.g. navigating through the flamechart with your arrow keys)\n * ENTRY_HOVERED: is MOUSE ONLY when an event is hovered over with the mouse.\n * ENTRY_INVOKED: is when the user cilcks on an event, or hits the \"enter\" key whilst an event is selected.\n */\n this.onMainEntrySelected = this.onEntrySelected.bind(this, this.mainDataProvider);\n this.onNetworkEntrySelected = this.onEntrySelected.bind(this, this.networkDataProvider);\n this.mainFlameChart.addEventListener(PerfUI.FlameChart.Events.ENTRY_SELECTED, this.onMainEntrySelected, this);\n this.networkFlameChart.addEventListener(PerfUI.FlameChart.Events.ENTRY_SELECTED, this.onNetworkEntrySelected, this);\n\n this.#onMainEntryInvoked = this.#onEntryInvoked.bind(this, this.mainDataProvider);\n this.#onNetworkEntryInvoked = this.#onEntryInvoked.bind(this, this.networkDataProvider);\n this.mainFlameChart.addEventListener(PerfUI.FlameChart.Events.ENTRY_INVOKED, this.#onMainEntryInvoked, this);\n this.networkFlameChart.addEventListener(PerfUI.FlameChart.Events.ENTRY_INVOKED, this.#onNetworkEntryInvoked, this);\n\n this.mainFlameChart.addEventListener(PerfUI.FlameChart.Events.ENTRY_HOVERED, event => {\n this.onEntryHovered(event);\n this.updateLinkSelectionAnnotationWithToEntry(this.mainDataProvider, event.data);\n }, this);\n this.networkFlameChart.addEventListener(PerfUI.FlameChart.Events.ENTRY_HOVERED, event => {\n this.updateLinkSelectionAnnotationWithToEntry(this.networkDataProvider, event.data);\n }, this);\n\n this.#overlays.addEventListener(Overlays.Overlays.EventReferenceClick.eventName, event => {\n const eventRef = (event as Overlays.Overlays.EventReferenceClick);\n const fromTraceEvent = selectionFromEvent(eventRef.event);\n this.openSelectionDetailsView(fromTraceEvent);\n });\n\n this.element.addEventListener('keydown', this.#keydownHandler.bind(this));\n this.element.addEventListener('pointerdown', this.#pointerDownHandler.bind(this));\n this.#boundRefreshAfterIgnoreList = this.#refreshAfterIgnoreList.bind(this);\n this.#selectedEvents = null;\n\n this.groupBySetting = Common.Settings.Settings.instance().createSetting(\n 'timeline-tree-group-by', AggregatedTimelineTreeView.GroupBy.None);\n this.groupBySetting.addChangeListener(this.refreshMainFlameChart, this);\n this.refreshMainFlameChart();\n\n TraceBounds.TraceBounds.onChange(this.#onTraceBoundsChangeBound);\n }\n\n containingElement(): HTMLElement {\n return this.element;\n }\n\n dimEvents(events: Trace.Types.Events.Event[]): void {\n const relatedMainIndices = events.map(event => this.mainDataProvider.indexForEvent(event) ?? -1);\n const relatedNetworkIndices = events.map(event => this.networkDataProvider.indexForEvent(event) ?? -1);\n this.mainFlameChart.enableDimming(relatedMainIndices, false /** shouldAddOutlines */);\n this.networkFlameChart.enableDimming(relatedNetworkIndices, false /** shouldAddOutlines */);\n }\n\n #dimInsightRelatedEvents(relatedEvents: Trace.Types.Events.Event[]): void {\n // Dim all events except those related to the active insight.\n const relatedMainIndices = relatedEvents.map(event => this.mainDataProvider.indexForEvent(event) ?? -1);\n const relatedNetworkIndices = relatedEvents.map(event => this.networkDataProvider.indexForEvent(event) ?? -1);\n\n // Further, overlays defining a trace bounds do not dim an event that falls within those bounds.\n for (const overlay of this.#currentInsightOverlays) {\n let bounds;\n if (overlay.type === 'TIMESPAN_BREAKDOWN') {\n const firstSection = overlay.sections.at(0);\n const lastSection = overlay.sections.at(-1);\n if (firstSection && lastSection) {\n bounds = Trace.Helpers.Timing.traceWindowFromMicroSeconds(firstSection.bounds.min, lastSection.bounds.max);\n }\n } else if (overlay.type === 'TIME_RANGE') {\n bounds = overlay.bounds;\n }\n\n if (!bounds) {\n continue;\n }\n\n let provider, relevantEvents;\n\n // Using a relevant event for the overlay, determine which provider this overlay is for.\n const overlayEvent = Overlays.Overlays.entriesForOverlay(overlay).at(0);\n if (overlayEvent) {\n if (this.mainDataProvider.indexForEvent(overlayEvent) !== null) {\n provider = this.mainDataProvider;\n relevantEvents = relatedMainIndices;\n } else if (this.networkDataProvider.indexForEvent(overlayEvent) !== null) {\n provider = this.networkDataProvider;\n relevantEvents = relatedNetworkIndices;\n }\n } else if (overlay.type === 'TIMESPAN_BREAKDOWN') {\n // For this overlay type, if there is no associated event it is rendered on mainFlameChart.\n provider = this.mainDataProvider;\n relevantEvents = relatedMainIndices;\n }\n\n if (!provider || !relevantEvents) {\n continue;\n }\n\n relevantEvents.push(...provider.search(bounds).map(r => r.index));\n }\n this.mainFlameChart.enableDimmingForUnrelatedEntries(relatedMainIndices);\n this.networkFlameChart.enableDimmingForUnrelatedEntries(relatedNetworkIndices);\n }\n\n disableAllDimming(): void {\n this.mainFlameChart.disableDimming();\n this.networkFlameChart.disableDimming();\n }\n\n #sortMarkersForPreferredVisualOrder(markers: Trace.Types.Events.Event[]): void {\n markers.sort((m1, m2) => {\n const m1Index = SORT_ORDER_PAGE_LOAD_MARKERS[m1.name] ?? Infinity;\n const m2Index = SORT_ORDER_PAGE_LOAD_MARKERS[m2.name] ?? Infinity;\n return m1Index - m2Index;\n });\n }\n\n setMarkers(parsedTrace: Trace.Handlers.Types.ParsedTrace|null): void {\n if (!parsedTrace) {\n return;\n }\n // Clear out any markers.\n this.bulkRemoveOverlays(this.#markers);\n const markerEvents = parsedTrace.PageLoadMetrics.allMarkerEvents;\n // Set markers for Navigations, LCP, FCP, DCL, L.\n const markers = markerEvents.filter(\n event => event.name === Trace.Types.Events.Name.NAVIGATION_START ||\n event.name === Trace.Types.Events.Name.MARK_LCP_CANDIDATE ||\n event.name === Trace.Types.Events.Name.MARK_FCP ||\n event.name === Trace.Types.Events.Name.MARK_DOM_CONTENT ||\n event.name === Trace.Types.Events.Name.MARK_LOAD);\n\n this.#sortMarkersForPreferredVisualOrder(markers);\n const overlayByTs = new Map();\n markers.forEach(marker => {\n const adjustedTimestamp = Trace.Helpers.Timing.timeStampForEventAdjustedByClosestNavigation(\n marker,\n parsedTrace.Meta.traceBounds,\n parsedTrace.Meta.navigationsByNavigationId,\n parsedTrace.Meta.navigationsByFrameId,\n );\n // If any of the markers overlap in timing, lets put them on the same marker.\n let matchingOverlay = false;\n for (const [ts, overlay] of overlayByTs.entries()) {\n if (Math.abs(marker.ts - ts) <= TIMESTAMP_THRESHOLD_MS) {\n overlay.entries.push(marker);\n matchingOverlay = true;\n break;\n }\n }\n if (!matchingOverlay) {\n const overlay = {\n type: 'TIMINGS_MARKER',\n entries: [marker],\n adjustedTimestamp,\n } as Overlays.Overlays.TimingsMarker;\n overlayByTs.set(marker.ts, overlay);\n }\n });\n const markerOverlays: Overlays.Overlays.TimingsMarker[] = [...overlayByTs.values()];\n this.#markers = markerOverlays;\n if (this.#markers.length === 0) {\n return;\n }\n\n this.bulkAddOverlays(this.#markers);\n }\n\n setOverlays(overlays: Overlays.Overlays.TimelineOverlay[], options: Overlays.Overlays.TimelineOverlaySetOptions):\n void {\n this.bulkRemoveOverlays(this.#currentInsightOverlays);\n\n this.#currentInsightOverlays = overlays;\n if (this.#currentInsightOverlays.length === 0) {\n return;\n }\n\n const traceBounds = TraceBounds.TraceBounds.BoundsManager.instance().state()?.micro.entireTraceBounds;\n if (!traceBounds) {\n return;\n }\n\n this.bulkAddOverlays(this.#currentInsightOverlays);\n\n const entries: Trace.Types.Events.Event[] = [];\n for (const overlay of this.#currentInsightOverlays) {\n entries.push(...Overlays.Overlays.entriesForOverlay(overlay));\n }\n\n for (const entry of entries) {\n // Ensure that the track for the entries are open.\n this.#expandEntryTrack(entry);\n }\n\n if (Root.Runtime.experiments.isEnabled(Root.Runtime.ExperimentName.TIMELINE_DIM_UNRELATED_EVENTS)) {\n // The insight's `relatedEvents` property likely already includes the events associated with\n // and overlay, but just in case not, include both arrays. Duplicates are fine.\n let relatedEventsList = this.#activeInsight?.model.relatedEvents;\n if (!relatedEventsList) {\n relatedEventsList = [];\n } else if (relatedEventsList instanceof Map) {\n relatedEventsList = Array.from(relatedEventsList.keys());\n }\n this.#dimInsightRelatedEvents([...entries, ...relatedEventsList]);\n }\n\n if (options.updateTraceWindow) {\n const overlaysBounds = Overlays.Overlays.traceWindowContainingOverlays(this.#currentInsightOverlays);\n if (overlaysBounds) {\n // Trace window covering all overlays expanded by 100% so that the overlays cover 50% of the visible window.\n const expandedBounds =\n Trace.Helpers.Timing.expandWindowByPercentOrToOneMillisecond(overlaysBounds, traceBounds, 100);\n\n // Set the timeline visible window and ignore the minimap bounds. This\n // allows us to pick a visible window even if the overlays are outside of\n // the current breadcrumb. If this happens, the event listener for\n // BoundsManager changes in TimelineMiniMap will detect it and activate\n // the correct breadcrumb for us.\n TraceBounds.TraceBounds.BoundsManager.instance().setTimelineVisibleWindow(\n expandedBounds, {ignoreMiniMapBounds: true, shouldAnimate: true});\n }\n }\n\n // Reveal entry if we have one.\n if (entries.length !== 0) {\n const earliestEntry =\n entries.reduce((earliest, current) => (earliest.ts < current.ts ? earliest : current), entries[0]);\n this.revealEventVertically(earliestEntry);\n }\n }\n\n revealAnnotation(annotation: Trace.Types.File.Annotation): void {\n const traceBounds = TraceBounds.TraceBounds.BoundsManager.instance().state()?.micro.entireTraceBounds;\n if (!traceBounds) {\n return;\n }\n\n const annotationWindow = getAnnotationWindow(annotation);\n if (!annotationWindow) {\n return;\n }\n\n const annotationEntries = getAnnotationEntries(annotation);\n\n for (const entry of annotationEntries) {\n this.#expandEntryTrack(entry);\n }\n const firstEntry = annotationEntries.at(0);\n if (firstEntry) {\n this.revealEventVertically(firstEntry);\n }\n\n // Trace window covering all overlays expanded by 100% so that the overlays cover 50% of the visible window.\n const expandedBounds =\n Trace.Helpers.Timing.expandWindowByPercentOrToOneMillisecond(annotationWindow, traceBounds, 100);\n TraceBounds.TraceBounds.BoundsManager.instance().setTimelineVisibleWindow(\n expandedBounds, {ignoreMiniMapBounds: true, shouldAnimate: true});\n }\n\n setActiveInsight(insight: TimelineComponents.Sidebar.ActiveInsight|null): void {\n this.#activeInsight = insight;\n this.bulkRemoveOverlays(this.#currentInsightOverlays);\n\n if (!this.#activeInsight) {\n this.mainFlameChart.disableDimming();\n this.networkFlameChart.disableDimming();\n }\n }\n\n /**\n * Expands the track / group that the given entry is in.\n */\n #expandEntryTrack(entry: Trace.Types.Events.Event): void {\n const chartName = Overlays.Overlays.chartForEntry(entry);\n const provider = chartName === 'main' ? this.mainDataProvider : this.networkDataProvider;\n const entryChart = chartName === 'main' ? this.mainFlameChart : this.networkFlameChart;\n\n const entryIndex = provider.indexForEvent?.(entry) ?? null;\n if (entryIndex === null) {\n return;\n }\n\n const group = provider.groupForEvent?.(entryIndex) ?? null;\n if (!group) {\n return;\n }\n const groupIndex = provider.timelineData().groups.indexOf(group);\n\n if (!group.expanded && groupIndex > -1) {\n entryChart.toggleGroupExpand(groupIndex);\n }\n }\n\n addTimestampMarkerOverlay(timestamp: Trace.Types.Timing.MicroSeconds): void {\n // TIMESTAMP_MARKER is a singleton. If one already exists, it will\n // be updated instead of creating a new one.\n this.addOverlay({\n type: 'TIMESTAMP_MARKER',\n timestamp,\n });\n }\n\n async removeTimestampMarkerOverlay(): Promise {\n const removedCount = this.#overlays.removeOverlaysOfType('TIMESTAMP_MARKER');\n if (removedCount > 0) {\n // Don't trigger lots of updates on a mouse move if we didn't actually\n // remove any overlays.\n await this.#overlays.update();\n }\n }\n\n async #processFlameChartMouseMoveEvent(data: PerfUI.FlameChart.EventTypes['MouseMove']): Promise {\n const {mouseEvent, timeInMicroSeconds} = data;\n // If the user is no longer holding shift, remove any existing marker.\n if (!mouseEvent.shiftKey) {\n await this.removeTimestampMarkerOverlay();\n }\n\n if (!mouseEvent.metaKey && mouseEvent.shiftKey) {\n this.addTimestampMarkerOverlay(timeInMicroSeconds);\n }\n }\n\n #pointerDownHandler(event: PointerEvent): void {\n /**\n * If the user is in the middle of creating an entry link annotation and\n * right clicks, let's take that as a sign to exit and cancel.\n * (buttons === 2 indicates a right click)\n */\n if (event.buttons === 2 && this.#linkSelectionAnnotation) {\n this.#clearLinkSelectionAnnotation(true);\n event.stopPropagation();\n }\n }\n\n #clearLinkSelectionAnnotation(deleteCurrentLink: boolean): void {\n if (this.#linkSelectionAnnotation === null) {\n return;\n }\n // If the link in progress in cleared, make sure it's creation is complete. If not, delete it.\n if (deleteCurrentLink || this.#linkSelectionAnnotation.state !== Trace.Types.File.EntriesLinkState.CONNECTED) {\n ModificationsManager.activeManager()?.removeAnnotation(this.#linkSelectionAnnotation);\n }\n this.mainFlameChart.setLinkSelectionAnnotationIsInProgress(false);\n this.networkFlameChart.setLinkSelectionAnnotationIsInProgress(false);\n this.#linkSelectionAnnotation = null;\n }\n\n #setLinkSelectionAnnotation(linkSelectionAnnotation: Trace.Types.File.EntriesLinkAnnotation): void {\n this.mainFlameChart.setLinkSelectionAnnotationIsInProgress(true);\n this.networkFlameChart.setLinkSelectionAnnotationIsInProgress(true);\n this.#linkSelectionAnnotation = linkSelectionAnnotation;\n }\n\n #createNewTimeRangeFromKeyboard(startTime: Trace.Types.Timing.MicroSeconds, endTime: Trace.Types.Timing.MicroSeconds):\n void {\n if (this.#timeRangeSelectionAnnotation) {\n return;\n }\n\n this.#timeRangeSelectionAnnotation = {\n bounds: Trace.Helpers.Timing.traceWindowFromMicroSeconds(startTime, endTime),\n type: 'TIME_RANGE',\n label: '',\n };\n ModificationsManager.activeManager()?.createAnnotation(this.#timeRangeSelectionAnnotation);\n }\n\n /**\n * Handles key presses that could impact the creation of a time range overlay with the keyboard.\n * @returns `true` if the event should not be propogated + have its default behaviour stopped.\n */\n #handleTimeRangeKeyboardCreation(event: KeyboardEvent): boolean {\n const visibleWindow = TraceBounds.TraceBounds.BoundsManager.instance().state()?.micro.timelineTraceWindow;\n if (!visibleWindow) {\n return false;\n }\n\n // The amount we increment the time range by when using the arrow keys is\n // 2% of the visible window.\n const timeRangeIncrementValue = visibleWindow.range * 0.02;\n\n switch (event.key) {\n // ArrowLeft + ArrowRight adjusts the right hand bound (the max) of the time range\n // alt/option + ArrowRight also starts a range if there isn't one already\n case 'ArrowRight': {\n if (!this.#timeRangeSelectionAnnotation) {\n if (event.altKey) {\n let startTime = visibleWindow.min;\n // Prefer the start time of the selected event, if there is one.\n if (this.#currentSelection) {\n startTime = rangeForSelection(this.#currentSelection).min;\n }\n this.#createNewTimeRangeFromKeyboard(\n startTime, Trace.Types.Timing.MicroSeconds(startTime + timeRangeIncrementValue));\n return true;\n }\n return false;\n }\n\n // Grow the RHS of the range, but limit it to the visible window.\n this.#timeRangeSelectionAnnotation.bounds.max = Trace.Types.Timing.MicroSeconds(\n Math.min(this.#timeRangeSelectionAnnotation.bounds.max + timeRangeIncrementValue, visibleWindow.max),\n );\n this.#timeRangeSelectionAnnotation.bounds.range = Trace.Types.Timing.MicroSeconds(\n this.#timeRangeSelectionAnnotation.bounds.max - this.#timeRangeSelectionAnnotation.bounds.min,\n );\n ModificationsManager.activeManager()?.updateAnnotation(this.#timeRangeSelectionAnnotation);\n return true;\n }\n case 'ArrowLeft': {\n if (!this.#timeRangeSelectionAnnotation) {\n return false;\n }\n this.#timeRangeSelectionAnnotation.bounds.max = Trace.Types.Timing.MicroSeconds(\n // Shrink the RHS of the range, but make sure it cannot go below the min value.\n Math.max(\n this.#timeRangeSelectionAnnotation.bounds.max - timeRangeIncrementValue,\n this.#timeRangeSelectionAnnotation.bounds.min + 1),\n );\n this.#timeRangeSelectionAnnotation.bounds.range = Trace.Types.Timing.MicroSeconds(\n this.#timeRangeSelectionAnnotation.bounds.max - this.#timeRangeSelectionAnnotation.bounds.min,\n );\n ModificationsManager.activeManager()?.updateAnnotation(this.#timeRangeSelectionAnnotation);\n return true;\n }\n // ArrowDown + ArrowUp adjusts the left hand bound (the min) of the time range\n case 'ArrowUp': {\n if (!this.#timeRangeSelectionAnnotation) {\n return false;\n }\n this.#timeRangeSelectionAnnotation.bounds.min = Trace.Types.Timing.MicroSeconds(\n // Increase the LHS of the range, but make sure it cannot go above the max value.\n Math.min(\n this.#timeRangeSelectionAnnotation.bounds.min + timeRangeIncrementValue,\n this.#timeRangeSelectionAnnotation.bounds.max - 1),\n );\n this.#timeRangeSelectionAnnotation.bounds.range = Trace.Types.Timing.MicroSeconds(\n this.#timeRangeSelectionAnnotation.bounds.max - this.#timeRangeSelectionAnnotation.bounds.min,\n );\n ModificationsManager.activeManager()?.updateAnnotation(this.#timeRangeSelectionAnnotation);\n return true;\n }\n case 'ArrowDown': {\n if (!this.#timeRangeSelectionAnnotation) {\n return false;\n }\n this.#timeRangeSelectionAnnotation.bounds.min = Trace.Types.Timing.MicroSeconds(\n // Decrease the LHS, but make sure it cannot go beyond the minimum visible window.\n Math.max(this.#timeRangeSelectionAnnotation.bounds.min - timeRangeIncrementValue, visibleWindow.min),\n );\n this.#timeRangeSelectionAnnotation.bounds.range = Trace.Types.Timing.MicroSeconds(\n this.#timeRangeSelectionAnnotation.bounds.max - this.#timeRangeSelectionAnnotation.bounds.min,\n );\n ModificationsManager.activeManager()?.updateAnnotation(this.#timeRangeSelectionAnnotation);\n return true;\n }\n default: {\n // If we get any other key, we take that as a sign the user is done. Most likely the keys come from them typing into the label :)\n // If they do not type into the label, then the time range is not created.\n this.#timeRangeSelectionAnnotation = null;\n\n return false;\n }\n }\n }\n\n #keydownHandler(event: KeyboardEvent): void {\n const keyCombo = 'fixme';\n\n // `CREATION_NOT_STARTED` is only true in the state when both empty label and button to create connection are\n // created at the same time. If any key is typed in that state, it means that the label is in focus and the key\n // is typed into the label. This tells us that the user chose to create the\n // label, not the connection. In that case, delete the connection.\n if (this.#linkSelectionAnnotation &&\n this.#linkSelectionAnnotation.state === Trace.Types.File.EntriesLinkState.CREATION_NOT_STARTED) {\n this.#clearLinkSelectionAnnotation(true);\n // We have dealt with the keypress as the user is typing into the label, so do not let it propogate up.\n // This also ensures that if the user uses \"Escape\" they don't toggle the DevTools drawer.\n event.stopPropagation();\n }\n\n /**\n * If the user is in the middle of creating an entry link and hits Esc,\n * cancel and clear out the pending annotation.\n */\n if (event.key === 'Escape' && this.#linkSelectionAnnotation) {\n this.#clearLinkSelectionAnnotation(true);\n event.stopPropagation();\n event.preventDefault();\n }\n\n const eventHandledByKeyboardTimeRange = this.#handleTimeRangeKeyboardCreation(event);\n if (eventHandledByKeyboardTimeRange) {\n event.preventDefault();\n event.stopPropagation();\n return;\n }\n\n if (event.key === keyCombo[this.#gameKeyMatches]) {\n this.#gameKeyMatches++;\n clearTimeout(this.#gameTimeout);\n this.#gameTimeout = setTimeout(() => {\n this.#gameKeyMatches = 0;\n }, 2000);\n } else {\n this.#gameKeyMatches = 0;\n clearTimeout(this.#gameTimeout);\n }\n if (this.#gameKeyMatches !== keyCombo.length) {\n return;\n }\n this.runBrickBreakerGame();\n }\n\n runBrickBreakerGame(): void {\n if (!SHOULD_SHOW_EASTER_EGG) {\n return;\n }\n if ([...this.element.childNodes].find(child => child instanceof PerfUI.BrickBreaker.BrickBreaker)) {\n return;\n }\n this.brickGame = new PerfUI.BrickBreaker.BrickBreaker(this.mainFlameChart);\n this.brickGame.classList.add('brick-game');\n this.element.append(this.brickGame);\n }\n\n #onTraceBoundsChange(event: TraceBounds.TraceBounds.StateChangedEvent): void {\n if (event.updateType === 'MINIMAP_BOUNDS') {\n // If the update type was a changing of the minimap bounds, we do not\n // need to redraw the timeline.\n return;\n }\n\n const visibleWindow = event.state.milli.timelineTraceWindow;\n const shouldAnimate = Boolean(event.options.shouldAnimate);\n this.mainFlameChart.setWindowTimes(visibleWindow.min, visibleWindow.max, shouldAnimate);\n this.networkDataProvider.setWindowTimes(visibleWindow.min, visibleWindow.max);\n this.networkFlameChart.setWindowTimes(visibleWindow.min, visibleWindow.max, shouldAnimate);\n // Updating search results can be very expensive. Debounce to avoid over-calling it.\n const debouncedUpdate = Common.Debouncer.debounce(() => {\n this.updateSearchResults(false, false);\n }, 100);\n debouncedUpdate();\n }\n\n isNetworkTrackShownForTests(): boolean {\n return this.networkSplitWidget.showMode() !== UI.SplitWidget.ShowMode.ONLY_MAIN;\n }\n\n getLinkSelectionAnnotation(): Trace.Types.File.EntriesLinkAnnotation|null {\n return this.#linkSelectionAnnotation;\n }\n\n getMainDataProvider(): TimelineFlameChartDataProvider {\n return this.mainDataProvider;\n }\n\n getNetworkDataProvider(): TimelineFlameChartNetworkDataProvider {\n return this.networkDataProvider;\n }\n\n refreshMainFlameChart(): void {\n this.mainFlameChart.update();\n }\n\n extensionDataVisibilityChanged(): void {\n this.reset();\n this.setupWindowTimes();\n this.mainDataProvider.reset();\n this.mainDataProvider.timelineData(true);\n this.refreshMainFlameChart();\n }\n\n windowChanged(\n windowStartTime: Trace.Types.Timing.MilliSeconds, windowEndTime: Trace.Types.Timing.MilliSeconds,\n animate: boolean): void {\n TraceBounds.TraceBounds.BoundsManager.instance().setTimelineVisibleWindow(\n Trace.Helpers.Timing.traceWindowFromMilliSeconds(\n Trace.Types.Timing.MilliSeconds(windowStartTime),\n Trace.Types.Timing.MilliSeconds(windowEndTime),\n ),\n {shouldAnimate: animate},\n );\n }\n\n /**\n * @param startTime - the start time of the selection in MilliSeconds\n * @param endTime - the end time of the selection in MilliSeconds\n * TODO(crbug.com/346312365): update the type definitions in ChartViewport.ts\n */\n updateRangeSelection(startTime: number, endTime: number): void {\n this.delegate.select(selectionFromRangeMilliSeconds(\n Trace.Types.Timing.MilliSeconds(startTime), Trace.Types.Timing.MilliSeconds(endTime)));\n\n // We need to check if the user is updating the range because they are\n // creating a time range annotation.\n const bounds = Trace.Helpers.Timing.traceWindowFromMilliSeconds(\n Trace.Types.Timing.MilliSeconds(startTime),\n Trace.Types.Timing.MilliSeconds(endTime),\n );\n\n // If the current time range annotation exists, the range selection\n // for it is in progress and we need to update its bounds.\n //\n // When the range selection is finished, the current range is set to null.\n // If the current selection is null, create a new time range annotations.\n if (this.#timeRangeSelectionAnnotation) {\n this.#timeRangeSelectionAnnotation.bounds = bounds;\n ModificationsManager.activeManager()?.updateAnnotation(this.#timeRangeSelectionAnnotation);\n } else {\n this.#timeRangeSelectionAnnotation = {\n type: 'TIME_RANGE',\n label: '',\n bounds,\n };\n // Before creating a new range, make sure to delete the empty ranges.\n ModificationsManager.activeManager()?.deleteEmptyRangeAnnotations();\n ModificationsManager.activeManager()?.createAnnotation(this.#timeRangeSelectionAnnotation);\n }\n }\n\n getMainFlameChart(): PerfUI.FlameChart.FlameChart {\n return this.mainFlameChart;\n }\n\n // This function is public for test purpose.\n getNetworkFlameChart(): PerfUI.FlameChart.FlameChart {\n return this.networkFlameChart;\n }\n\n updateSelectedGroup(flameChart: PerfUI.FlameChart.FlameChart, group: PerfUI.FlameChart.Group|null): void {\n if (flameChart !== this.mainFlameChart || this.#selectedGroupName === group?.name) {\n return;\n }\n this.#selectedGroupName = group?.name || null;\n this.#selectedEvents = group ? this.mainDataProvider.groupTreeEvents(group) : null;\n this.#updateDetailViews();\n }\n\n setModel(newParsedTrace: Trace.Handlers.Types.ParsedTrace, isCpuProfile = false): void {\n if (newParsedTrace === this.#parsedTrace) {\n return;\n }\n this.#selectedGroupName = null;\n this.#parsedTrace = newParsedTrace;\n Common.EventTarget.removeEventListeners(this.eventListeners);\n this.#selectedEvents = null;\n this.mainDataProvider.setModel(newParsedTrace, isCpuProfile);\n this.networkDataProvider.setModel(newParsedTrace);\n this.reset();\n this.setupWindowTimes();\n this.updateSearchResults(false, false);\n this.refreshMainFlameChart();\n this.#updateFlameCharts();\n this.setMarkers(newParsedTrace);\n }\n\n setInsights(\n insights: Trace.Insights.Types.TraceInsightSets|null,\n eventToRelatedInsightsMap: TimelineComponents.RelatedInsightChips.EventToRelatedInsightsMap): void {\n if (this.#traceInsightSets === insights) {\n return;\n }\n\n this.#traceInsightSets = insights;\n this.#eventToRelatedInsightsMap = eventToRelatedInsightsMap;\n // The DetailsView is provided with the InsightSets, so make sure we update it.\n this.#updateDetailViews();\n }\n\n reset(): void {\n if (this.networkDataProvider.isEmpty()) {\n this.mainFlameChart.enableRuler(true);\n this.networkSplitWidget.hideSidebar();\n } else {\n this.mainFlameChart.enableRuler(false);\n this.networkSplitWidget.showBoth();\n this.resizeToPreferredHeights();\n }\n this.#overlays.reset();\n this.mainFlameChart.reset();\n this.networkFlameChart.reset();\n this.updateSearchResults(false, false);\n }\n\n // TODO(paulirish): It's possible this is being called more than necessary. Attempt to clean up the lifecycle.\n setupWindowTimes(): void {\n const traceBoundsState = TraceBounds.TraceBounds.BoundsManager.instance().state();\n if (!traceBoundsState) {\n throw new Error('TimelineFlameChartView could not set the window bounds.');\n }\n const visibleWindow = traceBoundsState.milli.timelineTraceWindow;\n this.mainFlameChart.setWindowTimes(visibleWindow.min, visibleWindow.max);\n this.networkDataProvider.setWindowTimes(visibleWindow.min, visibleWindow.max);\n this.networkFlameChart.setWindowTimes(visibleWindow.min, visibleWindow.max);\n }\n\n #refreshAfterIgnoreList(): void {\n // The ignore list will only affect Thread tracks, which will only be in main flame chart.\n // So just force recalculate and redraw the main flame chart here.\n this.mainDataProvider.timelineData(true);\n this.mainFlameChart.scheduleUpdate();\n }\n\n #updateDetailViews(): void {\n this.countersView.setModel(this.#parsedTrace, this.#selectedEvents);\n void this.detailsView.setModel({\n parsedTrace: this.#parsedTrace,\n selectedEvents: this.#selectedEvents,\n traceInsightsSets: this.#traceInsightSets,\n eventToRelatedInsightsMap: this.#eventToRelatedInsightsMap,\n });\n }\n\n #updateFlameCharts(): void {\n this.mainFlameChart.scheduleUpdate();\n this.networkFlameChart.scheduleUpdate();\n\n this.#registerLoggableGroups();\n }\n\n #registerLoggableGroups(): void {\n const groups = [\n ...this.mainFlameChart.timelineData()?.groups ?? [],\n ...this.networkFlameChart.timelineData()?.groups ?? [],\n ];\n for (const group of groups) {\n if (!group.jslogContext) {\n continue;\n }\n const loggable = this.#loggableForGroupByLogContext.get(group.jslogContext) ?? Symbol(group.jslogContext);\n\n if (!this.#loggableForGroupByLogContext.has(group.jslogContext)) {\n // This is the first time this group has been created, so register its loggable.\n this.#loggableForGroupByLogContext.set(group.jslogContext, loggable);\n VisualLogging.registerLoggable(\n loggable, `${VisualLogging.section().context(`timeline.${group.jslogContext}`)}`, this.delegate.element);\n }\n }\n }\n\n // If an entry is hovered over and a creation of link annotation is in progress, update that annotation with a hovered entry.\n updateLinkSelectionAnnotationWithToEntry(\n dataProvider: TimelineFlameChartDataProvider|TimelineFlameChartNetworkDataProvider, entryIndex: number): void {\n if (!this.#linkSelectionAnnotation ||\n this.#linkSelectionAnnotation.state === Trace.Types.File.EntriesLinkState.CREATION_NOT_STARTED) {\n return;\n }\n const toSelectionObject = this.#selectionIfTraceEvent(entryIndex, dataProvider);\n\n if (toSelectionObject) {\n // Prevent the user from creating a link that connects an entry to itself.\n if (toSelectionObject === this.#linkSelectionAnnotation.entryFrom) {\n return;\n }\n // Prevent the user from creating a link that connects an entry it's already connected to.\n const linkBetweenEntriesExists = ModificationsManager.activeManager()?.linkAnnotationBetweenEntriesExists(\n this.#linkSelectionAnnotation.entryFrom, toSelectionObject);\n if (linkBetweenEntriesExists) {\n return;\n }\n\n this.#linkSelectionAnnotation.state = Trace.Types.File.EntriesLinkState.CONNECTED;\n this.#linkSelectionAnnotation.entryTo = toSelectionObject;\n } else {\n this.#linkSelectionAnnotation.state = Trace.Types.File.EntriesLinkState.PENDING_TO_EVENT;\n delete this.#linkSelectionAnnotation['entryTo'];\n }\n ModificationsManager.activeManager()?.updateAnnotation(this.#linkSelectionAnnotation);\n }\n\n private onEntryHovered(commonEvent: Common.EventTarget.EventTargetEvent): void {\n SDK.OverlayModel.OverlayModel.hideDOMNodeHighlight();\n const entryIndex = commonEvent.data;\n const event = this.mainDataProvider.eventByIndex(entryIndex);\n if (!event || !this.#parsedTrace) {\n return;\n }\n if (Trace.Types.Events.isLegacyTimelineFrame(event)) {\n return;\n }\n\n const target = targetForEvent(this.#parsedTrace, event);\n if (!target) {\n return;\n }\n\n const nodeIds = Trace.Extras.FetchNodes.nodeIdsForEvent(this.#parsedTrace, event);\n for (const nodeId of nodeIds) {\n new SDK.DOMModel.DeferredDOMNode(target, nodeId).highlight();\n }\n }\n\n highlightEvent(event: Trace.Types.Events.Event|null): void {\n const entryIndex = event ? this.mainDataProvider.entryIndexForSelection(selectionFromEvent(event)) : -1;\n if (entryIndex >= 0) {\n this.mainFlameChart.highlightEntry(entryIndex);\n } else {\n this.mainFlameChart.hideHighlight();\n }\n }\n\n override willHide(): void {\n this.networkFlameChartGroupExpansionSetting.removeChangeListener(this.resizeToPreferredHeights, this);\n Bindings.IgnoreListManager.IgnoreListManager.instance().removeChangeListener(this.#boundRefreshAfterIgnoreList);\n }\n\n override wasShown(): void {\n this.registerCSSFiles([timelineFlameChartViewStyles]);\n this.networkFlameChartGroupExpansionSetting.addChangeListener(this.resizeToPreferredHeights, this);\n Bindings.IgnoreListManager.IgnoreListManager.instance().addChangeListener(this.#boundRefreshAfterIgnoreList);\n if (this.needsResizeToPreferredHeights) {\n this.resizeToPreferredHeights();\n }\n this.#updateFlameCharts();\n }\n\n updateCountersGraphToggle(showMemoryGraph: boolean): void {\n if (showMemoryGraph) {\n this.chartSplitWidget.showBoth();\n } else {\n this.chartSplitWidget.hideSidebar();\n }\n }\n\n revealEvent(event: Trace.Types.Events.Event): void {\n const mainIndex = this.mainDataProvider.indexForEvent(event);\n const networkIndex = this.networkDataProvider.indexForEvent(event);\n if (mainIndex !== null) {\n this.mainFlameChart.revealEntry(mainIndex);\n } else if (networkIndex !== null) {\n this.networkFlameChart.revealEntry(networkIndex);\n }\n }\n\n // Given an event, it reveals its position vertically\n revealEventVertically(event: Trace.Types.Events.Event): void {\n const mainIndex = this.mainDataProvider.indexForEvent(event);\n const networkIndex = this.networkDataProvider.indexForEvent(event);\n if (mainIndex !== null) {\n this.mainFlameChart.revealEntryVertically(mainIndex);\n } else if (networkIndex !== null) {\n this.networkFlameChart.revealEntryVertically(networkIndex);\n }\n }\n\n setSelectionAndReveal(selection: TimelineSelection|null): void {\n this.#currentSelection = selection;\n const mainIndex = this.mainDataProvider.entryIndexForSelection(selection);\n const networkIndex = this.networkDataProvider.entryIndexForSelection(selection);\n this.mainFlameChart.setSelectedEntry(mainIndex);\n this.networkFlameChart.setSelectedEntry(networkIndex);\n\n // Clear any existing entry selection.\n this.#overlays.removeOverlaysOfType('ENTRY_SELECTED');\n // If:\n // 1. There is no selection, or the selection is not a range selection\n // AND 2. we have an active time range selection overlay\n // AND 3. The label of the selection is empty\n // then we need to remove it.\n if ((selection === null || !selectionIsRange(selection)) && this.#timeRangeSelectionAnnotation &&\n !this.#timeRangeSelectionAnnotation.label) {\n ModificationsManager.activeManager()?.removeAnnotation(this.#timeRangeSelectionAnnotation);\n this.#timeRangeSelectionAnnotation = null;\n }\n\n let index = this.mainDataProvider.entryIndexForSelection(selection);\n this.mainFlameChart.setSelectedEntry(index);\n index = this.networkDataProvider.entryIndexForSelection(selection);\n this.networkFlameChart.setSelectedEntry(index);\n if (this.detailsView) {\n // TODO(crbug.com/1459265): Change to await after migration work.\n void this.detailsView.setSelection(selection);\n }\n\n // Create the entry selected overlay if the selection represents a trace event\n if (selectionIsEvent(selection)) {\n this.addOverlay({\n type: 'ENTRY_SELECTED',\n entry: selection.event,\n });\n }\n\n if (this.#linkSelectionAnnotation &&\n this.#linkSelectionAnnotation.state === Trace.Types.File.EntriesLinkState.CREATION_NOT_STARTED) {\n this.#clearLinkSelectionAnnotation(true);\n }\n }\n\n // Only opens the details view of a selection. This is used for Timing Markers. Timing markers replace\n // their entry with a new UI. Becuase of that, thier entries can no longer be \"selected\" in the timings track,\n // so if clicked, we only open their details view.\n openSelectionDetailsView(selection: TimelineSelection|null): void {\n if (this.detailsView) {\n void this.detailsView.setSelection(selection);\n }\n }\n\n /**\n * Used to create multiple overlays at once without triggering a redraw for each one.\n */\n bulkAddOverlays(overlays: Overlays.Overlays.TimelineOverlay[]): void {\n for (const overlay of overlays) {\n this.#overlays.add(overlay);\n }\n void this.#overlays.update();\n }\n\n addOverlay(newOverlay: T): T {\n const overlay = this.#overlays.add(newOverlay);\n void this.#overlays.update();\n return overlay;\n }\n\n bulkRemoveOverlays(overlays: Overlays.Overlays.TimelineOverlay[]): void {\n if (!overlays.length) {\n return;\n }\n\n for (const overlay of overlays) {\n this.#overlays.remove(overlay);\n }\n void this.#overlays.update();\n }\n\n removeOverlay(removedOverlay: Overlays.Overlays.TimelineOverlay): void {\n this.#overlays.remove(removedOverlay);\n void this.#overlays.update();\n }\n\n updateExistingOverlay(existingOverlay: T, newData: Partial): void {\n this.#overlays.updateExisting(existingOverlay, newData);\n void this.#overlays.update();\n }\n\n enterLabelEditMode(overlay: Overlays.Overlays.EntryLabel): void {\n this.#overlays.enterLabelEditMode(overlay);\n }\n\n private onAddEntryLabelAnnotation(\n dataProvider: TimelineFlameChartDataProvider|TimelineFlameChartNetworkDataProvider,\n event: Common.EventTarget.EventTargetEvent<{entryIndex: number, withLinkCreationButton: boolean}>): void {\n const selection = dataProvider.createSelection(event.data.entryIndex);\n if (selectionIsEvent(selection)) {\n this.setSelectionAndReveal(selection);\n ModificationsManager.activeManager()?.createAnnotation({\n type: 'ENTRY_LABEL',\n entry: selection.event,\n label: '',\n });\n if (event.data.withLinkCreationButton) {\n this.onEntriesLinkAnnotationCreate(dataProvider, event.data.entryIndex, true);\n }\n }\n }\n\n onEntriesLinkAnnotationCreate(\n dataProvider: TimelineFlameChartDataProvider|TimelineFlameChartNetworkDataProvider, entryFromIndex: number,\n linkCreateButton?: boolean): void {\n const fromSelectionObject = (entryFromIndex) ? this.#selectionIfTraceEvent(entryFromIndex, dataProvider) : null;\n\n if (fromSelectionObject) {\n this.#setLinkSelectionAnnotation({\n type: 'ENTRIES_LINK',\n entryFrom: fromSelectionObject,\n state: (linkCreateButton) ? Trace.Types.File.EntriesLinkState.CREATION_NOT_STARTED :\n Trace.Types.File.EntriesLinkState.PENDING_TO_EVENT,\n });\n if (this.#linkSelectionAnnotation) {\n ModificationsManager.activeManager()?.createAnnotation(this.#linkSelectionAnnotation);\n }\n }\n }\n\n #selectionIfTraceEvent(\n index: number, dataProvider: TimelineFlameChartDataProvider|TimelineFlameChartNetworkDataProvider):\n Trace.Types.Events.Event|null {\n const selection = dataProvider.createSelection(index);\n return selectionIsEvent(selection) ? selection.event : null;\n }\n\n /**\n * Called when the user either:\n * 1. clicks with their mouse on an entry\n * 2. Uses the keyboard and presses \"enter\" whilst an entry is selected\n */\n #onEntryInvoked(\n dataProvider: TimelineFlameChartDataProvider|TimelineFlameChartNetworkDataProvider,\n event: Common.EventTarget.EventTargetEvent): void {\n this.#updateSelectedEntryStatus(dataProvider, event);\n\n const entryIndex = event.data;\n // If we have a pending link connection, create it if we can now the final entry has been pressed.\n if (this.#linkSelectionAnnotation) {\n this.handleToEntryOfLinkBetweenEntriesSelection(entryIndex);\n }\n }\n\n #updateSelectedEntryStatus(\n dataProvider: TimelineFlameChartDataProvider|TimelineFlameChartNetworkDataProvider,\n event: Common.EventTarget.EventTargetEvent): void {\n const data = dataProvider.timelineData();\n if (!data) {\n return;\n }\n const entryIndex = event.data;\n\n const entryLevel = data.entryLevels[entryIndex];\n\n // Find the group that contains this level and log a click for it.\n const group = groupForLevel(data.groups, entryLevel);\n if (group && group.jslogContext) {\n const loggable = this.#loggableForGroupByLogContext.get(group.jslogContext) ?? null;\n if (loggable) {\n VisualLogging.logClick(loggable, new MouseEvent('click'));\n }\n }\n\n dataProvider.buildFlowForInitiator(entryIndex);\n this.delegate.select(dataProvider.createSelection(entryIndex));\n }\n\n /**\n * This is invoked when the user uses their KEYBOARD ONLY to navigate between\n * events.\n * It IS NOT called when the user uses the mouse. See `onEntryInvoked`.\n */\n private onEntrySelected(\n dataProvider: TimelineFlameChartDataProvider|TimelineFlameChartNetworkDataProvider,\n event: Common.EventTarget.EventTargetEvent): void {\n this.#updateSelectedEntryStatus(dataProvider, event);\n\n // Update any pending link selection to point the entryTo to what the user has selected.\n const entryIndex = event.data;\n const toSelectionObject = this.#selectionIfTraceEvent(entryIndex, dataProvider);\n if (toSelectionObject && toSelectionObject !== this.#linkSelectionAnnotation?.entryTo) {\n this.updateLinkSelectionAnnotationWithToEntry(dataProvider, entryIndex);\n }\n }\n\n handleToEntryOfLinkBetweenEntriesSelection(toIndex: number): void {\n // If there is a link annotation in the process of being created when an empty\n // space in the Flamechart is clicked, delete the link being created.\n //\n // If an entry is clicked when a link between entries in created and the entry that an arrow\n // is pointing to is earlier than the one it starts from, switch 'to' and 'from' entries to\n // reverse the arrow.\n if (this.#linkSelectionAnnotation && toIndex === -1) {\n ModificationsManager.activeManager()?.removeAnnotation(this.#linkSelectionAnnotation);\n } else if (\n this.#linkSelectionAnnotation && this.#linkSelectionAnnotation?.entryTo &&\n (this.#linkSelectionAnnotation?.entryFrom.ts > this.#linkSelectionAnnotation?.entryTo.ts)) {\n const entryFrom = this.#linkSelectionAnnotation.entryFrom;\n const entryTo = this.#linkSelectionAnnotation.entryTo;\n this.#linkSelectionAnnotation.entryTo = entryFrom;\n this.#linkSelectionAnnotation.entryFrom = entryTo;\n ModificationsManager.activeManager()?.updateAnnotation(this.#linkSelectionAnnotation);\n }\n // Regardless of if the link in progress was deleted or the clicked entry is the final selection,\n // set the link selection in progress to null so a new one is created if the an event to create\n // of update the current link is dispatched.\n this.#clearLinkSelectionAnnotation(false);\n }\n\n resizeToPreferredHeights(): void {\n if (!this.isShowing()) {\n this.needsResizeToPreferredHeights = true;\n return;\n }\n this.needsResizeToPreferredHeights = false;\n this.networkPane.element.classList.toggle(\n 'timeline-network-resizer-disabled', !this.networkDataProvider.isExpanded());\n this.networkSplitWidget.setSidebarSize(\n this.networkDataProvider.preferredHeight() + this.splitResizer.clientHeight + PerfUI.FlameChart.RulerHeight +\n 2);\n }\n\n setSearchableView(searchableView: UI.SearchableView.SearchableView): void {\n this.searchableView = searchableView;\n }\n\n // UI.SearchableView.Searchable implementation\n\n searchResultIndexForEntryIndex(index: number): number {\n if (!this.searchResults) {\n return -1;\n }\n return this.searchResults.findIndex(result => result.index === index);\n }\n\n jumpToNextSearchResult(): void {\n if (!this.searchResults || !this.searchResults.length) {\n return;\n }\n const index =\n typeof this.selectedSearchResult !== 'undefined' ? this.searchResults.indexOf(this.selectedSearchResult) : -1;\n this.#selectSearchResult(Platform.NumberUtilities.mod(index + 1, this.searchResults.length));\n }\n\n jumpToPreviousSearchResult(): void {\n if (!this.searchResults || !this.searchResults.length) {\n return;\n }\n const index =\n typeof this.selectedSearchResult !== 'undefined' ? this.searchResults.indexOf(this.selectedSearchResult) : 0;\n this.#selectSearchResult(Platform.NumberUtilities.mod(index - 1, this.searchResults.length));\n }\n\n supportsCaseSensitiveSearch(): boolean {\n return true;\n }\n\n supportsRegexSearch(): boolean {\n return true;\n }\n\n #selectSearchResult(searchResultIndex: number): void {\n this.searchableView.updateCurrentMatchIndex(searchResultIndex);\n const matchedResult = this.searchResults?.at(searchResultIndex) ?? null;\n if (!matchedResult) {\n return;\n }\n\n switch (matchedResult.provider) {\n case 'main': {\n this.delegate.select(this.mainDataProvider.createSelection(matchedResult.index));\n this.mainFlameChart.showPopoverForSearchResult(matchedResult.index);\n break;\n }\n case 'network': {\n this.delegate.select(this.networkDataProvider.createSelection(matchedResult.index));\n this.networkFlameChart.showPopoverForSearchResult(matchedResult.index);\n break;\n }\n case 'other':\n // TimelineFlameChartView only has main/network so we can ignore.\n break;\n default:\n Platform.assertNever(matchedResult.provider, `Unknown SearchResult[provider]: ${matchedResult.provider}`);\n }\n this.selectedSearchResult = matchedResult;\n }\n\n private updateSearchResults(shouldJump: boolean, jumpBackwards?: boolean): void {\n const traceBoundsState = TraceBounds.TraceBounds.BoundsManager.instance().state();\n if (!traceBoundsState) {\n return;\n }\n\n const oldSelectedSearchResult = this.selectedSearchResult;\n delete this.selectedSearchResult;\n this.searchResults = [];\n if (!this.searchRegex) {\n return;\n }\n this.mainFlameChart.removeSearchResultHighlights();\n this.networkFlameChart.removeSearchResultHighlights();\n const regExpFilter = new TimelineRegExp(this.searchRegex);\n const visibleWindow = traceBoundsState.micro.timelineTraceWindow;\n\n /**\n * Get the matches for the user's search result. We search both providers\n * but before storing the results we need to \"tag\" the results with the\n * provider they came from. We do this so that when the user highlights a\n * search result we know which flame chart to talk to to highlight it.\n */\n const mainMatches = this.mainDataProvider.search(visibleWindow, regExpFilter);\n const networkMatches = this.networkDataProvider.search(visibleWindow, regExpFilter);\n\n // Merge both result sets into one, sorted by start time. This means as the\n // user navigates back/forwards they will do so in time order and not do\n // all the main results before the network results, or some other\n // unexpected ordering.\n this.searchResults = mainMatches.concat(networkMatches).sort((m1, m2) => {\n return m1.startTimeMilli - m2.startTimeMilli;\n });\n\n this.searchableView.updateSearchMatchesCount(this.searchResults.length);\n\n this.mainFlameChart.highlightAllEntries(mainMatches.map(m => m.index));\n this.networkFlameChart.highlightAllEntries(networkMatches.map(m => m.index));\n if (!shouldJump || !this.searchResults.length) {\n return;\n }\n let selectedIndex = this.#indexOfSearchResult(oldSelectedSearchResult);\n if (selectedIndex === -1) {\n selectedIndex = jumpBackwards ? this.searchResults.length - 1 : 0;\n }\n this.#selectSearchResult(selectedIndex);\n }\n\n #indexOfSearchResult(target?: PerfUI.FlameChart.DataProviderSearchResult): number {\n if (!target) {\n return -1;\n }\n\n return this.searchResults?.findIndex(result => {\n return result.provider === target.provider && result.index === target.index;\n }) ??\n -1;\n }\n\n /**\n * Returns the indexes of the elements that matched the most recent\n * query. Elements are indexed by the data provider and correspond\n * to their position in the data provider entry data array.\n * Public only for tests.\n */\n getSearchResults(): PerfUI.FlameChart.DataProviderSearchResult[]|undefined {\n return this.searchResults;\n }\n\n onSearchCanceled(): void {\n if (typeof this.selectedSearchResult !== 'undefined') {\n this.delegate.select(null);\n }\n delete this.searchResults;\n delete this.selectedSearchResult;\n delete this.searchRegex;\n this.mainFlameChart.showPopoverForSearchResult(null);\n this.mainFlameChart.removeSearchResultHighlights();\n this.networkFlameChart.showPopoverForSearchResult(null);\n this.networkFlameChart.removeSearchResultHighlights();\n }\n\n performSearch(searchConfig: UI.SearchableView.SearchConfig, shouldJump: boolean, jumpBackwards?: boolean): void {\n this.searchRegex = searchConfig.toSearchRegex().regex;\n this.updateSearchResults(shouldJump, jumpBackwards);\n }\n\n togglePopover({event, show}: {event: Trace.Types.Events.Event, show: boolean}): void {\n const entryIndex = this.mainDataProvider.indexForEvent(event);\n if (show && entryIndex) {\n this.mainFlameChart.setSelectedEntry(entryIndex);\n this.mainFlameChart.showPopoverForSearchResult(entryIndex);\n } else {\n this.mainFlameChart.hideHighlight();\n }\n }\n\n overlays(): Overlays.Overlays.Overlays {\n return this.#overlays;\n }\n}\n\nexport class Selection {\n timelineSelection: TimelineSelection;\n entryIndex: number;\n constructor(selection: TimelineSelection, entryIndex: number) {\n this.timelineSelection = selection;\n this.entryIndex = entryIndex;\n }\n}\n\nexport const FlameChartStyle = {\n textColor: '#333',\n};\n\nexport class TimelineFlameChartMarker implements PerfUI.FlameChart.FlameChartMarker {\n private readonly startTimeInternal: number;\n private readonly startOffset: number;\n private style: TimelineMarkerStyle;\n constructor(startTime: number, startOffset: number, style: TimelineMarkerStyle) {\n this.startTimeInternal = startTime;\n this.startOffset = startOffset;\n this.style = style;\n }\n\n startTime(): number {\n return this.startTimeInternal;\n }\n\n color(): string {\n return this.style.color;\n }\n\n title(): string|null {\n if (this.style.lowPriority) {\n return null;\n }\n const startTime = i18n.TimeUtilities.millisToString(this.startOffset);\n return i18nString(UIStrings.sAtS, {PH1: this.style.title, PH2: startTime});\n }\n\n draw(context: CanvasRenderingContext2D, x: number, height: number, pixelsPerMillisecond: number): void {\n const lowPriorityVisibilityThresholdInPixelsPerMs = 4;\n\n if (this.style.lowPriority && pixelsPerMillisecond < lowPriorityVisibilityThresholdInPixelsPerMs) {\n return;\n }\n\n if (!this.style.tall) {\n return;\n }\n\n context.save();\n\n context.strokeStyle = this.style.color;\n context.lineWidth = this.style.lineWidth;\n context.translate(this.style.lineWidth < 1 || (this.style.lineWidth & 1) ? 0.5 : 0, 0.5);\n context.beginPath();\n context.moveTo(x, 0);\n context.setLineDash(this.style.dashStyle);\n context.lineTo(x, context.canvas.height);\n context.stroke();\n\n context.restore();\n }\n}\n\nexport const enum ColorBy {\n URL = 'URL',\n}\n\n/**\n * Find the Group that contains the provided level, or `null` if no group is\n * found.\n */\nexport function groupForLevel(groups: PerfUI.FlameChart.Group[], level: number): PerfUI.FlameChart.Group|null {\n const groupForLevel = groups.find((group, groupIndex) => {\n const nextGroup = groups.at(groupIndex + 1);\n const groupEndLevel = nextGroup ? nextGroup.startLevel - 1 : Infinity;\n\n return group.startLevel <= level && groupEndLevel >= level;\n });\n return groupForLevel ?? null;\n}\n"]} \ No newline at end of file diff --git a/public/panels/timeline/TimelineFlameChartView.test.js b/public/panels/timeline/TimelineFlameChartView.test.js index e824fd488..1738433f4 100644 --- a/public/panels/timeline/TimelineFlameChartView.test.js +++ b/public/panels/timeline/TimelineFlameChartView.test.js @@ -336,37 +336,37 @@ describeWithEnvironment('TimelineFlameChartView', function () { generateContextMenuForNodeId(nodeIdWithNoChildren); assert.strictEqual(flameChartView.getMainFlameChart().getContextMenu()?.defaultSection().items.length, 5); // Hide function enabled - assert.strictEqual(flameChartView.getMainFlameChart() + assert.isTrue(flameChartView.getMainFlameChart() .getContextMenu() ?.defaultSection() .items.at(0) ?.buildDescriptor() - .enabled, true); + .enabled); // Rest of the actions disabled - assert.strictEqual(flameChartView.getMainFlameChart() + assert.isFalse(flameChartView.getMainFlameChart() .getContextMenu() ?.defaultSection() .items.at(1) ?.buildDescriptor() - .enabled, false); - assert.strictEqual(flameChartView.getMainFlameChart() + .enabled); + assert.isFalse(flameChartView.getMainFlameChart() .getContextMenu() ?.defaultSection() .items.at(2) ?.buildDescriptor() - .enabled, false); - assert.strictEqual(flameChartView.getMainFlameChart() + .enabled); + assert.isFalse(flameChartView.getMainFlameChart() .getContextMenu() ?.defaultSection() .items.at(3) ?.buildDescriptor() - .enabled, false); - assert.strictEqual(flameChartView.getMainFlameChart() + .enabled); + assert.isFalse(flameChartView.getMainFlameChart() .getContextMenu() ?.defaultSection() .items.at(4) ?.buildDescriptor() - .enabled, false); + .enabled); }); it('When an entry has children, correctly make only Hide Entry and Hide Children enabled in the Context Menu action', async function () { /** Part of this stack looks roughly like so (with some events omitted): @@ -397,38 +397,38 @@ describeWithEnvironment('TimelineFlameChartView', function () { // This entry has URL, so there are 5 always-shown actions, and one to add script to ignore list. assert.strictEqual(flameChartView.getMainFlameChart().getContextMenu()?.defaultSection().items.length, 6); // Hide function enabled - assert.strictEqual(flameChartView.getMainFlameChart() + assert.isTrue(flameChartView.getMainFlameChart() .getContextMenu() ?.defaultSection() .items.at(0) ?.buildDescriptor() - .enabled, true); + .enabled); // Hide children enabled - assert.strictEqual(flameChartView.getMainFlameChart() + assert.isTrue(flameChartView.getMainFlameChart() .getContextMenu() ?.defaultSection() .items.at(1) ?.buildDescriptor() - .enabled, true); + .enabled); // Rest of the actions disabled - assert.strictEqual(flameChartView.getMainFlameChart() + assert.isFalse(flameChartView.getMainFlameChart() .getContextMenu() ?.defaultSection() .items.at(2) ?.buildDescriptor() - .enabled, false); - assert.strictEqual(flameChartView.getMainFlameChart() + .enabled); + assert.isFalse(flameChartView.getMainFlameChart() .getContextMenu() ?.defaultSection() .items.at(3) ?.buildDescriptor() - .enabled, false); - assert.strictEqual(flameChartView.getMainFlameChart() + .enabled); + assert.isFalse(flameChartView.getMainFlameChart() .getContextMenu() ?.defaultSection() .items.at(4) ?.buildDescriptor() - .enabled, false); + .enabled); }); it('When an entry has repeating children, correctly make only Hide Entry, Hide Children and Hide repeating children enabled in the Context Menu action', async function () { /** Part of this stack looks roughly like so (with some events omitted): @@ -458,39 +458,39 @@ describeWithEnvironment('TimelineFlameChartView', function () { // This entry has URL, so there are 5 always-shown actions, and one to add script to ignore list. assert.strictEqual(flameChartView.getMainFlameChart().getContextMenu()?.defaultSection().items.length, 6); // Hide function enabled - assert.strictEqual(flameChartView.getMainFlameChart() + assert.isTrue(flameChartView.getMainFlameChart() .getContextMenu() ?.defaultSection() .items.at(0) ?.buildDescriptor() - .enabled, true); + .enabled); // Hide children enabled - assert.strictEqual(flameChartView.getMainFlameChart() + assert.isTrue(flameChartView.getMainFlameChart() .getContextMenu() ?.defaultSection() .items.at(1) ?.buildDescriptor() - .enabled, true); + .enabled); // Hide repeating children enabled - assert.strictEqual(flameChartView.getMainFlameChart() + assert.isTrue(flameChartView.getMainFlameChart() .getContextMenu() ?.defaultSection() .items.at(2) ?.buildDescriptor() - .enabled, true); + .enabled); // Rest of the actions disabled - assert.strictEqual(flameChartView.getMainFlameChart() + assert.isFalse(flameChartView.getMainFlameChart() .getContextMenu() ?.defaultSection() .items.at(3) ?.buildDescriptor() - .enabled, false); - assert.strictEqual(flameChartView.getMainFlameChart() + .enabled); + assert.isFalse(flameChartView.getMainFlameChart() .getContextMenu() ?.defaultSection() .items.at(4) ?.buildDescriptor() - .enabled, false); + .enabled); }); it('When an entry has no parent and has children, correctly make only Hide Children enabled in the Context Menu action', async function () { /** Part of this stack looks roughly like so (with some events omitted): @@ -525,38 +525,38 @@ describeWithEnvironment('TimelineFlameChartView', function () { assert.exists(nodeId); generateContextMenuForNodeId(nodeId); // Hide function disabled - assert.strictEqual(flameChartView.getMainFlameChart() + assert.isFalse(flameChartView.getMainFlameChart() .getContextMenu() ?.defaultSection() .items.at(0) ?.buildDescriptor() - .enabled, false); + .enabled); // Hide children enabled - assert.strictEqual(flameChartView.getMainFlameChart() + assert.isTrue(flameChartView.getMainFlameChart() .getContextMenu() ?.defaultSection() .items.at(1) ?.buildDescriptor() - .enabled, true); + .enabled); // Rest of the actions disabled - assert.strictEqual(flameChartView.getMainFlameChart() + assert.isFalse(flameChartView.getMainFlameChart() .getContextMenu() ?.defaultSection() .items.at(2) ?.buildDescriptor() - .enabled, false); - assert.strictEqual(flameChartView.getMainFlameChart() + .enabled); + assert.isFalse(flameChartView.getMainFlameChart() .getContextMenu() ?.defaultSection() .items.at(3) ?.buildDescriptor() - .enabled, false); - assert.strictEqual(flameChartView.getMainFlameChart() + .enabled); + assert.isFalse(flameChartView.getMainFlameChart() .getContextMenu() ?.defaultSection() .items.at(4) ?.buildDescriptor() - .enabled, false); + .enabled); }); it('Reset Trace Context Menu action is disabled before some action has been applied', async function () { /** Part of this stack looks roughly like so (with some events omitted): @@ -584,21 +584,21 @@ describeWithEnvironment('TimelineFlameChartView', function () { assert.strictEqual(flameChartView.getMainFlameChart().getContextMenu()?.defaultSection().items.length, 5); assert.strictEqual(flameChartView.getMainFlameChart().getContextMenu()?.defaultSection().items.at(4)?.buildDescriptor().label, 'Reset trace'); // Check that Reset Trace is disabled - assert.strictEqual(flameChartView.getMainFlameChart() + assert.isFalse(flameChartView.getMainFlameChart() .getContextMenu() ?.defaultSection() .items.at(4) ?.buildDescriptor() - .enabled, false); + .enabled); flameChartView.getMainFlameChart().modifyTree("MERGE_FUNCTION" /* PerfUI.FlameChart.FilterAction.MERGE_FUNCTION */, nodeId); generateContextMenuForNodeId(nodeId); // Check that Reset Trace is enabled - assert.strictEqual(flameChartView.getMainFlameChart() + assert.isTrue(flameChartView.getMainFlameChart() .getContextMenu() ?.defaultSection() .items.at(4) ?.buildDescriptor() - .enabled, true); + .enabled); }); it('When an entry has URL and is not ignored, correctly show the Add script to ignore list in the Context Menu action', async function () { const mainThread = getMainThread(parsedTrace.Renderer); diff --git a/public/panels/timeline/TimelineFlameChartView.test.js.map b/public/panels/timeline/TimelineFlameChartView.test.js.map index 19593c77b..45d0862c7 100644 --- a/public/panels/timeline/TimelineFlameChartView.test.js.map +++ b/public/panels/timeline/TimelineFlameChartView.test.js.map @@ -1 +1 @@ -{"version":3,"file":"TimelineFlameChartView.test.js","sourceRoot":"","sources":["../../../../../../front_end/panels/timeline/TimelineFlameChartView.test.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAI7B,OAAO,KAAK,QAAQ,MAAM,mCAAmC,CAAC;AAC9D,OAAO,KAAK,KAAK,MAAM,6BAA6B,CAAC;AACrD,OAAO,EAAC,uBAAuB,EAAC,MAAM,qCAAqC,CAAC;AAC5E,OAAO,EAAC,iCAAiC,EAAC,MAAM,+BAA+B,CAAC;AAChF,OAAO,EAAC,WAAW,EAAC,MAAM,8BAA8B,CAAC;AACzD,OAAO,KAAK,MAAM,MAAM,+CAA+C,CAAC;AACxE,OAAO,KAAK,EAAE,MAAM,2BAA2B,CAAC;AAEhD,OAAO,KAAK,QAAQ,MAAM,eAAe,CAAC;AAE1C,MAAM,gBAAgB;IACpB,SAAS,GAAsD,IAAI,CAAC;IACpE,MAAM,CAAC,SAA4D;QACjE,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;IAC7B,CAAC;IACD,iBAAiB,CAAC,OAAwC,EAAE,KAAa;IACzE,CAAC;IACD,cAAc,CAAC,MAAqC;IACpD,CAAC;IACD,OAAO,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;CACzC;AAED,uBAAuB,CAAC,wBAAwB,EAAE;IAChD,UAAU,CAAC,GAAG,EAAE;QACd,iCAAiC,EAAE,CAAC;IACtC,CAAC,CAAC,CAAC;IAEH,QAAQ,CAAC,eAAe,EAAE,GAA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AAmB,EAAE,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC;YAEzE,0FAA0F;YAC1F,cAAc,CAAC,wCAAwC,CAAC,cAAc,CAAC,mBAAmB,EAAE,EAAE,GAAG,CAAC,CAAC;YACnG,MAAM,OAAO,GAAG,cAAc,CAAC,mBAAmB,EAAE,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC;YAEvE,kFAAkF;YAClF,cAAc,CAAC,0CAA0C,CAAC,GAAG,CAAC,CAAC;YAE/D,8DAA8D;YAC9D,MAAM,WAAW,GAAG,QAAQ,CAAC,oBAAoB,CAAC,oBAAoB,CAAC,aAAa,EAAE,EAAE,cAAc,EAAE,CAAC;YACzG,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;YAC3B,MAAM,CAAC,WAAW,CAAC,WAAW,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC;YAC3C,MAAM,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,cAAc,CAAC,CAAC;YACxD,MAAM,WAAW,GAAG,WAAW,CAAC,CAAC,CAA2C,CAAC;YAE7E,4FAA4F;YAC5F,MAAM,CAAC,WAAW,CAAC,WAAW,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;YACnD,MAAM,CAAC,WAAW,CAAC,WAAW,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;QACrD,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["// Copyright 2023 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport type * as Common from '../../core/common/common.js';\nimport type * as Platform from '../../core/platform/platform.js';\nimport * as Bindings from '../../models/bindings/bindings.js';\nimport * as Trace from '../../models/trace/trace.js';\nimport {describeWithEnvironment} from '../../testing/EnvironmentHelpers.js';\nimport {setupIgnoreListManagerEnvironment} from '../../testing/TraceHelpers.js';\nimport {TraceLoader} from '../../testing/TraceLoader.js';\nimport * as PerfUI from '../../ui/legacy/components/perf_ui/perf_ui.js';\nimport * as UI from '../../ui/legacy/legacy.js';\n\nimport * as Timeline from './timeline.js';\n\nclass MockViewDelegate implements Timeline.TimelinePanel.TimelineModeViewDelegate {\n selection: Timeline.TimelineSelection.TimelineSelection|null = null;\n select(selection: Timeline.TimelineSelection.TimelineSelection|null): void {\n this.selection = selection;\n }\n selectEntryAtTime(_events: Trace.Types.Events.Event[]|null, _time: number): void {\n }\n highlightEvent(_event: Trace.Types.Events.Event|null): void {\n }\n element = document.createElement('div');\n}\n\ndescribeWithEnvironment('TimelineFlameChartView', function() {\n beforeEach(() => {\n setupIgnoreListManagerEnvironment();\n });\n\n describe('groupForLevel', () => {\n const {groupForLevel} = Timeline.TimelineFlameChartView;\n\n it('finds the right group for the given level', async () => {\n const groups: PerfUI.FlameChart.Group[] = [\n {\n name: 'group-1' as Common.UIString.LocalizedString,\n startLevel: 0,\n style: {} as PerfUI.FlameChart.GroupStyle,\n },\n {\n name: 'group-2' as Common.UIString.LocalizedString,\n startLevel: 10,\n style: {} as PerfUI.FlameChart.GroupStyle,\n },\n {\n name: 'group-3' as Common.UIString.LocalizedString,\n startLevel: 12,\n style: {} as PerfUI.FlameChart.GroupStyle,\n },\n ];\n\n assert.strictEqual(groupForLevel(groups, 1), groups[0]);\n assert.strictEqual(groupForLevel(groups, 10), groups[1]);\n assert.strictEqual(groupForLevel(groups, 11), groups[1]);\n assert.strictEqual(groupForLevel(groups, 12), groups[2]);\n assert.strictEqual(groupForLevel(groups, 999), groups[2]);\n });\n });\n\n it('Can search for events by name in the timeline', async function() {\n const {parsedTrace} = await TraceLoader.traceEngine(this, 'lcp-images.json.gz');\n // The timeline flamechart view will invoke the `select` method\n // of this delegate every time an event has matched on a search.\n const mockViewDelegate = new MockViewDelegate();\n\n const flameChartView = new Timeline.TimelineFlameChartView.TimelineFlameChartView(mockViewDelegate);\n const searchableView = new UI.SearchableView.SearchableView(flameChartView, null);\n flameChartView.setSearchableView(searchableView);\n flameChartView.setModel(parsedTrace);\n\n const searchQuery = 'Paint';\n const searchConfig =\n new UI.SearchableView.SearchConfig(/* query */ searchQuery, /* caseSensitive */ false, /* isRegex */ false);\n flameChartView.performSearch(searchConfig, true);\n\n assert.strictEqual(flameChartView.getSearchResults()?.length, 14);\n assertSelectionName('PrePaint');\n\n flameChartView.jumpToNextSearchResult();\n assertSelectionName('Paint');\n\n flameChartView.jumpToNextSearchResult();\n assertSelectionName('Paint');\n\n flameChartView.jumpToPreviousSearchResult();\n assertSelectionName('Paint');\n flameChartView.jumpToPreviousSearchResult();\n assertSelectionName('PrePaint');\n\n function assertSelectionName(name: string) {\n const selection = mockViewDelegate.selection;\n if (!selection || !Timeline.TimelineSelection.selectionIsEvent(selection)) {\n throw new Error('Selection is not present or not a Trace Event');\n }\n assert.strictEqual(selection.event.name, name);\n }\n });\n\n it('can search across both flame charts for events', async function() {\n const {parsedTrace} = await TraceLoader.traceEngine(this, 'web-dev-with-commit.json.gz');\n // The timeline flamechart view will invoke the `select` method\n // of this delegate every time an event has matched on a search.\n const mockViewDelegate = new MockViewDelegate();\n\n const flameChartView = new Timeline.TimelineFlameChartView.TimelineFlameChartView(mockViewDelegate);\n const searchableView = new UI.SearchableView.SearchableView(flameChartView, null);\n flameChartView.setSearchableView(searchableView);\n flameChartView.setModel(parsedTrace);\n\n const searchQuery = 'app.js';\n const searchConfig =\n new UI.SearchableView.SearchConfig(/* query */ searchQuery, /* caseSensitive */ false, /* isRegex */ false);\n flameChartView.performSearch(searchConfig, true);\n\n const results = flameChartView.getSearchResults();\n assert.isOk(results);\n assert.lengthOf(results, 6);\n // We should have 5 results from the main provider, and 1 from the network\n assert.lengthOf(results.filter(r => r.provider === 'main'), 5);\n assert.lengthOf(results.filter(r => r.provider === 'network'), 1);\n });\n\n // This test is still failing after bumping up the timeout to 20 seconds. So\n // skip it while we work on a fix for the trace load speed.\n it.skip('[crbug.com/1492405] Shows the network track correctly', async function() {\n const {parsedTrace} = await TraceLoader.traceEngine(this, 'load-simple.json.gz');\n // The timeline flamechart view will invoke the `select` method\n // of this delegate every time an event has matched on a search.\n const mockViewDelegate = new MockViewDelegate();\n\n const flameChartView = new Timeline.TimelineFlameChartView.TimelineFlameChartView(mockViewDelegate);\n flameChartView.setModel(parsedTrace);\n\n assert.isTrue(flameChartView.isNetworkTrackShownForTests());\n });\n\n it('Does not show the network track when there is no network request', async function() {\n const {parsedTrace} = await TraceLoader.traceEngine(this, 'basic.json.gz');\n // The timeline flamechart view will invoke the `select` method\n // of this delegate every time an event has matched on a search.\n const mockViewDelegate = new MockViewDelegate();\n\n const flameChartView = new Timeline.TimelineFlameChartView.TimelineFlameChartView(mockViewDelegate);\n flameChartView.setModel(parsedTrace);\n\n assert.isFalse(flameChartView.isNetworkTrackShownForTests());\n });\n\n it('Adds Hidden Descendants Arrow as a decoration when a Context Menu action is applied on a node', async function() {\n const {parsedTrace} = await TraceLoader.traceEngine(this, 'load-simple.json.gz');\n const mockViewDelegate = new MockViewDelegate();\n\n const flameChartView = new Timeline.TimelineFlameChartView.TimelineFlameChartView(mockViewDelegate);\n flameChartView.setModel(parsedTrace);\n\n // Find the main track to later collapse entries of\n const mainTrack = flameChartView.getMainFlameChart().timelineData()?.groups.find(group => {\n return group.name === 'Main — http://localhost:8080/';\n });\n if (!mainTrack) {\n throw new Error('Could not find main track');\n }\n\n // Find the first node that has children to collapse and is visible in the timeline\n const nodeOfGroup = flameChartView.getMainDataProvider().groupTreeEvents(mainTrack);\n const firstNodeWithChildren = nodeOfGroup?.find(node => {\n const childrenAmount = parsedTrace.Renderer.entryToNode.get(node as Trace.Types.Events.Event)?.children.length;\n if (!childrenAmount) {\n return false;\n }\n return childrenAmount > 0 && node.cat === 'devtools.timeline';\n });\n const node = parsedTrace.Renderer.entryToNode.get(firstNodeWithChildren as Trace.Types.Events.Event);\n if (!node) {\n throw new Error('Could not find a visible node with children');\n }\n\n // Apply COLLAPSE_FUNCTION action to the node. This action will hide all the children of the passed node and add HIDDEN_DESCENDANTS_ARROW decoration to it.\n flameChartView.getMainFlameChart().modifyTree(PerfUI.FlameChart.FilterAction.COLLAPSE_FUNCTION, node?.id);\n\n const decorationsForEntry = flameChartView.getMainFlameChart().timelineData()?.entryDecorations[node?.id];\n assert.deepEqual(decorationsForEntry, [\n {\n type: PerfUI.FlameChart.FlameChartDecorationType.HIDDEN_DESCENDANTS_ARROW,\n },\n ]);\n });\n\n it('Adds Hidden Descendants Arrow as a decoration when a Context Menu action is applied on a selected node with a key shortcut event',\n async function() {\n const {parsedTrace} = await TraceLoader.traceEngine(this, 'load-simple.json.gz');\n const mockViewDelegate = new MockViewDelegate();\n\n const flameChartView = new Timeline.TimelineFlameChartView.TimelineFlameChartView(mockViewDelegate);\n flameChartView.setModel(parsedTrace);\n\n // Find the main track to later collapse entries of\n const mainTrack = flameChartView.getMainFlameChart().timelineData()?.groups.find(group => {\n return group.name === 'Main — http://localhost:8080/';\n });\n if (!mainTrack) {\n throw new Error('Could not find main track');\n }\n\n // Find the first node that has children to collapse and is visible in the timeline\n const groupTreeEvents = flameChartView.getMainDataProvider().groupTreeEvents(mainTrack);\n const firstEventWithChildren = groupTreeEvents?.find(node => {\n const childrenAmount = parsedTrace.Renderer.entryToNode.get(node as Trace.Types.Events.Event)?.children.length;\n if (!childrenAmount) {\n return false;\n }\n return childrenAmount > 0 && node.cat === 'devtools.timeline';\n });\n assert.exists(firstEventWithChildren);\n\n const nodeId = flameChartView.getMainDataProvider().indexForEvent(firstEventWithChildren);\n assert.exists(nodeId);\n\n flameChartView.getMainFlameChart().setSelectedEntry(nodeId);\n\n // Dispatch a shortcut keydown event that applies 'Hide Children' Context menu action\n const event = new KeyboardEvent('keydown', {code: 'KeyC'});\n flameChartView.getMainFlameChart().getCanvas().dispatchEvent(event);\n\n const decorationsForEntry = flameChartView.getMainFlameChart().timelineData()?.entryDecorations[nodeId];\n assert.deepEqual(decorationsForEntry, [\n {\n type: PerfUI.FlameChart.FlameChartDecorationType.HIDDEN_DESCENDANTS_ARROW,\n },\n ]);\n });\n\n it('Removes Hidden Descendants Arrow as a decoration when Reset Children action is applied on a node',\n async function() {\n const {parsedTrace} = await TraceLoader.traceEngine(this, 'load-simple.json.gz');\n const mockViewDelegate = new MockViewDelegate();\n\n const flameChartView = new Timeline.TimelineFlameChartView.TimelineFlameChartView(mockViewDelegate);\n flameChartView.setModel(parsedTrace);\n Timeline.ModificationsManager.ModificationsManager.activeManager();\n\n // Find the main track to later collapse entries of\n let mainTrack = flameChartView.getMainFlameChart().timelineData()?.groups.find(group => {\n return group.name === 'Main — http://localhost:8080/';\n });\n if (!mainTrack) {\n throw new Error('Could not find main track');\n }\n\n // Find the first node that has children to collapse and is visible in the timeline\n const nodeOfGroup = flameChartView.getMainDataProvider().groupTreeEvents(mainTrack);\n const firstNodeWithChildren = nodeOfGroup?.find(node => {\n const childrenAmount = parsedTrace.Renderer.entryToNode.get(node as Trace.Types.Events.Event)?.children.length;\n if (!childrenAmount) {\n return false;\n }\n return childrenAmount > 0 && node.cat === 'devtools.timeline';\n });\n const node = parsedTrace.Renderer.entryToNode.get(firstNodeWithChildren as Trace.Types.Events.Event);\n if (!node) {\n throw new Error('Could not find a visible node with children');\n }\n\n // Apply COLLAPSE_FUNCTION Context Menu action to the node.\n // This action will hide all the children of the passed node and add HIDDEN_DESCENDANTS_ARROW decoration to it.\n flameChartView.getMainFlameChart().modifyTree(PerfUI.FlameChart.FilterAction.COLLAPSE_FUNCTION, node?.id);\n\n let decorationsForEntry = flameChartView.getMainFlameChart().timelineData()?.entryDecorations[node?.id];\n assert.deepEqual(decorationsForEntry, [\n {\n type: PerfUI.FlameChart.FlameChartDecorationType.HIDDEN_DESCENDANTS_ARROW,\n },\n ]);\n\n mainTrack = flameChartView.getMainFlameChart().timelineData()?.groups.find(group => {\n return group.name === 'Main — http://localhost:8080/';\n });\n if (!mainTrack) {\n throw new Error('Could not find main track');\n }\n // Apply a RESET_CHILDREN action that will reveal all of the hidden children of the passed node and remove HIDDEN_DESCENDANTS_ARROW decoration from it.\n flameChartView.getMainFlameChart().modifyTree(PerfUI.FlameChart.FilterAction.RESET_CHILDREN, node?.id);\n\n // No decorations should exist on the node\n decorationsForEntry = flameChartView.getMainFlameChart().timelineData()?.entryDecorations[node?.id];\n assert.isUndefined(decorationsForEntry);\n });\n\n describe('Context Menu', function() {\n let flameChartView: Timeline.TimelineFlameChartView.TimelineFlameChartView;\n let parsedTrace: Trace.Handlers.Types.ParsedTrace;\n\n this.beforeEach(async () => {\n ({parsedTrace} = await TraceLoader.traceEngine(this, 'recursive-blocking-js.json.gz'));\n const mockViewDelegate = new MockViewDelegate();\n\n flameChartView = new Timeline.TimelineFlameChartView.TimelineFlameChartView(mockViewDelegate);\n flameChartView.setModel(parsedTrace);\n Timeline.ModificationsManager.ModificationsManager.activeManager();\n });\n\n it('Does not create customized Context Menu for network track', async function() {\n // The mouse event passed to the Context Menu is used to indicate where the menu should appear. Since we don't\n // need it to actually appear for this test, pass an event with coordinates that is not in the track header.\n flameChartView.getNetworkFlameChart().onContextMenu(new MouseEvent('contextmenu', {clientX: 100, clientY: 100}));\n assert.isUndefined(flameChartView.getNetworkFlameChart().getContextMenu());\n });\n\n it('Does not create Context Menu for Network track header', async function() {\n // So for the first track header, its x will start from beginning.\n // And its y will start after the ruler (ruler's height is 17).\n flameChartView.getNetworkFlameChart().onContextMenu(new MouseEvent('contextmenu', {clientX: 0, clientY: 17}));\n assert.isUndefined(flameChartView.getNetworkFlameChart().getContextMenu());\n });\n\n it('Create correct Context Menu for track headers in main flame chart', async function() {\n // So for the first track header, its x will start from beginning.\n // And its y will start after the ruler (ruler's height is 17).\n flameChartView.getMainFlameChart().onContextMenu(new MouseEvent('contextmenu', {clientX: 0, clientY: 17}));\n\n assert.strictEqual(flameChartView.getMainFlameChart().getContextMenu()?.defaultSection().items.length, 1);\n assert.strictEqual(\n flameChartView.getMainFlameChart().getContextMenu()?.defaultSection().items.at(0)?.buildDescriptor().label,\n 'Configure tracks');\n });\n\n describe('Context Menu Actions For Thread tracks', function() {\n this.beforeEach(async () => {\n // Find the Main track to later collapse entries of\n const mainTrack = flameChartView.getMainFlameChart().timelineData()?.groups.find(group => {\n return group.name === 'Main — http://127.0.0.1:8080/';\n });\n if (!mainTrack) {\n throw new Error('Could not find main track');\n }\n });\n\n function getMainThread(data: Trace.Handlers.ModelHandlers.Renderer.RendererHandlerData):\n Trace.Handlers.ModelHandlers.Renderer.RendererThread {\n let mainThread: Trace.Handlers.ModelHandlers.Renderer.RendererThread|null = null;\n for (const [, process] of data.processes) {\n for (const [, thread] of process.threads) {\n if (thread.name === 'CrRendererMain') {\n mainThread = thread;\n break;\n }\n }\n }\n if (!mainThread) {\n throw new Error('Could not find main thread.');\n }\n return mainThread;\n }\n\n function findFirstEntry(\n allEntries: readonly Trace.Types.Events.Event[],\n predicate: (entry: Trace.Types.Events.Event) => boolean): Trace.Types.Events.Event {\n const entry = allEntries.find(entry => predicate(entry));\n if (!entry) {\n throw new Error('Could not find expected entry.');\n }\n return entry;\n }\n\n function generateContextMenuForNodeId(nodeId: number): void {\n // Highlight the node to make the Context Menu dispatch on this node\n flameChartView.getMainFlameChart().highlightEntry(nodeId);\n\n const eventCoordinates = flameChartView.getMainFlameChart().entryIndexToCoordinates(nodeId);\n if (!eventCoordinates) {\n throw new Error('Coordinates were not found');\n }\n\n // The mouse event passed to the Context Menu is used to indicate where the menu should appear. So just simply\n // use the pixels of top left corner of the event.\n flameChartView.getMainFlameChart().onContextMenu(\n new MouseEvent('contextmenu', {clientX: eventCoordinates.x, clientY: eventCoordinates.y}));\n }\n\n function generateContextMenuForNode(node: Trace.Types.Events.Event): void {\n const nodeId = flameChartView.getMainDataProvider().indexForEvent(node);\n assert.isNotNull(nodeId);\n generateContextMenuForNodeId(nodeId);\n }\n\n it('When an entry has no children, correctly make only Hide Entry enabled in the Context Menu action',\n async function() {\n /** Part of this stack looks roughly like so (with some events omitted):\n * =============== foo ===============\n * =============== foo ===============\n * =============== foo ===============\n * =============== foo ===============\n * =============== foo ===============\n * =============== foo ===============\n * =============== foo ===============\n * == now == == updateCounters == <-- ID=245\n *\n * In this test we want to test that the Context Menu option available\n * for an entry with no children and a parent is to hide given entry only.\n * Since there are no children to hide, we don't want to show 'hide children' option.\n *\n * To achieve that, we will dispatch the context menu on the 'updateCounters' function that does not have\n * children.\n * The ID of 'updateCounters' is 245.\n **/\n\n const nodeIdWithNoChildren = 245;\n generateContextMenuForNodeId(nodeIdWithNoChildren);\n\n assert.strictEqual(flameChartView.getMainFlameChart().getContextMenu()?.defaultSection().items.length, 5);\n // Hide function enabled\n assert.strictEqual(\n flameChartView.getMainFlameChart()\n .getContextMenu()\n ?.defaultSection()\n .items.at(0)\n ?.buildDescriptor()\n .enabled,\n true);\n // Rest of the actions disabled\n assert.strictEqual(\n flameChartView.getMainFlameChart()\n .getContextMenu()\n ?.defaultSection()\n .items.at(1)\n ?.buildDescriptor()\n .enabled,\n false);\n assert.strictEqual(\n flameChartView.getMainFlameChart()\n .getContextMenu()\n ?.defaultSection()\n .items.at(2)\n ?.buildDescriptor()\n .enabled,\n false);\n assert.strictEqual(\n flameChartView.getMainFlameChart()\n .getContextMenu()\n ?.defaultSection()\n .items.at(3)\n ?.buildDescriptor()\n .enabled,\n false);\n assert.strictEqual(\n flameChartView.getMainFlameChart()\n .getContextMenu()\n ?.defaultSection()\n .items.at(4)\n ?.buildDescriptor()\n .enabled,\n false);\n });\n\n it('When an entry has children, correctly make only Hide Entry and Hide Children enabled in the Context Menu action',\n async function() {\n /** Part of this stack looks roughly like so (with some events omitted):\n * =============== foo ===============\n * =============== foo ===============\n * =============== foo ===============\n * =============== foo ===============\n * =============== foo ===============\n * =============== foo ===============\n * =============== foo ===============\n * ===== wait ===== ===== wait =====\n * = now = = now = = now = = now =\n *\n * In this test we want to test that the Context Menu option available\n * for an entry with children and a parent is to hide given entry, and hide children only.\n * Since there are no repeating children to hide, we don't want to show 'hide repeating children' option.\n *\n * To achieve that, we will dispatch the context menu on the 'wait' function that has only non-repeating\n * children.\n **/\n const mainThread = getMainThread(parsedTrace.Renderer);\n const entry = findFirstEntry(mainThread.entries, entry => {\n return Trace.Types.Events.isProfileCall(entry) && entry.callFrame.functionName === 'wait';\n });\n const nodeIdWithNoChildren = flameChartView.getMainDataProvider().indexForEvent(entry);\n assert.exists(nodeIdWithNoChildren);\n generateContextMenuForNodeId(nodeIdWithNoChildren);\n\n // This entry has URL, so there are 5 always-shown actions, and one to add script to ignore list.\n assert.strictEqual(flameChartView.getMainFlameChart().getContextMenu()?.defaultSection().items.length, 6);\n // Hide function enabled\n assert.strictEqual(\n flameChartView.getMainFlameChart()\n .getContextMenu()\n ?.defaultSection()\n .items.at(0)\n ?.buildDescriptor()\n .enabled,\n true);\n // Hide children enabled\n assert.strictEqual(\n flameChartView.getMainFlameChart()\n .getContextMenu()\n ?.defaultSection()\n .items.at(1)\n ?.buildDescriptor()\n .enabled,\n true);\n // Rest of the actions disabled\n assert.strictEqual(\n flameChartView.getMainFlameChart()\n .getContextMenu()\n ?.defaultSection()\n .items.at(2)\n ?.buildDescriptor()\n .enabled,\n false);\n assert.strictEqual(\n flameChartView.getMainFlameChart()\n .getContextMenu()\n ?.defaultSection()\n .items.at(3)\n ?.buildDescriptor()\n .enabled,\n false);\n assert.strictEqual(\n flameChartView.getMainFlameChart()\n .getContextMenu()\n ?.defaultSection()\n .items.at(4)\n ?.buildDescriptor()\n .enabled,\n false);\n });\n\n it('When an entry has repeating children, correctly make only Hide Entry, Hide Children and Hide repeating children enabled in the Context Menu action',\n async function() {\n /** Part of this stack looks roughly like so (with some events omitted):\n * =============== foo ===============\n * =============== foo ===============\n * =============== foo ===============\n * =============== foo ===============\n * =============== foo ===============\n * =============== foo ===============\n * =============== foo ===============\n * ===== wait ===== ===== wait =====\n * = now = = now = = now = = now =\n *\n * In this test we want to test that the Context Menu option available\n * for an entry with children repeating children and a parent is to hide given entry, hide children and hide\n * repeating children.\n *\n * To achieve that, we will dispatch the context menu on the 'foo' function that has child 'foo' calls.\n **/\n\n const mainThread = getMainThread(parsedTrace.Renderer);\n const entry = findFirstEntry(mainThread.entries, entry => {\n return Trace.Types.Events.isProfileCall(entry) && entry.callFrame.functionName === 'foo';\n });\n\n const nodeId = flameChartView.getMainDataProvider().indexForEvent(entry);\n assert.exists(nodeId);\n\n generateContextMenuForNodeId(nodeId);\n\n // This entry has URL, so there are 5 always-shown actions, and one to add script to ignore list.\n assert.strictEqual(flameChartView.getMainFlameChart().getContextMenu()?.defaultSection().items.length, 6);\n // Hide function enabled\n assert.strictEqual(\n flameChartView.getMainFlameChart()\n .getContextMenu()\n ?.defaultSection()\n .items.at(0)\n ?.buildDescriptor()\n .enabled,\n true);\n // Hide children enabled\n assert.strictEqual(\n flameChartView.getMainFlameChart()\n .getContextMenu()\n ?.defaultSection()\n .items.at(1)\n ?.buildDescriptor()\n .enabled,\n true);\n // Hide repeating children enabled\n assert.strictEqual(\n flameChartView.getMainFlameChart()\n .getContextMenu()\n ?.defaultSection()\n .items.at(2)\n ?.buildDescriptor()\n .enabled,\n true);\n // Rest of the actions disabled\n assert.strictEqual(\n flameChartView.getMainFlameChart()\n .getContextMenu()\n ?.defaultSection()\n .items.at(3)\n ?.buildDescriptor()\n .enabled,\n false);\n assert.strictEqual(\n flameChartView.getMainFlameChart()\n .getContextMenu()\n ?.defaultSection()\n .items.at(4)\n ?.buildDescriptor()\n .enabled,\n false);\n });\n\n it('When an entry has no parent and has children, correctly make only Hide Children enabled in the Context Menu action',\n async function() {\n /** Part of this stack looks roughly like so (with some events omitted):\n * =============== Task ==============\n * =============== foo ===============\n * =============== foo ===============\n * =============== foo ===============\n * =============== foo ===============\n * =============== foo ===============\n * =============== foo ===============\n * ===== wait ===== ===== wait =====\n * = now = = now = = now = = now =\n *\n * In this test we want to test that the Context Menu option available for an entry with no parent is only to\n * hide children.\n * If an entry has no parent, we don't want to show an option to hide the entry since when an entry is hidden,\n * it is indicated by adding a decoration to the parent and if there is no parent, there is no way to show it\n * is hidden.\n *\n * To achieve that, we will dispatch the context menu on the 'Task' function that is on the top of the stack\n * and has no parent.\n **/\n\n const mainThread = getMainThread(parsedTrace.Renderer);\n const entry = findFirstEntry(mainThread.entries, entry => {\n const childrenAmount =\n parsedTrace.Renderer.entryToNode.get(entry as Trace.Types.Events.Event)?.children.length;\n if (!childrenAmount) {\n return false;\n }\n return Trace.Types.Events.isRunTask(entry);\n });\n\n const nodeId = flameChartView.getMainDataProvider().indexForEvent(entry);\n assert.exists(nodeId);\n\n generateContextMenuForNodeId(nodeId);\n\n // Hide function disabled\n assert.strictEqual(\n flameChartView.getMainFlameChart()\n .getContextMenu()\n ?.defaultSection()\n .items.at(0)\n ?.buildDescriptor()\n .enabled,\n false);\n // Hide children enabled\n assert.strictEqual(\n flameChartView.getMainFlameChart()\n .getContextMenu()\n ?.defaultSection()\n .items.at(1)\n ?.buildDescriptor()\n .enabled,\n true);\n // Rest of the actions disabled\n assert.strictEqual(\n flameChartView.getMainFlameChart()\n .getContextMenu()\n ?.defaultSection()\n .items.at(2)\n ?.buildDescriptor()\n .enabled,\n false);\n assert.strictEqual(\n flameChartView.getMainFlameChart()\n .getContextMenu()\n ?.defaultSection()\n .items.at(3)\n ?.buildDescriptor()\n .enabled,\n false);\n assert.strictEqual(\n flameChartView.getMainFlameChart()\n .getContextMenu()\n ?.defaultSection()\n .items.at(4)\n ?.buildDescriptor()\n .enabled,\n false);\n });\n\n it('Reset Trace Context Menu action is disabled before some action has been applied', async function() {\n /** Part of this stack looks roughly like so (with some events omitted):\n * =============== Task ==============\n * =============== foo ===============\n * =============== foo ===============\n * =============== foo ===============\n * =============== foo ===============\n * =============== foo ===============\n * =============== foo ===============\n * ===== wait ===== ===== wait =====\n * = now = = now = = now = = now =\n *\n * In this test we want to test that the Reset Trace Context Menu option is disabled by default and enabled after\n * some action has been applied.\n *\n * To achieve that, we will first check if Reset Trace is disabled and then dispatch a Context Menu action on\n * \"Task\" entry and then check if Reset Trace is enabled.\n **/\n\n const mainThread = getMainThread(parsedTrace.Renderer);\n const entry = findFirstEntry(mainThread.entries, entry => Trace.Types.Events.isRunTask(entry));\n const nodeId = flameChartView.getMainDataProvider().indexForEvent(entry);\n assert.exists(nodeId);\n\n generateContextMenuForNodeId(nodeId);\n assert.strictEqual(flameChartView.getMainFlameChart().getContextMenu()?.defaultSection().items.length, 5);\n assert.strictEqual(\n flameChartView.getMainFlameChart().getContextMenu()?.defaultSection().items.at(4)?.buildDescriptor().label,\n 'Reset trace');\n // Check that Reset Trace is disabled\n assert.strictEqual(\n flameChartView.getMainFlameChart()\n .getContextMenu()\n ?.defaultSection()\n .items.at(4)\n ?.buildDescriptor()\n .enabled,\n false);\n\n flameChartView.getMainFlameChart().modifyTree(PerfUI.FlameChart.FilterAction.MERGE_FUNCTION, nodeId);\n generateContextMenuForNodeId(nodeId);\n\n // Check that Reset Trace is enabled\n assert.strictEqual(\n flameChartView.getMainFlameChart()\n .getContextMenu()\n ?.defaultSection()\n .items.at(4)\n ?.buildDescriptor()\n .enabled,\n true);\n });\n\n it('When an entry has URL and is not ignored, correctly show the Add script to ignore list in the Context Menu action',\n async function() {\n const mainThread = getMainThread(parsedTrace.Renderer);\n const entryWithUrl = findFirstEntry(mainThread.entries, entry => {\n // Let's find the first entry with URL.\n return Trace.Types.Events.isProfileCall(entry) && Boolean(entry.callFrame.url);\n });\n generateContextMenuForNode(entryWithUrl);\n\n assert.strictEqual(flameChartView.getMainFlameChart().getContextMenu()?.defaultSection().items.length, 6);\n\n assert.strictEqual(\n flameChartView.getMainFlameChart()\n .getContextMenu()\n ?.defaultSection()\n .items.at(5)\n ?.buildDescriptor()\n .label,\n 'Add script to ignore list');\n });\n\n it('When an entry has URL and is ignored, correctly show the Remove script from ignore list in the Context Menu action',\n async function() {\n const mainThread = getMainThread(parsedTrace.Renderer);\n const entryWithIgnoredUrl = findFirstEntry(mainThread.entries, entry => {\n // Let's find the first entry with URL.\n return Trace.Types.Events.isProfileCall(entry) && Boolean(entry.callFrame.url);\n });\n Bindings.IgnoreListManager.IgnoreListManager.instance().ignoreListURL(\n (entryWithIgnoredUrl as Trace.Types.Events.SyntheticProfileCall).callFrame.url as\n Platform.DevToolsPath.UrlString);\n\n generateContextMenuForNode(entryWithIgnoredUrl);\n\n assert.strictEqual(flameChartView.getMainFlameChart().getContextMenu()?.defaultSection().items.length, 6);\n\n assert.strictEqual(\n flameChartView.getMainFlameChart()\n .getContextMenu()\n ?.defaultSection()\n .items.at(5)\n ?.buildDescriptor()\n .label,\n 'Remove script from ignore list');\n });\n });\n });\n\n describe('Link between entries annotation in progress', function() {\n let flameChartView: Timeline.TimelineFlameChartView.TimelineFlameChartView;\n let parsedTrace: Trace.Handlers.Types.ParsedTrace;\n\n this.beforeEach(async () => {\n ({parsedTrace} = await TraceLoader.traceEngine(this, 'recursive-blocking-js.json.gz'));\n const mockViewDelegate = new MockViewDelegate();\n\n flameChartView = new Timeline.TimelineFlameChartView.TimelineFlameChartView(mockViewDelegate);\n flameChartView.setModel(parsedTrace);\n Timeline.ModificationsManager.ModificationsManager.activeManager();\n });\n\n it('Creates a `link between entries Annotation in progress` tracking object', async function() {\n // Make sure the link annotation in the progress of creation does not exist\n assert.isNull(flameChartView.getLinkSelectionAnnotation());\n\n // Start creating a link between entries from an entry with ID 204\n flameChartView.onEntriesLinkAnnotationCreate(flameChartView.getMainDataProvider(), 204);\n\n // Make sure the link is started and only has 'from' entry set\n assert.isNotNull(flameChartView.getLinkSelectionAnnotation());\n assert.isNotNull(flameChartView.getLinkSelectionAnnotation()?.entryFrom);\n assert.isUndefined(flameChartView.getLinkSelectionAnnotation()?.entryTo);\n\n // Make sure the annotation exists in the ModificationsManager\n const annotations = Timeline.ModificationsManager.ModificationsManager.activeManager()?.getAnnotations();\n assert.exists(annotations);\n assert.strictEqual(annotations?.length, 1);\n assert.strictEqual(annotations[0].type, 'ENTRIES_LINK');\n });\n\n it('Sets the link between entries annotation in progress to null when the second entry is selected',\n async function() {\n // Make sure the link annotation in the progress of creation does not exist\n assert.isNull(flameChartView.getLinkSelectionAnnotation());\n\n // Start creating a link between entries from an entry with ID 204\n flameChartView.onEntriesLinkAnnotationCreate(flameChartView.getMainDataProvider(), 204);\n const entryFrom = flameChartView.getMainDataProvider().eventByIndex(204);\n\n // Hover on another entry to complete the link\n flameChartView.updateLinkSelectionAnnotationWithToEntry(flameChartView.getMainDataProvider(), 245);\n const entryTo = flameChartView.getMainDataProvider().eventByIndex(245);\n // Make sure the entry 'to' is set\n assert.exists(flameChartView.getLinkSelectionAnnotation()?.entryTo);\n\n // Select the other entry to complete the link and set the one in progress to null\n flameChartView.handleToEntryOfLinkBetweenEntriesSelection(245);\n // Make sure the link annotation in progress is set to null\n assert.isNull(flameChartView.getLinkSelectionAnnotation());\n\n // Make sure the annotation exists in the ModificationsManager\n const annotations = Timeline.ModificationsManager.ModificationsManager.activeManager()?.getAnnotations();\n assert.exists(annotations);\n assert.strictEqual(annotations?.length, 1);\n assert.strictEqual(annotations[0].type, 'ENTRIES_LINK');\n const entriesLink = annotations[0] as Trace.Types.File.EntriesLinkAnnotation;\n\n assert.strictEqual(entriesLink.entryFrom, entryFrom);\n assert.strictEqual(entriesLink.entryTo, entryTo);\n });\n\n it('Reverses entries in the link if `to` entry timestamp is earlier than `from` entry timestamo', async function() {\n // Make sure the link annotation in the progress of creation does not exist\n assert.isNull(flameChartView.getLinkSelectionAnnotation());\n\n // Start creating a link between entries from an entry with ID 245\n flameChartView.onEntriesLinkAnnotationCreate(flameChartView.getMainDataProvider(), 245);\n const entryFrom = flameChartView.getMainDataProvider().eventByIndex(245);\n\n // Hover on another entry that starts before the entry that the link is being created from\n flameChartView.updateLinkSelectionAnnotationWithToEntry(flameChartView.getMainDataProvider(), 204);\n const entryTo = flameChartView.getMainDataProvider().eventByIndex(204);\n\n // Select the other entry to complete the link and set the one in progress to null\n flameChartView.handleToEntryOfLinkBetweenEntriesSelection(204);\n\n // Make sure the annotation exists in the ModificationsManager\n const annotations = Timeline.ModificationsManager.ModificationsManager.activeManager()?.getAnnotations();\n assert.exists(annotations);\n assert.strictEqual(annotations?.length, 1);\n assert.strictEqual(annotations[0].type, 'ENTRIES_LINK');\n const entriesLink = annotations[0] as Trace.Types.File.EntriesLinkAnnotation;\n\n // Make 'entryFrom' has an earlier timestamp and the entries `to` and `from` got switched up\n assert.strictEqual(entriesLink.entryFrom, entryTo);\n assert.strictEqual(entriesLink.entryTo, entryFrom);\n });\n });\n});\n"]} \ No newline at end of file +{"version":3,"file":"TimelineFlameChartView.test.js","sourceRoot":"","sources":["../../../../../../front_end/panels/timeline/TimelineFlameChartView.test.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAI7B,OAAO,KAAK,QAAQ,MAAM,mCAAmC,CAAC;AAC9D,OAAO,KAAK,KAAK,MAAM,6BAA6B,CAAC;AACrD,OAAO,EAAC,uBAAuB,EAAC,MAAM,qCAAqC,CAAC;AAC5E,OAAO,EAAC,iCAAiC,EAAC,MAAM,+BAA+B,CAAC;AAChF,OAAO,EAAC,WAAW,EAAC,MAAM,8BAA8B,CAAC;AACzD,OAAO,KAAK,MAAM,MAAM,+CAA+C,CAAC;AACxE,OAAO,KAAK,EAAE,MAAM,2BAA2B,CAAC;AAEhD,OAAO,KAAK,QAAQ,MAAM,eAAe,CAAC;AAE1C,MAAM,gBAAgB;IACpB,SAAS,GAAsD,IAAI,CAAC;IACpE,MAAM,CAAC,SAA4D;QACjE,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;IAC7B,CAAC;IACD,iBAAiB,CAAC,OAAwC,EAAE,KAAa;IACzE,CAAC;IACD,cAAc,CAAC,MAAqC;IACpD,CAAC;IACD,OAAO,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;CACzC;AAED,uBAAuB,CAAC,wBAAwB,EAAE;IAChD,UAAU,CAAC,GAAG,EAAE;QACd,iCAAiC,EAAE,CAAC;IACtC,CAAC,CAAC,CAAC;IAEH,QAAQ,CAAC,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cAAc,CAAC,mBAAmB,EAAE,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC;YAEvE,kFAAkF;YAClF,cAAc,CAAC,0CAA0C,CAAC,GAAG,CAAC,CAAC;YAE/D,8DAA8D;YAC9D,MAAM,WAAW,GAAG,QAAQ,CAAC,oBAAoB,CAAC,oBAAoB,CAAC,aAAa,EAAE,EAAE,cAAc,EAAE,CAAC;YACzG,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;YAC3B,MAAM,CAAC,WAAW,CAAC,WAAW,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC;YAC3C,MAAM,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,cAAc,CAAC,CAAC;YACxD,MAAM,WAAW,GAAG,WAAW,CAAC,CAAC,CAA2C,CAAC;YAE7E,4FAA4F;YAC5F,MAAM,CAAC,WAAW,CAAC,WAAW,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;YACnD,MAAM,CAAC,WAAW,CAAC,WAAW,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;QACrD,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["// Copyright 2023 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport type * as Common from '../../core/common/common.js';\nimport type * as Platform from '../../core/platform/platform.js';\nimport * as Bindings from '../../models/bindings/bindings.js';\nimport * as Trace from '../../models/trace/trace.js';\nimport {describeWithEnvironment} from '../../testing/EnvironmentHelpers.js';\nimport {setupIgnoreListManagerEnvironment} from '../../testing/TraceHelpers.js';\nimport {TraceLoader} from '../../testing/TraceLoader.js';\nimport * as PerfUI from '../../ui/legacy/components/perf_ui/perf_ui.js';\nimport * as UI from '../../ui/legacy/legacy.js';\n\nimport * as Timeline from './timeline.js';\n\nclass MockViewDelegate implements Timeline.TimelinePanel.TimelineModeViewDelegate {\n selection: Timeline.TimelineSelection.TimelineSelection|null = null;\n select(selection: Timeline.TimelineSelection.TimelineSelection|null): void {\n this.selection = selection;\n }\n selectEntryAtTime(_events: Trace.Types.Events.Event[]|null, _time: number): void {\n }\n highlightEvent(_event: Trace.Types.Events.Event|null): void {\n }\n element = document.createElement('div');\n}\n\ndescribeWithEnvironment('TimelineFlameChartView', function() {\n beforeEach(() => {\n setupIgnoreListManagerEnvironment();\n });\n\n describe('groupForLevel', () => {\n const {groupForLevel} = Timeline.TimelineFlameChartView;\n\n it('finds the right group for the given level', async () => {\n const groups: PerfUI.FlameChart.Group[] = [\n {\n name: 'group-1' as Common.UIString.LocalizedString,\n startLevel: 0,\n style: {} as PerfUI.FlameChart.GroupStyle,\n },\n {\n name: 'group-2' as Common.UIString.LocalizedString,\n startLevel: 10,\n style: {} as PerfUI.FlameChart.GroupStyle,\n },\n {\n name: 'group-3' as Common.UIString.LocalizedString,\n startLevel: 12,\n style: {} as PerfUI.FlameChart.GroupStyle,\n },\n ];\n\n assert.strictEqual(groupForLevel(groups, 1), groups[0]);\n assert.strictEqual(groupForLevel(groups, 10), groups[1]);\n assert.strictEqual(groupForLevel(groups, 11), groups[1]);\n assert.strictEqual(groupForLevel(groups, 12), groups[2]);\n assert.strictEqual(groupForLevel(groups, 999), groups[2]);\n });\n });\n\n it('Can search for events by name in the timeline', async function() {\n const {parsedTrace} = await TraceLoader.traceEngine(this, 'lcp-images.json.gz');\n // The timeline flamechart view will invoke the `select` method\n // of this delegate every time an event has matched on a search.\n const mockViewDelegate = new MockViewDelegate();\n\n const flameChartView = new Timeline.TimelineFlameChartView.TimelineFlameChartView(mockViewDelegate);\n const searchableView = new UI.SearchableView.SearchableView(flameChartView, null);\n flameChartView.setSearchableView(searchableView);\n flameChartView.setModel(parsedTrace);\n\n const searchQuery = 'Paint';\n const searchConfig =\n new UI.SearchableView.SearchConfig(/* query */ searchQuery, /* caseSensitive */ false, /* isRegex */ false);\n flameChartView.performSearch(searchConfig, true);\n\n assert.strictEqual(flameChartView.getSearchResults()?.length, 14);\n assertSelectionName('PrePaint');\n\n flameChartView.jumpToNextSearchResult();\n assertSelectionName('Paint');\n\n flameChartView.jumpToNextSearchResult();\n assertSelectionName('Paint');\n\n flameChartView.jumpToPreviousSearchResult();\n assertSelectionName('Paint');\n flameChartView.jumpToPreviousSearchResult();\n assertSelectionName('PrePaint');\n\n function assertSelectionName(name: string) {\n const selection = mockViewDelegate.selection;\n if (!selection || !Timeline.TimelineSelection.selectionIsEvent(selection)) {\n throw new Error('Selection is not present or not a Trace Event');\n }\n assert.strictEqual(selection.event.name, name);\n }\n });\n\n it('can search across both flame charts for events', async function() {\n const {parsedTrace} = await TraceLoader.traceEngine(this, 'web-dev-with-commit.json.gz');\n // The timeline flamechart view will invoke the `select` method\n // of this delegate every time an event has matched on a search.\n const mockViewDelegate = new MockViewDelegate();\n\n const flameChartView = new Timeline.TimelineFlameChartView.TimelineFlameChartView(mockViewDelegate);\n const searchableView = new UI.SearchableView.SearchableView(flameChartView, null);\n flameChartView.setSearchableView(searchableView);\n flameChartView.setModel(parsedTrace);\n\n const searchQuery = 'app.js';\n const searchConfig =\n new UI.SearchableView.SearchConfig(/* query */ searchQuery, /* caseSensitive */ false, /* isRegex */ false);\n flameChartView.performSearch(searchConfig, true);\n\n const results = flameChartView.getSearchResults();\n assert.isOk(results);\n assert.lengthOf(results, 6);\n // We should have 5 results from the main provider, and 1 from the network\n assert.lengthOf(results.filter(r => r.provider === 'main'), 5);\n assert.lengthOf(results.filter(r => r.provider === 'network'), 1);\n });\n\n // This test is still failing after bumping up the timeout to 20 seconds. So\n // skip it while we work on a fix for the trace load speed.\n it.skip('[crbug.com/1492405] Shows the network track correctly', async function() {\n const {parsedTrace} = await TraceLoader.traceEngine(this, 'load-simple.json.gz');\n // The timeline flamechart view will invoke the `select` method\n // of this delegate every time an event has matched on a search.\n const mockViewDelegate = new MockViewDelegate();\n\n const flameChartView = new Timeline.TimelineFlameChartView.TimelineFlameChartView(mockViewDelegate);\n flameChartView.setModel(parsedTrace);\n\n assert.isTrue(flameChartView.isNetworkTrackShownForTests());\n });\n\n it('Does not show the network track when there is no network request', async function() {\n const {parsedTrace} = await TraceLoader.traceEngine(this, 'basic.json.gz');\n // The timeline flamechart view will invoke the `select` method\n // of this delegate every time an event has matched on a search.\n const mockViewDelegate = new MockViewDelegate();\n\n const flameChartView = new Timeline.TimelineFlameChartView.TimelineFlameChartView(mockViewDelegate);\n flameChartView.setModel(parsedTrace);\n\n assert.isFalse(flameChartView.isNetworkTrackShownForTests());\n });\n\n it('Adds Hidden Descendants Arrow as a decoration when a Context Menu action is applied on a node', async function() {\n const {parsedTrace} = await TraceLoader.traceEngine(this, 'load-simple.json.gz');\n const mockViewDelegate = new MockViewDelegate();\n\n const flameChartView = new Timeline.TimelineFlameChartView.TimelineFlameChartView(mockViewDelegate);\n flameChartView.setModel(parsedTrace);\n\n // Find the main track to later collapse entries of\n const mainTrack = flameChartView.getMainFlameChart().timelineData()?.groups.find(group => {\n return group.name === 'Main — http://localhost:8080/';\n });\n if (!mainTrack) {\n throw new Error('Could not find main track');\n }\n\n // Find the first node that has children to collapse and is visible in the timeline\n const nodeOfGroup = flameChartView.getMainDataProvider().groupTreeEvents(mainTrack);\n const firstNodeWithChildren = nodeOfGroup?.find(node => {\n const childrenAmount = parsedTrace.Renderer.entryToNode.get(node as Trace.Types.Events.Event)?.children.length;\n if (!childrenAmount) {\n return false;\n }\n return childrenAmount > 0 && node.cat === 'devtools.timeline';\n });\n const node = parsedTrace.Renderer.entryToNode.get(firstNodeWithChildren as Trace.Types.Events.Event);\n if (!node) {\n throw new Error('Could not find a visible node with children');\n }\n\n // Apply COLLAPSE_FUNCTION action to the node. This action will hide all the children of the passed node and add HIDDEN_DESCENDANTS_ARROW decoration to it.\n flameChartView.getMainFlameChart().modifyTree(PerfUI.FlameChart.FilterAction.COLLAPSE_FUNCTION, node?.id);\n\n const decorationsForEntry = flameChartView.getMainFlameChart().timelineData()?.entryDecorations[node?.id];\n assert.deepEqual(decorationsForEntry, [\n {\n type: PerfUI.FlameChart.FlameChartDecorationType.HIDDEN_DESCENDANTS_ARROW,\n },\n ]);\n });\n\n it('Adds Hidden Descendants Arrow as a decoration when a Context Menu action is applied on a selected node with a key shortcut event',\n async function() {\n const {parsedTrace} = await TraceLoader.traceEngine(this, 'load-simple.json.gz');\n const mockViewDelegate = new MockViewDelegate();\n\n const flameChartView = new Timeline.TimelineFlameChartView.TimelineFlameChartView(mockViewDelegate);\n flameChartView.setModel(parsedTrace);\n\n // Find the main track to later collapse entries of\n const mainTrack = flameChartView.getMainFlameChart().timelineData()?.groups.find(group => {\n return group.name === 'Main — http://localhost:8080/';\n });\n if (!mainTrack) {\n throw new Error('Could not find main track');\n }\n\n // Find the first node that has children to collapse and is visible in the timeline\n const groupTreeEvents = flameChartView.getMainDataProvider().groupTreeEvents(mainTrack);\n const firstEventWithChildren = groupTreeEvents?.find(node => {\n const childrenAmount = parsedTrace.Renderer.entryToNode.get(node as Trace.Types.Events.Event)?.children.length;\n if (!childrenAmount) {\n return false;\n }\n return childrenAmount > 0 && node.cat === 'devtools.timeline';\n });\n assert.exists(firstEventWithChildren);\n\n const nodeId = flameChartView.getMainDataProvider().indexForEvent(firstEventWithChildren);\n assert.exists(nodeId);\n\n flameChartView.getMainFlameChart().setSelectedEntry(nodeId);\n\n // Dispatch a shortcut keydown event that applies 'Hide Children' Context menu action\n const event = new KeyboardEvent('keydown', {code: 'KeyC'});\n flameChartView.getMainFlameChart().getCanvas().dispatchEvent(event);\n\n const decorationsForEntry = flameChartView.getMainFlameChart().timelineData()?.entryDecorations[nodeId];\n assert.deepEqual(decorationsForEntry, [\n {\n type: PerfUI.FlameChart.FlameChartDecorationType.HIDDEN_DESCENDANTS_ARROW,\n },\n ]);\n });\n\n it('Removes Hidden Descendants Arrow as a decoration when Reset Children action is applied on a node',\n async function() {\n const {parsedTrace} = await TraceLoader.traceEngine(this, 'load-simple.json.gz');\n const mockViewDelegate = new MockViewDelegate();\n\n const flameChartView = new Timeline.TimelineFlameChartView.TimelineFlameChartView(mockViewDelegate);\n flameChartView.setModel(parsedTrace);\n Timeline.ModificationsManager.ModificationsManager.activeManager();\n\n // Find the main track to later collapse entries of\n let mainTrack = flameChartView.getMainFlameChart().timelineData()?.groups.find(group => {\n return group.name === 'Main — http://localhost:8080/';\n });\n if (!mainTrack) {\n throw new Error('Could not find main track');\n }\n\n // Find the first node that has children to collapse and is visible in the timeline\n const nodeOfGroup = flameChartView.getMainDataProvider().groupTreeEvents(mainTrack);\n const firstNodeWithChildren = nodeOfGroup?.find(node => {\n const childrenAmount = parsedTrace.Renderer.entryToNode.get(node as Trace.Types.Events.Event)?.children.length;\n if (!childrenAmount) {\n return false;\n }\n return childrenAmount > 0 && node.cat === 'devtools.timeline';\n });\n const node = parsedTrace.Renderer.entryToNode.get(firstNodeWithChildren as Trace.Types.Events.Event);\n if (!node) {\n throw new Error('Could not find a visible node with children');\n }\n\n // Apply COLLAPSE_FUNCTION Context Menu action to the node.\n // This action will hide all the children of the passed node and add HIDDEN_DESCENDANTS_ARROW decoration to it.\n flameChartView.getMainFlameChart().modifyTree(PerfUI.FlameChart.FilterAction.COLLAPSE_FUNCTION, node?.id);\n\n let decorationsForEntry = flameChartView.getMainFlameChart().timelineData()?.entryDecorations[node?.id];\n assert.deepEqual(decorationsForEntry, [\n {\n type: PerfUI.FlameChart.FlameChartDecorationType.HIDDEN_DESCENDANTS_ARROW,\n },\n ]);\n\n mainTrack = flameChartView.getMainFlameChart().timelineData()?.groups.find(group => {\n return group.name === 'Main — http://localhost:8080/';\n });\n if (!mainTrack) {\n throw new Error('Could not find main track');\n }\n // Apply a RESET_CHILDREN action that will reveal all of the hidden children of the passed node and remove HIDDEN_DESCENDANTS_ARROW decoration from it.\n flameChartView.getMainFlameChart().modifyTree(PerfUI.FlameChart.FilterAction.RESET_CHILDREN, node?.id);\n\n // No decorations should exist on the node\n decorationsForEntry = flameChartView.getMainFlameChart().timelineData()?.entryDecorations[node?.id];\n assert.isUndefined(decorationsForEntry);\n });\n\n describe('Context Menu', function() {\n let flameChartView: Timeline.TimelineFlameChartView.TimelineFlameChartView;\n let parsedTrace: Trace.Handlers.Types.ParsedTrace;\n\n this.beforeEach(async () => {\n ({parsedTrace} = await TraceLoader.traceEngine(this, 'recursive-blocking-js.json.gz'));\n const mockViewDelegate = new MockViewDelegate();\n\n flameChartView = new Timeline.TimelineFlameChartView.TimelineFlameChartView(mockViewDelegate);\n flameChartView.setModel(parsedTrace);\n Timeline.ModificationsManager.ModificationsManager.activeManager();\n });\n\n it('Does not create customized Context Menu for network track', async function() {\n // The mouse event passed to the Context Menu is used to indicate where the menu should appear. Since we don't\n // need it to actually appear for this test, pass an event with coordinates that is not in the track header.\n flameChartView.getNetworkFlameChart().onContextMenu(new MouseEvent('contextmenu', {clientX: 100, clientY: 100}));\n assert.isUndefined(flameChartView.getNetworkFlameChart().getContextMenu());\n });\n\n it('Does not create Context Menu for Network track header', async function() {\n // So for the first track header, its x will start from beginning.\n // And its y will start after the ruler (ruler's height is 17).\n flameChartView.getNetworkFlameChart().onContextMenu(new MouseEvent('contextmenu', {clientX: 0, clientY: 17}));\n assert.isUndefined(flameChartView.getNetworkFlameChart().getContextMenu());\n });\n\n it('Create correct Context Menu for track headers in main flame chart', async function() {\n // So for the first track header, its x will start from beginning.\n // And its y will start after the ruler (ruler's height is 17).\n flameChartView.getMainFlameChart().onContextMenu(new MouseEvent('contextmenu', {clientX: 0, clientY: 17}));\n\n assert.strictEqual(flameChartView.getMainFlameChart().getContextMenu()?.defaultSection().items.length, 1);\n assert.strictEqual(\n flameChartView.getMainFlameChart().getContextMenu()?.defaultSection().items.at(0)?.buildDescriptor().label,\n 'Configure tracks');\n });\n\n describe('Context Menu Actions For Thread tracks', function() {\n this.beforeEach(async () => {\n // Find the Main track to later collapse entries of\n const mainTrack = flameChartView.getMainFlameChart().timelineData()?.groups.find(group => {\n return group.name === 'Main — http://127.0.0.1:8080/';\n });\n if (!mainTrack) {\n throw new Error('Could not find main track');\n }\n });\n\n function getMainThread(data: Trace.Handlers.ModelHandlers.Renderer.RendererHandlerData):\n Trace.Handlers.ModelHandlers.Renderer.RendererThread {\n let mainThread: Trace.Handlers.ModelHandlers.Renderer.RendererThread|null = null;\n for (const [, process] of data.processes) {\n for (const [, thread] of process.threads) {\n if (thread.name === 'CrRendererMain') {\n mainThread = thread;\n break;\n }\n }\n }\n if (!mainThread) {\n throw new Error('Could not find main thread.');\n }\n return mainThread;\n }\n\n function findFirstEntry(\n allEntries: readonly Trace.Types.Events.Event[],\n predicate: (entry: Trace.Types.Events.Event) => boolean): Trace.Types.Events.Event {\n const entry = allEntries.find(entry => predicate(entry));\n if (!entry) {\n throw new Error('Could not find expected entry.');\n }\n return entry;\n }\n\n function generateContextMenuForNodeId(nodeId: number): void {\n // Highlight the node to make the Context Menu dispatch on this node\n flameChartView.getMainFlameChart().highlightEntry(nodeId);\n\n const eventCoordinates = flameChartView.getMainFlameChart().entryIndexToCoordinates(nodeId);\n if (!eventCoordinates) {\n throw new Error('Coordinates were not found');\n }\n\n // The mouse event passed to the Context Menu is used to indicate where the menu should appear. So just simply\n // use the pixels of top left corner of the event.\n flameChartView.getMainFlameChart().onContextMenu(\n new MouseEvent('contextmenu', {clientX: eventCoordinates.x, clientY: eventCoordinates.y}));\n }\n\n function generateContextMenuForNode(node: Trace.Types.Events.Event): void {\n const nodeId = flameChartView.getMainDataProvider().indexForEvent(node);\n assert.isNotNull(nodeId);\n generateContextMenuForNodeId(nodeId);\n }\n\n it('When an entry has no children, correctly make only Hide Entry enabled in the Context Menu action',\n async function() {\n /** Part of this stack looks roughly like so (with some events omitted):\n * =============== foo ===============\n * =============== foo ===============\n * =============== foo ===============\n * =============== foo ===============\n * =============== foo ===============\n * =============== foo ===============\n * =============== foo ===============\n * == now == == updateCounters == <-- ID=245\n *\n * In this test we want to test that the Context Menu option available\n * for an entry with no children and a parent is to hide given entry only.\n * Since there are no children to hide, we don't want to show 'hide children' option.\n *\n * To achieve that, we will dispatch the context menu on the 'updateCounters' function that does not have\n * children.\n * The ID of 'updateCounters' is 245.\n **/\n\n const nodeIdWithNoChildren = 245;\n generateContextMenuForNodeId(nodeIdWithNoChildren);\n\n assert.strictEqual(flameChartView.getMainFlameChart().getContextMenu()?.defaultSection().items.length, 5);\n // Hide function enabled\n assert.isTrue(flameChartView.getMainFlameChart()\n .getContextMenu()\n ?.defaultSection()\n .items.at(0)\n ?.buildDescriptor()\n .enabled);\n // Rest of the actions disabled\n assert.isFalse(flameChartView.getMainFlameChart()\n .getContextMenu()\n ?.defaultSection()\n .items.at(1)\n ?.buildDescriptor()\n .enabled);\n assert.isFalse(flameChartView.getMainFlameChart()\n .getContextMenu()\n ?.defaultSection()\n .items.at(2)\n ?.buildDescriptor()\n .enabled);\n assert.isFalse(flameChartView.getMainFlameChart()\n .getContextMenu()\n ?.defaultSection()\n .items.at(3)\n ?.buildDescriptor()\n .enabled);\n assert.isFalse(flameChartView.getMainFlameChart()\n .getContextMenu()\n ?.defaultSection()\n .items.at(4)\n ?.buildDescriptor()\n .enabled);\n });\n\n it('When an entry has children, correctly make only Hide Entry and Hide Children enabled in the Context Menu action',\n async function() {\n /** Part of this stack looks roughly like so (with some events omitted):\n * =============== foo ===============\n * =============== foo ===============\n * =============== foo ===============\n * =============== foo ===============\n * =============== foo ===============\n * =============== foo ===============\n * =============== foo ===============\n * ===== wait ===== ===== wait =====\n * = now = = now = = now = = now =\n *\n * In this test we want to test that the Context Menu option available\n * for an entry with children and a parent is to hide given entry, and hide children only.\n * Since there are no repeating children to hide, we don't want to show 'hide repeating children' option.\n *\n * To achieve that, we will dispatch the context menu on the 'wait' function that has only non-repeating\n * children.\n **/\n const mainThread = getMainThread(parsedTrace.Renderer);\n const entry = findFirstEntry(mainThread.entries, entry => {\n return Trace.Types.Events.isProfileCall(entry) && entry.callFrame.functionName === 'wait';\n });\n const nodeIdWithNoChildren = flameChartView.getMainDataProvider().indexForEvent(entry);\n assert.exists(nodeIdWithNoChildren);\n generateContextMenuForNodeId(nodeIdWithNoChildren);\n\n // This entry has URL, so there are 5 always-shown actions, and one to add script to ignore list.\n assert.strictEqual(flameChartView.getMainFlameChart().getContextMenu()?.defaultSection().items.length, 6);\n // Hide function enabled\n assert.isTrue(flameChartView.getMainFlameChart()\n .getContextMenu()\n ?.defaultSection()\n .items.at(0)\n ?.buildDescriptor()\n .enabled);\n // Hide children enabled\n assert.isTrue(flameChartView.getMainFlameChart()\n .getContextMenu()\n ?.defaultSection()\n .items.at(1)\n ?.buildDescriptor()\n .enabled);\n // Rest of the actions disabled\n assert.isFalse(flameChartView.getMainFlameChart()\n .getContextMenu()\n ?.defaultSection()\n .items.at(2)\n ?.buildDescriptor()\n .enabled);\n assert.isFalse(flameChartView.getMainFlameChart()\n .getContextMenu()\n ?.defaultSection()\n .items.at(3)\n ?.buildDescriptor()\n .enabled);\n assert.isFalse(flameChartView.getMainFlameChart()\n .getContextMenu()\n ?.defaultSection()\n .items.at(4)\n ?.buildDescriptor()\n .enabled);\n });\n\n it('When an entry has repeating children, correctly make only Hide Entry, Hide Children and Hide repeating children enabled in the Context Menu action',\n async function() {\n /** Part of this stack looks roughly like so (with some events omitted):\n * =============== foo ===============\n * =============== foo ===============\n * =============== foo ===============\n * =============== foo ===============\n * =============== foo ===============\n * =============== foo ===============\n * =============== foo ===============\n * ===== wait ===== ===== wait =====\n * = now = = now = = now = = now =\n *\n * In this test we want to test that the Context Menu option available\n * for an entry with children repeating children and a parent is to hide given entry, hide children and hide\n * repeating children.\n *\n * To achieve that, we will dispatch the context menu on the 'foo' function that has child 'foo' calls.\n **/\n\n const mainThread = getMainThread(parsedTrace.Renderer);\n const entry = findFirstEntry(mainThread.entries, entry => {\n return Trace.Types.Events.isProfileCall(entry) && entry.callFrame.functionName === 'foo';\n });\n\n const nodeId = flameChartView.getMainDataProvider().indexForEvent(entry);\n assert.exists(nodeId);\n\n generateContextMenuForNodeId(nodeId);\n\n // This entry has URL, so there are 5 always-shown actions, and one to add script to ignore list.\n assert.strictEqual(flameChartView.getMainFlameChart().getContextMenu()?.defaultSection().items.length, 6);\n // Hide function enabled\n assert.isTrue(flameChartView.getMainFlameChart()\n .getContextMenu()\n ?.defaultSection()\n .items.at(0)\n ?.buildDescriptor()\n .enabled);\n // Hide children enabled\n assert.isTrue(flameChartView.getMainFlameChart()\n .getContextMenu()\n ?.defaultSection()\n .items.at(1)\n ?.buildDescriptor()\n .enabled);\n // Hide repeating children enabled\n assert.isTrue(flameChartView.getMainFlameChart()\n .getContextMenu()\n ?.defaultSection()\n .items.at(2)\n ?.buildDescriptor()\n .enabled);\n // Rest of the actions disabled\n assert.isFalse(flameChartView.getMainFlameChart()\n .getContextMenu()\n ?.defaultSection()\n .items.at(3)\n ?.buildDescriptor()\n .enabled);\n assert.isFalse(flameChartView.getMainFlameChart()\n .getContextMenu()\n ?.defaultSection()\n .items.at(4)\n ?.buildDescriptor()\n .enabled);\n });\n\n it('When an entry has no parent and has children, correctly make only Hide Children enabled in the Context Menu action',\n async function() {\n /** Part of this stack looks roughly like so (with some events omitted):\n * =============== Task ==============\n * =============== foo ===============\n * =============== foo ===============\n * =============== foo ===============\n * =============== foo ===============\n * =============== foo ===============\n * =============== foo ===============\n * ===== wait ===== ===== wait =====\n * = now = = now = = now = = now =\n *\n * In this test we want to test that the Context Menu option available for an entry with no parent is only to\n * hide children.\n * If an entry has no parent, we don't want to show an option to hide the entry since when an entry is hidden,\n * it is indicated by adding a decoration to the parent and if there is no parent, there is no way to show it\n * is hidden.\n *\n * To achieve that, we will dispatch the context menu on the 'Task' function that is on the top of the stack\n * and has no parent.\n **/\n\n const mainThread = getMainThread(parsedTrace.Renderer);\n const entry = findFirstEntry(mainThread.entries, entry => {\n const childrenAmount =\n parsedTrace.Renderer.entryToNode.get(entry as Trace.Types.Events.Event)?.children.length;\n if (!childrenAmount) {\n return false;\n }\n return Trace.Types.Events.isRunTask(entry);\n });\n\n const nodeId = flameChartView.getMainDataProvider().indexForEvent(entry);\n assert.exists(nodeId);\n\n generateContextMenuForNodeId(nodeId);\n\n // Hide function disabled\n assert.isFalse(flameChartView.getMainFlameChart()\n .getContextMenu()\n ?.defaultSection()\n .items.at(0)\n ?.buildDescriptor()\n .enabled);\n // Hide children enabled\n assert.isTrue(flameChartView.getMainFlameChart()\n .getContextMenu()\n ?.defaultSection()\n .items.at(1)\n ?.buildDescriptor()\n .enabled);\n // Rest of the actions disabled\n assert.isFalse(flameChartView.getMainFlameChart()\n .getContextMenu()\n ?.defaultSection()\n .items.at(2)\n ?.buildDescriptor()\n .enabled);\n assert.isFalse(flameChartView.getMainFlameChart()\n .getContextMenu()\n ?.defaultSection()\n .items.at(3)\n ?.buildDescriptor()\n .enabled);\n assert.isFalse(flameChartView.getMainFlameChart()\n .getContextMenu()\n ?.defaultSection()\n .items.at(4)\n ?.buildDescriptor()\n .enabled);\n });\n\n it('Reset Trace Context Menu action is disabled before some action has been applied', async function() {\n /** Part of this stack looks roughly like so (with some events omitted):\n * =============== Task ==============\n * =============== foo ===============\n * =============== foo ===============\n * =============== foo ===============\n * =============== foo ===============\n * =============== foo ===============\n * =============== foo ===============\n * ===== wait ===== ===== wait =====\n * = now = = now = = now = = now =\n *\n * In this test we want to test that the Reset Trace Context Menu option is disabled by default and enabled after\n * some action has been applied.\n *\n * To achieve that, we will first check if Reset Trace is disabled and then dispatch a Context Menu action on\n * \"Task\" entry and then check if Reset Trace is enabled.\n **/\n\n const mainThread = getMainThread(parsedTrace.Renderer);\n const entry = findFirstEntry(mainThread.entries, entry => Trace.Types.Events.isRunTask(entry));\n const nodeId = flameChartView.getMainDataProvider().indexForEvent(entry);\n assert.exists(nodeId);\n\n generateContextMenuForNodeId(nodeId);\n assert.strictEqual(flameChartView.getMainFlameChart().getContextMenu()?.defaultSection().items.length, 5);\n assert.strictEqual(\n flameChartView.getMainFlameChart().getContextMenu()?.defaultSection().items.at(4)?.buildDescriptor().label,\n 'Reset trace');\n // Check that Reset Trace is disabled\n assert.isFalse(flameChartView.getMainFlameChart()\n .getContextMenu()\n ?.defaultSection()\n .items.at(4)\n ?.buildDescriptor()\n .enabled);\n\n flameChartView.getMainFlameChart().modifyTree(PerfUI.FlameChart.FilterAction.MERGE_FUNCTION, nodeId);\n generateContextMenuForNodeId(nodeId);\n\n // Check that Reset Trace is enabled\n assert.isTrue(flameChartView.getMainFlameChart()\n .getContextMenu()\n ?.defaultSection()\n .items.at(4)\n ?.buildDescriptor()\n .enabled);\n });\n\n it('When an entry has URL and is not ignored, correctly show the Add script to ignore list in the Context Menu action',\n async function() {\n const mainThread = getMainThread(parsedTrace.Renderer);\n const entryWithUrl = findFirstEntry(mainThread.entries, entry => {\n // Let's find the first entry with URL.\n return Trace.Types.Events.isProfileCall(entry) && Boolean(entry.callFrame.url);\n });\n generateContextMenuForNode(entryWithUrl);\n\n assert.strictEqual(flameChartView.getMainFlameChart().getContextMenu()?.defaultSection().items.length, 6);\n\n assert.strictEqual(\n flameChartView.getMainFlameChart()\n .getContextMenu()\n ?.defaultSection()\n .items.at(5)\n ?.buildDescriptor()\n .label,\n 'Add script to ignore list');\n });\n\n it('When an entry has URL and is ignored, correctly show the Remove script from ignore list in the Context Menu action',\n async function() {\n const mainThread = getMainThread(parsedTrace.Renderer);\n const entryWithIgnoredUrl = findFirstEntry(mainThread.entries, entry => {\n // Let's find the first entry with URL.\n return Trace.Types.Events.isProfileCall(entry) && Boolean(entry.callFrame.url);\n });\n Bindings.IgnoreListManager.IgnoreListManager.instance().ignoreListURL(\n (entryWithIgnoredUrl as Trace.Types.Events.SyntheticProfileCall).callFrame.url as\n Platform.DevToolsPath.UrlString);\n\n generateContextMenuForNode(entryWithIgnoredUrl);\n\n assert.strictEqual(flameChartView.getMainFlameChart().getContextMenu()?.defaultSection().items.length, 6);\n\n assert.strictEqual(\n flameChartView.getMainFlameChart()\n .getContextMenu()\n ?.defaultSection()\n .items.at(5)\n ?.buildDescriptor()\n .label,\n 'Remove script from ignore list');\n });\n });\n });\n\n describe('Link between entries annotation in progress', function() {\n let flameChartView: Timeline.TimelineFlameChartView.TimelineFlameChartView;\n let parsedTrace: Trace.Handlers.Types.ParsedTrace;\n\n this.beforeEach(async () => {\n ({parsedTrace} = await TraceLoader.traceEngine(this, 'recursive-blocking-js.json.gz'));\n const mockViewDelegate = new MockViewDelegate();\n\n flameChartView = new Timeline.TimelineFlameChartView.TimelineFlameChartView(mockViewDelegate);\n flameChartView.setModel(parsedTrace);\n Timeline.ModificationsManager.ModificationsManager.activeManager();\n });\n\n it('Creates a `link between entries Annotation in progress` tracking object', async function() {\n // Make sure the link annotation in the progress of creation does not exist\n assert.isNull(flameChartView.getLinkSelectionAnnotation());\n\n // Start creating a link between entries from an entry with ID 204\n flameChartView.onEntriesLinkAnnotationCreate(flameChartView.getMainDataProvider(), 204);\n\n // Make sure the link is started and only has 'from' entry set\n assert.isNotNull(flameChartView.getLinkSelectionAnnotation());\n assert.isNotNull(flameChartView.getLinkSelectionAnnotation()?.entryFrom);\n assert.isUndefined(flameChartView.getLinkSelectionAnnotation()?.entryTo);\n\n // Make sure the annotation exists in the ModificationsManager\n const annotations = Timeline.ModificationsManager.ModificationsManager.activeManager()?.getAnnotations();\n assert.exists(annotations);\n assert.strictEqual(annotations?.length, 1);\n assert.strictEqual(annotations[0].type, 'ENTRIES_LINK');\n });\n\n it('Sets the link between entries annotation in progress to null when the second entry is selected',\n async function() {\n // Make sure the link annotation in the progress of creation does not exist\n assert.isNull(flameChartView.getLinkSelectionAnnotation());\n\n // Start creating a link between entries from an entry with ID 204\n flameChartView.onEntriesLinkAnnotationCreate(flameChartView.getMainDataProvider(), 204);\n const entryFrom = flameChartView.getMainDataProvider().eventByIndex(204);\n\n // Hover on another entry to complete the link\n flameChartView.updateLinkSelectionAnnotationWithToEntry(flameChartView.getMainDataProvider(), 245);\n const entryTo = flameChartView.getMainDataProvider().eventByIndex(245);\n // Make sure the entry 'to' is set\n assert.exists(flameChartView.getLinkSelectionAnnotation()?.entryTo);\n\n // Select the other entry to complete the link and set the one in progress to null\n flameChartView.handleToEntryOfLinkBetweenEntriesSelection(245);\n // Make sure the link annotation in progress is set to null\n assert.isNull(flameChartView.getLinkSelectionAnnotation());\n\n // Make sure the annotation exists in the ModificationsManager\n const annotations = Timeline.ModificationsManager.ModificationsManager.activeManager()?.getAnnotations();\n assert.exists(annotations);\n assert.strictEqual(annotations?.length, 1);\n assert.strictEqual(annotations[0].type, 'ENTRIES_LINK');\n const entriesLink = annotations[0] as Trace.Types.File.EntriesLinkAnnotation;\n\n assert.strictEqual(entriesLink.entryFrom, entryFrom);\n assert.strictEqual(entriesLink.entryTo, entryTo);\n });\n\n it('Reverses entries in the link if `to` entry timestamp is earlier than `from` entry timestamo', async function() {\n // Make sure the link annotation in the progress of creation does not exist\n assert.isNull(flameChartView.getLinkSelectionAnnotation());\n\n // Start creating a link between entries from an entry with ID 245\n flameChartView.onEntriesLinkAnnotationCreate(flameChartView.getMainDataProvider(), 245);\n const entryFrom = flameChartView.getMainDataProvider().eventByIndex(245);\n\n // Hover on another entry that starts before the entry that the link is being created from\n flameChartView.updateLinkSelectionAnnotationWithToEntry(flameChartView.getMainDataProvider(), 204);\n const entryTo = flameChartView.getMainDataProvider().eventByIndex(204);\n\n // Select the other entry to complete the link and set the one in progress to null\n flameChartView.handleToEntryOfLinkBetweenEntriesSelection(204);\n\n // Make sure the annotation exists in the ModificationsManager\n const annotations = Timeline.ModificationsManager.ModificationsManager.activeManager()?.getAnnotations();\n assert.exists(annotations);\n assert.strictEqual(annotations?.length, 1);\n assert.strictEqual(annotations[0].type, 'ENTRIES_LINK');\n const entriesLink = annotations[0] as Trace.Types.File.EntriesLinkAnnotation;\n\n // Make 'entryFrom' has an earlier timestamp and the entries `to` and `from` got switched up\n assert.strictEqual(entriesLink.entryFrom, entryTo);\n assert.strictEqual(entriesLink.entryTo, entryFrom);\n });\n });\n});\n"]} \ No newline at end of file diff --git a/public/panels/timeline/TimelineHistoryManager.js b/public/panels/timeline/TimelineHistoryManager.js index 8d83fe5f0..88ebe5ea9 100644 --- a/public/panels/timeline/TimelineHistoryManager.js +++ b/public/panels/timeline/TimelineHistoryManager.js @@ -353,10 +353,7 @@ export class DropDown { this.glassPane.setPointerEventsBehavior("BlockedByGlassPane" /* UI.GlassPane.PointerEventsBehavior.BLOCKED_BY_GLASS_PANE */); this.glassPane.setAnchorBehavior("PreferBottom" /* UI.GlassPane.AnchorBehavior.PREFER_BOTTOM */); this.glassPane.element.addEventListener('blur', () => this.close(null)); - const shadowRoot = UI.UIUtils.createShadowRootWithCoreStyles(this.glassPane.contentElement, { - cssFile: [timelineHistoryManagerStyles], - delegatesFocus: undefined, - }); + const shadowRoot = UI.UIUtils.createShadowRootWithCoreStyles(this.glassPane.contentElement, { cssFile: [timelineHistoryManagerStyles] }); const contentElement = shadowRoot.createChild('div', 'drop-down'); const listModel = new UI.ListModel.ListModel(); this.listControl = new UI.ListControl.ListControl(listModel, this, UI.ListControl.ListMode.NonViewport); diff --git a/public/panels/timeline/TimelineHistoryManager.js.map b/public/panels/timeline/TimelineHistoryManager.js.map index 227b405eb..df10b7d68 100644 --- a/public/panels/timeline/TimelineHistoryManager.js.map +++ b/public/panels/timeline/TimelineHistoryManager.js.map @@ -1 +1 @@ -{"version":3,"file":"TimelineHistoryManager.js","sourceRoot":"","sources":["../../../../../../front_end/panels/timeline/TimelineHistoryManager.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,KAAK,MAAM,MAAM,6BAA6B,CAAC;AACtD,OAAO,KAAK,IAAI,MAAM,yBAAyB,CAAC;AAChD,OAAO,KAAK,QAAQ,MAAM,iCAAiC,CAAC;AAE5D,OAAO,KAAK,UAAU,MAAM,gDAAgD,CAAC;AAC7E,OAAO,KAAK,EAAE,MAAM,2BAA2B,CAAC;AAChD,OAAO,KAAK,aAAa,MAAM,2CAA2C,CAAC;AAE3E,OAAO,EAEL,gCAAgC,EAChC,4BAA4B,EAC5B,mCAAmC,GACpC,MAAM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,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC;IAChC,CAAC;IAED,OAAO,CAAC,IAAY;QAClB,IAAI,CAAC,cAAc,CAAC,WAAW,GAAG,IAAI,CAAC;IACzC,CAAC;CACF","sourcesContent":["// Copyright 2017 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport * as Common from '../../core/common/common.js';\nimport * as i18n from '../../core/i18n/i18n.js';\nimport * as Platform from '../../core/platform/platform.js';\nimport type * as Trace from '../../models/trace/trace.js';\nimport * as IconButton from '../../ui/components/icon_button/icon_button.js';\nimport * as UI from '../../ui/legacy/legacy.js';\nimport * as VisualLogging from '../../ui/visual_logging/visual_logging.js';\n\nimport {\n type TimelineEventOverview,\n TimelineEventOverviewCPUActivity,\n TimelineEventOverviewNetwork,\n TimelineEventOverviewResponsiveness,\n} from './TimelineEventOverview.js';\nimport timelineHistoryManagerStyles from './timelineHistoryManager.css.js';\nimport type {TimelineMiniMap} from './TimelineMiniMap.js';\n\n/**\n * The dropdown works by returning an index which is the trace index; but we\n * also need a way to signify that the user picked the \"Landing Page\" option. We\n * represent that as Infinity so we never accidentally collide with an actual\n * trace (in reality a large number like 99 would probably suffice...)\n */\nexport const LANDING_PAGE_INDEX_DROPDOWN_CHOICE = Infinity;\n\nconst UIStrings = {\n /**\n *@description Screen reader label for the Timeline History dropdown button\n *@example {example.com #3} PH1\n *@example {Show recent timeline sessions} PH2\n */\n currentSessionSS: 'Current session: {PH1}. {PH2}',\n /**\n *@description the title shown when the user is viewing the landing page which is showing live performance metrics that are updated automatically.\n */\n landingPageTitle: 'Live metrics',\n /**\n * @description the title shown when the user is viewing the landing page which can be used to make a new performance recording.\n */\n nodeLandingPageTitle: 'New recording',\n /**\n *@description Text in Timeline History Manager of the Performance panel\n *@example {example.com} PH1\n *@example {2} PH2\n */\n sD: '{PH1} #{PH2}',\n /**\n *@description Accessible label for the timeline session selection menu\n */\n selectTimelineSession: 'Select timeline session',\n /**\n * @description Text label for a menu item indicating that a specific slowdown multiplier is applied.\n * @example {2} PH1\n */\n dSlowdown: '{PH1}× slowdown',\n};\nconst str_ = i18n.i18n.registerUIStrings('panels/timeline/TimelineHistoryManager.ts', UIStrings);\nconst i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);\n\n/**\n * The dropdown includes an option to navigate to the landing page; hence the\n * two types for storing recordings. The TimelineHistoryManager automatically\n * includes a link to go back to the landing page.\n */\ninterface TraceRecordingHistoryItem {\n type: 'TRACE_INDEX';\n // By storing only the index of this trace, the TimelinePanel can then look\n // up this trace's data (and metadata) via this index.\n parsedTraceIndex: number;\n}\ninterface LandingPageHistoryItem {\n type: 'LANDING_PAGE';\n}\nexport type RecordingData = TraceRecordingHistoryItem|LandingPageHistoryItem;\n\nexport interface NewHistoryRecordingData {\n // The data we will save to restore later.\n data: TraceRecordingHistoryItem;\n // We do not store this, but need it to build the thumbnail preview.\n filmStripForPreview: Trace.Extras.FilmStrip.Data|null;\n // Also not stored, but used to create the preview overview for a new trace.\n parsedTrace: Trace.Handlers.Types.ParsedTrace;\n metadata: Trace.Types.File.MetaData|null;\n}\n\n// Lazily instantiate the formatter as the constructor takes 50ms+\n// TODO: move me and others like me to i18n module\nconst listFormatter = (function defineFormatter() {\n let intlListFormat: Intl.ListFormat;\n return {\n format(...args: Parameters): ReturnType {\n if (!intlListFormat) {\n const opts: Intl.ListFormatOptions = {type: 'unit', style: 'short'};\n intlListFormat = new Intl.ListFormat(i18n.DevToolsLocale.DevToolsLocale.instance().locale, opts);\n }\n return intlListFormat.format(...args);\n },\n };\n})();\n\nexport class TimelineHistoryManager {\n private recordings: TraceRecordingHistoryItem[];\n private readonly action: UI.ActionRegistration.Action;\n private readonly nextNumberByDomain: Map;\n private readonly buttonInternal: ToolbarButton;\n private readonly allOverviews: {\n constructor: (parsedTrace: Trace.Handlers.Types.ParsedTrace) => TimelineEventOverview,\n height: number,\n }[];\n private totalHeight: number;\n private enabled: boolean;\n private lastActiveTrace: RecordingData|null = null;\n #minimapComponent?: TimelineMiniMap;\n #landingPageTitle: Common.UIString.LocalizedString;\n\n constructor(minimapComponent?: TimelineMiniMap, isNode?: boolean) {\n this.recordings = [];\n this.#minimapComponent = minimapComponent;\n this.action = UI.ActionRegistry.ActionRegistry.instance().getAction('timeline.show-history');\n this.nextNumberByDomain = new Map();\n this.buttonInternal = new ToolbarButton(this.action);\n\n this.#landingPageTitle =\n isNode ? i18nString(UIStrings.nodeLandingPageTitle) : i18nString(UIStrings.landingPageTitle);\n\n UI.ARIAUtils.markAsMenuButton(this.buttonInternal.element);\n this.clear();\n\n // Attempt to reuse the overviews coming from the panel's minimap\n // before creating new instances.\n this.allOverviews = [\n {\n\n constructor: parsedTrace => {\n const responsivenessOverviewFromMinimap =\n this.#minimapComponent?.getControls().find(\n control => control instanceof TimelineEventOverviewResponsiveness) as\n TimelineEventOverviewResponsiveness;\n return responsivenessOverviewFromMinimap || new TimelineEventOverviewResponsiveness(parsedTrace);\n },\n height: 3,\n },\n {\n constructor: parsedTrace => {\n const cpuOverviewFromMinimap =\n this.#minimapComponent?.getControls().find(\n control => control instanceof TimelineEventOverviewCPUActivity) as TimelineEventOverviewCPUActivity;\n if (cpuOverviewFromMinimap) {\n return cpuOverviewFromMinimap;\n }\n return new TimelineEventOverviewCPUActivity(parsedTrace);\n },\n height: 20,\n },\n {\n constructor: parsedTrace => {\n const networkOverviewFromMinimap =\n this.#minimapComponent?.getControls().find(control => control instanceof TimelineEventOverviewNetwork) as\n TimelineEventOverviewNetwork;\n return networkOverviewFromMinimap || new TimelineEventOverviewNetwork(parsedTrace);\n },\n height: 8,\n },\n ];\n this.totalHeight = this.allOverviews.reduce((acc, entry) => acc + entry.height, 0);\n this.enabled = true;\n }\n\n addRecording(newInput: NewHistoryRecordingData): void {\n const filmStrip = newInput.filmStripForPreview;\n this.lastActiveTrace = newInput.data;\n this.recordings.unshift(newInput.data);\n\n // Order is important: this needs to happen first because lots of the\n // subsequent code depends on us storing the preview data into the map.\n this.#buildAndStorePreviewData(newInput.data.parsedTraceIndex, newInput.parsedTrace, newInput.metadata, filmStrip);\n\n const modelTitle = this.title(newInput.data);\n this.buttonInternal.setText(modelTitle);\n const buttonTitle = this.action.title();\n UI.ARIAUtils.setLabel(\n this.buttonInternal.element, i18nString(UIStrings.currentSessionSS, {PH1: modelTitle, PH2: buttonTitle}));\n this.updateState();\n if (this.recordings.length <= maxRecordings) {\n return;\n }\n const modelUsedMoreTimeAgo =\n this.recordings.reduce((a, b) => lastUsedTime(a.parsedTraceIndex) < lastUsedTime(b.parsedTraceIndex) ? a : b);\n this.recordings.splice(this.recordings.indexOf(modelUsedMoreTimeAgo), 1);\n\n function lastUsedTime(index: number): number {\n const data = TimelineHistoryManager.dataForTraceIndex(index);\n if (!data) {\n throw new Error('Unable to find data for model');\n }\n return data.lastUsed;\n }\n }\n\n setEnabled(enabled: boolean): void {\n this.enabled = enabled;\n this.updateState();\n }\n\n button(): ToolbarButton {\n return this.buttonInternal;\n }\n\n clear(): void {\n this.recordings = [];\n this.lastActiveTrace = null;\n this.updateState();\n this.buttonInternal.setText(this.#landingPageTitle);\n this.nextNumberByDomain.clear();\n }\n\n #getActiveTraceIndexForListControl(): number {\n if (!this.lastActiveTrace) {\n return -1;\n }\n if (this.lastActiveTrace.type === 'LANDING_PAGE') {\n return LANDING_PAGE_INDEX_DROPDOWN_CHOICE;\n }\n return this.lastActiveTrace.parsedTraceIndex;\n }\n\n async showHistoryDropDown(): Promise {\n if (this.recordings.length < 1 || !this.enabled) {\n return null;\n }\n\n // DropDown.show() function finishes when the dropdown menu is closed via selection or losing focus\n const activeTraceIndex = await DropDown.show(\n this.recordings.map(recording => recording.parsedTraceIndex), this.#getActiveTraceIndexForListControl(),\n this.buttonInternal.element, this.#landingPageTitle);\n\n if (activeTraceIndex === null) {\n return null;\n }\n\n // The ListControl class that backs the dropdown uses indexes; we represent\n // the landing page choice via this special index.\n if (activeTraceIndex === LANDING_PAGE_INDEX_DROPDOWN_CHOICE) {\n this.#setActiveTrace({type: 'LANDING_PAGE'});\n return {type: 'LANDING_PAGE'};\n }\n\n const index = this.recordings.findIndex(recording => recording.parsedTraceIndex === activeTraceIndex);\n if (index < 0) {\n console.assert(false, 'selected recording not found');\n return null;\n }\n\n this.#setActiveTrace(this.recordings[index]);\n return this.recordings[index];\n }\n\n cancelIfShowing(): void {\n DropDown.cancelIfShowing();\n }\n\n /**\n * Navigate by 1 in either direction to the next trace.\n * Navigating in this way does not include the landing page; it will loop\n * over only the traces.\n */\n navigate(direction: number): TraceRecordingHistoryItem|null {\n if (!this.enabled || this.lastActiveTrace === null) {\n return null;\n }\n if (!this.lastActiveTrace || this.lastActiveTrace.type === 'LANDING_PAGE') {\n return null;\n }\n\n const index = this.recordings.findIndex(recording => {\n return this.lastActiveTrace?.type === 'TRACE_INDEX' && recording.type === 'TRACE_INDEX' &&\n recording.parsedTraceIndex === this.lastActiveTrace.parsedTraceIndex;\n });\n\n if (index < 0) {\n return null;\n }\n\n const newIndex = Platform.NumberUtilities.clamp(index + direction, 0, this.recordings.length - 1);\n this.#setActiveTrace(this.recordings[newIndex]);\n return this.recordings[newIndex];\n }\n\n navigateToLandingPage(): void {\n this.#setActiveTrace({type: 'LANDING_PAGE'});\n }\n\n #setActiveTrace(item: RecordingData): void {\n if (item.type === 'TRACE_INDEX') {\n const data = TimelineHistoryManager.dataForTraceIndex(item.parsedTraceIndex);\n if (!data) {\n throw new Error('Unable to find data for model');\n }\n data.lastUsed = Date.now();\n }\n\n this.lastActiveTrace = item;\n const modelTitle = this.title(item);\n const buttonTitle = this.action.title();\n this.buttonInternal.setText(modelTitle);\n UI.ARIAUtils.setLabel(\n this.buttonInternal.element, i18nString(UIStrings.currentSessionSS, {PH1: modelTitle, PH2: buttonTitle}));\n }\n\n private updateState(): void {\n this.action.setEnabled(this.recordings.length >= 1 && this.enabled);\n }\n\n static previewElement(parsedTraceIndex: number): Element {\n const data = TimelineHistoryManager.dataForTraceIndex(parsedTraceIndex);\n if (!data) {\n throw new Error('Unable to find data for model');\n }\n return data.preview;\n }\n\n private title(item: RecordingData): string {\n if (item.type === 'LANDING_PAGE') {\n return this.#landingPageTitle;\n }\n\n const data = TimelineHistoryManager.dataForTraceIndex(item.parsedTraceIndex);\n if (!data) {\n throw new Error('Unable to find data for model');\n }\n return data.title;\n }\n\n #buildAndStorePreviewData(\n parsedTraceIndex: number, parsedTrace: Trace.Handlers.Types.ParsedTrace, metadata: Trace.Types.File.MetaData|null,\n filmStrip: Trace.Extras.FilmStrip.Data|null): HTMLDivElement {\n const parsedURL = Common.ParsedURL.ParsedURL.fromString(parsedTrace.Meta.mainFrameURL);\n const domain = parsedURL ? parsedURL.host : '';\n\n const sequenceNumber = this.nextNumberByDomain.get(domain) || 1;\n const titleWithSequenceNumber = i18nString(UIStrings.sD, {PH1: domain, PH2: sequenceNumber});\n this.nextNumberByDomain.set(domain, sequenceNumber + 1);\n\n const preview = document.createElement('div');\n preview.classList.add('preview-item');\n preview.classList.add('vbox');\n preview.setAttribute('jslog', `${VisualLogging.dropDown('timeline.history-item').track({click: true})}`);\n preview.style.width = `${previewWidth}px`;\n const data = {\n preview,\n title: titleWithSequenceNumber,\n lastUsed: Date.now(),\n };\n parsedTraceIndexToPerformancePreviewData.set(parsedTraceIndex, data);\n\n preview.appendChild(this.#buildTextDetails(metadata, domain));\n const screenshotAndOverview = preview.createChild('div', 'hbox');\n screenshotAndOverview.appendChild(this.#buildScreenshotThumbnail(filmStrip));\n screenshotAndOverview.appendChild(this.#buildOverview(parsedTrace));\n return data.preview;\n }\n\n #buildTextDetails(metadata: Trace.Types.File.MetaData|null, title: string): Element {\n const container = document.createElement('div');\n container.classList.add('text-details');\n container.classList.add('hbox');\n const nameSpan = container.createChild('span', 'name');\n nameSpan.textContent = title;\n UI.ARIAUtils.setLabel(nameSpan, title);\n\n if (metadata) {\n const parts = [\n metadata.emulatedDeviceTitle,\n metadata.cpuThrottling ? i18nString(UIStrings.dSlowdown, {PH1: metadata.cpuThrottling}) : undefined,\n metadata.networkThrottling,\n ].filter(Boolean);\n container.createChild('span', 'metadata').textContent = listFormatter.format(parts as string[]);\n }\n\n return container;\n }\n\n #buildScreenshotThumbnail(filmStrip: Trace.Extras.FilmStrip.Data|null): Element {\n const container = document.createElement('div');\n container.classList.add('screenshot-thumb');\n const thumbnailAspectRatio = 3 / 2;\n container.style.width = this.totalHeight * thumbnailAspectRatio + 'px';\n container.style.height = this.totalHeight + 'px';\n if (!filmStrip) {\n return container;\n }\n const lastFrame = filmStrip.frames.at(-1);\n if (!lastFrame) {\n return container;\n }\n // TODO(paulirish): Adopt Util.ImageCache\n void UI.UIUtils.loadImage(lastFrame.screenshotEvent.args.dataUri).then(img => {\n if (img) {\n container.appendChild(img);\n }\n });\n return container;\n }\n\n #buildOverview(parsedTrace: Trace.Handlers.Types.ParsedTrace): Element {\n const container = document.createElement('div');\n const dPR = window.devicePixelRatio;\n container.style.width = previewWidth + 'px';\n container.style.height = this.totalHeight + 'px';\n const canvas = (container.createChild('canvas') as HTMLCanvasElement);\n canvas.width = dPR * previewWidth;\n canvas.height = dPR * this.totalHeight;\n\n const ctx = canvas.getContext('2d');\n let yOffset = 0;\n\n for (const overview of this.allOverviews) {\n const timelineOverviewComponent = overview.constructor(parsedTrace);\n timelineOverviewComponent.update();\n if (ctx) {\n ctx.drawImage(\n timelineOverviewComponent.context().canvas, 0, yOffset, dPR * previewWidth, overview.height * dPR);\n }\n yOffset += overview.height * dPR;\n }\n return container;\n }\n\n private static dataForTraceIndex(index: number): PreviewData|null {\n return parsedTraceIndexToPerformancePreviewData.get(index) || null;\n }\n}\n\nexport const maxRecordings = 5;\nexport const previewWidth = 500;\n// The reason we store a global map is because the Dropdown component needs to\n// be able to read the preview data in order to show a preview in the dropdown.\nconst parsedTraceIndexToPerformancePreviewData = new Map();\n\nexport interface PreviewData {\n preview: Element;\n lastUsed: number;\n title: string;\n}\n\nexport class DropDown implements UI.ListControl.ListDelegate {\n private readonly glassPane: UI.GlassPane.GlassPane;\n private readonly listControl: UI.ListControl.ListControl;\n private readonly focusRestorer: UI.UIUtils.ElementFocusRestorer;\n private selectionDone: ((arg0: number|null) => void)|null;\n #landingPageTitle: Common.UIString.LocalizedString;\n\n constructor(availableparsedTraceIndexes: number[], landingPageTitle: Common.UIString.LocalizedString) {\n this.#landingPageTitle = landingPageTitle;\n\n this.glassPane = new UI.GlassPane.GlassPane();\n this.glassPane.setSizeBehavior(UI.GlassPane.SizeBehavior.MEASURE_CONTENT);\n this.glassPane.setOutsideClickCallback(() => this.close(null));\n this.glassPane.setPointerEventsBehavior(UI.GlassPane.PointerEventsBehavior.BLOCKED_BY_GLASS_PANE);\n this.glassPane.setAnchorBehavior(UI.GlassPane.AnchorBehavior.PREFER_BOTTOM);\n this.glassPane.element.addEventListener('blur', () => this.close(null));\n\n const shadowRoot = UI.UIUtils.createShadowRootWithCoreStyles(this.glassPane.contentElement, {\n cssFile: [timelineHistoryManagerStyles],\n delegatesFocus: undefined,\n });\n const contentElement = shadowRoot.createChild('div', 'drop-down');\n\n const listModel = new UI.ListModel.ListModel();\n this.listControl = new UI.ListControl.ListControl(listModel, this, UI.ListControl.ListMode.NonViewport);\n this.listControl.element.addEventListener('mousemove', this.onMouseMove.bind(this), false);\n listModel.replaceAll(availableparsedTraceIndexes);\n\n UI.ARIAUtils.markAsMenu(this.listControl.element);\n UI.ARIAUtils.setLabel(this.listControl.element, i18nString(UIStrings.selectTimelineSession));\n contentElement.appendChild(this.listControl.element);\n contentElement.addEventListener('keydown', this.onKeyDown.bind(this), false);\n contentElement.addEventListener('click', this.onClick.bind(this), false);\n\n this.focusRestorer = new UI.UIUtils.ElementFocusRestorer(this.listControl.element);\n this.selectionDone = null;\n }\n\n static show(\n availableparsedTraceIndexes: number[], activeparsedTraceIndex: number, anchor: Element,\n landingPageTitle: Common.UIString.LocalizedString = i18nString(UIStrings.landingPageTitle)):\n Promise {\n if (DropDown.instance) {\n return Promise.resolve(null);\n }\n const availableDropdownChoices = [...availableparsedTraceIndexes];\n availableDropdownChoices.unshift(LANDING_PAGE_INDEX_DROPDOWN_CHOICE);\n const instance = new DropDown(availableDropdownChoices, landingPageTitle);\n return instance.show(anchor, activeparsedTraceIndex);\n }\n\n static cancelIfShowing(): void {\n if (!DropDown.instance) {\n return;\n }\n DropDown.instance.close(null);\n }\n\n private show(anchor: Element, activeparsedTraceIndex: number): Promise {\n DropDown.instance = this;\n this.glassPane.setContentAnchorBox(anchor.boxInWindow());\n this.glassPane.show(this.glassPane.contentElement.ownerDocument);\n this.listControl.element.focus();\n this.listControl.selectItem(activeparsedTraceIndex);\n\n return new Promise(fulfill => {\n this.selectionDone = fulfill;\n });\n }\n\n private onMouseMove(event: Event): void {\n const node = (event.target as HTMLElement).enclosingNodeOrSelfWithClass('preview-item');\n const listItem = node && this.listControl.itemForNode(node);\n if (listItem === null) {\n return;\n }\n this.listControl.selectItem(listItem);\n }\n\n private onClick(event: Event): void {\n // TODO(crbug.com/1172300) Ignored during the jsdoc to ts migration\n // @ts-expect-error\n if (!(event.target).enclosingNodeOrSelfWithClass('preview-item')) {\n return;\n }\n this.close(this.listControl.selectedItem());\n }\n\n private onKeyDown(event: Event): void {\n switch ((event as KeyboardEvent).key) {\n case 'Tab':\n case 'Escape':\n this.close(null);\n break;\n case 'Enter':\n this.close(this.listControl.selectedItem());\n break;\n default:\n return;\n }\n event.consume(true);\n }\n\n private close(traceIndex: number|null): void {\n if (this.selectionDone) {\n this.selectionDone(traceIndex);\n }\n this.focusRestorer.restore();\n this.glassPane.hide();\n DropDown.instance = null;\n }\n\n createElementForItem(parsedTraceIndex: number): Element {\n if (parsedTraceIndex === LANDING_PAGE_INDEX_DROPDOWN_CHOICE) {\n return this.#createLandingPageListItem();\n }\n const element = TimelineHistoryManager.previewElement(parsedTraceIndex);\n UI.ARIAUtils.markAsMenuItem(element);\n element.classList.remove('selected');\n return element;\n }\n\n #createLandingPageListItem(): HTMLElement {\n const div = document.createElement('div');\n UI.ARIAUtils.markAsMenuItem(div);\n div.classList.remove('selected');\n div.classList.add('preview-item');\n div.classList.add('landing-page-item');\n\n div.style.width = `${previewWidth}px`;\n\n const icon = IconButton.Icon.create('arrow-back');\n div.appendChild(icon);\n\n const text = document.createElement('span');\n text.innerText = this.#landingPageTitle;\n div.appendChild(text);\n return div;\n }\n\n heightForItem(_parsedTraceIndex: number): number {\n console.assert(false, 'Should not be called');\n return 0;\n }\n\n isItemSelectable(_parsedTraceIndex: number): boolean {\n return true;\n }\n\n selectedItemChanged(_from: number|null, _to: number|null, fromElement: Element|null, toElement: Element|null): void {\n if (fromElement) {\n fromElement.classList.remove('selected');\n }\n if (toElement) {\n toElement.classList.add('selected');\n }\n }\n\n updateSelectedItemARIA(_fromElement: Element|null, _toElement: Element|null): boolean {\n return false;\n }\n\n private static instance: DropDown|null = null;\n}\n\nexport class ToolbarButton extends UI.Toolbar.ToolbarItem {\n private contentElement: HTMLElement;\n\n constructor(action: UI.ActionRegistration.Action) {\n const element = document.createElement('button');\n element.classList.add('history-dropdown-button');\n element.setAttribute('jslog', `${VisualLogging.dropDown('history')}`);\n super(element);\n this.contentElement = this.element.createChild('span', 'content');\n this.element.addEventListener('click', () => void action.execute(), false);\n this.setEnabled(action.enabled());\n action.addEventListener(UI.ActionRegistration.Events.ENABLED, event => this.setEnabled(event.data));\n this.setTitle(action.title());\n }\n\n setText(text: string): void {\n this.contentElement.textContent = text;\n }\n}\n"]} \ No newline at end of file +{"version":3,"file":"TimelineHistoryManager.js","sourceRoot":"","sources":["../../../../../../front_end/panels/timeline/TimelineHistoryManager.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,KAAK,MAAM,MAAM,6BAA6B,CAAC;AACtD,OAAO,KAAK,IAAI,MAAM,yBAAyB,CAAC;AAChD,OAAO,KAAK,QAAQ,MAAM,iCAAiC,CAAC;AAE5D,OAAO,KAAK,UAAU,MAAM,gDAAgD,CAA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,CAAC,CAAC;QAClC,MAAM,CAAC,gBAAgB,uDAAuC,KAAK,CAAC,EAAE,CAAC,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC;QACpG,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC;IAChC,CAAC;IAED,OAAO,CAAC,IAAY;QAClB,IAAI,CAAC,cAAc,CAAC,WAAW,GAAG,IAAI,CAAC;IACzC,CAAC;CACF","sourcesContent":["// Copyright 2017 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport * as Common from '../../core/common/common.js';\nimport * as i18n from '../../core/i18n/i18n.js';\nimport * as Platform from '../../core/platform/platform.js';\nimport type * as Trace from '../../models/trace/trace.js';\nimport * as IconButton from '../../ui/components/icon_button/icon_button.js';\nimport * as UI from '../../ui/legacy/legacy.js';\nimport * as VisualLogging from '../../ui/visual_logging/visual_logging.js';\n\nimport {\n type TimelineEventOverview,\n TimelineEventOverviewCPUActivity,\n TimelineEventOverviewNetwork,\n TimelineEventOverviewResponsiveness,\n} from './TimelineEventOverview.js';\nimport timelineHistoryManagerStyles from './timelineHistoryManager.css.js';\nimport type {TimelineMiniMap} from './TimelineMiniMap.js';\n\n/**\n * The dropdown works by returning an index which is the trace index; but we\n * also need a way to signify that the user picked the \"Landing Page\" option. We\n * represent that as Infinity so we never accidentally collide with an actual\n * trace (in reality a large number like 99 would probably suffice...)\n */\nexport const LANDING_PAGE_INDEX_DROPDOWN_CHOICE = Infinity;\n\nconst UIStrings = {\n /**\n *@description Screen reader label for the Timeline History dropdown button\n *@example {example.com #3} PH1\n *@example {Show recent timeline sessions} PH2\n */\n currentSessionSS: 'Current session: {PH1}. {PH2}',\n /**\n *@description the title shown when the user is viewing the landing page which is showing live performance metrics that are updated automatically.\n */\n landingPageTitle: 'Live metrics',\n /**\n * @description the title shown when the user is viewing the landing page which can be used to make a new performance recording.\n */\n nodeLandingPageTitle: 'New recording',\n /**\n *@description Text in Timeline History Manager of the Performance panel\n *@example {example.com} PH1\n *@example {2} PH2\n */\n sD: '{PH1} #{PH2}',\n /**\n *@description Accessible label for the timeline session selection menu\n */\n selectTimelineSession: 'Select timeline session',\n /**\n * @description Text label for a menu item indicating that a specific slowdown multiplier is applied.\n * @example {2} PH1\n */\n dSlowdown: '{PH1}× slowdown',\n};\nconst str_ = i18n.i18n.registerUIStrings('panels/timeline/TimelineHistoryManager.ts', UIStrings);\nconst i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);\n\n/**\n * The dropdown includes an option to navigate to the landing page; hence the\n * two types for storing recordings. The TimelineHistoryManager automatically\n * includes a link to go back to the landing page.\n */\ninterface TraceRecordingHistoryItem {\n type: 'TRACE_INDEX';\n // By storing only the index of this trace, the TimelinePanel can then look\n // up this trace's data (and metadata) via this index.\n parsedTraceIndex: number;\n}\ninterface LandingPageHistoryItem {\n type: 'LANDING_PAGE';\n}\nexport type RecordingData = TraceRecordingHistoryItem|LandingPageHistoryItem;\n\nexport interface NewHistoryRecordingData {\n // The data we will save to restore later.\n data: TraceRecordingHistoryItem;\n // We do not store this, but need it to build the thumbnail preview.\n filmStripForPreview: Trace.Extras.FilmStrip.Data|null;\n // Also not stored, but used to create the preview overview for a new trace.\n parsedTrace: Trace.Handlers.Types.ParsedTrace;\n metadata: Trace.Types.File.MetaData|null;\n}\n\n// Lazily instantiate the formatter as the constructor takes 50ms+\n// TODO: move me and others like me to i18n module\nconst listFormatter = (function defineFormatter() {\n let intlListFormat: Intl.ListFormat;\n return {\n format(...args: Parameters): ReturnType {\n if (!intlListFormat) {\n const opts: Intl.ListFormatOptions = {type: 'unit', style: 'short'};\n intlListFormat = new Intl.ListFormat(i18n.DevToolsLocale.DevToolsLocale.instance().locale, opts);\n }\n return intlListFormat.format(...args);\n },\n };\n})();\n\nexport class TimelineHistoryManager {\n private recordings: TraceRecordingHistoryItem[];\n private readonly action: UI.ActionRegistration.Action;\n private readonly nextNumberByDomain: Map;\n private readonly buttonInternal: ToolbarButton;\n private readonly allOverviews: {\n constructor: (parsedTrace: Trace.Handlers.Types.ParsedTrace) => TimelineEventOverview,\n height: number,\n }[];\n private totalHeight: number;\n private enabled: boolean;\n private lastActiveTrace: RecordingData|null = null;\n #minimapComponent?: TimelineMiniMap;\n #landingPageTitle: Common.UIString.LocalizedString;\n\n constructor(minimapComponent?: TimelineMiniMap, isNode?: boolean) {\n this.recordings = [];\n this.#minimapComponent = minimapComponent;\n this.action = UI.ActionRegistry.ActionRegistry.instance().getAction('timeline.show-history');\n this.nextNumberByDomain = new Map();\n this.buttonInternal = new ToolbarButton(this.action);\n\n this.#landingPageTitle =\n isNode ? i18nString(UIStrings.nodeLandingPageTitle) : i18nString(UIStrings.landingPageTitle);\n\n UI.ARIAUtils.markAsMenuButton(this.buttonInternal.element);\n this.clear();\n\n // Attempt to reuse the overviews coming from the panel's minimap\n // before creating new instances.\n this.allOverviews = [\n {\n\n constructor: parsedTrace => {\n const responsivenessOverviewFromMinimap =\n this.#minimapComponent?.getControls().find(\n control => control instanceof TimelineEventOverviewResponsiveness) as\n TimelineEventOverviewResponsiveness;\n return responsivenessOverviewFromMinimap || new TimelineEventOverviewResponsiveness(parsedTrace);\n },\n height: 3,\n },\n {\n constructor: parsedTrace => {\n const cpuOverviewFromMinimap =\n this.#minimapComponent?.getControls().find(\n control => control instanceof TimelineEventOverviewCPUActivity) as TimelineEventOverviewCPUActivity;\n if (cpuOverviewFromMinimap) {\n return cpuOverviewFromMinimap;\n }\n return new TimelineEventOverviewCPUActivity(parsedTrace);\n },\n height: 20,\n },\n {\n constructor: parsedTrace => {\n const networkOverviewFromMinimap =\n this.#minimapComponent?.getControls().find(control => control instanceof TimelineEventOverviewNetwork) as\n TimelineEventOverviewNetwork;\n return networkOverviewFromMinimap || new TimelineEventOverviewNetwork(parsedTrace);\n },\n height: 8,\n },\n ];\n this.totalHeight = this.allOverviews.reduce((acc, entry) => acc + entry.height, 0);\n this.enabled = true;\n }\n\n addRecording(newInput: NewHistoryRecordingData): void {\n const filmStrip = newInput.filmStripForPreview;\n this.lastActiveTrace = newInput.data;\n this.recordings.unshift(newInput.data);\n\n // Order is important: this needs to happen first because lots of the\n // subsequent code depends on us storing the preview data into the map.\n this.#buildAndStorePreviewData(newInput.data.parsedTraceIndex, newInput.parsedTrace, newInput.metadata, filmStrip);\n\n const modelTitle = this.title(newInput.data);\n this.buttonInternal.setText(modelTitle);\n const buttonTitle = this.action.title();\n UI.ARIAUtils.setLabel(\n this.buttonInternal.element, i18nString(UIStrings.currentSessionSS, {PH1: modelTitle, PH2: buttonTitle}));\n this.updateState();\n if (this.recordings.length <= maxRecordings) {\n return;\n }\n const modelUsedMoreTimeAgo =\n this.recordings.reduce((a, b) => lastUsedTime(a.parsedTraceIndex) < lastUsedTime(b.parsedTraceIndex) ? a : b);\n this.recordings.splice(this.recordings.indexOf(modelUsedMoreTimeAgo), 1);\n\n function lastUsedTime(index: number): number {\n const data = TimelineHistoryManager.dataForTraceIndex(index);\n if (!data) {\n throw new Error('Unable to find data for model');\n }\n return data.lastUsed;\n }\n }\n\n setEnabled(enabled: boolean): void {\n this.enabled = enabled;\n this.updateState();\n }\n\n button(): ToolbarButton {\n return this.buttonInternal;\n }\n\n clear(): void {\n this.recordings = [];\n this.lastActiveTrace = null;\n this.updateState();\n this.buttonInternal.setText(this.#landingPageTitle);\n this.nextNumberByDomain.clear();\n }\n\n #getActiveTraceIndexForListControl(): number {\n if (!this.lastActiveTrace) {\n return -1;\n }\n if (this.lastActiveTrace.type === 'LANDING_PAGE') {\n return LANDING_PAGE_INDEX_DROPDOWN_CHOICE;\n }\n return this.lastActiveTrace.parsedTraceIndex;\n }\n\n async showHistoryDropDown(): Promise {\n if (this.recordings.length < 1 || !this.enabled) {\n return null;\n }\n\n // DropDown.show() function finishes when the dropdown menu is closed via selection or losing focus\n const activeTraceIndex = await DropDown.show(\n this.recordings.map(recording => recording.parsedTraceIndex), this.#getActiveTraceIndexForListControl(),\n this.buttonInternal.element, this.#landingPageTitle);\n\n if (activeTraceIndex === null) {\n return null;\n }\n\n // The ListControl class that backs the dropdown uses indexes; we represent\n // the landing page choice via this special index.\n if (activeTraceIndex === LANDING_PAGE_INDEX_DROPDOWN_CHOICE) {\n this.#setActiveTrace({type: 'LANDING_PAGE'});\n return {type: 'LANDING_PAGE'};\n }\n\n const index = this.recordings.findIndex(recording => recording.parsedTraceIndex === activeTraceIndex);\n if (index < 0) {\n console.assert(false, 'selected recording not found');\n return null;\n }\n\n this.#setActiveTrace(this.recordings[index]);\n return this.recordings[index];\n }\n\n cancelIfShowing(): void {\n DropDown.cancelIfShowing();\n }\n\n /**\n * Navigate by 1 in either direction to the next trace.\n * Navigating in this way does not include the landing page; it will loop\n * over only the traces.\n */\n navigate(direction: number): TraceRecordingHistoryItem|null {\n if (!this.enabled || this.lastActiveTrace === null) {\n return null;\n }\n if (!this.lastActiveTrace || this.lastActiveTrace.type === 'LANDING_PAGE') {\n return null;\n }\n\n const index = this.recordings.findIndex(recording => {\n return this.lastActiveTrace?.type === 'TRACE_INDEX' && recording.type === 'TRACE_INDEX' &&\n recording.parsedTraceIndex === this.lastActiveTrace.parsedTraceIndex;\n });\n\n if (index < 0) {\n return null;\n }\n\n const newIndex = Platform.NumberUtilities.clamp(index + direction, 0, this.recordings.length - 1);\n this.#setActiveTrace(this.recordings[newIndex]);\n return this.recordings[newIndex];\n }\n\n navigateToLandingPage(): void {\n this.#setActiveTrace({type: 'LANDING_PAGE'});\n }\n\n #setActiveTrace(item: RecordingData): void {\n if (item.type === 'TRACE_INDEX') {\n const data = TimelineHistoryManager.dataForTraceIndex(item.parsedTraceIndex);\n if (!data) {\n throw new Error('Unable to find data for model');\n }\n data.lastUsed = Date.now();\n }\n\n this.lastActiveTrace = item;\n const modelTitle = this.title(item);\n const buttonTitle = this.action.title();\n this.buttonInternal.setText(modelTitle);\n UI.ARIAUtils.setLabel(\n this.buttonInternal.element, i18nString(UIStrings.currentSessionSS, {PH1: modelTitle, PH2: buttonTitle}));\n }\n\n private updateState(): void {\n this.action.setEnabled(this.recordings.length >= 1 && this.enabled);\n }\n\n static previewElement(parsedTraceIndex: number): Element {\n const data = TimelineHistoryManager.dataForTraceIndex(parsedTraceIndex);\n if (!data) {\n throw new Error('Unable to find data for model');\n }\n return data.preview;\n }\n\n private title(item: RecordingData): string {\n if (item.type === 'LANDING_PAGE') {\n return this.#landingPageTitle;\n }\n\n const data = TimelineHistoryManager.dataForTraceIndex(item.parsedTraceIndex);\n if (!data) {\n throw new Error('Unable to find data for model');\n }\n return data.title;\n }\n\n #buildAndStorePreviewData(\n parsedTraceIndex: number, parsedTrace: Trace.Handlers.Types.ParsedTrace, metadata: Trace.Types.File.MetaData|null,\n filmStrip: Trace.Extras.FilmStrip.Data|null): HTMLDivElement {\n const parsedURL = Common.ParsedURL.ParsedURL.fromString(parsedTrace.Meta.mainFrameURL);\n const domain = parsedURL ? parsedURL.host : '';\n\n const sequenceNumber = this.nextNumberByDomain.get(domain) || 1;\n const titleWithSequenceNumber = i18nString(UIStrings.sD, {PH1: domain, PH2: sequenceNumber});\n this.nextNumberByDomain.set(domain, sequenceNumber + 1);\n\n const preview = document.createElement('div');\n preview.classList.add('preview-item');\n preview.classList.add('vbox');\n preview.setAttribute('jslog', `${VisualLogging.dropDown('timeline.history-item').track({click: true})}`);\n preview.style.width = `${previewWidth}px`;\n const data = {\n preview,\n title: titleWithSequenceNumber,\n lastUsed: Date.now(),\n };\n parsedTraceIndexToPerformancePreviewData.set(parsedTraceIndex, data);\n\n preview.appendChild(this.#buildTextDetails(metadata, domain));\n const screenshotAndOverview = preview.createChild('div', 'hbox');\n screenshotAndOverview.appendChild(this.#buildScreenshotThumbnail(filmStrip));\n screenshotAndOverview.appendChild(this.#buildOverview(parsedTrace));\n return data.preview;\n }\n\n #buildTextDetails(metadata: Trace.Types.File.MetaData|null, title: string): Element {\n const container = document.createElement('div');\n container.classList.add('text-details');\n container.classList.add('hbox');\n const nameSpan = container.createChild('span', 'name');\n nameSpan.textContent = title;\n UI.ARIAUtils.setLabel(nameSpan, title);\n\n if (metadata) {\n const parts = [\n metadata.emulatedDeviceTitle,\n metadata.cpuThrottling ? i18nString(UIStrings.dSlowdown, {PH1: metadata.cpuThrottling}) : undefined,\n metadata.networkThrottling,\n ].filter(Boolean);\n container.createChild('span', 'metadata').textContent = listFormatter.format(parts as string[]);\n }\n\n return container;\n }\n\n #buildScreenshotThumbnail(filmStrip: Trace.Extras.FilmStrip.Data|null): Element {\n const container = document.createElement('div');\n container.classList.add('screenshot-thumb');\n const thumbnailAspectRatio = 3 / 2;\n container.style.width = this.totalHeight * thumbnailAspectRatio + 'px';\n container.style.height = this.totalHeight + 'px';\n if (!filmStrip) {\n return container;\n }\n const lastFrame = filmStrip.frames.at(-1);\n if (!lastFrame) {\n return container;\n }\n // TODO(paulirish): Adopt Util.ImageCache\n void UI.UIUtils.loadImage(lastFrame.screenshotEvent.args.dataUri).then(img => {\n if (img) {\n container.appendChild(img);\n }\n });\n return container;\n }\n\n #buildOverview(parsedTrace: Trace.Handlers.Types.ParsedTrace): Element {\n const container = document.createElement('div');\n const dPR = window.devicePixelRatio;\n container.style.width = previewWidth + 'px';\n container.style.height = this.totalHeight + 'px';\n const canvas = container.createChild('canvas');\n canvas.width = dPR * previewWidth;\n canvas.height = dPR * this.totalHeight;\n\n const ctx = canvas.getContext('2d');\n let yOffset = 0;\n\n for (const overview of this.allOverviews) {\n const timelineOverviewComponent = overview.constructor(parsedTrace);\n timelineOverviewComponent.update();\n if (ctx) {\n ctx.drawImage(\n timelineOverviewComponent.context().canvas, 0, yOffset, dPR * previewWidth, overview.height * dPR);\n }\n yOffset += overview.height * dPR;\n }\n return container;\n }\n\n private static dataForTraceIndex(index: number): PreviewData|null {\n return parsedTraceIndexToPerformancePreviewData.get(index) || null;\n }\n}\n\nexport const maxRecordings = 5;\nexport const previewWidth = 500;\n// The reason we store a global map is because the Dropdown component needs to\n// be able to read the preview data in order to show a preview in the dropdown.\nconst parsedTraceIndexToPerformancePreviewData = new Map();\n\nexport interface PreviewData {\n preview: Element;\n lastUsed: number;\n title: string;\n}\n\nexport class DropDown implements UI.ListControl.ListDelegate {\n private readonly glassPane: UI.GlassPane.GlassPane;\n private readonly listControl: UI.ListControl.ListControl;\n private readonly focusRestorer: UI.UIUtils.ElementFocusRestorer;\n private selectionDone: ((arg0: number|null) => void)|null;\n #landingPageTitle: Common.UIString.LocalizedString;\n\n constructor(availableparsedTraceIndexes: number[], landingPageTitle: Common.UIString.LocalizedString) {\n this.#landingPageTitle = landingPageTitle;\n\n this.glassPane = new UI.GlassPane.GlassPane();\n this.glassPane.setSizeBehavior(UI.GlassPane.SizeBehavior.MEASURE_CONTENT);\n this.glassPane.setOutsideClickCallback(() => this.close(null));\n this.glassPane.setPointerEventsBehavior(UI.GlassPane.PointerEventsBehavior.BLOCKED_BY_GLASS_PANE);\n this.glassPane.setAnchorBehavior(UI.GlassPane.AnchorBehavior.PREFER_BOTTOM);\n this.glassPane.element.addEventListener('blur', () => this.close(null));\n\n const shadowRoot = UI.UIUtils.createShadowRootWithCoreStyles(\n this.glassPane.contentElement, {cssFile: [timelineHistoryManagerStyles]});\n const contentElement = shadowRoot.createChild('div', 'drop-down');\n\n const listModel = new UI.ListModel.ListModel();\n this.listControl = new UI.ListControl.ListControl(listModel, this, UI.ListControl.ListMode.NonViewport);\n this.listControl.element.addEventListener('mousemove', this.onMouseMove.bind(this), false);\n listModel.replaceAll(availableparsedTraceIndexes);\n\n UI.ARIAUtils.markAsMenu(this.listControl.element);\n UI.ARIAUtils.setLabel(this.listControl.element, i18nString(UIStrings.selectTimelineSession));\n contentElement.appendChild(this.listControl.element);\n contentElement.addEventListener('keydown', this.onKeyDown.bind(this), false);\n contentElement.addEventListener('click', this.onClick.bind(this), false);\n\n this.focusRestorer = new UI.UIUtils.ElementFocusRestorer(this.listControl.element);\n this.selectionDone = null;\n }\n\n static show(\n availableparsedTraceIndexes: number[], activeparsedTraceIndex: number, anchor: Element,\n landingPageTitle: Common.UIString.LocalizedString = i18nString(UIStrings.landingPageTitle)):\n Promise {\n if (DropDown.instance) {\n return Promise.resolve(null);\n }\n const availableDropdownChoices = [...availableparsedTraceIndexes];\n availableDropdownChoices.unshift(LANDING_PAGE_INDEX_DROPDOWN_CHOICE);\n const instance = new DropDown(availableDropdownChoices, landingPageTitle);\n return instance.show(anchor, activeparsedTraceIndex);\n }\n\n static cancelIfShowing(): void {\n if (!DropDown.instance) {\n return;\n }\n DropDown.instance.close(null);\n }\n\n private show(anchor: Element, activeparsedTraceIndex: number): Promise {\n DropDown.instance = this;\n this.glassPane.setContentAnchorBox(anchor.boxInWindow());\n this.glassPane.show(this.glassPane.contentElement.ownerDocument);\n this.listControl.element.focus();\n this.listControl.selectItem(activeparsedTraceIndex);\n\n return new Promise(fulfill => {\n this.selectionDone = fulfill;\n });\n }\n\n private onMouseMove(event: Event): void {\n const node = (event.target as HTMLElement).enclosingNodeOrSelfWithClass('preview-item');\n const listItem = node && this.listControl.itemForNode(node);\n if (listItem === null) {\n return;\n }\n this.listControl.selectItem(listItem);\n }\n\n private onClick(event: Event): void {\n // TODO(crbug.com/1172300) Ignored during the jsdoc to ts migration\n // @ts-expect-error\n if (!(event.target).enclosingNodeOrSelfWithClass('preview-item')) {\n return;\n }\n this.close(this.listControl.selectedItem());\n }\n\n private onKeyDown(event: Event): void {\n switch ((event as KeyboardEvent).key) {\n case 'Tab':\n case 'Escape':\n this.close(null);\n break;\n case 'Enter':\n this.close(this.listControl.selectedItem());\n break;\n default:\n return;\n }\n event.consume(true);\n }\n\n private close(traceIndex: number|null): void {\n if (this.selectionDone) {\n this.selectionDone(traceIndex);\n }\n this.focusRestorer.restore();\n this.glassPane.hide();\n DropDown.instance = null;\n }\n\n createElementForItem(parsedTraceIndex: number): Element {\n if (parsedTraceIndex === LANDING_PAGE_INDEX_DROPDOWN_CHOICE) {\n return this.#createLandingPageListItem();\n }\n const element = TimelineHistoryManager.previewElement(parsedTraceIndex);\n UI.ARIAUtils.markAsMenuItem(element);\n element.classList.remove('selected');\n return element;\n }\n\n #createLandingPageListItem(): HTMLElement {\n const div = document.createElement('div');\n UI.ARIAUtils.markAsMenuItem(div);\n div.classList.remove('selected');\n div.classList.add('preview-item');\n div.classList.add('landing-page-item');\n\n div.style.width = `${previewWidth}px`;\n\n const icon = IconButton.Icon.create('arrow-back');\n div.appendChild(icon);\n\n const text = document.createElement('span');\n text.innerText = this.#landingPageTitle;\n div.appendChild(text);\n return div;\n }\n\n heightForItem(_parsedTraceIndex: number): number {\n console.assert(false, 'Should not be called');\n return 0;\n }\n\n isItemSelectable(_parsedTraceIndex: number): boolean {\n return true;\n }\n\n selectedItemChanged(_from: number|null, _to: number|null, fromElement: Element|null, toElement: Element|null): void {\n if (fromElement) {\n fromElement.classList.remove('selected');\n }\n if (toElement) {\n toElement.classList.add('selected');\n }\n }\n\n updateSelectedItemARIA(_fromElement: Element|null, _toElement: Element|null): boolean {\n return false;\n }\n\n private static instance: DropDown|null = null;\n}\n\nexport class ToolbarButton extends UI.Toolbar.ToolbarItem {\n private contentElement: HTMLElement;\n\n constructor(action: UI.ActionRegistration.Action) {\n const element = document.createElement('button');\n element.classList.add('history-dropdown-button');\n element.setAttribute('jslog', `${VisualLogging.dropDown('history')}`);\n super(element);\n this.contentElement = this.element.createChild('span', 'content');\n this.element.addEventListener('click', () => void action.execute(), false);\n this.setEnabled(action.enabled());\n action.addEventListener(UI.ActionRegistration.Events.ENABLED, event => this.setEnabled(event.data));\n this.setTitle(action.title());\n }\n\n setText(text: string): void {\n this.contentElement.textContent = text;\n }\n}\n"]} \ No newline at end of file diff --git a/public/panels/timeline/TimelineMiniMap.test.js b/public/panels/timeline/TimelineMiniMap.test.js index a25740bc4..aa36c998e 100644 --- a/public/panels/timeline/TimelineMiniMap.test.js +++ b/public/panels/timeline/TimelineMiniMap.test.js @@ -70,7 +70,7 @@ describeWithEnvironment('TimelineMiniMap', function () { if (!minimap.breadcrumbs) { throw new Error('The MiniMap unexpectedly did not create any breadcrumbs'); } - assert.strictEqual(TimelineComponents.Breadcrumbs.flattenBreadcrumbs(minimap.breadcrumbs.initialBreadcrumb).length, 1); + assert.lengthOf(TimelineComponents.Breadcrumbs.flattenBreadcrumbs(minimap.breadcrumbs.initialBreadcrumb), 1); assert.deepEqual(minimap.breadcrumbs.initialBreadcrumb, { window: parsedTrace.Meta.traceBounds, child: null }); }); it('stores breadcrumbs to be serialized', async function () { diff --git a/public/panels/timeline/TimelineMiniMap.test.js.map b/public/panels/timeline/TimelineMiniMap.test.js.map index 9e17d3c4c..e1278c194 100644 --- a/public/panels/timeline/TimelineMiniMap.test.js.map +++ b/public/panels/timeline/TimelineMiniMap.test.js.map @@ -1 +1 @@ -{"version":3,"file":"TimelineMiniMap.test.js","sourceRoot":"","sources":["../../../../../../front_end/panels/timeline/TimelineMiniMap.test.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,KAAK,KAAK,MAAM,6BAA6B,CAAC;AACrD,OAAO,EAAC,GAAG,EAAE,oBAAoB,EAAC,MAAM,6BAA6B,CAAC;AACtE,OAAO,EAAC,uBAAuB,EAAC,MAAM,qCAAqC,CAAC;AAC5E,OAAO,EAAC,WAAW,EAAC,MAAM,8BAA8B,CAAC;AAEzD,OAAO,KAAK,kBAAkB,MAAM,4BAA4B,CAAC;AACjE,OAAO,KAAK,QAAQ,MAAM,eAAe,CAAC;AAE1C,uBAAuB,CAAC,iBAAiB,EAAE;IACzC,EAAE,CAAC,iEAAiE,EAAE,KAAK;QACzE,MAAM,EAAC,WAAW,EAAC,GAAG,MAAM,WAAW,CAAC,WAAW,CAAC,IAAI,EAAE,iBAAiB,CAAC,CAAC;QAE7E,MAAM,SAAS,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;QAChD,oBAAoB,CAAC,SAAS,CAAC,CAAC;QAEhC,MAAM,OAAO,GAAG,IAAI,QAAQ,CA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E,KAAK,EAAE,OAAO,EAAC,EAAE,KAAK,EAAE,IAAI,EAAgC,CAAC,CAAC;IACtH,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["// Copyright 2023 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport * as Trace from '../../models/trace/trace.js';\nimport {raf, renderElementIntoDOM} from '../../testing/DOMHelpers.js';\nimport {describeWithEnvironment} from '../../testing/EnvironmentHelpers.js';\nimport {TraceLoader} from '../../testing/TraceLoader.js';\n\nimport * as TimelineComponents from './components/components.js';\nimport * as Timeline from './timeline.js';\n\ndescribeWithEnvironment('TimelineMiniMap', function() {\n it('always shows the responsiveness, CPU activity and network panel', async function() {\n const {parsedTrace} = await TraceLoader.traceEngine(this, 'web-dev.json.gz');\n\n const container = document.createElement('div');\n renderElementIntoDOM(container);\n\n const minimap = new Timeline.TimelineMiniMap.TimelineMiniMap();\n minimap.markAsRoot();\n minimap.show(container);\n\n minimap.setData({\n parsedTrace,\n settings: {\n showMemory: false,\n showScreenshots: false,\n },\n });\n\n await raf();\n assert.exists(container.querySelector('#timeline-overview-responsiveness'));\n assert.exists(container.querySelector('#timeline-overview-cpu-activity'));\n assert.exists(container.querySelector('#timeline-overview-network'));\n assert.isNull(container.querySelector('#timeline-overview-filmstrip'));\n assert.isNull(container.querySelector('#timeline-overview-memory'));\n minimap.detach();\n });\n\n it('will show the other panels if they are set to visible', async function() {\n const {parsedTrace} = await TraceLoader.traceEngine(this, 'web-dev.json.gz');\n\n const container = document.createElement('div');\n renderElementIntoDOM(container);\n\n const minimap = new Timeline.TimelineMiniMap.TimelineMiniMap();\n minimap.markAsRoot();\n minimap.show(container);\n\n minimap.setData({\n parsedTrace,\n settings: {\n showMemory: true,\n showScreenshots: true,\n },\n });\n\n await raf();\n assert.exists(container.querySelector('#timeline-overview-responsiveness'));\n assert.exists(container.querySelector('#timeline-overview-cpu-activity'));\n assert.exists(container.querySelector('#timeline-overview-network'));\n assert.exists(container.querySelector('#timeline-overview-filmstrip'));\n assert.exists(container.querySelector('#timeline-overview-memory'));\n minimap.detach();\n });\n\n it('creates the first breadcrumb', async function() {\n const {parsedTrace} = await TraceLoader.traceEngine(this, 'web-dev.json.gz');\n\n const container = document.createElement('div');\n renderElementIntoDOM(container);\n\n const minimap = new Timeline.TimelineMiniMap.TimelineMiniMap();\n minimap.markAsRoot();\n minimap.show(container);\n\n minimap.setData({\n parsedTrace,\n settings: {\n showMemory: true,\n showScreenshots: true,\n },\n });\n\n await raf();\n\n if (!minimap.breadcrumbs) {\n throw new Error('The MiniMap unexpectedly did not create any breadcrumbs');\n }\n\n assert.strictEqual(\n TimelineComponents.Breadcrumbs.flattenBreadcrumbs(minimap.breadcrumbs.initialBreadcrumb).length, 1);\n assert.deepEqual(minimap.breadcrumbs.initialBreadcrumb, {window: parsedTrace.Meta.traceBounds, child: null});\n });\n it('stores breadcrumbs to be serialized', async function() {\n const {parsedTrace} = await TraceLoader.traceEngine(this, 'web-dev.json.gz');\n const minimap = new Timeline.TimelineMiniMap.TimelineMiniMap();\n minimap.setData({\n parsedTrace,\n settings: {\n showMemory: true,\n showScreenshots: true,\n },\n });\n const entireTraceBounds = parsedTrace.Meta.traceBounds;\n const newBounds = {\n ...entireTraceBounds,\n min: Trace.Types.Timing.MicroSeconds((entireTraceBounds.max + entireTraceBounds.min) / 2),\n };\n minimap.breadcrumbs?.add(newBounds);\n const serializableModifications = Timeline.ModificationsManager.ModificationsManager.activeManager()?.toJSON();\n assert.deepEqual(\n serializableModifications?.initialBreadcrumb.child,\n {window: {min: 1020035455504, max: 1020036087961, range: 1264914}, child: null} as Trace.Types.File.Breadcrumb);\n });\n});\n"]} \ No newline at end of file +{"version":3,"file":"TimelineMiniMap.test.js","sourceRoot":"","sources":["../../../../../../front_end/panels/timeline/TimelineMiniMap.test.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,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Ae,EAAE,IAAI;aACtB;SACF,CAAC,CAAC;QACH,MAAM,iBAAiB,GAAG,WAAW,CAAC,IAAI,CAAC,WAAW,CAAC;QACvD,MAAM,SAAS,GAAG;YAChB,GAAG,iBAAiB;YACpB,GAAG,EAAE,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC,iBAAiB,CAAC,GAAG,GAAG,iBAAiB,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;SAC1F,CAAC;QACF,OAAO,CAAC,WAAW,EAAE,GAAG,CAAC,SAAS,CAAC,CAAC;QACpC,MAAM,yBAAyB,GAAG,QAAQ,CAAC,oBAAoB,CAAC,oBAAoB,CAAC,aAAa,EAAE,EAAE,MAAM,EAAE,CAAC;QAC/G,MAAM,CAAC,SAAS,CACZ,yBAAyB,EAAE,iBAAiB,CAAC,KAAK,EAClD,EAAC,MAAM,EAAE,EAAC,GAAG,EAAE,aAAa,EAAE,GAAG,EAAE,aAAa,EAAE,KAAK,EAAE,OAAO,EAAC,EAAE,KAAK,EAAE,IAAI,EAAgC,CAAC,CAAC;IACtH,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["// Copyright 2023 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport * as Trace from '../../models/trace/trace.js';\nimport {raf, renderElementIntoDOM} from '../../testing/DOMHelpers.js';\nimport {describeWithEnvironment} from '../../testing/EnvironmentHelpers.js';\nimport {TraceLoader} from '../../testing/TraceLoader.js';\n\nimport * as TimelineComponents from './components/components.js';\nimport * as Timeline from './timeline.js';\n\ndescribeWithEnvironment('TimelineMiniMap', function() {\n it('always shows the responsiveness, CPU activity and network panel', async function() {\n const {parsedTrace} = await TraceLoader.traceEngine(this, 'web-dev.json.gz');\n\n const container = document.createElement('div');\n renderElementIntoDOM(container);\n\n const minimap = new Timeline.TimelineMiniMap.TimelineMiniMap();\n minimap.markAsRoot();\n minimap.show(container);\n\n minimap.setData({\n parsedTrace,\n settings: {\n showMemory: false,\n showScreenshots: false,\n },\n });\n\n await raf();\n assert.exists(container.querySelector('#timeline-overview-responsiveness'));\n assert.exists(container.querySelector('#timeline-overview-cpu-activity'));\n assert.exists(container.querySelector('#timeline-overview-network'));\n assert.isNull(container.querySelector('#timeline-overview-filmstrip'));\n assert.isNull(container.querySelector('#timeline-overview-memory'));\n minimap.detach();\n });\n\n it('will show the other panels if they are set to visible', async function() {\n const {parsedTrace} = await TraceLoader.traceEngine(this, 'web-dev.json.gz');\n\n const container = document.createElement('div');\n renderElementIntoDOM(container);\n\n const minimap = new Timeline.TimelineMiniMap.TimelineMiniMap();\n minimap.markAsRoot();\n minimap.show(container);\n\n minimap.setData({\n parsedTrace,\n settings: {\n showMemory: true,\n showScreenshots: true,\n },\n });\n\n await raf();\n assert.exists(container.querySelector('#timeline-overview-responsiveness'));\n assert.exists(container.querySelector('#timeline-overview-cpu-activity'));\n assert.exists(container.querySelector('#timeline-overview-network'));\n assert.exists(container.querySelector('#timeline-overview-filmstrip'));\n assert.exists(container.querySelector('#timeline-overview-memory'));\n minimap.detach();\n });\n\n it('creates the first breadcrumb', async function() {\n const {parsedTrace} = await TraceLoader.traceEngine(this, 'web-dev.json.gz');\n\n const container = document.createElement('div');\n renderElementIntoDOM(container);\n\n const minimap = new Timeline.TimelineMiniMap.TimelineMiniMap();\n minimap.markAsRoot();\n minimap.show(container);\n\n minimap.setData({\n parsedTrace,\n settings: {\n showMemory: true,\n showScreenshots: true,\n },\n });\n\n await raf();\n\n if (!minimap.breadcrumbs) {\n throw new Error('The MiniMap unexpectedly did not create any breadcrumbs');\n }\n\n assert.lengthOf(TimelineComponents.Breadcrumbs.flattenBreadcrumbs(minimap.breadcrumbs.initialBreadcrumb), 1);\n assert.deepEqual(minimap.breadcrumbs.initialBreadcrumb, {window: parsedTrace.Meta.traceBounds, child: null});\n });\n it('stores breadcrumbs to be serialized', async function() {\n const {parsedTrace} = await TraceLoader.traceEngine(this, 'web-dev.json.gz');\n const minimap = new Timeline.TimelineMiniMap.TimelineMiniMap();\n minimap.setData({\n parsedTrace,\n settings: {\n showMemory: true,\n showScreenshots: true,\n },\n });\n const entireTraceBounds = parsedTrace.Meta.traceBounds;\n const newBounds = {\n ...entireTraceBounds,\n min: Trace.Types.Timing.MicroSeconds((entireTraceBounds.max + entireTraceBounds.min) / 2),\n };\n minimap.breadcrumbs?.add(newBounds);\n const serializableModifications = Timeline.ModificationsManager.ModificationsManager.activeManager()?.toJSON();\n assert.deepEqual(\n serializableModifications?.initialBreadcrumb.child,\n {window: {min: 1020035455504, max: 1020036087961, range: 1264914}, child: null} as Trace.Types.File.Breadcrumb);\n });\n});\n"]} \ No newline at end of file diff --git a/public/panels/timeline/TimelinePaintProfilerView.js.map b/public/panels/timeline/TimelinePaintProfilerView.js.map index 8fe116cff..c613ad6a0 100644 --- a/public/panels/timeline/TimelinePaintProfilerView.js.map +++ b/public/panels/timeline/TimelinePaintProfilerView.js.map @@ -1 +1 @@ -{"version":3,"file":"TimelinePaintProfilerView.js","sourceRoot":"","sources":["../../../../../../front_end/panels/timeline/TimelinePaintProfilerView.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,KAAK,GAAG,MAAM,uBAAuB,CAAC;AAE7C,OAAO,KAAK,aAAa,MAAM,+CAA+C,CAAC;AAC/E,OAAO,KAAK,KAAK,MAAM,6BAA6B,CAAC;AACrD,OAAO,KAAK,EAAE,MAAM,2BAA2B,CAAC;AAChD,OAAO,KAAK,WAAW,MAAM,iCAAiC,CAAC;AAE/D,OAAO,2BAA2B,MAAM,gCAAgC,CAAC;AAEzE,MAAM,OAAO,yBAA0B,SAAQ,EAAE,CAAC,WAAW,CAAC,WAAW;IACtD,sBAAsB,CAA6B;IACnD,SAAS,CAAyB;IAClC,iBAAiB,CAAkD;IACnE,WAAW,CAA4D;IAChF,sBAAsB,CAAU;IAChC,eAAe,CAA+C;IAC9D,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,CAAC;QAC3C,MAAM,GAAG,IAAI,eAAe,EAAE;aAChB,SAAS,CAAC,IAAI,CAAC,mBAAmB,CAAC,OAAO,EAAE,EAAE,IAAI,CAAC,mBAAmB,CAAC,OAAO,EAAE,CAAC;aACjF,QAAQ,CAAC,MAAM,CAAC,CAAC;QAC/B,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,eAAe,GAAG,MAAM,CAAC,QAAQ,EAAE,CAAC;IAChE,CAAC;IAED,SAAS,CAAC,QAAiB;QACzB,IAAI,CAAC,cAAc,CAAC,SAAS,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,CAAC;QAC1D,IAAI,QAAQ,EAAE,CAAC;YACb,IAAI,CAAC,YAAY,CAAC,GAAG,GAAG,QAAQ,CAAC;QACnC,CAAC;IACH,CAAC;IAED,OAAO,CAAC,aAAqC;QAC3C,IAAI,CAAC,aAAa,GAAG,aAAa,CAAC;QACnC,IAAI,CAAC,WAAW,CAAC,SAAS,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC,aAAa,CAAC,CAAC;IAC9D,CAAC;IACQ,QAAQ;QACf,KAAK,CAAC,QAAQ,EAAE,CAAC;QACjB,IAAI,CAAC,gBAAgB,CAAC,CAAC,2BAA2B,CAAC,CAAC,CAAC;IACvD,CAAC;CACF","sourcesContent":["// Copyright 2014 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport * as SDK from '../../core/sdk/sdk.js';\nimport type * as Protocol from '../../generated/protocol.js';\nimport * as TimelineModel from '../../models/timeline_model/timeline_model.js';\nimport * as Trace from '../../models/trace/trace.js';\nimport * as UI from '../../ui/legacy/legacy.js';\nimport * as LayerViewer from '../layer_viewer/layer_viewer.js';\n\nimport timelinePaintProfilerStyles from './timelinePaintProfiler.css.js';\n\nexport class TimelinePaintProfilerView extends UI.SplitWidget.SplitWidget {\n private readonly logAndImageSplitWidget: UI.SplitWidget.SplitWidget;\n private readonly imageView: TimelinePaintImageView;\n private readonly paintProfilerView: LayerViewer.PaintProfilerView.PaintProfilerView;\n private readonly logTreeView: LayerViewer.PaintProfilerView.PaintProfilerCommandLogView;\n private needsUpdateWhenVisible: boolean;\n private pendingSnapshot: SDK.PaintProfiler.PaintProfilerSnapshot|null;\n private event: Trace.Types.Events.Event|null;\n private paintProfilerModel: SDK.PaintProfiler.PaintProfilerModel|null;\n private lastLoadedSnapshot: SDK.PaintProfiler.PaintProfilerSnapshot|null;\n #parsedTrace: Trace.Handlers.Types.ParsedTrace;\n\n constructor(parsedTrace: Trace.Handlers.Types.ParsedTrace) {\n super(false, false);\n this.element.classList.add('timeline-paint-profiler-view');\n this.setSidebarSize(60);\n this.setResizable(false);\n\n this.#parsedTrace = parsedTrace;\n\n this.logAndImageSplitWidget = new UI.SplitWidget.SplitWidget(true, false);\n this.logAndImageSplitWidget.element.classList.add('timeline-paint-profiler-log-split');\n this.setMainWidget(this.logAndImageSplitWidget);\n this.imageView = new TimelinePaintImageView();\n this.logAndImageSplitWidget.setMainWidget(this.imageView);\n\n this.paintProfilerView =\n new LayerViewer.PaintProfilerView.PaintProfilerView(this.imageView.showImage.bind(this.imageView));\n this.paintProfilerView.addEventListener(\n LayerViewer.PaintProfilerView.Events.WINDOW_CHANGED, this.onWindowChanged, this);\n this.setSidebarWidget(this.paintProfilerView);\n\n this.logTreeView = new LayerViewer.PaintProfilerView.PaintProfilerCommandLogView();\n this.logAndImageSplitWidget.setSidebarWidget(this.logTreeView);\n\n this.needsUpdateWhenVisible = false;\n this.pendingSnapshot = null;\n this.event = null;\n this.paintProfilerModel = null;\n this.lastLoadedSnapshot = null;\n }\n\n override wasShown(): void {\n super.wasShown();\n if (this.needsUpdateWhenVisible) {\n this.needsUpdateWhenVisible = false;\n this.update();\n }\n }\n\n setSnapshot(snapshot: SDK.PaintProfiler.PaintProfilerSnapshot): void {\n this.releaseSnapshot();\n this.pendingSnapshot = snapshot;\n this.event = null;\n this.updateWhenVisible();\n }\n\n #rasterEventHasTile(event: Trace.Types.Events.RasterTask): boolean {\n const data = event.args.tileData;\n if (!data) {\n return false;\n }\n\n const frame = this.#parsedTrace.Frames.framesById[data.sourceFrameNumber];\n if (!frame || !frame.layerTree) {\n return false;\n }\n return true;\n }\n\n setEvent(paintProfilerModel: SDK.PaintProfiler.PaintProfilerModel, event: Trace.Types.Events.Event): boolean {\n this.releaseSnapshot();\n this.paintProfilerModel = paintProfilerModel;\n this.pendingSnapshot = null;\n this.event = event;\n\n this.updateWhenVisible();\n if (Trace.Types.Events.isPaint(event)) {\n const snapshot = this.#parsedTrace.LayerTree.paintsToSnapshots.get(event);\n return Boolean(snapshot);\n }\n if (Trace.Types.Events.isRasterTask(event)) {\n return this.#rasterEventHasTile(event);\n }\n return false;\n }\n\n private updateWhenVisible(): void {\n if (this.isShowing()) {\n this.update();\n } else {\n this.needsUpdateWhenVisible = true;\n }\n }\n\n async #rasterTilePromise(rasterEvent: Trace.Types.Events.RasterTask): Promise<{\n rect: Protocol.DOM.Rect,\n snapshot: SDK.PaintProfiler.PaintProfilerSnapshot,\n }|null> {\n const data = rasterEvent.args.tileData;\n if (!data) {\n return null;\n }\n\n if (!data.tileId.id_ref) {\n return null;\n }\n\n const target = SDK.TargetManager.TargetManager.instance().rootTarget();\n if (!target) {\n return null;\n }\n\n const frame = this.#parsedTrace.Frames.framesById[data.sourceFrameNumber];\n if (!frame || !frame.layerTree) {\n return null;\n }\n\n const layerTree = new TimelineModel.TracingLayerTree.TracingFrameLayerTree(\n target,\n frame.layerTree,\n );\n const tracingLayerTree = await layerTree.layerTreePromise();\n return tracingLayerTree ? tracingLayerTree.pictureForRasterTile(data.tileId.id_ref) : null;\n }\n\n override update(): void {\n this.logTreeView.setCommandLog([]);\n void this.paintProfilerView.setSnapshotAndLog(null, [], null);\n\n let snapshotPromise: Promise<{\n rect: Protocol.DOM.Rect | null,\n snapshot: SDK.PaintProfiler.PaintProfilerSnapshot,\n }|null>;\n if (this.pendingSnapshot) {\n snapshotPromise = Promise.resolve({rect: null, snapshot: this.pendingSnapshot});\n } else if (this.event && this.paintProfilerModel && Trace.Types.Events.isPaint(this.event)) {\n // When we process events (TimelineModel#processEvent) and find a\n // snapshot event, we look for the last paint that occurred and link the\n // snapshot to that paint event. That is why here if the event is a Paint\n // event, we look to see if it has had a matching picture event set for\n // it.\n const snapshotEvent = this.#parsedTrace.LayerTree.paintsToSnapshots.get(this.event);\n if (snapshotEvent) {\n const encodedData = snapshotEvent.args.snapshot.skp64;\n snapshotPromise = this.paintProfilerModel.loadSnapshot(encodedData).then(snapshot => {\n return snapshot && {rect: null, snapshot};\n });\n } else {\n snapshotPromise = Promise.resolve(null);\n }\n\n } else if (this.event && Trace.Types.Events.isRasterTask(this.event)) {\n snapshotPromise = this.#rasterTilePromise(this.event);\n } else {\n console.assert(false, 'Unexpected event type or no snapshot');\n return;\n }\n void snapshotPromise.then(snapshotWithRect => {\n this.releaseSnapshot();\n if (!snapshotWithRect) {\n this.imageView.showImage();\n return;\n }\n const snapshot = snapshotWithRect.snapshot;\n this.lastLoadedSnapshot = snapshot;\n this.imageView.setMask(snapshotWithRect.rect);\n void snapshot.commandLog().then(log => onCommandLogDone.call(this, snapshot, snapshotWithRect.rect, log || []));\n });\n\n function onCommandLogDone(\n this: TimelinePaintProfilerView, snapshot: SDK.PaintProfiler.PaintProfilerSnapshot,\n clipRect: Protocol.DOM.Rect|null, log?: SDK.PaintProfiler.PaintProfilerLogItem[]): void {\n this.logTreeView.setCommandLog(log || []);\n void this.paintProfilerView.setSnapshotAndLog(snapshot, log || [], clipRect);\n }\n }\n\n private releaseSnapshot(): void {\n if (!this.lastLoadedSnapshot) {\n return;\n }\n this.lastLoadedSnapshot.release();\n this.lastLoadedSnapshot = null;\n }\n\n private onWindowChanged(): void {\n this.logTreeView.updateWindow(this.paintProfilerView.selectionWindow());\n }\n}\n\nexport class TimelinePaintImageView extends UI.Widget.Widget {\n private imageContainer: HTMLElement;\n private imageElement: HTMLImageElement;\n private readonly maskElement: HTMLElement;\n private transformController: LayerViewer.TransformController.TransformController;\n private maskRectangle?: Protocol.DOM.Rect|null;\n constructor() {\n super(true);\n\n this.contentElement.classList.add('fill', 'paint-profiler-image-view');\n this.imageContainer = this.contentElement.createChild('div', 'paint-profiler-image-container');\n this.imageElement = (this.imageContainer.createChild('img') as HTMLImageElement);\n this.maskElement = this.imageContainer.createChild('div');\n this.imageElement.addEventListener('load', this.updateImagePosition.bind(this), false);\n this.transformController =\n new LayerViewer.TransformController.TransformController((this.contentElement as HTMLElement), true);\n this.transformController.addEventListener(\n LayerViewer.TransformController.Events.TRANSFORM_CHANGED, this.updateImagePosition, this);\n }\n\n override onResize(): void {\n if (this.imageElement.src) {\n this.updateImagePosition();\n }\n }\n\n private updateImagePosition(): void {\n const width = this.imageElement.naturalWidth;\n const height = this.imageElement.naturalHeight;\n const clientWidth = this.contentElement.clientWidth;\n const clientHeight = this.contentElement.clientHeight;\n\n const paddingFraction = 0.1;\n const paddingX = clientWidth * paddingFraction;\n const paddingY = clientHeight * paddingFraction;\n const scaleX = (clientWidth - paddingX) / width;\n const scaleY = (clientHeight - paddingY) / height;\n const scale = Math.min(scaleX, scaleY);\n\n if (this.maskRectangle) {\n const style = this.maskElement.style;\n style.width = width + 'px';\n style.height = height + 'px';\n style.borderLeftWidth = this.maskRectangle.x + 'px';\n style.borderTopWidth = this.maskRectangle.y + 'px';\n style.borderRightWidth = (width - this.maskRectangle.x - this.maskRectangle.width) + 'px';\n style.borderBottomWidth = (height - this.maskRectangle.y - this.maskRectangle.height) + 'px';\n }\n this.transformController.setScaleConstraints(0.5, 10 / scale);\n let matrix = new WebKitCSSMatrix()\n .scale(this.transformController.scale(), this.transformController.scale())\n .translate(clientWidth / 2, clientHeight / 2)\n .scale(scale, scale)\n .translate(-width / 2, -height / 2);\n const bounds = UI.Geometry.boundsForTransformedPoints(matrix, [0, 0, 0, width, height, 0]);\n this.transformController.clampOffsets(\n paddingX - bounds.maxX, clientWidth - paddingX - bounds.minX, paddingY - bounds.maxY,\n clientHeight - paddingY - bounds.minY);\n matrix = new WebKitCSSMatrix()\n .translate(this.transformController.offsetX(), this.transformController.offsetY())\n .multiply(matrix);\n this.imageContainer.style.webkitTransform = matrix.toString();\n }\n\n showImage(imageURL?: string): void {\n this.imageContainer.classList.toggle('hidden', !imageURL);\n if (imageURL) {\n this.imageElement.src = imageURL;\n }\n }\n\n setMask(maskRectangle: Protocol.DOM.Rect|null): void {\n this.maskRectangle = maskRectangle;\n this.maskElement.classList.toggle('hidden', !maskRectangle);\n }\n override wasShown(): void {\n super.wasShown();\n this.registerCSSFiles([timelinePaintProfilerStyles]);\n }\n}\n"]} \ No newline at end of file +{"version":3,"file":"TimelinePaintProfilerView.js","sourceRoot":"","sources":["../../../../../../front_end/panels/timeline/TimelinePaintProfilerView.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,KAAK,GAAG,MAAM,uBAAuB,CAAC;AAE7C,OAAO,KAAK,aAAa,MAAM,+CAA+C,CAAC;AAC/E,OAAO,KAAK,KAAK,MAAM,6BAA6B,CAAC;AACrD,OAAO,KAAK,EAAE,MAAM,2BAA2B,CAAC;AAChD,OAAO,KAAK,WAAW,MAAM,iCAAiC,CAAC;AAE/D,OAAO,2BAA2B,MAAM,gCAAgC,CAAC;AAEzE,MAAM,OAAO,yBAA0B,SAAQ,EAAE,CAAC,WAAW,CAAC,WAAW;IACtD,sBAAsB,CAA6B;IACnD,SAAS,CAAyB;IAClC,iBAAiB,CAAkD;IACnE,WAAW,CAA4D;IAChF,sBAAsB,CAAU;IAChC,eAAe,CAA+C;IAC9D,KAAK,CAAgC;IACrC,kBAAkB,CAA4C;IAC9D,kBAAkB,CAA+C;IACzE,YAAY,CAAmC;IAE/C,YAAY,WAA6C;QACvD,KAAK,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;QACpB,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,GAAG,CAAC,8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,CAAC,cAAc,CAAC,KAAK,CAAC,eAAe,GAAG,MAAM,CAAC,QAAQ,EAAE,CAAC;IAChE,CAAC;IAED,SAAS,CAAC,QAAiB;QACzB,IAAI,CAAC,cAAc,CAAC,SAAS,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,CAAC;QAC1D,IAAI,QAAQ,EAAE,CAAC;YACb,IAAI,CAAC,YAAY,CAAC,GAAG,GAAG,QAAQ,CAAC;QACnC,CAAC;IACH,CAAC;IAED,OAAO,CAAC,aAAqC;QAC3C,IAAI,CAAC,aAAa,GAAG,aAAa,CAAC;QACnC,IAAI,CAAC,WAAW,CAAC,SAAS,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC,aAAa,CAAC,CAAC;IAC9D,CAAC;IACQ,QAAQ;QACf,KAAK,CAAC,QAAQ,EAAE,CAAC;QACjB,IAAI,CAAC,gBAAgB,CAAC,CAAC,2BAA2B,CAAC,CAAC,CAAC;IACvD,CAAC;CACF","sourcesContent":["// Copyright 2014 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport * as SDK from '../../core/sdk/sdk.js';\nimport type * as Protocol from '../../generated/protocol.js';\nimport * as TimelineModel from '../../models/timeline_model/timeline_model.js';\nimport * as Trace from '../../models/trace/trace.js';\nimport * as UI from '../../ui/legacy/legacy.js';\nimport * as LayerViewer from '../layer_viewer/layer_viewer.js';\n\nimport timelinePaintProfilerStyles from './timelinePaintProfiler.css.js';\n\nexport class TimelinePaintProfilerView extends UI.SplitWidget.SplitWidget {\n private readonly logAndImageSplitWidget: UI.SplitWidget.SplitWidget;\n private readonly imageView: TimelinePaintImageView;\n private readonly paintProfilerView: LayerViewer.PaintProfilerView.PaintProfilerView;\n private readonly logTreeView: LayerViewer.PaintProfilerView.PaintProfilerCommandLogView;\n private needsUpdateWhenVisible: boolean;\n private pendingSnapshot: SDK.PaintProfiler.PaintProfilerSnapshot|null;\n private event: Trace.Types.Events.Event|null;\n private paintProfilerModel: SDK.PaintProfiler.PaintProfilerModel|null;\n private lastLoadedSnapshot: SDK.PaintProfiler.PaintProfilerSnapshot|null;\n #parsedTrace: Trace.Handlers.Types.ParsedTrace;\n\n constructor(parsedTrace: Trace.Handlers.Types.ParsedTrace) {\n super(false, false);\n this.element.classList.add('timeline-paint-profiler-view');\n this.setSidebarSize(60);\n this.setResizable(false);\n\n this.#parsedTrace = parsedTrace;\n\n this.logAndImageSplitWidget = new UI.SplitWidget.SplitWidget(true, false);\n this.logAndImageSplitWidget.element.classList.add('timeline-paint-profiler-log-split');\n this.setMainWidget(this.logAndImageSplitWidget);\n this.imageView = new TimelinePaintImageView();\n this.logAndImageSplitWidget.setMainWidget(this.imageView);\n\n this.paintProfilerView =\n new LayerViewer.PaintProfilerView.PaintProfilerView(this.imageView.showImage.bind(this.imageView));\n this.paintProfilerView.addEventListener(\n LayerViewer.PaintProfilerView.Events.WINDOW_CHANGED, this.onWindowChanged, this);\n this.setSidebarWidget(this.paintProfilerView);\n\n this.logTreeView = new LayerViewer.PaintProfilerView.PaintProfilerCommandLogView();\n this.logAndImageSplitWidget.setSidebarWidget(this.logTreeView);\n\n this.needsUpdateWhenVisible = false;\n this.pendingSnapshot = null;\n this.event = null;\n this.paintProfilerModel = null;\n this.lastLoadedSnapshot = null;\n }\n\n override wasShown(): void {\n super.wasShown();\n if (this.needsUpdateWhenVisible) {\n this.needsUpdateWhenVisible = false;\n this.update();\n }\n }\n\n setSnapshot(snapshot: SDK.PaintProfiler.PaintProfilerSnapshot): void {\n this.releaseSnapshot();\n this.pendingSnapshot = snapshot;\n this.event = null;\n this.updateWhenVisible();\n }\n\n #rasterEventHasTile(event: Trace.Types.Events.RasterTask): boolean {\n const data = event.args.tileData;\n if (!data) {\n return false;\n }\n\n const frame = this.#parsedTrace.Frames.framesById[data.sourceFrameNumber];\n if (!frame || !frame.layerTree) {\n return false;\n }\n return true;\n }\n\n setEvent(paintProfilerModel: SDK.PaintProfiler.PaintProfilerModel, event: Trace.Types.Events.Event): boolean {\n this.releaseSnapshot();\n this.paintProfilerModel = paintProfilerModel;\n this.pendingSnapshot = null;\n this.event = event;\n\n this.updateWhenVisible();\n if (Trace.Types.Events.isPaint(event)) {\n const snapshot = this.#parsedTrace.LayerTree.paintsToSnapshots.get(event);\n return Boolean(snapshot);\n }\n if (Trace.Types.Events.isRasterTask(event)) {\n return this.#rasterEventHasTile(event);\n }\n return false;\n }\n\n private updateWhenVisible(): void {\n if (this.isShowing()) {\n this.update();\n } else {\n this.needsUpdateWhenVisible = true;\n }\n }\n\n async #rasterTilePromise(rasterEvent: Trace.Types.Events.RasterTask): Promise<{\n rect: Protocol.DOM.Rect,\n snapshot: SDK.PaintProfiler.PaintProfilerSnapshot,\n }|null> {\n const data = rasterEvent.args.tileData;\n if (!data) {\n return null;\n }\n\n if (!data.tileId.id_ref) {\n return null;\n }\n\n const target = SDK.TargetManager.TargetManager.instance().rootTarget();\n if (!target) {\n return null;\n }\n\n const frame = this.#parsedTrace.Frames.framesById[data.sourceFrameNumber];\n if (!frame || !frame.layerTree) {\n return null;\n }\n\n const layerTree = new TimelineModel.TracingLayerTree.TracingFrameLayerTree(\n target,\n frame.layerTree,\n );\n const tracingLayerTree = await layerTree.layerTreePromise();\n return tracingLayerTree ? tracingLayerTree.pictureForRasterTile(data.tileId.id_ref) : null;\n }\n\n override update(): void {\n this.logTreeView.setCommandLog([]);\n void this.paintProfilerView.setSnapshotAndLog(null, [], null);\n\n let snapshotPromise: Promise<{\n rect: Protocol.DOM.Rect | null,\n snapshot: SDK.PaintProfiler.PaintProfilerSnapshot,\n }|null>;\n if (this.pendingSnapshot) {\n snapshotPromise = Promise.resolve({rect: null, snapshot: this.pendingSnapshot});\n } else if (this.event && this.paintProfilerModel && Trace.Types.Events.isPaint(this.event)) {\n // When we process events (TimelineModel#processEvent) and find a\n // snapshot event, we look for the last paint that occurred and link the\n // snapshot to that paint event. That is why here if the event is a Paint\n // event, we look to see if it has had a matching picture event set for\n // it.\n const snapshotEvent = this.#parsedTrace.LayerTree.paintsToSnapshots.get(this.event);\n if (snapshotEvent) {\n const encodedData = snapshotEvent.args.snapshot.skp64;\n snapshotPromise = this.paintProfilerModel.loadSnapshot(encodedData).then(snapshot => {\n return snapshot && {rect: null, snapshot};\n });\n } else {\n snapshotPromise = Promise.resolve(null);\n }\n\n } else if (this.event && Trace.Types.Events.isRasterTask(this.event)) {\n snapshotPromise = this.#rasterTilePromise(this.event);\n } else {\n console.assert(false, 'Unexpected event type or no snapshot');\n return;\n }\n void snapshotPromise.then(snapshotWithRect => {\n this.releaseSnapshot();\n if (!snapshotWithRect) {\n this.imageView.showImage();\n return;\n }\n const snapshot = snapshotWithRect.snapshot;\n this.lastLoadedSnapshot = snapshot;\n this.imageView.setMask(snapshotWithRect.rect);\n void snapshot.commandLog().then(log => onCommandLogDone.call(this, snapshot, snapshotWithRect.rect, log || []));\n });\n\n function onCommandLogDone(\n this: TimelinePaintProfilerView, snapshot: SDK.PaintProfiler.PaintProfilerSnapshot,\n clipRect: Protocol.DOM.Rect|null, log?: SDK.PaintProfiler.PaintProfilerLogItem[]): void {\n this.logTreeView.setCommandLog(log || []);\n void this.paintProfilerView.setSnapshotAndLog(snapshot, log || [], clipRect);\n }\n }\n\n private releaseSnapshot(): void {\n if (!this.lastLoadedSnapshot) {\n return;\n }\n this.lastLoadedSnapshot.release();\n this.lastLoadedSnapshot = null;\n }\n\n private onWindowChanged(): void {\n this.logTreeView.updateWindow(this.paintProfilerView.selectionWindow());\n }\n}\n\nexport class TimelinePaintImageView extends UI.Widget.Widget {\n private imageContainer: HTMLElement;\n private imageElement: HTMLImageElement;\n private readonly maskElement: HTMLElement;\n private transformController: LayerViewer.TransformController.TransformController;\n private maskRectangle?: Protocol.DOM.Rect|null;\n constructor() {\n super(true);\n\n this.contentElement.classList.add('fill', 'paint-profiler-image-view');\n this.imageContainer = this.contentElement.createChild('div', 'paint-profiler-image-container');\n this.imageElement = this.imageContainer.createChild('img');\n this.maskElement = this.imageContainer.createChild('div');\n this.imageElement.addEventListener('load', this.updateImagePosition.bind(this), false);\n this.transformController =\n new LayerViewer.TransformController.TransformController((this.contentElement as HTMLElement), true);\n this.transformController.addEventListener(\n LayerViewer.TransformController.Events.TRANSFORM_CHANGED, this.updateImagePosition, this);\n }\n\n override onResize(): void {\n if (this.imageElement.src) {\n this.updateImagePosition();\n }\n }\n\n private updateImagePosition(): void {\n const width = this.imageElement.naturalWidth;\n const height = this.imageElement.naturalHeight;\n const clientWidth = this.contentElement.clientWidth;\n const clientHeight = this.contentElement.clientHeight;\n\n const paddingFraction = 0.1;\n const paddingX = clientWidth * paddingFraction;\n const paddingY = clientHeight * paddingFraction;\n const scaleX = (clientWidth - paddingX) / width;\n const scaleY = (clientHeight - paddingY) / height;\n const scale = Math.min(scaleX, scaleY);\n\n if (this.maskRectangle) {\n const style = this.maskElement.style;\n style.width = width + 'px';\n style.height = height + 'px';\n style.borderLeftWidth = this.maskRectangle.x + 'px';\n style.borderTopWidth = this.maskRectangle.y + 'px';\n style.borderRightWidth = (width - this.maskRectangle.x - this.maskRectangle.width) + 'px';\n style.borderBottomWidth = (height - this.maskRectangle.y - this.maskRectangle.height) + 'px';\n }\n this.transformController.setScaleConstraints(0.5, 10 / scale);\n let matrix = new WebKitCSSMatrix()\n .scale(this.transformController.scale(), this.transformController.scale())\n .translate(clientWidth / 2, clientHeight / 2)\n .scale(scale, scale)\n .translate(-width / 2, -height / 2);\n const bounds = UI.Geometry.boundsForTransformedPoints(matrix, [0, 0, 0, width, height, 0]);\n this.transformController.clampOffsets(\n paddingX - bounds.maxX, clientWidth - paddingX - bounds.minX, paddingY - bounds.maxY,\n clientHeight - paddingY - bounds.minY);\n matrix = new WebKitCSSMatrix()\n .translate(this.transformController.offsetX(), this.transformController.offsetY())\n .multiply(matrix);\n this.imageContainer.style.webkitTransform = matrix.toString();\n }\n\n showImage(imageURL?: string): void {\n this.imageContainer.classList.toggle('hidden', !imageURL);\n if (imageURL) {\n this.imageElement.src = imageURL;\n }\n }\n\n setMask(maskRectangle: Protocol.DOM.Rect|null): void {\n this.maskRectangle = maskRectangle;\n this.maskElement.classList.toggle('hidden', !maskRectangle);\n }\n override wasShown(): void {\n super.wasShown();\n this.registerCSSFiles([timelinePaintProfilerStyles]);\n }\n}\n"]} \ No newline at end of file diff --git a/public/panels/timeline/TimelinePanel.js b/public/panels/timeline/TimelinePanel.js index 64e70942f..0c342d28d 100644 --- a/public/panels/timeline/TimelinePanel.js +++ b/public/panels/timeline/TimelinePanel.js @@ -430,8 +430,8 @@ export class TimelinePanel extends UI.Panel.Panel { * Navigation radio buttons located in the shortcuts dialog. */ #navigationRadioButtons = document.createElement('form'); - #modernNavRadioButton = UI.UIUtils.createRadioLabel('flamechart-selected-navigation', 'Modern'); - #classicNavRadioButton = UI.UIUtils.createRadioLabel('flamechart-selected-navigation', 'Classic'); + #modernNavRadioButton = UI.UIUtils.createRadioButton('flamechart-selected-navigation', 'Modern', 'timeline.select-modern-navigation'); + #classicNavRadioButton = UI.UIUtils.createRadioButton('flamechart-selected-navigation', 'Classic', 'timeline.select-classic-navigation'); #onMainEntryHovered; constructor() { super('timeline'); @@ -998,29 +998,27 @@ export class TimelinePanel extends UI.Panel.Panel { this.#navigationRadioButtons.classList.add('nav-radio-buttons'); UI.ARIAUtils.markAsRadioGroup(this.#navigationRadioButtons); // Change EventListener is only triggered when the radio button is selected - this.#modernNavRadioButton.radioElement.addEventListener('change', () => { + this.#modernNavRadioButton.radio.addEventListener('change', () => { this.#shortcutsDialog.data = { shortcuts: this.#getShortcutsInfo(/* isNavClassic */ false) }; Common.Settings.moduleSetting('flamechart-selected-navigation').set('modern'); }); - this.#classicNavRadioButton.radioElement.addEventListener('change', () => { + this.#classicNavRadioButton.radio.addEventListener('change', () => { this.#shortcutsDialog.data = { shortcuts: this.#getShortcutsInfo(/* isNavClassic */ true) }; Common.Settings.moduleSetting('flamechart-selected-navigation').set('classic'); }); - this.#navigationRadioButtons.appendChild(this.#modernNavRadioButton); - this.#modernNavRadioButton.setAttribute('jslog', `${VisualLogging.action().track({ click: true }).context('timeline.select-modern-navigation')}`); - this.#navigationRadioButtons.appendChild(this.#classicNavRadioButton); - this.#classicNavRadioButton.setAttribute('jslog', `${VisualLogging.action().track({ click: true }).context('timeline.select-classic-navigation')}`); + this.#navigationRadioButtons.appendChild(this.#modernNavRadioButton.label); + this.#navigationRadioButtons.appendChild(this.#classicNavRadioButton.label); this.#userHadShortcutsDialogOpenedOnce.set(true); return this.#navigationRadioButtons; } #updateNavigationSettingSelection() { const currentNavSetting = Common.Settings.moduleSetting('flamechart-selected-navigation').get(); if (currentNavSetting === 'classic') { - this.#classicNavRadioButton.radioElement.checked = true; + this.#classicNavRadioButton.radio.checked = true; Host.userMetrics.navigationSettingAtFirstTimelineLoad(2 /* Host.UserMetrics.TimelineNavigationSetting.SWITCHED_TO_CLASSIC */); } else if (currentNavSetting === 'modern') { - this.#modernNavRadioButton.radioElement.checked = true; + this.#modernNavRadioButton.radio.checked = true; Host.userMetrics.navigationSettingAtFirstTimelineLoad(3 /* Host.UserMetrics.TimelineNavigationSetting.SWITCHED_TO_MODERN */); } } diff --git a/public/panels/timeline/TimelinePanel.js.map b/public/panels/timeline/TimelinePanel.js.map index 67fb1dbc3..808d8f321 100644 --- a/public/panels/timeline/TimelinePanel.js.map +++ b/public/panels/timeline/TimelinePanel.js.map @@ -1 +1 @@ -{"version":3,"file":"TimelinePanel.js","sourceRoot":"","sources":["../../../../../../front_end/panels/timeline/TimelinePanel.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAEH,OAAO,KAAK,MAAM,MAAM,6BAA6B,CAAC;AACtD,OAAO,KAAK,IAAI,MAAM,yBAAyB,CAAC;AAChD,OAAO,KAAK,IAAI,MAAM,yBAAyB,CAAC;AAChD,OAAO,KAAK,QAAQ,MAAM,iCAAiC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AAO,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC;QAC5C,IAAI,KAAK,KAAK,IAAI,EAAE,CAAC;YACnB,OAAO,KAAK,CAAC;QACf,CAAC;QACD,QAAQ,QAAQ,EAAE,CAAC;YACjB,KAAK,2BAA2B;gBAC9B,KAAK,KAAK,CAAC,eAAe,EAAE,CAAC;gBAC7B,OAAO,IAAI,CAAC;YACd,KAAK,wBAAwB;gBAC3B,KAAK,CAAC,YAAY,EAAE,CAAC;gBACrB,OAAO,IAAI,CAAC;YACd,KAAK,uBAAuB;gBAC1B,KAAK,KAAK,CAAC,UAAU,EAAE,CAAC;gBACxB,OAAO,IAAI,CAAC;YACd,KAAK,yBAAyB;gBAC5B,KAAK,CAAC,gBAAgB,EAAE,CAAC;gBACzB,OAAO,IAAI,CAAC;YACd,KAAK,iCAAiC;gBACpC,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC;gBACtB,OAAO,IAAI,CAAC;YACd,KAAK,6BAA6B;gBAChC,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;gBACrB,OAAO,IAAI,CAAC;YACd,KAAK,uBAAuB;gBAC1B,KAAK,KAAK,CAAC,mBAAmB,EAAE,CAAC;gBACjC,OAAO,IAAI,CAAC;YACd,KAAK,6BAA6B;gBAChC,KAAK,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC;gBACzB,OAAO,IAAI,CAAC;YACd,KAAK,yBAAyB;gBAC5B,KAAK,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,CAAC;gBAC1B,OAAO,IAAI,CAAC;QAChB,CAAC;QACD,OAAO,KAAK,CAAC;IACf,CAAC;CACF","sourcesContent":["// Copyright 2021 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\n/*\n * Copyright (C) 2012 Google Inc. All rights reserved.\n * Copyright (C) 2012 Intel Inc. All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are\n * met:\n *\n * * Redistributions of source code must retain the above copyright\n * notice, this list of conditions and the following disclaimer.\n * * Redistributions in binary form must reproduce the above\n * copyright notice, this list of conditions and the following disclaimer\n * in the documentation and/or other materials provided with the\n * distribution.\n * * Neither the name of Google Inc. nor the names of its\n * contributors may be used to endorse or promote products derived from\n * this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nimport * as Common from '../../core/common/common.js';\nimport * as Host from '../../core/host/host.js';\nimport * as i18n from '../../core/i18n/i18n.js';\nimport * as Platform from '../../core/platform/platform.js';\nimport * as Root from '../../core/root/root.js';\nimport * as SDK from '../../core/sdk/sdk.js';\nimport type * as Protocol from '../../generated/protocol.js';\nimport * as CrUXManager from '../../models/crux-manager/crux-manager.js';\nimport * as Trace from '../../models/trace/trace.js';\nimport * as Workspace from '../../models/workspace/workspace.js';\nimport * as TraceBounds from '../../services/trace_bounds/trace_bounds.js';\nimport * as Adorners from '../../ui/components/adorners/adorners.js';\nimport type * as Buttons from '../../ui/components/buttons/buttons.js';\nimport * as Dialogs from '../../ui/components/dialogs/dialogs.js';\nimport * as LegacyWrapper from '../../ui/components/legacy_wrapper/legacy_wrapper.js';\nimport * as PerfUI from '../../ui/legacy/components/perf_ui/perf_ui.js';\nimport * as UI from '../../ui/legacy/legacy.js';\nimport * as ThemeSupport from '../../ui/legacy/theme_support/theme_support.js';\nimport * as VisualLogging from '../../ui/visual_logging/visual_logging.js';\nimport * as MobileThrottling from '../mobile_throttling/mobile_throttling.js';\n\nimport {ActiveFilters} from './ActiveFilters.js';\nimport * as AnnotationHelpers from './AnnotationHelpers.js';\nimport {TraceLoadEvent} from './BenchmarkEvents.js';\nimport * as TimelineComponents from './components/components.js';\nimport * as TimelineInsights from './components/insights/insights.js';\nimport {SHOULD_SHOW_EASTER_EGG} from './EasterEgg.js';\nimport {Tracker} from './FreshRecording.js';\nimport historyToolbarButtonStyles from './historyToolbarButton.css.js';\nimport {IsolateSelector} from './IsolateSelector.js';\nimport {AnnotationModifiedEvent, ModificationsManager} from './ModificationsManager.js';\nimport * as Overlays from './overlays/overlays.js';\nimport {cpuprofileJsonGenerator, traceJsonGenerator} from './SaveFileFormatter.js';\nimport {type Client, TimelineController} from './TimelineController.js';\nimport type {TimelineFlameChartDataProvider} from './TimelineFlameChartDataProvider.js';\nimport {TimelineFlameChartView} from './TimelineFlameChartView.js';\nimport {TimelineHistoryManager} from './TimelineHistoryManager.js';\nimport {TimelineLoader} from './TimelineLoader.js';\nimport {TimelineMiniMap} from './TimelineMiniMap.js';\nimport timelinePanelStyles from './timelinePanel.css.js';\nimport {\n rangeForSelection,\n selectionFromEvent,\n selectionIsRange,\n type TimelineSelection,\n} from './TimelineSelection.js';\nimport timelineStatusDialogStyles from './timelineStatusDialog.css.js';\nimport {TimelineUIUtils} from './TimelineUIUtils.js';\nimport {UIDevtoolsController} from './UIDevtoolsController.js';\nimport {UIDevtoolsUtils} from './UIDevtoolsUtils.js';\nimport * as Utils from './utils/utils.js';\n\nconst UIStrings = {\n /**\n *@description Text that appears when user drag and drop something (for example, a file) in Timeline Panel of the Performance panel\n */\n dropTimelineFileOrUrlHere: 'Drop timeline file or URL here',\n /**\n *@description Title of disable capture jsprofile setting in timeline panel of the performance panel\n */\n disableJavascriptSamples: 'Disable JavaScript samples',\n /**\n *@description Title of capture layers and pictures setting in timeline panel of the performance panel\n */\n enableAdvancedPaint: 'Enable advanced paint instrumentation (slow)',\n /**\n *@description Title of CSS selector stats setting in timeline panel of the performance panel\n */\n enableSelectorStats: 'Enable CSS selector stats (slow)',\n /**\n *@description Title of show screenshots setting in timeline panel of the performance panel\n */\n screenshots: 'Screenshots',\n /**\n *@description Text for the memory of the page\n */\n memory: 'Memory',\n /**\n *@description Text to clear content\n */\n clear: 'Clear',\n /**\n *@description A label for a button that fixes something.\n */\n fixMe: 'Fix me',\n /**\n *@description Tooltip text that appears when hovering over the largeicon load button\n */\n loadProfile: 'Load profile…',\n /**\n *@description Tooltip text that appears when hovering over the largeicon download button\n */\n saveProfile: 'Save profile…',\n /**\n *@description An option to save trace with annotations that appears in the menu of the toolbar download button. This is the expected default option, therefore it does not mention annotations.\n */\n saveTraceWithAnnotationsMenuOption: 'Save trace',\n /**\n *@description An option to save trace without annotations that appears in the menu of the toolbar download button\n */\n saveTraceWithoutAnnotationsMenuOption: 'Save trace without annotations',\n /**\n *@description Text to take screenshots\n */\n captureScreenshots: 'Capture screenshots',\n /**\n *@description Text in Timeline Panel of the Performance panel\n */\n showMemoryTimeline: 'Show memory timeline',\n /**\n *@description Tooltip text that appears when hovering over the largeicon settings gear in show settings pane setting in timeline panel of the performance panel\n */\n captureSettings: 'Capture settings',\n /**\n *@description Text in Timeline Panel of the Performance panel\n */\n disablesJavascriptSampling: 'Disables JavaScript sampling, reduces overhead when running against mobile devices',\n /**\n *@description Text in Timeline Panel of the Performance panel\n */\n capturesAdvancedPaint: 'Captures advanced paint instrumentation, introduces significant performance overhead',\n /**\n *@description Text in Timeline Panel of the Performance panel\n */\n capturesSelectorStats: 'Captures CSS selector statistics',\n /**\n *@description Text in Timeline Panel of the Performance panel\n */\n network: 'Network:',\n /**\n *@description Text in Timeline Panel of the Performance panel\n */\n cpu: 'CPU:',\n /**\n *@description Title of the 'Network conditions' tool in the bottom drawer\n */\n networkConditions: 'Network conditions',\n /**\n *@description Text in Timeline Panel of the Performance panel\n *@example {wrong format} PH1\n *@example {ERROR_FILE_NOT_FOUND} PH2\n */\n failedToSaveTimelineSS: 'Failed to save timeline: {PH1} ({PH2})',\n /**\n *@description Text in Timeline Panel of the Performance panel\n */\n CpuThrottlingIsEnabled: '- CPU throttling is enabled',\n /**\n *@description Text in Timeline Panel of the Performance panel\n */\n NetworkThrottlingIsEnabled: '- Network throttling is enabled',\n /**\n *@description Text in Timeline Panel of the Performance panel\n */\n SignificantOverheadDueToPaint: '- Significant overhead due to paint instrumentation',\n /**\n *@description Text in Timeline Panel of the Performance panel\n */\n SelectorStatsEnabled: '- Selector stats is enabled',\n /**\n *@description Text in Timeline Panel of the Performance panel\n */\n JavascriptSamplingIsDisabled: '- JavaScript sampling is disabled',\n /**\n *@description Text in Timeline Panel of the Performance panel\n */\n stoppingTimeline: 'Stopping timeline…',\n /**\n *@description Text in Timeline Panel of the Performance panel\n */\n received: 'Received',\n /**\n *@description Text in Timeline Panel of the Performance panel\n */\n processed: 'Processed',\n /**\n *@description Text to close something\n */\n close: 'Close',\n /**\n *@description Text to download the raw trace files after an error\n */\n downloadAfterError: 'Download raw trace events',\n /**\n *@description Status text to indicate the recording has failed in the Performance panel\n */\n recordingFailed: 'Recording failed',\n /**\n * @description Text to indicate the progress of a profile. Informs the user that we are currently\n * creating a peformance profile.\n */\n profiling: 'Profiling…',\n /**\n *@description Text in Timeline Panel of the Performance panel\n */\n bufferUsage: 'Buffer usage',\n /**\n *@description Text in Timeline Panel of the Performance panel\n */\n loadingProfile: 'Loading profile…',\n /**\n *@description Text in Timeline Panel of the Performance panel\n */\n processingProfile: 'Processing profile…',\n /**\n *@description Text in Timeline Panel of the Performance panel\n */\n initializingProfiler: 'Initializing profiler…',\n /**\n *@description Text for the status of something\n */\n status: 'Status',\n /**\n *@description Text that refers to the time\n */\n time: 'Time',\n /**\n *@description Text for the description of something\n */\n description: 'Description',\n /**\n *@description Text of an item that stops the running task\n */\n stop: 'Stop',\n /**\n *\n * @description Text for exporting basic traces\n */\n exportNormalTraces: 'Basic performance traces',\n /**\n *\n * @description Text for exporting enhanced traces\n */\n exportEnhancedTraces: 'Enhanced performance traces',\n /**\n *@description Tooltip description for a checkbox that toggles the visibility of data added by extensions of this panel (Performance).\n */\n showDataAddedByExtensions: 'Show data added by extensions of the Performance panel',\n /**\n Label for a checkbox that toggles the visibility of data added by extensions of this panel (Performance).\n */\n showCustomtracks: 'Show custom tracks',\n\n /**\n * @description Tooltip for the the sidebar toggle in the Performance panel. Command to open/show the sidebar.\n */\n showSidebar: 'Show sidebar',\n /**\n * @description Tooltip for the the sidebar toggle in the Performance panel. Command to close the sidebar.\n */\n hideSidebar: 'Hide sidebar',\n /**\n * @description Screen reader announcement when the sidebar is shown in the Performance panel.\n */\n sidebarShown: 'Performance sidebar shown',\n /**\n * @description Screen reader announcement when the sidebar is hidden in the Performance panel.\n */\n sidebarHidden: 'Performance sidebar hidden',\n /**\n * @description Screen reader announcement when the user clears their selection\n */\n selectionCleared: 'Selection cleared',\n /**\n * @description Screen reader announcement when the user selects a frame.\n */\n frameSelected: 'Frame selected',\n /**\n * @description Screen reader announcement when the user selects a trace event.\n * @example {Paint} PH1\n */\n eventSelected: 'Event {PH1} selected',\n /**\n *@description Text of a hyperlink to documentation.\n */\n learnMore: 'Learn more',\n /**\n * @description Tooltip text for a button that takes the user back to the default view which shows performance metrics that are live.\n */\n backToLiveMetrics: 'Go back to the live metrics page',\n /**\n * @description Description of the Timeline in/out zoom action that appears in the Performance panel shortcuts dialog.\n */\n timelineZoomInOut: 'Timeline zoom in/out',\n /**\n * @description Description of the Timeline fast in/out zoom action that appears in the Performance panel shortcuts dialog.\n */\n timelineFastZoomInOut: 'Timeline fast zoom in/out',\n /**\n * @description Description of the Timeline up/down scroll action that appears in the Performance panel shortcuts dialog.\n */\n timelineScrollUpDown: 'Timeline up/down',\n /**\n * @description Description of the Timeline right/left panning action that appears in the Performance panel shortcuts dialog.\n */\n timelinePanLeftRight: 'Timeline right/left',\n /**\n * @description Title for the Dim 3rd Parties checkbox.\n */\n dimThirdParties: 'Dim 3rd Parties',\n};\nconst str_ = i18n.i18n.registerUIStrings('panels/timeline/TimelinePanel.ts', UIStrings);\nconst i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);\n\nlet timelinePanelInstance: TimelinePanel;\nlet isNode: boolean;\n\n/**\n * Represents the states that the timeline panel can be in.\n * If you need to change the panel's view, use the {@see #changeView} method.\n * Note that we do not represent the \"Loading/Processing\" view here. The\n * StatusPane is managed in the code that handles file import/recording, and\n * when it is visible it is rendered on top of the UI so obscures what is behind\n * it. When it completes, we will set the view mode to the trace that has been\n * loaded.\n */\ntype ViewMode = {\n mode: 'LANDING_PAGE',\n}|{\n mode: 'VIEWING_TRACE',\n traceIndex: number,\n}|{\n mode: 'STATUS_PANE_OVERLAY',\n};\n\nexport class TimelinePanel extends UI.Panel.Panel implements Client, TimelineModeViewDelegate {\n private readonly dropTarget: UI.DropTarget.DropTarget;\n private readonly recordingOptionUIControls: UI.Toolbar.ToolbarItem[];\n private state: State;\n private recordingPageReload: boolean;\n private readonly millisecondsToRecordAfterLoadEvent: number;\n private readonly toggleRecordAction: UI.ActionRegistration.Action;\n private readonly recordReloadAction: UI.ActionRegistration.Action;\n readonly #historyManager: TimelineHistoryManager;\n private disableCaptureJSProfileSetting: Common.Settings.Setting;\n private readonly captureLayersAndPicturesSetting: Common.Settings.Setting;\n private readonly captureSelectorStatsSetting: Common.Settings.Setting;\n readonly #thirdPartyTracksSetting: Common.Settings.Setting;\n private showScreenshotsSetting: Common.Settings.Setting;\n private showMemorySetting: Common.Settings.Setting;\n private readonly panelToolbar: UI.Toolbar.Toolbar;\n private readonly panelRightToolbar: UI.Toolbar.Toolbar;\n private readonly timelinePane: UI.Widget.VBox;\n readonly #minimapComponent = new TimelineMiniMap();\n #viewMode: ViewMode = {mode: 'LANDING_PAGE'};\n readonly #dimThirdPartiesSetting: Common.Settings.Setting|null = null;\n\n /**\n * We get given any filters for a new trace when it is recorded/imported.\n * Because the user can then use the dropdown to navigate to another trace,\n * we store the filters by the trace index, so if the user then navigates back\n * to a previous trace we can reinstate the filters from this map.\n */\n #exclusiveFilterPerTrace: Map = new Map();\n /**\n * This widget holds the timeline sidebar which shows Insights & Annotations,\n * and the main UI which shows the timeline\n */\n readonly #splitWidget = new UI.SplitWidget.SplitWidget(\n true, // isVertical\n false, // secondIsSidebar\n 'timeline-panel-sidebar-state', // settingName (to persist the open/closed state for the user)\n TimelineComponents.Sidebar.DEFAULT_SIDEBAR_WIDTH_PX,\n );\n private readonly statusPaneContainer: HTMLElement;\n private readonly flameChart: TimelineFlameChartView;\n private readonly searchableViewInternal: UI.SearchableView.SearchableView;\n private showSettingsPaneButton!: UI.Toolbar.ToolbarSettingToggle;\n private showSettingsPaneSetting!: Common.Settings.Setting;\n private settingsPane!: UI.Widget.Widget;\n private controller!: TimelineController|null;\n private cpuProfiler!: SDK.CPUProfilerModel.CPUProfilerModel|null;\n private clearButton!: UI.Toolbar.ToolbarButton;\n private brickBreakerToolbarButton: UI.Toolbar.ToolbarButton;\n private brickBreakerToolbarButtonAdded = false;\n private loadButton!: UI.Toolbar.ToolbarButton;\n private saveButton!: UI.Toolbar.ToolbarButton|UI.Toolbar.ToolbarMenuButton;\n private homeButton?: UI.Toolbar.ToolbarButton;\n private statusPane!: StatusPane|null;\n private landingPage!: UI.Widget.Widget;\n private loader?: TimelineLoader;\n private showScreenshotsToolbarCheckbox?: UI.Toolbar.ToolbarItem;\n private showMemoryToolbarCheckbox?: UI.Toolbar.ToolbarItem;\n private networkThrottlingSelect?: MobileThrottling.ThrottlingManager.NetworkThrottlingSelectorWrapper;\n private cpuThrottlingSelect?: MobileThrottling.ThrottlingManager.CPUThrottlingSelectorWrapper;\n private fileSelectorElement?: HTMLInputElement;\n private selection: TimelineSelection|null = null;\n private traceLoadStart!: Trace.Types.Timing.MilliSeconds|null;\n private primaryPageTargetPromiseCallback = (_target: SDK.Target.Target): void => {};\n // Note: this is technically unused, but we need it to define the promiseCallback function above.\n private primaryPageTargetPromise = new Promise(res => {\n this.primaryPageTargetPromiseCallback = res;\n });\n\n #traceEngineModel: Trace.TraceModel.Model;\n #sourceMapsResolver: Utils.SourceMapsResolver.SourceMapsResolver|null = null;\n #entityMapper: Utils.EntityMapper.EntityMapper|null = null;\n #onSourceMapsNodeNamesResolvedBound = this.#onSourceMapsNodeNamesResolved.bind(this);\n readonly #onChartPlayableStateChangeBound: (event: Common.EventTarget.EventTargetEvent) => void;\n #sidebarToggleButton = this.#splitWidget.createShowHideSidebarButton(\n i18nString(UIStrings.showSidebar),\n i18nString(UIStrings.hideSidebar),\n // These are used to announce to screen-readers and not shown visibly.\n i18nString(UIStrings.sidebarShown),\n i18nString(UIStrings.sidebarHidden),\n 'timeline.sidebar', // jslog context\n );\n\n #sideBar = new TimelineComponents.Sidebar.SidebarWidget();\n /**\n * Rather than auto-pop the sidebar every time the user records a trace,\n * which could get annoying, we instead persist the state of the sidebar\n * visibility to a setting so it's restored across sessions.\n * However, sometimes we have to automatically hide the sidebar, like when a\n * trace recording is happening, or the user is on the landing page. In those\n * times, we toggle this flag to true. Then, when we enter the VIEWING_TRACE\n * mode, we check this flag and pop the sidebar open if it's set to true.\n * Longer term a better fix here would be to divide the 3 UI screens\n * (status pane, landing page, trace view) into distinct components /\n * widgets, to avoid this complexity.\n */\n #restoreSidebarVisibilityOnTraceLoad: boolean = false;\n\n /**\n * Used to track an aria announcement that we need to alert for\n * screen-readers. We track these because we debounce announcements to not\n * overwhelm.\n */\n #pendingAriaMessage: string|null = null;\n\n #eventToRelatedInsights: TimelineComponents.RelatedInsightChips.EventToRelatedInsightsMap = new Map();\n #shortcutsDialog: Dialogs.ShortcutDialog.ShortcutDialog = new Dialogs.ShortcutDialog.ShortcutDialog();\n /**\n * Track if the user has opened the shortcuts dialog before. We do this so that the\n * very first time the performance panel is open after the shortcuts dialog ships, we can\n * automatically pop it open to aid discovery.\n */\n #userHadShortcutsDialogOpenedOnce = Common.Settings.Settings.instance().createSetting(\n 'timeline.user-had-shortcuts-dialog-opened-once', false);\n /**\n * Navigation radio buttons located in the shortcuts dialog.\n */\n #navigationRadioButtons = document.createElement('form');\n #modernNavRadioButton = UI.UIUtils.createRadioLabel('flamechart-selected-navigation', 'Modern');\n #classicNavRadioButton = UI.UIUtils.createRadioLabel('flamechart-selected-navigation', 'Classic');\n\n #onMainEntryHovered: (event: Common.EventTarget.EventTargetEvent) => void;\n\n constructor() {\n super('timeline');\n const adornerContent = document.createElement('span');\n adornerContent.innerHTML = `
💫
`;\n const adorner = new Adorners.Adorner.Adorner();\n adorner.classList.add('fix-perf-icon');\n adorner.data = {\n name: i18nString(UIStrings.fixMe),\n content: adornerContent,\n };\n this.brickBreakerToolbarButton = new UI.Toolbar.ToolbarButton(i18nString(UIStrings.fixMe), adorner);\n this.brickBreakerToolbarButton.addEventListener(\n UI.Toolbar.ToolbarButton.Events.CLICK, () => this.#onBrickBreakerEasterEggClick());\n\n this.#traceEngineModel = this.#instantiateNewModel();\n this.#listenForProcessingProgress();\n\n this.element.addEventListener('contextmenu', this.contextMenu.bind(this), false);\n this.dropTarget = new UI.DropTarget.DropTarget(\n this.element, [UI.DropTarget.Type.File, UI.DropTarget.Type.URI],\n i18nString(UIStrings.dropTimelineFileOrUrlHere), this.handleDrop.bind(this));\n\n this.recordingOptionUIControls = [];\n this.state = State.IDLE;\n this.recordingPageReload = false;\n this.millisecondsToRecordAfterLoadEvent = 5000;\n this.toggleRecordAction = UI.ActionRegistry.ActionRegistry.instance().getAction('timeline.toggle-recording');\n this.recordReloadAction = UI.ActionRegistry.ActionRegistry.instance().getAction('timeline.record-reload');\n\n this.#historyManager = new TimelineHistoryManager(this.#minimapComponent, isNode);\n\n this.traceLoadStart = null;\n\n this.disableCaptureJSProfileSetting =\n Common.Settings.Settings.instance().createSetting('timeline-disable-js-sampling', false);\n this.disableCaptureJSProfileSetting.setTitle(i18nString(UIStrings.disableJavascriptSamples));\n this.captureLayersAndPicturesSetting = Common.Settings.Settings.instance().createSetting(\n 'timeline-capture-layers-and-pictures', false, Common.Settings.SettingStorageType.SESSION);\n this.captureLayersAndPicturesSetting.setTitle(i18nString(UIStrings.enableAdvancedPaint));\n this.captureSelectorStatsSetting = Common.Settings.Settings.instance().createSetting(\n 'timeline-capture-selector-stats', false, Common.Settings.SettingStorageType.SESSION);\n this.captureSelectorStatsSetting.setTitle(i18nString(UIStrings.enableSelectorStats));\n\n this.showScreenshotsSetting =\n Common.Settings.Settings.instance().createSetting('timeline-show-screenshots', isNode ? false : true);\n this.showScreenshotsSetting.setTitle(i18nString(UIStrings.screenshots));\n this.showScreenshotsSetting.addChangeListener(this.updateMiniMap, this);\n\n this.showMemorySetting = Common.Settings.Settings.instance().createSetting('timeline-show-memory', false);\n this.showMemorySetting.setTitle(i18nString(UIStrings.memory));\n this.showMemorySetting.addChangeListener(this.onMemoryModeChanged, this);\n\n if (Root.Runtime.experiments.isEnabled(Root.Runtime.ExperimentName.TIMELINE_THIRD_PARTY_DEPENDENCIES)) {\n this.#dimThirdPartiesSetting =\n Common.Settings.Settings.instance().createSetting('timeline-dim-third-parties', false);\n this.#dimThirdPartiesSetting.setTitle(i18nString(UIStrings.dimThirdParties));\n this.#dimThirdPartiesSetting.addChangeListener(this.onDimThirdPartiesChanged, this);\n }\n\n this.#thirdPartyTracksSetting = TimelinePanel.extensionDataVisibilitySetting();\n this.#thirdPartyTracksSetting.addChangeListener(this.#extensionDataVisibilityChanged, this);\n this.#thirdPartyTracksSetting.setTitle(i18nString(UIStrings.showCustomtracks));\n\n const timelineToolbarContainer = this.element.createChild('div', 'timeline-toolbar-container');\n timelineToolbarContainer.setAttribute('jslog', `${VisualLogging.toolbar()}`);\n this.panelToolbar = new UI.Toolbar.Toolbar('timeline-main-toolbar', timelineToolbarContainer);\n this.panelToolbar.makeWrappable(true);\n this.panelRightToolbar = new UI.Toolbar.Toolbar('', timelineToolbarContainer);\n if (!isNode) {\n this.createSettingsPane();\n this.updateShowSettingsToolbarButton();\n }\n this.timelinePane = new UI.Widget.VBox();\n const topPaneElement = this.timelinePane.element.createChild('div', 'hbox');\n topPaneElement.id = 'timeline-overview-panel';\n\n this.#minimapComponent.show(topPaneElement);\n this.#minimapComponent.addEventListener(PerfUI.TimelineOverviewPane.Events.OVERVIEW_PANE_MOUSE_MOVE, event => {\n this.flameChart.addTimestampMarkerOverlay(event.data.timeInMicroSeconds);\n });\n this.#minimapComponent.addEventListener(PerfUI.TimelineOverviewPane.Events.OVERVIEW_PANE_MOUSE_LEAVE, async () => {\n await this.flameChart.removeTimestampMarkerOverlay();\n });\n\n this.statusPaneContainer = this.timelinePane.element.createChild('div', 'status-pane-container fill');\n\n this.createFileSelector();\n\n SDK.TargetManager.TargetManager.instance().addModelListener(\n SDK.ResourceTreeModel.ResourceTreeModel, SDK.ResourceTreeModel.Events.Load, this.loadEventFired, this);\n\n this.flameChart = new TimelineFlameChartView(this);\n this.#onChartPlayableStateChangeBound = this.#onChartPlayableStateChange.bind(this);\n this.element.addEventListener(\n 'toggle-popover', event => this.flameChart.togglePopover((event as CustomEvent).detail));\n\n this.flameChart.getMainFlameChart().addEventListener(\n PerfUI.FlameChart.Events.CHART_PLAYABLE_STATE_CHANGED, this.#onChartPlayableStateChangeBound, this);\n\n this.#onMainEntryHovered = this.#onEntryHovered.bind(this, this.flameChart.getMainDataProvider());\n this.flameChart.getMainFlameChart().addEventListener(\n PerfUI.FlameChart.Events.ENTRY_HOVERED, this.#onMainEntryHovered);\n\n this.searchableViewInternal = new UI.SearchableView.SearchableView(this.flameChart, null);\n this.searchableViewInternal.setMinimumSize(0, 100);\n this.searchableViewInternal.setMinimalSearchQuerySize(2); // At 1 it can introduce a bit of jank.\n this.searchableViewInternal.element.classList.add('searchable-view');\n this.searchableViewInternal.show(this.timelinePane.element);\n this.flameChart.show(this.searchableViewInternal.element);\n this.flameChart.setSearchableView(this.searchableViewInternal);\n this.searchableViewInternal.hideWidget();\n\n this.#splitWidget.setMainWidget(this.timelinePane);\n this.#splitWidget.setSidebarWidget(this.#sideBar);\n this.#splitWidget.enableShowModeSaving();\n this.#splitWidget.show(this.element);\n\n this.flameChart.overlays().addEventListener(Overlays.Overlays.TimeRangeMouseOverEvent.eventName, event => {\n const {overlay} = event as Overlays.Overlays.TimeRangeMouseOverEvent;\n const overlayBounds = Overlays.Overlays.traceWindowContainingOverlays([overlay]);\n if (!overlayBounds) {\n return;\n }\n this.#minimapComponent.highlightBounds(overlayBounds, /* withBracket */ false);\n });\n\n this.flameChart.overlays().addEventListener(Overlays.Overlays.TimeRangeMouseOutEvent.eventName, () => {\n this.#minimapComponent.clearBoundsHighlight();\n });\n\n this.#sideBar.element.addEventListener(TimelineInsights.SidebarInsight.InsightDeactivated.eventName, () => {\n this.#setActiveInsight(null);\n });\n\n this.#sideBar.element.addEventListener(TimelineInsights.SidebarInsight.InsightActivated.eventName, event => {\n const {model, insightSetKey} = event;\n this.#setActiveInsight({model, insightSetKey});\n });\n\n this.#sideBar.element.addEventListener(TimelineInsights.SidebarInsight.InsightProvideOverlays.eventName, event => {\n const {overlays, options} = event;\n\n this.flameChart.setOverlays(overlays, options);\n\n const overlaysBounds = Overlays.Overlays.traceWindowContainingOverlays(overlays);\n if (overlaysBounds) {\n this.#minimapComponent.highlightBounds(overlaysBounds, /* withBracket */ true);\n } else {\n this.#minimapComponent.clearBoundsHighlight();\n }\n });\n\n this.flameChart.element.addEventListener(TimelineInsights.EventRef.EventReferenceClick.eventName, event => {\n const fromTraceEvent = selectionFromEvent(event.event);\n this.flameChart.setSelectionAndReveal(fromTraceEvent);\n });\n\n this.#sideBar.contentElement.addEventListener(TimelineInsights.EventRef.EventReferenceClick.eventName, event => {\n this.select(selectionFromEvent(event.event));\n });\n\n this.#sideBar.element.addEventListener(TimelineComponents.Sidebar.RemoveAnnotation.eventName, event => {\n const {removedAnnotation} = (event as TimelineComponents.Sidebar.RemoveAnnotation);\n ModificationsManager.activeManager()?.removeAnnotation(removedAnnotation);\n });\n\n this.#sideBar.element.addEventListener(TimelineComponents.Sidebar.RevealAnnotation.eventName, event => {\n this.flameChart.revealAnnotation(event.annotation);\n });\n\n this.#sideBar.element.addEventListener(TimelineInsights.SidebarInsight.InsightSetHovered.eventName, event => {\n if (event.bounds) {\n this.#minimapComponent.highlightBounds(event.bounds, /* withBracket */ true);\n } else {\n this.#minimapComponent.clearBoundsHighlight();\n }\n });\n\n this.#sideBar.element.addEventListener(TimelineInsights.SidebarInsight.InsightSetZoom.eventName, event => {\n TraceBounds.TraceBounds.BoundsManager.instance().setTimelineVisibleWindow(\n event.bounds, {ignoreMiniMapBounds: true, shouldAnimate: true});\n });\n\n this.onMemoryModeChanged();\n this.populateToolbar();\n // The viewMode is set by default to the landing page, so we don't call\n // `#changeView` here and can instead directly call showLandingPage();\n this.#showLandingPage();\n this.updateTimelineControls();\n\n SDK.TargetManager.TargetManager.instance().addEventListener(\n SDK.TargetManager.Events.SUSPEND_STATE_CHANGED, this.onSuspendStateChanged, this);\n const profilerModels = SDK.TargetManager.TargetManager.instance().models(SDK.CPUProfilerModel.CPUProfilerModel);\n for (const model of profilerModels) {\n for (const message of model.registeredConsoleProfileMessages) {\n this.consoleProfileFinished(message);\n }\n }\n SDK.TargetManager.TargetManager.instance().observeModels(\n SDK.CPUProfilerModel.CPUProfilerModel,\n {\n modelAdded: (model: SDK.CPUProfilerModel.CPUProfilerModel) => {\n model.addEventListener(\n SDK.CPUProfilerModel.Events.CONSOLE_PROFILE_FINISHED, event => this.consoleProfileFinished(event.data));\n },\n modelRemoved: (_model: SDK.CPUProfilerModel.CPUProfilerModel) => {\n\n },\n },\n );\n SDK.TargetManager.TargetManager.instance().observeTargets({\n targetAdded: (target: SDK.Target.Target) => {\n if (target !== SDK.TargetManager.TargetManager.instance().primaryPageTarget()) {\n return;\n }\n this.primaryPageTargetPromiseCallback(target);\n },\n targetRemoved: (_: SDK.Target.Target) => {},\n });\n }\n\n #setActiveInsight(insight: TimelineComponents.Sidebar.ActiveInsight|null): void {\n if (insight) {\n this.#splitWidget.showBoth();\n }\n this.#sideBar.setActiveInsight(insight);\n this.flameChart.setActiveInsight(insight);\n }\n\n static instance(opts: {\n forceNew: boolean|null,\n isNode: boolean,\n }|undefined = {forceNew: null, isNode: false}): TimelinePanel {\n const {forceNew, isNode: isNodeMode} = opts;\n isNode = isNodeMode;\n\n if (!timelinePanelInstance || forceNew) {\n timelinePanelInstance = new TimelinePanel();\n }\n\n return timelinePanelInstance;\n }\n\n #instantiateNewModel(): Trace.TraceModel.Model {\n const config = Trace.Types.Configuration.defaults();\n config.showAllEvents = Root.Runtime.experiments.isEnabled('timeline-show-all-events');\n config.includeRuntimeCallStats = Root.Runtime.experiments.isEnabled('timeline-v8-runtime-call-stats');\n config.debugMode = Root.Runtime.experiments.isEnabled(Root.Runtime.ExperimentName.TIMELINE_DEBUG_MODE);\n\n return Trace.TraceModel.Model.createWithAllHandlers(config);\n }\n\n static extensionDataVisibilitySetting(): Common.Settings.Setting {\n // Calling this multiple times doesn't recreate the setting.\n // Instead, after the second call, the cached setting is returned.\n return Common.Settings.Settings.instance().createSetting('timeline-show-extension-data', true);\n }\n override searchableView(): UI.SearchableView.SearchableView|null {\n return this.searchableViewInternal;\n }\n\n override wasShown(): void {\n super.wasShown();\n UI.Context.Context.instance().setFlavor(TimelinePanel, this);\n this.registerCSSFiles([timelinePanelStyles]);\n // Record the performance tool load time.\n Host.userMetrics.panelLoaded('timeline', 'DevTools.Launch.Timeline');\n\n const cruxManager = CrUXManager.CrUXManager.instance();\n cruxManager.addEventListener(CrUXManager.Events.FIELD_DATA_CHANGED, this.#onFieldDataChanged, this);\n this.#onFieldDataChanged();\n }\n\n override willHide(): void {\n UI.Context.Context.instance().setFlavor(TimelinePanel, null);\n this.#historyManager.cancelIfShowing();\n\n const cruxManager = CrUXManager.CrUXManager.instance();\n cruxManager.removeEventListener(CrUXManager.Events.FIELD_DATA_CHANGED, this.#onFieldDataChanged, this);\n }\n\n #onFieldDataChanged(): void {\n const recs = Utils.Helpers.getThrottlingRecommendations();\n this.cpuThrottlingSelect?.updateRecommendedRate(recs.cpuRate);\n this.networkThrottlingSelect?.updateRecommendedConditions(recs.networkConditions);\n }\n\n loadFromEvents(events: Trace.Types.Events.Event[]): void {\n if (this.state !== State.IDLE) {\n return;\n }\n this.prepareToLoadTimeline();\n this.loader = TimelineLoader.loadFromEvents(events, this);\n }\n\n getFlameChart(): TimelineFlameChartView {\n return this.flameChart;\n }\n\n getMinimap(): TimelineMiniMap {\n return this.#minimapComponent;\n }\n\n /**\n * Determine if two view modes are equivalent. Useful because if {@see\n * #changeView} gets called and the new mode is identical to the current,\n * we can bail without doing any UI updates.\n */\n #viewModesEquivalent(m1: ViewMode, m2: ViewMode): boolean {\n if (m1.mode === 'LANDING_PAGE' && m2.mode === 'LANDING_PAGE') {\n return true;\n }\n\n if (m1.mode === 'STATUS_PANE_OVERLAY' && m2.mode === 'STATUS_PANE_OVERLAY') {\n return true;\n }\n\n // VIEWING_TRACE views are only equivalent if their traceIndex is the same.\n if (m1.mode === 'VIEWING_TRACE' && m2.mode === 'VIEWING_TRACE' && m1.traceIndex === m2.traceIndex) {\n return true;\n }\n return false;\n }\n\n #uninstallSourceMapsResolver(): void {\n if (this.#sourceMapsResolver) {\n // this set of NodeNames is cached by PIDs, so we clear it so we don't\n // use incorrect names from another trace that might happen to share\n // PID/TIDs.\n Utils.SourceMapsResolver.SourceMapsResolver.clearResolvedNodeNames();\n\n this.#sourceMapsResolver.removeEventListener(\n Utils.SourceMapsResolver.SourceMappingsUpdated.eventName, this.#onSourceMapsNodeNamesResolvedBound);\n this.#sourceMapsResolver.uninstall();\n this.#sourceMapsResolver = null;\n }\n }\n\n #removeStatusPane(): void {\n if (this.statusPane) {\n this.statusPane.remove();\n }\n this.statusPane = null;\n }\n\n #changeView(newMode: ViewMode): void {\n if (this.#viewModesEquivalent(this.#viewMode, newMode)) {\n return;\n }\n\n if (this.#viewMode.mode === 'VIEWING_TRACE') {\n // If the current / about to be \"old\" view was viewing a trace\n // we also uninstall any source maps resolver for the trace that was active.\n // If the user swaps back to this trace via the history dropdown, this will be reinstated.\n this.#uninstallSourceMapsResolver();\n\n // Store any modifications (e.g. annotations) that the user has created\n // on the current trace before we move away to a new view.\n this.#saveModificationsForActiveTrace();\n }\n\n this.#viewMode = newMode;\n this.updateTimelineControls();\n\n /**\n * Note that the TimelinePanel UI is really rendered in two distinct layers.\n * 1. status-pane-container: this is what renders both the StatusPane\n * loading modal AND the landing page.\n * What is important to note is that this renders ON TOP of the\n * SearchableView widget, which is what holds the FlameChartView.\n *\n * 2. SearchableView: this is the container that renders\n * TimelineFlameChartView and the rest of the flame chart code.\n *\n * What this layering means is that when we swap to the LANDING_PAGE or\n * STATUS_PANE_OVERLAY view, we don't actually need to reset the\n * SearchableView that is rendered behind it, because it won't be visible\n * and will be hidden behind the StatusPane/Landing Page.\n *\n * So the only time we update this SearchableView is when the user goes to\n * view a trace. That is why in the switch() statement below you won't see\n * any code that resets the SearchableView because we don't need to. We do\n * mark it as hidden, but mainly so the user can't accidentally use Cmd-F\n * to search a hidden view.\n */\n switch (newMode.mode) {\n case 'LANDING_PAGE': {\n this.#removeStatusPane();\n this.#showLandingPage();\n\n // Whilst we don't reset this, we hide it, mainly so the user cannot\n // hit Ctrl/Cmd-F and try to search when it isn't visible.\n this.searchableViewInternal.hideWidget();\n\n // Hide the brick-breaker easter egg\n this.brickBreakerToolbarButtonAdded = false;\n this.panelToolbar.removeToolbarItem(this.brickBreakerToolbarButton);\n return;\n }\n\n case 'VIEWING_TRACE': {\n this.#hideLandingPage();\n this.#setModelForActiveTrace();\n this.#removeStatusPane();\n this.#showSidebarIfRequired();\n this.#dimThirdPartiesIfRequired(newMode.traceIndex);\n return;\n }\n\n case 'STATUS_PANE_OVERLAY': {\n // We don't manage the StatusPane UI here; it is done in the\n // recordingStarted/recordingProgress callbacks, but we do make sure we\n // hide the landing page.\n this.#hideLandingPage();\n\n // We also hide the sidebar - else if the user is viewing a trace and\n // then load/record another, the sidebar remains visible.\n this.#hideSidebar();\n return;\n }\n default:\n Platform.assertNever(newMode, 'Unsupported TimelinePanel viewMode');\n }\n }\n\n #activeTraceIndex(): number|null {\n if (this.#viewMode.mode === 'VIEWING_TRACE') {\n return this.#viewMode.traceIndex;\n }\n return null;\n }\n\n /**\n * NOTE: this method only exists to enable some layout tests to be migrated to the new engine.\n * DO NOT use this method within DevTools. It is marked as deprecated so\n * within DevTools you are warned when using the method.\n * @deprecated\n **/\n getParsedTraceForLayoutTests(): Trace.Handlers.Types.ParsedTrace {\n const traceIndex = this.#activeTraceIndex();\n if (traceIndex === null) {\n throw new Error('No trace index active.');\n }\n const data = this.#traceEngineModel.parsedTrace(traceIndex);\n if (data === null) {\n throw new Error('No trace engine data found.');\n }\n return data;\n }\n\n /**\n * NOTE: this method only exists to enable some layout tests to be migrated to the new engine.\n * DO NOT use this method within DevTools. It is marked as deprecated so\n * within DevTools you are warned when using the method.\n * @deprecated\n **/\n getTraceEngineRawTraceEventsForLayoutTests(): readonly Trace.Types.Events.Event[] {\n const traceIndex = this.#activeTraceIndex();\n if (traceIndex === null) {\n throw new Error('No trace index active.');\n }\n const data = this.#traceEngineModel.rawTraceEvents(traceIndex);\n if (data === null) {\n throw new Error('No trace engine data found.');\n }\n return data;\n }\n\n #onChartPlayableStateChange(event: Common.EventTarget.EventTargetEvent): void {\n if (event.data) {\n const dateObj = new Date();\n const month = dateObj.getUTCMonth() + 1;\n const day = dateObj.getUTCDate();\n const isAprilFools = (month === 4 && (day === 1 || day === 2)); // Show only on April fools and the next day\n if (isAprilFools && !this.brickBreakerToolbarButtonAdded && SHOULD_SHOW_EASTER_EGG) {\n this.brickBreakerToolbarButtonAdded = true;\n this.panelToolbar.appendToolbarItem(this.brickBreakerToolbarButton);\n }\n } else {\n this.brickBreakerToolbarButtonAdded = false;\n this.panelToolbar.removeToolbarItem(this.brickBreakerToolbarButton);\n }\n }\n\n #onEntryHovered(dataProvider: TimelineFlameChartDataProvider, event: Common.EventTarget.EventTargetEvent):\n void {\n const entryIndex = event.data;\n if (entryIndex === -1) {\n this.#minimapComponent.clearBoundsHighlight();\n return;\n }\n const traceEvent = dataProvider.eventByIndex(entryIndex);\n if (!traceEvent) {\n return;\n }\n const bounds = Trace.Helpers.Timing.traceWindowFromEvent(traceEvent);\n this.#minimapComponent.highlightBounds(bounds, /* withBracket */ false);\n }\n\n private loadFromCpuProfile(profile: Protocol.Profiler.Profile|null): void {\n if (this.state !== State.IDLE || profile === null) {\n return;\n }\n this.prepareToLoadTimeline();\n this.loader = TimelineLoader.loadFromCpuProfile(profile, this);\n }\n\n private setState(state: State): void {\n this.state = state;\n this.updateTimelineControls();\n }\n\n private createSettingCheckbox(setting: Common.Settings.Setting, tooltip: Platform.UIString.LocalizedString):\n UI.Toolbar.ToolbarItem {\n const checkboxItem = new UI.Toolbar.ToolbarSettingCheckbox(setting, tooltip);\n this.recordingOptionUIControls.push(checkboxItem);\n return checkboxItem;\n }\n\n #addSidebarIconToToolbar(): void {\n if (this.panelToolbar.hasItem(this.#sidebarToggleButton)) {\n return;\n }\n\n this.panelToolbar.prependToolbarItem(this.#sidebarToggleButton);\n }\n\n /**\n * Used when the user deletes their last trace and is taken back to the\n * landing page - we don't add this icon until there is a trace loaded.\n */\n #removeSidebarIconFromToolbar(): void {\n this.panelToolbar.removeToolbarItem(this.#sidebarToggleButton);\n }\n\n #populateDownloadMenu(contextMenu: UI.ContextMenu.ContextMenu): void {\n contextMenu.viewSection().appendItem(i18nString(UIStrings.saveTraceWithAnnotationsMenuOption), () => {\n Host.userMetrics.actionTaken(Host.UserMetrics.Action.PerfPanelTraceExported);\n void this.saveToFile(/* isEnhancedTraces */ false, /* addModifications */ true);\n }, {\n jslogContext: 'timeline.save-to-file-with-annotations',\n });\n contextMenu.viewSection().appendItem(i18nString(UIStrings.saveTraceWithoutAnnotationsMenuOption), () => {\n Host.userMetrics.actionTaken(Host.UserMetrics.Action.PerfPanelTraceExported);\n void this.saveToFile();\n }, {\n jslogContext: 'timeline.save-to-file-without-annotations',\n });\n }\n\n private populateToolbar(): void {\n // Record\n this.panelToolbar.appendToolbarItem(UI.Toolbar.Toolbar.createActionButton(this.toggleRecordAction));\n this.panelToolbar.appendToolbarItem(UI.Toolbar.Toolbar.createActionButton(this.recordReloadAction));\n this.clearButton = new UI.Toolbar.ToolbarButton(i18nString(UIStrings.clear), 'clear', undefined, 'timeline.clear');\n this.clearButton.addEventListener(UI.Toolbar.ToolbarButton.Events.CLICK, () => this.onClearButton());\n this.panelToolbar.appendToolbarItem(this.clearButton);\n\n // Load / SaveCLICK\n this.loadButton =\n new UI.Toolbar.ToolbarButton(i18nString(UIStrings.loadProfile), 'import', undefined, 'timeline.load-from-file');\n this.loadButton.addEventListener(UI.Toolbar.ToolbarButton.Events.CLICK, () => {\n Host.userMetrics.actionTaken(Host.UserMetrics.Action.PerfPanelTraceImported);\n this.selectFileToLoad();\n });\n\n this.saveButton = new UI.Toolbar.ToolbarMenuButton(\n this.#populateDownloadMenu.bind(this), true, true, 'timeline.save-to-file-more-options', 'download');\n this.saveButton.setTitle(i18nString(UIStrings.saveProfile));\n\n if (Root.Runtime.experiments.isEnabled(Root.Runtime.ExperimentName.TIMELINE_ENHANCED_TRACES)) {\n this.saveButton.element.addEventListener('contextmenu', event => {\n event.preventDefault();\n event.stopPropagation();\n\n if (event.ctrlKey || event.button === 2) {\n const contextMenu = new UI.ContextMenu.ContextMenu(event);\n contextMenu.saveSection().appendItem(i18nString(UIStrings.exportNormalTraces), () => {\n void this.saveToFile();\n });\n contextMenu.saveSection().appendItem(i18nString(UIStrings.exportEnhancedTraces), () => {\n void this.saveToFile(/* isEnhancedTraces */ true);\n });\n\n void contextMenu.show();\n } else {\n void this.saveToFile();\n }\n });\n }\n\n this.panelToolbar.appendSeparator();\n this.panelToolbar.appendToolbarItem(this.loadButton);\n this.panelToolbar.appendToolbarItem(this.saveButton);\n\n // History\n this.panelToolbar.appendSeparator();\n\n if (!isNode) {\n this.homeButton = new UI.Toolbar.ToolbarButton(\n i18nString(UIStrings.backToLiveMetrics), 'home', undefined, 'timeline.back-to-live-metrics');\n this.homeButton.addEventListener(UI.Toolbar.ToolbarButton.Events.CLICK, () => {\n this.#changeView({mode: 'LANDING_PAGE'});\n this.#historyManager.navigateToLandingPage();\n });\n this.panelToolbar.appendToolbarItem(this.homeButton);\n this.panelToolbar.appendSeparator();\n }\n\n this.panelToolbar.appendToolbarItem(this.#historyManager.button());\n this.panelToolbar.registerCSSFiles([historyToolbarButtonStyles]);\n this.panelToolbar.appendSeparator();\n\n // View\n this.panelToolbar.appendSeparator();\n if (!isNode) {\n this.showScreenshotsToolbarCheckbox =\n this.createSettingCheckbox(this.showScreenshotsSetting, i18nString(UIStrings.captureScreenshots));\n this.panelToolbar.appendToolbarItem(this.showScreenshotsToolbarCheckbox);\n }\n\n this.showMemoryToolbarCheckbox =\n this.createSettingCheckbox(this.showMemorySetting, i18nString(UIStrings.showMemoryTimeline));\n this.panelToolbar.appendToolbarItem(this.showMemoryToolbarCheckbox);\n\n // GC\n this.panelToolbar.appendToolbarItem(UI.Toolbar.Toolbar.createActionButtonForId('components.collect-garbage'));\n\n // Ignore list setting\n this.panelToolbar.appendSeparator();\n const showIgnoreListSetting = new TimelineComponents.IgnoreListSetting.IgnoreListSetting();\n this.panelToolbar.appendToolbarItem(new UI.Toolbar.ToolbarItem(showIgnoreListSetting));\n\n if (Root.Runtime.experiments.isEnabled(Root.Runtime.ExperimentName.TIMELINE_THIRD_PARTY_DEPENDENCIES) &&\n this.#dimThirdPartiesSetting) {\n const dimThirdPartiesCheckbox =\n this.createSettingCheckbox(this.#dimThirdPartiesSetting, i18nString(UIStrings.dimThirdParties));\n this.panelToolbar.appendToolbarItem(dimThirdPartiesCheckbox);\n }\n\n // Isolate selector\n if (isNode) {\n const isolateSelector = new IsolateSelector();\n this.panelToolbar.appendSeparator();\n this.panelToolbar.appendToolbarItem(isolateSelector);\n }\n\n // Settings\n if (!isNode) {\n this.panelRightToolbar.appendSeparator();\n this.panelRightToolbar.appendToolbarItem(this.showSettingsPaneButton);\n }\n\n if (Root.Runtime.experiments.isEnabled(Root.Runtime.ExperimentName.TIMELINE_ALTERNATIVE_NAVIGATION)) {\n this.#setupNavigationSetting();\n this.#shortcutsDialog.prependElement(this.#navigationRadioButtons);\n const dialogToolbarItem = new UI.Toolbar.ToolbarItem(this.#shortcutsDialog);\n dialogToolbarItem.element.setAttribute(\n 'jslog', `${VisualLogging.action().track({click: true}).context('timeline.shortcuts-dialog-toggle')}`);\n this.panelRightToolbar.appendToolbarItem(dialogToolbarItem);\n // The setting could have been changed from the Devtools Settings. Therefore, we\n // need to update the radio buttons selection when the dialog is open.\n this.#shortcutsDialog.addEventListener('click', this.#updateNavigationSettingSelection.bind(this));\n }\n }\n\n #setupNavigationSetting(): HTMLElement {\n const currentNavSetting = Common.Settings.moduleSetting('flamechart-selected-navigation').get();\n const hideTheDialogForTests: string|null = localStorage.getItem('hide-shortcuts-dialog-for-test');\n const userHadShortcutsDialogOpenedOnce = this.#userHadShortcutsDialogOpenedOnce.get();\n\n this.#shortcutsDialog.data = {\n shortcuts: this.#getShortcutsInfo(currentNavSetting === 'classic'),\n open: !userHadShortcutsDialogOpenedOnce && hideTheDialogForTests !== 'true' &&\n !Host.InspectorFrontendHost.isUnderTest(),\n };\n\n this.#navigationRadioButtons.classList.add('nav-radio-buttons');\n UI.ARIAUtils.markAsRadioGroup(this.#navigationRadioButtons);\n // Change EventListener is only triggered when the radio button is selected\n this.#modernNavRadioButton.radioElement.addEventListener('change', () => {\n this.#shortcutsDialog.data = {shortcuts: this.#getShortcutsInfo(/* isNavClassic */ false)};\n Common.Settings.moduleSetting('flamechart-selected-navigation').set('modern');\n });\n this.#classicNavRadioButton.radioElement.addEventListener('change', () => {\n this.#shortcutsDialog.data = {shortcuts: this.#getShortcutsInfo(/* isNavClassic */ true)};\n Common.Settings.moduleSetting('flamechart-selected-navigation').set('classic');\n });\n\n this.#navigationRadioButtons.appendChild(this.#modernNavRadioButton);\n this.#modernNavRadioButton.setAttribute(\n 'jslog', `${VisualLogging.action().track({click: true}).context('timeline.select-modern-navigation')}`);\n this.#navigationRadioButtons.appendChild(this.#classicNavRadioButton);\n this.#classicNavRadioButton.setAttribute(\n 'jslog', `${VisualLogging.action().track({click: true}).context('timeline.select-classic-navigation')}`);\n\n this.#userHadShortcutsDialogOpenedOnce.set(true);\n return this.#navigationRadioButtons;\n }\n\n #updateNavigationSettingSelection(): void {\n const currentNavSetting = Common.Settings.moduleSetting('flamechart-selected-navigation').get();\n if (currentNavSetting === 'classic') {\n this.#classicNavRadioButton.radioElement.checked = true;\n Host.userMetrics.navigationSettingAtFirstTimelineLoad(\n Host.UserMetrics.TimelineNavigationSetting.SWITCHED_TO_CLASSIC);\n } else if (currentNavSetting === 'modern') {\n this.#modernNavRadioButton.radioElement.checked = true;\n Host.userMetrics.navigationSettingAtFirstTimelineLoad(\n Host.UserMetrics.TimelineNavigationSetting.SWITCHED_TO_MODERN);\n }\n }\n\n #getShortcutsInfo(isNavClassic: boolean): Dialogs.ShortcutDialog.Shortcut[] {\n if (isNavClassic) {\n return [\n {title: i18nString(UIStrings.timelineScrollUpDown), bindings: [['Shift', 'Scroll'], ['Shift', '↑/↓']]},\n {title: i18nString(UIStrings.timelineZoomInOut), bindings: [['Scroll'], ['W/S'], ['+/-']]},\n {title: i18nString(UIStrings.timelineFastZoomInOut), bindings: [['Shift', 'W/S'], ['Shift', '+/-']]},\n {title: i18nString(UIStrings.timelinePanLeftRight), bindings: [['Shift', '←/→'], ['A/D']]},\n ];\n }\n\n return [\n {title: i18nString(UIStrings.timelineScrollUpDown), bindings: [['Scroll'], ['Shift', '↑/↓']]},\n {\n title: i18nString(UIStrings.timelineZoomInOut),\n bindings: [[Host.Platform.isMac() ? '⌘' : 'Ctrl', 'Scroll'], ['W/S'], ['+/-']],\n },\n {title: i18nString(UIStrings.timelineFastZoomInOut), bindings: [['Shift', 'W/S'], ['Shift', '+/-']]},\n {\n title: i18nString(UIStrings.timelinePanLeftRight),\n bindings: [['Shift', 'Scroll'], ['Shift', '←/→'], ['A/D']],\n },\n ];\n }\n\n private createSettingsPane(): void {\n this.showSettingsPaneSetting =\n Common.Settings.Settings.instance().createSetting('timeline-show-settings-toolbar', false);\n this.showSettingsPaneButton = new UI.Toolbar.ToolbarSettingToggle(\n this.showSettingsPaneSetting, 'gear', i18nString(UIStrings.captureSettings), 'gear-filled',\n 'timeline-settings-toggle');\n SDK.NetworkManager.MultitargetNetworkManager.instance().addEventListener(\n SDK.NetworkManager.MultitargetNetworkManager.Events.CONDITIONS_CHANGED, this.updateShowSettingsToolbarButton,\n this);\n SDK.CPUThrottlingManager.CPUThrottlingManager.instance().addEventListener(\n SDK.CPUThrottlingManager.Events.RATE_CHANGED, this.updateShowSettingsToolbarButton, this);\n this.disableCaptureJSProfileSetting.addChangeListener(this.updateShowSettingsToolbarButton, this);\n this.captureLayersAndPicturesSetting.addChangeListener(this.updateShowSettingsToolbarButton, this);\n this.captureSelectorStatsSetting.addChangeListener(this.updateShowSettingsToolbarButton, this);\n\n this.settingsPane = new UI.Widget.HBox();\n this.settingsPane.element.classList.add('timeline-settings-pane');\n this.settingsPane.element.setAttribute(\n 'jslog', `${VisualLogging.pane('timeline-settings-pane').track({resize: true})}`);\n this.settingsPane.show(this.element);\n\n const captureToolbar = new UI.Toolbar.Toolbar('', this.settingsPane.element);\n captureToolbar.element.classList.add('flex-auto');\n captureToolbar.makeVertical();\n captureToolbar.appendToolbarItem(this.createSettingCheckbox(\n this.disableCaptureJSProfileSetting, i18nString(UIStrings.disablesJavascriptSampling)));\n captureToolbar.appendToolbarItem(\n this.createSettingCheckbox(this.captureLayersAndPicturesSetting, i18nString(UIStrings.capturesAdvancedPaint)));\n captureToolbar.appendToolbarItem(\n this.createSettingCheckbox(this.captureSelectorStatsSetting, i18nString(UIStrings.capturesSelectorStats)));\n\n const throttlingPane = new UI.Widget.VBox();\n throttlingPane.element.classList.add('flex-auto');\n throttlingPane.show(this.settingsPane.element);\n\n const cpuThrottlingToolbar = new UI.Toolbar.Toolbar('', throttlingPane.element);\n cpuThrottlingToolbar.appendText(i18nString(UIStrings.cpu));\n this.cpuThrottlingSelect = MobileThrottling.ThrottlingManager.throttlingManager().createCPUThrottlingSelector();\n this.cpuThrottlingSelect.control.setMinWidth(200);\n this.cpuThrottlingSelect.control.setMaxWidth(200);\n cpuThrottlingToolbar.appendToolbarItem(this.cpuThrottlingSelect.control);\n\n const networkThrottlingToolbar = new UI.Toolbar.Toolbar('', throttlingPane.element);\n networkThrottlingToolbar.appendText(i18nString(UIStrings.network));\n networkThrottlingToolbar.appendToolbarItem(this.createNetworkConditionsSelectToolbarItem());\n\n const thirdPartyToolbar = new UI.Toolbar.Toolbar('', throttlingPane.element);\n thirdPartyToolbar.makeVertical();\n const thirdPartyCheckbox =\n this.createSettingCheckbox(this.#thirdPartyTracksSetting, i18nString(UIStrings.showDataAddedByExtensions));\n\n const localLink = UI.XLink.XLink.create(\n 'https://developer.chrome.com/docs/devtools/performance/extension', i18nString(UIStrings.learnMore));\n localLink.style.paddingLeft = '5px';\n thirdPartyCheckbox.element.shadowRoot?.appendChild(localLink);\n thirdPartyToolbar.appendToolbarItem(thirdPartyCheckbox);\n\n this.showSettingsPaneSetting.addChangeListener(this.updateSettingsPaneVisibility.bind(this));\n this.updateSettingsPaneVisibility();\n }\n\n private createNetworkConditionsSelectToolbarItem(): UI.Toolbar.ToolbarComboBox {\n const toolbarItem = new UI.Toolbar.ToolbarComboBox(null, i18nString(UIStrings.networkConditions));\n toolbarItem.setMinWidth(200);\n toolbarItem.setMaxWidth(200);\n this.networkThrottlingSelect =\n MobileThrottling.ThrottlingManager.throttlingManager().createNetworkThrottlingSelector(\n toolbarItem.selectElement());\n return toolbarItem;\n }\n\n private prepareToLoadTimeline(): void {\n console.assert(this.state === State.IDLE);\n this.setState(State.LOADING);\n }\n\n private createFileSelector(): void {\n if (this.fileSelectorElement) {\n this.fileSelectorElement.remove();\n }\n // .gz is far more popular than .gzip, but both are valid.\n this.fileSelectorElement =\n UI.UIUtils.createFileSelectorElement(this.loadFromFile.bind(this), '.json,.gz,.gzip,.cpuprofile');\n this.timelinePane.element.appendChild(this.fileSelectorElement);\n }\n\n private contextMenu(event: Event): void {\n // Do not show this Context menu on FlameChart entries because we have a different context menu for FlameChart entries\n const mouseEvent = (event as MouseEvent);\n if (this.flameChart.getMainFlameChart().coordinatesToEntryIndex(mouseEvent.offsetX, mouseEvent.offsetY) !== -1) {\n return;\n }\n const contextMenu = new UI.ContextMenu.ContextMenu(event, {useSoftMenu: true});\n contextMenu.appendItemsAtLocation('timelineMenu');\n void contextMenu.show();\n }\n\n async saveToFile(isEnhancedTraces: boolean = false, addModifications: boolean = false): Promise {\n if (this.state !== State.IDLE) {\n return;\n }\n if (this.#viewMode.mode !== 'VIEWING_TRACE') {\n return;\n }\n const traceEvents = this.#traceEngineModel.rawTraceEvents(this.#viewMode.traceIndex);\n const metadata = this.#traceEngineModel.metadata(this.#viewMode.traceIndex);\n\n if (metadata && addModifications) {\n metadata.modifications = ModificationsManager.activeManager()?.toJSON();\n } else if (metadata) {\n delete metadata.modifications;\n }\n if (metadata && isEnhancedTraces) {\n metadata.enhancedTraceVersion = SDK.EnhancedTracesParser.EnhancedTracesParser.enhancedTraceVersion;\n }\n if (!traceEvents) {\n return;\n }\n\n const traceStart = Platform.DateUtilities.toISO8601Compact(new Date());\n let fileName: Platform.DevToolsPath.RawPathString;\n if (metadata?.dataOrigin === Trace.Types.File.DataOrigin.CPU_PROFILE) {\n fileName = `CPU-${traceStart}.cpuprofile` as Platform.DevToolsPath.RawPathString;\n } else if (metadata && metadata.enhancedTraceVersion) {\n fileName = `EnhancedTraces-${traceStart}.json` as Platform.DevToolsPath.RawPathString;\n } else {\n fileName = `Trace-${traceStart}.json` as Platform.DevToolsPath.RawPathString;\n }\n\n try {\n // TODO(crbug.com/1456818): Extract this logic and add more tests.\n let traceAsString;\n if (metadata?.dataOrigin === Trace.Types.File.DataOrigin.CPU_PROFILE) {\n const profileEvent = traceEvents.find(e => e.name === 'CpuProfile');\n if (!profileEvent || !profileEvent.args?.data) {\n return;\n }\n const profileEventData = profileEvent.args?.data;\n if (profileEventData.hasOwnProperty('cpuProfile')) {\n // TODO(crbug.com/1456799): Currently use a hack way because we can't differentiate\n // cpuprofile from trace events when loading a file.\n // The loader will directly add the fake trace created from CpuProfile to the tracingModel.\n // And there is where the old saving logic saves the cpuprofile.\n // This will be solved when the CPUProfileHandler is done. Then we can directly get it\n // from the new traceEngine\n const profile = (profileEventData as {cpuProfile: Protocol.Profiler.Profile}).cpuProfile;\n traceAsString = cpuprofileJsonGenerator(profile as Protocol.Profiler.Profile);\n }\n } else {\n const formattedTraceIter = traceJsonGenerator(traceEvents, metadata);\n traceAsString = Array.from(formattedTraceIter).join('');\n }\n if (!traceAsString) {\n throw new Error('Trace content empty');\n }\n await Workspace.FileManager.FileManager.instance().save(\n fileName, traceAsString, true /* forceSaveAs */, false /* isBase64 */);\n Workspace.FileManager.FileManager.instance().close(fileName);\n } catch (error) {\n console.error(error.stack);\n if (error.name === 'AbortError') {\n // The user cancelled the action, so this is not an error we need to report.\n return;\n }\n Common.Console.Console.instance().error(\n i18nString(UIStrings.failedToSaveTimelineSS, {PH1: error.message, PH2: error.name}));\n }\n }\n\n async showHistoryDropdown(): Promise {\n const recordingData = await this.#historyManager.showHistoryDropDown();\n if (recordingData) {\n if (recordingData.type === 'LANDING_PAGE') {\n this.#changeView({mode: 'LANDING_PAGE'});\n } else {\n this.#changeView({\n mode: 'VIEWING_TRACE',\n traceIndex: recordingData.parsedTraceIndex,\n });\n }\n }\n }\n\n navigateHistory(direction: number): boolean {\n const recordingData = this.#historyManager.navigate(direction);\n // When navigating programatically, you cannot navigate to the landing page\n // view, so we can discount that possibility here.\n if (recordingData && recordingData.type === 'TRACE_INDEX') {\n this.#changeView({\n mode: 'VIEWING_TRACE',\n traceIndex: recordingData.parsedTraceIndex,\n });\n }\n return true;\n }\n\n #saveModificationsForActiveTrace(): void {\n if (this.#viewMode.mode !== 'VIEWING_TRACE') {\n return;\n }\n const newModifications = ModificationsManager.activeManager()?.toJSON();\n if (newModifications) {\n this.#traceEngineModel.overrideModifications(this.#viewMode.traceIndex, newModifications);\n }\n }\n\n selectFileToLoad(): void {\n if (this.fileSelectorElement) {\n this.fileSelectorElement.click();\n }\n }\n\n async loadFromFile(file: File): Promise {\n if (this.state !== State.IDLE) {\n return;\n }\n const maximumTraceFileLengthToDetermineEnhancedTraces = 5000;\n // We are expecting to locate the enhanced traces version within the first 5000\n // characters of the trace file if the given trace file is enhanced traces.\n // Doing so can avoid serializing the whole trace while needing to serialize\n // it again in rehydrated session for enhanced traces.\n const blob = file.slice(0, maximumTraceFileLengthToDetermineEnhancedTraces);\n const content = await blob.text();\n if (content.includes('enhancedTraceVersion')) {\n await window.scheduler?.postTask(() => {\n this.#launchRehydratedSession(file);\n }, {priority: 'background'});\n } else {\n this.loader = await TimelineLoader.loadFromFile(file, this);\n this.prepareToLoadTimeline();\n }\n this.createFileSelector();\n }\n\n #launchRehydratedSession(file: File): void {\n let rehydratingWindow: Window|null = null;\n let pathToLaunch: string|null = null;\n const url = new URL(window.location.href);\n const pathToEntrypoint = url.pathname.slice(0, url.pathname.lastIndexOf('/'));\n url.pathname = `${pathToEntrypoint}/rehydrated_devtools_app.html`;\n pathToLaunch = url.toString();\n\n // Clarifying the window the code is referring to\n const hostWindow = window;\n function onMessageHandler(ev: MessageEvent): void {\n if (url && ev.data && ev.data.type === 'REHYDRATING_WINDOW_READY') {\n rehydratingWindow?.postMessage({type: 'REHYDRATING_TRACE_FILE', traceFile: file}, url.origin);\n }\n hostWindow.removeEventListener('message', onMessageHandler);\n }\n hostWindow.addEventListener('message', onMessageHandler);\n rehydratingWindow = hostWindow.open(pathToLaunch, /* target: */ undefined, 'noopener=false,popup=true');\n }\n\n async loadFromURL(url: Platform.DevToolsPath.UrlString): Promise {\n if (this.state !== State.IDLE) {\n return;\n }\n this.prepareToLoadTimeline();\n this.loader = await TimelineLoader.loadFromURL(url, this);\n }\n\n private updateMiniMap(): void {\n if (this.#viewMode.mode !== 'VIEWING_TRACE') {\n return;\n }\n\n const parsedTrace = this.#traceEngineModel.parsedTrace(this.#viewMode.traceIndex);\n const isCpuProfile = this.#traceEngineModel.metadata(this.#viewMode.traceIndex)?.dataOrigin ===\n Trace.Types.File.DataOrigin.CPU_PROFILE;\n if (!parsedTrace) {\n return;\n }\n\n this.#minimapComponent.setData({\n parsedTrace,\n isCpuProfile,\n settings: {\n showScreenshots: this.showScreenshotsSetting.get(),\n showMemory: this.showMemorySetting.get(),\n },\n });\n }\n\n private onMemoryModeChanged(): void {\n this.flameChart.updateCountersGraphToggle(this.showMemorySetting.get());\n this.updateMiniMap();\n this.doResize();\n this.select(null);\n }\n\n private onDimThirdPartiesChanged(): void {\n if (this.#viewMode.mode !== 'VIEWING_TRACE') {\n return;\n }\n this.#dimThirdPartiesIfRequired(this.#viewMode.traceIndex);\n }\n\n #extensionDataVisibilityChanged(): void {\n this.flameChart.extensionDataVisibilityChanged();\n }\n\n private updateSettingsPaneVisibility(): void {\n if (isNode) {\n return;\n }\n if (this.showSettingsPaneSetting.get()) {\n this.showSettingsPaneButton.setToggled(true);\n this.settingsPane.showWidget();\n } else {\n this.showSettingsPaneButton.setToggled(false);\n this.settingsPane.hideWidget();\n }\n }\n\n private updateShowSettingsToolbarButton(): void {\n const messages: string[] = [];\n if (SDK.CPUThrottlingManager.CPUThrottlingManager.instance().cpuThrottlingRate() !== 1) {\n messages.push(i18nString(UIStrings.CpuThrottlingIsEnabled));\n }\n if (SDK.NetworkManager.MultitargetNetworkManager.instance().isThrottling()) {\n messages.push(i18nString(UIStrings.NetworkThrottlingIsEnabled));\n }\n if (this.captureLayersAndPicturesSetting.get()) {\n messages.push(i18nString(UIStrings.SignificantOverheadDueToPaint));\n }\n if (this.captureSelectorStatsSetting.get()) {\n messages.push(i18nString(UIStrings.SelectorStatsEnabled));\n }\n if (this.disableCaptureJSProfileSetting.get()) {\n messages.push(i18nString(UIStrings.JavascriptSamplingIsDisabled));\n }\n\n this.showSettingsPaneButton.setChecked(messages.length > 0);\n this.showSettingsPaneButton.element.style.setProperty('--dot-toggle-top', '16px');\n this.showSettingsPaneButton.element.style.setProperty('--dot-toggle-left', '15px');\n\n if (messages.length) {\n const tooltipElement = document.createElement('div');\n messages.forEach(message => {\n tooltipElement.createChild('div').textContent = message;\n });\n this.showSettingsPaneButton.setTitle(tooltipElement.textContent || '');\n } else {\n this.showSettingsPaneButton.setTitle(i18nString(UIStrings.captureSettings));\n }\n }\n\n private setUIControlsEnabled(enabled: boolean): void {\n this.recordingOptionUIControls.forEach(control => control.setEnabled(enabled));\n }\n\n async #evaluateInspectedURL(): Promise {\n if (!this.controller) {\n return Platform.DevToolsPath.EmptyUrlString;\n }\n\n // target.inspectedURL is reliably populated, however it lacks any url #hash\n const inspectedURL = this.controller.primaryPageTarget.inspectedURL();\n\n // We'll use the navigationHistory to acquire the current URL including hash\n const resourceTreeModel = this.controller.primaryPageTarget.model(SDK.ResourceTreeModel.ResourceTreeModel);\n const navHistory = resourceTreeModel && await resourceTreeModel.navigationHistory();\n if (!resourceTreeModel || !navHistory) {\n return inspectedURL;\n }\n\n const {currentIndex, entries} = navHistory;\n const navigationEntry = entries[currentIndex];\n return navigationEntry.url as Platform.DevToolsPath.UrlString;\n }\n\n async #navigateToAboutBlank(): Promise {\n const aboutBlankNavigationComplete = new Promise(async (resolve, reject) => {\n if (!this.controller) {\n reject('Could not find TimelineController');\n return;\n }\n const target = this.controller.primaryPageTarget;\n const resourceModel = target.model(SDK.ResourceTreeModel.ResourceTreeModel);\n if (!resourceModel) {\n reject('Could not load resourceModel');\n return;\n }\n\n // To clear out the page and any state from prior test runs, we\n // navigate to about:blank before initiating the trace recording.\n // Once we have navigated to about:blank, we start recording and\n // then navigate to the original page URL, to ensure we profile the\n // page load.\n function waitForAboutBlank(event: Common.EventTarget.EventTargetEvent):\n void {\n if (event.data.url === 'about:blank') {\n resolve();\n } else {\n reject(`Unexpected navigation to ${event.data.url}`);\n }\n resourceModel?.removeEventListener(SDK.ResourceTreeModel.Events.FrameNavigated, waitForAboutBlank);\n }\n resourceModel.addEventListener(SDK.ResourceTreeModel.Events.FrameNavigated, waitForAboutBlank);\n await resourceModel.navigate('about:blank' as Platform.DevToolsPath.UrlString);\n });\n await aboutBlankNavigationComplete;\n }\n\n async #startCPUProfilingRecording(): Promise {\n try {\n this.cpuProfiler = UI.Context.Context.instance().flavor(SDK.CPUProfilerModel.CPUProfilerModel);\n if (!this.cpuProfiler) {\n // If there is no isolate selected, we will profile the first isolate that devtools connects to.\n // If we profile all target, but this will cause some bugs like time for the function is calculated wrong,\n // because the profiles will be concated and sorted together, so the total time will be amplified.\n // Multiple targets problem might happen when you inspect multiple node servers on different port at same time,\n // or when you let DevTools listen to both locolhost:9229 & 127.0.0.1:9229.\n const firstNodeTarget =\n SDK.TargetManager.TargetManager.instance().targets().find(target => target.type() === SDK.Target.Type.NODE);\n if (!firstNodeTarget) {\n throw new Error('Could not load any Node target.');\n }\n if (firstNodeTarget) {\n this.cpuProfiler = firstNodeTarget.model(SDK.CPUProfilerModel.CPUProfilerModel);\n }\n }\n\n this.setUIControlsEnabled(false);\n this.#changeView({mode: 'STATUS_PANE_OVERLAY'});\n if (!this.cpuProfiler) {\n throw new Error('No Node target is found.');\n }\n await SDK.TargetManager.TargetManager.instance().suspendAllTargets('performance-timeline');\n await this.cpuProfiler.startRecording();\n\n this.recordingStarted();\n } catch (e) {\n await this.recordingFailed(e.message);\n }\n }\n\n async #startTraceRecording(): Promise {\n try {\n // We record against the root target, but also need to use the\n // primaryPageTarget to inspect the current URL. For more info, see the\n // JSDoc comment on the TimelineController constructor.\n const rootTarget = SDK.TargetManager.TargetManager.instance().rootTarget();\n const primaryPageTarget = SDK.TargetManager.TargetManager.instance().primaryPageTarget();\n\n if (!primaryPageTarget) {\n throw new Error('Could not load primary page target.');\n }\n if (!rootTarget) {\n throw new Error('Could not load root target.');\n }\n\n if (UIDevtoolsUtils.isUiDevTools()) {\n this.controller = new UIDevtoolsController(rootTarget, primaryPageTarget, this);\n } else {\n this.controller = new TimelineController(rootTarget, primaryPageTarget, this);\n }\n this.setUIControlsEnabled(false);\n this.#changeView({mode: 'STATUS_PANE_OVERLAY'});\n if (!this.controller) {\n throw new Error('Could not create Timeline controller');\n }\n\n const urlToTrace = await this.#evaluateInspectedURL();\n // If we are doing \"Reload & record\", we first navigate the page to\n // about:blank. This is to ensure any data on the timeline from any\n // previous performance recording is lost, avoiding the problem where a\n // timeline will show data & screenshots from a previous page load that\n // was not relevant.\n if (this.recordingPageReload) {\n await this.#navigateToAboutBlank();\n }\n const recordingOptions = {\n enableJSSampling: !this.disableCaptureJSProfileSetting.get(),\n capturePictures: this.captureLayersAndPicturesSetting.get(),\n captureFilmStrip: this.showScreenshotsSetting.get(),\n captureSelectorStats: this.captureSelectorStatsSetting.get(),\n };\n // Order is important here: we tell the controller to start recording, which enables tracing.\n const response = await this.controller.startRecording(recordingOptions);\n if (response.getError()) {\n throw new Error(response.getError());\n }\n // Once we get here, we know tracing is active.\n // This is when, if the user has hit \"Reload & Record\" that we now need to navigate to the original URL.\n // If the user has just hit \"record\", we don't do any navigating.\n const recordingConfig = this.recordingPageReload ? {navigateToUrl: urlToTrace} : undefined;\n this.recordingStarted(recordingConfig);\n } catch (e) {\n await this.recordingFailed(e.message);\n }\n }\n\n private async startRecording(): Promise {\n console.assert(!this.statusPane, 'Status pane is already opened.');\n this.setState(State.START_PENDING);\n this.showRecordingStarted();\n\n if (isNode) {\n await this.#startCPUProfilingRecording();\n } else {\n await this.#startTraceRecording();\n }\n }\n\n private async stopRecording(): Promise {\n if (this.statusPane) {\n this.statusPane.finish();\n this.statusPane.updateStatus(i18nString(UIStrings.stoppingTimeline));\n this.statusPane.updateProgressBar(i18nString(UIStrings.received), 0);\n }\n this.setState(State.STOP_PENDING);\n if (this.controller) {\n await this.controller.stopRecording();\n this.setUIControlsEnabled(true);\n await this.controller.dispose();\n this.controller = null;\n return;\n }\n if (this.cpuProfiler) {\n const profile = await this.cpuProfiler.stopRecording();\n this.setState(State.IDLE);\n this.loadFromCpuProfile(profile);\n\n this.setUIControlsEnabled(true);\n this.cpuProfiler = null;\n\n await SDK.TargetManager.TargetManager.instance().resumeAllTargets();\n }\n }\n\n private async recordingFailed(error: string, rawEvents?: Trace.Types.Events.Event[]): Promise {\n if (this.statusPane) {\n this.statusPane.remove();\n }\n this.statusPane = new StatusPane(\n {\n description: error,\n buttonText: i18nString(UIStrings.close),\n buttonDisabled: false,\n showProgress: undefined,\n showTimer: undefined,\n },\n // When recording failed, we should load null to go back to the landing page.\n async () => {\n this.statusPane?.remove();\n await this.loadingComplete(\n /* no collectedEvents */[],\n /* exclusiveFilter= */ null,\n /* metadata= */ null);\n });\n this.statusPane.showPane(this.statusPaneContainer);\n this.statusPane.updateStatus(i18nString(UIStrings.recordingFailed));\n\n if (rawEvents) {\n this.statusPane.enableDownloadOfEvents(rawEvents);\n }\n\n this.setState(State.RECORDING_FAILED);\n this.traceLoadStart = null;\n this.setUIControlsEnabled(true);\n if (this.controller) {\n await this.controller.dispose();\n this.controller = null;\n }\n // Ensure we resume all targets, otherwise DevTools remains unresponsive in the event of an error.\n void SDK.TargetManager.TargetManager.instance().resumeAllTargets();\n }\n\n private onSuspendStateChanged(): void {\n this.updateTimelineControls();\n }\n\n private consoleProfileFinished(data: SDK.CPUProfilerModel.ProfileFinishedData): void {\n this.loadFromCpuProfile(data.cpuProfile);\n void UI.InspectorView.InspectorView.instance().showPanel('timeline');\n }\n\n private updateTimelineControls(): void {\n this.toggleRecordAction.setToggled(this.state === State.RECORDING);\n this.toggleRecordAction.setEnabled(this.state === State.RECORDING || this.state === State.IDLE);\n this.recordReloadAction.setEnabled(isNode ? false : this.state === State.IDLE);\n this.#historyManager.setEnabled(this.state === State.IDLE);\n this.clearButton.setEnabled(this.state === State.IDLE);\n this.panelToolbar.setEnabled(this.state !== State.LOADING);\n this.panelRightToolbar.setEnabled(this.state !== State.LOADING);\n this.dropTarget.setEnabled(this.state === State.IDLE);\n this.loadButton.setEnabled(this.state === State.IDLE);\n this.saveButton.setEnabled(this.state === State.IDLE && this.#hasActiveTrace());\n this.homeButton?.setEnabled(this.state === State.IDLE && this.#hasActiveTrace());\n if (this.#viewMode.mode === 'VIEWING_TRACE') {\n this.#addSidebarIconToToolbar();\n }\n }\n\n async toggleRecording(): Promise {\n if (this.state === State.IDLE) {\n this.recordingPageReload = false;\n await this.startRecording();\n Host.userMetrics.actionTaken(Host.UserMetrics.Action.TimelineStarted);\n } else if (this.state === State.RECORDING) {\n await this.stopRecording();\n }\n }\n\n recordReload(): void {\n if (this.state !== State.IDLE) {\n return;\n }\n this.recordingPageReload = true;\n void this.startRecording();\n Host.userMetrics.actionTaken(Host.UserMetrics.Action.TimelinePageReloadStarted);\n }\n\n private onClearButton(): void {\n this.#historyManager.clear();\n this.#traceEngineModel = this.#instantiateNewModel();\n ModificationsManager.reset();\n this.#uninstallSourceMapsResolver();\n this.flameChart.getMainDataProvider().reset();\n this.flameChart.getNetworkDataProvider().reset();\n this.flameChart.reset();\n this.#changeView({mode: 'LANDING_PAGE'});\n }\n\n #hasActiveTrace(): boolean {\n return this.#viewMode.mode === 'VIEWING_TRACE';\n }\n\n #onBrickBreakerEasterEggClick(): void {\n if (!this.#hasActiveTrace()) {\n return;\n }\n this.flameChart.runBrickBreakerGame();\n }\n\n #applyActiveFilters(traceIsGeneric: boolean, exclusiveFilter: Trace.Extras.TraceFilter.TraceFilter|null = null):\n void {\n if (traceIsGeneric || Root.Runtime.experiments.isEnabled('timeline-show-all-events')) {\n return;\n }\n\n const newActiveFilters = exclusiveFilter ? [exclusiveFilter] : [\n TimelineUIUtils.visibleEventsFilter(),\n ];\n\n ActiveFilters.instance().setFilters(newActiveFilters);\n }\n\n /**\n * If we generate a lot of the same aria announcements very quickly, we don't\n * want to send them all to the user.\n */\n #ariaDebouncer = Common.Debouncer.debounce(() => {\n if (this.#pendingAriaMessage) {\n UI.ARIAUtils.alert(this.#pendingAriaMessage);\n this.#pendingAriaMessage = null;\n }\n }, 1_000);\n\n #makeAriaAnnouncement(message: string): void {\n // If we already have one pending, don't queue this one.\n if (message === this.#pendingAriaMessage) {\n return;\n }\n\n // If the pending message is different, immediately announce the pending\n // message + then update the pending message to the new one.\n if (this.#pendingAriaMessage) {\n UI.ARIAUtils.alert(this.#pendingAriaMessage);\n }\n this.#pendingAriaMessage = message;\n this.#ariaDebouncer();\n }\n\n /**\n * Called when we update the active trace that is being shown to the user.\n * This is called from {@see changeView} when we change the UI to show a\n * trace - either one the user has just recorded/imported, or one they have\n * navigated to via the dropdown.\n *\n * If you need code to execute whenever the active trace changes, this is the method to use.\n * If you need code to execute ONLY ON NEW TRACES, then use {@see loadingComplete}\n * You should not call this method directly if you want the UI to update; use\n * {@see changeView} to control what is shown to the user.\n */\n #setModelForActiveTrace(): void {\n if (this.#viewMode.mode !== 'VIEWING_TRACE') {\n return;\n }\n const {traceIndex} = this.#viewMode;\n const parsedTrace = this.#traceEngineModel.parsedTrace(traceIndex);\n const syntheticEventsManager = this.#traceEngineModel.syntheticTraceEventsManager(traceIndex);\n\n if (!parsedTrace || !syntheticEventsManager) {\n // This should not happen, because you can only get into the\n // VIEWING_TRACE viewMode if you have a valid trace index from the\n // Trace Engine. If it does, let's bail back to the landing page.\n console.error(`setModelForActiveTrace was called with an invalid trace index: ${traceIndex}`);\n this.#changeView({mode: 'LANDING_PAGE'});\n return;\n }\n\n Trace.Helpers.SyntheticEvents.SyntheticEventsManager.activate(syntheticEventsManager);\n // Clear the line level profile that could exist from the previous trace.\n PerfUI.LineLevelProfile.Performance.instance().reset();\n\n this.#minimapComponent.reset();\n\n // Order is important: the bounds must be set before we initiate any UI\n // rendering.\n TraceBounds.TraceBounds.BoundsManager.instance().resetWithNewBounds(\n parsedTrace.Meta.traceBounds,\n );\n\n // Set up the modifications manager for the newly active trace.\n // The order is important: this needs to happen before we trigger a flame chart redraw by setting the model.\n // (it could happen after, but then we would need to trigger a fresh redraw so let's not do that)\n const currentManager = ModificationsManager.initAndActivateModificationsManager(this.#traceEngineModel, traceIndex);\n\n if (!currentManager) {\n console.error('ModificationsManager could not be created or activated.');\n }\n this.statusPane?.updateProgressBar(i18nString(UIStrings.processed), 70);\n\n const isCpuProfile =\n this.#traceEngineModel.metadata(traceIndex)?.dataOrigin === Trace.Types.File.DataOrigin.CPU_PROFILE;\n this.flameChart.setModel(parsedTrace, isCpuProfile);\n this.flameChart.resizeToPreferredHeights();\n // Reset the visual selection as we've just swapped to a new trace.\n this.flameChart.setSelectionAndReveal(null);\n this.#sideBar.setParsedTrace(parsedTrace);\n\n this.searchableViewInternal.showWidget();\n\n const exclusiveFilter = this.#exclusiveFilterPerTrace.get(traceIndex) ?? null;\n this.#applyActiveFilters(parsedTrace.Meta.traceIsGeneric, exclusiveFilter);\n\n // Add ModificationsManager listeners for annotations change to update the Annotation Overlays.\n currentManager?.addEventListener(AnnotationModifiedEvent.eventName, event => {\n // Update screen readers.\n const announcementText = AnnotationHelpers.ariaAnnouncementForModifiedEvent(event as AnnotationModifiedEvent);\n if (announcementText) {\n this.#makeAriaAnnouncement(announcementText);\n }\n\n const {overlay, action} = (event as AnnotationModifiedEvent);\n if (action === 'Add') {\n this.flameChart.addOverlay(overlay);\n } else if (action === 'Remove') {\n this.flameChart.removeOverlay(overlay);\n } else if (action === 'UpdateTimeRange' && AnnotationHelpers.isTimeRangeLabel(overlay)) {\n this.flameChart.updateExistingOverlay(overlay, {\n bounds: overlay.bounds,\n });\n } else if (action === 'UpdateLinkToEntry' && AnnotationHelpers.isEntriesLink(overlay)) {\n this.flameChart.updateExistingOverlay(overlay, {\n entryTo: overlay.entryTo,\n });\n } else if (action === 'EnterLabelEditState' && AnnotationHelpers.isEntryLabel(overlay)) {\n this.flameChart.enterLabelEditMode(overlay);\n }\n\n const annotations = currentManager.getAnnotations();\n const annotationEntryToColorMap = this.buildColorsAnnotationsMap(annotations);\n this.#sideBar.setAnnotations(annotations, annotationEntryToColorMap);\n });\n\n // To calculate the activity we might want to zoom in, we use the top-most main-thread track\n const topMostMainThreadAppender =\n this.flameChart.getMainDataProvider().compatibilityTracksAppenderInstance().threadAppenders().at(0);\n if (topMostMainThreadAppender) {\n const zoomedInBounds = Trace.Extras.MainThreadActivity.calculateWindow(\n parsedTrace.Meta.traceBounds, topMostMainThreadAppender.getEntries());\n\n TraceBounds.TraceBounds.BoundsManager.instance().setTimelineVisibleWindow(zoomedInBounds);\n }\n\n // Add overlays for annotations loaded from the trace file\n const currModificationManager = ModificationsManager.activeManager();\n if (currModificationManager) {\n const annotations = currModificationManager.getAnnotations();\n const annotationEntryToColorMap = this.buildColorsAnnotationsMap(annotations);\n this.#sideBar.setAnnotations(annotations, annotationEntryToColorMap);\n this.flameChart.bulkAddOverlays(currModificationManager.getOverlays());\n }\n\n // Set up line level profiling with CPU profiles, if we found any.\n PerfUI.LineLevelProfile.Performance.instance().reset();\n if (parsedTrace && parsedTrace.Samples.profilesInProcess.size) {\n const primaryPageTarget = SDK.TargetManager.TargetManager.instance().primaryPageTarget();\n // Gather up all CPU Profiles we found when parsing this trace.\n const cpuProfiles =\n Array.from(parsedTrace.Samples.profilesInProcess).flatMap(([_processId, threadsInProcess]) => {\n const profiles = Array.from(threadsInProcess.values()).map(profileData => profileData.parsedProfile);\n return profiles;\n });\n for (const profile of cpuProfiles) {\n PerfUI.LineLevelProfile.Performance.instance().appendCPUProfile(profile, primaryPageTarget);\n }\n }\n\n // Initialize EntityMapper\n this.#entityMapper = new Utils.EntityMapper.EntityMapper(parsedTrace);\n\n // Set up SourceMapsResolver to ensure we resolve any function names in\n // profile calls.\n // Pass in the entity mapper.\n this.#sourceMapsResolver = new Utils.SourceMapsResolver.SourceMapsResolver(parsedTrace, this.#entityMapper);\n this.#sourceMapsResolver.addEventListener(\n Utils.SourceMapsResolver.SourceMappingsUpdated.eventName, this.#onSourceMapsNodeNamesResolvedBound);\n void this.#sourceMapsResolver.install();\n\n // Initialize EntityMapper\n this.#entityMapper = new Utils.EntityMapper.EntityMapper(parsedTrace);\n\n this.statusPane?.updateProgressBar(i18nString(UIStrings.processed), 80);\n this.updateMiniMap();\n this.statusPane?.updateProgressBar(i18nString(UIStrings.processed), 90);\n this.updateTimelineControls();\n\n this.#setActiveInsight(null);\n\n let traceInsightsSets = this.#traceEngineModel.traceInsights(traceIndex);\n if (traceInsightsSets) {\n // Omit insight sets that don't have anything of interest to show to the user.\n const filteredTraceInsightsSets = new Map();\n for (const [key, insightSet] of traceInsightsSets) {\n if (Object.values(insightSet.model).some(model => model.shouldShow)) {\n filteredTraceInsightsSets.set(key, insightSet);\n }\n }\n\n traceInsightsSets = filteredTraceInsightsSets.size ? filteredTraceInsightsSets : null;\n }\n\n this.flameChart.setInsights(traceInsightsSets, this.#eventToRelatedInsights);\n this.#sideBar.setInsights(traceInsightsSets);\n\n this.#eventToRelatedInsights.clear();\n if (traceInsightsSets) {\n for (const [insightSetKey, insightSet] of traceInsightsSets) {\n for (const model of Object.values(insightSet.model)) {\n let relatedEvents = model.relatedEvents;\n if (!relatedEvents) {\n relatedEvents = new Map();\n } else if (Array.isArray(relatedEvents)) {\n relatedEvents = new Map(relatedEvents.map(e => [e, []]));\n }\n\n for (const [event, messages] of relatedEvents.entries()) {\n const relatedInsights = this.#eventToRelatedInsights.get(event) ?? [];\n this.#eventToRelatedInsights.set(event, relatedInsights);\n relatedInsights.push({\n insightLabel: model.title,\n messages,\n activateInsight: () => {\n this.#setActiveInsight({model, insightSetKey});\n },\n });\n }\n }\n }\n }\n\n this.#showSidebarIfRequired();\n\n // When the timeline is loaded for the first time, log what navigation setting is selected.\n // This will allow us to get an estimate number of people using each option.\n if (this.#traceEngineModel.size() === 1) {\n if (Common.Settings.moduleSetting('flamechart-selected-navigation').get() === 'classic') {\n Host.userMetrics.navigationSettingAtFirstTimelineLoad(\n Host.UserMetrics.TimelineNavigationSetting.CLASSIC_AT_SESSION_FIRST_TRACE);\n } else {\n Host.userMetrics.navigationSettingAtFirstTimelineLoad(\n Host.UserMetrics.TimelineNavigationSetting.MODERN_AT_SESSION_FIRST_TRACE);\n }\n }\n }\n\n /**\n * We automatically show the sidebar in only 2 scenarios:\n * 1. The user has never seen it before, so we show it once to aid discovery\n * 2. The user had it open, and we hid it (for example, during recording), so now we need to bring it back.\n */\n #showSidebarIfRequired(): void {\n if (Root.Runtime.Runtime.queryParam('disable-auto-performance-sidebar-reveal') !== null) {\n // Used in interaction tests & screenshot tests.\n return;\n }\n const needToRestore = this.#restoreSidebarVisibilityOnTraceLoad;\n const userHasSeenSidebar = this.#sideBar.userHasOpenedSidebarOnce();\n\n if (!userHasSeenSidebar || needToRestore) {\n this.#splitWidget.showBoth();\n }\n this.#restoreSidebarVisibilityOnTraceLoad = false;\n }\n\n #dimThirdPartiesIfRequired(traceIndex: number): void {\n const parsedTrace = this.#traceEngineModel.parsedTrace(traceIndex);\n if (!parsedTrace) {\n return;\n }\n const thirdPartyEvents = this.#entityMapper?.thirdPartyEvents() ?? [];\n if (this.#dimThirdPartiesSetting?.get() && thirdPartyEvents.length) {\n this.flameChart.dimEvents(thirdPartyEvents);\n } else {\n // Ensure dimming stores are cleared, and there is no dimming.\n this.flameChart.disableAllDimming();\n }\n }\n\n // Build a map mapping annotated entries to the colours that are used to display them in the FlameChart.\n // We need this map to display the entries in the sidebar with the same colours.\n private buildColorsAnnotationsMap(annotations: Trace.Types.File.Annotation[]): Map {\n const annotationEntryToColorMap = new Map();\n\n for (const annotation of annotations) {\n if (Trace.Types.File.isEntryLabelAnnotation(annotation)) {\n annotationEntryToColorMap.set(annotation.entry, this.getEntryColorByEntry(annotation.entry));\n } else if (Trace.Types.File.isEntriesLinkAnnotation(annotation)) {\n annotationEntryToColorMap.set(annotation.entryFrom, this.getEntryColorByEntry(annotation.entryFrom));\n if (annotation.entryTo) {\n annotationEntryToColorMap.set(annotation.entryTo, this.getEntryColorByEntry(annotation.entryTo));\n }\n }\n }\n\n return annotationEntryToColorMap;\n }\n\n private getEntryColorByEntry(entry: Trace.Types.Events.Event): string {\n const mainIndex = this.flameChart.getMainDataProvider().indexForEvent(entry);\n const networkIndex = this.flameChart.getNetworkDataProvider().indexForEvent(entry);\n if (mainIndex !== null) {\n const color = this.flameChart.getMainDataProvider().entryColor(mainIndex);\n\n // The color for idle frames will be white in flame chart, which will display weird in the sidebar, so just use a\n // light gray color instead.\n if (color === 'white') {\n return ThemeSupport.ThemeSupport.instance().getComputedValue('--app-color-system');\n }\n return color;\n }\n if (networkIndex !== null) {\n const color = this.flameChart.getNetworkDataProvider().entryColor(networkIndex);\n return color;\n }\n\n console.warn('Could not get entry color for ', entry);\n return ThemeSupport.ThemeSupport.instance().getComputedValue('--app-color-system');\n }\n\n private recordingStarted(config?: {navigateToUrl: Platform.DevToolsPath.UrlString}): void {\n if (config && this.recordingPageReload && this.controller) {\n // If the user hit \"Reload & record\", by this point we have:\n // 1. Navigated to about:blank\n // 2. Initiated tracing.\n // We therefore now should navigate back to the original URL that the user wants to profile.\n const resourceModel = this.controller?.primaryPageTarget.model(SDK.ResourceTreeModel.ResourceTreeModel);\n if (!resourceModel) {\n void this.recordingFailed('Could not navigate to original URL');\n return;\n }\n // We don't need to await this because we are purposefully showing UI\n // progress as the page loads & tracing is underway.\n void resourceModel.navigate(config.navigateToUrl);\n }\n\n this.#changeView({mode: 'STATUS_PANE_OVERLAY'});\n this.setState(State.RECORDING);\n this.showRecordingStarted();\n if (this.statusPane) {\n this.statusPane.enableAndFocusButton();\n this.statusPane.updateStatus(i18nString(UIStrings.profiling));\n this.statusPane.updateProgressBar(i18nString(UIStrings.bufferUsage), 0);\n this.statusPane.startTimer();\n }\n }\n\n recordingProgress(usage: number): void {\n if (this.statusPane) {\n this.statusPane.updateProgressBar(i18nString(UIStrings.bufferUsage), usage * 100);\n }\n }\n\n /**\n * Hide the sidebar, but persist the user's state, because when they import a\n * trace we want to revert the sidebar back to what it was.\n */\n #hideSidebar(): void {\n if (this.#splitWidget.sidebarIsShowing()) {\n this.#restoreSidebarVisibilityOnTraceLoad = true;\n this.#splitWidget.hideSidebar();\n }\n }\n\n #showLandingPage(): void {\n this.updateSettingsPaneVisibility();\n this.#removeSidebarIconFromToolbar();\n this.#hideSidebar();\n\n if (this.landingPage) {\n this.landingPage.show(this.statusPaneContainer);\n return;\n }\n\n const liveMetrics = new TimelineComponents.LiveMetricsView.LiveMetricsView();\n liveMetrics.isNode = isNode;\n this.landingPage = LegacyWrapper.LegacyWrapper.legacyWrapper(UI.Widget.Widget, liveMetrics);\n this.landingPage.element.classList.add('timeline-landing-page', 'fill');\n this.landingPage.contentElement.classList.add('fill');\n this.landingPage.show(this.statusPaneContainer);\n }\n\n #hideLandingPage(): void {\n this.landingPage.detach();\n\n // Hide pane settings in trace view to conserve UI space, but preserve underlying setting.\n this.showSettingsPaneButton?.setToggled(false);\n this.settingsPane?.hideWidget();\n }\n\n async loadingStarted(): Promise {\n this.#changeView({mode: 'STATUS_PANE_OVERLAY'});\n\n if (this.statusPane) {\n this.statusPane.remove();\n }\n this.statusPane = new StatusPane(\n {\n showProgress: true,\n showTimer: undefined,\n buttonDisabled: undefined,\n buttonText: undefined,\n description: undefined,\n },\n () => this.cancelLoading());\n this.statusPane.showPane(this.statusPaneContainer);\n this.statusPane.updateStatus(i18nString(UIStrings.loadingProfile));\n // FIXME: make loading from backend cancelable as well.\n if (!this.loader) {\n this.statusPane.finish();\n }\n this.traceLoadStart = Trace.Types.Timing.MilliSeconds(performance.now());\n await this.loadingProgress(0);\n }\n\n async loadingProgress(progress?: number): Promise {\n if (typeof progress === 'number' && this.statusPane) {\n this.statusPane.updateProgressBar(i18nString(UIStrings.received), progress * 100);\n }\n }\n\n async processingStarted(): Promise {\n this.statusPane?.updateStatus(i18nString(UIStrings.processingProfile));\n }\n\n #listenForProcessingProgress(): void {\n this.#traceEngineModel.addEventListener(Trace.TraceModel.ModelUpdateEvent.eventName, e => {\n const updateEvent = e as Trace.TraceModel.ModelUpdateEvent;\n const str = i18nString(UIStrings.processed);\n\n // Trace Engine will report progress from [0...1] but we still have more work to do. So, scale them down a bit.\n const traceParseMaxProgress = 0.7;\n\n if (updateEvent.data.type === Trace.TraceModel.ModelUpdateType.COMPLETE) {\n this.statusPane?.updateProgressBar(str, 100 * traceParseMaxProgress);\n } else if (updateEvent.data.type === Trace.TraceModel.ModelUpdateType.PROGRESS_UPDATE) {\n const data = updateEvent.data.data;\n this.statusPane?.updateProgressBar(str, data.percent * 100 * traceParseMaxProgress);\n }\n });\n }\n\n #onSourceMapsNodeNamesResolved(): void {\n // Source maps can change the way calls hierarchies should look in\n // the flame chart (f.e. if some calls are ignore listed after\n // resolving source maps). Thus, we must reappend the flamechart\n // entries.\n this.flameChart.getMainDataProvider().timelineData(true);\n this.flameChart.getMainFlameChart().update();\n }\n\n /**\n * This is called with we are done loading a trace from a file, or after we\n * have recorded a fresh trace.\n *\n * IMPORTANT: All the code in here should be code that is only required when we have\n * recorded or loaded a brand new trace. If you need the code to run when the\n * user switches to an existing trace, please {@see setModel} and put your\n * code in there.\n **/\n async loadingComplete(\n collectedEvents: Trace.Types.Events.Event[], exclusiveFilter: Trace.Extras.TraceFilter.TraceFilter|null = null,\n metadata: Trace.Types.File.MetaData|null): Promise {\n this.#traceEngineModel.resetProcessor();\n\n delete this.loader;\n\n // If the user just recorded this trace via the record UI, the state will\n // be StopPending. Whereas if it was an existing trace they loaded via a\n // file, it will be State.Loading. This means we can tell the recording is\n // fresh by checking the state value.\n const recordingIsFresh = this.state === State.STOP_PENDING;\n\n this.setState(State.IDLE);\n\n if (collectedEvents.length === 0) {\n // 0 collected events indicates probably an invalid file was imported.\n // If the user does not have any already-loaded traces, then we should\n // just reset the panel back to the landing page. However if they had a\n // previous trace imported, we should go to that instead.\n if (this.#traceEngineModel.size()) {\n this.#changeView({\n mode: 'VIEWING_TRACE',\n traceIndex: this.#traceEngineModel.lastTraceIndex(),\n });\n } else {\n this.#changeView({mode: 'LANDING_PAGE'});\n }\n return;\n }\n\n try {\n await this.#executeNewTrace(collectedEvents, recordingIsFresh, metadata);\n const traceIndex = this.#traceEngineModel.lastTraceIndex();\n if (exclusiveFilter) {\n this.#exclusiveFilterPerTrace.set(traceIndex, exclusiveFilter);\n }\n this.#changeView({\n mode: 'VIEWING_TRACE',\n traceIndex,\n });\n\n const parsedTrace = this.#traceEngineModel.parsedTrace(traceIndex);\n if (!parsedTrace) {\n throw new Error(`Could not get trace data at index ${traceIndex}`);\n }\n\n if (recordingIsFresh) {\n Tracker.instance().registerFreshRecording(parsedTrace);\n }\n\n // We store the index of the active trace so we can load it back easily\n // if the user goes to a different trace then comes back.\n // However we also pass in the full trace data because we use it to build\n // the preview overview thumbnail of the trace that gets shown in the UI.\n this.#historyManager.addRecording({\n data: {\n parsedTraceIndex: traceIndex,\n type: 'TRACE_INDEX',\n },\n filmStripForPreview: Trace.Extras.FilmStrip.fromParsedTrace(parsedTrace),\n parsedTrace,\n metadata,\n });\n } catch (error) {\n // If we errored during the parsing stage, it\n // is useful to get access to the raw events to download the trace. This\n // allows us to debug crashes!\n void this.recordingFailed(error.message, collectedEvents);\n console.error(error);\n } finally {\n this.recordTraceLoadMetric();\n }\n }\n\n recordTraceLoadMetric(): void {\n if (!this.traceLoadStart) {\n return;\n }\n const start = this.traceLoadStart;\n // Right *now* is the end of trace parsing and model building, but the flamechart rendering\n // isn't complete yet. To capture that we'll do a rAF+setTimeout to give the most accurate timestamp\n // for the first paint of the flamechart\n requestAnimationFrame(() => {\n setTimeout(() => {\n const end = Trace.Types.Timing.MilliSeconds(performance.now());\n const measure = performance.measure('TraceLoad', {start, end});\n const duration = Trace.Types.Timing.MilliSeconds(measure.duration);\n this.element.dispatchEvent(new TraceLoadEvent(duration));\n Host.userMetrics.performanceTraceLoad(measure);\n }, 0);\n });\n }\n\n async #executeNewTrace(\n collectedEvents: Trace.Types.Events.Event[], isFreshRecording: boolean,\n metadata: Trace.Types.File.MetaData|null): Promise {\n return this.#traceEngineModel.parse(\n collectedEvents,\n {\n metadata: metadata ?? undefined,\n isFreshRecording,\n },\n );\n }\n\n loadingCompleteForTest(): void {\n // Not implemented, added only for allowing the TimelineTestRunner\n // to be in sync when a trace load is finished.\n }\n\n private showRecordingStarted(): void {\n this.#changeView({mode: 'STATUS_PANE_OVERLAY'});\n if (this.statusPane) {\n this.statusPane.remove();\n }\n this.statusPane = new StatusPane(\n {\n showTimer: true,\n showProgress: true,\n buttonDisabled: true,\n description: undefined,\n buttonText: undefined,\n },\n () => this.stopRecording());\n this.statusPane.showPane(this.statusPaneContainer);\n this.statusPane.updateStatus(i18nString(UIStrings.initializingProfiler));\n }\n\n private cancelLoading(): void {\n if (this.loader) {\n void this.loader.cancel();\n }\n }\n\n private async loadEventFired(\n event: Common.EventTarget\n .EventTargetEvent<{resourceTreeModel: SDK.ResourceTreeModel.ResourceTreeModel, loadTime: number}>):\n Promise {\n if (this.state !== State.RECORDING || !this.recordingPageReload || !this.controller ||\n this.controller.primaryPageTarget !== event.data.resourceTreeModel.target()) {\n return;\n }\n const controller = this.controller;\n await new Promise(r => window.setTimeout(r, this.millisecondsToRecordAfterLoadEvent));\n\n // Check if we're still in the same recording session.\n if (controller !== this.controller || this.state !== State.RECORDING) {\n return;\n }\n void this.stopRecording();\n }\n\n private frameForSelection(selection: TimelineSelection): Trace.Types.Events.LegacyTimelineFrame|null {\n if (this.#viewMode.mode !== 'VIEWING_TRACE') {\n return null;\n }\n if (selectionIsRange(selection)) {\n return null;\n }\n if (Trace.Types.Events.isSyntheticNetworkRequest(selection.event)) {\n return null;\n }\n\n // If the user has selected a random trace event, the frame we want is the last\n // frame in that time window, hence why the window we look for is the\n // endTime to the endTime.\n const parsedTrace = this.#traceEngineModel.parsedTrace(this.#viewMode.traceIndex);\n if (!parsedTrace) {\n return null;\n }\n const endTime = rangeForSelection(selection).max;\n const lastFrameInSelection = Trace.Handlers.ModelHandlers.Frames\n .framesWithinWindow(\n parsedTrace.Frames.frames,\n endTime,\n endTime,\n )\n .at(0);\n return lastFrameInSelection || null;\n }\n\n jumpToFrame(offset: number): true|undefined {\n if (this.#viewMode.mode !== 'VIEWING_TRACE') {\n return;\n }\n const currentFrame = this.selection && this.frameForSelection(this.selection);\n if (!currentFrame) {\n return;\n }\n const parsedTrace = this.#traceEngineModel.parsedTrace(this.#viewMode.traceIndex);\n if (!parsedTrace) {\n return;\n }\n let index = parsedTrace.Frames.frames.indexOf(currentFrame);\n console.assert(index >= 0, 'Can\\'t find current frame in the frame list');\n index = Platform.NumberUtilities.clamp(index + offset, 0, parsedTrace.Frames.frames.length - 1);\n const frame = parsedTrace.Frames.frames[index];\n this.#revealTimeRange(\n Trace.Helpers.Timing.microSecondsToMilliseconds(frame.startTime),\n Trace.Helpers.Timing.microSecondsToMilliseconds(frame.endTime));\n this.select(selectionFromEvent(frame));\n return true;\n }\n\n #announceSelectionToAria(oldSelection: TimelineSelection|null, newSelection: TimelineSelection|null): void {\n if (oldSelection !== null && newSelection === null) {\n UI.ARIAUtils.alert(i18nString(UIStrings.selectionCleared));\n }\n if (newSelection === null) {\n return;\n }\n\n if (selectionIsRange(newSelection)) {\n // We don't announce here; within the annotations code we announce when\n // the user creates a new time range selection. So if we also announce\n // here we will duplicate and overwhelm rather than be useful.\n return;\n }\n\n // Announce the type of event that was selected (special casing frames.)\n if (Trace.Types.Events.isLegacyTimelineFrame(newSelection.event)) {\n UI.ARIAUtils.alert(i18nString(UIStrings.frameSelected));\n return;\n }\n const name = Utils.EntryName.nameForEntry(newSelection.event);\n UI.ARIAUtils.alert(i18nString(UIStrings.eventSelected, {PH1: name}));\n }\n\n select(selection: TimelineSelection|null): void {\n this.#announceSelectionToAria(this.selection, selection);\n this.selection = selection;\n this.flameChart.setSelectionAndReveal(selection);\n }\n\n selectEntryAtTime(events: Trace.Types.Events.Event[]|null, time: number): void {\n if (!events) {\n return;\n }\n\n if (events.length === 0) {\n this.select(null);\n return;\n }\n\n // Find best match, then backtrack to the first visible entry.\n for (let index = Platform.ArrayUtilities.upperBound(events, time, (time, event) => time - event.ts) - 1; index >= 0;\n --index) {\n const event = events[index];\n const {endTime} = Trace.Helpers.Timing.eventTimingsMilliSeconds(event);\n if (Trace.Helpers.Trace.isTopLevelEvent(event) && endTime < time) {\n break;\n }\n if (ActiveFilters.instance().isVisible(event) && endTime >= time) {\n this.select(selectionFromEvent(event));\n return;\n }\n }\n this.select(null);\n }\n\n highlightEvent(event: Trace.Types.Events.Event|null): void {\n this.flameChart.highlightEvent(event);\n }\n\n #revealTimeRange(startTime: Trace.Types.Timing.MilliSeconds, endTime: Trace.Types.Timing.MilliSeconds): void {\n const traceBoundsState = TraceBounds.TraceBounds.BoundsManager.instance().state();\n if (!traceBoundsState) {\n return;\n }\n const traceWindow = traceBoundsState.milli.timelineTraceWindow;\n\n let offset = 0;\n if (traceWindow.max < endTime) {\n offset = endTime - traceWindow.max;\n } else if (traceWindow.min > startTime) {\n offset = startTime - traceWindow.min;\n }\n TraceBounds.TraceBounds.BoundsManager.instance().setTimelineVisibleWindow(\n Trace.Helpers.Timing.traceWindowFromMilliSeconds(\n Trace.Types.Timing.MilliSeconds(traceWindow.min + offset),\n Trace.Types.Timing.MilliSeconds(traceWindow.max + offset),\n ),\n {\n shouldAnimate: true,\n },\n );\n }\n\n private handleDrop(dataTransfer: DataTransfer): void {\n const items = dataTransfer.items;\n if (!items.length) {\n return;\n }\n const item = items[0];\n Host.userMetrics.actionTaken(Host.UserMetrics.Action.PerfPanelTraceImported);\n if (item.kind === 'string') {\n const url = dataTransfer.getData('text/uri-list') as Platform.DevToolsPath.UrlString;\n if (new Common.ParsedURL.ParsedURL(url).isValid) {\n void this.loadFromURL(url);\n }\n } else if (item.kind === 'file') {\n const file = items[0].getAsFile();\n if (!file) {\n return;\n }\n void this.loadFromFile(file);\n }\n }\n}\n\nexport const enum State {\n IDLE = 'Idle',\n START_PENDING = 'StartPending',\n RECORDING = 'Recording',\n STOP_PENDING = 'StopPending',\n LOADING = 'Loading',\n RECORDING_FAILED = 'RecordingFailed',\n}\n\n// Define row and header height, should be in sync with styles for timeline graphs.\nexport const rowHeight = 18;\n\nexport const headerHeight = 20;\nexport interface TimelineModeViewDelegate {\n select(selection: TimelineSelection|null): void;\n element: Element;\n selectEntryAtTime(events: Trace.Types.Events.Event[]|null, time: number): void;\n highlightEvent(event: Trace.Types.Events.Event|null): void;\n}\n\nexport class StatusPane extends UI.Widget.VBox {\n private status: HTMLElement;\n private time: Element|undefined;\n private progressLabel!: Element;\n private progressBar!: Element;\n private readonly description: HTMLElement|undefined;\n private button: Buttons.Button.Button;\n private downloadTraceButton: Buttons.Button.Button;\n private startTime!: number;\n private timeUpdateTimer?: number;\n #rawEvents?: Trace.Types.Events.Event[];\n\n constructor(\n options: {\n showTimer?: boolean,\n showProgress?: boolean,\n description?: string,\n buttonText?: string,\n buttonDisabled?: boolean,\n },\n buttonCallback: () => (Promise| void)) {\n super(true);\n\n this.contentElement.classList.add('timeline-status-dialog');\n this.contentElement.setAttribute('jslog', `${VisualLogging.dialog('timeline-status').track({resize: true})}`);\n\n const statusLine = this.contentElement.createChild('div', 'status-dialog-line status');\n statusLine.createChild('div', 'label').textContent = i18nString(UIStrings.status);\n this.status = statusLine.createChild('div', 'content');\n UI.ARIAUtils.markAsStatus(this.status);\n\n if (options.showTimer) {\n const timeLine = this.contentElement.createChild('div', 'status-dialog-line time');\n timeLine.createChild('div', 'label').textContent = i18nString(UIStrings.time);\n this.time = timeLine.createChild('div', 'content');\n }\n\n if (options.showProgress) {\n const progressLine = this.contentElement.createChild('div', 'status-dialog-line progress');\n this.progressLabel = progressLine.createChild('div', 'label');\n this.progressBar = progressLine.createChild('div', 'indicator-container').createChild('div', 'indicator');\n UI.ARIAUtils.markAsProgressBar(this.progressBar);\n }\n\n if (typeof options.description === 'string') {\n const descriptionLine = this.contentElement.createChild('div', 'status-dialog-line description');\n descriptionLine.createChild('div', 'label').textContent = i18nString(UIStrings.description);\n this.description = descriptionLine.createChild('div', 'content');\n this.description.innerText = options.description;\n }\n\n const buttonContainer = this.contentElement.createChild('div', 'stop-button');\n this.downloadTraceButton = UI.UIUtils.createTextButton(i18nString(UIStrings.downloadAfterError), () => {\n void this.#downloadRawTraceAfterError();\n }, {jslogContext: 'timeline.download-after-error'});\n\n this.downloadTraceButton.disabled = true;\n this.downloadTraceButton.style.visibility = 'hidden';\n\n const buttonText = options.buttonText || i18nString(UIStrings.stop);\n this.button = UI.UIUtils.createTextButton(buttonText, buttonCallback, {\n jslogContext: 'timeline.stop-recording',\n });\n // Profiling can't be stopped during initialization.\n this.button.disabled = !options.buttonDisabled === false;\n\n buttonContainer.append(this.downloadTraceButton);\n buttonContainer.append(this.button);\n }\n\n finish(): void {\n this.stopTimer();\n this.button.disabled = true;\n }\n\n async #downloadRawTraceAfterError(): Promise {\n if (!this.#rawEvents || this.#rawEvents.length === 0) {\n return;\n }\n const traceStart = Platform.DateUtilities.toISO8601Compact(new Date());\n const fileName = `Trace-Load-Error-${traceStart}.json` as Platform.DevToolsPath.RawPathString;\n const formattedTraceIter = traceJsonGenerator(this.#rawEvents, {});\n const traceAsString = Array.from(formattedTraceIter).join('');\n await Workspace.FileManager.FileManager.instance().save(\n fileName, traceAsString, true /* forceSaveAs */, false /* isBase64 */);\n Workspace.FileManager.FileManager.instance().close(fileName);\n }\n\n enableDownloadOfEvents(rawEvents: Trace.Types.Events.Event[]): void {\n this.#rawEvents = rawEvents;\n this.downloadTraceButton.disabled = false;\n this.downloadTraceButton.style.visibility = 'visible';\n }\n\n remove(): void {\n if (this.element.parentNode) {\n (this.element.parentNode as HTMLElement).classList.remove('tinted');\n this.arrangeDialog((this.element.parentNode as HTMLElement));\n }\n this.stopTimer();\n this.element.remove();\n }\n\n showPane(parent: Element): void {\n this.arrangeDialog(parent);\n this.show(parent);\n parent.classList.add('tinted');\n }\n\n enableAndFocusButton(): void {\n this.button.disabled = false;\n this.button.focus();\n }\n\n updateStatus(text: string): void {\n this.status.textContent = text;\n }\n\n updateProgressBar(activity: string, percent: number): void {\n this.progressLabel.textContent = activity;\n (this.progressBar as HTMLElement).style.width = percent.toFixed(1) + '%';\n UI.ARIAUtils.setValueNow(this.progressBar, percent);\n this.updateTimer();\n }\n\n startTimer(): void {\n this.startTime = Date.now();\n this.timeUpdateTimer = window.setInterval(this.updateTimer.bind(this), 100);\n this.updateTimer();\n }\n\n private stopTimer(): void {\n if (!this.timeUpdateTimer) {\n return;\n }\n clearInterval(this.timeUpdateTimer);\n this.updateTimer();\n delete this.timeUpdateTimer;\n }\n\n private updateTimer(): void {\n this.arrangeDialog((this.element.parentNode as HTMLElement));\n if (!this.timeUpdateTimer || !this.time) {\n return;\n }\n\n const seconds = (Date.now() - this.startTime) / 1000;\n this.time.textContent = i18n.TimeUtilities.preciseSecondsToString(seconds, 1);\n }\n\n private arrangeDialog(parent: Element): void {\n const isSmallDialog = parent.clientWidth < 325;\n this.element.classList.toggle('small-dialog', isSmallDialog);\n this.contentElement.classList.toggle('small-dialog', isSmallDialog);\n }\n override wasShown(): void {\n super.wasShown();\n this.registerCSSFiles([timelineStatusDialogStyles]);\n }\n}\n\nlet loadTimelineHandlerInstance: LoadTimelineHandler;\n\nexport class LoadTimelineHandler implements Common.QueryParamHandler.QueryParamHandler {\n static instance(opts: {\n forceNew: boolean|null,\n } = {forceNew: null}): LoadTimelineHandler {\n const {forceNew} = opts;\n if (!loadTimelineHandlerInstance || forceNew) {\n loadTimelineHandlerInstance = new LoadTimelineHandler();\n }\n\n return loadTimelineHandlerInstance;\n }\n\n handleQueryParam(value: string): void {\n void UI.ViewManager.ViewManager.instance().showView('timeline').then(async () => {\n await TimelinePanel.instance().loadFromURL(window.decodeURIComponent(value) as Platform.DevToolsPath.UrlString);\n });\n }\n}\n\nexport class TraceRevealer implements Common.Revealer.Revealer {\n async reveal(trace: SDK.TraceObject.TraceObject): Promise {\n await UI.ViewManager.ViewManager.instance().showView('timeline');\n TimelinePanel.instance().loadFromEvents(trace.traceEvents);\n }\n}\n\nexport class EventRevealer implements Common.Revealer.Revealer {\n async reveal(rEvent: SDK.TraceObject.RevealableEvent): Promise {\n await UI.ViewManager.ViewManager.instance().showView('timeline');\n TimelinePanel.instance().select(selectionFromEvent(rEvent.event));\n }\n}\n\nexport class ActionDelegate implements UI.ActionRegistration.ActionDelegate {\n handleAction(context: UI.Context.Context, actionId: string): boolean {\n const panel = context.flavor(TimelinePanel);\n if (panel === null) {\n return false;\n }\n switch (actionId) {\n case 'timeline.toggle-recording':\n void panel.toggleRecording();\n return true;\n case 'timeline.record-reload':\n panel.recordReload();\n return true;\n case 'timeline.save-to-file':\n void panel.saveToFile();\n return true;\n case 'timeline.load-from-file':\n panel.selectFileToLoad();\n return true;\n case 'timeline.jump-to-previous-frame':\n panel.jumpToFrame(-1);\n return true;\n case 'timeline.jump-to-next-frame':\n panel.jumpToFrame(1);\n return true;\n case 'timeline.show-history':\n void panel.showHistoryDropdown();\n return true;\n case 'timeline.previous-recording':\n panel.navigateHistory(1);\n return true;\n case 'timeline.next-recording':\n panel.navigateHistory(-1);\n return true;\n }\n return false;\n }\n}\n"]} \ No newline at end of file +{"version":3,"file":"TimelinePanel.js","sourceRoot":"","sources":["../../../../../../front_end/panels/timeline/TimelinePanel.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAEH,OAAO,KAAK,MAAM,MAAM,6BAA6B,CAAC;AACtD,OAAO,KAAK,IAAI,MAAM,yBAAyB,CAAC;AAChD,OAAO,KAAK,IAAI,MAAM,yBAAyB,CAAC;AAChD,OAAO,KAAK,QAAQ,MAAM,iCAAi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ACd,KAAK,uBAAuB;gBAC1B,KAAK,KAAK,CAAC,UAAU,EAAE,CAAC;gBACxB,OAAO,IAAI,CAAC;YACd,KAAK,yBAAyB;gBAC5B,KAAK,CAAC,gBAAgB,EAAE,CAAC;gBACzB,OAAO,IAAI,CAAC;YACd,KAAK,iCAAiC;gBACpC,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC;gBACtB,OAAO,IAAI,CAAC;YACd,KAAK,6BAA6B;gBAChC,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;gBACrB,OAAO,IAAI,CAAC;YACd,KAAK,uBAAuB;gBAC1B,KAAK,KAAK,CAAC,mBAAmB,EAAE,CAAC;gBACjC,OAAO,IAAI,CAAC;YACd,KAAK,6BAA6B;gBAChC,KAAK,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC;gBACzB,OAAO,IAAI,CAAC;YACd,KAAK,yBAAyB;gBAC5B,KAAK,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,CAAC;gBAC1B,OAAO,IAAI,CAAC;QAChB,CAAC;QACD,OAAO,KAAK,CAAC;IACf,CAAC;CACF","sourcesContent":["// Copyright 2021 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\n/*\n * Copyright (C) 2012 Google Inc. All rights reserved.\n * Copyright (C) 2012 Intel Inc. All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are\n * met:\n *\n * * Redistributions of source code must retain the above copyright\n * notice, this list of conditions and the following disclaimer.\n * * Redistributions in binary form must reproduce the above\n * copyright notice, this list of conditions and the following disclaimer\n * in the documentation and/or other materials provided with the\n * distribution.\n * * Neither the name of Google Inc. nor the names of its\n * contributors may be used to endorse or promote products derived from\n * this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nimport * as Common from '../../core/common/common.js';\nimport * as Host from '../../core/host/host.js';\nimport * as i18n from '../../core/i18n/i18n.js';\nimport * as Platform from '../../core/platform/platform.js';\nimport * as Root from '../../core/root/root.js';\nimport * as SDK from '../../core/sdk/sdk.js';\nimport type * as Protocol from '../../generated/protocol.js';\nimport * as CrUXManager from '../../models/crux-manager/crux-manager.js';\nimport * as Trace from '../../models/trace/trace.js';\nimport * as Workspace from '../../models/workspace/workspace.js';\nimport * as TraceBounds from '../../services/trace_bounds/trace_bounds.js';\nimport * as Adorners from '../../ui/components/adorners/adorners.js';\nimport type * as Buttons from '../../ui/components/buttons/buttons.js';\nimport * as Dialogs from '../../ui/components/dialogs/dialogs.js';\nimport * as LegacyWrapper from '../../ui/components/legacy_wrapper/legacy_wrapper.js';\nimport * as PerfUI from '../../ui/legacy/components/perf_ui/perf_ui.js';\nimport * as UI from '../../ui/legacy/legacy.js';\nimport * as ThemeSupport from '../../ui/legacy/theme_support/theme_support.js';\nimport * as VisualLogging from '../../ui/visual_logging/visual_logging.js';\nimport * as MobileThrottling from '../mobile_throttling/mobile_throttling.js';\n\nimport {ActiveFilters} from './ActiveFilters.js';\nimport * as AnnotationHelpers from './AnnotationHelpers.js';\nimport {TraceLoadEvent} from './BenchmarkEvents.js';\nimport * as TimelineComponents from './components/components.js';\nimport * as TimelineInsights from './components/insights/insights.js';\nimport {SHOULD_SHOW_EASTER_EGG} from './EasterEgg.js';\nimport {Tracker} from './FreshRecording.js';\nimport historyToolbarButtonStyles from './historyToolbarButton.css.js';\nimport {IsolateSelector} from './IsolateSelector.js';\nimport {AnnotationModifiedEvent, ModificationsManager} from './ModificationsManager.js';\nimport * as Overlays from './overlays/overlays.js';\nimport {cpuprofileJsonGenerator, traceJsonGenerator} from './SaveFileFormatter.js';\nimport {type Client, TimelineController} from './TimelineController.js';\nimport type {TimelineFlameChartDataProvider} from './TimelineFlameChartDataProvider.js';\nimport {TimelineFlameChartView} from './TimelineFlameChartView.js';\nimport {TimelineHistoryManager} from './TimelineHistoryManager.js';\nimport {TimelineLoader} from './TimelineLoader.js';\nimport {TimelineMiniMap} from './TimelineMiniMap.js';\nimport timelinePanelStyles from './timelinePanel.css.js';\nimport {\n rangeForSelection,\n selectionFromEvent,\n selectionIsRange,\n type TimelineSelection,\n} from './TimelineSelection.js';\nimport timelineStatusDialogStyles from './timelineStatusDialog.css.js';\nimport {TimelineUIUtils} from './TimelineUIUtils.js';\nimport {UIDevtoolsController} from './UIDevtoolsController.js';\nimport {UIDevtoolsUtils} from './UIDevtoolsUtils.js';\nimport * as Utils from './utils/utils.js';\n\nconst UIStrings = {\n /**\n *@description Text that appears when user drag and drop something (for example, a file) in Timeline Panel of the Performance panel\n */\n dropTimelineFileOrUrlHere: 'Drop timeline file or URL here',\n /**\n *@description Title of disable capture jsprofile setting in timeline panel of the performance panel\n */\n disableJavascriptSamples: 'Disable JavaScript samples',\n /**\n *@description Title of capture layers and pictures setting in timeline panel of the performance panel\n */\n enableAdvancedPaint: 'Enable advanced paint instrumentation (slow)',\n /**\n *@description Title of CSS selector stats setting in timeline panel of the performance panel\n */\n enableSelectorStats: 'Enable CSS selector stats (slow)',\n /**\n *@description Title of show screenshots setting in timeline panel of the performance panel\n */\n screenshots: 'Screenshots',\n /**\n *@description Text for the memory of the page\n */\n memory: 'Memory',\n /**\n *@description Text to clear content\n */\n clear: 'Clear',\n /**\n *@description A label for a button that fixes something.\n */\n fixMe: 'Fix me',\n /**\n *@description Tooltip text that appears when hovering over the largeicon load button\n */\n loadProfile: 'Load profile…',\n /**\n *@description Tooltip text that appears when hovering over the largeicon download button\n */\n saveProfile: 'Save profile…',\n /**\n *@description An option to save trace with annotations that appears in the menu of the toolbar download button. This is the expected default option, therefore it does not mention annotations.\n */\n saveTraceWithAnnotationsMenuOption: 'Save trace',\n /**\n *@description An option to save trace without annotations that appears in the menu of the toolbar download button\n */\n saveTraceWithoutAnnotationsMenuOption: 'Save trace without annotations',\n /**\n *@description Text to take screenshots\n */\n captureScreenshots: 'Capture screenshots',\n /**\n *@description Text in Timeline Panel of the Performance panel\n */\n showMemoryTimeline: 'Show memory timeline',\n /**\n *@description Tooltip text that appears when hovering over the largeicon settings gear in show settings pane setting in timeline panel of the performance panel\n */\n captureSettings: 'Capture settings',\n /**\n *@description Text in Timeline Panel of the Performance panel\n */\n disablesJavascriptSampling: 'Disables JavaScript sampling, reduces overhead when running against mobile devices',\n /**\n *@description Text in Timeline Panel of the Performance panel\n */\n capturesAdvancedPaint: 'Captures advanced paint instrumentation, introduces significant performance overhead',\n /**\n *@description Text in Timeline Panel of the Performance panel\n */\n capturesSelectorStats: 'Captures CSS selector statistics',\n /**\n *@description Text in Timeline Panel of the Performance panel\n */\n network: 'Network:',\n /**\n *@description Text in Timeline Panel of the Performance panel\n */\n cpu: 'CPU:',\n /**\n *@description Title of the 'Network conditions' tool in the bottom drawer\n */\n networkConditions: 'Network conditions',\n /**\n *@description Text in Timeline Panel of the Performance panel\n *@example {wrong format} PH1\n *@example {ERROR_FILE_NOT_FOUND} PH2\n */\n failedToSaveTimelineSS: 'Failed to save timeline: {PH1} ({PH2})',\n /**\n *@description Text in Timeline Panel of the Performance panel\n */\n CpuThrottlingIsEnabled: '- CPU throttling is enabled',\n /**\n *@description Text in Timeline Panel of the Performance panel\n */\n NetworkThrottlingIsEnabled: '- Network throttling is enabled',\n /**\n *@description Text in Timeline Panel of the Performance panel\n */\n SignificantOverheadDueToPaint: '- Significant overhead due to paint instrumentation',\n /**\n *@description Text in Timeline Panel of the Performance panel\n */\n SelectorStatsEnabled: '- Selector stats is enabled',\n /**\n *@description Text in Timeline Panel of the Performance panel\n */\n JavascriptSamplingIsDisabled: '- JavaScript sampling is disabled',\n /**\n *@description Text in Timeline Panel of the Performance panel\n */\n stoppingTimeline: 'Stopping timeline…',\n /**\n *@description Text in Timeline Panel of the Performance panel\n */\n received: 'Received',\n /**\n *@description Text in Timeline Panel of the Performance panel\n */\n processed: 'Processed',\n /**\n *@description Text to close something\n */\n close: 'Close',\n /**\n *@description Text to download the raw trace files after an error\n */\n downloadAfterError: 'Download raw trace events',\n /**\n *@description Status text to indicate the recording has failed in the Performance panel\n */\n recordingFailed: 'Recording failed',\n /**\n * @description Text to indicate the progress of a profile. Informs the user that we are currently\n * creating a peformance profile.\n */\n profiling: 'Profiling…',\n /**\n *@description Text in Timeline Panel of the Performance panel\n */\n bufferUsage: 'Buffer usage',\n /**\n *@description Text in Timeline Panel of the Performance panel\n */\n loadingProfile: 'Loading profile…',\n /**\n *@description Text in Timeline Panel of the Performance panel\n */\n processingProfile: 'Processing profile…',\n /**\n *@description Text in Timeline Panel of the Performance panel\n */\n initializingProfiler: 'Initializing profiler…',\n /**\n *@description Text for the status of something\n */\n status: 'Status',\n /**\n *@description Text that refers to the time\n */\n time: 'Time',\n /**\n *@description Text for the description of something\n */\n description: 'Description',\n /**\n *@description Text of an item that stops the running task\n */\n stop: 'Stop',\n /**\n *\n * @description Text for exporting basic traces\n */\n exportNormalTraces: 'Basic performance traces',\n /**\n *\n * @description Text for exporting enhanced traces\n */\n exportEnhancedTraces: 'Enhanced performance traces',\n /**\n *@description Tooltip description for a checkbox that toggles the visibility of data added by extensions of this panel (Performance).\n */\n showDataAddedByExtensions: 'Show data added by extensions of the Performance panel',\n /**\n Label for a checkbox that toggles the visibility of data added by extensions of this panel (Performance).\n */\n showCustomtracks: 'Show custom tracks',\n\n /**\n * @description Tooltip for the the sidebar toggle in the Performance panel. Command to open/show the sidebar.\n */\n showSidebar: 'Show sidebar',\n /**\n * @description Tooltip for the the sidebar toggle in the Performance panel. Command to close the sidebar.\n */\n hideSidebar: 'Hide sidebar',\n /**\n * @description Screen reader announcement when the sidebar is shown in the Performance panel.\n */\n sidebarShown: 'Performance sidebar shown',\n /**\n * @description Screen reader announcement when the sidebar is hidden in the Performance panel.\n */\n sidebarHidden: 'Performance sidebar hidden',\n /**\n * @description Screen reader announcement when the user clears their selection\n */\n selectionCleared: 'Selection cleared',\n /**\n * @description Screen reader announcement when the user selects a frame.\n */\n frameSelected: 'Frame selected',\n /**\n * @description Screen reader announcement when the user selects a trace event.\n * @example {Paint} PH1\n */\n eventSelected: 'Event {PH1} selected',\n /**\n *@description Text of a hyperlink to documentation.\n */\n learnMore: 'Learn more',\n /**\n * @description Tooltip text for a button that takes the user back to the default view which shows performance metrics that are live.\n */\n backToLiveMetrics: 'Go back to the live metrics page',\n /**\n * @description Description of the Timeline in/out zoom action that appears in the Performance panel shortcuts dialog.\n */\n timelineZoomInOut: 'Timeline zoom in/out',\n /**\n * @description Description of the Timeline fast in/out zoom action that appears in the Performance panel shortcuts dialog.\n */\n timelineFastZoomInOut: 'Timeline fast zoom in/out',\n /**\n * @description Description of the Timeline up/down scroll action that appears in the Performance panel shortcuts dialog.\n */\n timelineScrollUpDown: 'Timeline up/down',\n /**\n * @description Description of the Timeline right/left panning action that appears in the Performance panel shortcuts dialog.\n */\n timelinePanLeftRight: 'Timeline right/left',\n /**\n * @description Title for the Dim 3rd Parties checkbox.\n */\n dimThirdParties: 'Dim 3rd Parties',\n};\nconst str_ = i18n.i18n.registerUIStrings('panels/timeline/TimelinePanel.ts', UIStrings);\nconst i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);\n\nlet timelinePanelInstance: TimelinePanel;\nlet isNode: boolean;\n\n/**\n * Represents the states that the timeline panel can be in.\n * If you need to change the panel's view, use the {@see #changeView} method.\n * Note that we do not represent the \"Loading/Processing\" view here. The\n * StatusPane is managed in the code that handles file import/recording, and\n * when it is visible it is rendered on top of the UI so obscures what is behind\n * it. When it completes, we will set the view mode to the trace that has been\n * loaded.\n */\ntype ViewMode = {\n mode: 'LANDING_PAGE',\n}|{\n mode: 'VIEWING_TRACE',\n traceIndex: number,\n}|{\n mode: 'STATUS_PANE_OVERLAY',\n};\n\nexport class TimelinePanel extends UI.Panel.Panel implements Client, TimelineModeViewDelegate {\n private readonly dropTarget: UI.DropTarget.DropTarget;\n private readonly recordingOptionUIControls: UI.Toolbar.ToolbarItem[];\n private state: State;\n private recordingPageReload: boolean;\n private readonly millisecondsToRecordAfterLoadEvent: number;\n private readonly toggleRecordAction: UI.ActionRegistration.Action;\n private readonly recordReloadAction: UI.ActionRegistration.Action;\n readonly #historyManager: TimelineHistoryManager;\n private disableCaptureJSProfileSetting: Common.Settings.Setting;\n private readonly captureLayersAndPicturesSetting: Common.Settings.Setting;\n private readonly captureSelectorStatsSetting: Common.Settings.Setting;\n readonly #thirdPartyTracksSetting: Common.Settings.Setting;\n private showScreenshotsSetting: Common.Settings.Setting;\n private showMemorySetting: Common.Settings.Setting;\n private readonly panelToolbar: UI.Toolbar.Toolbar;\n private readonly panelRightToolbar: UI.Toolbar.Toolbar;\n private readonly timelinePane: UI.Widget.VBox;\n readonly #minimapComponent = new TimelineMiniMap();\n #viewMode: ViewMode = {mode: 'LANDING_PAGE'};\n readonly #dimThirdPartiesSetting: Common.Settings.Setting|null = null;\n\n /**\n * We get given any filters for a new trace when it is recorded/imported.\n * Because the user can then use the dropdown to navigate to another trace,\n * we store the filters by the trace index, so if the user then navigates back\n * to a previous trace we can reinstate the filters from this map.\n */\n #exclusiveFilterPerTrace: Map = new Map();\n /**\n * This widget holds the timeline sidebar which shows Insights & Annotations,\n * and the main UI which shows the timeline\n */\n readonly #splitWidget = new UI.SplitWidget.SplitWidget(\n true, // isVertical\n false, // secondIsSidebar\n 'timeline-panel-sidebar-state', // settingName (to persist the open/closed state for the user)\n TimelineComponents.Sidebar.DEFAULT_SIDEBAR_WIDTH_PX,\n );\n private readonly statusPaneContainer: HTMLElement;\n private readonly flameChart: TimelineFlameChartView;\n private readonly searchableViewInternal: UI.SearchableView.SearchableView;\n private showSettingsPaneButton!: UI.Toolbar.ToolbarSettingToggle;\n private showSettingsPaneSetting!: Common.Settings.Setting;\n private settingsPane!: UI.Widget.Widget;\n private controller!: TimelineController|null;\n private cpuProfiler!: SDK.CPUProfilerModel.CPUProfilerModel|null;\n private clearButton!: UI.Toolbar.ToolbarButton;\n private brickBreakerToolbarButton: UI.Toolbar.ToolbarButton;\n private brickBreakerToolbarButtonAdded = false;\n private loadButton!: UI.Toolbar.ToolbarButton;\n private saveButton!: UI.Toolbar.ToolbarButton|UI.Toolbar.ToolbarMenuButton;\n private homeButton?: UI.Toolbar.ToolbarButton;\n private statusPane!: StatusPane|null;\n private landingPage!: UI.Widget.Widget;\n private loader?: TimelineLoader;\n private showScreenshotsToolbarCheckbox?: UI.Toolbar.ToolbarItem;\n private showMemoryToolbarCheckbox?: UI.Toolbar.ToolbarItem;\n private networkThrottlingSelect?: MobileThrottling.ThrottlingManager.NetworkThrottlingSelectorWrapper;\n private cpuThrottlingSelect?: MobileThrottling.ThrottlingManager.CPUThrottlingSelectorWrapper;\n private fileSelectorElement?: HTMLInputElement;\n private selection: TimelineSelection|null = null;\n private traceLoadStart!: Trace.Types.Timing.MilliSeconds|null;\n private primaryPageTargetPromiseCallback = (_target: SDK.Target.Target): void => {};\n // Note: this is technically unused, but we need it to define the promiseCallback function above.\n private primaryPageTargetPromise = new Promise(res => {\n this.primaryPageTargetPromiseCallback = res;\n });\n\n #traceEngineModel: Trace.TraceModel.Model;\n #sourceMapsResolver: Utils.SourceMapsResolver.SourceMapsResolver|null = null;\n #entityMapper: Utils.EntityMapper.EntityMapper|null = null;\n #onSourceMapsNodeNamesResolvedBound = this.#onSourceMapsNodeNamesResolved.bind(this);\n readonly #onChartPlayableStateChangeBound: (event: Common.EventTarget.EventTargetEvent) => void;\n #sidebarToggleButton = this.#splitWidget.createShowHideSidebarButton(\n i18nString(UIStrings.showSidebar),\n i18nString(UIStrings.hideSidebar),\n // These are used to announce to screen-readers and not shown visibly.\n i18nString(UIStrings.sidebarShown),\n i18nString(UIStrings.sidebarHidden),\n 'timeline.sidebar', // jslog context\n );\n\n #sideBar = new TimelineComponents.Sidebar.SidebarWidget();\n /**\n * Rather than auto-pop the sidebar every time the user records a trace,\n * which could get annoying, we instead persist the state of the sidebar\n * visibility to a setting so it's restored across sessions.\n * However, sometimes we have to automatically hide the sidebar, like when a\n * trace recording is happening, or the user is on the landing page. In those\n * times, we toggle this flag to true. Then, when we enter the VIEWING_TRACE\n * mode, we check this flag and pop the sidebar open if it's set to true.\n * Longer term a better fix here would be to divide the 3 UI screens\n * (status pane, landing page, trace view) into distinct components /\n * widgets, to avoid this complexity.\n */\n #restoreSidebarVisibilityOnTraceLoad: boolean = false;\n\n /**\n * Used to track an aria announcement that we need to alert for\n * screen-readers. We track these because we debounce announcements to not\n * overwhelm.\n */\n #pendingAriaMessage: string|null = null;\n\n #eventToRelatedInsights: TimelineComponents.RelatedInsightChips.EventToRelatedInsightsMap = new Map();\n #shortcutsDialog: Dialogs.ShortcutDialog.ShortcutDialog = new Dialogs.ShortcutDialog.ShortcutDialog();\n /**\n * Track if the user has opened the shortcuts dialog before. We do this so that the\n * very first time the performance panel is open after the shortcuts dialog ships, we can\n * automatically pop it open to aid discovery.\n */\n #userHadShortcutsDialogOpenedOnce = Common.Settings.Settings.instance().createSetting(\n 'timeline.user-had-shortcuts-dialog-opened-once', false);\n /**\n * Navigation radio buttons located in the shortcuts dialog.\n */\n #navigationRadioButtons = document.createElement('form');\n #modernNavRadioButton =\n UI.UIUtils.createRadioButton('flamechart-selected-navigation', 'Modern', 'timeline.select-modern-navigation');\n #classicNavRadioButton =\n UI.UIUtils.createRadioButton('flamechart-selected-navigation', 'Classic', 'timeline.select-classic-navigation');\n\n #onMainEntryHovered: (event: Common.EventTarget.EventTargetEvent) => void;\n\n constructor() {\n super('timeline');\n const adornerContent = document.createElement('span');\n adornerContent.innerHTML = `
💫
`;\n const adorner = new Adorners.Adorner.Adorner();\n adorner.classList.add('fix-perf-icon');\n adorner.data = {\n name: i18nString(UIStrings.fixMe),\n content: adornerContent,\n };\n this.brickBreakerToolbarButton = new UI.Toolbar.ToolbarButton(i18nString(UIStrings.fixMe), adorner);\n this.brickBreakerToolbarButton.addEventListener(\n UI.Toolbar.ToolbarButton.Events.CLICK, () => this.#onBrickBreakerEasterEggClick());\n\n this.#traceEngineModel = this.#instantiateNewModel();\n this.#listenForProcessingProgress();\n\n this.element.addEventListener('contextmenu', this.contextMenu.bind(this), false);\n this.dropTarget = new UI.DropTarget.DropTarget(\n this.element, [UI.DropTarget.Type.File, UI.DropTarget.Type.URI],\n i18nString(UIStrings.dropTimelineFileOrUrlHere), this.handleDrop.bind(this));\n\n this.recordingOptionUIControls = [];\n this.state = State.IDLE;\n this.recordingPageReload = false;\n this.millisecondsToRecordAfterLoadEvent = 5000;\n this.toggleRecordAction = UI.ActionRegistry.ActionRegistry.instance().getAction('timeline.toggle-recording');\n this.recordReloadAction = UI.ActionRegistry.ActionRegistry.instance().getAction('timeline.record-reload');\n\n this.#historyManager = new TimelineHistoryManager(this.#minimapComponent, isNode);\n\n this.traceLoadStart = null;\n\n this.disableCaptureJSProfileSetting =\n Common.Settings.Settings.instance().createSetting('timeline-disable-js-sampling', false);\n this.disableCaptureJSProfileSetting.setTitle(i18nString(UIStrings.disableJavascriptSamples));\n this.captureLayersAndPicturesSetting = Common.Settings.Settings.instance().createSetting(\n 'timeline-capture-layers-and-pictures', false, Common.Settings.SettingStorageType.SESSION);\n this.captureLayersAndPicturesSetting.setTitle(i18nString(UIStrings.enableAdvancedPaint));\n this.captureSelectorStatsSetting = Common.Settings.Settings.instance().createSetting(\n 'timeline-capture-selector-stats', false, Common.Settings.SettingStorageType.SESSION);\n this.captureSelectorStatsSetting.setTitle(i18nString(UIStrings.enableSelectorStats));\n\n this.showScreenshotsSetting =\n Common.Settings.Settings.instance().createSetting('timeline-show-screenshots', isNode ? false : true);\n this.showScreenshotsSetting.setTitle(i18nString(UIStrings.screenshots));\n this.showScreenshotsSetting.addChangeListener(this.updateMiniMap, this);\n\n this.showMemorySetting = Common.Settings.Settings.instance().createSetting('timeline-show-memory', false);\n this.showMemorySetting.setTitle(i18nString(UIStrings.memory));\n this.showMemorySetting.addChangeListener(this.onMemoryModeChanged, this);\n\n if (Root.Runtime.experiments.isEnabled(Root.Runtime.ExperimentName.TIMELINE_THIRD_PARTY_DEPENDENCIES)) {\n this.#dimThirdPartiesSetting =\n Common.Settings.Settings.instance().createSetting('timeline-dim-third-parties', false);\n this.#dimThirdPartiesSetting.setTitle(i18nString(UIStrings.dimThirdParties));\n this.#dimThirdPartiesSetting.addChangeListener(this.onDimThirdPartiesChanged, this);\n }\n\n this.#thirdPartyTracksSetting = TimelinePanel.extensionDataVisibilitySetting();\n this.#thirdPartyTracksSetting.addChangeListener(this.#extensionDataVisibilityChanged, this);\n this.#thirdPartyTracksSetting.setTitle(i18nString(UIStrings.showCustomtracks));\n\n const timelineToolbarContainer = this.element.createChild('div', 'timeline-toolbar-container');\n timelineToolbarContainer.setAttribute('jslog', `${VisualLogging.toolbar()}`);\n this.panelToolbar = new UI.Toolbar.Toolbar('timeline-main-toolbar', timelineToolbarContainer);\n this.panelToolbar.makeWrappable(true);\n this.panelRightToolbar = new UI.Toolbar.Toolbar('', timelineToolbarContainer);\n if (!isNode) {\n this.createSettingsPane();\n this.updateShowSettingsToolbarButton();\n }\n this.timelinePane = new UI.Widget.VBox();\n const topPaneElement = this.timelinePane.element.createChild('div', 'hbox');\n topPaneElement.id = 'timeline-overview-panel';\n\n this.#minimapComponent.show(topPaneElement);\n this.#minimapComponent.addEventListener(PerfUI.TimelineOverviewPane.Events.OVERVIEW_PANE_MOUSE_MOVE, event => {\n this.flameChart.addTimestampMarkerOverlay(event.data.timeInMicroSeconds);\n });\n this.#minimapComponent.addEventListener(PerfUI.TimelineOverviewPane.Events.OVERVIEW_PANE_MOUSE_LEAVE, async () => {\n await this.flameChart.removeTimestampMarkerOverlay();\n });\n\n this.statusPaneContainer = this.timelinePane.element.createChild('div', 'status-pane-container fill');\n\n this.createFileSelector();\n\n SDK.TargetManager.TargetManager.instance().addModelListener(\n SDK.ResourceTreeModel.ResourceTreeModel, SDK.ResourceTreeModel.Events.Load, this.loadEventFired, this);\n\n this.flameChart = new TimelineFlameChartView(this);\n this.#onChartPlayableStateChangeBound = this.#onChartPlayableStateChange.bind(this);\n this.element.addEventListener(\n 'toggle-popover', event => this.flameChart.togglePopover((event as CustomEvent).detail));\n\n this.flameChart.getMainFlameChart().addEventListener(\n PerfUI.FlameChart.Events.CHART_PLAYABLE_STATE_CHANGED, this.#onChartPlayableStateChangeBound, this);\n\n this.#onMainEntryHovered = this.#onEntryHovered.bind(this, this.flameChart.getMainDataProvider());\n this.flameChart.getMainFlameChart().addEventListener(\n PerfUI.FlameChart.Events.ENTRY_HOVERED, this.#onMainEntryHovered);\n\n this.searchableViewInternal = new UI.SearchableView.SearchableView(this.flameChart, null);\n this.searchableViewInternal.setMinimumSize(0, 100);\n this.searchableViewInternal.setMinimalSearchQuerySize(2); // At 1 it can introduce a bit of jank.\n this.searchableViewInternal.element.classList.add('searchable-view');\n this.searchableViewInternal.show(this.timelinePane.element);\n this.flameChart.show(this.searchableViewInternal.element);\n this.flameChart.setSearchableView(this.searchableViewInternal);\n this.searchableViewInternal.hideWidget();\n\n this.#splitWidget.setMainWidget(this.timelinePane);\n this.#splitWidget.setSidebarWidget(this.#sideBar);\n this.#splitWidget.enableShowModeSaving();\n this.#splitWidget.show(this.element);\n\n this.flameChart.overlays().addEventListener(Overlays.Overlays.TimeRangeMouseOverEvent.eventName, event => {\n const {overlay} = event as Overlays.Overlays.TimeRangeMouseOverEvent;\n const overlayBounds = Overlays.Overlays.traceWindowContainingOverlays([overlay]);\n if (!overlayBounds) {\n return;\n }\n this.#minimapComponent.highlightBounds(overlayBounds, /* withBracket */ false);\n });\n\n this.flameChart.overlays().addEventListener(Overlays.Overlays.TimeRangeMouseOutEvent.eventName, () => {\n this.#minimapComponent.clearBoundsHighlight();\n });\n\n this.#sideBar.element.addEventListener(TimelineInsights.SidebarInsight.InsightDeactivated.eventName, () => {\n this.#setActiveInsight(null);\n });\n\n this.#sideBar.element.addEventListener(TimelineInsights.SidebarInsight.InsightActivated.eventName, event => {\n const {model, insightSetKey} = event;\n this.#setActiveInsight({model, insightSetKey});\n });\n\n this.#sideBar.element.addEventListener(TimelineInsights.SidebarInsight.InsightProvideOverlays.eventName, event => {\n const {overlays, options} = event;\n\n this.flameChart.setOverlays(overlays, options);\n\n const overlaysBounds = Overlays.Overlays.traceWindowContainingOverlays(overlays);\n if (overlaysBounds) {\n this.#minimapComponent.highlightBounds(overlaysBounds, /* withBracket */ true);\n } else {\n this.#minimapComponent.clearBoundsHighlight();\n }\n });\n\n this.flameChart.element.addEventListener(TimelineInsights.EventRef.EventReferenceClick.eventName, event => {\n const fromTraceEvent = selectionFromEvent(event.event);\n this.flameChart.setSelectionAndReveal(fromTraceEvent);\n });\n\n this.#sideBar.contentElement.addEventListener(TimelineInsights.EventRef.EventReferenceClick.eventName, event => {\n this.select(selectionFromEvent(event.event));\n });\n\n this.#sideBar.element.addEventListener(TimelineComponents.Sidebar.RemoveAnnotation.eventName, event => {\n const {removedAnnotation} = (event as TimelineComponents.Sidebar.RemoveAnnotation);\n ModificationsManager.activeManager()?.removeAnnotation(removedAnnotation);\n });\n\n this.#sideBar.element.addEventListener(TimelineComponents.Sidebar.RevealAnnotation.eventName, event => {\n this.flameChart.revealAnnotation(event.annotation);\n });\n\n this.#sideBar.element.addEventListener(TimelineInsights.SidebarInsight.InsightSetHovered.eventName, event => {\n if (event.bounds) {\n this.#minimapComponent.highlightBounds(event.bounds, /* withBracket */ true);\n } else {\n this.#minimapComponent.clearBoundsHighlight();\n }\n });\n\n this.#sideBar.element.addEventListener(TimelineInsights.SidebarInsight.InsightSetZoom.eventName, event => {\n TraceBounds.TraceBounds.BoundsManager.instance().setTimelineVisibleWindow(\n event.bounds, {ignoreMiniMapBounds: true, shouldAnimate: true});\n });\n\n this.onMemoryModeChanged();\n this.populateToolbar();\n // The viewMode is set by default to the landing page, so we don't call\n // `#changeView` here and can instead directly call showLandingPage();\n this.#showLandingPage();\n this.updateTimelineControls();\n\n SDK.TargetManager.TargetManager.instance().addEventListener(\n SDK.TargetManager.Events.SUSPEND_STATE_CHANGED, this.onSuspendStateChanged, this);\n const profilerModels = SDK.TargetManager.TargetManager.instance().models(SDK.CPUProfilerModel.CPUProfilerModel);\n for (const model of profilerModels) {\n for (const message of model.registeredConsoleProfileMessages) {\n this.consoleProfileFinished(message);\n }\n }\n SDK.TargetManager.TargetManager.instance().observeModels(\n SDK.CPUProfilerModel.CPUProfilerModel,\n {\n modelAdded: (model: SDK.CPUProfilerModel.CPUProfilerModel) => {\n model.addEventListener(\n SDK.CPUProfilerModel.Events.CONSOLE_PROFILE_FINISHED, event => this.consoleProfileFinished(event.data));\n },\n modelRemoved: (_model: SDK.CPUProfilerModel.CPUProfilerModel) => {\n\n },\n },\n );\n SDK.TargetManager.TargetManager.instance().observeTargets({\n targetAdded: (target: SDK.Target.Target) => {\n if (target !== SDK.TargetManager.TargetManager.instance().primaryPageTarget()) {\n return;\n }\n this.primaryPageTargetPromiseCallback(target);\n },\n targetRemoved: (_: SDK.Target.Target) => {},\n });\n }\n\n #setActiveInsight(insight: TimelineComponents.Sidebar.ActiveInsight|null): void {\n if (insight) {\n this.#splitWidget.showBoth();\n }\n this.#sideBar.setActiveInsight(insight);\n this.flameChart.setActiveInsight(insight);\n }\n\n static instance(opts: {\n forceNew: boolean|null,\n isNode: boolean,\n }|undefined = {forceNew: null, isNode: false}): TimelinePanel {\n const {forceNew, isNode: isNodeMode} = opts;\n isNode = isNodeMode;\n\n if (!timelinePanelInstance || forceNew) {\n timelinePanelInstance = new TimelinePanel();\n }\n\n return timelinePanelInstance;\n }\n\n #instantiateNewModel(): Trace.TraceModel.Model {\n const config = Trace.Types.Configuration.defaults();\n config.showAllEvents = Root.Runtime.experiments.isEnabled('timeline-show-all-events');\n config.includeRuntimeCallStats = Root.Runtime.experiments.isEnabled('timeline-v8-runtime-call-stats');\n config.debugMode = Root.Runtime.experiments.isEnabled(Root.Runtime.ExperimentName.TIMELINE_DEBUG_MODE);\n\n return Trace.TraceModel.Model.createWithAllHandlers(config);\n }\n\n static extensionDataVisibilitySetting(): Common.Settings.Setting {\n // Calling this multiple times doesn't recreate the setting.\n // Instead, after the second call, the cached setting is returned.\n return Common.Settings.Settings.instance().createSetting('timeline-show-extension-data', true);\n }\n override searchableView(): UI.SearchableView.SearchableView|null {\n return this.searchableViewInternal;\n }\n\n override wasShown(): void {\n super.wasShown();\n UI.Context.Context.instance().setFlavor(TimelinePanel, this);\n this.registerCSSFiles([timelinePanelStyles]);\n // Record the performance tool load time.\n Host.userMetrics.panelLoaded('timeline', 'DevTools.Launch.Timeline');\n\n const cruxManager = CrUXManager.CrUXManager.instance();\n cruxManager.addEventListener(CrUXManager.Events.FIELD_DATA_CHANGED, this.#onFieldDataChanged, this);\n this.#onFieldDataChanged();\n }\n\n override willHide(): void {\n UI.Context.Context.instance().setFlavor(TimelinePanel, null);\n this.#historyManager.cancelIfShowing();\n\n const cruxManager = CrUXManager.CrUXManager.instance();\n cruxManager.removeEventListener(CrUXManager.Events.FIELD_DATA_CHANGED, this.#onFieldDataChanged, this);\n }\n\n #onFieldDataChanged(): void {\n const recs = Utils.Helpers.getThrottlingRecommendations();\n this.cpuThrottlingSelect?.updateRecommendedRate(recs.cpuRate);\n this.networkThrottlingSelect?.updateRecommendedConditions(recs.networkConditions);\n }\n\n loadFromEvents(events: Trace.Types.Events.Event[]): void {\n if (this.state !== State.IDLE) {\n return;\n }\n this.prepareToLoadTimeline();\n this.loader = TimelineLoader.loadFromEvents(events, this);\n }\n\n getFlameChart(): TimelineFlameChartView {\n return this.flameChart;\n }\n\n getMinimap(): TimelineMiniMap {\n return this.#minimapComponent;\n }\n\n /**\n * Determine if two view modes are equivalent. Useful because if {@see\n * #changeView} gets called and the new mode is identical to the current,\n * we can bail without doing any UI updates.\n */\n #viewModesEquivalent(m1: ViewMode, m2: ViewMode): boolean {\n if (m1.mode === 'LANDING_PAGE' && m2.mode === 'LANDING_PAGE') {\n return true;\n }\n\n if (m1.mode === 'STATUS_PANE_OVERLAY' && m2.mode === 'STATUS_PANE_OVERLAY') {\n return true;\n }\n\n // VIEWING_TRACE views are only equivalent if their traceIndex is the same.\n if (m1.mode === 'VIEWING_TRACE' && m2.mode === 'VIEWING_TRACE' && m1.traceIndex === m2.traceIndex) {\n return true;\n }\n return false;\n }\n\n #uninstallSourceMapsResolver(): void {\n if (this.#sourceMapsResolver) {\n // this set of NodeNames is cached by PIDs, so we clear it so we don't\n // use incorrect names from another trace that might happen to share\n // PID/TIDs.\n Utils.SourceMapsResolver.SourceMapsResolver.clearResolvedNodeNames();\n\n this.#sourceMapsResolver.removeEventListener(\n Utils.SourceMapsResolver.SourceMappingsUpdated.eventName, this.#onSourceMapsNodeNamesResolvedBound);\n this.#sourceMapsResolver.uninstall();\n this.#sourceMapsResolver = null;\n }\n }\n\n #removeStatusPane(): void {\n if (this.statusPane) {\n this.statusPane.remove();\n }\n this.statusPane = null;\n }\n\n #changeView(newMode: ViewMode): void {\n if (this.#viewModesEquivalent(this.#viewMode, newMode)) {\n return;\n }\n\n if (this.#viewMode.mode === 'VIEWING_TRACE') {\n // If the current / about to be \"old\" view was viewing a trace\n // we also uninstall any source maps resolver for the trace that was active.\n // If the user swaps back to this trace via the history dropdown, this will be reinstated.\n this.#uninstallSourceMapsResolver();\n\n // Store any modifications (e.g. annotations) that the user has created\n // on the current trace before we move away to a new view.\n this.#saveModificationsForActiveTrace();\n }\n\n this.#viewMode = newMode;\n this.updateTimelineControls();\n\n /**\n * Note that the TimelinePanel UI is really rendered in two distinct layers.\n * 1. status-pane-container: this is what renders both the StatusPane\n * loading modal AND the landing page.\n * What is important to note is that this renders ON TOP of the\n * SearchableView widget, which is what holds the FlameChartView.\n *\n * 2. SearchableView: this is the container that renders\n * TimelineFlameChartView and the rest of the flame chart code.\n *\n * What this layering means is that when we swap to the LANDING_PAGE or\n * STATUS_PANE_OVERLAY view, we don't actually need to reset the\n * SearchableView that is rendered behind it, because it won't be visible\n * and will be hidden behind the StatusPane/Landing Page.\n *\n * So the only time we update this SearchableView is when the user goes to\n * view a trace. That is why in the switch() statement below you won't see\n * any code that resets the SearchableView because we don't need to. We do\n * mark it as hidden, but mainly so the user can't accidentally use Cmd-F\n * to search a hidden view.\n */\n switch (newMode.mode) {\n case 'LANDING_PAGE': {\n this.#removeStatusPane();\n this.#showLandingPage();\n\n // Whilst we don't reset this, we hide it, mainly so the user cannot\n // hit Ctrl/Cmd-F and try to search when it isn't visible.\n this.searchableViewInternal.hideWidget();\n\n // Hide the brick-breaker easter egg\n this.brickBreakerToolbarButtonAdded = false;\n this.panelToolbar.removeToolbarItem(this.brickBreakerToolbarButton);\n return;\n }\n\n case 'VIEWING_TRACE': {\n this.#hideLandingPage();\n this.#setModelForActiveTrace();\n this.#removeStatusPane();\n this.#showSidebarIfRequired();\n this.#dimThirdPartiesIfRequired(newMode.traceIndex);\n return;\n }\n\n case 'STATUS_PANE_OVERLAY': {\n // We don't manage the StatusPane UI here; it is done in the\n // recordingStarted/recordingProgress callbacks, but we do make sure we\n // hide the landing page.\n this.#hideLandingPage();\n\n // We also hide the sidebar - else if the user is viewing a trace and\n // then load/record another, the sidebar remains visible.\n this.#hideSidebar();\n return;\n }\n default:\n Platform.assertNever(newMode, 'Unsupported TimelinePanel viewMode');\n }\n }\n\n #activeTraceIndex(): number|null {\n if (this.#viewMode.mode === 'VIEWING_TRACE') {\n return this.#viewMode.traceIndex;\n }\n return null;\n }\n\n /**\n * NOTE: this method only exists to enable some layout tests to be migrated to the new engine.\n * DO NOT use this method within DevTools. It is marked as deprecated so\n * within DevTools you are warned when using the method.\n * @deprecated\n **/\n getParsedTraceForLayoutTests(): Trace.Handlers.Types.ParsedTrace {\n const traceIndex = this.#activeTraceIndex();\n if (traceIndex === null) {\n throw new Error('No trace index active.');\n }\n const data = this.#traceEngineModel.parsedTrace(traceIndex);\n if (data === null) {\n throw new Error('No trace engine data found.');\n }\n return data;\n }\n\n /**\n * NOTE: this method only exists to enable some layout tests to be migrated to the new engine.\n * DO NOT use this method within DevTools. It is marked as deprecated so\n * within DevTools you are warned when using the method.\n * @deprecated\n **/\n getTraceEngineRawTraceEventsForLayoutTests(): readonly Trace.Types.Events.Event[] {\n const traceIndex = this.#activeTraceIndex();\n if (traceIndex === null) {\n throw new Error('No trace index active.');\n }\n const data = this.#traceEngineModel.rawTraceEvents(traceIndex);\n if (data === null) {\n throw new Error('No trace engine data found.');\n }\n return data;\n }\n\n #onChartPlayableStateChange(event: Common.EventTarget.EventTargetEvent): void {\n if (event.data) {\n const dateObj = new Date();\n const month = dateObj.getUTCMonth() + 1;\n const day = dateObj.getUTCDate();\n const isAprilFools = (month === 4 && (day === 1 || day === 2)); // Show only on April fools and the next day\n if (isAprilFools && !this.brickBreakerToolbarButtonAdded && SHOULD_SHOW_EASTER_EGG) {\n this.brickBreakerToolbarButtonAdded = true;\n this.panelToolbar.appendToolbarItem(this.brickBreakerToolbarButton);\n }\n } else {\n this.brickBreakerToolbarButtonAdded = false;\n this.panelToolbar.removeToolbarItem(this.brickBreakerToolbarButton);\n }\n }\n\n #onEntryHovered(dataProvider: TimelineFlameChartDataProvider, event: Common.EventTarget.EventTargetEvent):\n void {\n const entryIndex = event.data;\n if (entryIndex === -1) {\n this.#minimapComponent.clearBoundsHighlight();\n return;\n }\n const traceEvent = dataProvider.eventByIndex(entryIndex);\n if (!traceEvent) {\n return;\n }\n const bounds = Trace.Helpers.Timing.traceWindowFromEvent(traceEvent);\n this.#minimapComponent.highlightBounds(bounds, /* withBracket */ false);\n }\n\n private loadFromCpuProfile(profile: Protocol.Profiler.Profile|null): void {\n if (this.state !== State.IDLE || profile === null) {\n return;\n }\n this.prepareToLoadTimeline();\n this.loader = TimelineLoader.loadFromCpuProfile(profile, this);\n }\n\n private setState(state: State): void {\n this.state = state;\n this.updateTimelineControls();\n }\n\n private createSettingCheckbox(setting: Common.Settings.Setting, tooltip: Platform.UIString.LocalizedString):\n UI.Toolbar.ToolbarItem {\n const checkboxItem = new UI.Toolbar.ToolbarSettingCheckbox(setting, tooltip);\n this.recordingOptionUIControls.push(checkboxItem);\n return checkboxItem;\n }\n\n #addSidebarIconToToolbar(): void {\n if (this.panelToolbar.hasItem(this.#sidebarToggleButton)) {\n return;\n }\n\n this.panelToolbar.prependToolbarItem(this.#sidebarToggleButton);\n }\n\n /**\n * Used when the user deletes their last trace and is taken back to the\n * landing page - we don't add this icon until there is a trace loaded.\n */\n #removeSidebarIconFromToolbar(): void {\n this.panelToolbar.removeToolbarItem(this.#sidebarToggleButton);\n }\n\n #populateDownloadMenu(contextMenu: UI.ContextMenu.ContextMenu): void {\n contextMenu.viewSection().appendItem(i18nString(UIStrings.saveTraceWithAnnotationsMenuOption), () => {\n Host.userMetrics.actionTaken(Host.UserMetrics.Action.PerfPanelTraceExported);\n void this.saveToFile(/* isEnhancedTraces */ false, /* addModifications */ true);\n }, {\n jslogContext: 'timeline.save-to-file-with-annotations',\n });\n contextMenu.viewSection().appendItem(i18nString(UIStrings.saveTraceWithoutAnnotationsMenuOption), () => {\n Host.userMetrics.actionTaken(Host.UserMetrics.Action.PerfPanelTraceExported);\n void this.saveToFile();\n }, {\n jslogContext: 'timeline.save-to-file-without-annotations',\n });\n }\n\n private populateToolbar(): void {\n // Record\n this.panelToolbar.appendToolbarItem(UI.Toolbar.Toolbar.createActionButton(this.toggleRecordAction));\n this.panelToolbar.appendToolbarItem(UI.Toolbar.Toolbar.createActionButton(this.recordReloadAction));\n this.clearButton = new UI.Toolbar.ToolbarButton(i18nString(UIStrings.clear), 'clear', undefined, 'timeline.clear');\n this.clearButton.addEventListener(UI.Toolbar.ToolbarButton.Events.CLICK, () => this.onClearButton());\n this.panelToolbar.appendToolbarItem(this.clearButton);\n\n // Load / SaveCLICK\n this.loadButton =\n new UI.Toolbar.ToolbarButton(i18nString(UIStrings.loadProfile), 'import', undefined, 'timeline.load-from-file');\n this.loadButton.addEventListener(UI.Toolbar.ToolbarButton.Events.CLICK, () => {\n Host.userMetrics.actionTaken(Host.UserMetrics.Action.PerfPanelTraceImported);\n this.selectFileToLoad();\n });\n\n this.saveButton = new UI.Toolbar.ToolbarMenuButton(\n this.#populateDownloadMenu.bind(this), true, true, 'timeline.save-to-file-more-options', 'download');\n this.saveButton.setTitle(i18nString(UIStrings.saveProfile));\n\n if (Root.Runtime.experiments.isEnabled(Root.Runtime.ExperimentName.TIMELINE_ENHANCED_TRACES)) {\n this.saveButton.element.addEventListener('contextmenu', event => {\n event.preventDefault();\n event.stopPropagation();\n\n if (event.ctrlKey || event.button === 2) {\n const contextMenu = new UI.ContextMenu.ContextMenu(event);\n contextMenu.saveSection().appendItem(i18nString(UIStrings.exportNormalTraces), () => {\n void this.saveToFile();\n });\n contextMenu.saveSection().appendItem(i18nString(UIStrings.exportEnhancedTraces), () => {\n void this.saveToFile(/* isEnhancedTraces */ true);\n });\n\n void contextMenu.show();\n } else {\n void this.saveToFile();\n }\n });\n }\n\n this.panelToolbar.appendSeparator();\n this.panelToolbar.appendToolbarItem(this.loadButton);\n this.panelToolbar.appendToolbarItem(this.saveButton);\n\n // History\n this.panelToolbar.appendSeparator();\n\n if (!isNode) {\n this.homeButton = new UI.Toolbar.ToolbarButton(\n i18nString(UIStrings.backToLiveMetrics), 'home', undefined, 'timeline.back-to-live-metrics');\n this.homeButton.addEventListener(UI.Toolbar.ToolbarButton.Events.CLICK, () => {\n this.#changeView({mode: 'LANDING_PAGE'});\n this.#historyManager.navigateToLandingPage();\n });\n this.panelToolbar.appendToolbarItem(this.homeButton);\n this.panelToolbar.appendSeparator();\n }\n\n this.panelToolbar.appendToolbarItem(this.#historyManager.button());\n this.panelToolbar.registerCSSFiles([historyToolbarButtonStyles]);\n this.panelToolbar.appendSeparator();\n\n // View\n this.panelToolbar.appendSeparator();\n if (!isNode) {\n this.showScreenshotsToolbarCheckbox =\n this.createSettingCheckbox(this.showScreenshotsSetting, i18nString(UIStrings.captureScreenshots));\n this.panelToolbar.appendToolbarItem(this.showScreenshotsToolbarCheckbox);\n }\n\n this.showMemoryToolbarCheckbox =\n this.createSettingCheckbox(this.showMemorySetting, i18nString(UIStrings.showMemoryTimeline));\n this.panelToolbar.appendToolbarItem(this.showMemoryToolbarCheckbox);\n\n // GC\n this.panelToolbar.appendToolbarItem(UI.Toolbar.Toolbar.createActionButtonForId('components.collect-garbage'));\n\n // Ignore list setting\n this.panelToolbar.appendSeparator();\n const showIgnoreListSetting = new TimelineComponents.IgnoreListSetting.IgnoreListSetting();\n this.panelToolbar.appendToolbarItem(new UI.Toolbar.ToolbarItem(showIgnoreListSetting));\n\n if (Root.Runtime.experiments.isEnabled(Root.Runtime.ExperimentName.TIMELINE_THIRD_PARTY_DEPENDENCIES) &&\n this.#dimThirdPartiesSetting) {\n const dimThirdPartiesCheckbox =\n this.createSettingCheckbox(this.#dimThirdPartiesSetting, i18nString(UIStrings.dimThirdParties));\n this.panelToolbar.appendToolbarItem(dimThirdPartiesCheckbox);\n }\n\n // Isolate selector\n if (isNode) {\n const isolateSelector = new IsolateSelector();\n this.panelToolbar.appendSeparator();\n this.panelToolbar.appendToolbarItem(isolateSelector);\n }\n\n // Settings\n if (!isNode) {\n this.panelRightToolbar.appendSeparator();\n this.panelRightToolbar.appendToolbarItem(this.showSettingsPaneButton);\n }\n\n if (Root.Runtime.experiments.isEnabled(Root.Runtime.ExperimentName.TIMELINE_ALTERNATIVE_NAVIGATION)) {\n this.#setupNavigationSetting();\n this.#shortcutsDialog.prependElement(this.#navigationRadioButtons);\n const dialogToolbarItem = new UI.Toolbar.ToolbarItem(this.#shortcutsDialog);\n dialogToolbarItem.element.setAttribute(\n 'jslog', `${VisualLogging.action().track({click: true}).context('timeline.shortcuts-dialog-toggle')}`);\n this.panelRightToolbar.appendToolbarItem(dialogToolbarItem);\n // The setting could have been changed from the Devtools Settings. Therefore, we\n // need to update the radio buttons selection when the dialog is open.\n this.#shortcutsDialog.addEventListener('click', this.#updateNavigationSettingSelection.bind(this));\n }\n }\n\n #setupNavigationSetting(): HTMLElement {\n const currentNavSetting = Common.Settings.moduleSetting('flamechart-selected-navigation').get();\n const hideTheDialogForTests: string|null = localStorage.getItem('hide-shortcuts-dialog-for-test');\n const userHadShortcutsDialogOpenedOnce = this.#userHadShortcutsDialogOpenedOnce.get();\n\n this.#shortcutsDialog.data = {\n shortcuts: this.#getShortcutsInfo(currentNavSetting === 'classic'),\n open: !userHadShortcutsDialogOpenedOnce && hideTheDialogForTests !== 'true' &&\n !Host.InspectorFrontendHost.isUnderTest(),\n };\n\n this.#navigationRadioButtons.classList.add('nav-radio-buttons');\n UI.ARIAUtils.markAsRadioGroup(this.#navigationRadioButtons);\n // Change EventListener is only triggered when the radio button is selected\n this.#modernNavRadioButton.radio.addEventListener('change', () => {\n this.#shortcutsDialog.data = {shortcuts: this.#getShortcutsInfo(/* isNavClassic */ false)};\n Common.Settings.moduleSetting('flamechart-selected-navigation').set('modern');\n });\n this.#classicNavRadioButton.radio.addEventListener('change', () => {\n this.#shortcutsDialog.data = {shortcuts: this.#getShortcutsInfo(/* isNavClassic */ true)};\n Common.Settings.moduleSetting('flamechart-selected-navigation').set('classic');\n });\n\n this.#navigationRadioButtons.appendChild(this.#modernNavRadioButton.label);\n this.#navigationRadioButtons.appendChild(this.#classicNavRadioButton.label);\n\n this.#userHadShortcutsDialogOpenedOnce.set(true);\n return this.#navigationRadioButtons;\n }\n\n #updateNavigationSettingSelection(): void {\n const currentNavSetting = Common.Settings.moduleSetting('flamechart-selected-navigation').get();\n if (currentNavSetting === 'classic') {\n this.#classicNavRadioButton.radio.checked = true;\n Host.userMetrics.navigationSettingAtFirstTimelineLoad(\n Host.UserMetrics.TimelineNavigationSetting.SWITCHED_TO_CLASSIC);\n } else if (currentNavSetting === 'modern') {\n this.#modernNavRadioButton.radio.checked = true;\n Host.userMetrics.navigationSettingAtFirstTimelineLoad(\n Host.UserMetrics.TimelineNavigationSetting.SWITCHED_TO_MODERN);\n }\n }\n\n #getShortcutsInfo(isNavClassic: boolean): Dialogs.ShortcutDialog.Shortcut[] {\n if (isNavClassic) {\n return [\n {title: i18nString(UIStrings.timelineScrollUpDown), bindings: [['Shift', 'Scroll'], ['Shift', '↑/↓']]},\n {title: i18nString(UIStrings.timelineZoomInOut), bindings: [['Scroll'], ['W/S'], ['+/-']]},\n {title: i18nString(UIStrings.timelineFastZoomInOut), bindings: [['Shift', 'W/S'], ['Shift', '+/-']]},\n {title: i18nString(UIStrings.timelinePanLeftRight), bindings: [['Shift', '←/→'], ['A/D']]},\n ];\n }\n\n return [\n {title: i18nString(UIStrings.timelineScrollUpDown), bindings: [['Scroll'], ['Shift', '↑/↓']]},\n {\n title: i18nString(UIStrings.timelineZoomInOut),\n bindings: [[Host.Platform.isMac() ? '⌘' : 'Ctrl', 'Scroll'], ['W/S'], ['+/-']],\n },\n {title: i18nString(UIStrings.timelineFastZoomInOut), bindings: [['Shift', 'W/S'], ['Shift', '+/-']]},\n {\n title: i18nString(UIStrings.timelinePanLeftRight),\n bindings: [['Shift', 'Scroll'], ['Shift', '←/→'], ['A/D']],\n },\n ];\n }\n\n private createSettingsPane(): void {\n this.showSettingsPaneSetting =\n Common.Settings.Settings.instance().createSetting('timeline-show-settings-toolbar', false);\n this.showSettingsPaneButton = new UI.Toolbar.ToolbarSettingToggle(\n this.showSettingsPaneSetting, 'gear', i18nString(UIStrings.captureSettings), 'gear-filled',\n 'timeline-settings-toggle');\n SDK.NetworkManager.MultitargetNetworkManager.instance().addEventListener(\n SDK.NetworkManager.MultitargetNetworkManager.Events.CONDITIONS_CHANGED, this.updateShowSettingsToolbarButton,\n this);\n SDK.CPUThrottlingManager.CPUThrottlingManager.instance().addEventListener(\n SDK.CPUThrottlingManager.Events.RATE_CHANGED, this.updateShowSettingsToolbarButton, this);\n this.disableCaptureJSProfileSetting.addChangeListener(this.updateShowSettingsToolbarButton, this);\n this.captureLayersAndPicturesSetting.addChangeListener(this.updateShowSettingsToolbarButton, this);\n this.captureSelectorStatsSetting.addChangeListener(this.updateShowSettingsToolbarButton, this);\n\n this.settingsPane = new UI.Widget.HBox();\n this.settingsPane.element.classList.add('timeline-settings-pane');\n this.settingsPane.element.setAttribute(\n 'jslog', `${VisualLogging.pane('timeline-settings-pane').track({resize: true})}`);\n this.settingsPane.show(this.element);\n\n const captureToolbar = new UI.Toolbar.Toolbar('', this.settingsPane.element);\n captureToolbar.element.classList.add('flex-auto');\n captureToolbar.makeVertical();\n captureToolbar.appendToolbarItem(this.createSettingCheckbox(\n this.disableCaptureJSProfileSetting, i18nString(UIStrings.disablesJavascriptSampling)));\n captureToolbar.appendToolbarItem(\n this.createSettingCheckbox(this.captureLayersAndPicturesSetting, i18nString(UIStrings.capturesAdvancedPaint)));\n captureToolbar.appendToolbarItem(\n this.createSettingCheckbox(this.captureSelectorStatsSetting, i18nString(UIStrings.capturesSelectorStats)));\n\n const throttlingPane = new UI.Widget.VBox();\n throttlingPane.element.classList.add('flex-auto');\n throttlingPane.show(this.settingsPane.element);\n\n const cpuThrottlingToolbar = new UI.Toolbar.Toolbar('', throttlingPane.element);\n cpuThrottlingToolbar.appendText(i18nString(UIStrings.cpu));\n this.cpuThrottlingSelect = MobileThrottling.ThrottlingManager.throttlingManager().createCPUThrottlingSelector();\n this.cpuThrottlingSelect.control.setMinWidth(200);\n this.cpuThrottlingSelect.control.setMaxWidth(200);\n cpuThrottlingToolbar.appendToolbarItem(this.cpuThrottlingSelect.control);\n\n const networkThrottlingToolbar = new UI.Toolbar.Toolbar('', throttlingPane.element);\n networkThrottlingToolbar.appendText(i18nString(UIStrings.network));\n networkThrottlingToolbar.appendToolbarItem(this.createNetworkConditionsSelectToolbarItem());\n\n const thirdPartyToolbar = new UI.Toolbar.Toolbar('', throttlingPane.element);\n thirdPartyToolbar.makeVertical();\n const thirdPartyCheckbox =\n this.createSettingCheckbox(this.#thirdPartyTracksSetting, i18nString(UIStrings.showDataAddedByExtensions));\n\n const localLink = UI.XLink.XLink.create(\n 'https://developer.chrome.com/docs/devtools/performance/extension', i18nString(UIStrings.learnMore));\n localLink.style.paddingLeft = '5px';\n thirdPartyCheckbox.element.shadowRoot?.appendChild(localLink);\n thirdPartyToolbar.appendToolbarItem(thirdPartyCheckbox);\n\n this.showSettingsPaneSetting.addChangeListener(this.updateSettingsPaneVisibility.bind(this));\n this.updateSettingsPaneVisibility();\n }\n\n private createNetworkConditionsSelectToolbarItem(): UI.Toolbar.ToolbarComboBox {\n const toolbarItem = new UI.Toolbar.ToolbarComboBox(null, i18nString(UIStrings.networkConditions));\n toolbarItem.setMinWidth(200);\n toolbarItem.setMaxWidth(200);\n this.networkThrottlingSelect =\n MobileThrottling.ThrottlingManager.throttlingManager().createNetworkThrottlingSelector(\n toolbarItem.selectElement());\n return toolbarItem;\n }\n\n private prepareToLoadTimeline(): void {\n console.assert(this.state === State.IDLE);\n this.setState(State.LOADING);\n }\n\n private createFileSelector(): void {\n if (this.fileSelectorElement) {\n this.fileSelectorElement.remove();\n }\n // .gz is far more popular than .gzip, but both are valid.\n this.fileSelectorElement =\n UI.UIUtils.createFileSelectorElement(this.loadFromFile.bind(this), '.json,.gz,.gzip,.cpuprofile');\n this.timelinePane.element.appendChild(this.fileSelectorElement);\n }\n\n private contextMenu(event: Event): void {\n // Do not show this Context menu on FlameChart entries because we have a different context menu for FlameChart entries\n const mouseEvent = (event as MouseEvent);\n if (this.flameChart.getMainFlameChart().coordinatesToEntryIndex(mouseEvent.offsetX, mouseEvent.offsetY) !== -1) {\n return;\n }\n const contextMenu = new UI.ContextMenu.ContextMenu(event, {useSoftMenu: true});\n contextMenu.appendItemsAtLocation('timelineMenu');\n void contextMenu.show();\n }\n\n async saveToFile(isEnhancedTraces: boolean = false, addModifications: boolean = false): Promise {\n if (this.state !== State.IDLE) {\n return;\n }\n if (this.#viewMode.mode !== 'VIEWING_TRACE') {\n return;\n }\n const traceEvents = this.#traceEngineModel.rawTraceEvents(this.#viewMode.traceIndex);\n const metadata = this.#traceEngineModel.metadata(this.#viewMode.traceIndex);\n\n if (metadata && addModifications) {\n metadata.modifications = ModificationsManager.activeManager()?.toJSON();\n } else if (metadata) {\n delete metadata.modifications;\n }\n if (metadata && isEnhancedTraces) {\n metadata.enhancedTraceVersion = SDK.EnhancedTracesParser.EnhancedTracesParser.enhancedTraceVersion;\n }\n if (!traceEvents) {\n return;\n }\n\n const traceStart = Platform.DateUtilities.toISO8601Compact(new Date());\n let fileName: Platform.DevToolsPath.RawPathString;\n if (metadata?.dataOrigin === Trace.Types.File.DataOrigin.CPU_PROFILE) {\n fileName = `CPU-${traceStart}.cpuprofile` as Platform.DevToolsPath.RawPathString;\n } else if (metadata && metadata.enhancedTraceVersion) {\n fileName = `EnhancedTraces-${traceStart}.json` as Platform.DevToolsPath.RawPathString;\n } else {\n fileName = `Trace-${traceStart}.json` as Platform.DevToolsPath.RawPathString;\n }\n\n try {\n // TODO(crbug.com/1456818): Extract this logic and add more tests.\n let traceAsString;\n if (metadata?.dataOrigin === Trace.Types.File.DataOrigin.CPU_PROFILE) {\n const profileEvent = traceEvents.find(e => e.name === 'CpuProfile');\n if (!profileEvent || !profileEvent.args?.data) {\n return;\n }\n const profileEventData = profileEvent.args?.data;\n if (profileEventData.hasOwnProperty('cpuProfile')) {\n // TODO(crbug.com/1456799): Currently use a hack way because we can't differentiate\n // cpuprofile from trace events when loading a file.\n // The loader will directly add the fake trace created from CpuProfile to the tracingModel.\n // And there is where the old saving logic saves the cpuprofile.\n // This will be solved when the CPUProfileHandler is done. Then we can directly get it\n // from the new traceEngine\n const profile = (profileEventData as {cpuProfile: Protocol.Profiler.Profile}).cpuProfile;\n traceAsString = cpuprofileJsonGenerator(profile as Protocol.Profiler.Profile);\n }\n } else {\n const formattedTraceIter = traceJsonGenerator(traceEvents, metadata);\n traceAsString = Array.from(formattedTraceIter).join('');\n }\n if (!traceAsString) {\n throw new Error('Trace content empty');\n }\n await Workspace.FileManager.FileManager.instance().save(\n fileName, traceAsString, true /* forceSaveAs */, false /* isBase64 */);\n Workspace.FileManager.FileManager.instance().close(fileName);\n } catch (error) {\n console.error(error.stack);\n if (error.name === 'AbortError') {\n // The user cancelled the action, so this is not an error we need to report.\n return;\n }\n Common.Console.Console.instance().error(\n i18nString(UIStrings.failedToSaveTimelineSS, {PH1: error.message, PH2: error.name}));\n }\n }\n\n async showHistoryDropdown(): Promise {\n const recordingData = await this.#historyManager.showHistoryDropDown();\n if (recordingData) {\n if (recordingData.type === 'LANDING_PAGE') {\n this.#changeView({mode: 'LANDING_PAGE'});\n } else {\n this.#changeView({\n mode: 'VIEWING_TRACE',\n traceIndex: recordingData.parsedTraceIndex,\n });\n }\n }\n }\n\n navigateHistory(direction: number): boolean {\n const recordingData = this.#historyManager.navigate(direction);\n // When navigating programatically, you cannot navigate to the landing page\n // view, so we can discount that possibility here.\n if (recordingData && recordingData.type === 'TRACE_INDEX') {\n this.#changeView({\n mode: 'VIEWING_TRACE',\n traceIndex: recordingData.parsedTraceIndex,\n });\n }\n return true;\n }\n\n #saveModificationsForActiveTrace(): void {\n if (this.#viewMode.mode !== 'VIEWING_TRACE') {\n return;\n }\n const newModifications = ModificationsManager.activeManager()?.toJSON();\n if (newModifications) {\n this.#traceEngineModel.overrideModifications(this.#viewMode.traceIndex, newModifications);\n }\n }\n\n selectFileToLoad(): void {\n if (this.fileSelectorElement) {\n this.fileSelectorElement.click();\n }\n }\n\n async loadFromFile(file: File): Promise {\n if (this.state !== State.IDLE) {\n return;\n }\n const maximumTraceFileLengthToDetermineEnhancedTraces = 5000;\n // We are expecting to locate the enhanced traces version within the first 5000\n // characters of the trace file if the given trace file is enhanced traces.\n // Doing so can avoid serializing the whole trace while needing to serialize\n // it again in rehydrated session for enhanced traces.\n const blob = file.slice(0, maximumTraceFileLengthToDetermineEnhancedTraces);\n const content = await blob.text();\n if (content.includes('enhancedTraceVersion')) {\n await window.scheduler?.postTask(() => {\n this.#launchRehydratedSession(file);\n }, {priority: 'background'});\n } else {\n this.loader = await TimelineLoader.loadFromFile(file, this);\n this.prepareToLoadTimeline();\n }\n this.createFileSelector();\n }\n\n #launchRehydratedSession(file: File): void {\n let rehydratingWindow: Window|null = null;\n let pathToLaunch: string|null = null;\n const url = new URL(window.location.href);\n const pathToEntrypoint = url.pathname.slice(0, url.pathname.lastIndexOf('/'));\n url.pathname = `${pathToEntrypoint}/rehydrated_devtools_app.html`;\n pathToLaunch = url.toString();\n\n // Clarifying the window the code is referring to\n const hostWindow = window;\n function onMessageHandler(ev: MessageEvent): void {\n if (url && ev.data && ev.data.type === 'REHYDRATING_WINDOW_READY') {\n rehydratingWindow?.postMessage({type: 'REHYDRATING_TRACE_FILE', traceFile: file}, url.origin);\n }\n hostWindow.removeEventListener('message', onMessageHandler);\n }\n hostWindow.addEventListener('message', onMessageHandler);\n rehydratingWindow = hostWindow.open(pathToLaunch, /* target: */ undefined, 'noopener=false,popup=true');\n }\n\n async loadFromURL(url: Platform.DevToolsPath.UrlString): Promise {\n if (this.state !== State.IDLE) {\n return;\n }\n this.prepareToLoadTimeline();\n this.loader = await TimelineLoader.loadFromURL(url, this);\n }\n\n private updateMiniMap(): void {\n if (this.#viewMode.mode !== 'VIEWING_TRACE') {\n return;\n }\n\n const parsedTrace = this.#traceEngineModel.parsedTrace(this.#viewMode.traceIndex);\n const isCpuProfile = this.#traceEngineModel.metadata(this.#viewMode.traceIndex)?.dataOrigin ===\n Trace.Types.File.DataOrigin.CPU_PROFILE;\n if (!parsedTrace) {\n return;\n }\n\n this.#minimapComponent.setData({\n parsedTrace,\n isCpuProfile,\n settings: {\n showScreenshots: this.showScreenshotsSetting.get(),\n showMemory: this.showMemorySetting.get(),\n },\n });\n }\n\n private onMemoryModeChanged(): void {\n this.flameChart.updateCountersGraphToggle(this.showMemorySetting.get());\n this.updateMiniMap();\n this.doResize();\n this.select(null);\n }\n\n private onDimThirdPartiesChanged(): void {\n if (this.#viewMode.mode !== 'VIEWING_TRACE') {\n return;\n }\n this.#dimThirdPartiesIfRequired(this.#viewMode.traceIndex);\n }\n\n #extensionDataVisibilityChanged(): void {\n this.flameChart.extensionDataVisibilityChanged();\n }\n\n private updateSettingsPaneVisibility(): void {\n if (isNode) {\n return;\n }\n if (this.showSettingsPaneSetting.get()) {\n this.showSettingsPaneButton.setToggled(true);\n this.settingsPane.showWidget();\n } else {\n this.showSettingsPaneButton.setToggled(false);\n this.settingsPane.hideWidget();\n }\n }\n\n private updateShowSettingsToolbarButton(): void {\n const messages: string[] = [];\n if (SDK.CPUThrottlingManager.CPUThrottlingManager.instance().cpuThrottlingRate() !== 1) {\n messages.push(i18nString(UIStrings.CpuThrottlingIsEnabled));\n }\n if (SDK.NetworkManager.MultitargetNetworkManager.instance().isThrottling()) {\n messages.push(i18nString(UIStrings.NetworkThrottlingIsEnabled));\n }\n if (this.captureLayersAndPicturesSetting.get()) {\n messages.push(i18nString(UIStrings.SignificantOverheadDueToPaint));\n }\n if (this.captureSelectorStatsSetting.get()) {\n messages.push(i18nString(UIStrings.SelectorStatsEnabled));\n }\n if (this.disableCaptureJSProfileSetting.get()) {\n messages.push(i18nString(UIStrings.JavascriptSamplingIsDisabled));\n }\n\n this.showSettingsPaneButton.setChecked(messages.length > 0);\n this.showSettingsPaneButton.element.style.setProperty('--dot-toggle-top', '16px');\n this.showSettingsPaneButton.element.style.setProperty('--dot-toggle-left', '15px');\n\n if (messages.length) {\n const tooltipElement = document.createElement('div');\n messages.forEach(message => {\n tooltipElement.createChild('div').textContent = message;\n });\n this.showSettingsPaneButton.setTitle(tooltipElement.textContent || '');\n } else {\n this.showSettingsPaneButton.setTitle(i18nString(UIStrings.captureSettings));\n }\n }\n\n private setUIControlsEnabled(enabled: boolean): void {\n this.recordingOptionUIControls.forEach(control => control.setEnabled(enabled));\n }\n\n async #evaluateInspectedURL(): Promise {\n if (!this.controller) {\n return Platform.DevToolsPath.EmptyUrlString;\n }\n\n // target.inspectedURL is reliably populated, however it lacks any url #hash\n const inspectedURL = this.controller.primaryPageTarget.inspectedURL();\n\n // We'll use the navigationHistory to acquire the current URL including hash\n const resourceTreeModel = this.controller.primaryPageTarget.model(SDK.ResourceTreeModel.ResourceTreeModel);\n const navHistory = resourceTreeModel && await resourceTreeModel.navigationHistory();\n if (!resourceTreeModel || !navHistory) {\n return inspectedURL;\n }\n\n const {currentIndex, entries} = navHistory;\n const navigationEntry = entries[currentIndex];\n return navigationEntry.url as Platform.DevToolsPath.UrlString;\n }\n\n async #navigateToAboutBlank(): Promise {\n const aboutBlankNavigationComplete = new Promise(async (resolve, reject) => {\n if (!this.controller) {\n reject('Could not find TimelineController');\n return;\n }\n const target = this.controller.primaryPageTarget;\n const resourceModel = target.model(SDK.ResourceTreeModel.ResourceTreeModel);\n if (!resourceModel) {\n reject('Could not load resourceModel');\n return;\n }\n\n // To clear out the page and any state from prior test runs, we\n // navigate to about:blank before initiating the trace recording.\n // Once we have navigated to about:blank, we start recording and\n // then navigate to the original page URL, to ensure we profile the\n // page load.\n function waitForAboutBlank(event: Common.EventTarget.EventTargetEvent):\n void {\n if (event.data.url === 'about:blank') {\n resolve();\n } else {\n reject(`Unexpected navigation to ${event.data.url}`);\n }\n resourceModel?.removeEventListener(SDK.ResourceTreeModel.Events.FrameNavigated, waitForAboutBlank);\n }\n resourceModel.addEventListener(SDK.ResourceTreeModel.Events.FrameNavigated, waitForAboutBlank);\n await resourceModel.navigate('about:blank' as Platform.DevToolsPath.UrlString);\n });\n await aboutBlankNavigationComplete;\n }\n\n async #startCPUProfilingRecording(): Promise {\n try {\n this.cpuProfiler = UI.Context.Context.instance().flavor(SDK.CPUProfilerModel.CPUProfilerModel);\n if (!this.cpuProfiler) {\n // If there is no isolate selected, we will profile the first isolate that devtools connects to.\n // If we profile all target, but this will cause some bugs like time for the function is calculated wrong,\n // because the profiles will be concated and sorted together, so the total time will be amplified.\n // Multiple targets problem might happen when you inspect multiple node servers on different port at same time,\n // or when you let DevTools listen to both locolhost:9229 & 127.0.0.1:9229.\n const firstNodeTarget =\n SDK.TargetManager.TargetManager.instance().targets().find(target => target.type() === SDK.Target.Type.NODE);\n if (!firstNodeTarget) {\n throw new Error('Could not load any Node target.');\n }\n if (firstNodeTarget) {\n this.cpuProfiler = firstNodeTarget.model(SDK.CPUProfilerModel.CPUProfilerModel);\n }\n }\n\n this.setUIControlsEnabled(false);\n this.#changeView({mode: 'STATUS_PANE_OVERLAY'});\n if (!this.cpuProfiler) {\n throw new Error('No Node target is found.');\n }\n await SDK.TargetManager.TargetManager.instance().suspendAllTargets('performance-timeline');\n await this.cpuProfiler.startRecording();\n\n this.recordingStarted();\n } catch (e) {\n await this.recordingFailed(e.message);\n }\n }\n\n async #startTraceRecording(): Promise {\n try {\n // We record against the root target, but also need to use the\n // primaryPageTarget to inspect the current URL. For more info, see the\n // JSDoc comment on the TimelineController constructor.\n const rootTarget = SDK.TargetManager.TargetManager.instance().rootTarget();\n const primaryPageTarget = SDK.TargetManager.TargetManager.instance().primaryPageTarget();\n\n if (!primaryPageTarget) {\n throw new Error('Could not load primary page target.');\n }\n if (!rootTarget) {\n throw new Error('Could not load root target.');\n }\n\n if (UIDevtoolsUtils.isUiDevTools()) {\n this.controller = new UIDevtoolsController(rootTarget, primaryPageTarget, this);\n } else {\n this.controller = new TimelineController(rootTarget, primaryPageTarget, this);\n }\n this.setUIControlsEnabled(false);\n this.#changeView({mode: 'STATUS_PANE_OVERLAY'});\n if (!this.controller) {\n throw new Error('Could not create Timeline controller');\n }\n\n const urlToTrace = await this.#evaluateInspectedURL();\n // If we are doing \"Reload & record\", we first navigate the page to\n // about:blank. This is to ensure any data on the timeline from any\n // previous performance recording is lost, avoiding the problem where a\n // timeline will show data & screenshots from a previous page load that\n // was not relevant.\n if (this.recordingPageReload) {\n await this.#navigateToAboutBlank();\n }\n const recordingOptions = {\n enableJSSampling: !this.disableCaptureJSProfileSetting.get(),\n capturePictures: this.captureLayersAndPicturesSetting.get(),\n captureFilmStrip: this.showScreenshotsSetting.get(),\n captureSelectorStats: this.captureSelectorStatsSetting.get(),\n };\n // Order is important here: we tell the controller to start recording, which enables tracing.\n const response = await this.controller.startRecording(recordingOptions);\n if (response.getError()) {\n throw new Error(response.getError());\n }\n // Once we get here, we know tracing is active.\n // This is when, if the user has hit \"Reload & Record\" that we now need to navigate to the original URL.\n // If the user has just hit \"record\", we don't do any navigating.\n const recordingConfig = this.recordingPageReload ? {navigateToUrl: urlToTrace} : undefined;\n this.recordingStarted(recordingConfig);\n } catch (e) {\n await this.recordingFailed(e.message);\n }\n }\n\n private async startRecording(): Promise {\n console.assert(!this.statusPane, 'Status pane is already opened.');\n this.setState(State.START_PENDING);\n this.showRecordingStarted();\n\n if (isNode) {\n await this.#startCPUProfilingRecording();\n } else {\n await this.#startTraceRecording();\n }\n }\n\n private async stopRecording(): Promise {\n if (this.statusPane) {\n this.statusPane.finish();\n this.statusPane.updateStatus(i18nString(UIStrings.stoppingTimeline));\n this.statusPane.updateProgressBar(i18nString(UIStrings.received), 0);\n }\n this.setState(State.STOP_PENDING);\n if (this.controller) {\n await this.controller.stopRecording();\n this.setUIControlsEnabled(true);\n await this.controller.dispose();\n this.controller = null;\n return;\n }\n if (this.cpuProfiler) {\n const profile = await this.cpuProfiler.stopRecording();\n this.setState(State.IDLE);\n this.loadFromCpuProfile(profile);\n\n this.setUIControlsEnabled(true);\n this.cpuProfiler = null;\n\n await SDK.TargetManager.TargetManager.instance().resumeAllTargets();\n }\n }\n\n private async recordingFailed(error: string, rawEvents?: Trace.Types.Events.Event[]): Promise {\n if (this.statusPane) {\n this.statusPane.remove();\n }\n this.statusPane = new StatusPane(\n {\n description: error,\n buttonText: i18nString(UIStrings.close),\n buttonDisabled: false,\n showProgress: undefined,\n showTimer: undefined,\n },\n // When recording failed, we should load null to go back to the landing page.\n async () => {\n this.statusPane?.remove();\n await this.loadingComplete(\n /* no collectedEvents */[],\n /* exclusiveFilter= */ null,\n /* metadata= */ null);\n });\n this.statusPane.showPane(this.statusPaneContainer);\n this.statusPane.updateStatus(i18nString(UIStrings.recordingFailed));\n\n if (rawEvents) {\n this.statusPane.enableDownloadOfEvents(rawEvents);\n }\n\n this.setState(State.RECORDING_FAILED);\n this.traceLoadStart = null;\n this.setUIControlsEnabled(true);\n if (this.controller) {\n await this.controller.dispose();\n this.controller = null;\n }\n // Ensure we resume all targets, otherwise DevTools remains unresponsive in the event of an error.\n void SDK.TargetManager.TargetManager.instance().resumeAllTargets();\n }\n\n private onSuspendStateChanged(): void {\n this.updateTimelineControls();\n }\n\n private consoleProfileFinished(data: SDK.CPUProfilerModel.ProfileFinishedData): void {\n this.loadFromCpuProfile(data.cpuProfile);\n void UI.InspectorView.InspectorView.instance().showPanel('timeline');\n }\n\n private updateTimelineControls(): void {\n this.toggleRecordAction.setToggled(this.state === State.RECORDING);\n this.toggleRecordAction.setEnabled(this.state === State.RECORDING || this.state === State.IDLE);\n this.recordReloadAction.setEnabled(isNode ? false : this.state === State.IDLE);\n this.#historyManager.setEnabled(this.state === State.IDLE);\n this.clearButton.setEnabled(this.state === State.IDLE);\n this.panelToolbar.setEnabled(this.state !== State.LOADING);\n this.panelRightToolbar.setEnabled(this.state !== State.LOADING);\n this.dropTarget.setEnabled(this.state === State.IDLE);\n this.loadButton.setEnabled(this.state === State.IDLE);\n this.saveButton.setEnabled(this.state === State.IDLE && this.#hasActiveTrace());\n this.homeButton?.setEnabled(this.state === State.IDLE && this.#hasActiveTrace());\n if (this.#viewMode.mode === 'VIEWING_TRACE') {\n this.#addSidebarIconToToolbar();\n }\n }\n\n async toggleRecording(): Promise {\n if (this.state === State.IDLE) {\n this.recordingPageReload = false;\n await this.startRecording();\n Host.userMetrics.actionTaken(Host.UserMetrics.Action.TimelineStarted);\n } else if (this.state === State.RECORDING) {\n await this.stopRecording();\n }\n }\n\n recordReload(): void {\n if (this.state !== State.IDLE) {\n return;\n }\n this.recordingPageReload = true;\n void this.startRecording();\n Host.userMetrics.actionTaken(Host.UserMetrics.Action.TimelinePageReloadStarted);\n }\n\n private onClearButton(): void {\n this.#historyManager.clear();\n this.#traceEngineModel = this.#instantiateNewModel();\n ModificationsManager.reset();\n this.#uninstallSourceMapsResolver();\n this.flameChart.getMainDataProvider().reset();\n this.flameChart.getNetworkDataProvider().reset();\n this.flameChart.reset();\n this.#changeView({mode: 'LANDING_PAGE'});\n }\n\n #hasActiveTrace(): boolean {\n return this.#viewMode.mode === 'VIEWING_TRACE';\n }\n\n #onBrickBreakerEasterEggClick(): void {\n if (!this.#hasActiveTrace()) {\n return;\n }\n this.flameChart.runBrickBreakerGame();\n }\n\n #applyActiveFilters(traceIsGeneric: boolean, exclusiveFilter: Trace.Extras.TraceFilter.TraceFilter|null = null):\n void {\n if (traceIsGeneric || Root.Runtime.experiments.isEnabled('timeline-show-all-events')) {\n return;\n }\n\n const newActiveFilters = exclusiveFilter ? [exclusiveFilter] : [\n TimelineUIUtils.visibleEventsFilter(),\n ];\n\n ActiveFilters.instance().setFilters(newActiveFilters);\n }\n\n /**\n * If we generate a lot of the same aria announcements very quickly, we don't\n * want to send them all to the user.\n */\n #ariaDebouncer = Common.Debouncer.debounce(() => {\n if (this.#pendingAriaMessage) {\n UI.ARIAUtils.alert(this.#pendingAriaMessage);\n this.#pendingAriaMessage = null;\n }\n }, 1_000);\n\n #makeAriaAnnouncement(message: string): void {\n // If we already have one pending, don't queue this one.\n if (message === this.#pendingAriaMessage) {\n return;\n }\n\n // If the pending message is different, immediately announce the pending\n // message + then update the pending message to the new one.\n if (this.#pendingAriaMessage) {\n UI.ARIAUtils.alert(this.#pendingAriaMessage);\n }\n this.#pendingAriaMessage = message;\n this.#ariaDebouncer();\n }\n\n /**\n * Called when we update the active trace that is being shown to the user.\n * This is called from {@see changeView} when we change the UI to show a\n * trace - either one the user has just recorded/imported, or one they have\n * navigated to via the dropdown.\n *\n * If you need code to execute whenever the active trace changes, this is the method to use.\n * If you need code to execute ONLY ON NEW TRACES, then use {@see loadingComplete}\n * You should not call this method directly if you want the UI to update; use\n * {@see changeView} to control what is shown to the user.\n */\n #setModelForActiveTrace(): void {\n if (this.#viewMode.mode !== 'VIEWING_TRACE') {\n return;\n }\n const {traceIndex} = this.#viewMode;\n const parsedTrace = this.#traceEngineModel.parsedTrace(traceIndex);\n const syntheticEventsManager = this.#traceEngineModel.syntheticTraceEventsManager(traceIndex);\n\n if (!parsedTrace || !syntheticEventsManager) {\n // This should not happen, because you can only get into the\n // VIEWING_TRACE viewMode if you have a valid trace index from the\n // Trace Engine. If it does, let's bail back to the landing page.\n console.error(`setModelForActiveTrace was called with an invalid trace index: ${traceIndex}`);\n this.#changeView({mode: 'LANDING_PAGE'});\n return;\n }\n\n Trace.Helpers.SyntheticEvents.SyntheticEventsManager.activate(syntheticEventsManager);\n // Clear the line level profile that could exist from the previous trace.\n PerfUI.LineLevelProfile.Performance.instance().reset();\n\n this.#minimapComponent.reset();\n\n // Order is important: the bounds must be set before we initiate any UI\n // rendering.\n TraceBounds.TraceBounds.BoundsManager.instance().resetWithNewBounds(\n parsedTrace.Meta.traceBounds,\n );\n\n // Set up the modifications manager for the newly active trace.\n // The order is important: this needs to happen before we trigger a flame chart redraw by setting the model.\n // (it could happen after, but then we would need to trigger a fresh redraw so let's not do that)\n const currentManager = ModificationsManager.initAndActivateModificationsManager(this.#traceEngineModel, traceIndex);\n\n if (!currentManager) {\n console.error('ModificationsManager could not be created or activated.');\n }\n this.statusPane?.updateProgressBar(i18nString(UIStrings.processed), 70);\n\n const isCpuProfile =\n this.#traceEngineModel.metadata(traceIndex)?.dataOrigin === Trace.Types.File.DataOrigin.CPU_PROFILE;\n this.flameChart.setModel(parsedTrace, isCpuProfile);\n this.flameChart.resizeToPreferredHeights();\n // Reset the visual selection as we've just swapped to a new trace.\n this.flameChart.setSelectionAndReveal(null);\n this.#sideBar.setParsedTrace(parsedTrace);\n\n this.searchableViewInternal.showWidget();\n\n const exclusiveFilter = this.#exclusiveFilterPerTrace.get(traceIndex) ?? null;\n this.#applyActiveFilters(parsedTrace.Meta.traceIsGeneric, exclusiveFilter);\n\n // Add ModificationsManager listeners for annotations change to update the Annotation Overlays.\n currentManager?.addEventListener(AnnotationModifiedEvent.eventName, event => {\n // Update screen readers.\n const announcementText = AnnotationHelpers.ariaAnnouncementForModifiedEvent(event as AnnotationModifiedEvent);\n if (announcementText) {\n this.#makeAriaAnnouncement(announcementText);\n }\n\n const {overlay, action} = (event as AnnotationModifiedEvent);\n if (action === 'Add') {\n this.flameChart.addOverlay(overlay);\n } else if (action === 'Remove') {\n this.flameChart.removeOverlay(overlay);\n } else if (action === 'UpdateTimeRange' && AnnotationHelpers.isTimeRangeLabel(overlay)) {\n this.flameChart.updateExistingOverlay(overlay, {\n bounds: overlay.bounds,\n });\n } else if (action === 'UpdateLinkToEntry' && AnnotationHelpers.isEntriesLink(overlay)) {\n this.flameChart.updateExistingOverlay(overlay, {\n entryTo: overlay.entryTo,\n });\n } else if (action === 'EnterLabelEditState' && AnnotationHelpers.isEntryLabel(overlay)) {\n this.flameChart.enterLabelEditMode(overlay);\n }\n\n const annotations = currentManager.getAnnotations();\n const annotationEntryToColorMap = this.buildColorsAnnotationsMap(annotations);\n this.#sideBar.setAnnotations(annotations, annotationEntryToColorMap);\n });\n\n // To calculate the activity we might want to zoom in, we use the top-most main-thread track\n const topMostMainThreadAppender =\n this.flameChart.getMainDataProvider().compatibilityTracksAppenderInstance().threadAppenders().at(0);\n if (topMostMainThreadAppender) {\n const zoomedInBounds = Trace.Extras.MainThreadActivity.calculateWindow(\n parsedTrace.Meta.traceBounds, topMostMainThreadAppender.getEntries());\n\n TraceBounds.TraceBounds.BoundsManager.instance().setTimelineVisibleWindow(zoomedInBounds);\n }\n\n // Add overlays for annotations loaded from the trace file\n const currModificationManager = ModificationsManager.activeManager();\n if (currModificationManager) {\n const annotations = currModificationManager.getAnnotations();\n const annotationEntryToColorMap = this.buildColorsAnnotationsMap(annotations);\n this.#sideBar.setAnnotations(annotations, annotationEntryToColorMap);\n this.flameChart.bulkAddOverlays(currModificationManager.getOverlays());\n }\n\n // Set up line level profiling with CPU profiles, if we found any.\n PerfUI.LineLevelProfile.Performance.instance().reset();\n if (parsedTrace && parsedTrace.Samples.profilesInProcess.size) {\n const primaryPageTarget = SDK.TargetManager.TargetManager.instance().primaryPageTarget();\n // Gather up all CPU Profiles we found when parsing this trace.\n const cpuProfiles =\n Array.from(parsedTrace.Samples.profilesInProcess).flatMap(([_processId, threadsInProcess]) => {\n const profiles = Array.from(threadsInProcess.values()).map(profileData => profileData.parsedProfile);\n return profiles;\n });\n for (const profile of cpuProfiles) {\n PerfUI.LineLevelProfile.Performance.instance().appendCPUProfile(profile, primaryPageTarget);\n }\n }\n\n // Initialize EntityMapper\n this.#entityMapper = new Utils.EntityMapper.EntityMapper(parsedTrace);\n\n // Set up SourceMapsResolver to ensure we resolve any function names in\n // profile calls.\n // Pass in the entity mapper.\n this.#sourceMapsResolver = new Utils.SourceMapsResolver.SourceMapsResolver(parsedTrace, this.#entityMapper);\n this.#sourceMapsResolver.addEventListener(\n Utils.SourceMapsResolver.SourceMappingsUpdated.eventName, this.#onSourceMapsNodeNamesResolvedBound);\n void this.#sourceMapsResolver.install();\n\n // Initialize EntityMapper\n this.#entityMapper = new Utils.EntityMapper.EntityMapper(parsedTrace);\n\n this.statusPane?.updateProgressBar(i18nString(UIStrings.processed), 80);\n this.updateMiniMap();\n this.statusPane?.updateProgressBar(i18nString(UIStrings.processed), 90);\n this.updateTimelineControls();\n\n this.#setActiveInsight(null);\n\n let traceInsightsSets = this.#traceEngineModel.traceInsights(traceIndex);\n if (traceInsightsSets) {\n // Omit insight sets that don't have anything of interest to show to the user.\n const filteredTraceInsightsSets = new Map();\n for (const [key, insightSet] of traceInsightsSets) {\n if (Object.values(insightSet.model).some(model => model.shouldShow)) {\n filteredTraceInsightsSets.set(key, insightSet);\n }\n }\n\n traceInsightsSets = filteredTraceInsightsSets.size ? filteredTraceInsightsSets : null;\n }\n\n this.flameChart.setInsights(traceInsightsSets, this.#eventToRelatedInsights);\n this.#sideBar.setInsights(traceInsightsSets);\n\n this.#eventToRelatedInsights.clear();\n if (traceInsightsSets) {\n for (const [insightSetKey, insightSet] of traceInsightsSets) {\n for (const model of Object.values(insightSet.model)) {\n let relatedEvents = model.relatedEvents;\n if (!relatedEvents) {\n relatedEvents = new Map();\n } else if (Array.isArray(relatedEvents)) {\n relatedEvents = new Map(relatedEvents.map(e => [e, []]));\n }\n\n for (const [event, messages] of relatedEvents.entries()) {\n const relatedInsights = this.#eventToRelatedInsights.get(event) ?? [];\n this.#eventToRelatedInsights.set(event, relatedInsights);\n relatedInsights.push({\n insightLabel: model.title,\n messages,\n activateInsight: () => {\n this.#setActiveInsight({model, insightSetKey});\n },\n });\n }\n }\n }\n }\n\n this.#showSidebarIfRequired();\n\n // When the timeline is loaded for the first time, log what navigation setting is selected.\n // This will allow us to get an estimate number of people using each option.\n if (this.#traceEngineModel.size() === 1) {\n if (Common.Settings.moduleSetting('flamechart-selected-navigation').get() === 'classic') {\n Host.userMetrics.navigationSettingAtFirstTimelineLoad(\n Host.UserMetrics.TimelineNavigationSetting.CLASSIC_AT_SESSION_FIRST_TRACE);\n } else {\n Host.userMetrics.navigationSettingAtFirstTimelineLoad(\n Host.UserMetrics.TimelineNavigationSetting.MODERN_AT_SESSION_FIRST_TRACE);\n }\n }\n }\n\n /**\n * We automatically show the sidebar in only 2 scenarios:\n * 1. The user has never seen it before, so we show it once to aid discovery\n * 2. The user had it open, and we hid it (for example, during recording), so now we need to bring it back.\n */\n #showSidebarIfRequired(): void {\n if (Root.Runtime.Runtime.queryParam('disable-auto-performance-sidebar-reveal') !== null) {\n // Used in interaction tests & screenshot tests.\n return;\n }\n const needToRestore = this.#restoreSidebarVisibilityOnTraceLoad;\n const userHasSeenSidebar = this.#sideBar.userHasOpenedSidebarOnce();\n\n if (!userHasSeenSidebar || needToRestore) {\n this.#splitWidget.showBoth();\n }\n this.#restoreSidebarVisibilityOnTraceLoad = false;\n }\n\n #dimThirdPartiesIfRequired(traceIndex: number): void {\n const parsedTrace = this.#traceEngineModel.parsedTrace(traceIndex);\n if (!parsedTrace) {\n return;\n }\n const thirdPartyEvents = this.#entityMapper?.thirdPartyEvents() ?? [];\n if (this.#dimThirdPartiesSetting?.get() && thirdPartyEvents.length) {\n this.flameChart.dimEvents(thirdPartyEvents);\n } else {\n // Ensure dimming stores are cleared, and there is no dimming.\n this.flameChart.disableAllDimming();\n }\n }\n\n // Build a map mapping annotated entries to the colours that are used to display them in the FlameChart.\n // We need this map to display the entries in the sidebar with the same colours.\n private buildColorsAnnotationsMap(annotations: Trace.Types.File.Annotation[]): Map {\n const annotationEntryToColorMap = new Map();\n\n for (const annotation of annotations) {\n if (Trace.Types.File.isEntryLabelAnnotation(annotation)) {\n annotationEntryToColorMap.set(annotation.entry, this.getEntryColorByEntry(annotation.entry));\n } else if (Trace.Types.File.isEntriesLinkAnnotation(annotation)) {\n annotationEntryToColorMap.set(annotation.entryFrom, this.getEntryColorByEntry(annotation.entryFrom));\n if (annotation.entryTo) {\n annotationEntryToColorMap.set(annotation.entryTo, this.getEntryColorByEntry(annotation.entryTo));\n }\n }\n }\n\n return annotationEntryToColorMap;\n }\n\n private getEntryColorByEntry(entry: Trace.Types.Events.Event): string {\n const mainIndex = this.flameChart.getMainDataProvider().indexForEvent(entry);\n const networkIndex = this.flameChart.getNetworkDataProvider().indexForEvent(entry);\n if (mainIndex !== null) {\n const color = this.flameChart.getMainDataProvider().entryColor(mainIndex);\n\n // The color for idle frames will be white in flame chart, which will display weird in the sidebar, so just use a\n // light gray color instead.\n if (color === 'white') {\n return ThemeSupport.ThemeSupport.instance().getComputedValue('--app-color-system');\n }\n return color;\n }\n if (networkIndex !== null) {\n const color = this.flameChart.getNetworkDataProvider().entryColor(networkIndex);\n return color;\n }\n\n console.warn('Could not get entry color for ', entry);\n return ThemeSupport.ThemeSupport.instance().getComputedValue('--app-color-system');\n }\n\n private recordingStarted(config?: {navigateToUrl: Platform.DevToolsPath.UrlString}): void {\n if (config && this.recordingPageReload && this.controller) {\n // If the user hit \"Reload & record\", by this point we have:\n // 1. Navigated to about:blank\n // 2. Initiated tracing.\n // We therefore now should navigate back to the original URL that the user wants to profile.\n const resourceModel = this.controller?.primaryPageTarget.model(SDK.ResourceTreeModel.ResourceTreeModel);\n if (!resourceModel) {\n void this.recordingFailed('Could not navigate to original URL');\n return;\n }\n // We don't need to await this because we are purposefully showing UI\n // progress as the page loads & tracing is underway.\n void resourceModel.navigate(config.navigateToUrl);\n }\n\n this.#changeView({mode: 'STATUS_PANE_OVERLAY'});\n this.setState(State.RECORDING);\n this.showRecordingStarted();\n if (this.statusPane) {\n this.statusPane.enableAndFocusButton();\n this.statusPane.updateStatus(i18nString(UIStrings.profiling));\n this.statusPane.updateProgressBar(i18nString(UIStrings.bufferUsage), 0);\n this.statusPane.startTimer();\n }\n }\n\n recordingProgress(usage: number): void {\n if (this.statusPane) {\n this.statusPane.updateProgressBar(i18nString(UIStrings.bufferUsage), usage * 100);\n }\n }\n\n /**\n * Hide the sidebar, but persist the user's state, because when they import a\n * trace we want to revert the sidebar back to what it was.\n */\n #hideSidebar(): void {\n if (this.#splitWidget.sidebarIsShowing()) {\n this.#restoreSidebarVisibilityOnTraceLoad = true;\n this.#splitWidget.hideSidebar();\n }\n }\n\n #showLandingPage(): void {\n this.updateSettingsPaneVisibility();\n this.#removeSidebarIconFromToolbar();\n this.#hideSidebar();\n\n if (this.landingPage) {\n this.landingPage.show(this.statusPaneContainer);\n return;\n }\n\n const liveMetrics = new TimelineComponents.LiveMetricsView.LiveMetricsView();\n liveMetrics.isNode = isNode;\n this.landingPage = LegacyWrapper.LegacyWrapper.legacyWrapper(UI.Widget.Widget, liveMetrics);\n this.landingPage.element.classList.add('timeline-landing-page', 'fill');\n this.landingPage.contentElement.classList.add('fill');\n this.landingPage.show(this.statusPaneContainer);\n }\n\n #hideLandingPage(): void {\n this.landingPage.detach();\n\n // Hide pane settings in trace view to conserve UI space, but preserve underlying setting.\n this.showSettingsPaneButton?.setToggled(false);\n this.settingsPane?.hideWidget();\n }\n\n async loadingStarted(): Promise {\n this.#changeView({mode: 'STATUS_PANE_OVERLAY'});\n\n if (this.statusPane) {\n this.statusPane.remove();\n }\n this.statusPane = new StatusPane(\n {\n showProgress: true,\n showTimer: undefined,\n buttonDisabled: undefined,\n buttonText: undefined,\n description: undefined,\n },\n () => this.cancelLoading());\n this.statusPane.showPane(this.statusPaneContainer);\n this.statusPane.updateStatus(i18nString(UIStrings.loadingProfile));\n // FIXME: make loading from backend cancelable as well.\n if (!this.loader) {\n this.statusPane.finish();\n }\n this.traceLoadStart = Trace.Types.Timing.MilliSeconds(performance.now());\n await this.loadingProgress(0);\n }\n\n async loadingProgress(progress?: number): Promise {\n if (typeof progress === 'number' && this.statusPane) {\n this.statusPane.updateProgressBar(i18nString(UIStrings.received), progress * 100);\n }\n }\n\n async processingStarted(): Promise {\n this.statusPane?.updateStatus(i18nString(UIStrings.processingProfile));\n }\n\n #listenForProcessingProgress(): void {\n this.#traceEngineModel.addEventListener(Trace.TraceModel.ModelUpdateEvent.eventName, e => {\n const updateEvent = e as Trace.TraceModel.ModelUpdateEvent;\n const str = i18nString(UIStrings.processed);\n\n // Trace Engine will report progress from [0...1] but we still have more work to do. So, scale them down a bit.\n const traceParseMaxProgress = 0.7;\n\n if (updateEvent.data.type === Trace.TraceModel.ModelUpdateType.COMPLETE) {\n this.statusPane?.updateProgressBar(str, 100 * traceParseMaxProgress);\n } else if (updateEvent.data.type === Trace.TraceModel.ModelUpdateType.PROGRESS_UPDATE) {\n const data = updateEvent.data.data;\n this.statusPane?.updateProgressBar(str, data.percent * 100 * traceParseMaxProgress);\n }\n });\n }\n\n #onSourceMapsNodeNamesResolved(): void {\n // Source maps can change the way calls hierarchies should look in\n // the flame chart (f.e. if some calls are ignore listed after\n // resolving source maps). Thus, we must reappend the flamechart\n // entries.\n this.flameChart.getMainDataProvider().timelineData(true);\n this.flameChart.getMainFlameChart().update();\n }\n\n /**\n * This is called with we are done loading a trace from a file, or after we\n * have recorded a fresh trace.\n *\n * IMPORTANT: All the code in here should be code that is only required when we have\n * recorded or loaded a brand new trace. If you need the code to run when the\n * user switches to an existing trace, please {@see setModel} and put your\n * code in there.\n **/\n async loadingComplete(\n collectedEvents: Trace.Types.Events.Event[], exclusiveFilter: Trace.Extras.TraceFilter.TraceFilter|null = null,\n metadata: Trace.Types.File.MetaData|null): Promise {\n this.#traceEngineModel.resetProcessor();\n\n delete this.loader;\n\n // If the user just recorded this trace via the record UI, the state will\n // be StopPending. Whereas if it was an existing trace they loaded via a\n // file, it will be State.Loading. This means we can tell the recording is\n // fresh by checking the state value.\n const recordingIsFresh = this.state === State.STOP_PENDING;\n\n this.setState(State.IDLE);\n\n if (collectedEvents.length === 0) {\n // 0 collected events indicates probably an invalid file was imported.\n // If the user does not have any already-loaded traces, then we should\n // just reset the panel back to the landing page. However if they had a\n // previous trace imported, we should go to that instead.\n if (this.#traceEngineModel.size()) {\n this.#changeView({\n mode: 'VIEWING_TRACE',\n traceIndex: this.#traceEngineModel.lastTraceIndex(),\n });\n } else {\n this.#changeView({mode: 'LANDING_PAGE'});\n }\n return;\n }\n\n try {\n await this.#executeNewTrace(collectedEvents, recordingIsFresh, metadata);\n const traceIndex = this.#traceEngineModel.lastTraceIndex();\n if (exclusiveFilter) {\n this.#exclusiveFilterPerTrace.set(traceIndex, exclusiveFilter);\n }\n this.#changeView({\n mode: 'VIEWING_TRACE',\n traceIndex,\n });\n\n const parsedTrace = this.#traceEngineModel.parsedTrace(traceIndex);\n if (!parsedTrace) {\n throw new Error(`Could not get trace data at index ${traceIndex}`);\n }\n\n if (recordingIsFresh) {\n Tracker.instance().registerFreshRecording(parsedTrace);\n }\n\n // We store the index of the active trace so we can load it back easily\n // if the user goes to a different trace then comes back.\n // However we also pass in the full trace data because we use it to build\n // the preview overview thumbnail of the trace that gets shown in the UI.\n this.#historyManager.addRecording({\n data: {\n parsedTraceIndex: traceIndex,\n type: 'TRACE_INDEX',\n },\n filmStripForPreview: Trace.Extras.FilmStrip.fromParsedTrace(parsedTrace),\n parsedTrace,\n metadata,\n });\n } catch (error) {\n // If we errored during the parsing stage, it\n // is useful to get access to the raw events to download the trace. This\n // allows us to debug crashes!\n void this.recordingFailed(error.message, collectedEvents);\n console.error(error);\n } finally {\n this.recordTraceLoadMetric();\n }\n }\n\n recordTraceLoadMetric(): void {\n if (!this.traceLoadStart) {\n return;\n }\n const start = this.traceLoadStart;\n // Right *now* is the end of trace parsing and model building, but the flamechart rendering\n // isn't complete yet. To capture that we'll do a rAF+setTimeout to give the most accurate timestamp\n // for the first paint of the flamechart\n requestAnimationFrame(() => {\n setTimeout(() => {\n const end = Trace.Types.Timing.MilliSeconds(performance.now());\n const measure = performance.measure('TraceLoad', {start, end});\n const duration = Trace.Types.Timing.MilliSeconds(measure.duration);\n this.element.dispatchEvent(new TraceLoadEvent(duration));\n Host.userMetrics.performanceTraceLoad(measure);\n }, 0);\n });\n }\n\n async #executeNewTrace(\n collectedEvents: Trace.Types.Events.Event[], isFreshRecording: boolean,\n metadata: Trace.Types.File.MetaData|null): Promise {\n return this.#traceEngineModel.parse(\n collectedEvents,\n {\n metadata: metadata ?? undefined,\n isFreshRecording,\n },\n );\n }\n\n loadingCompleteForTest(): void {\n // Not implemented, added only for allowing the TimelineTestRunner\n // to be in sync when a trace load is finished.\n }\n\n private showRecordingStarted(): void {\n this.#changeView({mode: 'STATUS_PANE_OVERLAY'});\n if (this.statusPane) {\n this.statusPane.remove();\n }\n this.statusPane = new StatusPane(\n {\n showTimer: true,\n showProgress: true,\n buttonDisabled: true,\n description: undefined,\n buttonText: undefined,\n },\n () => this.stopRecording());\n this.statusPane.showPane(this.statusPaneContainer);\n this.statusPane.updateStatus(i18nString(UIStrings.initializingProfiler));\n }\n\n private cancelLoading(): void {\n if (this.loader) {\n void this.loader.cancel();\n }\n }\n\n private async loadEventFired(\n event: Common.EventTarget\n .EventTargetEvent<{resourceTreeModel: SDK.ResourceTreeModel.ResourceTreeModel, loadTime: number}>):\n Promise {\n if (this.state !== State.RECORDING || !this.recordingPageReload || !this.controller ||\n this.controller.primaryPageTarget !== event.data.resourceTreeModel.target()) {\n return;\n }\n const controller = this.controller;\n await new Promise(r => window.setTimeout(r, this.millisecondsToRecordAfterLoadEvent));\n\n // Check if we're still in the same recording session.\n if (controller !== this.controller || this.state !== State.RECORDING) {\n return;\n }\n void this.stopRecording();\n }\n\n private frameForSelection(selection: TimelineSelection): Trace.Types.Events.LegacyTimelineFrame|null {\n if (this.#viewMode.mode !== 'VIEWING_TRACE') {\n return null;\n }\n if (selectionIsRange(selection)) {\n return null;\n }\n if (Trace.Types.Events.isSyntheticNetworkRequest(selection.event)) {\n return null;\n }\n\n // If the user has selected a random trace event, the frame we want is the last\n // frame in that time window, hence why the window we look for is the\n // endTime to the endTime.\n const parsedTrace = this.#traceEngineModel.parsedTrace(this.#viewMode.traceIndex);\n if (!parsedTrace) {\n return null;\n }\n const endTime = rangeForSelection(selection).max;\n const lastFrameInSelection = Trace.Handlers.ModelHandlers.Frames\n .framesWithinWindow(\n parsedTrace.Frames.frames,\n endTime,\n endTime,\n )\n .at(0);\n return lastFrameInSelection || null;\n }\n\n jumpToFrame(offset: number): true|undefined {\n if (this.#viewMode.mode !== 'VIEWING_TRACE') {\n return;\n }\n const currentFrame = this.selection && this.frameForSelection(this.selection);\n if (!currentFrame) {\n return;\n }\n const parsedTrace = this.#traceEngineModel.parsedTrace(this.#viewMode.traceIndex);\n if (!parsedTrace) {\n return;\n }\n let index = parsedTrace.Frames.frames.indexOf(currentFrame);\n console.assert(index >= 0, 'Can\\'t find current frame in the frame list');\n index = Platform.NumberUtilities.clamp(index + offset, 0, parsedTrace.Frames.frames.length - 1);\n const frame = parsedTrace.Frames.frames[index];\n this.#revealTimeRange(\n Trace.Helpers.Timing.microSecondsToMilliseconds(frame.startTime),\n Trace.Helpers.Timing.microSecondsToMilliseconds(frame.endTime));\n this.select(selectionFromEvent(frame));\n return true;\n }\n\n #announceSelectionToAria(oldSelection: TimelineSelection|null, newSelection: TimelineSelection|null): void {\n if (oldSelection !== null && newSelection === null) {\n UI.ARIAUtils.alert(i18nString(UIStrings.selectionCleared));\n }\n if (newSelection === null) {\n return;\n }\n\n if (selectionIsRange(newSelection)) {\n // We don't announce here; within the annotations code we announce when\n // the user creates a new time range selection. So if we also announce\n // here we will duplicate and overwhelm rather than be useful.\n return;\n }\n\n // Announce the type of event that was selected (special casing frames.)\n if (Trace.Types.Events.isLegacyTimelineFrame(newSelection.event)) {\n UI.ARIAUtils.alert(i18nString(UIStrings.frameSelected));\n return;\n }\n const name = Utils.EntryName.nameForEntry(newSelection.event);\n UI.ARIAUtils.alert(i18nString(UIStrings.eventSelected, {PH1: name}));\n }\n\n select(selection: TimelineSelection|null): void {\n this.#announceSelectionToAria(this.selection, selection);\n this.selection = selection;\n this.flameChart.setSelectionAndReveal(selection);\n }\n\n selectEntryAtTime(events: Trace.Types.Events.Event[]|null, time: number): void {\n if (!events) {\n return;\n }\n\n if (events.length === 0) {\n this.select(null);\n return;\n }\n\n // Find best match, then backtrack to the first visible entry.\n for (let index = Platform.ArrayUtilities.upperBound(events, time, (time, event) => time - event.ts) - 1; index >= 0;\n --index) {\n const event = events[index];\n const {endTime} = Trace.Helpers.Timing.eventTimingsMilliSeconds(event);\n if (Trace.Helpers.Trace.isTopLevelEvent(event) && endTime < time) {\n break;\n }\n if (ActiveFilters.instance().isVisible(event) && endTime >= time) {\n this.select(selectionFromEvent(event));\n return;\n }\n }\n this.select(null);\n }\n\n highlightEvent(event: Trace.Types.Events.Event|null): void {\n this.flameChart.highlightEvent(event);\n }\n\n #revealTimeRange(startTime: Trace.Types.Timing.MilliSeconds, endTime: Trace.Types.Timing.MilliSeconds): void {\n const traceBoundsState = TraceBounds.TraceBounds.BoundsManager.instance().state();\n if (!traceBoundsState) {\n return;\n }\n const traceWindow = traceBoundsState.milli.timelineTraceWindow;\n\n let offset = 0;\n if (traceWindow.max < endTime) {\n offset = endTime - traceWindow.max;\n } else if (traceWindow.min > startTime) {\n offset = startTime - traceWindow.min;\n }\n TraceBounds.TraceBounds.BoundsManager.instance().setTimelineVisibleWindow(\n Trace.Helpers.Timing.traceWindowFromMilliSeconds(\n Trace.Types.Timing.MilliSeconds(traceWindow.min + offset),\n Trace.Types.Timing.MilliSeconds(traceWindow.max + offset),\n ),\n {\n shouldAnimate: true,\n },\n );\n }\n\n private handleDrop(dataTransfer: DataTransfer): void {\n const items = dataTransfer.items;\n if (!items.length) {\n return;\n }\n const item = items[0];\n Host.userMetrics.actionTaken(Host.UserMetrics.Action.PerfPanelTraceImported);\n if (item.kind === 'string') {\n const url = dataTransfer.getData('text/uri-list') as Platform.DevToolsPath.UrlString;\n if (new Common.ParsedURL.ParsedURL(url).isValid) {\n void this.loadFromURL(url);\n }\n } else if (item.kind === 'file') {\n const file = items[0].getAsFile();\n if (!file) {\n return;\n }\n void this.loadFromFile(file);\n }\n }\n}\n\nexport const enum State {\n IDLE = 'Idle',\n START_PENDING = 'StartPending',\n RECORDING = 'Recording',\n STOP_PENDING = 'StopPending',\n LOADING = 'Loading',\n RECORDING_FAILED = 'RecordingFailed',\n}\n\n// Define row and header height, should be in sync with styles for timeline graphs.\nexport const rowHeight = 18;\n\nexport const headerHeight = 20;\nexport interface TimelineModeViewDelegate {\n select(selection: TimelineSelection|null): void;\n element: Element;\n selectEntryAtTime(events: Trace.Types.Events.Event[]|null, time: number): void;\n highlightEvent(event: Trace.Types.Events.Event|null): void;\n}\n\nexport class StatusPane extends UI.Widget.VBox {\n private status: HTMLElement;\n private time: Element|undefined;\n private progressLabel!: Element;\n private progressBar!: Element;\n private readonly description: HTMLElement|undefined;\n private button: Buttons.Button.Button;\n private downloadTraceButton: Buttons.Button.Button;\n private startTime!: number;\n private timeUpdateTimer?: number;\n #rawEvents?: Trace.Types.Events.Event[];\n\n constructor(\n options: {\n showTimer?: boolean,\n showProgress?: boolean,\n description?: string,\n buttonText?: string,\n buttonDisabled?: boolean,\n },\n buttonCallback: () => (Promise| void)) {\n super(true);\n\n this.contentElement.classList.add('timeline-status-dialog');\n this.contentElement.setAttribute('jslog', `${VisualLogging.dialog('timeline-status').track({resize: true})}`);\n\n const statusLine = this.contentElement.createChild('div', 'status-dialog-line status');\n statusLine.createChild('div', 'label').textContent = i18nString(UIStrings.status);\n this.status = statusLine.createChild('div', 'content');\n UI.ARIAUtils.markAsStatus(this.status);\n\n if (options.showTimer) {\n const timeLine = this.contentElement.createChild('div', 'status-dialog-line time');\n timeLine.createChild('div', 'label').textContent = i18nString(UIStrings.time);\n this.time = timeLine.createChild('div', 'content');\n }\n\n if (options.showProgress) {\n const progressLine = this.contentElement.createChild('div', 'status-dialog-line progress');\n this.progressLabel = progressLine.createChild('div', 'label');\n this.progressBar = progressLine.createChild('div', 'indicator-container').createChild('div', 'indicator');\n UI.ARIAUtils.markAsProgressBar(this.progressBar);\n }\n\n if (typeof options.description === 'string') {\n const descriptionLine = this.contentElement.createChild('div', 'status-dialog-line description');\n descriptionLine.createChild('div', 'label').textContent = i18nString(UIStrings.description);\n this.description = descriptionLine.createChild('div', 'content');\n this.description.innerText = options.description;\n }\n\n const buttonContainer = this.contentElement.createChild('div', 'stop-button');\n this.downloadTraceButton = UI.UIUtils.createTextButton(i18nString(UIStrings.downloadAfterError), () => {\n void this.#downloadRawTraceAfterError();\n }, {jslogContext: 'timeline.download-after-error'});\n\n this.downloadTraceButton.disabled = true;\n this.downloadTraceButton.style.visibility = 'hidden';\n\n const buttonText = options.buttonText || i18nString(UIStrings.stop);\n this.button = UI.UIUtils.createTextButton(buttonText, buttonCallback, {\n jslogContext: 'timeline.stop-recording',\n });\n // Profiling can't be stopped during initialization.\n this.button.disabled = !options.buttonDisabled === false;\n\n buttonContainer.append(this.downloadTraceButton);\n buttonContainer.append(this.button);\n }\n\n finish(): void {\n this.stopTimer();\n this.button.disabled = true;\n }\n\n async #downloadRawTraceAfterError(): Promise {\n if (!this.#rawEvents || this.#rawEvents.length === 0) {\n return;\n }\n const traceStart = Platform.DateUtilities.toISO8601Compact(new Date());\n const fileName = `Trace-Load-Error-${traceStart}.json` as Platform.DevToolsPath.RawPathString;\n const formattedTraceIter = traceJsonGenerator(this.#rawEvents, {});\n const traceAsString = Array.from(formattedTraceIter).join('');\n await Workspace.FileManager.FileManager.instance().save(\n fileName, traceAsString, true /* forceSaveAs */, false /* isBase64 */);\n Workspace.FileManager.FileManager.instance().close(fileName);\n }\n\n enableDownloadOfEvents(rawEvents: Trace.Types.Events.Event[]): void {\n this.#rawEvents = rawEvents;\n this.downloadTraceButton.disabled = false;\n this.downloadTraceButton.style.visibility = 'visible';\n }\n\n remove(): void {\n if (this.element.parentNode) {\n (this.element.parentNode as HTMLElement).classList.remove('tinted');\n this.arrangeDialog((this.element.parentNode as HTMLElement));\n }\n this.stopTimer();\n this.element.remove();\n }\n\n showPane(parent: Element): void {\n this.arrangeDialog(parent);\n this.show(parent);\n parent.classList.add('tinted');\n }\n\n enableAndFocusButton(): void {\n this.button.disabled = false;\n this.button.focus();\n }\n\n updateStatus(text: string): void {\n this.status.textContent = text;\n }\n\n updateProgressBar(activity: string, percent: number): void {\n this.progressLabel.textContent = activity;\n (this.progressBar as HTMLElement).style.width = percent.toFixed(1) + '%';\n UI.ARIAUtils.setValueNow(this.progressBar, percent);\n this.updateTimer();\n }\n\n startTimer(): void {\n this.startTime = Date.now();\n this.timeUpdateTimer = window.setInterval(this.updateTimer.bind(this), 100);\n this.updateTimer();\n }\n\n private stopTimer(): void {\n if (!this.timeUpdateTimer) {\n return;\n }\n clearInterval(this.timeUpdateTimer);\n this.updateTimer();\n delete this.timeUpdateTimer;\n }\n\n private updateTimer(): void {\n this.arrangeDialog((this.element.parentNode as HTMLElement));\n if (!this.timeUpdateTimer || !this.time) {\n return;\n }\n\n const seconds = (Date.now() - this.startTime) / 1000;\n this.time.textContent = i18n.TimeUtilities.preciseSecondsToString(seconds, 1);\n }\n\n private arrangeDialog(parent: Element): void {\n const isSmallDialog = parent.clientWidth < 325;\n this.element.classList.toggle('small-dialog', isSmallDialog);\n this.contentElement.classList.toggle('small-dialog', isSmallDialog);\n }\n override wasShown(): void {\n super.wasShown();\n this.registerCSSFiles([timelineStatusDialogStyles]);\n }\n}\n\nlet loadTimelineHandlerInstance: LoadTimelineHandler;\n\nexport class LoadTimelineHandler implements Common.QueryParamHandler.QueryParamHandler {\n static instance(opts: {\n forceNew: boolean|null,\n } = {forceNew: null}): LoadTimelineHandler {\n const {forceNew} = opts;\n if (!loadTimelineHandlerInstance || forceNew) {\n loadTimelineHandlerInstance = new LoadTimelineHandler();\n }\n\n return loadTimelineHandlerInstance;\n }\n\n handleQueryParam(value: string): void {\n void UI.ViewManager.ViewManager.instance().showView('timeline').then(async () => {\n await TimelinePanel.instance().loadFromURL(window.decodeURIComponent(value) as Platform.DevToolsPath.UrlString);\n });\n }\n}\n\nexport class TraceRevealer implements Common.Revealer.Revealer {\n async reveal(trace: SDK.TraceObject.TraceObject): Promise {\n await UI.ViewManager.ViewManager.instance().showView('timeline');\n TimelinePanel.instance().loadFromEvents(trace.traceEvents);\n }\n}\n\nexport class EventRevealer implements Common.Revealer.Revealer {\n async reveal(rEvent: SDK.TraceObject.RevealableEvent): Promise {\n await UI.ViewManager.ViewManager.instance().showView('timeline');\n TimelinePanel.instance().select(selectionFromEvent(rEvent.event));\n }\n}\n\nexport class ActionDelegate implements UI.ActionRegistration.ActionDelegate {\n handleAction(context: UI.Context.Context, actionId: string): boolean {\n const panel = context.flavor(TimelinePanel);\n if (panel === null) {\n return false;\n }\n switch (actionId) {\n case 'timeline.toggle-recording':\n void panel.toggleRecording();\n return true;\n case 'timeline.record-reload':\n panel.recordReload();\n return true;\n case 'timeline.save-to-file':\n void panel.saveToFile();\n return true;\n case 'timeline.load-from-file':\n panel.selectFileToLoad();\n return true;\n case 'timeline.jump-to-previous-frame':\n panel.jumpToFrame(-1);\n return true;\n case 'timeline.jump-to-next-frame':\n panel.jumpToFrame(1);\n return true;\n case 'timeline.show-history':\n void panel.showHistoryDropdown();\n return true;\n case 'timeline.previous-recording':\n panel.navigateHistory(1);\n return true;\n case 'timeline.next-recording':\n panel.navigateHistory(-1);\n return true;\n }\n return false;\n }\n}\n"]} \ No newline at end of file diff --git a/public/panels/timeline/TimelineUIUtils.js.map b/public/panels/timeline/TimelineUIUtils.js.map index 10ae1fd15..40855ca60 100644 --- a/public/panels/timeline/TimelineUIUtils.js.map +++ b/public/panels/timeline/TimelineUIUtils.js.map @@ -1 +1 @@ -{"version":3,"file":"TimelineUIUtils.js","sourceRoot":"","sources":["../../../../../../front_end/panels/timeline/TimelineUIUtils.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAEH,OAAO,KAAK,MAAM,MAAM,6BAA6B,CAAC;AACtD,OAAO,KAAK,IAAI,MAAM,yBAAyB,CAAC;AAChD,OAAO,KAAK,QAAQ,MAAM,iCAAiC,CAAC;AAC5D,OAAO,KAAK,IAAI,MAAM,yBAAyB,CAAC;AAChD,OAAO,KAAK,GAAG,MAAM,uBAAuB,CAAC;AAE7C,OAAO,KAAK,QAAQ,MAAM,mCAAmC,CAAC;AAC9D,OAAO,KAAK,KAAK,MAAM,6BAA6B,CAAC;AACrD,OAAO,KAAK,WAAW,MAAM,6CAA6C,CAAC;AAC3E,OAAO,KAAK,eAAe,MAAM,0DAA0D,CAAC;AAC5F,sDAAsD;AACtD,OAAO,qBAAqB,MAAM,6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AO,oBAAoB,CAAC;QAC9B,CAAC;QACD,OAAO,OAAO,CAAC,WAAW,CAAC,CAAC;IAC9B,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC;AAED,SAAS,gBAAgB,CACrB,KAA+B,EAAE,WAA6C;IAChF,MAAM,QAAQ,GAAG,KAAK,CAAC,KAAK,CAAC,UAAU,CAAC,yBAAyB,CAAC,KAAK,CAAC,CAAC,CAAC;QACtE,WAAW,CAAC,kBAAkB,CAAC,WAAW,CAAC,CAAC;QAC5C,WAAW,CAAC,QAAQ,CAAC,WAAW,CAAC;IACrC,MAAM,QAAQ,GAAG,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,QAAQ,CAAC;IAC/C,OAAO,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,0BAA0B,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;AACnH,CAAC","sourcesContent":["// Copyright 2021 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\n/*\n * Copyright (C) 2013 Google Inc. All rights reserved.\n * Copyright (C) 2012 Intel Inc. All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are\n * met:\n *\n * * Redistributions of source code must retain the above copyright\n * notice, this list of conditions and the following disclaimer.\n * * Redistributions in binary form must reproduce the above\n * copyright notice, this list of conditions and the following disclaimer\n * in the documentation and/or other materials provided with the\n * distribution.\n * * Neither the name of Google Inc. nor the names of its\n * contributors may be used to endorse or promote products derived from\n * this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nimport * as Common from '../../core/common/common.js';\nimport * as i18n from '../../core/i18n/i18n.js';\nimport * as Platform from '../../core/platform/platform.js';\nimport * as Root from '../../core/root/root.js';\nimport * as SDK from '../../core/sdk/sdk.js';\nimport type * as Protocol from '../../generated/protocol.js';\nimport * as Bindings from '../../models/bindings/bindings.js';\nimport * as Trace from '../../models/trace/trace.js';\nimport * as TraceBounds from '../../services/trace_bounds/trace_bounds.js';\nimport * as CodeHighlighter from '../../ui/components/code_highlighter/code_highlighter.js';\n// eslint-disable-next-line rulesdir/es-modules-import\nimport codeHighlighterStyles from '../../ui/components/code_highlighter/codeHighlighter.css.js';\nimport * as PerfUI from '../../ui/legacy/components/perf_ui/perf_ui.js';\n// eslint-disable-next-line rulesdir/es-modules-import\nimport imagePreviewStyles from '../../ui/legacy/components/utils/imagePreview.css.js';\nimport * as LegacyComponents from '../../ui/legacy/components/utils/utils.js';\nimport * as UI from '../../ui/legacy/legacy.js';\n\nimport {CLSRect} from './CLSLinkifier.js';\nimport * as TimelineComponents from './components/components.js';\nimport * as Extensions from './extensions/extensions.js';\nimport {Tracker} from './FreshRecording.js';\nimport {ModificationsManager} from './ModificationsManager.js';\nimport {targetForEvent} from './TargetForEvent.js';\nimport {TimelinePanel} from './TimelinePanel.js';\nimport {selectionFromEvent} from './TimelineSelection.js';\nimport * as Utils from './utils/utils.js';\n\nconst UIStrings = {\n /**\n *@description Text that only contain a placeholder\n *@example {100ms (at 200ms)} PH1\n */\n emptyPlaceholder: '{PH1}', // eslint-disable-line rulesdir/l10n-no-locked-or-placeholder-only-phrase\n /**\n *@description Text for timestamps of items\n */\n timestamp: 'Timestamp',\n /**\n *@description Text shown next to the interaction event's ID in the detail view.\n */\n interactionID: 'ID',\n /**\n *@description Text shown next to the interaction event's input delay time in the detail view.\n */\n inputDelay: 'Input delay',\n /**\n *@description Text shown next to the interaction event's thread processing duration in the detail view.\n */\n processingDuration: 'Processing duration',\n /**\n *@description Text shown next to the interaction event's presentation delay time in the detail view.\n */\n presentationDelay: 'Presentation delay',\n /**\n *@description Text shown when the user has selected an event that represents script compiliation.\n */\n compile: 'Compile',\n /**\n *@description Text shown when the user selects an event that represents script parsing.\n */\n parse: 'Parse',\n /**\n *@description Text with two placeholders separated by a colon\n *@example {Node removed} PH1\n *@example {div#id1} PH2\n */\n sS: '{PH1}: {PH2}',\n /**\n *@description Details text used to show the amount of data collected.\n *@example {30 MB} PH1\n */\n sCollected: '{PH1} collected',\n /**\n *@description Text used to show a URL to a script and the relevant line numbers.\n *@example {https://example.com/foo.js} PH1\n *@example {2} PH2\n *@example {4} PH3\n */\n sSs: '{PH1} [{PH2}…{PH3}]',\n /**\n *@description Text used to show a URL to a script and the starting line\n * number - used when there is no end line number available.\n *@example {https://example.com/foo.js} PH1\n *@example {2} PH2\n */\n sSSquareBrackets: '{PH1} [{PH2}…]',\n /**\n *@description Text that is usually a hyperlink to more documentation\n */\n learnMore: 'Learn more',\n /**\n *@description Text referring to the status of the browser's compilation cache.\n */\n compilationCacheStatus: 'Compilation cache status',\n /**\n *@description Text referring to the size of the browser's compiliation cache.\n */\n compilationCacheSize: 'Compilation cache size',\n /**\n *@description Text in Timeline UIUtils of the Performance panel. \"Compilation\n * cache\" refers to the code cache described at\n * https://v8.dev/blog/code-caching-for-devs . This label is followed by the\n * type of code cache data used, either \"normal\" or \"full\" as described in the\n * linked article.\n */\n compilationCacheKind: 'Compilation cache kind',\n /**\n *@description Text used to inform the user that the script they are looking\n * at was loaded from the browser's cache.\n */\n scriptLoadedFromCache: 'script loaded from cache',\n /**\n *@description Text to inform the user that the script they are looking at\n * was unable to be loaded from the browser's cache.\n */\n failedToLoadScriptFromCache: 'failed to load script from cache',\n /**\n *@description Text to inform the user that the script they are looking at was not eligible to be loaded from the browser's cache.\n */\n scriptNotEligibleToBeLoadedFromCache: 'script not eligible',\n /**\n *@description Text for the total time of something\n */\n totalTime: 'Total time',\n /**\n *@description Time of a single activity, as opposed to the total time\n */\n selfTime: 'Self time',\n /**\n *@description Label in the summary view in the Performance panel for a number which indicates how much managed memory has been reclaimed by performing Garbage Collection\n */\n collected: 'Collected',\n /**\n *@description Text for a programming function\n */\n function: 'Function',\n /**\n *@description Text for referring to the ID of a timer.\n */\n timerId: 'Timer ID',\n /**\n *@description Text for referring to a timer that has timed-out and therefore is being removed.\n */\n timeout: 'Timeout',\n /**\n *@description Text used to indicate that a timer is repeating (e.g. every X seconds) rather than a one off.\n */\n repeats: 'Repeats',\n /**\n *@description Text for referring to the ID of a callback function installed by an event.\n */\n callbackId: 'Callback ID',\n /**\n *@description Text for a module, the programming concept\n */\n module: 'Module',\n /**\n *@description Label for a group of JavaScript files\n */\n script: 'Script',\n /**\n *@description Text used to tell a user that a compilation trace event was streamed.\n */\n streamed: 'Streamed',\n /**\n *@description Text to indicate if a compilation event was eager.\n */\n eagerCompile: 'Compiling all functions eagerly',\n /**\n *@description Text to refer to the URL associated with a given event.\n */\n url: 'Url',\n /**\n *@description Text to indicate to the user the size of the cache (as a filesize - e.g. 5mb).\n */\n producedCacheSize: 'Produced cache size',\n /**\n *@description Text to indicate to the user the amount of the cache (as a filesize - e.g. 5mb) that has been used.\n */\n consumedCacheSize: 'Consumed cache size',\n /**\n *@description Title for a group of cities\n */\n location: 'Location',\n /**\n *@description Text used to show a coordinate pair (e.g. (3, 2)).\n *@example {2} PH1\n *@example {2} PH2\n */\n sSCurlyBrackets: '({PH1}, {PH2})',\n /**\n *@description Text used to indicate to the user they are looking at the physical dimensions of a shape that was drawn by the browser.\n */\n dimensions: 'Dimensions',\n /**\n *@description Text used to show the user the dimensions of a shape and indicate its area (e.g. 3x2).\n *@example {2} PH1\n *@example {2} PH2\n */\n sSDimensions: '{PH1} × {PH2}',\n /**\n *@description Related node label in Timeline UIUtils of the Performance panel\n */\n layerRoot: 'Layer root',\n /**\n *@description Related node label in Timeline UIUtils of the Performance panel\n */\n ownerElement: 'Owner element',\n /**\n *@description Text used to show the user the URL of the image they are viewing.\n */\n imageUrl: 'Image URL',\n /**\n *@description Text used to show the user that the URL they are viewing is loading a CSS stylesheet.\n */\n stylesheetUrl: 'Stylesheet URL',\n /**\n *@description Text used next to a number to show the user how many elements were affected.\n */\n elementsAffected: 'Elements affected',\n /**\n *@description Text used next to a number to show the user how many nodes required the browser to update and re-layout the page.\n */\n nodesThatNeedLayout: 'Nodes that need layout',\n /**\n *@description Text used to show the amount in a subset - e.g. \"2 of 10\".\n *@example {2} PH1\n *@example {10} PH2\n */\n sOfS: '{PH1} of {PH2}',\n /**\n *@description Related node label in Timeline UIUtils of the Performance panel\n */\n layoutRoot: 'Layout root',\n /**\n *@description Text used when viewing an event that can have a custom message attached.\n */\n message: 'Message',\n /**\n *@description Text used to tell the user they are viewing an event that has a function embedded in it, which is referred to as the \"callback function\".\n */\n callbackFunction: 'Callback function',\n /**\n *@description Text used to show the relevant range of a file - e.g. \"lines 2-10\".\n */\n range: 'Range',\n /**\n *@description Text used to refer to the amount of time some event or code was given to complete within.\n */\n allottedTime: 'Allotted time',\n /**\n *@description Text used to tell a user that a particular event or function was automatically run by a timeout.\n */\n invokedByTimeout: 'Invoked by timeout',\n /**\n *@description Text that refers to some types\n */\n type: 'Type',\n /**\n *@description Text for the size of something\n */\n size: 'Size',\n /**\n *@description Text for the details of something\n */\n details: 'Details',\n /**\n *@description Title in Timeline for Cumulative Layout Shifts\n */\n cumulativeLayoutShifts: 'Cumulative Layout Shifts',\n /**\n *@description Text for the link to the evolved CLS website\n */\n evolvedClsLink: 'evolved',\n /**\n *@description Warning in Timeline that CLS can cause a poor user experience. It contains a link to inform developers about the recent changes to how CLS is measured. The new CLS metric is said to have evolved from the previous version.\n *@example {Link to web.dev/metrics} PH1\n *@example {Link to web.dev/evolving-cls which will always have the text 'evolved'} PH2\n */\n sCLSInformation: '{PH1} can result in poor user experiences. It has recently {PH2}.',\n /**\n *@description Text to indicate an item is a warning\n */\n warning: 'Warning',\n /**\n *@description Title for the Timeline CLS Score\n */\n score: 'Score',\n /**\n *@description Text in Timeline for the cumulative CLS score\n */\n cumulativeScore: 'Cumulative score',\n /**\n *@description Text in Timeline for the current CLS score\n */\n currentClusterScore: 'Current cluster score',\n /**\n *@description Text in Timeline for the current CLS cluster\n */\n currentClusterId: 'Current cluster ID',\n /**\n *@description Text in Timeline for whether input happened recently\n */\n hadRecentInput: 'Had recent input',\n /**\n *@description Text in Timeline indicating that input has happened recently\n */\n yes: 'Yes',\n /**\n *@description Text in Timeline indicating that input has not happened recently\n */\n no: 'No',\n /**\n *@description Label for Cumulative Layout records, indicating where they moved from\n */\n movedFrom: 'Moved from',\n /**\n *@description Label for Cumulative Layout records, indicating where they moved to\n */\n movedTo: 'Moved to',\n /**\n *@description Text that indicates a particular HTML element or node is related to what the user is viewing.\n */\n relatedNode: 'Related node',\n /**\n *@description Text for previewing items\n */\n preview: 'Preview',\n /**\n *@description Text used to refer to the total time summed up across multiple events.\n */\n aggregatedTime: 'Aggregated time',\n /**\n *@description Text for the duration of something\n */\n duration: 'Duration',\n /**\n *@description Text for the stack trace of the initiator of something. The Initiator is the event or factor that directly triggered or precipitated a subsequent action.\n */\n initiatorStackTrace: 'Initiator stack trace',\n /**\n *@description Text for the event initiated by another one\n */\n initiatedBy: 'Initiated by',\n /**\n *@description Text for the event that is an initiator for another one\n */\n initiatorFor: 'Initiator for',\n /**\n *@description Text for the underlying data behing a specific flamechart selection. Trace events are the browser instrumentation that are emitted as JSON objects.\n */\n traceEvent: 'Trace event',\n /**\n *@description Call site stack label in Timeline UIUtils of the Performance panel\n */\n timerInstalled: 'Timer installed',\n /**\n *@description Call site stack label in Timeline UIUtils of the Performance panel\n */\n animationFrameRequested: 'Animation frame requested',\n /**\n *@description Call site stack label in Timeline UIUtils of the Performance panel\n */\n idleCallbackRequested: 'Idle callback requested',\n /**\n *@description Stack label in Timeline UIUtils of the Performance panel\n */\n recalculationForced: 'Recalculation forced',\n /**\n *@description Call site stack label in Timeline UIUtils of the Performance panel\n */\n firstLayoutInvalidation: 'First layout invalidation',\n /**\n *@description Stack label in Timeline UIUtils of the Performance panel\n */\n layoutForced: 'Layout forced',\n /**\n *@description Label in front of CSS property (eg `opacity`) being animated or a CSS animation name (eg `layer-4-fade-in-out`)\n */\n animating: 'Animating',\n /**\n *@description Label in front of reasons why a CSS animation wasn't composited (aka hardware accelerated)\n */\n compositingFailed: 'Compositing failed',\n /** Descriptive reason for why a user-provided animation failed to be optimized by the browser due to accelerated animations being disabled. Shown in a table with a list of other potential failure reasons. */\n compositingFailedAcceleratedAnimationsDisabled: 'Accelerated animations disabled',\n /** Descriptive reason for why a user-provided animation failed to be optimized by the browser due to DevTools suppressing the effect. Shown in a table with a list of other potential failure reasons. */\n compositingFailedEffectSuppressedByDevtools: 'Effect suppressed by DevTools ',\n /** Descriptive reason for why a user-provided animation failed to be optimized by the browser due to the animation or effect being invalid. Shown in a table with a list of other potential failure reasons. */\n compositingFailedInvalidAnimationOrEffect: 'Invalid animation or effect',\n /** Descriptive reason for why a user-provided animation failed to be optimized by the browser due to an effect having unsupported timing parameters. Shown in a table with a list of other potential failure reasons. */\n compositingFailedEffectHasUnsupportedTimingParams: 'Effect has unsupported timing parameters',\n /** Descriptive reason for why a user-provided animation failed to be optimized by the browser due to an effect having a composite mode which is not `replace`. Shown in a table with a list of other potential failure reasons. */\n compositingFailedEffectHasNonReplaceCompositeMode: 'Effect has composite mode other than \"replace\"',\n /** Descriptive reason for why a user-provided animation failed to be optimized by the browser due to the target being in an invalid compositing state. Shown in a table with a list of other potential failure reasons. */\n compositingFailedTargetHasInvalidCompositingState: 'Target has invalid compositing state',\n /** Descriptive reason for why a user-provided animation failed to be optimized by the browser due to another animation on the same target being incompatible. Shown in a table with a list of other potential failure reasons. */\n compositingFailedTargetHasIncompatibleAnimations: 'Target has another animation which is incompatible',\n /** Descriptive reason for why a user-provided animation failed to be optimized by the browser due to the target having a CSS offset. Shown in a table with a list of other potential failure reasons. */\n compositingFailedTargetHasCSSOffset: 'Target has CSS offset',\n /** Descriptive reason for why a user-provided animation failed to be optimized by the browser due to the animation affecting non-CSS properties. Shown in a table with a list of other potential failure reasons. */\n compositingFailedAnimationAffectsNonCSSProperties: 'Animation affects non-CSS properties',\n /** Descriptive reason for why a user-provided animation failed to be optimized by the browser due to the transform-related property not being able to be animated on the target. Shown in a table with a list of other potential failure reasons. */\n compositingFailedTransformRelatedPropertyCannotBeAcceleratedOnTarget:\n 'Transform-related property cannot be accelerated on target',\n /** Descriptive reason for why a user-provided animation failed to be optimized by the browser due to a `transform` property being dependent on the size of the element itself. Shown in a table with a list of other potential failure reasons. */\n compositingFailedTransformDependsBoxSize: 'Transform-related property depends on box size',\n /** Descriptive reason for why a user-provided animation failed to be optimized by the browser due to a `filter` property possibly moving pixels. Shown in a table with a list of other potential failure reasons. */\n compositingFailedFilterRelatedPropertyMayMovePixels: 'Filter-related property may move pixels',\n /**\n * @description [ICU Syntax] Descriptive reason for why a user-provided animation failed to be optimized by the browser due to the animated CSS property not being supported on the compositor. Shown in a table with a list of other potential failure reasons.\n * @example {height, width} properties\n */\n compositingFailedUnsupportedCSSProperty: `{propertyCount, plural,\n =1 {Unsupported CSS property: {properties}}\n other {Unsupported CSS properties: {properties}}\n }`,\n /** Descriptive reason for why a user-provided animation failed to be optimized by the browser due to mixing keyframe value types. Shown in a table with a list of other potential failure reasons. */\n compositingFailedMixedKeyframeValueTypes: 'Mixed keyframe value types',\n /** Descriptive reason for why a user-provided animation failed to be optimized by the browser due to the timeline source being in an invalid compositing state. Shown in a table with a list of other potential failure reasons. */\n compositingFailedTimelineSourceHasInvalidCompositingState: 'Timeline source has invalid compositing state',\n /** Descriptive reason for why a user-provided animation failed to be optimized by the browser due to the animation having no visible change. Shown in a table with a list of other potential failure reasons. */\n compositingFailedAnimationHasNoVisibleChange: 'Animation has no visible change',\n /** Descriptive reason for why a user-provided animation failed to be optimized by the browser due to an effect affecting an important property. Shown in a table with a list of other potential failure reasons. */\n compositingFailedAffectsImportantProperty: 'Effect affects a property with !important',\n /** Descriptive reason for why a user-provided animation failed to be optimized by the browser due to the SVG target having an independent transfrom property. Shown in a table with a list of other potential failure reasons. */\n compositingFailedSVGTargetHasIndependentTransformProperty: 'SVG target has independent transform property',\n /** Descriptive reason for why a user-provided animation failed to be optimized by the browser due to an unknown reason. Shown in a table with a list of other potential failure reasons. */\n compositingFailedUnknownReason: 'Unknown Reason',\n\n /**\n *@description Text for the execution stack trace\n */\n stackTrace: 'Stack trace',\n /**\n *@description Text used to show any invalidations for a particular event that caused the browser to have to do more work to update the page.\n * @example {2} PH1\n */\n invalidations: 'Invalidations ({PH1} total)',\n /**\n * @description Text in Timeline UIUtils of the Performance panel. Phrase is followed by a number of milliseconds.\n * Some events or tasks might have been only started, but have not ended yet. Such events or tasks are considered\n * \"pending\".\n */\n pendingFor: 'Pending for',\n /**\n *@description Noun label for a stack trace which indicates the first time some condition was invalidated.\n */\n firstInvalidated: 'First invalidated',\n /**\n *@description Title of the paint profiler, old name of the performance pane\n */\n paintProfiler: 'Paint profiler',\n /**\n *@description Text in Timeline Flame Chart View of the Performance panel\n *@example {Frame} PH1\n *@example {10ms} PH2\n */\n sAtS: '{PH1} at {PH2}',\n /**\n *@description Text used next to a time to indicate that the particular event took that much time itself. In context this might look like \"3ms blink.console (self)\"\n *@example {blink.console} PH1\n */\n sSelf: '{PH1} (self)',\n /**\n *@description Text used next to a time to indicate that the event's children took that much time. In context this might look like \"3ms blink.console (children)\"\n *@example {blink.console} PH1\n */\n sChildren: '{PH1} (children)',\n /**\n *@description Text used to show the user how much time the browser spent on rendering (drawing the page onto the screen).\n */\n timeSpentInRendering: 'Time spent in rendering',\n /**\n *@description Text for a rendering frame\n */\n frame: 'Frame',\n /**\n *@description Text used to refer to the duration of an event at a given offset - e.g. \"2ms at 10ms\" which can be read as \"2ms starting after 10ms\".\n *@example {10ms} PH1\n *@example {10ms} PH2\n */\n sAtSParentheses: '{PH1} (at {PH2})',\n /**\n *@description Text of a DOM element in Timeline UIUtils of the Performance panel\n */\n UnknownNode: '[ unknown node ]',\n /**\n *@description Text used to refer to a particular element and the file it was referred to in.\n *@example {node} PH1\n *@example {app.js} PH2\n */\n invalidationWithCallFrame: '{PH1} at {PH2}',\n /**\n *@description Text indicating that something is outside of the Performace Panel Timeline Minimap range\n */\n outsideBreadcrumbRange: '(outside of the breadcrumb range)',\n /**\n *@description Text indicating that something is hidden from the Performace Panel Timeline\n */\n entryIsHidden: '(entry is hidden)',\n /**\n * @description Title of a row in the details view for a `Recalculate Styles` event that contains more info about selector stats tracing.\n */\n selectorStatsTitle: 'Selector stats',\n /**\n * @description Info text that explains to the user how to enable selector stats tracing.\n * @example {Setting Name} PH1\n */\n sSelectorStatsInfo: 'Select \"{PH1}\" to collect detailed CSS selector matching statistics.',\n /**\n * @description Label for a description text of a metric.\n */\n description: 'Description',\n /**\n * @description Label for a numeric value that was how long to wait before a function was run.\n */\n delay: 'Delay',\n /**\n * @description Label for a string that describes the priority at which a task was scheduled, like 'background' for low-priority tasks, and 'user-blocking' for high priority.\n */\n priority: 'Priority',\n};\nconst str_ = i18n.i18n.registerUIStrings('panels/timeline/TimelineUIUtils.ts', UIStrings);\nconst i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);\n\nlet eventDispatchDesciptors: EventDispatchTypeDescriptor[];\n\nlet colorGenerator: Common.Color.Generator;\n\ntype LinkifyLocationOptions = {\n scriptId: Protocol.Runtime.ScriptId|null,\n url: string,\n lineNumber: number,\n target: SDK.Target.Target|null,\n linkifier: LegacyComponents.Linkifier.Linkifier,\n isFreshRecording?: boolean,\n columnNumber?: number,\n};\n\nexport class TimelineUIUtils {\n static frameDisplayName(frame: Protocol.Runtime.CallFrame): string {\n const maybeResolvedData = Utils.SourceMapsResolver.SourceMapsResolver.resolvedCodeLocationForCallFrame(frame);\n const functionName = maybeResolvedData?.name || frame.functionName;\n if (!Trace.Extras.TimelineJSProfile.TimelineJSProfileProcessor.isNativeRuntimeFrame(frame)) {\n return UI.UIUtils.beautifyFunctionName(functionName);\n }\n const nativeGroup = Trace.Extras.TimelineJSProfile.TimelineJSProfileProcessor.nativeGroup(functionName);\n switch (nativeGroup) {\n case Trace.Extras.TimelineJSProfile.TimelineJSProfileProcessor.NativeGroups.COMPILE:\n return i18nString(UIStrings.compile);\n case Trace.Extras.TimelineJSProfile.TimelineJSProfileProcessor.NativeGroups.PARSE:\n return i18nString(UIStrings.parse);\n }\n return functionName;\n }\n\n static testContentMatching(\n traceEvent: Trace.Types.Events.Event, regExp: RegExp, parsedTrace?: Trace.Handlers.Types.ParsedTrace): boolean {\n const title = TimelineUIUtils.eventStyle(traceEvent).title;\n const tokens = [title];\n\n if (Trace.Types.Events.isProfileCall(traceEvent)) {\n // In the future this case will not be possible - wherever we call this\n // function we will be able to pass in the data from the new engine. But\n // currently this is called in a variety of places including from the\n // legacy model which does not have a reference to the new engine's data.\n // So if we are missing the data, we just fallback to the name from the\n // callFrame.\n if (!parsedTrace || !parsedTrace.Samples) {\n tokens.push(traceEvent.callFrame.functionName);\n } else {\n tokens.push(Trace.Handlers.ModelHandlers.Samples.getProfileCallFunctionName(parsedTrace.Samples, traceEvent));\n }\n }\n if (parsedTrace) {\n const url = Trace.Handlers.Helpers.getNonResolvedURL(traceEvent, parsedTrace);\n if (url) {\n tokens.push(url);\n }\n }\n // This works for both legacy and new engine events.\n appendObjectProperties(traceEvent.args as ContentObject, 2);\n const result = tokens.join('|').match(regExp);\n return result ? result.length > 0 : false;\n\n interface ContentObject {\n [x: string]: number|string|ContentObject;\n }\n function appendObjectProperties(object: ContentObject, depth: number): void {\n if (!depth) {\n return;\n }\n for (const key in object) {\n const value = object[key];\n if (typeof value === 'string') {\n tokens.push(value);\n } else if (typeof value === 'number') {\n tokens.push(String(value));\n } else if (typeof value === 'object' && value !== null) {\n appendObjectProperties(value, depth - 1);\n }\n }\n }\n }\n\n static eventStyle(event: Trace.Types.Events.Event): Utils.EntryStyles.TimelineRecordStyle {\n if (Trace.Types.Events.isProfileCall(event) && event.callFrame.functionName === '(idle)') {\n return new Utils.EntryStyles.TimelineRecordStyle(event.name, Utils.EntryStyles.getCategoryStyles().idle);\n }\n\n if (event.cat === Trace.Types.Events.Categories.Console || event.cat === Trace.Types.Events.Categories.UserTiming) {\n return new Utils.EntryStyles.TimelineRecordStyle(event.name, Utils.EntryStyles.getCategoryStyles()['scripting']);\n }\n\n return Utils.EntryStyles.getEventStyle(event.name as Trace.Types.Events.Name) ??\n new Utils.EntryStyles.TimelineRecordStyle(event.name, Utils.EntryStyles.getCategoryStyles().other);\n }\n\n static eventColor(event: Trace.Types.Events.Event): string {\n if (Trace.Types.Events.isProfileCall(event)) {\n const frame = event.callFrame;\n if (TimelineUIUtils.isUserFrame(frame)) {\n // TODO(andoli): This should use the resolved (sourcemapped) URL\n return TimelineUIUtils.colorForId(frame.url);\n }\n }\n if (Trace.Types.Extensions.isSyntheticExtensionEntry(event)) {\n return Extensions.ExtensionUI.extensionEntryColor(event);\n }\n let parsedColor = TimelineUIUtils.eventStyle(event).category.getComputedColorValue();\n // This event is considered idle time but still rendered as a scripting event here\n // to connect the StreamingCompileScriptParsing events it belongs to.\n if (event.name === Trace.Types.Events.Name.STREAMING_COMPILE_SCRIPT_WAITING) {\n parsedColor = Utils.EntryStyles.getCategoryStyles().scripting.getComputedColorValue();\n if (!parsedColor) {\n throw new Error('Unable to parse color from getCategoryStyles().scripting.color');\n }\n }\n return parsedColor;\n }\n\n static eventTitle(event: Trace.Types.Events.Event): string {\n // Profile call events do not have a args.data property, thus, we\n // need to check for profile calls in the beginning of this\n // function.\n if (Trace.Types.Events.isProfileCall(event)) {\n const maybeResolvedData = Utils.SourceMapsResolver.SourceMapsResolver.resolvedCodeLocationForEntry(event);\n const displayName = maybeResolvedData?.name || TimelineUIUtils.frameDisplayName(event.callFrame);\n return displayName;\n }\n if (event.name === 'EventTiming' && Trace.Types.Events.isSyntheticInteraction(event)) {\n // TODO(crbug.com/365047728): replace this entire method with this call.\n return Utils.EntryName.nameForEntry(event);\n }\n const title = TimelineUIUtils.eventStyle(event).title;\n if (Trace.Helpers.Trace.eventHasCategory(event, Trace.Types.Events.Categories.Console)) {\n return title;\n }\n if (Trace.Types.Events.isTimeStamp(event)) {\n return i18nString(UIStrings.sS, {PH1: title, PH2: event.args.data.message});\n }\n if (Trace.Types.Events.isAnimation(event) && event.args.data.name) {\n return i18nString(UIStrings.sS, {PH1: title, PH2: event.args.data.name});\n }\n if (Trace.Types.Events.isDispatch(event)) {\n return i18nString(UIStrings.sS, {PH1: title, PH2: event.args.data.type});\n }\n return title;\n }\n\n static isUserFrame(frame: Protocol.Runtime.CallFrame): boolean {\n return frame.scriptId !== '0' && !(frame.url && frame.url.startsWith('native '));\n }\n\n static async buildDetailsTextForTraceEvent(\n event: Trace.Types.Events.Event, parsedTrace: Trace.Handlers.Types.ParsedTrace): Promise {\n let detailsText;\n\n // TODO(40287735): update this code with type-safe data checks.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const unsafeEventArgs = event.args as Record;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const unsafeEventData = event.args?.data as Record;\n\n switch (event.name) {\n case Trace.Types.Events.Name.GC:\n case Trace.Types.Events.Name.MAJOR_GC:\n case Trace.Types.Events.Name.MINOR_GC: {\n const delta = unsafeEventArgs['usedHeapSizeBefore'] - unsafeEventArgs['usedHeapSizeAfter'];\n detailsText = i18nString(UIStrings.sCollected, {PH1: i18n.ByteUtilities.bytesToString(delta)});\n break;\n }\n case Trace.Types.Events.Name.FUNCTION_CALL: {\n const {lineNumber, columnNumber} = Trace.Helpers.Trace.getZeroIndexedLineAndColumnForEvent(event);\n if (lineNumber !== undefined && columnNumber !== undefined) {\n detailsText = unsafeEventData.url + ':' + (lineNumber + 1) + ':' + (columnNumber + 1);\n }\n break;\n }\n case Trace.Types.Events.Name.EVENT_DISPATCH:\n detailsText = unsafeEventData ? unsafeEventData['type'] : null;\n break;\n case Trace.Types.Events.Name.PAINT: {\n const width = TimelineUIUtils.quadWidth(unsafeEventData.clip);\n const height = TimelineUIUtils.quadHeight(unsafeEventData.clip);\n if (width && height) {\n detailsText = i18nString(UIStrings.sSDimensions, {PH1: width, PH2: height});\n }\n break;\n }\n case Trace.Types.Events.Name.PARSE_HTML: {\n const startLine = unsafeEventArgs['beginData']['startLine'];\n const endLine = unsafeEventArgs['endData'] && unsafeEventArgs['endData']['endLine'];\n const url = Bindings.ResourceUtils.displayNameForURL(unsafeEventArgs['beginData']['url']);\n if (endLine >= 0) {\n detailsText = i18nString(UIStrings.sSs, {PH1: url, PH2: startLine + 1, PH3: endLine + 1});\n } else {\n detailsText = i18nString(UIStrings.sSSquareBrackets, {PH1: url, PH2: startLine + 1});\n }\n break;\n }\n case Trace.Types.Events.Name.COMPILE_MODULE:\n case Trace.Types.Events.Name.CACHE_MODULE:\n detailsText = Bindings.ResourceUtils.displayNameForURL(unsafeEventArgs['fileName']);\n break;\n case Trace.Types.Events.Name.COMPILE_SCRIPT:\n case Trace.Types.Events.Name.CACHE_SCRIPT:\n case Trace.Types.Events.Name.EVALUATE_SCRIPT: {\n const {lineNumber} = Trace.Helpers.Trace.getZeroIndexedLineAndColumnForEvent(event);\n const url = unsafeEventData && unsafeEventData['url'];\n if (url) {\n detailsText = Bindings.ResourceUtils.displayNameForURL(url) + ':' + ((lineNumber || 0) + 1);\n }\n break;\n }\n case Trace.Types.Events.Name.WASM_COMPILED_MODULE:\n case Trace.Types.Events.Name.WASM_MODULE_CACHE_HIT: {\n const url = unsafeEventArgs['url'];\n if (url) {\n detailsText = Bindings.ResourceUtils.displayNameForURL(url);\n }\n break;\n }\n\n case Trace.Types.Events.Name.STREAMING_COMPILE_SCRIPT:\n case Trace.Types.Events.Name.BACKGROUND_DESERIALIZE:\n case Trace.Types.Events.Name.XHR_READY_STATE_CHANGED:\n case Trace.Types.Events.Name.XHR_LOAD: {\n const url = unsafeEventData['url'];\n if (url) {\n detailsText = Bindings.ResourceUtils.displayNameForURL(url);\n }\n break;\n }\n case Trace.Types.Events.Name.TIME_STAMP:\n detailsText = unsafeEventData['message'];\n break;\n\n case Trace.Types.Events.Name.WEB_SOCKET_CREATE:\n case Trace.Types.Events.Name.WEB_SOCKET_SEND_HANDSHAKE_REQUEST:\n case Trace.Types.Events.Name.WEB_SOCKET_RECEIVE_HANDSHAKE_REQUEST:\n case Trace.Types.Events.Name.WEB_SOCKET_SEND:\n case Trace.Types.Events.Name.WEB_SOCKET_RECEIVE:\n case Trace.Types.Events.Name.WEB_SOCKET_DESTROY:\n case Trace.Types.Events.Name.RESOURCE_WILL_SEND_REQUEST:\n case Trace.Types.Events.Name.RESOURCE_SEND_REQUEST:\n case Trace.Types.Events.Name.RESOURCE_RECEIVE_DATA:\n case Trace.Types.Events.Name.RESOURCE_RECEIVE_RESPONSE:\n case Trace.Types.Events.Name.RESOURCE_FINISH:\n case Trace.Types.Events.Name.PAINT_IMAGE:\n case Trace.Types.Events.Name.DECODE_IMAGE:\n case Trace.Types.Events.Name.DECODE_LAZY_PIXEL_REF: {\n const url = Trace.Handlers.Helpers.getNonResolvedURL(event, parsedTrace);\n if (url) {\n detailsText = Bindings.ResourceUtils.displayNameForURL(url);\n }\n break;\n }\n\n case Trace.Types.Events.Name.EMBEDDER_CALLBACK:\n detailsText = unsafeEventData['callbackName'];\n break;\n\n case Trace.Types.Events.Name.ASYNC_TASK:\n detailsText = unsafeEventData ? unsafeEventData['name'] : null;\n break;\n\n default:\n if (Trace.Helpers.Trace.eventHasCategory(event, Trace.Types.Events.Categories.Console)) {\n detailsText = null;\n } else {\n detailsText = linkifyTopCallFrameAsText();\n }\n break;\n }\n\n return detailsText;\n\n function linkifyTopCallFrameAsText(): string|null {\n const frame = Trace.Helpers.Trace.getZeroIndexedStackTraceForEvent(event)?.at(0) ?? null;\n if (!frame) {\n return null;\n }\n\n return frame.url + ':' + (frame.lineNumber + 1) + ':' + (frame.columnNumber + 1);\n }\n }\n\n static async buildDetailsNodeForTraceEvent(\n event: Trace.Types.Events.Event, target: SDK.Target.Target|null, linkifier: LegacyComponents.Linkifier.Linkifier,\n isFreshRecording = false, parsedTrace: Trace.Handlers.Types.ParsedTrace): Promise {\n let details: HTMLElement|HTMLSpanElement|(Element | null)|Text|null = null;\n let detailsText;\n // TODO(40287735): update this code with type-safe data checks.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const unsafeEventArgs = event.args as Record;\n // TODO(40287735): update this code with type-safe data checks.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const unsafeEventData = event.args?.data as Record;\n\n switch (event.name) {\n case Trace.Types.Events.Name.GC:\n case Trace.Types.Events.Name.MAJOR_GC:\n case Trace.Types.Events.Name.MINOR_GC:\n case Trace.Types.Events.Name.EVENT_DISPATCH:\n case Trace.Types.Events.Name.PAINT:\n case Trace.Types.Events.Name.ANIMATION:\n case Trace.Types.Events.Name.EMBEDDER_CALLBACK:\n case Trace.Types.Events.Name.PARSE_HTML:\n case Trace.Types.Events.Name.WASM_STREAM_FROM_RESPONSE_CALLBACK:\n case Trace.Types.Events.Name.WASM_COMPILED_MODULE:\n case Trace.Types.Events.Name.WASM_MODULE_CACHE_HIT:\n case Trace.Types.Events.Name.WASM_CACHED_MODULE:\n case Trace.Types.Events.Name.WASM_MODULE_CACHE_INVALID:\n case Trace.Types.Events.Name.WEB_SOCKET_CREATE:\n case Trace.Types.Events.Name.WEB_SOCKET_SEND_HANDSHAKE_REQUEST:\n case Trace.Types.Events.Name.WEB_SOCKET_RECEIVE_HANDSHAKE_REQUEST:\n case Trace.Types.Events.Name.WEB_SOCKET_SEND:\n case Trace.Types.Events.Name.WEB_SOCKET_RECEIVE:\n case Trace.Types.Events.Name.WEB_SOCKET_DESTROY: {\n detailsText = await TimelineUIUtils.buildDetailsTextForTraceEvent(event, parsedTrace);\n break;\n }\n\n case Trace.Types.Events.Name.PAINT_IMAGE:\n case Trace.Types.Events.Name.DECODE_IMAGE:\n case Trace.Types.Events.Name.DECODE_LAZY_PIXEL_REF:\n case Trace.Types.Events.Name.XHR_READY_STATE_CHANGED:\n case Trace.Types.Events.Name.XHR_LOAD:\n case Trace.Types.Events.Name.RESOURCE_WILL_SEND_REQUEST:\n case Trace.Types.Events.Name.RESOURCE_SEND_REQUEST:\n case Trace.Types.Events.Name.RESOURCE_RECEIVE_DATA:\n case Trace.Types.Events.Name.RESOURCE_RECEIVE_RESPONSE:\n case Trace.Types.Events.Name.RESOURCE_FINISH: {\n const url = Trace.Handlers.Helpers.getNonResolvedURL(event, parsedTrace);\n if (url) {\n const options = {\n tabStop: true,\n showColumnNumber: false,\n inlineFrameIndex: 0,\n };\n details = LegacyComponents.Linkifier.Linkifier.linkifyURL(url, options);\n }\n break;\n }\n\n case Trace.Types.Events.Name.FUNCTION_CALL: {\n details = document.createElement('span');\n\n // FunctionCall events have an args.data that could be a CallFrame, if all the details are present, so we check for that.\n const callFrame = Trace.Helpers.Trace.getZeroIndexedStackTraceForEvent(event)?.at(0);\n if (Trace.Types.Events.isFunctionCall(event) && callFrame) {\n UI.UIUtils.createTextChild(\n details,\n TimelineUIUtils.frameDisplayName(\n {...callFrame, scriptId: String(callFrame.scriptId) as Protocol.Runtime.ScriptId}));\n }\n const location = this.linkifyLocation({\n scriptId: unsafeEventData['scriptId'],\n url: unsafeEventData['url'],\n lineNumber: callFrame?.lineNumber || 0,\n columnNumber: callFrame?.columnNumber,\n target,\n isFreshRecording,\n linkifier,\n });\n if (location) {\n UI.UIUtils.createTextChild(details, ' @ ');\n details.appendChild(location);\n }\n break;\n }\n\n case Trace.Types.Events.Name.COMPILE_MODULE:\n case Trace.Types.Events.Name.CACHE_MODULE: {\n details = this.linkifyLocation({\n scriptId: null,\n url: unsafeEventArgs['fileName'],\n lineNumber: 0,\n columnNumber: 0,\n target,\n isFreshRecording,\n linkifier,\n });\n break;\n }\n\n case Trace.Types.Events.Name.COMPILE_SCRIPT:\n case Trace.Types.Events.Name.CACHE_SCRIPT:\n case Trace.Types.Events.Name.EVALUATE_SCRIPT: {\n const url = unsafeEventData['url'];\n if (url) {\n const {lineNumber} = Trace.Helpers.Trace.getZeroIndexedLineAndColumnForEvent(event);\n details = this.linkifyLocation({\n scriptId: null,\n url,\n lineNumber: lineNumber || 0,\n columnNumber: 0,\n target,\n isFreshRecording,\n linkifier,\n });\n }\n break;\n }\n\n case Trace.Types.Events.Name.BACKGROUND_DESERIALIZE:\n case Trace.Types.Events.Name.STREAMING_COMPILE_SCRIPT: {\n const url = unsafeEventData['url'];\n if (url) {\n details = this.linkifyLocation(\n {scriptId: null, url, lineNumber: 0, columnNumber: 0, target, isFreshRecording, linkifier});\n }\n break;\n }\n\n default: {\n /**\n * Some events have a stack trace which is extracted by default at @see TimelineUIUtils.generateCauses\n * thus, we prevent extracting the stack trace again here.\n */\n if (Trace.Helpers.Trace.eventHasCategory(event, Trace.Types.Events.Categories.Console) ||\n Trace.Types.Events.isUserTiming(event) || Trace.Types.Extensions.isSyntheticExtensionEntry(event) ||\n Trace.Types.Events.isProfileCall(event)) {\n detailsText = null;\n } else {\n details = this.linkifyTopCallFrame(event, target, linkifier, isFreshRecording) ?? null;\n }\n break;\n }\n }\n\n if (!details && detailsText) {\n details = document.createTextNode(detailsText);\n }\n return details;\n }\n\n static linkifyLocation(linkifyOptions: LinkifyLocationOptions): Element|null {\n const {scriptId, url, lineNumber, columnNumber, isFreshRecording, linkifier, target} = linkifyOptions;\n const options = {\n lineNumber,\n columnNumber,\n showColumnNumber: true,\n inlineFrameIndex: 0,\n className: 'timeline-details',\n tabStop: true,\n };\n if (isFreshRecording) {\n return linkifier.linkifyScriptLocation(\n target, scriptId, url as Platform.DevToolsPath.UrlString, lineNumber, options);\n }\n return LegacyComponents.Linkifier.Linkifier.linkifyURL(url as Platform.DevToolsPath.UrlString, options);\n }\n\n static linkifyTopCallFrame(\n event: Trace.Types.Events.Event, target: SDK.Target.Target|null, linkifier: LegacyComponents.Linkifier.Linkifier,\n isFreshRecording = false): Element|null {\n let frame = Trace.Helpers.Trace.getZeroIndexedStackTraceForEvent(event)?.[0];\n if (Trace.Types.Events.isProfileCall(event)) {\n frame = event.callFrame;\n }\n if (!frame) {\n return null;\n }\n const options = {\n className: 'timeline-details',\n tabStop: true,\n inlineFrameIndex: 0,\n showColumnNumber: true,\n columnNumber: frame.columnNumber,\n lineNumber: frame.lineNumber,\n };\n if (isFreshRecording) {\n return linkifier.maybeLinkifyConsoleCallFrame(target, frame, {showColumnNumber: true, inlineFrameIndex: 0});\n }\n return LegacyComponents.Linkifier.Linkifier.linkifyURL(frame.url as Platform.DevToolsPath.UrlString, options);\n }\n\n static buildDetailsNodeForMarkerEvents(event: Trace.Types.Events.MarkerEvent): HTMLElement {\n let link = 'https://web.dev/user-centric-performance-metrics/';\n let name = 'page performance metrics';\n switch (event.name) {\n case Trace.Types.Events.Name.MARK_LCP_CANDIDATE:\n link = 'https://web.dev/lcp/';\n name = 'largest contentful paint';\n break;\n case Trace.Types.Events.Name.MARK_FCP:\n link = 'https://web.dev/first-contentful-paint/';\n name = 'first contentful paint';\n break;\n default:\n break;\n }\n\n const html = UI.Fragment.html`
${\n UI.XLink.XLink.create(\n link, i18nString(UIStrings.learnMore), undefined, undefined, 'learn-more')} about ${name}.
`;\n return html as HTMLElement;\n }\n\n static buildConsumeCacheDetails(\n eventData: {\n consumedCacheSize?: number,\n cacheRejected?: boolean,\n cacheKind?: string,\n },\n contentHelper: TimelineDetailsContentHelper): void {\n if (typeof eventData.consumedCacheSize === 'number') {\n contentHelper.appendTextRow(\n i18nString(UIStrings.compilationCacheStatus), i18nString(UIStrings.scriptLoadedFromCache));\n contentHelper.appendTextRow(\n i18nString(UIStrings.compilationCacheSize), i18n.ByteUtilities.bytesToString(eventData.consumedCacheSize));\n const cacheKind = eventData.cacheKind;\n if (cacheKind) {\n contentHelper.appendTextRow(i18nString(UIStrings.compilationCacheKind), cacheKind);\n }\n } else if ('cacheRejected' in eventData && eventData['cacheRejected']) {\n // Version mismatch or similar.\n contentHelper.appendTextRow(\n i18nString(UIStrings.compilationCacheStatus), i18nString(UIStrings.failedToLoadScriptFromCache));\n } else {\n contentHelper.appendTextRow(\n i18nString(UIStrings.compilationCacheStatus), i18nString(UIStrings.scriptNotEligibleToBeLoadedFromCache));\n }\n }\n\n static async buildTraceEventDetails(\n parsedTrace: Trace.Handlers.Types.ParsedTrace,\n event: Trace.Types.Events.Event,\n linkifier: LegacyComponents.Linkifier.Linkifier,\n detailed: boolean,\n ): Promise {\n const maybeTarget = targetForEvent(parsedTrace, event);\n const {duration} = Trace.Helpers.Timing.eventTimingsMilliSeconds(event);\n const selfTime = getEventSelfTime(event, parsedTrace);\n const relatedNodesMap = await Trace.Extras.FetchNodes.extractRelatedDOMNodesFromEvent(\n parsedTrace,\n event,\n );\n\n if (maybeTarget) {\n // @ts-ignore TODO(crbug.com/1011811): Remove symbol usage.\n if (typeof event[previewElementSymbol] === 'undefined') {\n let previewElement: (Element|null)|null = null;\n const url = Trace.Handlers.Helpers.getNonResolvedURL(event, parsedTrace);\n if (url) {\n previewElement = await LegacyComponents.ImagePreview.ImagePreview.build(maybeTarget, url, false, {\n imageAltText: LegacyComponents.ImagePreview.ImagePreview.defaultAltTextForImageURL(url),\n precomputedFeatures: undefined,\n align: LegacyComponents.ImagePreview.Align.START,\n });\n } else if (Trace.Types.Events.isPaint(event)) {\n previewElement = await TimelineUIUtils.buildPicturePreviewContent(parsedTrace, event, maybeTarget);\n }\n // @ts-ignore TODO(crbug.com/1011811): Remove symbol usage.\n event[previewElementSymbol] = previewElement;\n }\n }\n\n if (Trace.Types.Events.isSyntheticLayoutShift(event)) {\n // Ensure that there are no pie charts or extended info for layout shifts.\n detailed = false;\n }\n\n // This message may vary per event.name;\n let relatedNodeLabel;\n\n const contentHelper = new TimelineDetailsContentHelper(targetForEvent(parsedTrace, event), linkifier);\n\n const defaultColorForEvent = this.eventColor(event);\n const isMarker = parsedTrace && isMarkerEvent(parsedTrace, event);\n const color = isMarker ? TimelineUIUtils.markerStyleForEvent(event).color : defaultColorForEvent;\n\n contentHelper.addSection(TimelineUIUtils.eventTitle(event), color);\n\n // TODO: as part of the removal of the old engine, produce a typesafe way\n // to look up args and data for events.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const unsafeEventArgs = event.args as Record;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const unsafeEventData = event.args?.data as Record;\n const initiator = parsedTrace.Initiators.eventToInitiator.get(event) ?? null;\n const initiatorFor = parsedTrace.Initiators.initiatorToEvents.get(event) ?? null;\n\n let url: Platform.DevToolsPath.UrlString|null = null;\n\n if (parsedTrace) {\n const warnings = TimelineComponents.DetailsView.buildWarningElementsForEvent(event, parsedTrace);\n for (const warning of warnings) {\n contentHelper.appendElementRow(i18nString(UIStrings.warning), warning, true);\n }\n }\n\n // Add timestamp to user timings.\n if (Trace.Helpers.Trace.eventHasCategory(event, Trace.Types.Events.Categories.UserTiming)) {\n const adjustedEventTimeStamp = timeStampForEventAdjustedForClosestNavigationIfPossible(\n event,\n parsedTrace,\n );\n contentHelper.appendTextRow(\n i18nString(UIStrings.timestamp), i18n.TimeUtilities.preciseMillisToString(adjustedEventTimeStamp, 1));\n }\n\n // Only show total time and self time for events with non-zero durations.\n if (detailed && !Number.isNaN(duration || 0) && duration !== 0) {\n contentHelper.appendTextRow(\n i18nString(UIStrings.totalTime), i18n.TimeUtilities.millisToString(duration || 0, true));\n contentHelper.appendTextRow(i18nString(UIStrings.selfTime), i18n.TimeUtilities.millisToString(selfTime, true));\n }\n\n if (Trace.Types.Events.isPerformanceMark(event) && event.args.data?.detail) {\n const detailContainer = TimelineUIUtils.renderObjectJson(JSON.parse(event.args.data?.detail));\n contentHelper.appendElementRow(i18nString(UIStrings.details), detailContainer);\n }\n if (Trace.Types.Events.isSyntheticUserTiming(event) && event.args?.data?.beginEvent.args.detail) {\n const detailContainer = TimelineUIUtils.renderObjectJson(JSON.parse(event.args?.data?.beginEvent.args.detail));\n contentHelper.appendElementRow(i18nString(UIStrings.details), detailContainer);\n }\n\n if (parsedTrace.Meta.traceIsGeneric) {\n TimelineUIUtils.renderEventJson(event, contentHelper);\n return contentHelper.fragment;\n }\n\n if (Trace.Types.Events.isV8Compile(event)) {\n url = event.args.data?.url as Platform.DevToolsPath.UrlString;\n if (url) {\n const {lineNumber, columnNumber} = Trace.Helpers.Trace.getZeroIndexedLineAndColumnForEvent(event);\n contentHelper.appendLocationRow(i18nString(UIStrings.script), url, lineNumber || 0, columnNumber);\n }\n const isEager = Boolean(event.args.data?.eager);\n if (isEager) {\n contentHelper.appendTextRow(i18nString(UIStrings.eagerCompile), true);\n }\n\n const isStreamed = Boolean(event.args.data?.streamed);\n contentHelper.appendTextRow(\n i18nString(UIStrings.streamed),\n isStreamed + (isStreamed ? '' : `: ${event.args.data?.notStreamedReason || ''}`));\n if (event.args.data) {\n TimelineUIUtils.buildConsumeCacheDetails(event.args.data, contentHelper);\n }\n }\n\n if (Trace.Types.Extensions.isSyntheticExtensionEntry(event)) {\n for (const [key, value] of event.args.properties || []) {\n contentHelper.appendTextRow(key, value);\n }\n }\n\n if (Trace.Types.Events.isSyntheticServerTiming(event) && event.args.data.desc) {\n contentHelper.appendTextRow(i18nString(UIStrings.description), event.args.data.desc);\n }\n\n const isFreshRecording = Boolean(parsedTrace && Tracker.instance().recordingIsFresh(parsedTrace));\n\n switch (event.name) {\n case Trace.Types.Events.Name.GC:\n case Trace.Types.Events.Name.MAJOR_GC:\n case Trace.Types.Events.Name.MINOR_GC: {\n const delta = unsafeEventArgs['usedHeapSizeBefore'] - unsafeEventArgs['usedHeapSizeAfter'];\n contentHelper.appendTextRow(i18nString(UIStrings.collected), i18n.ByteUtilities.bytesToString(delta));\n break;\n }\n\n case Trace.Types.Events.Name.PROFILE_CALL:\n case Trace.Types.Events.Name.FUNCTION_CALL: {\n const detailsNode = await TimelineUIUtils.buildDetailsNodeForTraceEvent(\n event, targetForEvent(parsedTrace, event), linkifier, isFreshRecording, parsedTrace);\n if (detailsNode) {\n contentHelper.appendElementRow(i18nString(UIStrings.function), detailsNode);\n }\n break;\n }\n\n case Trace.Types.Events.Name.TIMER_FIRE:\n case Trace.Types.Events.Name.TIMER_INSTALL:\n case Trace.Types.Events.Name.TIMER_REMOVE: {\n contentHelper.appendTextRow(i18nString(UIStrings.timerId), unsafeEventData.timerId);\n\n if (event.name === Trace.Types.Events.Name.TIMER_INSTALL) {\n contentHelper.appendTextRow(\n i18nString(UIStrings.timeout), i18n.TimeUtilities.millisToString(unsafeEventData['timeout']));\n contentHelper.appendTextRow(i18nString(UIStrings.repeats), !unsafeEventData['singleShot']);\n }\n break;\n }\n\n case Trace.Types.Events.Name.SCHEDULE_POST_TASK_CALLBACK:\n case Trace.Types.Events.Name.RUN_POST_TASK_CALLBACK: {\n contentHelper.appendTextRow(\n i18nString(UIStrings.delay), i18n.TimeUtilities.millisToString(unsafeEventData['delay']));\n contentHelper.appendTextRow(i18nString(UIStrings.priority), unsafeEventData['priority']);\n break;\n }\n\n case Trace.Types.Events.Name.FIRE_ANIMATION_FRAME: {\n contentHelper.appendTextRow(i18nString(UIStrings.callbackId), unsafeEventData['id']);\n break;\n }\n\n case Trace.Types.Events.Name.COMPILE_MODULE: {\n contentHelper.appendLocationRow(i18nString(UIStrings.module), unsafeEventArgs['fileName'], 0);\n break;\n }\n case Trace.Types.Events.Name.COMPILE_SCRIPT: {\n // This case is handled above\n break;\n }\n\n case Trace.Types.Events.Name.CACHE_MODULE: {\n url = unsafeEventData && unsafeEventData['url'] as Platform.DevToolsPath.UrlString;\n contentHelper.appendTextRow(\n i18nString(UIStrings.compilationCacheSize),\n i18n.ByteUtilities.bytesToString(unsafeEventData['producedCacheSize']));\n break;\n }\n\n case Trace.Types.Events.Name.CACHE_SCRIPT: {\n url = unsafeEventData && unsafeEventData['url'] as Platform.DevToolsPath.UrlString;\n if (url) {\n const {lineNumber, columnNumber} = Trace.Helpers.Trace.getZeroIndexedLineAndColumnForEvent(event);\n contentHelper.appendLocationRow(i18nString(UIStrings.script), url, lineNumber || 0, columnNumber);\n }\n contentHelper.appendTextRow(\n i18nString(UIStrings.compilationCacheSize),\n i18n.ByteUtilities.bytesToString(unsafeEventData['producedCacheSize']));\n break;\n }\n\n case Trace.Types.Events.Name.EVALUATE_SCRIPT: {\n url = unsafeEventData && unsafeEventData['url'] as Platform.DevToolsPath.UrlString;\n if (url) {\n const {lineNumber, columnNumber} = Trace.Helpers.Trace.getZeroIndexedLineAndColumnForEvent(event);\n contentHelper.appendLocationRow(i18nString(UIStrings.script), url, lineNumber || 0, columnNumber);\n }\n break;\n }\n\n case Trace.Types.Events.Name.WASM_STREAM_FROM_RESPONSE_CALLBACK:\n case Trace.Types.Events.Name.WASM_COMPILED_MODULE:\n case Trace.Types.Events.Name.WASM_CACHED_MODULE:\n case Trace.Types.Events.Name.WASM_MODULE_CACHE_HIT:\n case Trace.Types.Events.Name.WASM_MODULE_CACHE_INVALID: {\n if (unsafeEventData) {\n url = unsafeEventArgs['url'] as Platform.DevToolsPath.UrlString;\n if (url) {\n contentHelper.appendTextRow(i18nString(UIStrings.url), url);\n }\n const producedCachedSize = unsafeEventArgs['producedCachedSize'];\n if (producedCachedSize) {\n contentHelper.appendTextRow(i18nString(UIStrings.producedCacheSize), producedCachedSize);\n }\n const consumedCachedSize = unsafeEventArgs['consumedCachedSize'];\n if (consumedCachedSize) {\n contentHelper.appendTextRow(i18nString(UIStrings.consumedCacheSize), consumedCachedSize);\n }\n }\n break;\n }\n\n // @ts-ignore Fall-through intended.\n case Trace.Types.Events.Name.PAINT: {\n const clip = unsafeEventData['clip'];\n contentHelper.appendTextRow(\n i18nString(UIStrings.location), i18nString(UIStrings.sSCurlyBrackets, {PH1: clip[0], PH2: clip[1]}));\n const clipWidth = TimelineUIUtils.quadWidth(clip);\n const clipHeight = TimelineUIUtils.quadHeight(clip);\n contentHelper.appendTextRow(\n i18nString(UIStrings.dimensions), i18nString(UIStrings.sSDimensions, {PH1: clipWidth, PH2: clipHeight}));\n }\n\n case Trace.Types.Events.Name.PAINT_SETUP:\n case Trace.Types.Events.Name.RASTERIZE:\n case Trace.Types.Events.Name.SCROLL_LAYER: {\n relatedNodeLabel = i18nString(UIStrings.layerRoot);\n break;\n }\n\n case Trace.Types.Events.Name.PAINT_IMAGE:\n case Trace.Types.Events.Name.DECODE_LAZY_PIXEL_REF:\n case Trace.Types.Events.Name.DECODE_IMAGE:\n case Trace.Types.Events.Name.DRAW_LAZY_PIXEL_REF: {\n relatedNodeLabel = i18nString(UIStrings.ownerElement);\n url = Trace.Handlers.Helpers.getNonResolvedURL(event, parsedTrace);\n if (url) {\n const options = {\n tabStop: true,\n showColumnNumber: false,\n inlineFrameIndex: 0,\n };\n contentHelper.appendElementRow(\n i18nString(UIStrings.imageUrl), LegacyComponents.Linkifier.Linkifier.linkifyURL(url, options));\n }\n break;\n }\n\n case Trace.Types.Events.Name.PARSE_AUTHOR_STYLE_SHEET: {\n url = unsafeEventData['styleSheetUrl'] as Platform.DevToolsPath.UrlString;\n if (url) {\n const options = {\n tabStop: true,\n showColumnNumber: false,\n inlineFrameIndex: 0,\n };\n contentHelper.appendElementRow(\n i18nString(UIStrings.stylesheetUrl), LegacyComponents.Linkifier.Linkifier.linkifyURL(url, options));\n }\n break;\n }\n\n case Trace.Types.Events.Name.UPDATE_LAYOUT_TREE: {\n contentHelper.appendTextRow(i18nString(UIStrings.elementsAffected), unsafeEventArgs['elementCount']);\n\n const selectorStatsSetting =\n Common.Settings.Settings.instance().createSetting('timeline-capture-selector-stats', false);\n if (!selectorStatsSetting.get()) {\n const note = document.createElement('span');\n note.textContent = i18nString(UIStrings.sSelectorStatsInfo, {PH1: selectorStatsSetting.title()});\n contentHelper.appendElementRow(i18nString(UIStrings.selectorStatsTitle), note);\n }\n\n break;\n }\n\n case Trace.Types.Events.Name.LAYOUT: {\n const beginData = unsafeEventArgs['beginData'];\n contentHelper.appendTextRow(\n i18nString(UIStrings.nodesThatNeedLayout),\n i18nString(UIStrings.sOfS, {PH1: beginData['dirtyObjects'], PH2: beginData['totalObjects']}));\n relatedNodeLabel = i18nString(UIStrings.layoutRoot);\n break;\n }\n\n case Trace.Types.Events.Name.CONSOLE_TIME: {\n contentHelper.appendTextRow(i18nString(UIStrings.message), event.name);\n break;\n }\n\n case Trace.Types.Events.Name.WEB_SOCKET_CREATE:\n case Trace.Types.Events.Name.WEB_SOCKET_SEND_HANDSHAKE_REQUEST:\n case Trace.Types.Events.Name.WEB_SOCKET_RECEIVE_HANDSHAKE_REQUEST:\n case Trace.Types.Events.Name.WEB_SOCKET_SEND:\n case Trace.Types.Events.Name.WEB_SOCKET_RECEIVE:\n case Trace.Types.Events.Name.WEB_SOCKET_DESTROY: {\n if (Trace.Types.Events.isWebSocketTraceEvent(event)) {\n const rows = TimelineComponents.DetailsView.buildRowsForWebSocketEvent(event, parsedTrace);\n for (const {key, value} of rows) {\n contentHelper.appendTextRow(key, value);\n }\n }\n break;\n }\n\n case Trace.Types.Events.Name.EMBEDDER_CALLBACK: {\n contentHelper.appendTextRow(i18nString(UIStrings.callbackFunction), unsafeEventData['callbackName']);\n break;\n }\n\n case Trace.Types.Events.Name.ANIMATION: {\n if (!Trace.Types.Events.isSyntheticAnimation(event)) {\n break;\n }\n const {displayName, nodeName} = event.args.data.beginEvent.args.data;\n displayName && contentHelper.appendTextRow(i18nString(UIStrings.animating), displayName);\n // If relatedNodes is empty (maybe saved trace), then print the text description of the DOM node.\n if (!relatedNodesMap?.size && nodeName) {\n contentHelper.appendTextRow(i18nString(UIStrings.relatedNode), nodeName);\n }\n\n const CLSInsight = Trace.Insights.Models.CLSCulprits;\n const failures = CLSInsight.getNonCompositedFailure(event);\n if (!failures.length) {\n break;\n }\n\n const failureReasons = new Set(failures.map(f => f.failureReasons).flat().filter(Boolean));\n const unsupportedProperties =\n new Set(failures.map(f => f.unsupportedProperties).flat().filter(Boolean)) as Set;\n\n // The failureReasons can be empty when Blink added a new failure reason that is\n // not supported by DevTools yet\n if (failureReasons.size === 0) {\n contentHelper.appendElementRow(\n i18nString(UIStrings.compositingFailed), i18nString(UIStrings.compositingFailedUnknownReason), true);\n } else {\n for (const reason of failureReasons) {\n let str;\n switch (reason) {\n case CLSInsight.AnimationFailureReasons.ACCELERATED_ANIMATIONS_DISABLED:\n str = i18nString(UIStrings.compositingFailedAcceleratedAnimationsDisabled);\n break;\n case CLSInsight.AnimationFailureReasons.EFFECT_SUPPRESSED_BY_DEVTOOLS:\n str = i18nString(UIStrings.compositingFailedEffectSuppressedByDevtools);\n break;\n case CLSInsight.AnimationFailureReasons.INVALID_ANIMATION_OR_EFFECT:\n str = i18nString(UIStrings.compositingFailedInvalidAnimationOrEffect);\n break;\n case CLSInsight.AnimationFailureReasons.EFFECT_HAS_UNSUPPORTED_TIMING_PARAMS:\n str = i18nString(UIStrings.compositingFailedEffectHasUnsupportedTimingParams);\n break;\n case CLSInsight.AnimationFailureReasons.EFFECT_HAS_NON_REPLACE_COMPOSITE_MODE:\n str = i18nString(UIStrings.compositingFailedEffectHasNonReplaceCompositeMode);\n break;\n case CLSInsight.AnimationFailureReasons.TARGET_HAS_INVALID_COMPOSITING_STATE:\n str = i18nString(UIStrings.compositingFailedTargetHasInvalidCompositingState);\n break;\n case CLSInsight.AnimationFailureReasons.TARGET_HAS_INCOMPATIBLE_ANIMATIONS:\n str = i18nString(UIStrings.compositingFailedTargetHasIncompatibleAnimations);\n break;\n case CLSInsight.AnimationFailureReasons.TARGET_HAS_CSS_OFFSET:\n str = i18nString(UIStrings.compositingFailedTargetHasCSSOffset);\n break;\n case CLSInsight.AnimationFailureReasons.ANIMATION_AFFECTS_NON_CSS_PROPERTIES:\n str = i18nString(UIStrings.compositingFailedAnimationAffectsNonCSSProperties);\n break;\n case CLSInsight.AnimationFailureReasons.TRANSFORM_RELATED_PROPERTY_CANNOT_BE_ACCELERATED_ON_TARGET:\n str = i18nString(UIStrings.compositingFailedTransformRelatedPropertyCannotBeAcceleratedOnTarget);\n break;\n case CLSInsight.AnimationFailureReasons.TRANSFROM_BOX_SIZE_DEPENDENT:\n str = i18nString(UIStrings.compositingFailedTransformDependsBoxSize);\n break;\n case CLSInsight.AnimationFailureReasons.FILTER_RELATED_PROPERTY_MAY_MOVE_PIXELS:\n str = i18nString(UIStrings.compositingFailedFilterRelatedPropertyMayMovePixels);\n break;\n case CLSInsight.AnimationFailureReasons.UNSUPPORTED_CSS_PROPERTY:\n str = i18nString(UIStrings.compositingFailedUnsupportedCSSProperty, {\n propertyCount: unsupportedProperties.size,\n properties: new Intl.ListFormat(undefined, {style: 'short', type: 'conjunction'})\n .format(unsupportedProperties),\n });\n break;\n case CLSInsight.AnimationFailureReasons.MIXED_KEYFRAME_VALUE_TYPES:\n str = i18nString(UIStrings.compositingFailedMixedKeyframeValueTypes);\n break;\n case CLSInsight.AnimationFailureReasons.TIMELINE_SOURCE_HAS_INVALID_COMPOSITING_STATE:\n str = i18nString(UIStrings.compositingFailedTimelineSourceHasInvalidCompositingState);\n break;\n case CLSInsight.AnimationFailureReasons.ANIMATION_HAS_NO_VISIBLE_CHANGE:\n str = i18nString(UIStrings.compositingFailedAnimationHasNoVisibleChange);\n break;\n case CLSInsight.AnimationFailureReasons.AFFECTS_IMPORTANT_PROPERTY:\n str = i18nString(UIStrings.compositingFailedAffectsImportantProperty);\n break;\n case CLSInsight.AnimationFailureReasons.SVG_TARGET_HAS_INDEPENDENT_TRANSFORM_PROPERTY:\n str = i18nString(UIStrings.compositingFailedSVGTargetHasIndependentTransformProperty);\n break;\n default:\n // We should never actually end up here, as adding a new AnimationFailureReason\n // should also require adding a UIString that describes it\n str = i18nString(UIStrings.compositingFailedUnknownReason);\n break;\n }\n str && contentHelper.appendElementRow(i18nString(UIStrings.compositingFailed), str, true);\n }\n }\n\n break;\n }\n\n case Trace.Types.Events.Name.PARSE_HTML: {\n const beginData = unsafeEventArgs['beginData'];\n const startLine = beginData['startLine'] - 1;\n const endLine = unsafeEventArgs['endData'] ? unsafeEventArgs['endData']['endLine'] - 1 : undefined;\n url = beginData['url'];\n if (url) {\n contentHelper.appendLocationRange(i18nString(UIStrings.range), url, startLine, endLine);\n }\n break;\n }\n\n // @ts-ignore Fall-through intended.\n case Trace.Types.Events.Name.FIRE_IDLE_CALLBACK: {\n contentHelper.appendTextRow(\n i18nString(UIStrings.allottedTime),\n i18n.TimeUtilities.millisToString(unsafeEventData['allottedMilliseconds']));\n contentHelper.appendTextRow(i18nString(UIStrings.invokedByTimeout), unsafeEventData['timedOut']);\n }\n\n case Trace.Types.Events.Name.REQUEST_IDLE_CALLBACK:\n case Trace.Types.Events.Name.CANCEL_IDLE_CALLBACK: {\n contentHelper.appendTextRow(i18nString(UIStrings.callbackId), unsafeEventData['id']);\n break;\n }\n\n case Trace.Types.Events.Name.EVENT_DISPATCH: {\n contentHelper.appendTextRow(i18nString(UIStrings.type), unsafeEventData['type']);\n break;\n }\n\n // @ts-ignore Fall-through intended.\n case Trace.Types.Events.Name.MARK_LCP_CANDIDATE: {\n contentHelper.appendTextRow(i18nString(UIStrings.type), String(unsafeEventData['type']));\n contentHelper.appendTextRow(i18nString(UIStrings.size), String(unsafeEventData['size']));\n }\n\n case Trace.Types.Events.Name.MARK_FIRST_PAINT:\n case Trace.Types.Events.Name.MARK_FCP:\n case Trace.Types.Events.Name.MARK_LOAD:\n case Trace.Types.Events.Name.MARK_DOM_CONTENT: {\n const adjustedEventTimeStamp = timeStampForEventAdjustedForClosestNavigationIfPossible(\n event,\n parsedTrace,\n );\n\n contentHelper.appendTextRow(\n i18nString(UIStrings.timestamp), i18n.TimeUtilities.preciseMillisToString(adjustedEventTimeStamp, 1));\n\n if (Trace.Types.Events.isMarkerEvent(event)) {\n contentHelper.appendElementRow(\n i18nString(UIStrings.details), TimelineUIUtils.buildDetailsNodeForMarkerEvents(event));\n }\n\n break;\n }\n\n case Trace.Types.Events.Name.EVENT_TIMING: {\n const detailsNode = await TimelineUIUtils.buildDetailsNodeForTraceEvent(\n event, targetForEvent(parsedTrace, event), linkifier, isFreshRecording, parsedTrace);\n if (detailsNode) {\n contentHelper.appendElementRow(i18nString(UIStrings.details), detailsNode);\n }\n if (Trace.Types.Events.isSyntheticInteraction(event)) {\n const inputDelay = i18n.TimeUtilities.formatMicroSecondsAsMillisFixed(event.inputDelay);\n const mainThreadTime = i18n.TimeUtilities.formatMicroSecondsAsMillisFixed(event.mainThreadHandling);\n const presentationDelay = i18n.TimeUtilities.formatMicroSecondsAsMillisFixed(event.presentationDelay);\n contentHelper.appendTextRow(i18nString(UIStrings.interactionID), event.interactionId);\n contentHelper.appendTextRow(i18nString(UIStrings.inputDelay), inputDelay);\n contentHelper.appendTextRow(i18nString(UIStrings.processingDuration), mainThreadTime);\n contentHelper.appendTextRow(i18nString(UIStrings.presentationDelay), presentationDelay);\n }\n break;\n }\n\n case Trace.Types.Events.Name.LAYOUT_SHIFT: {\n if (!Trace.Types.Events.isSyntheticLayoutShift(event)) {\n console.error('Unexpected type for LayoutShift event');\n break;\n }\n const layoutShift = event as Trace.Types.Events.SyntheticLayoutShift;\n const layoutShiftEventData = layoutShift.args.data;\n const warning = document.createElement('span');\n const clsLink = UI.XLink.XLink.create(\n 'https://web.dev/cls/', i18nString(UIStrings.cumulativeLayoutShifts), undefined, undefined,\n 'cumulative-layout-shifts');\n const evolvedClsLink = UI.XLink.XLink.create(\n 'https://web.dev/evolving-cls/', i18nString(UIStrings.evolvedClsLink), undefined, undefined, 'evolved-cls');\n\n warning.appendChild(\n i18n.i18n.getFormatLocalizedString(str_, UIStrings.sCLSInformation, {PH1: clsLink, PH2: evolvedClsLink}));\n contentHelper.appendElementRow(i18nString(UIStrings.warning), warning, true);\n if (!layoutShiftEventData) {\n break;\n }\n contentHelper.appendTextRow(\n i18nString(UIStrings.score), layoutShiftEventData.weighted_score_delta.toPrecision(4));\n contentHelper.appendTextRow(\n i18nString(UIStrings.cumulativeScore), layoutShiftEventData['cumulative_score'].toPrecision(4));\n contentHelper.appendTextRow(\n i18nString(UIStrings.currentClusterId), layoutShift.parsedData.sessionWindowData.id);\n contentHelper.appendTextRow(\n i18nString(UIStrings.currentClusterScore),\n layoutShift.parsedData.sessionWindowData.cumulativeWindowScore.toPrecision(4));\n contentHelper.appendTextRow(\n i18nString(UIStrings.hadRecentInput),\n unsafeEventData['had_recent_input'] ? i18nString(UIStrings.yes) : i18nString(UIStrings.no));\n\n for (const impactedNode of unsafeEventData['impacted_nodes']) {\n const oldRect = new CLSRect(impactedNode['old_rect']);\n const newRect = new CLSRect(impactedNode['new_rect']);\n\n const linkedOldRect = await Common.Linkifier.Linkifier.linkify(oldRect);\n const linkedNewRect = await Common.Linkifier.Linkifier.linkify(newRect);\n\n contentHelper.appendElementRow(i18nString(UIStrings.movedFrom), linkedOldRect);\n contentHelper.appendElementRow(i18nString(UIStrings.movedTo), linkedNewRect);\n }\n\n break;\n }\n\n default: {\n const detailsNode = await TimelineUIUtils.buildDetailsNodeForTraceEvent(\n event, targetForEvent(parsedTrace, event), linkifier, isFreshRecording, parsedTrace);\n if (detailsNode) {\n contentHelper.appendElementRow(i18nString(UIStrings.details), detailsNode);\n }\n break;\n }\n }\n const relatedNodes = relatedNodesMap?.values() || [];\n for (const relatedNode of relatedNodes) {\n if (relatedNode) {\n const nodeSpan = await Common.Linkifier.Linkifier.linkify(relatedNode);\n contentHelper.appendElementRow(relatedNodeLabel || i18nString(UIStrings.relatedNode), nodeSpan);\n }\n }\n\n // @ts-ignore TODO(crbug.com/1011811): Remove symbol usage.\n if (event[previewElementSymbol]) {\n contentHelper.addSection(i18nString(UIStrings.preview));\n // @ts-ignore TODO(crbug.com/1011811): Remove symbol usage.\n contentHelper.appendElementRow('', event[previewElementSymbol]);\n }\n\n const stackTrace = Trace.Helpers.Trace.getZeroIndexedStackTraceForEvent(event);\n if (Trace.Types.Events.isProfileCall(event) || initiator || initiatorFor || stackTrace ||\n parsedTrace?.Invalidations.invalidationsForEvent.get(event)) {\n await TimelineUIUtils.generateCauses(event, contentHelper, parsedTrace);\n }\n\n if (Root.Runtime.experiments.isEnabled(Root.Runtime.ExperimentName.TIMELINE_DEBUG_MODE)) {\n TimelineUIUtils.renderEventJson(event, contentHelper);\n }\n\n const stats: {\n [x: string]: number,\n } = {};\n const showPieChart =\n detailed && parsedTrace && TimelineUIUtils.aggregatedStatsForTraceEvent(stats, parsedTrace, event);\n if (showPieChart) {\n contentHelper.addSection(i18nString(UIStrings.aggregatedTime));\n const pieChart = TimelineUIUtils.generatePieChart(stats, TimelineUIUtils.eventStyle(event).category, selfTime);\n contentHelper.appendElementRow('', pieChart);\n }\n\n return contentHelper.fragment;\n }\n\n static statsForTimeRange(\n events: Trace.Types.Events.Event[], startTime: Trace.Types.Timing.MilliSeconds,\n endTime: Trace.Types.Timing.MilliSeconds): {\n [x: string]: number,\n } {\n if (!events.length) {\n return {idle: endTime - startTime};\n }\n\n buildRangeStatsCacheIfNeeded(events);\n const aggregatedStats = subtractStats(aggregatedStatsAtTime(endTime), aggregatedStatsAtTime(startTime));\n const aggregatedTotal = Object.values(aggregatedStats).reduce((a, b) => a + b, 0);\n aggregatedStats['idle'] = Math.max(0, endTime - startTime - aggregatedTotal);\n return aggregatedStats;\n\n function aggregatedStatsAtTime(time: number): {\n [x: string]: number,\n } {\n const stats: {\n [x: string]: number,\n } = {};\n // @ts-ignore TODO(crbug.com/1011811): Remove symbol usage.\n const cache = events[categoryBreakdownCacheSymbol];\n for (const category in cache) {\n const categoryCache = cache[category];\n const index =\n Platform.ArrayUtilities.upperBound(categoryCache.time, time, Platform.ArrayUtilities.DEFAULT_COMPARATOR);\n let value;\n if (index === 0) {\n value = 0;\n } else if (index === categoryCache.time.length) {\n value = categoryCache.value[categoryCache.value.length - 1];\n } else {\n const t0 = categoryCache.time[index - 1];\n const t1 = categoryCache.time[index];\n const v0 = categoryCache.value[index - 1];\n const v1 = categoryCache.value[index];\n value = v0 + (v1 - v0) * (time - t0) / (t1 - t0);\n }\n stats[category] = value;\n }\n return stats;\n }\n\n function subtractStats(\n a: {\n [x: string]: number,\n },\n b: {\n [x: string]: number,\n }): {\n [x: string]: number,\n } {\n const result = Object.assign({}, a);\n for (const key in b) {\n result[key] -= b[key];\n }\n return result;\n }\n\n function buildRangeStatsCacheIfNeeded(events: Trace.Types.Events.Event[]): void {\n // @ts-ignore TODO(crbug.com/1011811): Remove symbol usage.\n if (events[categoryBreakdownCacheSymbol]) {\n return;\n }\n\n // aggeregatedStats is a map by categories. For each category there's an array\n // containing sorted time points which records accumulated value of the category.\n const aggregatedStats: {\n [x: string]: {\n time: number[],\n value: number[],\n },\n } = {};\n const categoryStack: string[] = [];\n let lastTime = 0;\n Trace.Helpers.Trace.forEachEvent(events, {\n onStartEvent,\n onEndEvent,\n });\n\n function updateCategory(category: string, time: number): void {\n let statsArrays: {\n time: number[],\n value: number[],\n } = aggregatedStats[category];\n if (!statsArrays) {\n statsArrays = {time: [], value: []};\n aggregatedStats[category] = statsArrays;\n }\n if (statsArrays.time.length && statsArrays.time[statsArrays.time.length - 1] === time || lastTime > time) {\n return;\n }\n const lastValue = statsArrays.value.length > 0 ? statsArrays.value[statsArrays.value.length - 1] : 0;\n statsArrays.value.push(lastValue + time - lastTime);\n statsArrays.time.push(time);\n }\n\n function categoryChange(from: string|null, to: string|null, time: number): void {\n if (from) {\n updateCategory(from, time);\n }\n lastTime = time;\n if (to) {\n updateCategory(to, time);\n }\n }\n\n function onStartEvent(e: Trace.Types.Events.Event): void {\n const {startTime} = Trace.Helpers.Timing.eventTimingsMilliSeconds(e);\n const category = Utils.EntryStyles.getEventStyle(e.name as Trace.Types.Events.Name)?.category.name ||\n Utils.EntryStyles.getCategoryStyles().other.name;\n const parentCategory = categoryStack.length ? categoryStack[categoryStack.length - 1] : null;\n if (category !== parentCategory) {\n categoryChange(parentCategory || null, category, startTime);\n }\n categoryStack.push(category);\n }\n\n function onEndEvent(e: Trace.Types.Events.Event): void {\n const {endTime} = Trace.Helpers.Timing.eventTimingsMilliSeconds(e);\n const category = categoryStack.pop();\n const parentCategory = categoryStack.length ? categoryStack[categoryStack.length - 1] : null;\n if (category !== parentCategory) {\n categoryChange(category || null, parentCategory || null, endTime || 0);\n }\n }\n\n const obj = (events as Object);\n // @ts-ignore TODO(crbug.com/1011811): Remove symbol usage.\n obj[categoryBreakdownCacheSymbol] = aggregatedStats;\n }\n }\n\n private static renderEventJson(event: Trace.Types.Events.Event, contentHelper: TimelineDetailsContentHelper): void {\n contentHelper.addSection(i18nString(UIStrings.traceEvent));\n\n const eventWithArgsFirst = {\n ...{args: event.args},\n ...event,\n };\n const highlightContainer = TimelineUIUtils.renderObjectJson(eventWithArgsFirst);\n contentHelper.appendElementRow('', highlightContainer);\n }\n\n private static renderObjectJson(obj: Object): HTMLDivElement {\n const indentLength = Common.Settings.Settings.instance().moduleSetting('text-editor-indent').get().length;\n // Elide if the data is huge. Then remove the initial new-line for a denser UI\n const eventStr = JSON.stringify(obj, null, indentLength).slice(0, 10_000).replace(/{\\n /, '{ ');\n\n // Use CodeHighlighter for syntax highlighting.\n const highlightContainer = document.createElement('div');\n const shadowRoot =\n UI.UIUtils.createShadowRootWithCoreStyles(highlightContainer, {cssFile: [codeHighlighterStyles]});\n const elem = shadowRoot.createChild('div');\n elem.classList.add('monospace', 'source-code');\n elem.textContent = eventStr;\n void CodeHighlighter.CodeHighlighter.highlightNode(elem, 'text/javascript');\n return highlightContainer;\n }\n\n static stackTraceFromCallFrames(callFrames: Protocol.Runtime.CallFrame[]|\n Trace.Types.Events.CallFrame[]): Protocol.Runtime.StackTrace {\n return {callFrames} as Protocol.Runtime.StackTrace;\n }\n\n static async generateCauses(\n event: Trace.Types.Events.Event, contentHelper: TimelineDetailsContentHelper,\n parsedTrace: Trace.Handlers.Types.ParsedTrace): Promise {\n const {startTime} = Trace.Helpers.Timing.eventTimingsMilliSeconds(event);\n let initiatorStackLabel = i18nString(UIStrings.initiatorStackTrace);\n let stackLabel = i18nString(UIStrings.stackTrace);\n const stackTraceForEvent = Trace.Extras.StackTraceForEvent.get(event, parsedTrace);\n if (stackTraceForEvent) {\n contentHelper.addSection(i18nString(UIStrings.stackTrace));\n contentHelper.createChildStackTraceElement(stackTraceForEvent);\n // TODO(andoli): also build stack trace component for other events\n // that have a stack trace using the StackTraceForEvent helper.\n } else {\n const stackTrace = Trace.Helpers.Trace.getZeroIndexedStackTraceForEvent(event);\n if (stackTrace && stackTrace.length) {\n contentHelper.addSection(stackLabel);\n contentHelper.createChildStackTraceElement(TimelineUIUtils.stackTraceFromCallFrames(stackTrace));\n }\n }\n switch (event.name) {\n case Trace.Types.Events.Name.TIMER_FIRE:\n initiatorStackLabel = i18nString(UIStrings.timerInstalled);\n break;\n case Trace.Types.Events.Name.FIRE_ANIMATION_FRAME:\n initiatorStackLabel = i18nString(UIStrings.animationFrameRequested);\n break;\n case Trace.Types.Events.Name.FIRE_IDLE_CALLBACK:\n initiatorStackLabel = i18nString(UIStrings.idleCallbackRequested);\n break;\n case Trace.Types.Events.Name.UPDATE_LAYOUT_TREE:\n initiatorStackLabel = i18nString(UIStrings.firstInvalidated);\n stackLabel = i18nString(UIStrings.recalculationForced);\n break;\n case Trace.Types.Events.Name.LAYOUT:\n initiatorStackLabel = i18nString(UIStrings.firstLayoutInvalidation);\n stackLabel = i18nString(UIStrings.layoutForced);\n break;\n }\n\n const initiator = parsedTrace.Initiators.eventToInitiator.get(event);\n const initiatorFor = parsedTrace.Initiators.initiatorToEvents.get(event);\n const invalidations = parsedTrace.Invalidations.invalidationsForEvent.get(event);\n\n if (initiator) {\n // If we have an initiator for the event, we can show its stack trace, a link to reveal the initiator,\n // and the time since the initiator (Pending For).\n const stackTrace = Trace.Helpers.Trace.getZeroIndexedStackTraceForEvent(initiator);\n if (stackTrace) {\n contentHelper.addSection(initiatorStackLabel);\n contentHelper.createChildStackTraceElement(TimelineUIUtils.stackTraceFromCallFrames(stackTrace.map(frame => {\n return {\n ...frame,\n scriptId: String(frame.scriptId) as Protocol.Runtime.ScriptId,\n };\n })));\n }\n\n const link = this.createEntryLink(initiator);\n contentHelper.appendElementRow(i18nString(UIStrings.initiatedBy), link);\n\n const {startTime: initiatorStartTime} = Trace.Helpers.Timing.eventTimingsMilliSeconds(initiator);\n const delay = startTime - initiatorStartTime;\n contentHelper.appendTextRow(i18nString(UIStrings.pendingFor), i18n.TimeUtilities.preciseMillisToString(delay, 1));\n }\n\n if (initiatorFor) {\n // If the event is an initiator for some entries, add links to reveal them.\n const links = document.createElement('div');\n initiatorFor.map((initiator, i) => {\n links.appendChild(this.createEntryLink(initiator));\n // Add space between each link if it's not last\n if (i < initiatorFor.length - 1) {\n links.append(' ');\n }\n });\n contentHelper.appendElementRow(UIStrings.initiatorFor, links);\n }\n\n if (invalidations && invalidations.length) {\n const totalInvalidations = parsedTrace.Invalidations.invalidationCountForEvent.get(event) ??\n 0; // Won't be 0, but saves us dealing with undefined.\n contentHelper.addSection(i18nString(UIStrings.invalidations, {PH1: totalInvalidations}));\n await TimelineUIUtils.generateInvalidationsList(invalidations, contentHelper);\n }\n }\n\n private static createEntryLink(entry: Trace.Types.Events.Event): HTMLElement {\n const link = document.createElement('span');\n\n const traceBoundsState = TraceBounds.TraceBounds.BoundsManager.instance().state();\n\n if (!traceBoundsState) {\n console.error('Tried to link to an entry without any traceBoundsState. This should never happen.');\n return link;\n }\n\n // Check is the entry is outside of the current breadcrumb. If it is, don't create a link to navigate to it because there is no way to navigate outside breadcrumb without removing it. Instead, just display the name and \"outside breadcrumb\" text\n // Consider entry outside breadcrumb only if it is fully outside. If a part of it is visible, we can still select it.\n const isEntryOutsideBreadcrumb = traceBoundsState.micro.minimapTraceBounds.min > entry.ts + (entry.dur || 0) ||\n traceBoundsState.micro.minimapTraceBounds.max < entry.ts;\n\n // Check if it is in the hidden array\n const isEntryHidden = ModificationsManager.activeManager()?.getEntriesFilter().entryIsInvisible(entry);\n\n if (!isEntryOutsideBreadcrumb) {\n link.classList.add('timeline-link');\n UI.ARIAUtils.markAsLink(link);\n link.tabIndex = 0;\n link.addEventListener('click', () => {\n TimelinePanel.instance().select(selectionFromEvent(entry));\n });\n\n link.addEventListener('keydown', event => {\n if (event.key === Platform.KeyboardUtilities.ENTER_KEY) {\n TimelinePanel.instance().select(selectionFromEvent(entry));\n event.consume(true);\n }\n });\n }\n\n if (isEntryHidden) {\n link.textContent = this.eventTitle(entry) + ' ' + i18nString(UIStrings.entryIsHidden);\n } else if (isEntryOutsideBreadcrumb) {\n link.textContent = this.eventTitle(entry) + ' ' + i18nString(UIStrings.outsideBreadcrumbRange);\n } else {\n link.textContent = this.eventTitle(entry);\n }\n\n return link;\n }\n\n private static async generateInvalidationsList(\n invalidations: Trace.Types.Events.InvalidationTrackingEvent[],\n contentHelper: TimelineDetailsContentHelper): Promise {\n const {groupedByReason, backendNodeIds} = TimelineComponents.DetailsView.generateInvalidationsList(invalidations);\n\n let relatedNodesMap: Map|null = null;\n const target = SDK.TargetManager.TargetManager.instance().primaryPageTarget();\n const domModel = target?.model(SDK.DOMModel.DOMModel);\n if (domModel) {\n relatedNodesMap = await domModel.pushNodesByBackendIdsToFrontend(backendNodeIds);\n }\n\n Object.keys(groupedByReason).forEach(reason => {\n TimelineUIUtils.generateInvalidationsForReason(reason, groupedByReason[reason], relatedNodesMap, contentHelper);\n });\n }\n\n private static generateInvalidationsForReason(\n reason: string, invalidations: Trace.Types.Events.InvalidationTrackingEvent[],\n relatedNodesMap: Map|null, contentHelper: TimelineDetailsContentHelper): void {\n function createLinkForInvalidationNode(invalidation: Trace.Types.Events.InvalidationTrackingEvent):\n HTMLSpanElement {\n const node = (invalidation.args.data.nodeId && relatedNodesMap) ?\n relatedNodesMap.get(invalidation.args.data.nodeId) :\n null;\n if (node) {\n const nodeSpan = document.createElement('span');\n void Common.Linkifier.Linkifier.linkify(node).then(link => nodeSpan.appendChild(link));\n return nodeSpan;\n }\n if (invalidation.args.data.nodeName) {\n const nodeSpan = document.createElement('span');\n nodeSpan.textContent = invalidation.args.data.nodeName;\n return nodeSpan;\n }\n const nodeSpan = document.createElement('span');\n UI.UIUtils.createTextChild(nodeSpan, i18nString(UIStrings.UnknownNode));\n return nodeSpan;\n }\n\n const generatedItems = new Set();\n\n for (const invalidation of invalidations) {\n const stackTrace = Trace.Helpers.Trace.getZeroIndexedStackTraceForEvent(invalidation);\n let scriptLink: HTMLElement|null = null;\n const callFrame = stackTrace?.at(0);\n if (callFrame) {\n scriptLink = contentHelper.linkifier()?.maybeLinkifyScriptLocation(\n SDK.TargetManager.TargetManager.instance().rootTarget(),\n callFrame.scriptId as Protocol.Runtime.ScriptId,\n callFrame.url as Platform.DevToolsPath.UrlString,\n callFrame.lineNumber,\n ) ||\n null;\n }\n\n const niceNodeLink = createLinkForInvalidationNode(invalidation);\n\n const text = scriptLink ?\n i18n.i18n.getFormatLocalizedString(\n str_, UIStrings.invalidationWithCallFrame, {PH1: niceNodeLink, PH2: scriptLink}) as HTMLElement :\n niceNodeLink;\n\n // Sometimes we can get different Invalidation events which cause\n // the same text for the same element for the same reason to be\n // generated. Rather than show the user duplicates, if we have\n // generated text that looks identical to this before, we will\n // bail.\n const generatedText: string = (typeof text === 'string' ? text : text.innerText);\n if (generatedItems.has(generatedText)) {\n continue;\n }\n\n generatedItems.add(generatedText);\n contentHelper.appendElementRow(reason, text);\n }\n }\n\n private static aggregatedStatsForTraceEvent(\n total: {\n [x: string]: number,\n },\n parsedTrace: Trace.Handlers.Types.ParsedTrace, event: Trace.Types.Events.Event): boolean {\n const events = parsedTrace.Renderer?.allTraceEntries || [];\n const {startTime, endTime} = Trace.Helpers.Timing.eventTimingsMilliSeconds(event);\n function eventComparator(startTime: number, e: Trace.Types.Events.Event): number {\n const {startTime: eventStartTime} = Trace.Helpers.Timing.eventTimingsMilliSeconds(e);\n return startTime - eventStartTime;\n }\n\n const index = Platform.ArrayUtilities.binaryIndexOf(events, startTime, eventComparator);\n // Not a main thread event?\n if (index < 0) {\n return false;\n }\n let hasChildren = false;\n if (endTime) {\n for (let i = index; i < events.length; i++) {\n const nextEvent = events[i];\n const {startTime: nextEventStartTime} = Trace.Helpers.Timing.eventTimingsMilliSeconds(nextEvent);\n if (nextEventStartTime >= endTime) {\n break;\n }\n const nextEventSelfTime = getEventSelfTime(nextEvent, parsedTrace);\n if (!nextEventSelfTime) {\n continue;\n }\n if (nextEvent.tid !== event.tid) {\n continue;\n }\n if (i > index) {\n hasChildren = true;\n }\n const categoryName = TimelineUIUtils.eventStyle(nextEvent).category.name;\n total[categoryName] = (total[categoryName] || 0) + nextEventSelfTime;\n }\n }\n if (Trace.Types.Events.isPhaseAsync(event.ph)) {\n if (endTime) {\n let aggregatedTotal = 0;\n for (const categoryName in total) {\n aggregatedTotal += total[categoryName];\n }\n total['idle'] = Math.max(0, endTime - startTime - aggregatedTotal);\n }\n return false;\n }\n return hasChildren;\n }\n\n static async buildPicturePreviewContent(\n parsedTrace: Trace.Handlers.Types.ParsedTrace, event: Trace.Types.Events.Paint,\n target: SDK.Target.Target): Promise {\n const snapshotEvent = parsedTrace.LayerTree.paintsToSnapshots.get(event);\n if (!snapshotEvent) {\n return null;\n }\n\n const paintProfilerModel = target.model(SDK.PaintProfiler.PaintProfilerModel);\n if (!paintProfilerModel) {\n return null;\n }\n const snapshot = await paintProfilerModel.loadSnapshot(snapshotEvent.args.snapshot.skp64);\n if (!snapshot) {\n return null;\n }\n\n const snapshotWithRect = {\n snapshot,\n rect: snapshotEvent.args.snapshot.params?.layer_rect,\n };\n\n if (!snapshotWithRect) {\n return null;\n }\n const imageURLPromise = snapshotWithRect.snapshot.replay();\n snapshotWithRect.snapshot.release();\n const imageURL = await imageURLPromise as Platform.DevToolsPath.UrlString;\n if (!imageURL) {\n return null;\n }\n const stylesContainer = document.createElement('div');\n const shadowRoot = stylesContainer.attachShadow({mode: 'open'});\n shadowRoot.adoptedStyleSheets = [imagePreviewStyles];\n const container = shadowRoot.createChild('div') as HTMLDivElement;\n container.classList.add('image-preview-container', 'vbox', 'link');\n const img = (container.createChild('img') as HTMLImageElement);\n img.src = imageURL;\n img.alt = LegacyComponents.ImagePreview.ImagePreview.defaultAltTextForImageURL(imageURL);\n const paintProfilerButton = container.createChild('a');\n paintProfilerButton.textContent = i18nString(UIStrings.paintProfiler);\n UI.ARIAUtils.markAsLink(container);\n container.tabIndex = 0;\n container.addEventListener('click', () => TimelinePanel.instance().select(selectionFromEvent(event)), false);\n container.addEventListener('keydown', keyEvent => {\n if (keyEvent.key === Platform.KeyboardUtilities.ENTER_KEY) {\n TimelinePanel.instance().select(selectionFromEvent(event));\n keyEvent.consume(true);\n }\n });\n return stylesContainer;\n }\n\n static createEventDivider(event: Trace.Types.Events.Event, zeroTime: number): HTMLDivElement {\n const eventDivider = document.createElement('div');\n eventDivider.classList.add('resources-event-divider');\n const {startTime: eventStartTime} = Trace.Helpers.Timing.eventTimingsMilliSeconds(event);\n\n const startTime = i18n.TimeUtilities.millisToString(eventStartTime - zeroTime);\n UI.Tooltip.Tooltip.install(\n eventDivider, i18nString(UIStrings.sAtS, {PH1: TimelineUIUtils.eventTitle(event), PH2: startTime}));\n const style = TimelineUIUtils.markerStyleForEvent(event);\n if (style.tall) {\n eventDivider.style.backgroundColor = style.color;\n }\n return eventDivider;\n }\n\n static visibleEventsFilter(): Trace.Extras.TraceFilter.TraceFilter {\n return new Trace.Extras.TraceFilter.VisibleEventsFilter(Utils.EntryStyles.visibleTypes());\n }\n\n // Included only for layout tests.\n // TODO(crbug.com/1386091): Fix/port layout tests and remove.\n static categories(): Utils.EntryStyles.CategoryPalette {\n return Utils.EntryStyles.getCategoryStyles();\n }\n\n static generatePieChart(\n aggregatedStats: {\n [x: string]: number,\n },\n selfCategory?: Utils.EntryStyles.TimelineCategory, selfTime?: number): Element {\n let total = 0;\n for (const categoryName in aggregatedStats) {\n total += aggregatedStats[categoryName];\n }\n\n const element = document.createElement('div');\n element.classList.add('timeline-details-view-pie-chart-wrapper');\n element.classList.add('hbox');\n\n const pieChart = new PerfUI.PieChart.PieChart();\n const slices: {\n value: number,\n color: string,\n title: string,\n }[] = [];\n\n function appendLegendRow(name: string, title: string, value: number, color: string): void {\n if (!value) {\n return;\n }\n slices.push({value, color, title});\n }\n\n // In case of self time, first add self, then children of the same category.\n if (selfCategory) {\n if (selfTime) {\n appendLegendRow(\n selfCategory.name, i18nString(UIStrings.sSelf, {PH1: selfCategory.title}), selfTime,\n selfCategory.getCSSValue());\n }\n // Children of the same category.\n const categoryTime = aggregatedStats[selfCategory.name];\n const value = categoryTime - (selfTime || 0);\n if (value > 0) {\n appendLegendRow(\n selfCategory.name, i18nString(UIStrings.sChildren, {PH1: selfCategory.title}), value,\n selfCategory.getCSSValue());\n }\n }\n\n // Add other categories.\n for (const categoryName in Utils.EntryStyles.getCategoryStyles()) {\n const category = Utils.EntryStyles.getCategoryStyles()[categoryName as keyof Utils.EntryStyles.CategoryPalette];\n if (categoryName === selfCategory?.name) {\n // Do not add an entry for this event's self category because 2\n // entries for it where added just before this for loop (for\n // self and children times).\n continue;\n }\n appendLegendRow(category.name, category.title, aggregatedStats[category.name], category.getCSSValue());\n }\n\n pieChart.data = {\n chartName: i18nString(UIStrings.timeSpentInRendering),\n size: 110,\n formatter: (value: number) => i18n.TimeUtilities.preciseMillisToString(value),\n showLegend: true,\n total,\n slices,\n };\n const pieChartContainer = element.createChild('div', 'vbox');\n pieChartContainer.appendChild(pieChart);\n\n return element;\n }\n // Generates a Summary component given a aggregated stats for categories.\n static generateSummaryDetails(aggregatedStats: Record, rangeStart: number, rangeEnd: number):\n Element {\n let total = 0;\n // Calculate total of all categories.\n for (const categoryName in aggregatedStats) {\n total += aggregatedStats[categoryName];\n }\n\n const element = document.createElement('div');\n element.classList.add('timeline-details-view-summary');\n\n const summaryTable = new TimelineComponents.TimelineSummary.TimelineSummary();\n let categories: TimelineComponents.TimelineSummary.CategoryData[] = [];\n\n // Get stats values from categories.\n for (const categoryName in Utils.EntryStyles.getCategoryStyles()) {\n const category = Utils.EntryStyles.getCategoryStyles()[categoryName as keyof Utils.EntryStyles.CategoryPalette];\n if (category.name === Utils.EntryStyles.EventCategory.IDLE) {\n continue;\n }\n const value = aggregatedStats[category.name];\n if (!value) {\n continue;\n }\n const title = category.title;\n const color = category.getCSSValue();\n categories.push({value, color, title});\n }\n\n // Keeps the most useful categories on top.\n categories = categories.sort((a, b) => b.value - a.value);\n const start = Trace.Types.Timing.MilliSeconds(rangeStart);\n const end = Trace.Types.Timing.MilliSeconds(rangeEnd);\n summaryTable.data = {\n rangeStart: start,\n rangeEnd: end,\n total,\n categories,\n };\n const summaryTableContainer = element.createChild('div');\n summaryTableContainer.appendChild(summaryTable);\n return element;\n }\n\n static generateDetailsContentForFrame(\n frame: Trace.Types.Events.LegacyTimelineFrame, filmStrip: Trace.Extras.FilmStrip.Data|null,\n filmStripFrame: Trace.Extras.FilmStrip.Frame|null): DocumentFragment {\n const contentHelper = new TimelineDetailsContentHelper(null, null);\n contentHelper.addSection(i18nString(UIStrings.frame));\n\n const duration = TimelineUIUtils.frameDuration(frame);\n contentHelper.appendElementRow(i18nString(UIStrings.duration), duration);\n if (filmStrip && filmStripFrame) {\n const filmStripPreview = document.createElement('div');\n filmStripPreview.classList.add('timeline-filmstrip-preview');\n // TODO(paulirish): Adopt Util.ImageCache\n void UI.UIUtils.loadImage(filmStripFrame.screenshotEvent.args.dataUri)\n .then(image => image && filmStripPreview.appendChild(image));\n contentHelper.appendElementRow('', filmStripPreview);\n filmStripPreview.addEventListener('click', frameClicked.bind(null, filmStrip, filmStripFrame), false);\n }\n\n function frameClicked(filmStrip: Trace.Extras.FilmStrip.Data, filmStripFrame: Trace.Extras.FilmStrip.Frame): void {\n PerfUI.FilmStripView.Dialog.fromFilmStrip(filmStrip, filmStripFrame.index);\n }\n\n return contentHelper.fragment;\n }\n\n static frameDuration(frame: Trace.Types.Events.LegacyTimelineFrame): Element {\n const offsetMilli = Trace.Helpers.Timing.microSecondsToMilliseconds(frame.startTimeOffset);\n const durationMilli = Trace.Helpers.Timing.microSecondsToMilliseconds(\n Trace.Types.Timing.MicroSeconds(frame.endTime - frame.startTime));\n\n const durationText = i18nString(UIStrings.sAtSParentheses, {\n PH1: i18n.TimeUtilities.millisToString(durationMilli, true),\n PH2: i18n.TimeUtilities.millisToString(offsetMilli, true),\n });\n return i18n.i18n.getFormatLocalizedString(str_, UIStrings.emptyPlaceholder, {PH1: durationText});\n }\n\n static quadWidth(quad: number[]): number {\n return Math.round(Math.sqrt(Math.pow(quad[0] - quad[2], 2) + Math.pow(quad[1] - quad[3], 2)));\n }\n\n static quadHeight(quad: number[]): number {\n return Math.round(Math.sqrt(Math.pow(quad[0] - quad[6], 2) + Math.pow(quad[1] - quad[7], 2)));\n }\n\n static eventDispatchDesciptors(): EventDispatchTypeDescriptor[] {\n if (eventDispatchDesciptors) {\n return eventDispatchDesciptors;\n }\n const lightOrange = 'hsl(40,100%,80%)';\n const orange = 'hsl(40,100%,50%)';\n const green = 'hsl(90,100%,40%)';\n const purple = 'hsl(256,100%,75%)';\n eventDispatchDesciptors = [\n new EventDispatchTypeDescriptor(\n 1, lightOrange, ['mousemove', 'mouseenter', 'mouseleave', 'mouseout', 'mouseover']),\n new EventDispatchTypeDescriptor(\n 1, lightOrange, ['pointerover', 'pointerout', 'pointerenter', 'pointerleave', 'pointermove']),\n new EventDispatchTypeDescriptor(2, green, ['wheel']),\n new EventDispatchTypeDescriptor(3, orange, ['click', 'mousedown', 'mouseup']),\n new EventDispatchTypeDescriptor(3, orange, ['touchstart', 'touchend', 'touchmove', 'touchcancel']),\n new EventDispatchTypeDescriptor(\n 3, orange, ['pointerdown', 'pointerup', 'pointercancel', 'gotpointercapture', 'lostpointercapture']),\n new EventDispatchTypeDescriptor(3, purple, ['keydown', 'keyup', 'keypress']),\n ];\n return eventDispatchDesciptors;\n }\n\n static markerStyleForEvent(event: Trace.Types.Events.Event): TimelineMarkerStyle {\n // Note: keep the colors matching that of `markerDetailsForEvent`.\n\n const tallMarkerDashStyle = [6, 4];\n const title = TimelineUIUtils.eventTitle(event);\n\n if (event.name !== Trace.Types.Events.Name.NAVIGATION_START &&\n (Trace.Helpers.Trace.eventHasCategory(event, Trace.Types.Events.Categories.Console) ||\n Trace.Helpers.Trace.eventHasCategory(event, Trace.Types.Events.Categories.UserTiming))) {\n return {\n title,\n dashStyle: tallMarkerDashStyle,\n lineWidth: 0.5,\n color: Trace.Helpers.Trace.eventHasCategory(event, Trace.Types.Events.Categories.Console) ? 'purple' : 'orange',\n tall: false,\n lowPriority: false,\n };\n }\n let tall = false;\n let color = 'grey';\n switch (event.name) {\n case Trace.Types.Events.Name.NAVIGATION_START:\n color = 'var(--color-text-primary)';\n tall = true;\n break;\n case Trace.Types.Events.Name.FRAME_STARTED_LOADING:\n color = 'green';\n tall = true;\n break;\n case Trace.Types.Events.Name.MARK_DOM_CONTENT:\n color = 'var(--color-text-disabled)';\n tall = true;\n break;\n case Trace.Types.Events.Name.MARK_LOAD:\n color = 'var(--color-text-disabled)';\n tall = true;\n break;\n case Trace.Types.Events.Name.MARK_FIRST_PAINT:\n color = '#228847';\n tall = true;\n break;\n case Trace.Types.Events.Name.MARK_FCP:\n color = 'var(--sys-color-green-bright)';\n tall = true;\n break;\n case Trace.Types.Events.Name.MARK_LCP_CANDIDATE:\n color = 'var(--sys-color-green)';\n tall = true;\n break;\n case Trace.Types.Events.Name.TIME_STAMP:\n color = 'orange';\n break;\n }\n return {\n title,\n dashStyle: tallMarkerDashStyle,\n lineWidth: 0.5,\n color,\n tall,\n lowPriority: false,\n };\n }\n\n static colorForId(id: string): string {\n if (!colorGenerator) {\n colorGenerator =\n new Common.Color.Generator({min: 30, max: 330, count: undefined}, {min: 50, max: 80, count: 3}, 85);\n colorGenerator.setColorForID('', '#f2ecdc');\n }\n return colorGenerator.colorForID(id);\n }\n\n static displayNameForFrame(frame: Trace.Types.Events.TraceFrame, trimAt: number = 80): string {\n const url = frame.url as Platform.DevToolsPath.UrlString;\n return Common.ParsedURL.schemeIs(url, 'about:') ? `\"${Platform.StringUtilities.trimMiddle(frame.name, trimAt)}\"` :\n frame.url.slice(0, trimAt);\n }\n}\n\nexport const aggregatedStatsKey = Symbol('aggregatedStats');\n\nexport const previewElementSymbol = Symbol('previewElement');\n\nexport class EventDispatchTypeDescriptor {\n priority: number;\n color: string;\n eventTypes: string[];\n\n constructor(priority: number, color: string, eventTypes: string[]) {\n this.priority = priority;\n this.color = color;\n this.eventTypes = eventTypes;\n }\n}\n\nexport class TimelineDetailsContentHelper {\n fragment: DocumentFragment;\n private linkifierInternal: LegacyComponents.Linkifier.Linkifier|null;\n private target: SDK.Target.Target|null;\n element: HTMLDivElement;\n private tableElement: HTMLElement;\n\n constructor(target: SDK.Target.Target|null, linkifier: LegacyComponents.Linkifier.Linkifier|null) {\n this.fragment = document.createDocumentFragment();\n\n this.linkifierInternal = linkifier;\n this.target = target;\n\n this.element = document.createElement('div');\n this.element.classList.add('timeline-details-view-block');\n this.tableElement = this.element.createChild('div', 'vbox timeline-details-chip-body');\n this.fragment.appendChild(this.element);\n }\n\n addSection(title: string, swatchColor?: string): void {\n if (!this.tableElement.hasChildNodes()) {\n this.element.removeChildren();\n } else {\n this.element = document.createElement('div');\n this.element.classList.add('timeline-details-view-block');\n this.fragment.appendChild(this.element);\n }\n\n if (title) {\n const titleElement = this.element.createChild('div', 'timeline-details-chip-title');\n if (swatchColor) {\n titleElement.createChild('div').style.backgroundColor = swatchColor;\n }\n UI.UIUtils.createTextChild(titleElement, title);\n }\n\n this.tableElement = this.element.createChild('div', 'vbox timeline-details-chip-body');\n this.fragment.appendChild(this.element);\n }\n\n linkifier(): LegacyComponents.Linkifier.Linkifier|null {\n return this.linkifierInternal;\n }\n\n appendTextRow(title: string, value: string|number|boolean): void {\n const rowElement = this.tableElement.createChild('div', 'timeline-details-view-row');\n rowElement.createChild('div', 'timeline-details-view-row-title').textContent = title;\n rowElement.createChild('div', 'timeline-details-view-row-value').textContent = value.toString();\n }\n\n appendElementRow(title: string, content: string|Node, isWarning?: boolean, isStacked?: boolean): void {\n const rowElement = this.tableElement.createChild('div', 'timeline-details-view-row');\n rowElement.setAttribute('data-row-title', title);\n if (isWarning) {\n rowElement.classList.add('timeline-details-warning');\n }\n if (isStacked) {\n rowElement.classList.add('timeline-details-stack-values');\n }\n const titleElement = rowElement.createChild('div', 'timeline-details-view-row-title');\n titleElement.textContent = title;\n const valueElement = rowElement.createChild('div', 'timeline-details-view-row-value');\n if (content instanceof Node) {\n valueElement.appendChild(content);\n } else {\n UI.UIUtils.createTextChild(valueElement, content || '');\n }\n }\n\n appendLocationRow(title: string, url: string, startLine: number, startColumn?: number): void {\n if (!this.linkifierInternal) {\n return;\n }\n\n const options = {\n tabStop: true,\n columnNumber: startColumn,\n showColumnNumber: true,\n inlineFrameIndex: 0,\n };\n const link = this.linkifierInternal.maybeLinkifyScriptLocation(\n this.target, null, url as Platform.DevToolsPath.UrlString, startLine, options);\n if (!link) {\n return;\n }\n this.appendElementRow(title, link);\n }\n\n appendLocationRange(title: string, url: Platform.DevToolsPath.UrlString, startLine: number, endLine?: number): void {\n if (!this.linkifierInternal || !this.target) {\n return;\n }\n const locationContent = document.createElement('span');\n const link = this.linkifierInternal.maybeLinkifyScriptLocation(\n this.target, null, url, startLine, {tabStop: true, inlineFrameIndex: 0});\n if (!link) {\n return;\n }\n locationContent.appendChild(link);\n UI.UIUtils.createTextChild(\n locationContent, Platform.StringUtilities.sprintf(' [%s…%s]', startLine + 1, (endLine || 0) + 1 || ''));\n this.appendElementRow(title, locationContent);\n }\n\n createChildStackTraceElement(stackTrace: Protocol.Runtime.StackTrace): void {\n if (!this.linkifierInternal) {\n return;\n }\n const resolvedStackTrace: Protocol.Runtime.StackTrace = structuredClone(stackTrace);\n let currentResolvedStackTrace: Protocol.Runtime.StackTrace|undefined = resolvedStackTrace;\n while (currentResolvedStackTrace) {\n currentResolvedStackTrace.callFrames = currentResolvedStackTrace.callFrames.map(\n callFrame => ({\n ...callFrame,\n functionName:\n Utils.SourceMapsResolver.SourceMapsResolver.resolvedCodeLocationForCallFrame(callFrame)?.name ||\n callFrame.functionName,\n }));\n currentResolvedStackTrace = currentResolvedStackTrace.parent;\n }\n const stackTraceElement =\n this.tableElement.createChild('div', 'timeline-details-view-row timeline-details-stack-values');\n const callFrameContents = LegacyComponents.JSPresentationUtils.buildStackTracePreviewContents(\n this.target, this.linkifierInternal, {stackTrace: resolvedStackTrace, tabStops: true, showColumnNumber: true});\n stackTraceElement.appendChild(callFrameContents.element);\n }\n}\n\nexport const categoryBreakdownCacheSymbol = Symbol('categoryBreakdownCache');\nexport interface TimelineMarkerStyle {\n title: string;\n color: string;\n lineWidth: number;\n dashStyle: number[];\n tall: boolean;\n lowPriority: boolean;\n}\n\n/**\n * Given a particular event, this method can adjust its timestamp by\n * substracting the timestamp of the previous navigation. This helps in cases\n * where the user has navigated multiple times in the trace, so that we can show\n * the LCP (for example) relative to the last navigation.\n **/\nexport function timeStampForEventAdjustedForClosestNavigationIfPossible(\n event: Trace.Types.Events.Event,\n parsedTrace: Trace.Handlers.Types.ParsedTrace|null): Trace.Types.Timing.MilliSeconds {\n if (!parsedTrace) {\n const {startTime} = Trace.Helpers.Timing.eventTimingsMilliSeconds(event);\n return startTime;\n }\n\n const time = Trace.Helpers.Timing.timeStampForEventAdjustedByClosestNavigation(\n event,\n parsedTrace.Meta.traceBounds,\n parsedTrace.Meta.navigationsByNavigationId,\n parsedTrace.Meta.navigationsByFrameId,\n );\n return Trace.Helpers.Timing.microSecondsToMilliseconds(time);\n}\n\n/**\n * Determines if an event is potentially a marker event. A marker event here\n * is a single moment in time that we want to highlight on the timeline, such as\n * the LCP time. This method does not filter out events: for example, it treats\n * every LCP Candidate event as a potential marker event.\n **/\nexport function isMarkerEvent(parsedTrace: Trace.Handlers.Types.ParsedTrace, event: Trace.Types.Events.Event): boolean {\n const {Name} = Trace.Types.Events;\n\n if (event.name === Name.TIME_STAMP || event.name === Name.NAVIGATION_START) {\n return true;\n }\n\n if (Trace.Types.Events.isFirstContentfulPaint(event) || Trace.Types.Events.isFirstPaint(event)) {\n return event.args.frame === parsedTrace.Meta.mainFrameId;\n }\n\n if (Trace.Types.Events.isMarkDOMContent(event) || Trace.Types.Events.isMarkLoad(event) ||\n Trace.Types.Events.isLargestContentfulPaintCandidate(event)) {\n // isOutermostMainFrame was added in 2022, so we fallback to isMainFrame\n // for older traces.\n if (!event.args.data) {\n return false;\n }\n const {isOutermostMainFrame, isMainFrame} = event.args.data;\n if (typeof isOutermostMainFrame !== 'undefined') {\n // If isOutermostMainFrame is defined we want to use that and not\n // fallback to isMainFrame, even if isOutermostMainFrame is false. Hence\n // this check.\n return isOutermostMainFrame;\n }\n return Boolean(isMainFrame);\n }\n\n return false;\n}\n\nfunction getEventSelfTime(\n event: Trace.Types.Events.Event, parsedTrace: Trace.Handlers.Types.ParsedTrace): Trace.Types.Timing.MilliSeconds {\n const mapToUse = Trace.Types.Extensions.isSyntheticExtensionEntry(event) ?\n parsedTrace.ExtensionTraceData.entryToNode :\n parsedTrace.Renderer.entryToNode;\n const selfTime = mapToUse.get(event)?.selfTime;\n return selfTime ? Trace.Helpers.Timing.microSecondsToMilliseconds(selfTime) : Trace.Types.Timing.MilliSeconds(0);\n}\n"]} \ No newline at end of file +{"version":3,"file":"TimelineUIUtils.js","sourceRoot":"","sources":["../../../../../../front_end/panels/timeline/TimelineUIUtils.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAEH,OAAO,KAAK,MAAM,MAAM,6BAA6B,CAAC;A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KAAK,CAAC;QAClF,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,iCAAiC,CAAC,KAAK,CAAC,EAAE,CAAC;QAChE,wEAAwE;QACxE,oBAAoB;QACpB,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;YACrB,OAAO,KAAK,CAAC;QACf,CAAC;QACD,MAAM,EAAC,oBAAoB,EAAE,WAAW,EAAC,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC;QAC5D,IAAI,OAAO,oBAAoB,KAAK,WAAW,EAAE,CAAC;YAChD,iEAAiE;YACjE,wEAAwE;YACxE,cAAc;YACd,OAAO,oBAAoB,CAAC;QAC9B,CAAC;QACD,OAAO,OAAO,CAAC,WAAW,CAAC,CAAC;IAC9B,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC;AAED,SAAS,gBAAgB,CACrB,KAA+B,EAAE,WAA6C;IAChF,MAAM,QAAQ,GAAG,KAAK,CAAC,KAAK,CAAC,UAAU,CAAC,yBAAyB,CAAC,KAAK,CAAC,CAAC,CAAC;QACtE,WAAW,CAAC,kBAAkB,CAAC,WAAW,CAAC,CAAC;QAC5C,WAAW,CAAC,QAAQ,CAAC,WAAW,CAAC;IACrC,MAAM,QAAQ,GAAG,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,QAAQ,CAAC;IAC/C,OAAO,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,0BAA0B,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;AACnH,CAAC","sourcesContent":["// Copyright 2021 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\n/*\n * Copyright (C) 2013 Google Inc. All rights reserved.\n * Copyright (C) 2012 Intel Inc. All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are\n * met:\n *\n * * Redistributions of source code must retain the above copyright\n * notice, this list of conditions and the following disclaimer.\n * * Redistributions in binary form must reproduce the above\n * copyright notice, this list of conditions and the following disclaimer\n * in the documentation and/or other materials provided with the\n * distribution.\n * * Neither the name of Google Inc. nor the names of its\n * contributors may be used to endorse or promote products derived from\n * this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nimport * as Common from '../../core/common/common.js';\nimport * as i18n from '../../core/i18n/i18n.js';\nimport * as Platform from '../../core/platform/platform.js';\nimport * as Root from '../../core/root/root.js';\nimport * as SDK from '../../core/sdk/sdk.js';\nimport type * as Protocol from '../../generated/protocol.js';\nimport * as Bindings from '../../models/bindings/bindings.js';\nimport * as Trace from '../../models/trace/trace.js';\nimport * as TraceBounds from '../../services/trace_bounds/trace_bounds.js';\nimport * as CodeHighlighter from '../../ui/components/code_highlighter/code_highlighter.js';\n// eslint-disable-next-line rulesdir/es-modules-import\nimport codeHighlighterStyles from '../../ui/components/code_highlighter/codeHighlighter.css.js';\nimport * as PerfUI from '../../ui/legacy/components/perf_ui/perf_ui.js';\n// eslint-disable-next-line rulesdir/es-modules-import\nimport imagePreviewStyles from '../../ui/legacy/components/utils/imagePreview.css.js';\nimport * as LegacyComponents from '../../ui/legacy/components/utils/utils.js';\nimport * as UI from '../../ui/legacy/legacy.js';\n\nimport {CLSRect} from './CLSLinkifier.js';\nimport * as TimelineComponents from './components/components.js';\nimport * as Extensions from './extensions/extensions.js';\nimport {Tracker} from './FreshRecording.js';\nimport {ModificationsManager} from './ModificationsManager.js';\nimport {targetForEvent} from './TargetForEvent.js';\nimport {TimelinePanel} from './TimelinePanel.js';\nimport {selectionFromEvent} from './TimelineSelection.js';\nimport * as Utils from './utils/utils.js';\n\nconst UIStrings = {\n /**\n *@description Text that only contain a placeholder\n *@example {100ms (at 200ms)} PH1\n */\n emptyPlaceholder: '{PH1}', // eslint-disable-line rulesdir/l10n-no-locked-or-placeholder-only-phrase\n /**\n *@description Text for timestamps of items\n */\n timestamp: 'Timestamp',\n /**\n *@description Text shown next to the interaction event's ID in the detail view.\n */\n interactionID: 'ID',\n /**\n *@description Text shown next to the interaction event's input delay time in the detail view.\n */\n inputDelay: 'Input delay',\n /**\n *@description Text shown next to the interaction event's thread processing duration in the detail view.\n */\n processingDuration: 'Processing duration',\n /**\n *@description Text shown next to the interaction event's presentation delay time in the detail view.\n */\n presentationDelay: 'Presentation delay',\n /**\n *@description Text shown when the user has selected an event that represents script compiliation.\n */\n compile: 'Compile',\n /**\n *@description Text shown when the user selects an event that represents script parsing.\n */\n parse: 'Parse',\n /**\n *@description Text with two placeholders separated by a colon\n *@example {Node removed} PH1\n *@example {div#id1} PH2\n */\n sS: '{PH1}: {PH2}',\n /**\n *@description Details text used to show the amount of data collected.\n *@example {30 MB} PH1\n */\n sCollected: '{PH1} collected',\n /**\n *@description Text used to show a URL to a script and the relevant line numbers.\n *@example {https://example.com/foo.js} PH1\n *@example {2} PH2\n *@example {4} PH3\n */\n sSs: '{PH1} [{PH2}…{PH3}]',\n /**\n *@description Text used to show a URL to a script and the starting line\n * number - used when there is no end line number available.\n *@example {https://example.com/foo.js} PH1\n *@example {2} PH2\n */\n sSSquareBrackets: '{PH1} [{PH2}…]',\n /**\n *@description Text that is usually a hyperlink to more documentation\n */\n learnMore: 'Learn more',\n /**\n *@description Text referring to the status of the browser's compilation cache.\n */\n compilationCacheStatus: 'Compilation cache status',\n /**\n *@description Text referring to the size of the browser's compiliation cache.\n */\n compilationCacheSize: 'Compilation cache size',\n /**\n *@description Text in Timeline UIUtils of the Performance panel. \"Compilation\n * cache\" refers to the code cache described at\n * https://v8.dev/blog/code-caching-for-devs . This label is followed by the\n * type of code cache data used, either \"normal\" or \"full\" as described in the\n * linked article.\n */\n compilationCacheKind: 'Compilation cache kind',\n /**\n *@description Text used to inform the user that the script they are looking\n * at was loaded from the browser's cache.\n */\n scriptLoadedFromCache: 'script loaded from cache',\n /**\n *@description Text to inform the user that the script they are looking at\n * was unable to be loaded from the browser's cache.\n */\n failedToLoadScriptFromCache: 'failed to load script from cache',\n /**\n *@description Text to inform the user that the script they are looking at was not eligible to be loaded from the browser's cache.\n */\n scriptNotEligibleToBeLoadedFromCache: 'script not eligible',\n /**\n *@description Text for the total time of something\n */\n totalTime: 'Total time',\n /**\n *@description Time of a single activity, as opposed to the total time\n */\n selfTime: 'Self time',\n /**\n *@description Label in the summary view in the Performance panel for a number which indicates how much managed memory has been reclaimed by performing Garbage Collection\n */\n collected: 'Collected',\n /**\n *@description Text for a programming function\n */\n function: 'Function',\n /**\n *@description Text for referring to the ID of a timer.\n */\n timerId: 'Timer ID',\n /**\n *@description Text for referring to a timer that has timed-out and therefore is being removed.\n */\n timeout: 'Timeout',\n /**\n *@description Text used to indicate that a timer is repeating (e.g. every X seconds) rather than a one off.\n */\n repeats: 'Repeats',\n /**\n *@description Text for referring to the ID of a callback function installed by an event.\n */\n callbackId: 'Callback ID',\n /**\n *@description Text for a module, the programming concept\n */\n module: 'Module',\n /**\n *@description Label for a group of JavaScript files\n */\n script: 'Script',\n /**\n *@description Text used to tell a user that a compilation trace event was streamed.\n */\n streamed: 'Streamed',\n /**\n *@description Text to indicate if a compilation event was eager.\n */\n eagerCompile: 'Compiling all functions eagerly',\n /**\n *@description Text to refer to the URL associated with a given event.\n */\n url: 'Url',\n /**\n *@description Text to indicate to the user the size of the cache (as a filesize - e.g. 5mb).\n */\n producedCacheSize: 'Produced cache size',\n /**\n *@description Text to indicate to the user the amount of the cache (as a filesize - e.g. 5mb) that has been used.\n */\n consumedCacheSize: 'Consumed cache size',\n /**\n *@description Title for a group of cities\n */\n location: 'Location',\n /**\n *@description Text used to show a coordinate pair (e.g. (3, 2)).\n *@example {2} PH1\n *@example {2} PH2\n */\n sSCurlyBrackets: '({PH1}, {PH2})',\n /**\n *@description Text used to indicate to the user they are looking at the physical dimensions of a shape that was drawn by the browser.\n */\n dimensions: 'Dimensions',\n /**\n *@description Text used to show the user the dimensions of a shape and indicate its area (e.g. 3x2).\n *@example {2} PH1\n *@example {2} PH2\n */\n sSDimensions: '{PH1} × {PH2}',\n /**\n *@description Related node label in Timeline UIUtils of the Performance panel\n */\n layerRoot: 'Layer root',\n /**\n *@description Related node label in Timeline UIUtils of the Performance panel\n */\n ownerElement: 'Owner element',\n /**\n *@description Text used to show the user the URL of the image they are viewing.\n */\n imageUrl: 'Image URL',\n /**\n *@description Text used to show the user that the URL they are viewing is loading a CSS stylesheet.\n */\n stylesheetUrl: 'Stylesheet URL',\n /**\n *@description Text used next to a number to show the user how many elements were affected.\n */\n elementsAffected: 'Elements affected',\n /**\n *@description Text used next to a number to show the user how many nodes required the browser to update and re-layout the page.\n */\n nodesThatNeedLayout: 'Nodes that need layout',\n /**\n *@description Text used to show the amount in a subset - e.g. \"2 of 10\".\n *@example {2} PH1\n *@example {10} PH2\n */\n sOfS: '{PH1} of {PH2}',\n /**\n *@description Related node label in Timeline UIUtils of the Performance panel\n */\n layoutRoot: 'Layout root',\n /**\n *@description Text used when viewing an event that can have a custom message attached.\n */\n message: 'Message',\n /**\n *@description Text used to tell the user they are viewing an event that has a function embedded in it, which is referred to as the \"callback function\".\n */\n callbackFunction: 'Callback function',\n /**\n *@description Text used to show the relevant range of a file - e.g. \"lines 2-10\".\n */\n range: 'Range',\n /**\n *@description Text used to refer to the amount of time some event or code was given to complete within.\n */\n allottedTime: 'Allotted time',\n /**\n *@description Text used to tell a user that a particular event or function was automatically run by a timeout.\n */\n invokedByTimeout: 'Invoked by timeout',\n /**\n *@description Text that refers to some types\n */\n type: 'Type',\n /**\n *@description Text for the size of something\n */\n size: 'Size',\n /**\n *@description Text for the details of something\n */\n details: 'Details',\n /**\n *@description Title in Timeline for Cumulative Layout Shifts\n */\n cumulativeLayoutShifts: 'Cumulative Layout Shifts',\n /**\n *@description Text for the link to the evolved CLS website\n */\n evolvedClsLink: 'evolved',\n /**\n *@description Warning in Timeline that CLS can cause a poor user experience. It contains a link to inform developers about the recent changes to how CLS is measured. The new CLS metric is said to have evolved from the previous version.\n *@example {Link to web.dev/metrics} PH1\n *@example {Link to web.dev/evolving-cls which will always have the text 'evolved'} PH2\n */\n sCLSInformation: '{PH1} can result in poor user experiences. It has recently {PH2}.',\n /**\n *@description Text to indicate an item is a warning\n */\n warning: 'Warning',\n /**\n *@description Title for the Timeline CLS Score\n */\n score: 'Score',\n /**\n *@description Text in Timeline for the cumulative CLS score\n */\n cumulativeScore: 'Cumulative score',\n /**\n *@description Text in Timeline for the current CLS score\n */\n currentClusterScore: 'Current cluster score',\n /**\n *@description Text in Timeline for the current CLS cluster\n */\n currentClusterId: 'Current cluster ID',\n /**\n *@description Text in Timeline for whether input happened recently\n */\n hadRecentInput: 'Had recent input',\n /**\n *@description Text in Timeline indicating that input has happened recently\n */\n yes: 'Yes',\n /**\n *@description Text in Timeline indicating that input has not happened recently\n */\n no: 'No',\n /**\n *@description Label for Cumulative Layout records, indicating where they moved from\n */\n movedFrom: 'Moved from',\n /**\n *@description Label for Cumulative Layout records, indicating where they moved to\n */\n movedTo: 'Moved to',\n /**\n *@description Text that indicates a particular HTML element or node is related to what the user is viewing.\n */\n relatedNode: 'Related node',\n /**\n *@description Text for previewing items\n */\n preview: 'Preview',\n /**\n *@description Text used to refer to the total time summed up across multiple events.\n */\n aggregatedTime: 'Aggregated time',\n /**\n *@description Text for the duration of something\n */\n duration: 'Duration',\n /**\n *@description Text for the stack trace of the initiator of something. The Initiator is the event or factor that directly triggered or precipitated a subsequent action.\n */\n initiatorStackTrace: 'Initiator stack trace',\n /**\n *@description Text for the event initiated by another one\n */\n initiatedBy: 'Initiated by',\n /**\n *@description Text for the event that is an initiator for another one\n */\n initiatorFor: 'Initiator for',\n /**\n *@description Text for the underlying data behing a specific flamechart selection. Trace events are the browser instrumentation that are emitted as JSON objects.\n */\n traceEvent: 'Trace event',\n /**\n *@description Call site stack label in Timeline UIUtils of the Performance panel\n */\n timerInstalled: 'Timer installed',\n /**\n *@description Call site stack label in Timeline UIUtils of the Performance panel\n */\n animationFrameRequested: 'Animation frame requested',\n /**\n *@description Call site stack label in Timeline UIUtils of the Performance panel\n */\n idleCallbackRequested: 'Idle callback requested',\n /**\n *@description Stack label in Timeline UIUtils of the Performance panel\n */\n recalculationForced: 'Recalculation forced',\n /**\n *@description Call site stack label in Timeline UIUtils of the Performance panel\n */\n firstLayoutInvalidation: 'First layout invalidation',\n /**\n *@description Stack label in Timeline UIUtils of the Performance panel\n */\n layoutForced: 'Layout forced',\n /**\n *@description Label in front of CSS property (eg `opacity`) being animated or a CSS animation name (eg `layer-4-fade-in-out`)\n */\n animating: 'Animating',\n /**\n *@description Label in front of reasons why a CSS animation wasn't composited (aka hardware accelerated)\n */\n compositingFailed: 'Compositing failed',\n /** Descriptive reason for why a user-provided animation failed to be optimized by the browser due to accelerated animations being disabled. Shown in a table with a list of other potential failure reasons. */\n compositingFailedAcceleratedAnimationsDisabled: 'Accelerated animations disabled',\n /** Descriptive reason for why a user-provided animation failed to be optimized by the browser due to DevTools suppressing the effect. Shown in a table with a list of other potential failure reasons. */\n compositingFailedEffectSuppressedByDevtools: 'Effect suppressed by DevTools ',\n /** Descriptive reason for why a user-provided animation failed to be optimized by the browser due to the animation or effect being invalid. Shown in a table with a list of other potential failure reasons. */\n compositingFailedInvalidAnimationOrEffect: 'Invalid animation or effect',\n /** Descriptive reason for why a user-provided animation failed to be optimized by the browser due to an effect having unsupported timing parameters. Shown in a table with a list of other potential failure reasons. */\n compositingFailedEffectHasUnsupportedTimingParams: 'Effect has unsupported timing parameters',\n /** Descriptive reason for why a user-provided animation failed to be optimized by the browser due to an effect having a composite mode which is not `replace`. Shown in a table with a list of other potential failure reasons. */\n compositingFailedEffectHasNonReplaceCompositeMode: 'Effect has composite mode other than \"replace\"',\n /** Descriptive reason for why a user-provided animation failed to be optimized by the browser due to the target being in an invalid compositing state. Shown in a table with a list of other potential failure reasons. */\n compositingFailedTargetHasInvalidCompositingState: 'Target has invalid compositing state',\n /** Descriptive reason for why a user-provided animation failed to be optimized by the browser due to another animation on the same target being incompatible. Shown in a table with a list of other potential failure reasons. */\n compositingFailedTargetHasIncompatibleAnimations: 'Target has another animation which is incompatible',\n /** Descriptive reason for why a user-provided animation failed to be optimized by the browser due to the target having a CSS offset. Shown in a table with a list of other potential failure reasons. */\n compositingFailedTargetHasCSSOffset: 'Target has CSS offset',\n /** Descriptive reason for why a user-provided animation failed to be optimized by the browser due to the animation affecting non-CSS properties. Shown in a table with a list of other potential failure reasons. */\n compositingFailedAnimationAffectsNonCSSProperties: 'Animation affects non-CSS properties',\n /** Descriptive reason for why a user-provided animation failed to be optimized by the browser due to the transform-related property not being able to be animated on the target. Shown in a table with a list of other potential failure reasons. */\n compositingFailedTransformRelatedPropertyCannotBeAcceleratedOnTarget:\n 'Transform-related property cannot be accelerated on target',\n /** Descriptive reason for why a user-provided animation failed to be optimized by the browser due to a `transform` property being dependent on the size of the element itself. Shown in a table with a list of other potential failure reasons. */\n compositingFailedTransformDependsBoxSize: 'Transform-related property depends on box size',\n /** Descriptive reason for why a user-provided animation failed to be optimized by the browser due to a `filter` property possibly moving pixels. Shown in a table with a list of other potential failure reasons. */\n compositingFailedFilterRelatedPropertyMayMovePixels: 'Filter-related property may move pixels',\n /**\n * @description [ICU Syntax] Descriptive reason for why a user-provided animation failed to be optimized by the browser due to the animated CSS property not being supported on the compositor. Shown in a table with a list of other potential failure reasons.\n * @example {height, width} properties\n */\n compositingFailedUnsupportedCSSProperty: `{propertyCount, plural,\n =1 {Unsupported CSS property: {properties}}\n other {Unsupported CSS properties: {properties}}\n }`,\n /** Descriptive reason for why a user-provided animation failed to be optimized by the browser due to mixing keyframe value types. Shown in a table with a list of other potential failure reasons. */\n compositingFailedMixedKeyframeValueTypes: 'Mixed keyframe value types',\n /** Descriptive reason for why a user-provided animation failed to be optimized by the browser due to the timeline source being in an invalid compositing state. Shown in a table with a list of other potential failure reasons. */\n compositingFailedTimelineSourceHasInvalidCompositingState: 'Timeline source has invalid compositing state',\n /** Descriptive reason for why a user-provided animation failed to be optimized by the browser due to the animation having no visible change. Shown in a table with a list of other potential failure reasons. */\n compositingFailedAnimationHasNoVisibleChange: 'Animation has no visible change',\n /** Descriptive reason for why a user-provided animation failed to be optimized by the browser due to an effect affecting an important property. Shown in a table with a list of other potential failure reasons. */\n compositingFailedAffectsImportantProperty: 'Effect affects a property with !important',\n /** Descriptive reason for why a user-provided animation failed to be optimized by the browser due to the SVG target having an independent transfrom property. Shown in a table with a list of other potential failure reasons. */\n compositingFailedSVGTargetHasIndependentTransformProperty: 'SVG target has independent transform property',\n /** Descriptive reason for why a user-provided animation failed to be optimized by the browser due to an unknown reason. Shown in a table with a list of other potential failure reasons. */\n compositingFailedUnknownReason: 'Unknown Reason',\n\n /**\n *@description Text for the execution stack trace\n */\n stackTrace: 'Stack trace',\n /**\n *@description Text used to show any invalidations for a particular event that caused the browser to have to do more work to update the page.\n * @example {2} PH1\n */\n invalidations: 'Invalidations ({PH1} total)',\n /**\n * @description Text in Timeline UIUtils of the Performance panel. Phrase is followed by a number of milliseconds.\n * Some events or tasks might have been only started, but have not ended yet. Such events or tasks are considered\n * \"pending\".\n */\n pendingFor: 'Pending for',\n /**\n *@description Noun label for a stack trace which indicates the first time some condition was invalidated.\n */\n firstInvalidated: 'First invalidated',\n /**\n *@description Title of the paint profiler, old name of the performance pane\n */\n paintProfiler: 'Paint profiler',\n /**\n *@description Text in Timeline Flame Chart View of the Performance panel\n *@example {Frame} PH1\n *@example {10ms} PH2\n */\n sAtS: '{PH1} at {PH2}',\n /**\n *@description Text used next to a time to indicate that the particular event took that much time itself. In context this might look like \"3ms blink.console (self)\"\n *@example {blink.console} PH1\n */\n sSelf: '{PH1} (self)',\n /**\n *@description Text used next to a time to indicate that the event's children took that much time. In context this might look like \"3ms blink.console (children)\"\n *@example {blink.console} PH1\n */\n sChildren: '{PH1} (children)',\n /**\n *@description Text used to show the user how much time the browser spent on rendering (drawing the page onto the screen).\n */\n timeSpentInRendering: 'Time spent in rendering',\n /**\n *@description Text for a rendering frame\n */\n frame: 'Frame',\n /**\n *@description Text used to refer to the duration of an event at a given offset - e.g. \"2ms at 10ms\" which can be read as \"2ms starting after 10ms\".\n *@example {10ms} PH1\n *@example {10ms} PH2\n */\n sAtSParentheses: '{PH1} (at {PH2})',\n /**\n *@description Text of a DOM element in Timeline UIUtils of the Performance panel\n */\n UnknownNode: '[ unknown node ]',\n /**\n *@description Text used to refer to a particular element and the file it was referred to in.\n *@example {node} PH1\n *@example {app.js} PH2\n */\n invalidationWithCallFrame: '{PH1} at {PH2}',\n /**\n *@description Text indicating that something is outside of the Performace Panel Timeline Minimap range\n */\n outsideBreadcrumbRange: '(outside of the breadcrumb range)',\n /**\n *@description Text indicating that something is hidden from the Performace Panel Timeline\n */\n entryIsHidden: '(entry is hidden)',\n /**\n * @description Title of a row in the details view for a `Recalculate Styles` event that contains more info about selector stats tracing.\n */\n selectorStatsTitle: 'Selector stats',\n /**\n * @description Info text that explains to the user how to enable selector stats tracing.\n * @example {Setting Name} PH1\n */\n sSelectorStatsInfo: 'Select \"{PH1}\" to collect detailed CSS selector matching statistics.',\n /**\n * @description Label for a description text of a metric.\n */\n description: 'Description',\n /**\n * @description Label for a numeric value that was how long to wait before a function was run.\n */\n delay: 'Delay',\n /**\n * @description Label for a string that describes the priority at which a task was scheduled, like 'background' for low-priority tasks, and 'user-blocking' for high priority.\n */\n priority: 'Priority',\n};\nconst str_ = i18n.i18n.registerUIStrings('panels/timeline/TimelineUIUtils.ts', UIStrings);\nconst i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);\n\nlet eventDispatchDesciptors: EventDispatchTypeDescriptor[];\n\nlet colorGenerator: Common.Color.Generator;\n\ntype LinkifyLocationOptions = {\n scriptId: Protocol.Runtime.ScriptId|null,\n url: string,\n lineNumber: number,\n target: SDK.Target.Target|null,\n linkifier: LegacyComponents.Linkifier.Linkifier,\n isFreshRecording?: boolean,\n columnNumber?: number,\n};\n\nexport class TimelineUIUtils {\n static frameDisplayName(frame: Protocol.Runtime.CallFrame): string {\n const maybeResolvedData = Utils.SourceMapsResolver.SourceMapsResolver.resolvedCodeLocationForCallFrame(frame);\n const functionName = maybeResolvedData?.name || frame.functionName;\n if (!Trace.Extras.TimelineJSProfile.TimelineJSProfileProcessor.isNativeRuntimeFrame(frame)) {\n return UI.UIUtils.beautifyFunctionName(functionName);\n }\n const nativeGroup = Trace.Extras.TimelineJSProfile.TimelineJSProfileProcessor.nativeGroup(functionName);\n switch (nativeGroup) {\n case Trace.Extras.TimelineJSProfile.TimelineJSProfileProcessor.NativeGroups.COMPILE:\n return i18nString(UIStrings.compile);\n case Trace.Extras.TimelineJSProfile.TimelineJSProfileProcessor.NativeGroups.PARSE:\n return i18nString(UIStrings.parse);\n }\n return functionName;\n }\n\n static testContentMatching(\n traceEvent: Trace.Types.Events.Event, regExp: RegExp, parsedTrace?: Trace.Handlers.Types.ParsedTrace): boolean {\n const title = TimelineUIUtils.eventStyle(traceEvent).title;\n const tokens = [title];\n\n if (Trace.Types.Events.isProfileCall(traceEvent)) {\n // In the future this case will not be possible - wherever we call this\n // function we will be able to pass in the data from the new engine. But\n // currently this is called in a variety of places including from the\n // legacy model which does not have a reference to the new engine's data.\n // So if we are missing the data, we just fallback to the name from the\n // callFrame.\n if (!parsedTrace || !parsedTrace.Samples) {\n tokens.push(traceEvent.callFrame.functionName);\n } else {\n tokens.push(Trace.Handlers.ModelHandlers.Samples.getProfileCallFunctionName(parsedTrace.Samples, traceEvent));\n }\n }\n if (parsedTrace) {\n const url = Trace.Handlers.Helpers.getNonResolvedURL(traceEvent, parsedTrace);\n if (url) {\n tokens.push(url);\n }\n }\n // This works for both legacy and new engine events.\n appendObjectProperties(traceEvent.args as ContentObject, 2);\n const result = tokens.join('|').match(regExp);\n return result ? result.length > 0 : false;\n\n interface ContentObject {\n [x: string]: number|string|ContentObject;\n }\n function appendObjectProperties(object: ContentObject, depth: number): void {\n if (!depth) {\n return;\n }\n for (const key in object) {\n const value = object[key];\n if (typeof value === 'string') {\n tokens.push(value);\n } else if (typeof value === 'number') {\n tokens.push(String(value));\n } else if (typeof value === 'object' && value !== null) {\n appendObjectProperties(value, depth - 1);\n }\n }\n }\n }\n\n static eventStyle(event: Trace.Types.Events.Event): Utils.EntryStyles.TimelineRecordStyle {\n if (Trace.Types.Events.isProfileCall(event) && event.callFrame.functionName === '(idle)') {\n return new Utils.EntryStyles.TimelineRecordStyle(event.name, Utils.EntryStyles.getCategoryStyles().idle);\n }\n\n if (event.cat === Trace.Types.Events.Categories.Console || event.cat === Trace.Types.Events.Categories.UserTiming) {\n return new Utils.EntryStyles.TimelineRecordStyle(event.name, Utils.EntryStyles.getCategoryStyles()['scripting']);\n }\n\n return Utils.EntryStyles.getEventStyle(event.name as Trace.Types.Events.Name) ??\n new Utils.EntryStyles.TimelineRecordStyle(event.name, Utils.EntryStyles.getCategoryStyles().other);\n }\n\n static eventColor(event: Trace.Types.Events.Event): string {\n if (Trace.Types.Events.isProfileCall(event)) {\n const frame = event.callFrame;\n if (TimelineUIUtils.isUserFrame(frame)) {\n // TODO(andoli): This should use the resolved (sourcemapped) URL\n return TimelineUIUtils.colorForId(frame.url);\n }\n }\n if (Trace.Types.Extensions.isSyntheticExtensionEntry(event)) {\n return Extensions.ExtensionUI.extensionEntryColor(event);\n }\n let parsedColor = TimelineUIUtils.eventStyle(event).category.getComputedColorValue();\n // This event is considered idle time but still rendered as a scripting event here\n // to connect the StreamingCompileScriptParsing events it belongs to.\n if (event.name === Trace.Types.Events.Name.STREAMING_COMPILE_SCRIPT_WAITING) {\n parsedColor = Utils.EntryStyles.getCategoryStyles().scripting.getComputedColorValue();\n if (!parsedColor) {\n throw new Error('Unable to parse color from getCategoryStyles().scripting.color');\n }\n }\n return parsedColor;\n }\n\n static eventTitle(event: Trace.Types.Events.Event): string {\n // Profile call events do not have a args.data property, thus, we\n // need to check for profile calls in the beginning of this\n // function.\n if (Trace.Types.Events.isProfileCall(event)) {\n const maybeResolvedData = Utils.SourceMapsResolver.SourceMapsResolver.resolvedCodeLocationForEntry(event);\n const displayName = maybeResolvedData?.name || TimelineUIUtils.frameDisplayName(event.callFrame);\n return displayName;\n }\n if (event.name === 'EventTiming' && Trace.Types.Events.isSyntheticInteraction(event)) {\n // TODO(crbug.com/365047728): replace this entire method with this call.\n return Utils.EntryName.nameForEntry(event);\n }\n const title = TimelineUIUtils.eventStyle(event).title;\n if (Trace.Helpers.Trace.eventHasCategory(event, Trace.Types.Events.Categories.Console)) {\n return title;\n }\n if (Trace.Types.Events.isTimeStamp(event)) {\n return i18nString(UIStrings.sS, {PH1: title, PH2: event.args.data.message});\n }\n if (Trace.Types.Events.isAnimation(event) && event.args.data.name) {\n return i18nString(UIStrings.sS, {PH1: title, PH2: event.args.data.name});\n }\n if (Trace.Types.Events.isDispatch(event)) {\n return i18nString(UIStrings.sS, {PH1: title, PH2: event.args.data.type});\n }\n return title;\n }\n\n static isUserFrame(frame: Protocol.Runtime.CallFrame): boolean {\n return frame.scriptId !== '0' && !(frame.url && frame.url.startsWith('native '));\n }\n\n static async buildDetailsTextForTraceEvent(\n event: Trace.Types.Events.Event, parsedTrace: Trace.Handlers.Types.ParsedTrace): Promise {\n let detailsText;\n\n // TODO(40287735): update this code with type-safe data checks.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const unsafeEventArgs = event.args as Record;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const unsafeEventData = event.args?.data as Record;\n\n switch (event.name) {\n case Trace.Types.Events.Name.GC:\n case Trace.Types.Events.Name.MAJOR_GC:\n case Trace.Types.Events.Name.MINOR_GC: {\n const delta = unsafeEventArgs['usedHeapSizeBefore'] - unsafeEventArgs['usedHeapSizeAfter'];\n detailsText = i18nString(UIStrings.sCollected, {PH1: i18n.ByteUtilities.bytesToString(delta)});\n break;\n }\n case Trace.Types.Events.Name.FUNCTION_CALL: {\n const {lineNumber, columnNumber} = Trace.Helpers.Trace.getZeroIndexedLineAndColumnForEvent(event);\n if (lineNumber !== undefined && columnNumber !== undefined) {\n detailsText = unsafeEventData.url + ':' + (lineNumber + 1) + ':' + (columnNumber + 1);\n }\n break;\n }\n case Trace.Types.Events.Name.EVENT_DISPATCH:\n detailsText = unsafeEventData ? unsafeEventData['type'] : null;\n break;\n case Trace.Types.Events.Name.PAINT: {\n const width = TimelineUIUtils.quadWidth(unsafeEventData.clip);\n const height = TimelineUIUtils.quadHeight(unsafeEventData.clip);\n if (width && height) {\n detailsText = i18nString(UIStrings.sSDimensions, {PH1: width, PH2: height});\n }\n break;\n }\n case Trace.Types.Events.Name.PARSE_HTML: {\n const startLine = unsafeEventArgs['beginData']['startLine'];\n const endLine = unsafeEventArgs['endData'] && unsafeEventArgs['endData']['endLine'];\n const url = Bindings.ResourceUtils.displayNameForURL(unsafeEventArgs['beginData']['url']);\n if (endLine >= 0) {\n detailsText = i18nString(UIStrings.sSs, {PH1: url, PH2: startLine + 1, PH3: endLine + 1});\n } else {\n detailsText = i18nString(UIStrings.sSSquareBrackets, {PH1: url, PH2: startLine + 1});\n }\n break;\n }\n case Trace.Types.Events.Name.COMPILE_MODULE:\n case Trace.Types.Events.Name.CACHE_MODULE:\n detailsText = Bindings.ResourceUtils.displayNameForURL(unsafeEventArgs['fileName']);\n break;\n case Trace.Types.Events.Name.COMPILE_SCRIPT:\n case Trace.Types.Events.Name.CACHE_SCRIPT:\n case Trace.Types.Events.Name.EVALUATE_SCRIPT: {\n const {lineNumber} = Trace.Helpers.Trace.getZeroIndexedLineAndColumnForEvent(event);\n const url = unsafeEventData && unsafeEventData['url'];\n if (url) {\n detailsText = Bindings.ResourceUtils.displayNameForURL(url) + ':' + ((lineNumber || 0) + 1);\n }\n break;\n }\n case Trace.Types.Events.Name.WASM_COMPILED_MODULE:\n case Trace.Types.Events.Name.WASM_MODULE_CACHE_HIT: {\n const url = unsafeEventArgs['url'];\n if (url) {\n detailsText = Bindings.ResourceUtils.displayNameForURL(url);\n }\n break;\n }\n\n case Trace.Types.Events.Name.STREAMING_COMPILE_SCRIPT:\n case Trace.Types.Events.Name.BACKGROUND_DESERIALIZE:\n case Trace.Types.Events.Name.XHR_READY_STATE_CHANGED:\n case Trace.Types.Events.Name.XHR_LOAD: {\n const url = unsafeEventData['url'];\n if (url) {\n detailsText = Bindings.ResourceUtils.displayNameForURL(url);\n }\n break;\n }\n case Trace.Types.Events.Name.TIME_STAMP:\n detailsText = unsafeEventData['message'];\n break;\n\n case Trace.Types.Events.Name.WEB_SOCKET_CREATE:\n case Trace.Types.Events.Name.WEB_SOCKET_SEND_HANDSHAKE_REQUEST:\n case Trace.Types.Events.Name.WEB_SOCKET_RECEIVE_HANDSHAKE_REQUEST:\n case Trace.Types.Events.Name.WEB_SOCKET_SEND:\n case Trace.Types.Events.Name.WEB_SOCKET_RECEIVE:\n case Trace.Types.Events.Name.WEB_SOCKET_DESTROY:\n case Trace.Types.Events.Name.RESOURCE_WILL_SEND_REQUEST:\n case Trace.Types.Events.Name.RESOURCE_SEND_REQUEST:\n case Trace.Types.Events.Name.RESOURCE_RECEIVE_DATA:\n case Trace.Types.Events.Name.RESOURCE_RECEIVE_RESPONSE:\n case Trace.Types.Events.Name.RESOURCE_FINISH:\n case Trace.Types.Events.Name.PAINT_IMAGE:\n case Trace.Types.Events.Name.DECODE_IMAGE:\n case Trace.Types.Events.Name.DECODE_LAZY_PIXEL_REF: {\n const url = Trace.Handlers.Helpers.getNonResolvedURL(event, parsedTrace);\n if (url) {\n detailsText = Bindings.ResourceUtils.displayNameForURL(url);\n }\n break;\n }\n\n case Trace.Types.Events.Name.EMBEDDER_CALLBACK:\n detailsText = unsafeEventData['callbackName'];\n break;\n\n case Trace.Types.Events.Name.ASYNC_TASK:\n detailsText = unsafeEventData ? unsafeEventData['name'] : null;\n break;\n\n default:\n if (Trace.Helpers.Trace.eventHasCategory(event, Trace.Types.Events.Categories.Console)) {\n detailsText = null;\n } else {\n detailsText = linkifyTopCallFrameAsText();\n }\n break;\n }\n\n return detailsText;\n\n function linkifyTopCallFrameAsText(): string|null {\n const frame = Trace.Helpers.Trace.getZeroIndexedStackTraceForEvent(event)?.at(0) ?? null;\n if (!frame) {\n return null;\n }\n\n return frame.url + ':' + (frame.lineNumber + 1) + ':' + (frame.columnNumber + 1);\n }\n }\n\n static async buildDetailsNodeForTraceEvent(\n event: Trace.Types.Events.Event, target: SDK.Target.Target|null, linkifier: LegacyComponents.Linkifier.Linkifier,\n isFreshRecording = false, parsedTrace: Trace.Handlers.Types.ParsedTrace): Promise {\n let details: HTMLElement|HTMLSpanElement|(Element | null)|Text|null = null;\n let detailsText;\n // TODO(40287735): update this code with type-safe data checks.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const unsafeEventArgs = event.args as Record;\n // TODO(40287735): update this code with type-safe data checks.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const unsafeEventData = event.args?.data as Record;\n\n switch (event.name) {\n case Trace.Types.Events.Name.GC:\n case Trace.Types.Events.Name.MAJOR_GC:\n case Trace.Types.Events.Name.MINOR_GC:\n case Trace.Types.Events.Name.EVENT_DISPATCH:\n case Trace.Types.Events.Name.PAINT:\n case Trace.Types.Events.Name.ANIMATION:\n case Trace.Types.Events.Name.EMBEDDER_CALLBACK:\n case Trace.Types.Events.Name.PARSE_HTML:\n case Trace.Types.Events.Name.WASM_STREAM_FROM_RESPONSE_CALLBACK:\n case Trace.Types.Events.Name.WASM_COMPILED_MODULE:\n case Trace.Types.Events.Name.WASM_MODULE_CACHE_HIT:\n case Trace.Types.Events.Name.WASM_CACHED_MODULE:\n case Trace.Types.Events.Name.WASM_MODULE_CACHE_INVALID:\n case Trace.Types.Events.Name.WEB_SOCKET_CREATE:\n case Trace.Types.Events.Name.WEB_SOCKET_SEND_HANDSHAKE_REQUEST:\n case Trace.Types.Events.Name.WEB_SOCKET_RECEIVE_HANDSHAKE_REQUEST:\n case Trace.Types.Events.Name.WEB_SOCKET_SEND:\n case Trace.Types.Events.Name.WEB_SOCKET_RECEIVE:\n case Trace.Types.Events.Name.WEB_SOCKET_DESTROY: {\n detailsText = await TimelineUIUtils.buildDetailsTextForTraceEvent(event, parsedTrace);\n break;\n }\n\n case Trace.Types.Events.Name.PAINT_IMAGE:\n case Trace.Types.Events.Name.DECODE_IMAGE:\n case Trace.Types.Events.Name.DECODE_LAZY_PIXEL_REF:\n case Trace.Types.Events.Name.XHR_READY_STATE_CHANGED:\n case Trace.Types.Events.Name.XHR_LOAD:\n case Trace.Types.Events.Name.RESOURCE_WILL_SEND_REQUEST:\n case Trace.Types.Events.Name.RESOURCE_SEND_REQUEST:\n case Trace.Types.Events.Name.RESOURCE_RECEIVE_DATA:\n case Trace.Types.Events.Name.RESOURCE_RECEIVE_RESPONSE:\n case Trace.Types.Events.Name.RESOURCE_FINISH: {\n const url = Trace.Handlers.Helpers.getNonResolvedURL(event, parsedTrace);\n if (url) {\n const options = {\n tabStop: true,\n showColumnNumber: false,\n inlineFrameIndex: 0,\n };\n details = LegacyComponents.Linkifier.Linkifier.linkifyURL(url, options);\n }\n break;\n }\n\n case Trace.Types.Events.Name.FUNCTION_CALL: {\n details = document.createElement('span');\n\n // FunctionCall events have an args.data that could be a CallFrame, if all the details are present, so we check for that.\n const callFrame = Trace.Helpers.Trace.getZeroIndexedStackTraceForEvent(event)?.at(0);\n if (Trace.Types.Events.isFunctionCall(event) && callFrame) {\n UI.UIUtils.createTextChild(\n details,\n TimelineUIUtils.frameDisplayName(\n {...callFrame, scriptId: String(callFrame.scriptId) as Protocol.Runtime.ScriptId}));\n }\n const location = this.linkifyLocation({\n scriptId: unsafeEventData['scriptId'],\n url: unsafeEventData['url'],\n lineNumber: callFrame?.lineNumber || 0,\n columnNumber: callFrame?.columnNumber,\n target,\n isFreshRecording,\n linkifier,\n });\n if (location) {\n UI.UIUtils.createTextChild(details, ' @ ');\n details.appendChild(location);\n }\n break;\n }\n\n case Trace.Types.Events.Name.COMPILE_MODULE:\n case Trace.Types.Events.Name.CACHE_MODULE: {\n details = this.linkifyLocation({\n scriptId: null,\n url: unsafeEventArgs['fileName'],\n lineNumber: 0,\n columnNumber: 0,\n target,\n isFreshRecording,\n linkifier,\n });\n break;\n }\n\n case Trace.Types.Events.Name.COMPILE_SCRIPT:\n case Trace.Types.Events.Name.CACHE_SCRIPT:\n case Trace.Types.Events.Name.EVALUATE_SCRIPT: {\n const url = unsafeEventData['url'];\n if (url) {\n const {lineNumber} = Trace.Helpers.Trace.getZeroIndexedLineAndColumnForEvent(event);\n details = this.linkifyLocation({\n scriptId: null,\n url,\n lineNumber: lineNumber || 0,\n columnNumber: 0,\n target,\n isFreshRecording,\n linkifier,\n });\n }\n break;\n }\n\n case Trace.Types.Events.Name.BACKGROUND_DESERIALIZE:\n case Trace.Types.Events.Name.STREAMING_COMPILE_SCRIPT: {\n const url = unsafeEventData['url'];\n if (url) {\n details = this.linkifyLocation(\n {scriptId: null, url, lineNumber: 0, columnNumber: 0, target, isFreshRecording, linkifier});\n }\n break;\n }\n\n default: {\n /**\n * Some events have a stack trace which is extracted by default at @see TimelineUIUtils.generateCauses\n * thus, we prevent extracting the stack trace again here.\n */\n if (Trace.Helpers.Trace.eventHasCategory(event, Trace.Types.Events.Categories.Console) ||\n Trace.Types.Events.isUserTiming(event) || Trace.Types.Extensions.isSyntheticExtensionEntry(event) ||\n Trace.Types.Events.isProfileCall(event)) {\n detailsText = null;\n } else {\n details = this.linkifyTopCallFrame(event, target, linkifier, isFreshRecording) ?? null;\n }\n break;\n }\n }\n\n if (!details && detailsText) {\n details = document.createTextNode(detailsText);\n }\n return details;\n }\n\n static linkifyLocation(linkifyOptions: LinkifyLocationOptions): Element|null {\n const {scriptId, url, lineNumber, columnNumber, isFreshRecording, linkifier, target} = linkifyOptions;\n const options = {\n lineNumber,\n columnNumber,\n showColumnNumber: true,\n inlineFrameIndex: 0,\n className: 'timeline-details',\n tabStop: true,\n };\n if (isFreshRecording) {\n return linkifier.linkifyScriptLocation(\n target, scriptId, url as Platform.DevToolsPath.UrlString, lineNumber, options);\n }\n return LegacyComponents.Linkifier.Linkifier.linkifyURL(url as Platform.DevToolsPath.UrlString, options);\n }\n\n static linkifyTopCallFrame(\n event: Trace.Types.Events.Event, target: SDK.Target.Target|null, linkifier: LegacyComponents.Linkifier.Linkifier,\n isFreshRecording = false): Element|null {\n let frame = Trace.Helpers.Trace.getZeroIndexedStackTraceForEvent(event)?.[0];\n if (Trace.Types.Events.isProfileCall(event)) {\n frame = event.callFrame;\n }\n if (!frame) {\n return null;\n }\n const options = {\n className: 'timeline-details',\n tabStop: true,\n inlineFrameIndex: 0,\n showColumnNumber: true,\n columnNumber: frame.columnNumber,\n lineNumber: frame.lineNumber,\n };\n if (isFreshRecording) {\n return linkifier.maybeLinkifyConsoleCallFrame(target, frame, {showColumnNumber: true, inlineFrameIndex: 0});\n }\n return LegacyComponents.Linkifier.Linkifier.linkifyURL(frame.url as Platform.DevToolsPath.UrlString, options);\n }\n\n static buildDetailsNodeForMarkerEvents(event: Trace.Types.Events.MarkerEvent): HTMLElement {\n let link = 'https://web.dev/user-centric-performance-metrics/';\n let name = 'page performance metrics';\n switch (event.name) {\n case Trace.Types.Events.Name.MARK_LCP_CANDIDATE:\n link = 'https://web.dev/lcp/';\n name = 'largest contentful paint';\n break;\n case Trace.Types.Events.Name.MARK_FCP:\n link = 'https://web.dev/first-contentful-paint/';\n name = 'first contentful paint';\n break;\n default:\n break;\n }\n\n const html = UI.Fragment.html`
${\n UI.XLink.XLink.create(\n link, i18nString(UIStrings.learnMore), undefined, undefined, 'learn-more')} about ${name}.
`;\n return html as HTMLElement;\n }\n\n static buildConsumeCacheDetails(\n eventData: {\n consumedCacheSize?: number,\n cacheRejected?: boolean,\n cacheKind?: string,\n },\n contentHelper: TimelineDetailsContentHelper): void {\n if (typeof eventData.consumedCacheSize === 'number') {\n contentHelper.appendTextRow(\n i18nString(UIStrings.compilationCacheStatus), i18nString(UIStrings.scriptLoadedFromCache));\n contentHelper.appendTextRow(\n i18nString(UIStrings.compilationCacheSize), i18n.ByteUtilities.bytesToString(eventData.consumedCacheSize));\n const cacheKind = eventData.cacheKind;\n if (cacheKind) {\n contentHelper.appendTextRow(i18nString(UIStrings.compilationCacheKind), cacheKind);\n }\n } else if ('cacheRejected' in eventData && eventData['cacheRejected']) {\n // Version mismatch or similar.\n contentHelper.appendTextRow(\n i18nString(UIStrings.compilationCacheStatus), i18nString(UIStrings.failedToLoadScriptFromCache));\n } else {\n contentHelper.appendTextRow(\n i18nString(UIStrings.compilationCacheStatus), i18nString(UIStrings.scriptNotEligibleToBeLoadedFromCache));\n }\n }\n\n static async buildTraceEventDetails(\n parsedTrace: Trace.Handlers.Types.ParsedTrace,\n event: Trace.Types.Events.Event,\n linkifier: LegacyComponents.Linkifier.Linkifier,\n detailed: boolean,\n ): Promise {\n const maybeTarget = targetForEvent(parsedTrace, event);\n const {duration} = Trace.Helpers.Timing.eventTimingsMilliSeconds(event);\n const selfTime = getEventSelfTime(event, parsedTrace);\n const relatedNodesMap = await Trace.Extras.FetchNodes.extractRelatedDOMNodesFromEvent(\n parsedTrace,\n event,\n );\n\n if (maybeTarget) {\n // @ts-ignore TODO(crbug.com/1011811): Remove symbol usage.\n if (typeof event[previewElementSymbol] === 'undefined') {\n let previewElement: (Element|null)|null = null;\n const url = Trace.Handlers.Helpers.getNonResolvedURL(event, parsedTrace);\n if (url) {\n previewElement = await LegacyComponents.ImagePreview.ImagePreview.build(maybeTarget, url, false, {\n imageAltText: LegacyComponents.ImagePreview.ImagePreview.defaultAltTextForImageURL(url),\n precomputedFeatures: undefined,\n align: LegacyComponents.ImagePreview.Align.START,\n });\n } else if (Trace.Types.Events.isPaint(event)) {\n previewElement = await TimelineUIUtils.buildPicturePreviewContent(parsedTrace, event, maybeTarget);\n }\n // @ts-ignore TODO(crbug.com/1011811): Remove symbol usage.\n event[previewElementSymbol] = previewElement;\n }\n }\n\n if (Trace.Types.Events.isSyntheticLayoutShift(event)) {\n // Ensure that there are no pie charts or extended info for layout shifts.\n detailed = false;\n }\n\n // This message may vary per event.name;\n let relatedNodeLabel;\n\n const contentHelper = new TimelineDetailsContentHelper(targetForEvent(parsedTrace, event), linkifier);\n\n const defaultColorForEvent = this.eventColor(event);\n const isMarker = parsedTrace && isMarkerEvent(parsedTrace, event);\n const color = isMarker ? TimelineUIUtils.markerStyleForEvent(event).color : defaultColorForEvent;\n\n contentHelper.addSection(TimelineUIUtils.eventTitle(event), color);\n\n // TODO: as part of the removal of the old engine, produce a typesafe way\n // to look up args and data for events.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const unsafeEventArgs = event.args as Record;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const unsafeEventData = event.args?.data as Record;\n const initiator = parsedTrace.Initiators.eventToInitiator.get(event) ?? null;\n const initiatorFor = parsedTrace.Initiators.initiatorToEvents.get(event) ?? null;\n\n let url: Platform.DevToolsPath.UrlString|null = null;\n\n if (parsedTrace) {\n const warnings = TimelineComponents.DetailsView.buildWarningElementsForEvent(event, parsedTrace);\n for (const warning of warnings) {\n contentHelper.appendElementRow(i18nString(UIStrings.warning), warning, true);\n }\n }\n\n // Add timestamp to user timings.\n if (Trace.Helpers.Trace.eventHasCategory(event, Trace.Types.Events.Categories.UserTiming)) {\n const adjustedEventTimeStamp = timeStampForEventAdjustedForClosestNavigationIfPossible(\n event,\n parsedTrace,\n );\n contentHelper.appendTextRow(\n i18nString(UIStrings.timestamp), i18n.TimeUtilities.preciseMillisToString(adjustedEventTimeStamp, 1));\n }\n\n // Only show total time and self time for events with non-zero durations.\n if (detailed && !Number.isNaN(duration || 0) && duration !== 0) {\n contentHelper.appendTextRow(\n i18nString(UIStrings.totalTime), i18n.TimeUtilities.millisToString(duration || 0, true));\n contentHelper.appendTextRow(i18nString(UIStrings.selfTime), i18n.TimeUtilities.millisToString(selfTime, true));\n }\n\n if (Trace.Types.Events.isPerformanceMark(event) && event.args.data?.detail) {\n const detailContainer = TimelineUIUtils.renderObjectJson(JSON.parse(event.args.data?.detail));\n contentHelper.appendElementRow(i18nString(UIStrings.details), detailContainer);\n }\n if (Trace.Types.Events.isSyntheticUserTiming(event) && event.args?.data?.beginEvent.args.detail) {\n const detailContainer = TimelineUIUtils.renderObjectJson(JSON.parse(event.args?.data?.beginEvent.args.detail));\n contentHelper.appendElementRow(i18nString(UIStrings.details), detailContainer);\n }\n\n if (parsedTrace.Meta.traceIsGeneric) {\n TimelineUIUtils.renderEventJson(event, contentHelper);\n return contentHelper.fragment;\n }\n\n if (Trace.Types.Events.isV8Compile(event)) {\n url = event.args.data?.url as Platform.DevToolsPath.UrlString;\n if (url) {\n const {lineNumber, columnNumber} = Trace.Helpers.Trace.getZeroIndexedLineAndColumnForEvent(event);\n contentHelper.appendLocationRow(i18nString(UIStrings.script), url, lineNumber || 0, columnNumber);\n }\n const isEager = Boolean(event.args.data?.eager);\n if (isEager) {\n contentHelper.appendTextRow(i18nString(UIStrings.eagerCompile), true);\n }\n\n const isStreamed = Boolean(event.args.data?.streamed);\n contentHelper.appendTextRow(\n i18nString(UIStrings.streamed),\n isStreamed + (isStreamed ? '' : `: ${event.args.data?.notStreamedReason || ''}`));\n if (event.args.data) {\n TimelineUIUtils.buildConsumeCacheDetails(event.args.data, contentHelper);\n }\n }\n\n if (Trace.Types.Extensions.isSyntheticExtensionEntry(event)) {\n for (const [key, value] of event.args.properties || []) {\n contentHelper.appendTextRow(key, value);\n }\n }\n\n if (Trace.Types.Events.isSyntheticServerTiming(event) && event.args.data.desc) {\n contentHelper.appendTextRow(i18nString(UIStrings.description), event.args.data.desc);\n }\n\n const isFreshRecording = Boolean(parsedTrace && Tracker.instance().recordingIsFresh(parsedTrace));\n\n switch (event.name) {\n case Trace.Types.Events.Name.GC:\n case Trace.Types.Events.Name.MAJOR_GC:\n case Trace.Types.Events.Name.MINOR_GC: {\n const delta = unsafeEventArgs['usedHeapSizeBefore'] - unsafeEventArgs['usedHeapSizeAfter'];\n contentHelper.appendTextRow(i18nString(UIStrings.collected), i18n.ByteUtilities.bytesToString(delta));\n break;\n }\n\n case Trace.Types.Events.Name.PROFILE_CALL:\n case Trace.Types.Events.Name.FUNCTION_CALL: {\n const detailsNode = await TimelineUIUtils.buildDetailsNodeForTraceEvent(\n event, targetForEvent(parsedTrace, event), linkifier, isFreshRecording, parsedTrace);\n if (detailsNode) {\n contentHelper.appendElementRow(i18nString(UIStrings.function), detailsNode);\n }\n break;\n }\n\n case Trace.Types.Events.Name.TIMER_FIRE:\n case Trace.Types.Events.Name.TIMER_INSTALL:\n case Trace.Types.Events.Name.TIMER_REMOVE: {\n contentHelper.appendTextRow(i18nString(UIStrings.timerId), unsafeEventData.timerId);\n\n if (event.name === Trace.Types.Events.Name.TIMER_INSTALL) {\n contentHelper.appendTextRow(\n i18nString(UIStrings.timeout), i18n.TimeUtilities.millisToString(unsafeEventData['timeout']));\n contentHelper.appendTextRow(i18nString(UIStrings.repeats), !unsafeEventData['singleShot']);\n }\n break;\n }\n\n case Trace.Types.Events.Name.SCHEDULE_POST_TASK_CALLBACK:\n case Trace.Types.Events.Name.RUN_POST_TASK_CALLBACK: {\n contentHelper.appendTextRow(\n i18nString(UIStrings.delay), i18n.TimeUtilities.millisToString(unsafeEventData['delay']));\n contentHelper.appendTextRow(i18nString(UIStrings.priority), unsafeEventData['priority']);\n break;\n }\n\n case Trace.Types.Events.Name.FIRE_ANIMATION_FRAME: {\n contentHelper.appendTextRow(i18nString(UIStrings.callbackId), unsafeEventData['id']);\n break;\n }\n\n case Trace.Types.Events.Name.COMPILE_MODULE: {\n contentHelper.appendLocationRow(i18nString(UIStrings.module), unsafeEventArgs['fileName'], 0);\n break;\n }\n case Trace.Types.Events.Name.COMPILE_SCRIPT: {\n // This case is handled above\n break;\n }\n\n case Trace.Types.Events.Name.CACHE_MODULE: {\n url = unsafeEventData && unsafeEventData['url'] as Platform.DevToolsPath.UrlString;\n contentHelper.appendTextRow(\n i18nString(UIStrings.compilationCacheSize),\n i18n.ByteUtilities.bytesToString(unsafeEventData['producedCacheSize']));\n break;\n }\n\n case Trace.Types.Events.Name.CACHE_SCRIPT: {\n url = unsafeEventData && unsafeEventData['url'] as Platform.DevToolsPath.UrlString;\n if (url) {\n const {lineNumber, columnNumber} = Trace.Helpers.Trace.getZeroIndexedLineAndColumnForEvent(event);\n contentHelper.appendLocationRow(i18nString(UIStrings.script), url, lineNumber || 0, columnNumber);\n }\n contentHelper.appendTextRow(\n i18nString(UIStrings.compilationCacheSize),\n i18n.ByteUtilities.bytesToString(unsafeEventData['producedCacheSize']));\n break;\n }\n\n case Trace.Types.Events.Name.EVALUATE_SCRIPT: {\n url = unsafeEventData && unsafeEventData['url'] as Platform.DevToolsPath.UrlString;\n if (url) {\n const {lineNumber, columnNumber} = Trace.Helpers.Trace.getZeroIndexedLineAndColumnForEvent(event);\n contentHelper.appendLocationRow(i18nString(UIStrings.script), url, lineNumber || 0, columnNumber);\n }\n break;\n }\n\n case Trace.Types.Events.Name.WASM_STREAM_FROM_RESPONSE_CALLBACK:\n case Trace.Types.Events.Name.WASM_COMPILED_MODULE:\n case Trace.Types.Events.Name.WASM_CACHED_MODULE:\n case Trace.Types.Events.Name.WASM_MODULE_CACHE_HIT:\n case Trace.Types.Events.Name.WASM_MODULE_CACHE_INVALID: {\n if (unsafeEventData) {\n url = unsafeEventArgs['url'] as Platform.DevToolsPath.UrlString;\n if (url) {\n contentHelper.appendTextRow(i18nString(UIStrings.url), url);\n }\n const producedCachedSize = unsafeEventArgs['producedCachedSize'];\n if (producedCachedSize) {\n contentHelper.appendTextRow(i18nString(UIStrings.producedCacheSize), producedCachedSize);\n }\n const consumedCachedSize = unsafeEventArgs['consumedCachedSize'];\n if (consumedCachedSize) {\n contentHelper.appendTextRow(i18nString(UIStrings.consumedCacheSize), consumedCachedSize);\n }\n }\n break;\n }\n\n // @ts-ignore Fall-through intended.\n case Trace.Types.Events.Name.PAINT: {\n const clip = unsafeEventData['clip'];\n contentHelper.appendTextRow(\n i18nString(UIStrings.location), i18nString(UIStrings.sSCurlyBrackets, {PH1: clip[0], PH2: clip[1]}));\n const clipWidth = TimelineUIUtils.quadWidth(clip);\n const clipHeight = TimelineUIUtils.quadHeight(clip);\n contentHelper.appendTextRow(\n i18nString(UIStrings.dimensions), i18nString(UIStrings.sSDimensions, {PH1: clipWidth, PH2: clipHeight}));\n }\n\n case Trace.Types.Events.Name.PAINT_SETUP:\n case Trace.Types.Events.Name.RASTERIZE:\n case Trace.Types.Events.Name.SCROLL_LAYER: {\n relatedNodeLabel = i18nString(UIStrings.layerRoot);\n break;\n }\n\n case Trace.Types.Events.Name.PAINT_IMAGE:\n case Trace.Types.Events.Name.DECODE_LAZY_PIXEL_REF:\n case Trace.Types.Events.Name.DECODE_IMAGE:\n case Trace.Types.Events.Name.DRAW_LAZY_PIXEL_REF: {\n relatedNodeLabel = i18nString(UIStrings.ownerElement);\n url = Trace.Handlers.Helpers.getNonResolvedURL(event, parsedTrace);\n if (url) {\n const options = {\n tabStop: true,\n showColumnNumber: false,\n inlineFrameIndex: 0,\n };\n contentHelper.appendElementRow(\n i18nString(UIStrings.imageUrl), LegacyComponents.Linkifier.Linkifier.linkifyURL(url, options));\n }\n break;\n }\n\n case Trace.Types.Events.Name.PARSE_AUTHOR_STYLE_SHEET: {\n url = unsafeEventData['styleSheetUrl'] as Platform.DevToolsPath.UrlString;\n if (url) {\n const options = {\n tabStop: true,\n showColumnNumber: false,\n inlineFrameIndex: 0,\n };\n contentHelper.appendElementRow(\n i18nString(UIStrings.stylesheetUrl), LegacyComponents.Linkifier.Linkifier.linkifyURL(url, options));\n }\n break;\n }\n\n case Trace.Types.Events.Name.UPDATE_LAYOUT_TREE: {\n contentHelper.appendTextRow(i18nString(UIStrings.elementsAffected), unsafeEventArgs['elementCount']);\n\n const selectorStatsSetting =\n Common.Settings.Settings.instance().createSetting('timeline-capture-selector-stats', false);\n if (!selectorStatsSetting.get()) {\n const note = document.createElement('span');\n note.textContent = i18nString(UIStrings.sSelectorStatsInfo, {PH1: selectorStatsSetting.title()});\n contentHelper.appendElementRow(i18nString(UIStrings.selectorStatsTitle), note);\n }\n\n break;\n }\n\n case Trace.Types.Events.Name.LAYOUT: {\n const beginData = unsafeEventArgs['beginData'];\n contentHelper.appendTextRow(\n i18nString(UIStrings.nodesThatNeedLayout),\n i18nString(UIStrings.sOfS, {PH1: beginData['dirtyObjects'], PH2: beginData['totalObjects']}));\n relatedNodeLabel = i18nString(UIStrings.layoutRoot);\n break;\n }\n\n case Trace.Types.Events.Name.CONSOLE_TIME: {\n contentHelper.appendTextRow(i18nString(UIStrings.message), event.name);\n break;\n }\n\n case Trace.Types.Events.Name.WEB_SOCKET_CREATE:\n case Trace.Types.Events.Name.WEB_SOCKET_SEND_HANDSHAKE_REQUEST:\n case Trace.Types.Events.Name.WEB_SOCKET_RECEIVE_HANDSHAKE_REQUEST:\n case Trace.Types.Events.Name.WEB_SOCKET_SEND:\n case Trace.Types.Events.Name.WEB_SOCKET_RECEIVE:\n case Trace.Types.Events.Name.WEB_SOCKET_DESTROY: {\n if (Trace.Types.Events.isWebSocketTraceEvent(event)) {\n const rows = TimelineComponents.DetailsView.buildRowsForWebSocketEvent(event, parsedTrace);\n for (const {key, value} of rows) {\n contentHelper.appendTextRow(key, value);\n }\n }\n break;\n }\n\n case Trace.Types.Events.Name.EMBEDDER_CALLBACK: {\n contentHelper.appendTextRow(i18nString(UIStrings.callbackFunction), unsafeEventData['callbackName']);\n break;\n }\n\n case Trace.Types.Events.Name.ANIMATION: {\n if (!Trace.Types.Events.isSyntheticAnimation(event)) {\n break;\n }\n const {displayName, nodeName} = event.args.data.beginEvent.args.data;\n displayName && contentHelper.appendTextRow(i18nString(UIStrings.animating), displayName);\n // If relatedNodes is empty (maybe saved trace), then print the text description of the DOM node.\n if (!relatedNodesMap?.size && nodeName) {\n contentHelper.appendTextRow(i18nString(UIStrings.relatedNode), nodeName);\n }\n\n const CLSInsight = Trace.Insights.Models.CLSCulprits;\n const failures = CLSInsight.getNonCompositedFailure(event);\n if (!failures.length) {\n break;\n }\n\n const failureReasons = new Set(failures.map(f => f.failureReasons).flat().filter(Boolean));\n const unsupportedProperties =\n new Set(failures.map(f => f.unsupportedProperties).flat().filter(Boolean)) as Set;\n\n // The failureReasons can be empty when Blink added a new failure reason that is\n // not supported by DevTools yet\n if (failureReasons.size === 0) {\n contentHelper.appendElementRow(\n i18nString(UIStrings.compositingFailed), i18nString(UIStrings.compositingFailedUnknownReason), true);\n } else {\n for (const reason of failureReasons) {\n let str;\n switch (reason) {\n case CLSInsight.AnimationFailureReasons.ACCELERATED_ANIMATIONS_DISABLED:\n str = i18nString(UIStrings.compositingFailedAcceleratedAnimationsDisabled);\n break;\n case CLSInsight.AnimationFailureReasons.EFFECT_SUPPRESSED_BY_DEVTOOLS:\n str = i18nString(UIStrings.compositingFailedEffectSuppressedByDevtools);\n break;\n case CLSInsight.AnimationFailureReasons.INVALID_ANIMATION_OR_EFFECT:\n str = i18nString(UIStrings.compositingFailedInvalidAnimationOrEffect);\n break;\n case CLSInsight.AnimationFailureReasons.EFFECT_HAS_UNSUPPORTED_TIMING_PARAMS:\n str = i18nString(UIStrings.compositingFailedEffectHasUnsupportedTimingParams);\n break;\n case CLSInsight.AnimationFailureReasons.EFFECT_HAS_NON_REPLACE_COMPOSITE_MODE:\n str = i18nString(UIStrings.compositingFailedEffectHasNonReplaceCompositeMode);\n break;\n case CLSInsight.AnimationFailureReasons.TARGET_HAS_INVALID_COMPOSITING_STATE:\n str = i18nString(UIStrings.compositingFailedTargetHasInvalidCompositingState);\n break;\n case CLSInsight.AnimationFailureReasons.TARGET_HAS_INCOMPATIBLE_ANIMATIONS:\n str = i18nString(UIStrings.compositingFailedTargetHasIncompatibleAnimations);\n break;\n case CLSInsight.AnimationFailureReasons.TARGET_HAS_CSS_OFFSET:\n str = i18nString(UIStrings.compositingFailedTargetHasCSSOffset);\n break;\n case CLSInsight.AnimationFailureReasons.ANIMATION_AFFECTS_NON_CSS_PROPERTIES:\n str = i18nString(UIStrings.compositingFailedAnimationAffectsNonCSSProperties);\n break;\n case CLSInsight.AnimationFailureReasons.TRANSFORM_RELATED_PROPERTY_CANNOT_BE_ACCELERATED_ON_TARGET:\n str = i18nString(UIStrings.compositingFailedTransformRelatedPropertyCannotBeAcceleratedOnTarget);\n break;\n case CLSInsight.AnimationFailureReasons.TRANSFROM_BOX_SIZE_DEPENDENT:\n str = i18nString(UIStrings.compositingFailedTransformDependsBoxSize);\n break;\n case CLSInsight.AnimationFailureReasons.FILTER_RELATED_PROPERTY_MAY_MOVE_PIXELS:\n str = i18nString(UIStrings.compositingFailedFilterRelatedPropertyMayMovePixels);\n break;\n case CLSInsight.AnimationFailureReasons.UNSUPPORTED_CSS_PROPERTY:\n str = i18nString(UIStrings.compositingFailedUnsupportedCSSProperty, {\n propertyCount: unsupportedProperties.size,\n properties: new Intl.ListFormat(undefined, {style: 'short', type: 'conjunction'})\n .format(unsupportedProperties),\n });\n break;\n case CLSInsight.AnimationFailureReasons.MIXED_KEYFRAME_VALUE_TYPES:\n str = i18nString(UIStrings.compositingFailedMixedKeyframeValueTypes);\n break;\n case CLSInsight.AnimationFailureReasons.TIMELINE_SOURCE_HAS_INVALID_COMPOSITING_STATE:\n str = i18nString(UIStrings.compositingFailedTimelineSourceHasInvalidCompositingState);\n break;\n case CLSInsight.AnimationFailureReasons.ANIMATION_HAS_NO_VISIBLE_CHANGE:\n str = i18nString(UIStrings.compositingFailedAnimationHasNoVisibleChange);\n break;\n case CLSInsight.AnimationFailureReasons.AFFECTS_IMPORTANT_PROPERTY:\n str = i18nString(UIStrings.compositingFailedAffectsImportantProperty);\n break;\n case CLSInsight.AnimationFailureReasons.SVG_TARGET_HAS_INDEPENDENT_TRANSFORM_PROPERTY:\n str = i18nString(UIStrings.compositingFailedSVGTargetHasIndependentTransformProperty);\n break;\n default:\n // We should never actually end up here, as adding a new AnimationFailureReason\n // should also require adding a UIString that describes it\n str = i18nString(UIStrings.compositingFailedUnknownReason);\n break;\n }\n str && contentHelper.appendElementRow(i18nString(UIStrings.compositingFailed), str, true);\n }\n }\n\n break;\n }\n\n case Trace.Types.Events.Name.PARSE_HTML: {\n const beginData = unsafeEventArgs['beginData'];\n const startLine = beginData['startLine'] - 1;\n const endLine = unsafeEventArgs['endData'] ? unsafeEventArgs['endData']['endLine'] - 1 : undefined;\n url = beginData['url'];\n if (url) {\n contentHelper.appendLocationRange(i18nString(UIStrings.range), url, startLine, endLine);\n }\n break;\n }\n\n // @ts-ignore Fall-through intended.\n case Trace.Types.Events.Name.FIRE_IDLE_CALLBACK: {\n contentHelper.appendTextRow(\n i18nString(UIStrings.allottedTime),\n i18n.TimeUtilities.millisToString(unsafeEventData['allottedMilliseconds']));\n contentHelper.appendTextRow(i18nString(UIStrings.invokedByTimeout), unsafeEventData['timedOut']);\n }\n\n case Trace.Types.Events.Name.REQUEST_IDLE_CALLBACK:\n case Trace.Types.Events.Name.CANCEL_IDLE_CALLBACK: {\n contentHelper.appendTextRow(i18nString(UIStrings.callbackId), unsafeEventData['id']);\n break;\n }\n\n case Trace.Types.Events.Name.EVENT_DISPATCH: {\n contentHelper.appendTextRow(i18nString(UIStrings.type), unsafeEventData['type']);\n break;\n }\n\n // @ts-ignore Fall-through intended.\n case Trace.Types.Events.Name.MARK_LCP_CANDIDATE: {\n contentHelper.appendTextRow(i18nString(UIStrings.type), String(unsafeEventData['type']));\n contentHelper.appendTextRow(i18nString(UIStrings.size), String(unsafeEventData['size']));\n }\n\n case Trace.Types.Events.Name.MARK_FIRST_PAINT:\n case Trace.Types.Events.Name.MARK_FCP:\n case Trace.Types.Events.Name.MARK_LOAD:\n case Trace.Types.Events.Name.MARK_DOM_CONTENT: {\n const adjustedEventTimeStamp = timeStampForEventAdjustedForClosestNavigationIfPossible(\n event,\n parsedTrace,\n );\n\n contentHelper.appendTextRow(\n i18nString(UIStrings.timestamp), i18n.TimeUtilities.preciseMillisToString(adjustedEventTimeStamp, 1));\n\n if (Trace.Types.Events.isMarkerEvent(event)) {\n contentHelper.appendElementRow(\n i18nString(UIStrings.details), TimelineUIUtils.buildDetailsNodeForMarkerEvents(event));\n }\n\n break;\n }\n\n case Trace.Types.Events.Name.EVENT_TIMING: {\n const detailsNode = await TimelineUIUtils.buildDetailsNodeForTraceEvent(\n event, targetForEvent(parsedTrace, event), linkifier, isFreshRecording, parsedTrace);\n if (detailsNode) {\n contentHelper.appendElementRow(i18nString(UIStrings.details), detailsNode);\n }\n if (Trace.Types.Events.isSyntheticInteraction(event)) {\n const inputDelay = i18n.TimeUtilities.formatMicroSecondsAsMillisFixed(event.inputDelay);\n const mainThreadTime = i18n.TimeUtilities.formatMicroSecondsAsMillisFixed(event.mainThreadHandling);\n const presentationDelay = i18n.TimeUtilities.formatMicroSecondsAsMillisFixed(event.presentationDelay);\n contentHelper.appendTextRow(i18nString(UIStrings.interactionID), event.interactionId);\n contentHelper.appendTextRow(i18nString(UIStrings.inputDelay), inputDelay);\n contentHelper.appendTextRow(i18nString(UIStrings.processingDuration), mainThreadTime);\n contentHelper.appendTextRow(i18nString(UIStrings.presentationDelay), presentationDelay);\n }\n break;\n }\n\n case Trace.Types.Events.Name.LAYOUT_SHIFT: {\n if (!Trace.Types.Events.isSyntheticLayoutShift(event)) {\n console.error('Unexpected type for LayoutShift event');\n break;\n }\n const layoutShift = event as Trace.Types.Events.SyntheticLayoutShift;\n const layoutShiftEventData = layoutShift.args.data;\n const warning = document.createElement('span');\n const clsLink = UI.XLink.XLink.create(\n 'https://web.dev/cls/', i18nString(UIStrings.cumulativeLayoutShifts), undefined, undefined,\n 'cumulative-layout-shifts');\n const evolvedClsLink = UI.XLink.XLink.create(\n 'https://web.dev/evolving-cls/', i18nString(UIStrings.evolvedClsLink), undefined, undefined, 'evolved-cls');\n\n warning.appendChild(\n i18n.i18n.getFormatLocalizedString(str_, UIStrings.sCLSInformation, {PH1: clsLink, PH2: evolvedClsLink}));\n contentHelper.appendElementRow(i18nString(UIStrings.warning), warning, true);\n if (!layoutShiftEventData) {\n break;\n }\n contentHelper.appendTextRow(\n i18nString(UIStrings.score), layoutShiftEventData.weighted_score_delta.toPrecision(4));\n contentHelper.appendTextRow(\n i18nString(UIStrings.cumulativeScore), layoutShiftEventData['cumulative_score'].toPrecision(4));\n contentHelper.appendTextRow(\n i18nString(UIStrings.currentClusterId), layoutShift.parsedData.sessionWindowData.id);\n contentHelper.appendTextRow(\n i18nString(UIStrings.currentClusterScore),\n layoutShift.parsedData.sessionWindowData.cumulativeWindowScore.toPrecision(4));\n contentHelper.appendTextRow(\n i18nString(UIStrings.hadRecentInput),\n unsafeEventData['had_recent_input'] ? i18nString(UIStrings.yes) : i18nString(UIStrings.no));\n\n for (const impactedNode of unsafeEventData['impacted_nodes']) {\n const oldRect = new CLSRect(impactedNode['old_rect']);\n const newRect = new CLSRect(impactedNode['new_rect']);\n\n const linkedOldRect = await Common.Linkifier.Linkifier.linkify(oldRect);\n const linkedNewRect = await Common.Linkifier.Linkifier.linkify(newRect);\n\n contentHelper.appendElementRow(i18nString(UIStrings.movedFrom), linkedOldRect);\n contentHelper.appendElementRow(i18nString(UIStrings.movedTo), linkedNewRect);\n }\n\n break;\n }\n\n default: {\n const detailsNode = await TimelineUIUtils.buildDetailsNodeForTraceEvent(\n event, targetForEvent(parsedTrace, event), linkifier, isFreshRecording, parsedTrace);\n if (detailsNode) {\n contentHelper.appendElementRow(i18nString(UIStrings.details), detailsNode);\n }\n break;\n }\n }\n const relatedNodes = relatedNodesMap?.values() || [];\n for (const relatedNode of relatedNodes) {\n if (relatedNode) {\n const nodeSpan = await Common.Linkifier.Linkifier.linkify(relatedNode);\n contentHelper.appendElementRow(relatedNodeLabel || i18nString(UIStrings.relatedNode), nodeSpan);\n }\n }\n\n // @ts-ignore TODO(crbug.com/1011811): Remove symbol usage.\n if (event[previewElementSymbol]) {\n contentHelper.addSection(i18nString(UIStrings.preview));\n // @ts-ignore TODO(crbug.com/1011811): Remove symbol usage.\n contentHelper.appendElementRow('', event[previewElementSymbol]);\n }\n\n const stackTrace = Trace.Helpers.Trace.getZeroIndexedStackTraceForEvent(event);\n if (Trace.Types.Events.isProfileCall(event) || initiator || initiatorFor || stackTrace ||\n parsedTrace?.Invalidations.invalidationsForEvent.get(event)) {\n await TimelineUIUtils.generateCauses(event, contentHelper, parsedTrace);\n }\n\n if (Root.Runtime.experiments.isEnabled(Root.Runtime.ExperimentName.TIMELINE_DEBUG_MODE)) {\n TimelineUIUtils.renderEventJson(event, contentHelper);\n }\n\n const stats: {\n [x: string]: number,\n } = {};\n const showPieChart =\n detailed && parsedTrace && TimelineUIUtils.aggregatedStatsForTraceEvent(stats, parsedTrace, event);\n if (showPieChart) {\n contentHelper.addSection(i18nString(UIStrings.aggregatedTime));\n const pieChart = TimelineUIUtils.generatePieChart(stats, TimelineUIUtils.eventStyle(event).category, selfTime);\n contentHelper.appendElementRow('', pieChart);\n }\n\n return contentHelper.fragment;\n }\n\n static statsForTimeRange(\n events: Trace.Types.Events.Event[], startTime: Trace.Types.Timing.MilliSeconds,\n endTime: Trace.Types.Timing.MilliSeconds): {\n [x: string]: number,\n } {\n if (!events.length) {\n return {idle: endTime - startTime};\n }\n\n buildRangeStatsCacheIfNeeded(events);\n const aggregatedStats = subtractStats(aggregatedStatsAtTime(endTime), aggregatedStatsAtTime(startTime));\n const aggregatedTotal = Object.values(aggregatedStats).reduce((a, b) => a + b, 0);\n aggregatedStats['idle'] = Math.max(0, endTime - startTime - aggregatedTotal);\n return aggregatedStats;\n\n function aggregatedStatsAtTime(time: number): {\n [x: string]: number,\n } {\n const stats: {\n [x: string]: number,\n } = {};\n // @ts-ignore TODO(crbug.com/1011811): Remove symbol usage.\n const cache = events[categoryBreakdownCacheSymbol];\n for (const category in cache) {\n const categoryCache = cache[category];\n const index =\n Platform.ArrayUtilities.upperBound(categoryCache.time, time, Platform.ArrayUtilities.DEFAULT_COMPARATOR);\n let value;\n if (index === 0) {\n value = 0;\n } else if (index === categoryCache.time.length) {\n value = categoryCache.value[categoryCache.value.length - 1];\n } else {\n const t0 = categoryCache.time[index - 1];\n const t1 = categoryCache.time[index];\n const v0 = categoryCache.value[index - 1];\n const v1 = categoryCache.value[index];\n value = v0 + (v1 - v0) * (time - t0) / (t1 - t0);\n }\n stats[category] = value;\n }\n return stats;\n }\n\n function subtractStats(\n a: {\n [x: string]: number,\n },\n b: {\n [x: string]: number,\n }): {\n [x: string]: number,\n } {\n const result = Object.assign({}, a);\n for (const key in b) {\n result[key] -= b[key];\n }\n return result;\n }\n\n function buildRangeStatsCacheIfNeeded(events: Trace.Types.Events.Event[]): void {\n // @ts-ignore TODO(crbug.com/1011811): Remove symbol usage.\n if (events[categoryBreakdownCacheSymbol]) {\n return;\n }\n\n // aggeregatedStats is a map by categories. For each category there's an array\n // containing sorted time points which records accumulated value of the category.\n const aggregatedStats: {\n [x: string]: {\n time: number[],\n value: number[],\n },\n } = {};\n const categoryStack: string[] = [];\n let lastTime = 0;\n Trace.Helpers.Trace.forEachEvent(events, {\n onStartEvent,\n onEndEvent,\n });\n\n function updateCategory(category: string, time: number): void {\n let statsArrays: {\n time: number[],\n value: number[],\n } = aggregatedStats[category];\n if (!statsArrays) {\n statsArrays = {time: [], value: []};\n aggregatedStats[category] = statsArrays;\n }\n if (statsArrays.time.length && statsArrays.time[statsArrays.time.length - 1] === time || lastTime > time) {\n return;\n }\n const lastValue = statsArrays.value.length > 0 ? statsArrays.value[statsArrays.value.length - 1] : 0;\n statsArrays.value.push(lastValue + time - lastTime);\n statsArrays.time.push(time);\n }\n\n function categoryChange(from: string|null, to: string|null, time: number): void {\n if (from) {\n updateCategory(from, time);\n }\n lastTime = time;\n if (to) {\n updateCategory(to, time);\n }\n }\n\n function onStartEvent(e: Trace.Types.Events.Event): void {\n const {startTime} = Trace.Helpers.Timing.eventTimingsMilliSeconds(e);\n const category = Utils.EntryStyles.getEventStyle(e.name as Trace.Types.Events.Name)?.category.name ||\n Utils.EntryStyles.getCategoryStyles().other.name;\n const parentCategory = categoryStack.length ? categoryStack[categoryStack.length - 1] : null;\n if (category !== parentCategory) {\n categoryChange(parentCategory || null, category, startTime);\n }\n categoryStack.push(category);\n }\n\n function onEndEvent(e: Trace.Types.Events.Event): void {\n const {endTime} = Trace.Helpers.Timing.eventTimingsMilliSeconds(e);\n const category = categoryStack.pop();\n const parentCategory = categoryStack.length ? categoryStack[categoryStack.length - 1] : null;\n if (category !== parentCategory) {\n categoryChange(category || null, parentCategory || null, endTime || 0);\n }\n }\n\n const obj = (events as Object);\n // @ts-ignore TODO(crbug.com/1011811): Remove symbol usage.\n obj[categoryBreakdownCacheSymbol] = aggregatedStats;\n }\n }\n\n private static renderEventJson(event: Trace.Types.Events.Event, contentHelper: TimelineDetailsContentHelper): void {\n contentHelper.addSection(i18nString(UIStrings.traceEvent));\n\n const eventWithArgsFirst = {\n ...{args: event.args},\n ...event,\n };\n const highlightContainer = TimelineUIUtils.renderObjectJson(eventWithArgsFirst);\n contentHelper.appendElementRow('', highlightContainer);\n }\n\n private static renderObjectJson(obj: Object): HTMLDivElement {\n const indentLength = Common.Settings.Settings.instance().moduleSetting('text-editor-indent').get().length;\n // Elide if the data is huge. Then remove the initial new-line for a denser UI\n const eventStr = JSON.stringify(obj, null, indentLength).slice(0, 10_000).replace(/{\\n /, '{ ');\n\n // Use CodeHighlighter for syntax highlighting.\n const highlightContainer = document.createElement('div');\n const shadowRoot =\n UI.UIUtils.createShadowRootWithCoreStyles(highlightContainer, {cssFile: [codeHighlighterStyles]});\n const elem = shadowRoot.createChild('div');\n elem.classList.add('monospace', 'source-code');\n elem.textContent = eventStr;\n void CodeHighlighter.CodeHighlighter.highlightNode(elem, 'text/javascript');\n return highlightContainer;\n }\n\n static stackTraceFromCallFrames(callFrames: Protocol.Runtime.CallFrame[]|\n Trace.Types.Events.CallFrame[]): Protocol.Runtime.StackTrace {\n return {callFrames} as Protocol.Runtime.StackTrace;\n }\n\n static async generateCauses(\n event: Trace.Types.Events.Event, contentHelper: TimelineDetailsContentHelper,\n parsedTrace: Trace.Handlers.Types.ParsedTrace): Promise {\n const {startTime} = Trace.Helpers.Timing.eventTimingsMilliSeconds(event);\n let initiatorStackLabel = i18nString(UIStrings.initiatorStackTrace);\n let stackLabel = i18nString(UIStrings.stackTrace);\n const stackTraceForEvent = Trace.Extras.StackTraceForEvent.get(event, parsedTrace);\n if (stackTraceForEvent) {\n contentHelper.addSection(i18nString(UIStrings.stackTrace));\n contentHelper.createChildStackTraceElement(stackTraceForEvent);\n // TODO(andoli): also build stack trace component for other events\n // that have a stack trace using the StackTraceForEvent helper.\n } else {\n const stackTrace = Trace.Helpers.Trace.getZeroIndexedStackTraceForEvent(event);\n if (stackTrace && stackTrace.length) {\n contentHelper.addSection(stackLabel);\n contentHelper.createChildStackTraceElement(TimelineUIUtils.stackTraceFromCallFrames(stackTrace));\n }\n }\n switch (event.name) {\n case Trace.Types.Events.Name.TIMER_FIRE:\n initiatorStackLabel = i18nString(UIStrings.timerInstalled);\n break;\n case Trace.Types.Events.Name.FIRE_ANIMATION_FRAME:\n initiatorStackLabel = i18nString(UIStrings.animationFrameRequested);\n break;\n case Trace.Types.Events.Name.FIRE_IDLE_CALLBACK:\n initiatorStackLabel = i18nString(UIStrings.idleCallbackRequested);\n break;\n case Trace.Types.Events.Name.UPDATE_LAYOUT_TREE:\n initiatorStackLabel = i18nString(UIStrings.firstInvalidated);\n stackLabel = i18nString(UIStrings.recalculationForced);\n break;\n case Trace.Types.Events.Name.LAYOUT:\n initiatorStackLabel = i18nString(UIStrings.firstLayoutInvalidation);\n stackLabel = i18nString(UIStrings.layoutForced);\n break;\n }\n\n const initiator = parsedTrace.Initiators.eventToInitiator.get(event);\n const initiatorFor = parsedTrace.Initiators.initiatorToEvents.get(event);\n const invalidations = parsedTrace.Invalidations.invalidationsForEvent.get(event);\n\n if (initiator) {\n // If we have an initiator for the event, we can show its stack trace, a link to reveal the initiator,\n // and the time since the initiator (Pending For).\n const stackTrace = Trace.Helpers.Trace.getZeroIndexedStackTraceForEvent(initiator);\n if (stackTrace) {\n contentHelper.addSection(initiatorStackLabel);\n contentHelper.createChildStackTraceElement(TimelineUIUtils.stackTraceFromCallFrames(stackTrace.map(frame => {\n return {\n ...frame,\n scriptId: String(frame.scriptId) as Protocol.Runtime.ScriptId,\n };\n })));\n }\n\n const link = this.createEntryLink(initiator);\n contentHelper.appendElementRow(i18nString(UIStrings.initiatedBy), link);\n\n const {startTime: initiatorStartTime} = Trace.Helpers.Timing.eventTimingsMilliSeconds(initiator);\n const delay = startTime - initiatorStartTime;\n contentHelper.appendTextRow(i18nString(UIStrings.pendingFor), i18n.TimeUtilities.preciseMillisToString(delay, 1));\n }\n\n if (initiatorFor) {\n // If the event is an initiator for some entries, add links to reveal them.\n const links = document.createElement('div');\n initiatorFor.map((initiator, i) => {\n links.appendChild(this.createEntryLink(initiator));\n // Add space between each link if it's not last\n if (i < initiatorFor.length - 1) {\n links.append(' ');\n }\n });\n contentHelper.appendElementRow(UIStrings.initiatorFor, links);\n }\n\n if (invalidations && invalidations.length) {\n const totalInvalidations = parsedTrace.Invalidations.invalidationCountForEvent.get(event) ??\n 0; // Won't be 0, but saves us dealing with undefined.\n contentHelper.addSection(i18nString(UIStrings.invalidations, {PH1: totalInvalidations}));\n await TimelineUIUtils.generateInvalidationsList(invalidations, contentHelper);\n }\n }\n\n private static createEntryLink(entry: Trace.Types.Events.Event): HTMLElement {\n const link = document.createElement('span');\n\n const traceBoundsState = TraceBounds.TraceBounds.BoundsManager.instance().state();\n\n if (!traceBoundsState) {\n console.error('Tried to link to an entry without any traceBoundsState. This should never happen.');\n return link;\n }\n\n // Check is the entry is outside of the current breadcrumb. If it is, don't create a link to navigate to it because there is no way to navigate outside breadcrumb without removing it. Instead, just display the name and \"outside breadcrumb\" text\n // Consider entry outside breadcrumb only if it is fully outside. If a part of it is visible, we can still select it.\n const isEntryOutsideBreadcrumb = traceBoundsState.micro.minimapTraceBounds.min > entry.ts + (entry.dur || 0) ||\n traceBoundsState.micro.minimapTraceBounds.max < entry.ts;\n\n // Check if it is in the hidden array\n const isEntryHidden = ModificationsManager.activeManager()?.getEntriesFilter().entryIsInvisible(entry);\n\n if (!isEntryOutsideBreadcrumb) {\n link.classList.add('timeline-link');\n UI.ARIAUtils.markAsLink(link);\n link.tabIndex = 0;\n link.addEventListener('click', () => {\n TimelinePanel.instance().select(selectionFromEvent(entry));\n });\n\n link.addEventListener('keydown', event => {\n if (event.key === Platform.KeyboardUtilities.ENTER_KEY) {\n TimelinePanel.instance().select(selectionFromEvent(entry));\n event.consume(true);\n }\n });\n }\n\n if (isEntryHidden) {\n link.textContent = this.eventTitle(entry) + ' ' + i18nString(UIStrings.entryIsHidden);\n } else if (isEntryOutsideBreadcrumb) {\n link.textContent = this.eventTitle(entry) + ' ' + i18nString(UIStrings.outsideBreadcrumbRange);\n } else {\n link.textContent = this.eventTitle(entry);\n }\n\n return link;\n }\n\n private static async generateInvalidationsList(\n invalidations: Trace.Types.Events.InvalidationTrackingEvent[],\n contentHelper: TimelineDetailsContentHelper): Promise {\n const {groupedByReason, backendNodeIds} = TimelineComponents.DetailsView.generateInvalidationsList(invalidations);\n\n let relatedNodesMap: Map|null = null;\n const target = SDK.TargetManager.TargetManager.instance().primaryPageTarget();\n const domModel = target?.model(SDK.DOMModel.DOMModel);\n if (domModel) {\n relatedNodesMap = await domModel.pushNodesByBackendIdsToFrontend(backendNodeIds);\n }\n\n Object.keys(groupedByReason).forEach(reason => {\n TimelineUIUtils.generateInvalidationsForReason(reason, groupedByReason[reason], relatedNodesMap, contentHelper);\n });\n }\n\n private static generateInvalidationsForReason(\n reason: string, invalidations: Trace.Types.Events.InvalidationTrackingEvent[],\n relatedNodesMap: Map|null, contentHelper: TimelineDetailsContentHelper): void {\n function createLinkForInvalidationNode(invalidation: Trace.Types.Events.InvalidationTrackingEvent):\n HTMLSpanElement {\n const node = (invalidation.args.data.nodeId && relatedNodesMap) ?\n relatedNodesMap.get(invalidation.args.data.nodeId) :\n null;\n if (node) {\n const nodeSpan = document.createElement('span');\n void Common.Linkifier.Linkifier.linkify(node).then(link => nodeSpan.appendChild(link));\n return nodeSpan;\n }\n if (invalidation.args.data.nodeName) {\n const nodeSpan = document.createElement('span');\n nodeSpan.textContent = invalidation.args.data.nodeName;\n return nodeSpan;\n }\n const nodeSpan = document.createElement('span');\n UI.UIUtils.createTextChild(nodeSpan, i18nString(UIStrings.UnknownNode));\n return nodeSpan;\n }\n\n const generatedItems = new Set();\n\n for (const invalidation of invalidations) {\n const stackTrace = Trace.Helpers.Trace.getZeroIndexedStackTraceForEvent(invalidation);\n let scriptLink: HTMLElement|null = null;\n const callFrame = stackTrace?.at(0);\n if (callFrame) {\n scriptLink = contentHelper.linkifier()?.maybeLinkifyScriptLocation(\n SDK.TargetManager.TargetManager.instance().rootTarget(),\n callFrame.scriptId as Protocol.Runtime.ScriptId,\n callFrame.url as Platform.DevToolsPath.UrlString,\n callFrame.lineNumber,\n ) ||\n null;\n }\n\n const niceNodeLink = createLinkForInvalidationNode(invalidation);\n\n const text = scriptLink ?\n i18n.i18n.getFormatLocalizedString(\n str_, UIStrings.invalidationWithCallFrame, {PH1: niceNodeLink, PH2: scriptLink}) as HTMLElement :\n niceNodeLink;\n\n // Sometimes we can get different Invalidation events which cause\n // the same text for the same element for the same reason to be\n // generated. Rather than show the user duplicates, if we have\n // generated text that looks identical to this before, we will\n // bail.\n const generatedText: string = (typeof text === 'string' ? text : text.innerText);\n if (generatedItems.has(generatedText)) {\n continue;\n }\n\n generatedItems.add(generatedText);\n contentHelper.appendElementRow(reason, text);\n }\n }\n\n private static aggregatedStatsForTraceEvent(\n total: {\n [x: string]: number,\n },\n parsedTrace: Trace.Handlers.Types.ParsedTrace, event: Trace.Types.Events.Event): boolean {\n const events = parsedTrace.Renderer?.allTraceEntries || [];\n const {startTime, endTime} = Trace.Helpers.Timing.eventTimingsMilliSeconds(event);\n function eventComparator(startTime: number, e: Trace.Types.Events.Event): number {\n const {startTime: eventStartTime} = Trace.Helpers.Timing.eventTimingsMilliSeconds(e);\n return startTime - eventStartTime;\n }\n\n const index = Platform.ArrayUtilities.binaryIndexOf(events, startTime, eventComparator);\n // Not a main thread event?\n if (index < 0) {\n return false;\n }\n let hasChildren = false;\n if (endTime) {\n for (let i = index; i < events.length; i++) {\n const nextEvent = events[i];\n const {startTime: nextEventStartTime} = Trace.Helpers.Timing.eventTimingsMilliSeconds(nextEvent);\n if (nextEventStartTime >= endTime) {\n break;\n }\n const nextEventSelfTime = getEventSelfTime(nextEvent, parsedTrace);\n if (!nextEventSelfTime) {\n continue;\n }\n if (nextEvent.tid !== event.tid) {\n continue;\n }\n if (i > index) {\n hasChildren = true;\n }\n const categoryName = TimelineUIUtils.eventStyle(nextEvent).category.name;\n total[categoryName] = (total[categoryName] || 0) + nextEventSelfTime;\n }\n }\n if (Trace.Types.Events.isPhaseAsync(event.ph)) {\n if (endTime) {\n let aggregatedTotal = 0;\n for (const categoryName in total) {\n aggregatedTotal += total[categoryName];\n }\n total['idle'] = Math.max(0, endTime - startTime - aggregatedTotal);\n }\n return false;\n }\n return hasChildren;\n }\n\n static async buildPicturePreviewContent(\n parsedTrace: Trace.Handlers.Types.ParsedTrace, event: Trace.Types.Events.Paint,\n target: SDK.Target.Target): Promise {\n const snapshotEvent = parsedTrace.LayerTree.paintsToSnapshots.get(event);\n if (!snapshotEvent) {\n return null;\n }\n\n const paintProfilerModel = target.model(SDK.PaintProfiler.PaintProfilerModel);\n if (!paintProfilerModel) {\n return null;\n }\n const snapshot = await paintProfilerModel.loadSnapshot(snapshotEvent.args.snapshot.skp64);\n if (!snapshot) {\n return null;\n }\n\n const snapshotWithRect = {\n snapshot,\n rect: snapshotEvent.args.snapshot.params?.layer_rect,\n };\n\n if (!snapshotWithRect) {\n return null;\n }\n const imageURLPromise = snapshotWithRect.snapshot.replay();\n snapshotWithRect.snapshot.release();\n const imageURL = await imageURLPromise as Platform.DevToolsPath.UrlString;\n if (!imageURL) {\n return null;\n }\n const stylesContainer = document.createElement('div');\n const shadowRoot = stylesContainer.attachShadow({mode: 'open'});\n shadowRoot.adoptedStyleSheets = [imagePreviewStyles];\n const container = shadowRoot.createChild('div');\n container.classList.add('image-preview-container', 'vbox', 'link');\n const img = container.createChild('img');\n img.src = imageURL;\n img.alt = LegacyComponents.ImagePreview.ImagePreview.defaultAltTextForImageURL(imageURL);\n const paintProfilerButton = container.createChild('a');\n paintProfilerButton.textContent = i18nString(UIStrings.paintProfiler);\n UI.ARIAUtils.markAsLink(container);\n container.tabIndex = 0;\n container.addEventListener('click', () => TimelinePanel.instance().select(selectionFromEvent(event)), false);\n container.addEventListener('keydown', keyEvent => {\n if (keyEvent.key === Platform.KeyboardUtilities.ENTER_KEY) {\n TimelinePanel.instance().select(selectionFromEvent(event));\n keyEvent.consume(true);\n }\n });\n return stylesContainer;\n }\n\n static createEventDivider(event: Trace.Types.Events.Event, zeroTime: number): HTMLDivElement {\n const eventDivider = document.createElement('div');\n eventDivider.classList.add('resources-event-divider');\n const {startTime: eventStartTime} = Trace.Helpers.Timing.eventTimingsMilliSeconds(event);\n\n const startTime = i18n.TimeUtilities.millisToString(eventStartTime - zeroTime);\n UI.Tooltip.Tooltip.install(\n eventDivider, i18nString(UIStrings.sAtS, {PH1: TimelineUIUtils.eventTitle(event), PH2: startTime}));\n const style = TimelineUIUtils.markerStyleForEvent(event);\n if (style.tall) {\n eventDivider.style.backgroundColor = style.color;\n }\n return eventDivider;\n }\n\n static visibleEventsFilter(): Trace.Extras.TraceFilter.TraceFilter {\n return new Trace.Extras.TraceFilter.VisibleEventsFilter(Utils.EntryStyles.visibleTypes());\n }\n\n // Included only for layout tests.\n // TODO(crbug.com/1386091): Fix/port layout tests and remove.\n static categories(): Utils.EntryStyles.CategoryPalette {\n return Utils.EntryStyles.getCategoryStyles();\n }\n\n static generatePieChart(\n aggregatedStats: {\n [x: string]: number,\n },\n selfCategory?: Utils.EntryStyles.TimelineCategory, selfTime?: number): Element {\n let total = 0;\n for (const categoryName in aggregatedStats) {\n total += aggregatedStats[categoryName];\n }\n\n const element = document.createElement('div');\n element.classList.add('timeline-details-view-pie-chart-wrapper');\n element.classList.add('hbox');\n\n const pieChart = new PerfUI.PieChart.PieChart();\n const slices: {\n value: number,\n color: string,\n title: string,\n }[] = [];\n\n function appendLegendRow(name: string, title: string, value: number, color: string): void {\n if (!value) {\n return;\n }\n slices.push({value, color, title});\n }\n\n // In case of self time, first add self, then children of the same category.\n if (selfCategory) {\n if (selfTime) {\n appendLegendRow(\n selfCategory.name, i18nString(UIStrings.sSelf, {PH1: selfCategory.title}), selfTime,\n selfCategory.getCSSValue());\n }\n // Children of the same category.\n const categoryTime = aggregatedStats[selfCategory.name];\n const value = categoryTime - (selfTime || 0);\n if (value > 0) {\n appendLegendRow(\n selfCategory.name, i18nString(UIStrings.sChildren, {PH1: selfCategory.title}), value,\n selfCategory.getCSSValue());\n }\n }\n\n // Add other categories.\n for (const categoryName in Utils.EntryStyles.getCategoryStyles()) {\n const category = Utils.EntryStyles.getCategoryStyles()[categoryName as keyof Utils.EntryStyles.CategoryPalette];\n if (categoryName === selfCategory?.name) {\n // Do not add an entry for this event's self category because 2\n // entries for it where added just before this for loop (for\n // self and children times).\n continue;\n }\n appendLegendRow(category.name, category.title, aggregatedStats[category.name], category.getCSSValue());\n }\n\n pieChart.data = {\n chartName: i18nString(UIStrings.timeSpentInRendering),\n size: 110,\n formatter: (value: number) => i18n.TimeUtilities.preciseMillisToString(value),\n showLegend: true,\n total,\n slices,\n };\n const pieChartContainer = element.createChild('div', 'vbox');\n pieChartContainer.appendChild(pieChart);\n\n return element;\n }\n // Generates a Summary component given a aggregated stats for categories.\n static generateSummaryDetails(aggregatedStats: Record, rangeStart: number, rangeEnd: number):\n Element {\n let total = 0;\n // Calculate total of all categories.\n for (const categoryName in aggregatedStats) {\n total += aggregatedStats[categoryName];\n }\n\n const element = document.createElement('div');\n element.classList.add('timeline-details-view-summary');\n\n const summaryTable = new TimelineComponents.TimelineSummary.TimelineSummary();\n let categories: TimelineComponents.TimelineSummary.CategoryData[] = [];\n\n // Get stats values from categories.\n for (const categoryName in Utils.EntryStyles.getCategoryStyles()) {\n const category = Utils.EntryStyles.getCategoryStyles()[categoryName as keyof Utils.EntryStyles.CategoryPalette];\n if (category.name === Utils.EntryStyles.EventCategory.IDLE) {\n continue;\n }\n const value = aggregatedStats[category.name];\n if (!value) {\n continue;\n }\n const title = category.title;\n const color = category.getCSSValue();\n categories.push({value, color, title});\n }\n\n // Keeps the most useful categories on top.\n categories = categories.sort((a, b) => b.value - a.value);\n const start = Trace.Types.Timing.MilliSeconds(rangeStart);\n const end = Trace.Types.Timing.MilliSeconds(rangeEnd);\n summaryTable.data = {\n rangeStart: start,\n rangeEnd: end,\n total,\n categories,\n };\n const summaryTableContainer = element.createChild('div');\n summaryTableContainer.appendChild(summaryTable);\n return element;\n }\n\n static generateDetailsContentForFrame(\n frame: Trace.Types.Events.LegacyTimelineFrame, filmStrip: Trace.Extras.FilmStrip.Data|null,\n filmStripFrame: Trace.Extras.FilmStrip.Frame|null): DocumentFragment {\n const contentHelper = new TimelineDetailsContentHelper(null, null);\n contentHelper.addSection(i18nString(UIStrings.frame));\n\n const duration = TimelineUIUtils.frameDuration(frame);\n contentHelper.appendElementRow(i18nString(UIStrings.duration), duration);\n if (filmStrip && filmStripFrame) {\n const filmStripPreview = document.createElement('div');\n filmStripPreview.classList.add('timeline-filmstrip-preview');\n // TODO(paulirish): Adopt Util.ImageCache\n void UI.UIUtils.loadImage(filmStripFrame.screenshotEvent.args.dataUri)\n .then(image => image && filmStripPreview.appendChild(image));\n contentHelper.appendElementRow('', filmStripPreview);\n filmStripPreview.addEventListener('click', frameClicked.bind(null, filmStrip, filmStripFrame), false);\n }\n\n function frameClicked(filmStrip: Trace.Extras.FilmStrip.Data, filmStripFrame: Trace.Extras.FilmStrip.Frame): void {\n PerfUI.FilmStripView.Dialog.fromFilmStrip(filmStrip, filmStripFrame.index);\n }\n\n return contentHelper.fragment;\n }\n\n static frameDuration(frame: Trace.Types.Events.LegacyTimelineFrame): Element {\n const offsetMilli = Trace.Helpers.Timing.microSecondsToMilliseconds(frame.startTimeOffset);\n const durationMilli = Trace.Helpers.Timing.microSecondsToMilliseconds(\n Trace.Types.Timing.MicroSeconds(frame.endTime - frame.startTime));\n\n const durationText = i18nString(UIStrings.sAtSParentheses, {\n PH1: i18n.TimeUtilities.millisToString(durationMilli, true),\n PH2: i18n.TimeUtilities.millisToString(offsetMilli, true),\n });\n return i18n.i18n.getFormatLocalizedString(str_, UIStrings.emptyPlaceholder, {PH1: durationText});\n }\n\n static quadWidth(quad: number[]): number {\n return Math.round(Math.sqrt(Math.pow(quad[0] - quad[2], 2) + Math.pow(quad[1] - quad[3], 2)));\n }\n\n static quadHeight(quad: number[]): number {\n return Math.round(Math.sqrt(Math.pow(quad[0] - quad[6], 2) + Math.pow(quad[1] - quad[7], 2)));\n }\n\n static eventDispatchDesciptors(): EventDispatchTypeDescriptor[] {\n if (eventDispatchDesciptors) {\n return eventDispatchDesciptors;\n }\n const lightOrange = 'hsl(40,100%,80%)';\n const orange = 'hsl(40,100%,50%)';\n const green = 'hsl(90,100%,40%)';\n const purple = 'hsl(256,100%,75%)';\n eventDispatchDesciptors = [\n new EventDispatchTypeDescriptor(\n 1, lightOrange, ['mousemove', 'mouseenter', 'mouseleave', 'mouseout', 'mouseover']),\n new EventDispatchTypeDescriptor(\n 1, lightOrange, ['pointerover', 'pointerout', 'pointerenter', 'pointerleave', 'pointermove']),\n new EventDispatchTypeDescriptor(2, green, ['wheel']),\n new EventDispatchTypeDescriptor(3, orange, ['click', 'mousedown', 'mouseup']),\n new EventDispatchTypeDescriptor(3, orange, ['touchstart', 'touchend', 'touchmove', 'touchcancel']),\n new EventDispatchTypeDescriptor(\n 3, orange, ['pointerdown', 'pointerup', 'pointercancel', 'gotpointercapture', 'lostpointercapture']),\n new EventDispatchTypeDescriptor(3, purple, ['keydown', 'keyup', 'keypress']),\n ];\n return eventDispatchDesciptors;\n }\n\n static markerStyleForEvent(event: Trace.Types.Events.Event): TimelineMarkerStyle {\n // Note: keep the colors matching that of `markerDetailsForEvent`.\n\n const tallMarkerDashStyle = [6, 4];\n const title = TimelineUIUtils.eventTitle(event);\n\n if (event.name !== Trace.Types.Events.Name.NAVIGATION_START &&\n (Trace.Helpers.Trace.eventHasCategory(event, Trace.Types.Events.Categories.Console) ||\n Trace.Helpers.Trace.eventHasCategory(event, Trace.Types.Events.Categories.UserTiming))) {\n return {\n title,\n dashStyle: tallMarkerDashStyle,\n lineWidth: 0.5,\n color: Trace.Helpers.Trace.eventHasCategory(event, Trace.Types.Events.Categories.Console) ? 'purple' : 'orange',\n tall: false,\n lowPriority: false,\n };\n }\n let tall = false;\n let color = 'grey';\n switch (event.name) {\n case Trace.Types.Events.Name.NAVIGATION_START:\n color = 'var(--color-text-primary)';\n tall = true;\n break;\n case Trace.Types.Events.Name.FRAME_STARTED_LOADING:\n color = 'green';\n tall = true;\n break;\n case Trace.Types.Events.Name.MARK_DOM_CONTENT:\n color = 'var(--color-text-disabled)';\n tall = true;\n break;\n case Trace.Types.Events.Name.MARK_LOAD:\n color = 'var(--color-text-disabled)';\n tall = true;\n break;\n case Trace.Types.Events.Name.MARK_FIRST_PAINT:\n color = '#228847';\n tall = true;\n break;\n case Trace.Types.Events.Name.MARK_FCP:\n color = 'var(--sys-color-green-bright)';\n tall = true;\n break;\n case Trace.Types.Events.Name.MARK_LCP_CANDIDATE:\n color = 'var(--sys-color-green)';\n tall = true;\n break;\n case Trace.Types.Events.Name.TIME_STAMP:\n color = 'orange';\n break;\n }\n return {\n title,\n dashStyle: tallMarkerDashStyle,\n lineWidth: 0.5,\n color,\n tall,\n lowPriority: false,\n };\n }\n\n static colorForId(id: string): string {\n if (!colorGenerator) {\n colorGenerator =\n new Common.Color.Generator({min: 30, max: 330, count: undefined}, {min: 50, max: 80, count: 3}, 85);\n colorGenerator.setColorForID('', '#f2ecdc');\n }\n return colorGenerator.colorForID(id);\n }\n\n static displayNameForFrame(frame: Trace.Types.Events.TraceFrame, trimAt: number = 80): string {\n const url = frame.url as Platform.DevToolsPath.UrlString;\n return Common.ParsedURL.schemeIs(url, 'about:') ? `\"${Platform.StringUtilities.trimMiddle(frame.name, trimAt)}\"` :\n frame.url.slice(0, trimAt);\n }\n}\n\nexport const aggregatedStatsKey = Symbol('aggregatedStats');\n\nexport const previewElementSymbol = Symbol('previewElement');\n\nexport class EventDispatchTypeDescriptor {\n priority: number;\n color: string;\n eventTypes: string[];\n\n constructor(priority: number, color: string, eventTypes: string[]) {\n this.priority = priority;\n this.color = color;\n this.eventTypes = eventTypes;\n }\n}\n\nexport class TimelineDetailsContentHelper {\n fragment: DocumentFragment;\n private linkifierInternal: LegacyComponents.Linkifier.Linkifier|null;\n private target: SDK.Target.Target|null;\n element: HTMLDivElement;\n private tableElement: HTMLElement;\n\n constructor(target: SDK.Target.Target|null, linkifier: LegacyComponents.Linkifier.Linkifier|null) {\n this.fragment = document.createDocumentFragment();\n\n this.linkifierInternal = linkifier;\n this.target = target;\n\n this.element = document.createElement('div');\n this.element.classList.add('timeline-details-view-block');\n this.tableElement = this.element.createChild('div', 'vbox timeline-details-chip-body');\n this.fragment.appendChild(this.element);\n }\n\n addSection(title: string, swatchColor?: string): void {\n if (!this.tableElement.hasChildNodes()) {\n this.element.removeChildren();\n } else {\n this.element = document.createElement('div');\n this.element.classList.add('timeline-details-view-block');\n this.fragment.appendChild(this.element);\n }\n\n if (title) {\n const titleElement = this.element.createChild('div', 'timeline-details-chip-title');\n if (swatchColor) {\n titleElement.createChild('div').style.backgroundColor = swatchColor;\n }\n UI.UIUtils.createTextChild(titleElement, title);\n }\n\n this.tableElement = this.element.createChild('div', 'vbox timeline-details-chip-body');\n this.fragment.appendChild(this.element);\n }\n\n linkifier(): LegacyComponents.Linkifier.Linkifier|null {\n return this.linkifierInternal;\n }\n\n appendTextRow(title: string, value: string|number|boolean): void {\n const rowElement = this.tableElement.createChild('div', 'timeline-details-view-row');\n rowElement.createChild('div', 'timeline-details-view-row-title').textContent = title;\n rowElement.createChild('div', 'timeline-details-view-row-value').textContent = value.toString();\n }\n\n appendElementRow(title: string, content: string|Node, isWarning?: boolean, isStacked?: boolean): void {\n const rowElement = this.tableElement.createChild('div', 'timeline-details-view-row');\n rowElement.setAttribute('data-row-title', title);\n if (isWarning) {\n rowElement.classList.add('timeline-details-warning');\n }\n if (isStacked) {\n rowElement.classList.add('timeline-details-stack-values');\n }\n const titleElement = rowElement.createChild('div', 'timeline-details-view-row-title');\n titleElement.textContent = title;\n const valueElement = rowElement.createChild('div', 'timeline-details-view-row-value');\n if (content instanceof Node) {\n valueElement.appendChild(content);\n } else {\n UI.UIUtils.createTextChild(valueElement, content || '');\n }\n }\n\n appendLocationRow(title: string, url: string, startLine: number, startColumn?: number): void {\n if (!this.linkifierInternal) {\n return;\n }\n\n const options = {\n tabStop: true,\n columnNumber: startColumn,\n showColumnNumber: true,\n inlineFrameIndex: 0,\n };\n const link = this.linkifierInternal.maybeLinkifyScriptLocation(\n this.target, null, url as Platform.DevToolsPath.UrlString, startLine, options);\n if (!link) {\n return;\n }\n this.appendElementRow(title, link);\n }\n\n appendLocationRange(title: string, url: Platform.DevToolsPath.UrlString, startLine: number, endLine?: number): void {\n if (!this.linkifierInternal || !this.target) {\n return;\n }\n const locationContent = document.createElement('span');\n const link = this.linkifierInternal.maybeLinkifyScriptLocation(\n this.target, null, url, startLine, {tabStop: true, inlineFrameIndex: 0});\n if (!link) {\n return;\n }\n locationContent.appendChild(link);\n UI.UIUtils.createTextChild(\n locationContent, Platform.StringUtilities.sprintf(' [%s…%s]', startLine + 1, (endLine || 0) + 1 || ''));\n this.appendElementRow(title, locationContent);\n }\n\n createChildStackTraceElement(stackTrace: Protocol.Runtime.StackTrace): void {\n if (!this.linkifierInternal) {\n return;\n }\n const resolvedStackTrace: Protocol.Runtime.StackTrace = structuredClone(stackTrace);\n let currentResolvedStackTrace: Protocol.Runtime.StackTrace|undefined = resolvedStackTrace;\n while (currentResolvedStackTrace) {\n currentResolvedStackTrace.callFrames = currentResolvedStackTrace.callFrames.map(\n callFrame => ({\n ...callFrame,\n functionName:\n Utils.SourceMapsResolver.SourceMapsResolver.resolvedCodeLocationForCallFrame(callFrame)?.name ||\n callFrame.functionName,\n }));\n currentResolvedStackTrace = currentResolvedStackTrace.parent;\n }\n const stackTraceElement =\n this.tableElement.createChild('div', 'timeline-details-view-row timeline-details-stack-values');\n const callFrameContents = LegacyComponents.JSPresentationUtils.buildStackTracePreviewContents(\n this.target, this.linkifierInternal, {stackTrace: resolvedStackTrace, tabStops: true, showColumnNumber: true});\n stackTraceElement.appendChild(callFrameContents.element);\n }\n}\n\nexport const categoryBreakdownCacheSymbol = Symbol('categoryBreakdownCache');\nexport interface TimelineMarkerStyle {\n title: string;\n color: string;\n lineWidth: number;\n dashStyle: number[];\n tall: boolean;\n lowPriority: boolean;\n}\n\n/**\n * Given a particular event, this method can adjust its timestamp by\n * substracting the timestamp of the previous navigation. This helps in cases\n * where the user has navigated multiple times in the trace, so that we can show\n * the LCP (for example) relative to the last navigation.\n **/\nexport function timeStampForEventAdjustedForClosestNavigationIfPossible(\n event: Trace.Types.Events.Event,\n parsedTrace: Trace.Handlers.Types.ParsedTrace|null): Trace.Types.Timing.MilliSeconds {\n if (!parsedTrace) {\n const {startTime} = Trace.Helpers.Timing.eventTimingsMilliSeconds(event);\n return startTime;\n }\n\n const time = Trace.Helpers.Timing.timeStampForEventAdjustedByClosestNavigation(\n event,\n parsedTrace.Meta.traceBounds,\n parsedTrace.Meta.navigationsByNavigationId,\n parsedTrace.Meta.navigationsByFrameId,\n );\n return Trace.Helpers.Timing.microSecondsToMilliseconds(time);\n}\n\n/**\n * Determines if an event is potentially a marker event. A marker event here\n * is a single moment in time that we want to highlight on the timeline, such as\n * the LCP time. This method does not filter out events: for example, it treats\n * every LCP Candidate event as a potential marker event.\n **/\nexport function isMarkerEvent(parsedTrace: Trace.Handlers.Types.ParsedTrace, event: Trace.Types.Events.Event): boolean {\n const {Name} = Trace.Types.Events;\n\n if (event.name === Name.TIME_STAMP || event.name === Name.NAVIGATION_START) {\n return true;\n }\n\n if (Trace.Types.Events.isFirstContentfulPaint(event) || Trace.Types.Events.isFirstPaint(event)) {\n return event.args.frame === parsedTrace.Meta.mainFrameId;\n }\n\n if (Trace.Types.Events.isMarkDOMContent(event) || Trace.Types.Events.isMarkLoad(event) ||\n Trace.Types.Events.isLargestContentfulPaintCandidate(event)) {\n // isOutermostMainFrame was added in 2022, so we fallback to isMainFrame\n // for older traces.\n if (!event.args.data) {\n return false;\n }\n const {isOutermostMainFrame, isMainFrame} = event.args.data;\n if (typeof isOutermostMainFrame !== 'undefined') {\n // If isOutermostMainFrame is defined we want to use that and not\n // fallback to isMainFrame, even if isOutermostMainFrame is false. Hence\n // this check.\n return isOutermostMainFrame;\n }\n return Boolean(isMainFrame);\n }\n\n return false;\n}\n\nfunction getEventSelfTime(\n event: Trace.Types.Events.Event, parsedTrace: Trace.Handlers.Types.ParsedTrace): Trace.Types.Timing.MilliSeconds {\n const mapToUse = Trace.Types.Extensions.isSyntheticExtensionEntry(event) ?\n parsedTrace.ExtensionTraceData.entryToNode :\n parsedTrace.Renderer.entryToNode;\n const selfTime = mapToUse.get(event)?.selfTime;\n return selfTime ? Trace.Helpers.Timing.microSecondsToMilliseconds(selfTime) : Trace.Types.Timing.MilliSeconds(0);\n}\n"]} \ No newline at end of file diff --git a/public/panels/timeline/components/BreadcrumbsUI.test.js b/public/panels/timeline/components/BreadcrumbsUI.test.js index 14fd11ddb..591710341 100644 --- a/public/panels/timeline/components/BreadcrumbsUI.test.js +++ b/public/panels/timeline/components/BreadcrumbsUI.test.js @@ -4,7 +4,7 @@ import * as Trace from '../../../models/trace/trace.js'; import { renderElementIntoDOM } from '../../../testing/DOMHelpers.js'; import { describeWithEnvironment } from '../../../testing/EnvironmentHelpers.js'; -import * as Coordinator from '../../../ui/components/render_coordinator/render_coordinator.js'; +import * as RenderCoordinator from '../../../ui/components/render_coordinator/render_coordinator.js'; import * as TimelineComponents from './components.js'; function milliToMicro(x) { return Trace.Helpers.Timing.millisecondsToMicroseconds(Trace.Types.Timing.MilliSeconds(x)); @@ -26,7 +26,6 @@ describeWithEnvironment('BreadcrumbsUI', () => { }); } it('renders one breadcrumb', async () => { - const coordinator = Coordinator.RenderCoordinator.RenderCoordinator.instance(); const component = new BreadcrumbsUI(); renderElementIntoDOM(component); const traceWindow = { @@ -39,13 +38,12 @@ describeWithEnvironment('BreadcrumbsUI', () => { child: null, }; component.data = { initialBreadcrumb: breadcrumb, activeBreadcrumb: breadcrumb }; - await coordinator.done(); + await RenderCoordinator.done(); const breadcrumbsRanges = queryBreadcrumbs(component); - assert.deepEqual(breadcrumbsRanges.length, 1); + assert.lengthOf(breadcrumbsRanges, 1); assert.deepEqual(breadcrumbsRanges, ['Full range (9.00 ms)']); }); it('renders all the breadcrumbs provided', async () => { - const coordinator = Coordinator.RenderCoordinator.RenderCoordinator.instance(); const component = new BreadcrumbsUI(); renderElementIntoDOM(component); const traceWindow2 = { @@ -67,13 +65,13 @@ describeWithEnvironment('BreadcrumbsUI', () => { child: breadcrumb2, }; component.data = { initialBreadcrumb: breadcrumb, activeBreadcrumb: breadcrumb2 }; - await coordinator.done(); + await RenderCoordinator.done(); const breadcrumbsRanges = queryBreadcrumbs(component); - assert.deepEqual(breadcrumbsRanges.length, 2); + assert.lengthOf(breadcrumbsRanges, 2); assert.deepEqual(breadcrumbsRanges, ['Full range (9.00 ms)', '7.00 ms']); // There should always be one active breadcrumb const activeRange = queryActiveBreadcrumb(component); - assert.deepEqual(activeRange.length, 1); + assert.lengthOf(activeRange, 1); }); }); //# sourceMappingURL=BreadcrumbsUI.test.js.map \ No newline at end of file diff --git a/public/panels/timeline/components/BreadcrumbsUI.test.js.map b/public/panels/timeline/components/BreadcrumbsUI.test.js.map index 3490cdb99..3550ffd8d 100644 --- a/public/panels/timeline/components/BreadcrumbsUI.test.js.map +++ b/public/panels/timeline/components/BreadcrumbsUI.test.js.map @@ -1 +1 @@ -{"version":3,"file":"BreadcrumbsUI.test.js","sourceRoot":"","sources":["../../../../../../../front_end/panels/timeline/components/BreadcrumbsUI.test.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,KAAK,KAAK,MAAM,gCAAgC,CAAC;AACxD,OAAO,EAAC,oBAAoB,EAAC,MAAM,gCAAgC,CAAC;AACpE,OAAO,EAAC,uBAAuB,EAAC,MAAM,wCAAwC,CAAC;AAC/E,OAAO,KAAK,WAAW,MAAM,iEAAiE,CAAC;AAE/F,OAAO,KAAK,kBAAkB,MAAM,iBAAiB,CAAC;AAEtD,SAAS,YAAY,CAAC,CAAS;IAC7B,OAAO,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,0BAA0B,CAClD,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC,CAAC,CACrC,CAAC;AACJ,CAAC;AAED,uBAAuB,CAAC,eAAe,EAAE,GAAG,EAAE;IAC5C,MAAM,EAAC,aAAa,EAAC,GAAG,kBAAkB,CAAC,aAAa,CAAC;IAEzD,SAAS,gBAAgB,CA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CAAC,SAAS,CAAC,CAAC;QAEtD,MAAM,CAAC,SAAS,CAAC,iBAAiB,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;QAC9C,MAAM,CAAC,SAAS,CAAC,iBAAiB,EAAE,CAAC,sBAAsB,EAAE,SAAS,CAAC,CAAC,CAAC;QAEzE,+CAA+C;QAC/C,MAAM,WAAW,GAAG,qBAAqB,CAAC,SAAS,CAAC,CAAC;QACrD,MAAM,CAAC,SAAS,CAAC,WAAW,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;IAC1C,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["// Copyright 2023 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport * as Trace from '../../../models/trace/trace.js';\nimport {renderElementIntoDOM} from '../../../testing/DOMHelpers.js';\nimport {describeWithEnvironment} from '../../../testing/EnvironmentHelpers.js';\nimport * as Coordinator from '../../../ui/components/render_coordinator/render_coordinator.js';\n\nimport * as TimelineComponents from './components.js';\n\nfunction milliToMicro(x: number): Trace.Types.Timing.MicroSeconds {\n return Trace.Helpers.Timing.millisecondsToMicroseconds(\n Trace.Types.Timing.MilliSeconds(x),\n );\n}\n\ndescribeWithEnvironment('BreadcrumbsUI', () => {\n const {BreadcrumbsUI} = TimelineComponents.BreadcrumbsUI;\n\n function queryBreadcrumbs(component: HTMLElement): (string)[] {\n assert.isNotNull(component.shadowRoot);\n const breadcrumbsRanges = component.shadowRoot.querySelectorAll('.range');\n return Array.from(breadcrumbsRanges).map(row => {\n return row.textContent?.trim() || '';\n });\n }\n\n function queryActiveBreadcrumb(component: HTMLElement): (string)[] {\n assert.isNotNull(component.shadowRoot);\n const breadcrumbsRanges = component.shadowRoot.querySelectorAll('.active-breadcrumb');\n return Array.from(breadcrumbsRanges).map(row => {\n return row.textContent?.trim() || '';\n });\n }\n\n it('renders one breadcrumb', async () => {\n const coordinator = Coordinator.RenderCoordinator.RenderCoordinator.instance();\n const component = new BreadcrumbsUI();\n renderElementIntoDOM(component);\n\n const traceWindow: Trace.Types.Timing.TraceWindowMicroSeconds = {\n min: milliToMicro(1),\n max: milliToMicro(10),\n range: milliToMicro(9),\n };\n\n const breadcrumb: Trace.Types.File.Breadcrumb = {\n window: traceWindow,\n child: null,\n };\n\n component.data = {initialBreadcrumb: breadcrumb, activeBreadcrumb: breadcrumb};\n\n await coordinator.done();\n\n const breadcrumbsRanges = queryBreadcrumbs(component);\n\n assert.deepEqual(breadcrumbsRanges.length, 1);\n assert.deepEqual(breadcrumbsRanges, ['Full range (9.00 ms)']);\n });\n\n it('renders all the breadcrumbs provided', async () => {\n const coordinator = Coordinator.RenderCoordinator.RenderCoordinator.instance();\n const component = new BreadcrumbsUI();\n renderElementIntoDOM(component);\n\n const traceWindow2: Trace.Types.Timing.TraceWindowMicroSeconds = {\n min: milliToMicro(2),\n max: milliToMicro(9),\n range: milliToMicro(7),\n };\n\n const traceWindow: Trace.Types.Timing.TraceWindowMicroSeconds = {\n min: milliToMicro(1),\n max: milliToMicro(10),\n range: milliToMicro(9),\n };\n\n const breadcrumb2: Trace.Types.File.Breadcrumb = {\n window: traceWindow2,\n child: null,\n };\n\n const breadcrumb: Trace.Types.File.Breadcrumb = {\n window: traceWindow,\n child: breadcrumb2,\n };\n\n component.data = {initialBreadcrumb: breadcrumb, activeBreadcrumb: breadcrumb2};\n\n await coordinator.done();\n\n const breadcrumbsRanges = queryBreadcrumbs(component);\n\n assert.deepEqual(breadcrumbsRanges.length, 2);\n assert.deepEqual(breadcrumbsRanges, ['Full range (9.00 ms)', '7.00 ms']);\n\n // There should always be one active breadcrumb\n const activeRange = queryActiveBreadcrumb(component);\n assert.deepEqual(activeRange.length, 1);\n });\n});\n"]} \ No newline at end of file +{"version":3,"file":"BreadcrumbsUI.test.js","sourceRoot":"","sources":["../../../../../../../front_end/panels/timeline/components/BreadcrumbsUI.test.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE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K,EAAE,YAAY,CAAC,CAAC,CAAC;SACvB,CAAC;QAEF,MAAM,WAAW,GAAgC;YAC/C,MAAM,EAAE,YAAY;YACpB,KAAK,EAAE,IAAI;SACZ,CAAC;QAEF,MAAM,UAAU,GAAgC;YAC9C,MAAM,EAAE,WAAW;YACnB,KAAK,EAAE,WAAW;SACnB,CAAC;QAEF,SAAS,CAAC,IAAI,GAAG,EAAC,iBAAiB,EAAE,UAAU,EAAE,gBAAgB,EAAE,WAAW,EAAC,CAAC;QAEhF,MAAM,iBAAiB,CAAC,IAAI,EAAE,CAAC;QAE/B,MAAM,iBAAiB,GAAG,gBAAgB,CAAC,SAAS,CAAC,CAAC;QAEtD,MAAM,CAAC,QAAQ,CAAC,iBAAiB,EAAE,CAAC,CAAC,CAAC;QACtC,MAAM,CAAC,SAAS,CAAC,iBAAiB,EAAE,CAAC,sBAAsB,EAAE,SAAS,CAAC,CAAC,CAAC;QAEzE,+CAA+C;QAC/C,MAAM,WAAW,GAAG,qBAAqB,CAAC,SAAS,CAAC,CAAC;QACrD,MAAM,CAAC,QAAQ,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC;IAClC,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["// Copyright 2023 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport * as Trace from '../../../models/trace/trace.js';\nimport {renderElementIntoDOM} from '../../../testing/DOMHelpers.js';\nimport {describeWithEnvironment} from '../../../testing/EnvironmentHelpers.js';\nimport * as RenderCoordinator from '../../../ui/components/render_coordinator/render_coordinator.js';\n\nimport * as TimelineComponents from './components.js';\n\nfunction milliToMicro(x: number): Trace.Types.Timing.MicroSeconds {\n return Trace.Helpers.Timing.millisecondsToMicroseconds(\n Trace.Types.Timing.MilliSeconds(x),\n );\n}\n\ndescribeWithEnvironment('BreadcrumbsUI', () => {\n const {BreadcrumbsUI} = TimelineComponents.BreadcrumbsUI;\n\n function queryBreadcrumbs(component: HTMLElement): (string)[] {\n assert.isNotNull(component.shadowRoot);\n const breadcrumbsRanges = component.shadowRoot.querySelectorAll('.range');\n return Array.from(breadcrumbsRanges).map(row => {\n return row.textContent?.trim() || '';\n });\n }\n\n function queryActiveBreadcrumb(component: HTMLElement): (string)[] {\n assert.isNotNull(component.shadowRoot);\n const breadcrumbsRanges = component.shadowRoot.querySelectorAll('.active-breadcrumb');\n return Array.from(breadcrumbsRanges).map(row => {\n return row.textContent?.trim() || '';\n });\n }\n\n it('renders one breadcrumb', async () => {\n const component = new BreadcrumbsUI();\n renderElementIntoDOM(component);\n\n const traceWindow: Trace.Types.Timing.TraceWindowMicroSeconds = {\n min: milliToMicro(1),\n max: milliToMicro(10),\n range: milliToMicro(9),\n };\n\n const breadcrumb: Trace.Types.File.Breadcrumb = {\n window: traceWindow,\n child: null,\n };\n\n component.data = {initialBreadcrumb: breadcrumb, activeBreadcrumb: breadcrumb};\n\n await RenderCoordinator.done();\n\n const breadcrumbsRanges = queryBreadcrumbs(component);\n\n assert.lengthOf(breadcrumbsRanges, 1);\n assert.deepEqual(breadcrumbsRanges, ['Full range (9.00 ms)']);\n });\n\n it('renders all the breadcrumbs provided', async () => {\n const component = new BreadcrumbsUI();\n renderElementIntoDOM(component);\n\n const traceWindow2: Trace.Types.Timing.TraceWindowMicroSeconds = {\n min: milliToMicro(2),\n max: milliToMicro(9),\n range: milliToMicro(7),\n };\n\n const traceWindow: Trace.Types.Timing.TraceWindowMicroSeconds = {\n min: milliToMicro(1),\n max: milliToMicro(10),\n range: milliToMicro(9),\n };\n\n const breadcrumb2: Trace.Types.File.Breadcrumb = {\n window: traceWindow2,\n child: null,\n };\n\n const breadcrumb: Trace.Types.File.Breadcrumb = {\n window: traceWindow,\n child: breadcrumb2,\n };\n\n component.data = {initialBreadcrumb: breadcrumb, activeBreadcrumb: breadcrumb2};\n\n await RenderCoordinator.done();\n\n const breadcrumbsRanges = queryBreadcrumbs(component);\n\n assert.lengthOf(breadcrumbsRanges, 2);\n assert.deepEqual(breadcrumbsRanges, ['Full range (9.00 ms)', '7.00 ms']);\n\n // There should always be one active breadcrumb\n const activeRange = queryActiveBreadcrumb(component);\n assert.lengthOf(activeRange, 1);\n });\n});\n"]} \ No newline at end of file diff --git a/public/panels/timeline/components/CPUThrottlingSelector.test.js b/public/panels/timeline/components/CPUThrottlingSelector.test.js index 7014e9358..2199cc23c 100644 --- a/public/panels/timeline/components/CPUThrottlingSelector.test.js +++ b/public/panels/timeline/components/CPUThrottlingSelector.test.js @@ -5,10 +5,9 @@ import * as SDK from '../../../core/sdk/sdk.js'; import * as MobileThrottling from '../../../panels/mobile_throttling/mobile_throttling.js'; import { renderElementIntoDOM } from '../../../testing/DOMHelpers.js'; import { describeWithEnvironment } from '../../../testing/EnvironmentHelpers.js'; -import * as Coordinator from '../../../ui/components/render_coordinator/render_coordinator.js'; +import * as RenderCoordinator from '../../../ui/components/render_coordinator/render_coordinator.js'; import * as Components from './components.js'; describeWithEnvironment('CPUThrottlingSelector', () => { - const coordinator = Coordinator.RenderCoordinator.RenderCoordinator.instance(); let cpuThrottlingManager; beforeEach(() => { cpuThrottlingManager = SDK.CPUThrottlingManager.CPUThrottlingManager.instance({ forceNew: true }); @@ -17,7 +16,7 @@ describeWithEnvironment('CPUThrottlingSelector', () => { it('renders all CPU throttling presets', async () => { const view = new Components.CPUThrottlingSelector.CPUThrottlingSelector(); renderElementIntoDOM(view); - await coordinator.done(); + await RenderCoordinator.done(); const menuItems = view.shadowRoot.querySelectorAll('devtools-menu-item'); assert.lengthOf(menuItems, 4); assert.strictEqual(menuItems[0].value, 1); @@ -36,23 +35,23 @@ describeWithEnvironment('CPUThrottlingSelector', () => { it('updates CPU throttling manager on change', async () => { const view = new Components.CPUThrottlingSelector.CPUThrottlingSelector(); renderElementIntoDOM(view); - await coordinator.done(); + await RenderCoordinator.done(); const menuItems = view.shadowRoot.querySelectorAll('devtools-menu-item'); assert.isTrue(menuItems[0].selected); assert.strictEqual(cpuThrottlingManager.cpuThrottlingRate(), 1); menuItems[1].click(); - await coordinator.done(); + await RenderCoordinator.done(); assert.isTrue(menuItems[1].selected); assert.strictEqual(cpuThrottlingManager.cpuThrottlingRate(), 4); }); it('reacts to changes in CPU throttling manager', async () => { const view = new Components.CPUThrottlingSelector.CPUThrottlingSelector(); renderElementIntoDOM(view); - await coordinator.done(); + await RenderCoordinator.done(); const menuItems = view.shadowRoot.querySelectorAll('devtools-menu-item'); assert.isTrue(menuItems[0].selected); cpuThrottlingManager.setCPUThrottlingRate(6); - await coordinator.done(); + await RenderCoordinator.done(); assert.isTrue(menuItems[2].selected); }); it('reacts to changes in CPU throttling manager when it is unmounted and then remounted', async () => { @@ -60,7 +59,7 @@ describeWithEnvironment('CPUThrottlingSelector', () => { // Change the conditions before the component is put into the DOM. cpuThrottlingManager.setCPUThrottlingRate(6); renderElementIntoDOM(view); - await coordinator.done(); + await RenderCoordinator.done(); // Ensure that the component picks up the new changes and has selected the right thorttling setting const menuItems = view.shadowRoot.querySelectorAll('devtools-menu-item'); assert.isTrue(menuItems[2].selected); diff --git a/public/panels/timeline/components/CPUThrottlingSelector.test.js.map b/public/panels/timeline/components/CPUThrottlingSelector.test.js.map index 7332d493d..34145143d 100644 --- a/public/panels/timeline/components/CPUThrottlingSelector.test.js.map +++ b/public/panels/timeline/components/CPUThrottlingSelector.test.js.map @@ -1 +1 @@ -{"version":3,"file":"CPUThrottlingSelector.test.js","sourceRoot":"","sources":["../../../../../../../front_end/panels/timeline/components/CPUThrottlingSelector.test.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,KAAK,GAAG,MAAM,0BAA0B,CAAC;AAChD,OAAO,KAAK,gBAAgB,MAAM,wDAAwD,CAAC;AAC3F,OAAO,EAAC,oBAAoB,EAAC,MAAM,gCAAgC,CAAC;AACpE,OAAO,EAAC,uBAAuB,EAAC,MAAM,wCAAwC,CAAC;AAE/E,OAAO,KAAK,WAAW,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QAAQ,CAAC,CAAC;IACvC,CAAC,CAAC,CAAC;AAEL,CAAC,CAAC,CAAC","sourcesContent":["// Copyright 2024 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport * as SDK from '../../../core/sdk/sdk.js';\nimport * as MobileThrottling from '../../../panels/mobile_throttling/mobile_throttling.js';\nimport {renderElementIntoDOM} from '../../../testing/DOMHelpers.js';\nimport {describeWithEnvironment} from '../../../testing/EnvironmentHelpers.js';\nimport type * as Menus from '../../../ui/components/menus/menus.js';\nimport * as Coordinator from '../../../ui/components/render_coordinator/render_coordinator.js';\n\nimport * as Components from './components.js';\n\ndescribeWithEnvironment('CPUThrottlingSelector', () => {\n const coordinator = Coordinator.RenderCoordinator.RenderCoordinator.instance();\n let cpuThrottlingManager: SDK.CPUThrottlingManager.CPUThrottlingManager;\n\n beforeEach(() => {\n cpuThrottlingManager = SDK.CPUThrottlingManager.CPUThrottlingManager.instance({forceNew: true});\n MobileThrottling.ThrottlingManager.ThrottlingManager.instance({forceNew: true});\n });\n\n it('renders all CPU throttling presets', async () => {\n const view = new Components.CPUThrottlingSelector.CPUThrottlingSelector();\n renderElementIntoDOM(view);\n\n await coordinator.done();\n\n const menuItems = view.shadowRoot!.querySelectorAll('devtools-menu-item') as NodeListOf;\n\n assert.lengthOf(menuItems, 4);\n\n assert.strictEqual(menuItems[0].value, 1);\n assert.isTrue(menuItems[0].selected);\n assert.match(menuItems[0].innerText, /No throttling/);\n\n assert.strictEqual(menuItems[1].value, 4);\n assert.isFalse(menuItems[1].selected);\n assert.match(menuItems[1].innerText, /4× slowdown/);\n\n assert.strictEqual(menuItems[2].value, 6);\n assert.isFalse(menuItems[2].selected);\n assert.match(menuItems[2].innerText, /6× slowdown/);\n\n assert.strictEqual(menuItems[3].value, 20);\n assert.isFalse(menuItems[3].selected);\n assert.match(menuItems[3].innerText, /20× slowdown/);\n });\n\n it('updates CPU throttling manager on change', async () => {\n const view = new Components.CPUThrottlingSelector.CPUThrottlingSelector();\n renderElementIntoDOM(view);\n\n await coordinator.done();\n\n const menuItems = view.shadowRoot!.querySelectorAll('devtools-menu-item') as NodeListOf;\n\n assert.isTrue(menuItems[0].selected);\n assert.strictEqual(cpuThrottlingManager.cpuThrottlingRate(), 1);\n\n menuItems[1].click();\n await coordinator.done();\n\n assert.isTrue(menuItems[1].selected);\n assert.strictEqual(cpuThrottlingManager.cpuThrottlingRate(), 4);\n });\n\n it('reacts to changes in CPU throttling manager', async () => {\n const view = new Components.CPUThrottlingSelector.CPUThrottlingSelector();\n renderElementIntoDOM(view);\n\n await coordinator.done();\n\n const menuItems = view.shadowRoot!.querySelectorAll('devtools-menu-item') as NodeListOf;\n\n assert.isTrue(menuItems[0].selected);\n\n cpuThrottlingManager.setCPUThrottlingRate(6);\n await coordinator.done();\n\n assert.isTrue(menuItems[2].selected);\n });\n it('reacts to changes in CPU throttling manager when it is unmounted and then remounted', async () => {\n const view = new Components.CPUThrottlingSelector.CPUThrottlingSelector();\n // Change the conditions before the component is put into the DOM.\n cpuThrottlingManager.setCPUThrottlingRate(6);\n\n renderElementIntoDOM(view);\n await coordinator.done();\n // Ensure that the component picks up the new changes and has selected the right thorttling setting\n const menuItems = view.shadowRoot!.querySelectorAll('devtools-menu-item') as NodeListOf;\n assert.isTrue(menuItems[2].selected);\n });\n\n});\n"]} \ No newline at end of file +{"version":3,"file":"CPUThrottlingSelector.test.js","sourceRoot":"","sources":["../../../../../../../front_end/panels/timeline/components/CPUThrottlingSelector.test.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,KAAK,GAAG,MAAM,0BAA0B,CAAC;AAChD,OAAO,KAAK,gBAAgB,MAAM,wDAAwD,CAAC;AAC3F,OAAO,EAAC,oBAAoB,EAAC,MAAM,gCAAgC,CAAC;AACpE,OAAO,EAAC,uBAAuB,EAAC,MAAM,wCAAwC,CAAC;AAE/E,OAAO,KAAK,iBAAi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cesContent":["// Copyright 2024 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport * as SDK from '../../../core/sdk/sdk.js';\nimport * as MobileThrottling from '../../../panels/mobile_throttling/mobile_throttling.js';\nimport {renderElementIntoDOM} from '../../../testing/DOMHelpers.js';\nimport {describeWithEnvironment} from '../../../testing/EnvironmentHelpers.js';\nimport type * as Menus from '../../../ui/components/menus/menus.js';\nimport * as RenderCoordinator from '../../../ui/components/render_coordinator/render_coordinator.js';\n\nimport * as Components from './components.js';\n\ndescribeWithEnvironment('CPUThrottlingSelector', () => {\n let cpuThrottlingManager: SDK.CPUThrottlingManager.CPUThrottlingManager;\n\n beforeEach(() => {\n cpuThrottlingManager = SDK.CPUThrottlingManager.CPUThrottlingManager.instance({forceNew: true});\n MobileThrottling.ThrottlingManager.ThrottlingManager.instance({forceNew: true});\n });\n\n it('renders all CPU throttling presets', async () => {\n const view = new Components.CPUThrottlingSelector.CPUThrottlingSelector();\n renderElementIntoDOM(view);\n\n await RenderCoordinator.done();\n\n const menuItems = view.shadowRoot!.querySelectorAll('devtools-menu-item') as NodeListOf;\n\n assert.lengthOf(menuItems, 4);\n\n assert.strictEqual(menuItems[0].value, 1);\n assert.isTrue(menuItems[0].selected);\n assert.match(menuItems[0].innerText, /No throttling/);\n\n assert.strictEqual(menuItems[1].value, 4);\n assert.isFalse(menuItems[1].selected);\n assert.match(menuItems[1].innerText, /4× slowdown/);\n\n assert.strictEqual(menuItems[2].value, 6);\n assert.isFalse(menuItems[2].selected);\n assert.match(menuItems[2].innerText, /6× slowdown/);\n\n assert.strictEqual(menuItems[3].value, 20);\n assert.isFalse(menuItems[3].selected);\n assert.match(menuItems[3].innerText, /20× slowdown/);\n });\n\n it('updates CPU throttling manager on change', async () => {\n const view = new Components.CPUThrottlingSelector.CPUThrottlingSelector();\n renderElementIntoDOM(view);\n\n await RenderCoordinator.done();\n\n const menuItems = view.shadowRoot!.querySelectorAll('devtools-menu-item') as NodeListOf;\n\n assert.isTrue(menuItems[0].selected);\n assert.strictEqual(cpuThrottlingManager.cpuThrottlingRate(), 1);\n\n menuItems[1].click();\n await RenderCoordinator.done();\n\n assert.isTrue(menuItems[1].selected);\n assert.strictEqual(cpuThrottlingManager.cpuThrottlingRate(), 4);\n });\n\n it('reacts to changes in CPU throttling manager', async () => {\n const view = new Components.CPUThrottlingSelector.CPUThrottlingSelector();\n renderElementIntoDOM(view);\n\n await RenderCoordinator.done();\n\n const menuItems = view.shadowRoot!.querySelectorAll('devtools-menu-item') as NodeListOf;\n\n assert.isTrue(menuItems[0].selected);\n\n cpuThrottlingManager.setCPUThrottlingRate(6);\n await RenderCoordinator.done();\n\n assert.isTrue(menuItems[2].selected);\n });\n it('reacts to changes in CPU throttling manager when it is unmounted and then remounted', async () => {\n const view = new Components.CPUThrottlingSelector.CPUThrottlingSelector();\n // Change the conditions before the component is put into the DOM.\n cpuThrottlingManager.setCPUThrottlingRate(6);\n\n renderElementIntoDOM(view);\n await RenderCoordinator.done();\n // Ensure that the component picks up the new changes and has selected the right thorttling setting\n const menuItems = view.shadowRoot!.querySelectorAll('devtools-menu-item') as NodeListOf;\n assert.isTrue(menuItems[2].selected);\n });\n});\n"]} \ No newline at end of file diff --git a/public/panels/timeline/components/FieldSettingsDialog.test.js b/public/panels/timeline/components/FieldSettingsDialog.test.js index 230e11892..c45834ae4 100644 --- a/public/panels/timeline/components/FieldSettingsDialog.test.js +++ b/public/panels/timeline/components/FieldSettingsDialog.test.js @@ -4,10 +4,9 @@ import * as CrUXManager from '../../../models/crux-manager/crux-manager.js'; import { renderElementIntoDOM } from '../../../testing/DOMHelpers.js'; import { describeWithMockConnection } from '../../../testing/MockConnection.js'; -import * as Coordinator from '../../../ui/components/render_coordinator/render_coordinator.js'; +import * as RenderCoordinator from '../../../ui/components/render_coordinator/render_coordinator.js'; import * as UI from '../../../ui/legacy/legacy.js'; import * as Components from './components.js'; -const coordinator = Coordinator.RenderCoordinator.RenderCoordinator.instance(); const OPEN_BUTTON_SELECTOR = 'devtools-button'; const ENABLE_BUTTON_SELECTOR = 'devtools-button[data-field-data-enable]'; const DISABLE_BUTTON_SELECTOR = 'devtools-button[data-field-data-disable]'; @@ -77,46 +76,46 @@ describeWithMockConnection('FieldSettingsDialog', () => { }); it('should enable field when enable button clicked', async () => { const view = createFieldSettingsDialog(); - await coordinator.done(); + await RenderCoordinator.done(); assert.isFalse(cruxManager.getConfigSetting().get().enabled); const openButton = view.shadowRoot.querySelector(OPEN_BUTTON_SELECTOR); assert.strictEqual(openButton.innerText, 'Set up'); openButton.click(); - await coordinator.done(); + await RenderCoordinator.done(); view.shadowRoot.querySelector(ENABLE_BUTTON_SELECTOR).click(); - await coordinator.done(); + await RenderCoordinator.done(); assert.isFalse(view.shadowRoot.querySelector('devtools-dialog').shadowRoot.querySelector('dialog').open); assert.isTrue(cruxManager.getConfigSetting().get().enabled); }); it('should disable field data when disable button clicked', async () => { cruxManager.getConfigSetting().set({ enabled: true, override: '' }); const view = createFieldSettingsDialog(); - await coordinator.done(); + await RenderCoordinator.done(); const openButton = view.shadowRoot.querySelector(OPEN_BUTTON_SELECTOR); assert.strictEqual(openButton.innerText, 'Configure'); openButton.click(); - await coordinator.done(); + await RenderCoordinator.done(); const disableButton = view.shadowRoot.querySelector(DISABLE_BUTTON_SELECTOR); assert.strictEqual(disableButton.innerText, 'Opt out'); disableButton.click(); - await coordinator.done(); + await RenderCoordinator.done(); assert.isFalse(view.shadowRoot.querySelector('devtools-dialog').shadowRoot.querySelector('dialog').open); assert.isFalse(cruxManager.getConfigSetting().get().enabled); }); it('should set URL override on enable', async () => { mockFieldData['url-ALL'] = mockResponse(); const view = createFieldSettingsDialog(); - await coordinator.done(); + await RenderCoordinator.done(); view.shadowRoot.querySelector(OPEN_BUTTON_SELECTOR).click(); - await coordinator.done(); + await RenderCoordinator.done(); view.shadowRoot.querySelector(OVERRIDE_CHECKBOX_SELECTOR).click(); - await coordinator.done(); + await RenderCoordinator.done(); const urlOverride = view.shadowRoot.querySelector(OVERRIDE_TEXT_SELECTOR); urlOverride.value = 'https://example.com'; urlOverride.dispatchEvent(new Event('change')); - await coordinator.done(); + await RenderCoordinator.done(); view.shadowRoot.querySelector(ENABLE_BUTTON_SELECTOR).click(); - await coordinator.done({ waitForWork: true }); + await RenderCoordinator.done({ waitForWork: true }); assert.isFalse(view.shadowRoot.querySelector('devtools-dialog').shadowRoot.querySelector('dialog').open); assert.isTrue(cruxManager.getConfigSetting().get().enabled); assert.strictEqual(cruxManager.getConfigSetting().get().override, 'https://example.com'); @@ -125,17 +124,17 @@ describeWithMockConnection('FieldSettingsDialog', () => { it('should still set URL override on disable', async () => { mockFieldData['url-ALL'] = mockResponse(); const view = createFieldSettingsDialog(); - await coordinator.done(); + await RenderCoordinator.done(); view.shadowRoot.querySelector(OPEN_BUTTON_SELECTOR).click(); - await coordinator.done(); + await RenderCoordinator.done(); view.shadowRoot.querySelector(OVERRIDE_CHECKBOX_SELECTOR).click(); - await coordinator.done(); + await RenderCoordinator.done(); const urlOverride = view.shadowRoot.querySelector(OVERRIDE_TEXT_SELECTOR); urlOverride.value = 'https://example.com'; urlOverride.dispatchEvent(new Event('change')); - await coordinator.done(); + await RenderCoordinator.done(); view.shadowRoot.querySelector(DISABLE_BUTTON_SELECTOR).click(); - await coordinator.done({ waitForWork: true }); + await RenderCoordinator.done({ waitForWork: true }); assert.isFalse(view.shadowRoot.querySelector('devtools-dialog').shadowRoot.querySelector('dialog').open); assert.isFalse(cruxManager.getConfigSetting().get().enabled); assert.strictEqual(cruxManager.getConfigSetting().get().override, 'https://example.com'); @@ -143,17 +142,17 @@ describeWithMockConnection('FieldSettingsDialog', () => { }); it('should show message for URL override with no data', async () => { const view = createFieldSettingsDialog(); - await coordinator.done(); + await RenderCoordinator.done(); view.shadowRoot.querySelector(OPEN_BUTTON_SELECTOR).click(); - await coordinator.done(); + await RenderCoordinator.done(); view.shadowRoot.querySelector(OVERRIDE_CHECKBOX_SELECTOR).click(); - await coordinator.done(); + await RenderCoordinator.done(); const urlOverride = view.shadowRoot.querySelector(OVERRIDE_TEXT_SELECTOR); urlOverride.value = 'https://example.com'; urlOverride.dispatchEvent(new Event('change')); - await coordinator.done(); + await RenderCoordinator.done(); view.shadowRoot.querySelector(ENABLE_BUTTON_SELECTOR).click(); - await coordinator.done({ waitForWork: true }); + await RenderCoordinator.done({ waitForWork: true }); assert.strictEqual(view.shadowRoot.querySelector('.warning').textContent, 'The Chrome UX Report does not have sufficient real-world speed data for this page.'); assert.isTrue(view.shadowRoot.querySelector('devtools-dialog').shadowRoot.querySelector('dialog').open); assert.isFalse(cruxManager.getConfigSetting().get().enabled); @@ -161,17 +160,17 @@ describeWithMockConnection('FieldSettingsDialog', () => { }); it('should show message for malformed URL', async () => { const view = createFieldSettingsDialog(); - await coordinator.done(); + await RenderCoordinator.done(); view.shadowRoot.querySelector(OPEN_BUTTON_SELECTOR).click(); - await coordinator.done(); + await RenderCoordinator.done(); view.shadowRoot.querySelector(OVERRIDE_CHECKBOX_SELECTOR).click(); - await coordinator.done(); + await RenderCoordinator.done(); const urlOverride = view.shadowRoot.querySelector(OVERRIDE_TEXT_SELECTOR); urlOverride.value = '//example.com'; urlOverride.dispatchEvent(new Event('change')); - await coordinator.done(); + await RenderCoordinator.done(); view.shadowRoot.querySelector(ENABLE_BUTTON_SELECTOR).click(); - await coordinator.done({ waitForWork: true }); + await RenderCoordinator.done({ waitForWork: true }); assert.strictEqual(view.shadowRoot.querySelector('.warning').textContent, '"//example.com" is not a valid origin or URL.'); assert.isTrue(view.shadowRoot.querySelector('devtools-dialog').shadowRoot.querySelector('dialog').open); assert.isFalse(cruxManager.getConfigSetting().get().enabled); @@ -184,9 +183,9 @@ describeWithMockConnection('FieldSettingsDialog', () => { overrideEnabled: true, }); const view = createFieldSettingsDialog(); - await coordinator.done(); + await RenderCoordinator.done(); view.shadowRoot.querySelector(OPEN_BUTTON_SELECTOR).click(); - await coordinator.done(); + await RenderCoordinator.done(); const checked = view.shadowRoot.querySelector(OVERRIDE_CHECKBOX_SELECTOR).checked; const urlOverride = view.shadowRoot.querySelector(OVERRIDE_TEXT_SELECTOR).value; assert.strictEqual(urlOverride, 'https://example.com'); @@ -199,9 +198,9 @@ describeWithMockConnection('FieldSettingsDialog', () => { overrideEnabled: false, }); const view = createFieldSettingsDialog(); - await coordinator.done(); + await RenderCoordinator.done(); view.shadowRoot.querySelector(OPEN_BUTTON_SELECTOR).click(); - await coordinator.done(); + await RenderCoordinator.done(); const checked = view.shadowRoot.querySelector(OVERRIDE_CHECKBOX_SELECTOR).checked; const urlOverride = view.shadowRoot.querySelector(OVERRIDE_TEXT_SELECTOR).value; assert.strictEqual(urlOverride, 'https://example.com'); diff --git a/public/panels/timeline/components/FieldSettingsDialog.test.js.map b/public/panels/timeline/components/FieldSettingsDialog.test.js.map index e4eedda91..3f1aebec7 100644 --- a/public/panels/timeline/components/FieldSettingsDialog.test.js.map +++ b/public/panels/timeline/components/FieldSettingsDialog.test.js.map @@ -1 +1 @@ -{"version":3,"file":"FieldSettingsDialog.test.js","sourceRoot":"","sources":["../../../../../../../front_end/panels/timeline/components/FieldSettingsDialog.test.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,KAAK,WAAW,MAAM,8CAA8C,CAAC;AAC5E,OAAO,EAAC,oBAAoB,EAAC,MAAM,gCAAgC,CAAC;AACpE,OAAO,EAAC,0BAA0B,EAAC,MAAM,oCAAoC,CAAC;AAC9E,OAAO,KAAK,WAAW,MAAM,iEAAiE,CAAC;AAC/F,OAAO,KAAK,EAAE,MAAM,8BAA8B,CAAC;AAEnD,OAAO,KAAK,UAAU,MAAM,iBAAiB,CAAC;AAE9C,MAAM,WAAW,GAAG,WAAW,CAAC,iBAAiB,CAAC,iBAAiB,CAAC,QAAQ,EAAE,CAAC;AAE/E,MAAM,oBAAoB,GAAG,iBAAiB,CAAC;AAC/C,MAAM,sBAAsB,GAAG,yC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CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["// Copyright 2024 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport * as CrUXManager from '../../../models/crux-manager/crux-manager.js';\nimport {renderElementIntoDOM} from '../../../testing/DOMHelpers.js';\nimport {describeWithMockConnection} from '../../../testing/MockConnection.js';\nimport * as Coordinator from '../../../ui/components/render_coordinator/render_coordinator.js';\nimport * as UI from '../../../ui/legacy/legacy.js';\n\nimport * as Components from './components.js';\n\nconst coordinator = Coordinator.RenderCoordinator.RenderCoordinator.instance();\n\nconst OPEN_BUTTON_SELECTOR = 'devtools-button';\nconst ENABLE_BUTTON_SELECTOR = 'devtools-button[data-field-data-enable]';\nconst DISABLE_BUTTON_SELECTOR = 'devtools-button[data-field-data-disable]';\nconst OVERRIDE_CHECKBOX_SELECTOR = 'input[type=\"checkbox\"]';\nconst OVERRIDE_TEXT_SELECTOR = 'input[type=\"text\"]';\n\nfunction mockResponse(): CrUXManager.CrUXResponse {\n return {\n record: {\n key: {},\n metrics: {\n largest_contentful_paint: {\n histogram: [\n {start: 0, end: 2500, density: 0.5},\n {start: 2500, end: 4000, density: 0.3},\n {start: 4000, density: 0.2},\n ],\n percentiles: {p75: 1000},\n },\n cumulative_layout_shift: {\n histogram: [\n {start: 0, end: 0.1, density: 0.1},\n {start: 0.1, end: 0.25, density: 0.1},\n {start: 0.25, density: 0.8},\n ],\n percentiles: {p75: 0.25},\n },\n },\n collectionPeriod: {\n firstDate: {year: 2024, month: 1, day: 1},\n lastDate: {year: 2024, month: 1, day: 29},\n },\n },\n };\n}\n\nfunction createFieldSettingsDialog(): Components.FieldSettingsDialog.FieldSettingsDialog {\n const root = document.createElement('div');\n renderElementIntoDOM(root);\n\n const widget = new UI.Widget.Widget();\n widget.markAsRoot();\n widget.show(root);\n\n const view = new Components.FieldSettingsDialog.FieldSettingsDialog();\n widget.contentElement.append(view);\n\n return view;\n}\n\ndescribeWithMockConnection('FieldSettingsDialog', () => {\n let cruxManager: CrUXManager.CrUXManager;\n let mockFieldData: CrUXManager.PageResult;\n let getFieldDataStub: sinon.SinonStub;\n\n beforeEach(async () => {\n cruxManager = CrUXManager.CrUXManager.instance({forceNew: true});\n getFieldDataStub = sinon.stub(cruxManager, 'getFieldDataForPage').callsFake(async () => mockFieldData);\n\n mockFieldData = {\n 'origin-ALL': null,\n 'origin-DESKTOP': null,\n 'origin-PHONE': null,\n 'origin-TABLET': null,\n 'url-ALL': null,\n 'url-DESKTOP': null,\n 'url-PHONE': null,\n 'url-TABLET': null,\n warnings: [],\n };\n\n cruxManager.getConfigSetting().set({enabled: false, override: ''});\n });\n\n afterEach(async () => {\n getFieldDataStub.restore();\n });\n\n it('should enable field when enable button clicked', async () => {\n const view = createFieldSettingsDialog();\n await coordinator.done();\n\n assert.isFalse(cruxManager.getConfigSetting().get().enabled);\n\n const openButton = view.shadowRoot!.querySelector(OPEN_BUTTON_SELECTOR) as HTMLElement;\n assert.strictEqual(openButton.innerText, 'Set up');\n openButton.click();\n\n await coordinator.done();\n\n view.shadowRoot!.querySelector(ENABLE_BUTTON_SELECTOR)!.click();\n\n await coordinator.done();\n\n assert.isFalse(view.shadowRoot!.querySelector('devtools-dialog')!.shadowRoot!.querySelector('dialog')!.open);\n assert.isTrue(cruxManager.getConfigSetting().get().enabled);\n });\n\n it('should disable field data when disable button clicked', async () => {\n cruxManager.getConfigSetting().set({enabled: true, override: ''});\n\n const view = createFieldSettingsDialog();\n await coordinator.done();\n\n const openButton = view.shadowRoot!.querySelector(OPEN_BUTTON_SELECTOR) as HTMLElement;\n assert.strictEqual(openButton.innerText, 'Configure');\n openButton.click();\n\n await coordinator.done();\n\n const disableButton = view.shadowRoot!.querySelector(DISABLE_BUTTON_SELECTOR) as HTMLElement;\n assert.strictEqual(disableButton.innerText, 'Opt out');\n disableButton.click();\n\n await coordinator.done();\n\n assert.isFalse(view.shadowRoot!.querySelector('devtools-dialog')!.shadowRoot!.querySelector('dialog')!.open);\n assert.isFalse(cruxManager.getConfigSetting().get().enabled);\n });\n\n it('should set URL override on enable', async () => {\n mockFieldData['url-ALL'] = mockResponse();\n\n const view = createFieldSettingsDialog();\n await coordinator.done();\n\n view.shadowRoot!.querySelector(OPEN_BUTTON_SELECTOR)!.click();\n\n await coordinator.done();\n\n view.shadowRoot!.querySelector(OVERRIDE_CHECKBOX_SELECTOR)!.click();\n\n await coordinator.done();\n\n const urlOverride = view.shadowRoot!.querySelector(OVERRIDE_TEXT_SELECTOR) as HTMLInputElement;\n urlOverride.value = 'https://example.com';\n urlOverride.dispatchEvent(new Event('change'));\n\n await coordinator.done();\n\n view.shadowRoot!.querySelector(ENABLE_BUTTON_SELECTOR)!.click();\n\n await coordinator.done({waitForWork: true});\n\n assert.isFalse(view.shadowRoot!.querySelector('devtools-dialog')!.shadowRoot!.querySelector('dialog')!.open);\n assert.isTrue(cruxManager.getConfigSetting().get().enabled);\n assert.strictEqual(cruxManager.getConfigSetting().get().override, 'https://example.com');\n assert.isTrue(cruxManager.getConfigSetting().get().overrideEnabled);\n });\n\n it('should still set URL override on disable', async () => {\n mockFieldData['url-ALL'] = mockResponse();\n\n const view = createFieldSettingsDialog();\n await coordinator.done();\n\n view.shadowRoot!.querySelector(OPEN_BUTTON_SELECTOR)!.click();\n\n await coordinator.done();\n\n view.shadowRoot!.querySelector(OVERRIDE_CHECKBOX_SELECTOR)!.click();\n\n await coordinator.done();\n\n const urlOverride = view.shadowRoot!.querySelector(OVERRIDE_TEXT_SELECTOR) as HTMLInputElement;\n urlOverride.value = 'https://example.com';\n urlOverride.dispatchEvent(new Event('change'));\n\n await coordinator.done();\n\n view.shadowRoot!.querySelector(DISABLE_BUTTON_SELECTOR)!.click();\n\n await coordinator.done({waitForWork: true});\n\n assert.isFalse(view.shadowRoot!.querySelector('devtools-dialog')!.shadowRoot!.querySelector('dialog')!.open);\n assert.isFalse(cruxManager.getConfigSetting().get().enabled);\n assert.strictEqual(cruxManager.getConfigSetting().get().override, 'https://example.com');\n assert.isTrue(cruxManager.getConfigSetting().get().overrideEnabled);\n });\n\n it('should show message for URL override with no data', async () => {\n const view = createFieldSettingsDialog();\n await coordinator.done();\n\n view.shadowRoot!.querySelector(OPEN_BUTTON_SELECTOR)!.click();\n\n await coordinator.done();\n\n view.shadowRoot!.querySelector(OVERRIDE_CHECKBOX_SELECTOR)!.click();\n\n await coordinator.done();\n\n const urlOverride = view.shadowRoot!.querySelector(OVERRIDE_TEXT_SELECTOR) as HTMLInputElement;\n urlOverride.value = 'https://example.com';\n urlOverride.dispatchEvent(new Event('change'));\n\n await coordinator.done();\n\n view.shadowRoot!.querySelector(ENABLE_BUTTON_SELECTOR)!.click();\n\n await coordinator.done({waitForWork: true});\n\n assert.strictEqual(\n view.shadowRoot!.querySelector('.warning')!.textContent,\n 'The Chrome UX Report does not have sufficient real-world speed data for this page.');\n\n assert.isTrue(view.shadowRoot!.querySelector('devtools-dialog')!.shadowRoot!.querySelector('dialog')!.open);\n assert.isFalse(cruxManager.getConfigSetting().get().enabled);\n assert.strictEqual(cruxManager.getConfigSetting().get().override, '');\n });\n\n it('should show message for malformed URL', async () => {\n const view = createFieldSettingsDialog();\n await coordinator.done();\n\n view.shadowRoot!.querySelector(OPEN_BUTTON_SELECTOR)!.click();\n\n await coordinator.done();\n\n view.shadowRoot!.querySelector(OVERRIDE_CHECKBOX_SELECTOR)!.click();\n\n await coordinator.done();\n\n const urlOverride = view.shadowRoot!.querySelector(OVERRIDE_TEXT_SELECTOR) as HTMLInputElement;\n urlOverride.value = '//example.com';\n urlOverride.dispatchEvent(new Event('change'));\n\n await coordinator.done();\n\n view.shadowRoot!.querySelector(ENABLE_BUTTON_SELECTOR)!.click();\n\n await coordinator.done({waitForWork: true});\n\n assert.strictEqual(\n view.shadowRoot!.querySelector('.warning')!.textContent, '\"//example.com\" is not a valid origin or URL.');\n\n assert.isTrue(view.shadowRoot!.querySelector('devtools-dialog')!.shadowRoot!.querySelector('dialog')!.open);\n assert.isFalse(cruxManager.getConfigSetting().get().enabled);\n assert.strictEqual(cruxManager.getConfigSetting().get().override, '');\n });\n\n it('should restore URL override from setting', async () => {\n cruxManager.getConfigSetting().set({\n enabled: true,\n override: 'https://example.com',\n overrideEnabled: true,\n });\n\n const view = createFieldSettingsDialog();\n await coordinator.done();\n\n view.shadowRoot!.querySelector(OPEN_BUTTON_SELECTOR)!.click();\n\n await coordinator.done();\n\n const checked = view.shadowRoot!.querySelector(OVERRIDE_CHECKBOX_SELECTOR)!.checked;\n const urlOverride = view.shadowRoot!.querySelector(OVERRIDE_TEXT_SELECTOR)!.value;\n\n assert.strictEqual(urlOverride, 'https://example.com');\n assert.isTrue(checked);\n });\n\n it('should restore URL override from setting if override disabled', async () => {\n cruxManager.getConfigSetting().set({\n enabled: true,\n override: 'https://example.com',\n overrideEnabled: false,\n });\n\n const view = createFieldSettingsDialog();\n await coordinator.done();\n\n view.shadowRoot!.querySelector(OPEN_BUTTON_SELECTOR)!.click();\n\n await coordinator.done();\n\n const checked = view.shadowRoot!.querySelector(OVERRIDE_CHECKBOX_SELECTOR)!.checked;\n const urlOverride = view.shadowRoot!.querySelector(OVERRIDE_TEXT_SELECTOR)!.value;\n\n assert.strictEqual(urlOverride, 'https://example.com');\n assert.isFalse(checked);\n });\n});\n"]} \ No newline at end of file +{"version":3,"file":"FieldSettingsDialog.test.js","sourceRoot":"","sources":["../../../../../../../front_end/panels/timeline/components/FieldSettingsDialog.test.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,KAAK,WAAW,MAAM,8CAA8C,CAAC;AAC5E,OAAO,EAAC,oBAAoB,EAAC,MAAM,gCAAgC,CAAC;AACpE,OAAO,EAAC,0BAA0B,EAAC,MAAM,oCAAoC,CAAC;AAC9E,OAAO,KAAK,iBAAiB,MAAM,iEAAiE,CAAC;AACrG,OAAO,KAAK,EAAE,MAAM,8BAA8B,CAAC;AAEnD,OAAO,KAAK,UAAU,MAAM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CAAE,CAAC,KAAK,CAAC;QAEpG,MAAM,CAAC,WAAW,CAAC,WAAW,EAAE,qBAAqB,CAAC,CAAC;QACvD,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;IAC1B,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["// Copyright 2024 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport * as CrUXManager from '../../../models/crux-manager/crux-manager.js';\nimport {renderElementIntoDOM} from '../../../testing/DOMHelpers.js';\nimport {describeWithMockConnection} from '../../../testing/MockConnection.js';\nimport * as RenderCoordinator from '../../../ui/components/render_coordinator/render_coordinator.js';\nimport * as UI from '../../../ui/legacy/legacy.js';\n\nimport * as Components from './components.js';\n\nconst OPEN_BUTTON_SELECTOR = 'devtools-button';\nconst ENABLE_BUTTON_SELECTOR = 'devtools-button[data-field-data-enable]';\nconst DISABLE_BUTTON_SELECTOR = 'devtools-button[data-field-data-disable]';\nconst OVERRIDE_CHECKBOX_SELECTOR = 'input[type=\"checkbox\"]';\nconst OVERRIDE_TEXT_SELECTOR = 'input[type=\"text\"]';\n\nfunction mockResponse(): CrUXManager.CrUXResponse {\n return {\n record: {\n key: {},\n metrics: {\n largest_contentful_paint: {\n histogram: [\n {start: 0, end: 2500, density: 0.5},\n {start: 2500, end: 4000, density: 0.3},\n {start: 4000, density: 0.2},\n ],\n percentiles: {p75: 1000},\n },\n cumulative_layout_shift: {\n histogram: [\n {start: 0, end: 0.1, density: 0.1},\n {start: 0.1, end: 0.25, density: 0.1},\n {start: 0.25, density: 0.8},\n ],\n percentiles: {p75: 0.25},\n },\n },\n collectionPeriod: {\n firstDate: {year: 2024, month: 1, day: 1},\n lastDate: {year: 2024, month: 1, day: 29},\n },\n },\n };\n}\n\nfunction createFieldSettingsDialog(): Components.FieldSettingsDialog.FieldSettingsDialog {\n const root = document.createElement('div');\n renderElementIntoDOM(root);\n\n const widget = new UI.Widget.Widget();\n widget.markAsRoot();\n widget.show(root);\n\n const view = new Components.FieldSettingsDialog.FieldSettingsDialog();\n widget.contentElement.append(view);\n\n return view;\n}\n\ndescribeWithMockConnection('FieldSettingsDialog', () => {\n let cruxManager: CrUXManager.CrUXManager;\n let mockFieldData: CrUXManager.PageResult;\n let getFieldDataStub: sinon.SinonStub;\n\n beforeEach(async () => {\n cruxManager = CrUXManager.CrUXManager.instance({forceNew: true});\n getFieldDataStub = sinon.stub(cruxManager, 'getFieldDataForPage').callsFake(async () => mockFieldData);\n\n mockFieldData = {\n 'origin-ALL': null,\n 'origin-DESKTOP': null,\n 'origin-PHONE': null,\n 'origin-TABLET': null,\n 'url-ALL': null,\n 'url-DESKTOP': null,\n 'url-PHONE': null,\n 'url-TABLET': null,\n warnings: [],\n };\n\n cruxManager.getConfigSetting().set({enabled: false, override: ''});\n });\n\n afterEach(async () => {\n getFieldDataStub.restore();\n });\n\n it('should enable field when enable button clicked', async () => {\n const view = createFieldSettingsDialog();\n await RenderCoordinator.done();\n\n assert.isFalse(cruxManager.getConfigSetting().get().enabled);\n\n const openButton = view.shadowRoot!.querySelector(OPEN_BUTTON_SELECTOR) as HTMLElement;\n assert.strictEqual(openButton.innerText, 'Set up');\n openButton.click();\n\n await RenderCoordinator.done();\n\n view.shadowRoot!.querySelector(ENABLE_BUTTON_SELECTOR)!.click();\n\n await RenderCoordinator.done();\n\n assert.isFalse(view.shadowRoot!.querySelector('devtools-dialog')!.shadowRoot!.querySelector('dialog')!.open);\n assert.isTrue(cruxManager.getConfigSetting().get().enabled);\n });\n\n it('should disable field data when disable button clicked', async () => {\n cruxManager.getConfigSetting().set({enabled: true, override: ''});\n\n const view = createFieldSettingsDialog();\n await RenderCoordinator.done();\n\n const openButton = view.shadowRoot!.querySelector(OPEN_BUTTON_SELECTOR) as HTMLElement;\n assert.strictEqual(openButton.innerText, 'Configure');\n openButton.click();\n\n await RenderCoordinator.done();\n\n const disableButton = view.shadowRoot!.querySelector(DISABLE_BUTTON_SELECTOR) as HTMLElement;\n assert.strictEqual(disableButton.innerText, 'Opt out');\n disableButton.click();\n\n await RenderCoordinator.done();\n\n assert.isFalse(view.shadowRoot!.querySelector('devtools-dialog')!.shadowRoot!.querySelector('dialog')!.open);\n assert.isFalse(cruxManager.getConfigSetting().get().enabled);\n });\n\n it('should set URL override on enable', async () => {\n mockFieldData['url-ALL'] = mockResponse();\n\n const view = createFieldSettingsDialog();\n await RenderCoordinator.done();\n\n view.shadowRoot!.querySelector(OPEN_BUTTON_SELECTOR)!.click();\n\n await RenderCoordinator.done();\n\n view.shadowRoot!.querySelector(OVERRIDE_CHECKBOX_SELECTOR)!.click();\n\n await RenderCoordinator.done();\n\n const urlOverride = view.shadowRoot!.querySelector(OVERRIDE_TEXT_SELECTOR) as HTMLInputElement;\n urlOverride.value = 'https://example.com';\n urlOverride.dispatchEvent(new Event('change'));\n\n await RenderCoordinator.done();\n\n view.shadowRoot!.querySelector(ENABLE_BUTTON_SELECTOR)!.click();\n\n await RenderCoordinator.done({waitForWork: true});\n\n assert.isFalse(view.shadowRoot!.querySelector('devtools-dialog')!.shadowRoot!.querySelector('dialog')!.open);\n assert.isTrue(cruxManager.getConfigSetting().get().enabled);\n assert.strictEqual(cruxManager.getConfigSetting().get().override, 'https://example.com');\n assert.isTrue(cruxManager.getConfigSetting().get().overrideEnabled);\n });\n\n it('should still set URL override on disable', async () => {\n mockFieldData['url-ALL'] = mockResponse();\n\n const view = createFieldSettingsDialog();\n await RenderCoordinator.done();\n\n view.shadowRoot!.querySelector(OPEN_BUTTON_SELECTOR)!.click();\n\n await RenderCoordinator.done();\n\n view.shadowRoot!.querySelector(OVERRIDE_CHECKBOX_SELECTOR)!.click();\n\n await RenderCoordinator.done();\n\n const urlOverride = view.shadowRoot!.querySelector(OVERRIDE_TEXT_SELECTOR) as HTMLInputElement;\n urlOverride.value = 'https://example.com';\n urlOverride.dispatchEvent(new Event('change'));\n\n await RenderCoordinator.done();\n\n view.shadowRoot!.querySelector(DISABLE_BUTTON_SELECTOR)!.click();\n\n await RenderCoordinator.done({waitForWork: true});\n\n assert.isFalse(view.shadowRoot!.querySelector('devtools-dialog')!.shadowRoot!.querySelector('dialog')!.open);\n assert.isFalse(cruxManager.getConfigSetting().get().enabled);\n assert.strictEqual(cruxManager.getConfigSetting().get().override, 'https://example.com');\n assert.isTrue(cruxManager.getConfigSetting().get().overrideEnabled);\n });\n\n it('should show message for URL override with no data', async () => {\n const view = createFieldSettingsDialog();\n await RenderCoordinator.done();\n\n view.shadowRoot!.querySelector(OPEN_BUTTON_SELECTOR)!.click();\n\n await RenderCoordinator.done();\n\n view.shadowRoot!.querySelector(OVERRIDE_CHECKBOX_SELECTOR)!.click();\n\n await RenderCoordinator.done();\n\n const urlOverride = view.shadowRoot!.querySelector(OVERRIDE_TEXT_SELECTOR) as HTMLInputElement;\n urlOverride.value = 'https://example.com';\n urlOverride.dispatchEvent(new Event('change'));\n\n await RenderCoordinator.done();\n\n view.shadowRoot!.querySelector(ENABLE_BUTTON_SELECTOR)!.click();\n\n await RenderCoordinator.done({waitForWork: true});\n\n assert.strictEqual(\n view.shadowRoot!.querySelector('.warning')!.textContent,\n 'The Chrome UX Report does not have sufficient real-world speed data for this page.');\n\n assert.isTrue(view.shadowRoot!.querySelector('devtools-dialog')!.shadowRoot!.querySelector('dialog')!.open);\n assert.isFalse(cruxManager.getConfigSetting().get().enabled);\n assert.strictEqual(cruxManager.getConfigSetting().get().override, '');\n });\n\n it('should show message for malformed URL', async () => {\n const view = createFieldSettingsDialog();\n await RenderCoordinator.done();\n\n view.shadowRoot!.querySelector(OPEN_BUTTON_SELECTOR)!.click();\n\n await RenderCoordinator.done();\n\n view.shadowRoot!.querySelector(OVERRIDE_CHECKBOX_SELECTOR)!.click();\n\n await RenderCoordinator.done();\n\n const urlOverride = view.shadowRoot!.querySelector(OVERRIDE_TEXT_SELECTOR) as HTMLInputElement;\n urlOverride.value = '//example.com';\n urlOverride.dispatchEvent(new Event('change'));\n\n await RenderCoordinator.done();\n\n view.shadowRoot!.querySelector(ENABLE_BUTTON_SELECTOR)!.click();\n\n await RenderCoordinator.done({waitForWork: true});\n\n assert.strictEqual(\n view.shadowRoot!.querySelector('.warning')!.textContent, '\"//example.com\" is not a valid origin or URL.');\n\n assert.isTrue(view.shadowRoot!.querySelector('devtools-dialog')!.shadowRoot!.querySelector('dialog')!.open);\n assert.isFalse(cruxManager.getConfigSetting().get().enabled);\n assert.strictEqual(cruxManager.getConfigSetting().get().override, '');\n });\n\n it('should restore URL override from setting', async () => {\n cruxManager.getConfigSetting().set({\n enabled: true,\n override: 'https://example.com',\n overrideEnabled: true,\n });\n\n const view = createFieldSettingsDialog();\n await RenderCoordinator.done();\n\n view.shadowRoot!.querySelector(OPEN_BUTTON_SELECTOR)!.click();\n\n await RenderCoordinator.done();\n\n const checked = view.shadowRoot!.querySelector(OVERRIDE_CHECKBOX_SELECTOR)!.checked;\n const urlOverride = view.shadowRoot!.querySelector(OVERRIDE_TEXT_SELECTOR)!.value;\n\n assert.strictEqual(urlOverride, 'https://example.com');\n assert.isTrue(checked);\n });\n\n it('should restore URL override from setting if override disabled', async () => {\n cruxManager.getConfigSetting().set({\n enabled: true,\n override: 'https://example.com',\n overrideEnabled: false,\n });\n\n const view = createFieldSettingsDialog();\n await RenderCoordinator.done();\n\n view.shadowRoot!.querySelector(OPEN_BUTTON_SELECTOR)!.click();\n\n await RenderCoordinator.done();\n\n const checked = view.shadowRoot!.querySelector(OVERRIDE_CHECKBOX_SELECTOR)!.checked;\n const urlOverride = view.shadowRoot!.querySelector(OVERRIDE_TEXT_SELECTOR)!.value;\n\n assert.strictEqual(urlOverride, 'https://example.com');\n assert.isFalse(checked);\n });\n});\n"]} \ No newline at end of file diff --git a/public/panels/timeline/components/IgnoreListSetting.test.js b/public/panels/timeline/components/IgnoreListSetting.test.js index ea11eb721..e28edf150 100644 --- a/public/panels/timeline/components/IgnoreListSetting.test.js +++ b/public/panels/timeline/components/IgnoreListSetting.test.js @@ -8,14 +8,13 @@ import * as Bindings from '../../../models/bindings/bindings.js'; import * as Workspace from '../../../models/workspace/workspace.js'; import { dispatchBlurEvent, dispatchFocusEvent, dispatchInputEvent, dispatchKeyDownEvent, renderElementIntoDOM, } from '../../../testing/DOMHelpers.js'; import { describeWithEnvironment } from '../../../testing/EnvironmentHelpers.js'; -import * as Coordinator from '../../../ui/components/render_coordinator/render_coordinator.js'; +import * as RenderCoordinator from '../../../ui/components/render_coordinator/render_coordinator.js'; import * as TimelineComponents from './components.js'; -const coordinator = Coordinator.RenderCoordinator.RenderCoordinator.instance(); describeWithEnvironment('Ignore List Setting', () => { async function renderIgnoreListSetting() { const component = new TimelineComponents.IgnoreListSetting.IgnoreListSetting(); renderElementIntoDOM(component); - await coordinator.done(); + await RenderCoordinator.done(); return component; } function getAllRules(component) { @@ -58,11 +57,11 @@ describeWithEnvironment('Ignore List Setting', () => { const component = await renderIgnoreListSetting(); const ignoredRules = getAllRules(component); // There is a default rule `/node_modules/|/bower_components/` - assert.deepEqual(ignoredRules.length, 2); + assert.lengthOf(ignoredRules, 2); assert.deepEqual(ignoredRules[0].regex, '/node_modules/|/bower_components/'); - assert.deepEqual(ignoredRules[0].disabled, false); + assert.isFalse(ignoredRules[0].disabled); assert.deepEqual(ignoredRules[1].regex, 'rule 1'); - assert.deepEqual(ignoredRules[1].disabled, false); + assert.isFalse(ignoredRules[1].disabled); // Check the remove buttons are rendered assert.isNotNull(component.shadowRoot); const regexRowsElements = component.shadowRoot.querySelectorAll('.regex-row'); @@ -76,11 +75,11 @@ describeWithEnvironment('Ignore List Setting', () => { const component = await renderIgnoreListSetting(); const ignoredRules = getAllRules(component); // There is a default rule `/node_modules/|/bower_components/` - assert.deepEqual(ignoredRules.length, 2); + assert.lengthOf(ignoredRules, 2); assert.deepEqual(ignoredRules[0].regex, '/node_modules/|/bower_components/'); - assert.deepEqual(ignoredRules[0].disabled, false); + assert.isFalse(ignoredRules[0].disabled); assert.deepEqual(ignoredRules[1].regex, 'rule 1'); - assert.deepEqual(ignoredRules[1].disabled, true); + assert.isTrue(ignoredRules[1].disabled); }); it('Able to toggle the disable status of an ignore listed rules', async () => { const component = await renderIgnoreListSetting(); @@ -114,12 +113,12 @@ describeWithEnvironment('Ignore List Setting', () => { assert.isNotNull(component.shadowRoot); const newRegexRows = component.shadowRoot.querySelectorAll('.new-regex-row'); // There should only be one add new regex row. - assert.strictEqual(newRegexRows.length, 1); + assert.lengthOf(newRegexRows, 1); // There are two elements, one is checkbox, one is the input const newRegexCheckboxes = newRegexRows[0].querySelectorAll('dt-checkbox'); - assert.strictEqual(newRegexCheckboxes.length, 1); + assert.lengthOf(newRegexCheckboxes, 1); const newRegexInputs = newRegexRows[0].querySelectorAll('.new-regex-text-input'); - assert.strictEqual(newRegexInputs.length, 1); + assert.lengthOf(newRegexInputs, 1); }); it('Able to add an ignore list rule', async () => { // Now there should only by 1 rule (`/node_modules/|/bower_components/`) @@ -145,7 +144,7 @@ describeWithEnvironment('Ignore List Setting', () => { dispatchFocusEvent(newRegexInput); newRegexInput.value = 'rule 2'; dispatchInputEvent(newRegexInput); - await coordinator.done(); + await RenderCoordinator.done(); const validationResultElement = component.shadowRoot?.querySelector('.input-validation'); assert.notExists(validationResultElement); // We need this to simulate the 'finish editing' with empty input, so it can remove the temp regex. Otherwise the @@ -162,7 +161,7 @@ describeWithEnvironment('Ignore List Setting', () => { dispatchFocusEvent(newRegexInput); newRegexInput.value = 'rule 1'; dispatchInputEvent(newRegexInput); - await coordinator.done(); + await RenderCoordinator.done(); const validationResultElement = getValidationResultElement(component); assert.isFalse(validationResultElement.hidden); assert.isTrue(validationResultElement.classList.contains('input-validation-error')); @@ -182,7 +181,7 @@ describeWithEnvironment('Ignore List Setting', () => { dispatchFocusEvent(newRegexInput); newRegexInput.value = 'rule 1'; dispatchInputEvent(newRegexInput); - await coordinator.done(); + await RenderCoordinator.done(); const validationResultElement = getValidationResultElement(component); assert.isFalse(validationResultElement.hidden); assert.isFalse(validationResultElement.classList.contains('input-validation-error')); @@ -197,11 +196,11 @@ describeWithEnvironment('Ignore List Setting', () => { it('Add an empty regex when focusing on the input', async () => { const regexPatterns = getIgnoredRegexes(); // There is a default rule `/node_modules/|/bower_components/`, and the 'rule 1' we added. - assert.strictEqual(regexPatterns.length, 2); + assert.lengthOf(regexPatterns, 2); const component = await renderIgnoreListSetting(); const newRegexInput = getNewRegexInput(component); dispatchFocusEvent(newRegexInput); - assert.strictEqual(regexPatterns.length, 3); + assert.lengthOf(regexPatterns, 3); // We need this to simulate the 'finish editing', so it can remove the temp regex. Otherwise the future tests will // be messed up. // The 'finish editing' part will be tested later @@ -210,11 +209,11 @@ describeWithEnvironment('Ignore List Setting', () => { it('Update the regex when user typing', async () => { const regexPatterns = getIgnoredRegexes(); // There is a default rule `/node_modules/|/bower_components/`, and the 'rule 1' we added. - assert.strictEqual(regexPatterns.length, 2); + assert.lengthOf(regexPatterns, 2); const component = await renderIgnoreListSetting(); const newRegexInput = getNewRegexInput(component); dispatchFocusEvent(newRegexInput); - assert.strictEqual(regexPatterns.length, 3); + assert.lengthOf(regexPatterns, 3); // After the focus event, the temp regex (last one) is still empty. assert.strictEqual(regexPatterns[2].pattern, ''); // Simulate user's typing @@ -231,30 +230,30 @@ describeWithEnvironment('Ignore List Setting', () => { it('Add the regex when user finish typing', async () => { const regexPatterns = getIgnoredRegexes(); // There is a default rule `/node_modules/|/bower_components/`, and the 'rule 1' we added. - assert.strictEqual(regexPatterns.length, 2); + assert.lengthOf(regexPatterns, 2); const component = await renderIgnoreListSetting(); const newRegexInput = getNewRegexInput(component); dispatchFocusEvent(newRegexInput); newRegexInput.value = 'rule 2'; - assert.strictEqual(regexPatterns.length, 3); + assert.lengthOf(regexPatterns, 3); dispatchBlurEvent(newRegexInput); // When add a valid rule, the temp regex won't be removed. - assert.strictEqual(regexPatterns.length, 3); + assert.lengthOf(regexPatterns, 3); assert.strictEqual(regexPatterns[2].pattern, 'rule 2'); }); it('Remove the invalid regex when user finish typing', async () => { const regexPatterns = getIgnoredRegexes(); // There is a default rule `/node_modules/|/bower_components/`, and the 'rule 1', 'rule 2' we added. - assert.strictEqual(regexPatterns.length, 3); + assert.lengthOf(regexPatterns, 3); const component = await renderIgnoreListSetting(); const newRegexInput = getNewRegexInput(component); dispatchFocusEvent(newRegexInput); // This is a duplicate rule, so it is invalid. newRegexInput.value = 'rule 2'; - assert.strictEqual(regexPatterns.length, 4); + assert.lengthOf(regexPatterns, 4); dispatchBlurEvent(newRegexInput); // When add an invalid rule, the temp regex will be removed. - assert.strictEqual(regexPatterns.length, 3); + assert.lengthOf(regexPatterns, 3); }); it('Clear the input when `Escape` is pressed', async () => { const component = await renderIgnoreListSetting(); diff --git a/public/panels/timeline/components/IgnoreListSetting.test.js.map b/public/panels/timeline/components/IgnoreListSetting.test.js.map index 3a06320dd..2028467da 100644 --- a/public/panels/timeline/components/IgnoreListSetting.test.js.map +++ b/public/panels/timeline/components/IgnoreListSetting.test.js.map @@ -1 +1 @@ -{"version":3,"file":"IgnoreListSetting.test.js","sourceRoot":"","sources":["../../../../../../../front_end/panels/timeline/components/IgnoreListSetting.test.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,KAAK,MAAM,MAAM,gCAAgC,CAAC;AACzD,OAAO,KAAK,QAAQ,MAAM,oCAAoC,CAAC;AAC/D,OAAO,KAAK,GAAG,MAAM,0BAA0B,CAAC;AAChD,OAAO,KAAK,QAAQ,MAAM,sCAAsC,CAAC;AACjE,OAAO,KAAK,SAAS,MAAM,wCAAwC,CAAC;AACpE,OAAO,EACL,iBAAiB,EACjB,kBAAkB,EAClB,kBAAkB,EAClB,oBAAoB,EACpB,oBAAoB,GACrB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAC,uBAAuB,EAAC,MAAM,wCAAwC,CAAC;AAC/E,OAAO,KAAK,WAAW,MAAM,iEAAiE,CAAC;AAE/F,OAAO,KAAK,kBAAkB,MAAM,iBAAiB,CAAC;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AC;AAED,SAAS,kBAAkB,CAAC,UAAkB;IAC5C,MAAM,aAAa,GAAG,iBAAiB,EAAE,CAAC;IAC1C,KAAK,MAAM,YAAY,IAAI,aAAa,EAAE,CAAC;QACzC,IAAI,YAAY,CAAC,OAAO,KAAK,UAAU,EAAE,CAAC;YACxC,YAAY,CAAC,QAAQ,GAAG,IAAI,CAAC;YAC7B,MAAM;QACR,CAAC;IACH,CAAC;AACH,CAAC;AAED,SAAS,qBAAqB,CAAC,UAAkB;IAC/C,MAAM,aAAa,GAAG,iBAAiB,EAAE,CAAC;IAC1C,KAAK,MAAM,YAAY,IAAI,aAAa,EAAE,CAAC;QACzC,IAAI,YAAY,CAAC,OAAO,KAAK,UAAU,EAAE,CAAC;YACxC,OAAO,YAAY,CAAC,QAAQ,IAAI,KAAK,CAAC;QACxC,CAAC;IACH,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED;;GAEG;AACH,SAAS,oBAAoB,CAAC,UAAkB;IAC9C,MAAM,aAAa,GAAG,iBAAiB,EAAE,CAAC;IAC1C,KAAK,MAAM,YAAY,IAAI,aAAa,EAAE,CAAC;QACzC,IAAI,YAAY,CAAC,OAAO,KAAK,UAAU,EAAE,CAAC;YACxC,OAAO,IAAI,CAAC;QACd,CAAC;IACH,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC","sourcesContent":["// Copyright 2024 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport * as Common from '../../../core/common/common.js';\nimport * as Platform from '../../../core/platform/platform.js';\nimport * as SDK from '../../../core/sdk/sdk.js';\nimport * as Bindings from '../../../models/bindings/bindings.js';\nimport * as Workspace from '../../../models/workspace/workspace.js';\nimport {\n dispatchBlurEvent,\n dispatchFocusEvent,\n dispatchInputEvent,\n dispatchKeyDownEvent,\n renderElementIntoDOM,\n} from '../../../testing/DOMHelpers.js';\nimport {describeWithEnvironment} from '../../../testing/EnvironmentHelpers.js';\nimport * as Coordinator from '../../../ui/components/render_coordinator/render_coordinator.js';\n\nimport * as TimelineComponents from './components.js';\n\nconst coordinator = Coordinator.RenderCoordinator.RenderCoordinator.instance();\n\ndescribeWithEnvironment('Ignore List Setting', () => {\n async function renderIgnoreListSetting(): Promise {\n const component = new TimelineComponents.IgnoreListSetting.IgnoreListSetting();\n renderElementIntoDOM(component);\n await coordinator.done();\n return component;\n }\n\n function getAllRules(component: HTMLElement): {regex: string, disabled: boolean}[] {\n assert.isNotNull(component.shadowRoot);\n const regexRows = component.shadowRoot.querySelectorAll('.regex-row');\n return Array.from(regexRows).map(row => {\n const checkboxShadow = row.querySelector('dt-checkbox')?.shadowRoot;\n assert.exists(checkboxShadow);\n return {\n regex: checkboxShadow.querySelector('label')?.textContent?.trim() ?? '',\n disabled: !checkboxShadow.querySelector('input')?.checked,\n };\n });\n }\n\n function getNewRegexInput(component: HTMLElement): HTMLInputElement {\n assert.isNotNull(component.shadowRoot);\n const newRegexRow = component.shadowRoot.querySelector('.new-regex-row');\n const newRegexInput = newRegexRow?.querySelector('.new-regex-text-input');\n\n assert.exists(newRegexInput);\n return newRegexInput;\n }\n\n function getValidationResultElement(component: HTMLElement): HTMLDivElement {\n assert.isNotNull(component.shadowRoot);\n const validationResultElement = component.shadowRoot.querySelector('.input-validation');\n\n assert.exists(validationResultElement);\n return validationResultElement;\n }\n\n before(() => {\n const targetManager = SDK.TargetManager.TargetManager.instance();\n const workspace = Workspace.Workspace.WorkspaceImpl.instance({forceNew: true});\n const resourceMapping = new Bindings.ResourceMapping.ResourceMapping(targetManager, workspace);\n const debuggerWorkspaceBinding = Bindings.DebuggerWorkspaceBinding.DebuggerWorkspaceBinding.instance(\n {forceNew: true, resourceMapping, targetManager});\n Bindings.IgnoreListManager.IgnoreListManager.instance({\n forceNew: true,\n debuggerWorkspaceBinding,\n });\n\n ignoreRegex('rule 1');\n });\n\n it('Able to render the ignore listed rules', async () => {\n const component = await renderIgnoreListSetting();\n const ignoredRules = getAllRules(component);\n\n // There is a default rule `/node_modules/|/bower_components/`\n assert.deepEqual(ignoredRules.length, 2);\n assert.deepEqual(ignoredRules[0].regex, '/node_modules/|/bower_components/');\n assert.deepEqual(ignoredRules[0].disabled, false);\n assert.deepEqual(ignoredRules[1].regex, 'rule 1');\n assert.deepEqual(ignoredRules[1].disabled, false);\n\n // Check the remove buttons are rendered\n assert.isNotNull(component.shadowRoot);\n const regexRowsElements = component.shadowRoot.querySelectorAll('.regex-row');\n Array.from(regexRowsElements).forEach(row => {\n const removeButton = row.querySelector('devtools-button');\n assert.exists(removeButton);\n });\n });\n\n it('Able to render the disabled ignore listed rules', async () => {\n disableIgnoreRegex('rule 1');\n\n const component = await renderIgnoreListSetting();\n const ignoredRules = getAllRules(component);\n\n // There is a default rule `/node_modules/|/bower_components/`\n assert.deepEqual(ignoredRules.length, 2);\n assert.deepEqual(ignoredRules[0].regex, '/node_modules/|/bower_components/');\n assert.deepEqual(ignoredRules[0].disabled, false);\n assert.deepEqual(ignoredRules[1].regex, 'rule 1');\n assert.deepEqual(ignoredRules[1].disabled, true);\n });\n\n it('Able to toggle the disable status of an ignore listed rules', async () => {\n const component = await renderIgnoreListSetting();\n\n assert.isNotNull(component.shadowRoot);\n const regexRows = component.shadowRoot.querySelectorAll('.regex-row');\n // \"rule 1\" is the second in the view.\n // Now the \"rule 1\" is disabled (by last test), so click the checkbox, it will be enabled.\n // Add sanity checks to make sure.\n const checkboxShadow = regexRows[1].querySelector('dt-checkbox')?.shadowRoot;\n assert.strictEqual(checkboxShadow?.querySelector('label')?.textContent, 'rule 1');\n assert.isTrue(isIgnoreRegexDisabled('rule 1'));\n\n const rule1CheckBox = checkboxShadow?.querySelector('input');\n rule1CheckBox?.click();\n assert.isFalse(isIgnoreRegexDisabled('rule 1'));\n });\n\n it('Able to remove an ignore list rule', async () => {\n const component = await renderIgnoreListSetting();\n\n assert.isNotNull(component.shadowRoot);\n const regexRows = component.shadowRoot.querySelectorAll('.regex-row');\n // \"rule 1\" is the second in the view.\n // Add sanity checks to make sure.\n const checkboxShadow = regexRows[1].querySelector('dt-checkbox')?.shadowRoot;\n assert.strictEqual(checkboxShadow?.querySelector('label')?.textContent, 'rule 1');\n assert.isTrue(isRegexInIgnoredList('rule 1'));\n\n const rule1RemoveButton = regexRows[1].querySelector('devtools-button');\n rule1RemoveButton?.click();\n assert.isFalse(isRegexInIgnoredList('rule 1'));\n });\n\n it('Able to render the add new regex row correctly', async () => {\n const component = await renderIgnoreListSetting();\n assert.isNotNull(component.shadowRoot);\n\n const newRegexRows = component.shadowRoot.querySelectorAll('.new-regex-row');\n // There should only be one add new regex row.\n assert.strictEqual(newRegexRows.length, 1);\n // There are two elements, one is checkbox, one is the input\n const newRegexCheckboxes = newRegexRows[0].querySelectorAll('dt-checkbox');\n assert.strictEqual(newRegexCheckboxes.length, 1);\n const newRegexInputs = newRegexRows[0].querySelectorAll('.new-regex-text-input');\n assert.strictEqual(newRegexInputs.length, 1);\n });\n\n it('Able to add an ignore list rule', async () => {\n // Now there should only by 1 rule (`/node_modules/|/bower_components/`)\n assert.isFalse(isRegexInIgnoredList('rule 1'));\n\n const component = await renderIgnoreListSetting();\n const newRegexInput = getNewRegexInput(component);\n\n newRegexInput.value = 'rule 1';\n dispatchBlurEvent(newRegexInput);\n\n assert.isTrue(isRegexInIgnoredList('rule 1'));\n });\n\n it('Do not add a duplicate ignore list rule', async () => {\n disableIgnoreRegex('rule 1');\n assert.isTrue(isIgnoreRegexDisabled('rule 1'));\n\n const component = await renderIgnoreListSetting();\n const newRegexInput = getNewRegexInput(component);\n\n newRegexInput.value = 'rule 1';\n dispatchBlurEvent(newRegexInput);\n\n assert.isFalse(isIgnoreRegexDisabled('rule 1'));\n });\n\n it('Do not show warning message for valid rule', async () => {\n const component = await renderIgnoreListSetting();\n const newRegexInput = getNewRegexInput(component);\n\n dispatchFocusEvent(newRegexInput);\n newRegexInput.value = 'rule 2';\n dispatchInputEvent(newRegexInput);\n await coordinator.done();\n\n const validationResultElement = component.shadowRoot?.querySelector('.input-validation');\n assert.notExists(validationResultElement);\n\n // We need this to simulate the 'finish editing' with empty input, so it can remove the temp regex. Otherwise the\n // future tests will be messed up.\n // The 'finish editing' part will be tested later\n newRegexInput.value = '';\n dispatchBlurEvent(newRegexInput);\n });\n\n it('Show error message for invalid rule', async () => {\n // One example of invalid rule is duplicate input.\n assert.isTrue(isRegexInIgnoredList('rule 1'));\n\n const component = await renderIgnoreListSetting();\n const newRegexInput = getNewRegexInput(component);\n\n dispatchFocusEvent(newRegexInput);\n newRegexInput.value = 'rule 1';\n dispatchInputEvent(newRegexInput);\n await coordinator.done();\n\n const validationResultElement = getValidationResultElement(component);\n assert.isFalse(validationResultElement.hidden);\n assert.isTrue(validationResultElement.classList.contains('input-validation-error'));\n assert.isNotEmpty(validationResultElement.textContent);\n\n // We need this to simulate the 'finish editing' with empty input, so it can remove the temp regex. Otherwise the\n // future tests will be messed up.\n // The 'finish editing' part will be tested later\n newRegexInput.value = '';\n dispatchBlurEvent(newRegexInput);\n });\n\n it('Show warning message for valid rule with warning message', async () => {\n // One example of valid rule with warning message is when a rule is disabled and it is added again.\n disableIgnoreRegex('rule 1');\n assert.isTrue(isIgnoreRegexDisabled('rule 1'));\n\n const component = await renderIgnoreListSetting();\n const newRegexInput = getNewRegexInput(component);\n\n dispatchFocusEvent(newRegexInput);\n newRegexInput.value = 'rule 1';\n dispatchInputEvent(newRegexInput);\n await coordinator.done();\n\n const validationResultElement = getValidationResultElement(component);\n assert.isFalse(validationResultElement.hidden);\n assert.isFalse(validationResultElement.classList.contains('input-validation-error'));\n assert.isNotEmpty(validationResultElement.textContent);\n\n // We need this to simulate the 'finish editing' with empty input, so it can remove the temp regex. Otherwise the\n // future tests will be messed up.\n // The 'finish editing' part will be tested later\n newRegexInput.value = '';\n dispatchBlurEvent(newRegexInput);\n });\n\n describe('preview the result', () => {\n it('Add an empty regex when focusing on the input', async () => {\n const regexPatterns = getIgnoredRegexes();\n // There is a default rule `/node_modules/|/bower_components/`, and the 'rule 1' we added.\n assert.strictEqual(regexPatterns.length, 2);\n\n const component = await renderIgnoreListSetting();\n const newRegexInput = getNewRegexInput(component);\n\n dispatchFocusEvent(newRegexInput);\n assert.strictEqual(regexPatterns.length, 3);\n\n // We need this to simulate the 'finish editing', so it can remove the temp regex. Otherwise the future tests will\n // be messed up.\n // The 'finish editing' part will be tested later\n dispatchBlurEvent(newRegexInput);\n });\n\n it('Update the regex when user typing', async () => {\n const regexPatterns = getIgnoredRegexes();\n // There is a default rule `/node_modules/|/bower_components/`, and the 'rule 1' we added.\n assert.strictEqual(regexPatterns.length, 2);\n\n const component = await renderIgnoreListSetting();\n const newRegexInput = getNewRegexInput(component);\n\n dispatchFocusEvent(newRegexInput);\n assert.strictEqual(regexPatterns.length, 3);\n // After the focus event, the temp regex (last one) is still empty.\n assert.strictEqual(regexPatterns[2].pattern, '');\n // Simulate user's typing\n newRegexInput.value = 'r';\n dispatchInputEvent(newRegexInput);\n // After the input event, the temp regex (last one) is updated.\n assert.strictEqual(regexPatterns[2].pattern, 'r');\n\n // We need this to simulate the 'finish editing' with empty input, so it can remove the temp regex. Otherwise the\n // future tests will be messed up.\n // The 'finish editing' part will be tested later\n newRegexInput.value = '';\n dispatchBlurEvent(newRegexInput);\n });\n\n it('Add the regex when user finish typing', async () => {\n const regexPatterns = getIgnoredRegexes();\n // There is a default rule `/node_modules/|/bower_components/`, and the 'rule 1' we added.\n assert.strictEqual(regexPatterns.length, 2);\n\n const component = await renderIgnoreListSetting();\n const newRegexInput = getNewRegexInput(component);\n\n dispatchFocusEvent(newRegexInput);\n newRegexInput.value = 'rule 2';\n assert.strictEqual(regexPatterns.length, 3);\n\n dispatchBlurEvent(newRegexInput);\n // When add a valid rule, the temp regex won't be removed.\n assert.strictEqual(regexPatterns.length, 3);\n assert.strictEqual(regexPatterns[2].pattern, 'rule 2');\n });\n\n it('Remove the invalid regex when user finish typing', async () => {\n const regexPatterns = getIgnoredRegexes();\n // There is a default rule `/node_modules/|/bower_components/`, and the 'rule 1', 'rule 2' we added.\n assert.strictEqual(regexPatterns.length, 3);\n\n const component = await renderIgnoreListSetting();\n const newRegexInput = getNewRegexInput(component);\n\n dispatchFocusEvent(newRegexInput);\n // This is a duplicate rule, so it is invalid.\n newRegexInput.value = 'rule 2';\n assert.strictEqual(regexPatterns.length, 4);\n\n dispatchBlurEvent(newRegexInput);\n // When add an invalid rule, the temp regex will be removed.\n assert.strictEqual(regexPatterns.length, 3);\n });\n\n it('Clear the input when `Escape` is pressed', async () => {\n const component = await renderIgnoreListSetting();\n const newRegexInput = getNewRegexInput(component);\n\n // This is a duplicate rule, so it is invalid.\n newRegexInput.value = 'rule 2';\n\n dispatchKeyDownEvent(newRegexInput, {key: Platform.KeyboardUtilities.ESCAPE_KEY});\n // When add an invalid rule, the temp regex will be removed.\n assert.strictEqual('', newRegexInput.value);\n });\n });\n});\n\ndescribeWithEnvironment('Pattern validator', () => {\n it('Can validate the valid pattern', () => {\n const validPattern = '^hello$';\n const result = TimelineComponents.IgnoreListSetting.patternValidator([], validPattern);\n assert.isTrue(result.valid);\n });\n\n it('Returns the reason for the empty pattern', () => {\n const emptyPattern = '';\n const result = TimelineComponents.IgnoreListSetting.patternValidator([], emptyPattern);\n assert.isFalse(result.valid);\n assert.strictEqual(result.message, 'Rule can\\'t be empty');\n });\n\n it('Returns the reason for the existed pattern', () => {\n const duplicatePattern = 'abc';\n const existedRegex = {pattern: duplicatePattern, disabled: false};\n\n const result = TimelineComponents.IgnoreListSetting.patternValidator([existedRegex], duplicatePattern);\n assert.isFalse(result.valid);\n assert.strictEqual(result.message, 'Rule already exists');\n });\n\n it('Returns true for the disabled existed pattern', () => {\n const duplicatePattern = 'abc';\n const existedRegex = {pattern: duplicatePattern, disabled: true};\n\n const result = TimelineComponents.IgnoreListSetting.patternValidator([existedRegex], duplicatePattern);\n assert.isTrue(result.valid);\n assert.strictEqual(\n result.message, 'This rule already exists but is disabled. Saving this value will re-enable the rule');\n });\n\n it('Returns the reason for the invalid pattern', () => {\n const invalidPattern = '[';\n const result = TimelineComponents.IgnoreListSetting.patternValidator([], invalidPattern);\n assert.isFalse(result.valid);\n assert.strictEqual(result.message, 'Rule must be a valid regular expression');\n });\n});\n\nfunction getIgnoredRegexes(): Common.Settings.RegExpSettingItem[] {\n return (Common.Settings.Settings.instance().moduleSetting('skip-stack-frames-pattern') as\n Common.Settings.RegExpSetting)\n .getAsArray();\n}\n\nfunction ignoreRegex(regexValue: string): void {\n const regexPatterns = getIgnoredRegexes();\n regexPatterns.push({pattern: regexValue, disabled: false});\n}\n\nfunction disableIgnoreRegex(regexValue: string): void {\n const regexPatterns = getIgnoredRegexes();\n for (const regexPattern of regexPatterns) {\n if (regexPattern.pattern === regexValue) {\n regexPattern.disabled = true;\n break;\n }\n }\n}\n\nfunction isIgnoreRegexDisabled(regexValue: string): boolean {\n const regexPatterns = getIgnoredRegexes();\n for (const regexPattern of regexPatterns) {\n if (regexPattern.pattern === regexValue) {\n return regexPattern.disabled ?? false;\n }\n }\n return false;\n}\n\n/**\n * Returns if the regex is in the ignore list, no matter if it is disabled.\n */\nfunction isRegexInIgnoredList(regexValue: string): boolean {\n const regexPatterns = getIgnoredRegexes();\n for (const regexPattern of regexPatterns) {\n if (regexPattern.pattern === regexValue) {\n return true;\n }\n }\n return false;\n}\n"]} \ No newline at end of file +{"version":3,"file":"IgnoreListSetting.test.js","sourceRoot":"","sources":["../../../../../../../front_end/panels/timeline/components/IgnoreListSetting.test.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,KAAK,MAAM,MAAM,gCAAgC,CAAC;AACzD,OAAO,KAAK,QAAQ,MAAM,oCAAoC,CAAC;AAC/D,OAAO,KAAK,GAAG,MAAM,0BAA0B,CAAC;AAChD,OAAO,KAAK,QAAQ,MAAM,sCAAsC,CAAC;AACjE,OAAO,KAAK,SAAS,MAAM,wCAAwC,CAAC;AACpE,OAAO,EACL,iBAAiB,EACjB,kBA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,CAAC;IAC1C,KAAK,MAAM,YAAY,IAAI,aAAa,EAAE,CAAC;QACzC,IAAI,YAAY,CAAC,OAAO,KAAK,UAAU,EAAE,CAAC;YACxC,YAAY,CAAC,QAAQ,GAAG,IAAI,CAAC;YAC7B,MAAM;QACR,CAAC;IACH,CAAC;AACH,CAAC;AAED,SAAS,qBAAqB,CAAC,UAAkB;IAC/C,MAAM,aAAa,GAAG,iBAAiB,EAAE,CAAC;IAC1C,KAAK,MAAM,YAAY,IAAI,aAAa,EAAE,CAAC;QACzC,IAAI,YAAY,CAAC,OAAO,KAAK,UAAU,EAAE,CAAC;YACxC,OAAO,YAAY,CAAC,QAAQ,IAAI,KAAK,CAAC;QACxC,CAAC;IACH,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED;;GAEG;AACH,SAAS,oBAAoB,CAAC,UAAkB;IAC9C,MAAM,aAAa,GAAG,iBAAiB,EAAE,CAAC;IAC1C,KAAK,MAAM,YAAY,IAAI,aAAa,EAAE,CAAC;QACzC,IAAI,YAAY,CAAC,OAAO,KAAK,UAAU,EAAE,CAAC;YACxC,OAAO,IAAI,CAAC;QACd,CAAC;IACH,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC","sourcesContent":["// Copyright 2024 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport * as Common from '../../../core/common/common.js';\nimport * as Platform from '../../../core/platform/platform.js';\nimport * as SDK from '../../../core/sdk/sdk.js';\nimport * as Bindings from '../../../models/bindings/bindings.js';\nimport * as Workspace from '../../../models/workspace/workspace.js';\nimport {\n dispatchBlurEvent,\n dispatchFocusEvent,\n dispatchInputEvent,\n dispatchKeyDownEvent,\n renderElementIntoDOM,\n} from '../../../testing/DOMHelpers.js';\nimport {describeWithEnvironment} from '../../../testing/EnvironmentHelpers.js';\nimport * as RenderCoordinator from '../../../ui/components/render_coordinator/render_coordinator.js';\n\nimport * as TimelineComponents from './components.js';\n\ndescribeWithEnvironment('Ignore List Setting', () => {\n async function renderIgnoreListSetting(): Promise {\n const component = new TimelineComponents.IgnoreListSetting.IgnoreListSetting();\n renderElementIntoDOM(component);\n await RenderCoordinator.done();\n return component;\n }\n\n function getAllRules(component: HTMLElement): {regex: string, disabled: boolean}[] {\n assert.isNotNull(component.shadowRoot);\n const regexRows = component.shadowRoot.querySelectorAll('.regex-row');\n return Array.from(regexRows).map(row => {\n const checkboxShadow = row.querySelector('dt-checkbox')?.shadowRoot;\n assert.exists(checkboxShadow);\n return {\n regex: checkboxShadow.querySelector('label')?.textContent?.trim() ?? '',\n disabled: !checkboxShadow.querySelector('input')?.checked,\n };\n });\n }\n\n function getNewRegexInput(component: HTMLElement): HTMLInputElement {\n assert.isNotNull(component.shadowRoot);\n const newRegexRow = component.shadowRoot.querySelector('.new-regex-row');\n const newRegexInput = newRegexRow?.querySelector('.new-regex-text-input');\n\n assert.exists(newRegexInput);\n return newRegexInput;\n }\n\n function getValidationResultElement(component: HTMLElement): HTMLDivElement {\n assert.isNotNull(component.shadowRoot);\n const validationResultElement = component.shadowRoot.querySelector('.input-validation');\n\n assert.exists(validationResultElement);\n return validationResultElement;\n }\n\n before(() => {\n const targetManager = SDK.TargetManager.TargetManager.instance();\n const workspace = Workspace.Workspace.WorkspaceImpl.instance({forceNew: true});\n const resourceMapping = new Bindings.ResourceMapping.ResourceMapping(targetManager, workspace);\n const debuggerWorkspaceBinding = Bindings.DebuggerWorkspaceBinding.DebuggerWorkspaceBinding.instance(\n {forceNew: true, resourceMapping, targetManager});\n Bindings.IgnoreListManager.IgnoreListManager.instance({\n forceNew: true,\n debuggerWorkspaceBinding,\n });\n\n ignoreRegex('rule 1');\n });\n\n it('Able to render the ignore listed rules', async () => {\n const component = await renderIgnoreListSetting();\n const ignoredRules = getAllRules(component);\n\n // There is a default rule `/node_modules/|/bower_components/`\n assert.lengthOf(ignoredRules, 2);\n assert.deepEqual(ignoredRules[0].regex, '/node_modules/|/bower_components/');\n assert.isFalse(ignoredRules[0].disabled);\n assert.deepEqual(ignoredRules[1].regex, 'rule 1');\n assert.isFalse(ignoredRules[1].disabled);\n\n // Check the remove buttons are rendered\n assert.isNotNull(component.shadowRoot);\n const regexRowsElements = component.shadowRoot.querySelectorAll('.regex-row');\n Array.from(regexRowsElements).forEach(row => {\n const removeButton = row.querySelector('devtools-button');\n assert.exists(removeButton);\n });\n });\n\n it('Able to render the disabled ignore listed rules', async () => {\n disableIgnoreRegex('rule 1');\n\n const component = await renderIgnoreListSetting();\n const ignoredRules = getAllRules(component);\n\n // There is a default rule `/node_modules/|/bower_components/`\n assert.lengthOf(ignoredRules, 2);\n assert.deepEqual(ignoredRules[0].regex, '/node_modules/|/bower_components/');\n assert.isFalse(ignoredRules[0].disabled);\n assert.deepEqual(ignoredRules[1].regex, 'rule 1');\n assert.isTrue(ignoredRules[1].disabled);\n });\n\n it('Able to toggle the disable status of an ignore listed rules', async () => {\n const component = await renderIgnoreListSetting();\n\n assert.isNotNull(component.shadowRoot);\n const regexRows = component.shadowRoot.querySelectorAll('.regex-row');\n // \"rule 1\" is the second in the view.\n // Now the \"rule 1\" is disabled (by last test), so click the checkbox, it will be enabled.\n // Add sanity checks to make sure.\n const checkboxShadow = regexRows[1].querySelector('dt-checkbox')?.shadowRoot;\n assert.strictEqual(checkboxShadow?.querySelector('label')?.textContent, 'rule 1');\n assert.isTrue(isIgnoreRegexDisabled('rule 1'));\n\n const rule1CheckBox = checkboxShadow?.querySelector('input');\n rule1CheckBox?.click();\n assert.isFalse(isIgnoreRegexDisabled('rule 1'));\n });\n\n it('Able to remove an ignore list rule', async () => {\n const component = await renderIgnoreListSetting();\n\n assert.isNotNull(component.shadowRoot);\n const regexRows = component.shadowRoot.querySelectorAll('.regex-row');\n // \"rule 1\" is the second in the view.\n // Add sanity checks to make sure.\n const checkboxShadow = regexRows[1].querySelector('dt-checkbox')?.shadowRoot;\n assert.strictEqual(checkboxShadow?.querySelector('label')?.textContent, 'rule 1');\n assert.isTrue(isRegexInIgnoredList('rule 1'));\n\n const rule1RemoveButton = regexRows[1].querySelector('devtools-button');\n rule1RemoveButton?.click();\n assert.isFalse(isRegexInIgnoredList('rule 1'));\n });\n\n it('Able to render the add new regex row correctly', async () => {\n const component = await renderIgnoreListSetting();\n assert.isNotNull(component.shadowRoot);\n\n const newRegexRows = component.shadowRoot.querySelectorAll('.new-regex-row');\n // There should only be one add new regex row.\n assert.lengthOf(newRegexRows, 1);\n // There are two elements, one is checkbox, one is the input\n const newRegexCheckboxes = newRegexRows[0].querySelectorAll('dt-checkbox');\n assert.lengthOf(newRegexCheckboxes, 1);\n const newRegexInputs = newRegexRows[0].querySelectorAll('.new-regex-text-input');\n assert.lengthOf(newRegexInputs, 1);\n });\n\n it('Able to add an ignore list rule', async () => {\n // Now there should only by 1 rule (`/node_modules/|/bower_components/`)\n assert.isFalse(isRegexInIgnoredList('rule 1'));\n\n const component = await renderIgnoreListSetting();\n const newRegexInput = getNewRegexInput(component);\n\n newRegexInput.value = 'rule 1';\n dispatchBlurEvent(newRegexInput);\n\n assert.isTrue(isRegexInIgnoredList('rule 1'));\n });\n\n it('Do not add a duplicate ignore list rule', async () => {\n disableIgnoreRegex('rule 1');\n assert.isTrue(isIgnoreRegexDisabled('rule 1'));\n\n const component = await renderIgnoreListSetting();\n const newRegexInput = getNewRegexInput(component);\n\n newRegexInput.value = 'rule 1';\n dispatchBlurEvent(newRegexInput);\n\n assert.isFalse(isIgnoreRegexDisabled('rule 1'));\n });\n\n it('Do not show warning message for valid rule', async () => {\n const component = await renderIgnoreListSetting();\n const newRegexInput = getNewRegexInput(component);\n\n dispatchFocusEvent(newRegexInput);\n newRegexInput.value = 'rule 2';\n dispatchInputEvent(newRegexInput);\n await RenderCoordinator.done();\n\n const validationResultElement = component.shadowRoot?.querySelector('.input-validation');\n assert.notExists(validationResultElement);\n\n // We need this to simulate the 'finish editing' with empty input, so it can remove the temp regex. Otherwise the\n // future tests will be messed up.\n // The 'finish editing' part will be tested later\n newRegexInput.value = '';\n dispatchBlurEvent(newRegexInput);\n });\n\n it('Show error message for invalid rule', async () => {\n // One example of invalid rule is duplicate input.\n assert.isTrue(isRegexInIgnoredList('rule 1'));\n\n const component = await renderIgnoreListSetting();\n const newRegexInput = getNewRegexInput(component);\n\n dispatchFocusEvent(newRegexInput);\n newRegexInput.value = 'rule 1';\n dispatchInputEvent(newRegexInput);\n await RenderCoordinator.done();\n\n const validationResultElement = getValidationResultElement(component);\n assert.isFalse(validationResultElement.hidden);\n assert.isTrue(validationResultElement.classList.contains('input-validation-error'));\n assert.isNotEmpty(validationResultElement.textContent);\n\n // We need this to simulate the 'finish editing' with empty input, so it can remove the temp regex. Otherwise the\n // future tests will be messed up.\n // The 'finish editing' part will be tested later\n newRegexInput.value = '';\n dispatchBlurEvent(newRegexInput);\n });\n\n it('Show warning message for valid rule with warning message', async () => {\n // One example of valid rule with warning message is when a rule is disabled and it is added again.\n disableIgnoreRegex('rule 1');\n assert.isTrue(isIgnoreRegexDisabled('rule 1'));\n\n const component = await renderIgnoreListSetting();\n const newRegexInput = getNewRegexInput(component);\n\n dispatchFocusEvent(newRegexInput);\n newRegexInput.value = 'rule 1';\n dispatchInputEvent(newRegexInput);\n await RenderCoordinator.done();\n\n const validationResultElement = getValidationResultElement(component);\n assert.isFalse(validationResultElement.hidden);\n assert.isFalse(validationResultElement.classList.contains('input-validation-error'));\n assert.isNotEmpty(validationResultElement.textContent);\n\n // We need this to simulate the 'finish editing' with empty input, so it can remove the temp regex. Otherwise the\n // future tests will be messed up.\n // The 'finish editing' part will be tested later\n newRegexInput.value = '';\n dispatchBlurEvent(newRegexInput);\n });\n\n describe('preview the result', () => {\n it('Add an empty regex when focusing on the input', async () => {\n const regexPatterns = getIgnoredRegexes();\n // There is a default rule `/node_modules/|/bower_components/`, and the 'rule 1' we added.\n assert.lengthOf(regexPatterns, 2);\n\n const component = await renderIgnoreListSetting();\n const newRegexInput = getNewRegexInput(component);\n\n dispatchFocusEvent(newRegexInput);\n assert.lengthOf(regexPatterns, 3);\n\n // We need this to simulate the 'finish editing', so it can remove the temp regex. Otherwise the future tests will\n // be messed up.\n // The 'finish editing' part will be tested later\n dispatchBlurEvent(newRegexInput);\n });\n\n it('Update the regex when user typing', async () => {\n const regexPatterns = getIgnoredRegexes();\n // There is a default rule `/node_modules/|/bower_components/`, and the 'rule 1' we added.\n assert.lengthOf(regexPatterns, 2);\n\n const component = await renderIgnoreListSetting();\n const newRegexInput = getNewRegexInput(component);\n\n dispatchFocusEvent(newRegexInput);\n assert.lengthOf(regexPatterns, 3);\n // After the focus event, the temp regex (last one) is still empty.\n assert.strictEqual(regexPatterns[2].pattern, '');\n // Simulate user's typing\n newRegexInput.value = 'r';\n dispatchInputEvent(newRegexInput);\n // After the input event, the temp regex (last one) is updated.\n assert.strictEqual(regexPatterns[2].pattern, 'r');\n\n // We need this to simulate the 'finish editing' with empty input, so it can remove the temp regex. Otherwise the\n // future tests will be messed up.\n // The 'finish editing' part will be tested later\n newRegexInput.value = '';\n dispatchBlurEvent(newRegexInput);\n });\n\n it('Add the regex when user finish typing', async () => {\n const regexPatterns = getIgnoredRegexes();\n // There is a default rule `/node_modules/|/bower_components/`, and the 'rule 1' we added.\n assert.lengthOf(regexPatterns, 2);\n\n const component = await renderIgnoreListSetting();\n const newRegexInput = getNewRegexInput(component);\n\n dispatchFocusEvent(newRegexInput);\n newRegexInput.value = 'rule 2';\n assert.lengthOf(regexPatterns, 3);\n\n dispatchBlurEvent(newRegexInput);\n // When add a valid rule, the temp regex won't be removed.\n assert.lengthOf(regexPatterns, 3);\n assert.strictEqual(regexPatterns[2].pattern, 'rule 2');\n });\n\n it('Remove the invalid regex when user finish typing', async () => {\n const regexPatterns = getIgnoredRegexes();\n // There is a default rule `/node_modules/|/bower_components/`, and the 'rule 1', 'rule 2' we added.\n assert.lengthOf(regexPatterns, 3);\n\n const component = await renderIgnoreListSetting();\n const newRegexInput = getNewRegexInput(component);\n\n dispatchFocusEvent(newRegexInput);\n // This is a duplicate rule, so it is invalid.\n newRegexInput.value = 'rule 2';\n assert.lengthOf(regexPatterns, 4);\n\n dispatchBlurEvent(newRegexInput);\n // When add an invalid rule, the temp regex will be removed.\n assert.lengthOf(regexPatterns, 3);\n });\n\n it('Clear the input when `Escape` is pressed', async () => {\n const component = await renderIgnoreListSetting();\n const newRegexInput = getNewRegexInput(component);\n\n // This is a duplicate rule, so it is invalid.\n newRegexInput.value = 'rule 2';\n\n dispatchKeyDownEvent(newRegexInput, {key: Platform.KeyboardUtilities.ESCAPE_KEY});\n // When add an invalid rule, the temp regex will be removed.\n assert.strictEqual('', newRegexInput.value);\n });\n });\n});\n\ndescribeWithEnvironment('Pattern validator', () => {\n it('Can validate the valid pattern', () => {\n const validPattern = '^hello$';\n const result = TimelineComponents.IgnoreListSetting.patternValidator([], validPattern);\n assert.isTrue(result.valid);\n });\n\n it('Returns the reason for the empty pattern', () => {\n const emptyPattern = '';\n const result = TimelineComponents.IgnoreListSetting.patternValidator([], emptyPattern);\n assert.isFalse(result.valid);\n assert.strictEqual(result.message, 'Rule can\\'t be empty');\n });\n\n it('Returns the reason for the existed pattern', () => {\n const duplicatePattern = 'abc';\n const existedRegex = {pattern: duplicatePattern, disabled: false};\n\n const result = TimelineComponents.IgnoreListSetting.patternValidator([existedRegex], duplicatePattern);\n assert.isFalse(result.valid);\n assert.strictEqual(result.message, 'Rule already exists');\n });\n\n it('Returns true for the disabled existed pattern', () => {\n const duplicatePattern = 'abc';\n const existedRegex = {pattern: duplicatePattern, disabled: true};\n\n const result = TimelineComponents.IgnoreListSetting.patternValidator([existedRegex], duplicatePattern);\n assert.isTrue(result.valid);\n assert.strictEqual(\n result.message, 'This rule already exists but is disabled. Saving this value will re-enable the rule');\n });\n\n it('Returns the reason for the invalid pattern', () => {\n const invalidPattern = '[';\n const result = TimelineComponents.IgnoreListSetting.patternValidator([], invalidPattern);\n assert.isFalse(result.valid);\n assert.strictEqual(result.message, 'Rule must be a valid regular expression');\n });\n});\n\nfunction getIgnoredRegexes(): Common.Settings.RegExpSettingItem[] {\n return (Common.Settings.Settings.instance().moduleSetting('skip-stack-frames-pattern') as\n Common.Settings.RegExpSetting)\n .getAsArray();\n}\n\nfunction ignoreRegex(regexValue: string): void {\n const regexPatterns = getIgnoredRegexes();\n regexPatterns.push({pattern: regexValue, disabled: false});\n}\n\nfunction disableIgnoreRegex(regexValue: string): void {\n const regexPatterns = getIgnoredRegexes();\n for (const regexPattern of regexPatterns) {\n if (regexPattern.pattern === regexValue) {\n regexPattern.disabled = true;\n break;\n }\n }\n}\n\nfunction isIgnoreRegexDisabled(regexValue: string): boolean {\n const regexPatterns = getIgnoredRegexes();\n for (const regexPattern of regexPatterns) {\n if (regexPattern.pattern === regexValue) {\n return regexPattern.disabled ?? false;\n }\n }\n return false;\n}\n\n/**\n * Returns if the regex is in the ignore list, no matter if it is disabled.\n */\nfunction isRegexInIgnoredList(regexValue: string): boolean {\n const regexPatterns = getIgnoredRegexes();\n for (const regexPattern of regexPatterns) {\n if (regexPattern.pattern === regexValue) {\n return true;\n }\n }\n return false;\n}\n"]} \ No newline at end of file diff --git a/public/panels/timeline/components/InteractionBreakdown.test.js b/public/panels/timeline/components/InteractionBreakdown.test.js index b5f72a29a..59359c161 100644 --- a/public/panels/timeline/components/InteractionBreakdown.test.js +++ b/public/panels/timeline/components/InteractionBreakdown.test.js @@ -4,10 +4,9 @@ import { renderElementIntoDOM } from '../../../testing/DOMHelpers.js'; import { describeWithEnvironment } from '../../../testing/EnvironmentHelpers.js'; import { TraceLoader } from '../../../testing/TraceLoader.js'; -import * as Coordinator from '../../../ui/components/render_coordinator/render_coordinator.js'; +import * as RenderCoordinator from '../../../ui/components/render_coordinator/render_coordinator.js'; import * as TimelineComponents from './components.js'; describeWithEnvironment('InteractionBreakdown', () => { - const coordinator = Coordinator.RenderCoordinator.RenderCoordinator.instance(); const { InteractionBreakdown } = TimelineComponents.InteractionBreakdown; it('renders the breakdowns for an InteractionBreakdown', async function () { const { parsedTrace } = await TraceLoader.traceEngine(this, 'one-second-interaction.json.gz'); @@ -18,7 +17,7 @@ describeWithEnvironment('InteractionBreakdown', () => { const breakdown = new InteractionBreakdown(); breakdown.entry = longInteraction; renderElementIntoDOM(breakdown); - await coordinator.done(); + await RenderCoordinator.done(); assert.isNotNull(breakdown.shadowRoot); const inputDelay = breakdown.shadowRoot.querySelector('[data-entry="input-delay"] .value')?.textContent; assert.strictEqual(inputDelay, '1\xA0ms'); diff --git a/public/panels/timeline/components/InteractionBreakdown.test.js.map b/public/panels/timeline/components/InteractionBreakdown.test.js.map index 47d14d465..07b17580d 100644 --- a/public/panels/timeline/components/InteractionBreakdown.test.js.map +++ b/public/panels/timeline/components/InteractionBreakdown.test.js.map @@ -1 +1 @@ -{"version":3,"file":"InteractionBreakdown.test.js","sourceRoot":"","sources":["../../../../../../../front_end/panels/timeline/components/InteractionBreakdown.test.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,EAAC,oBAAoB,EAAC,MAAM,gCAAgC,CAAC;AACpE,OAAO,EAAC,uBAAuB,EAAC,MAAM,wCAAwC,CAAC;AAC/E,OAAO,EAAC,WAAW,EAAC,MAAM,iCAAiC,CAAC;AAC5D,OAAO,KAAK,WAAW,MAAM,iEAAiE,CAAC;AAE/F,OAAO,KAAK,kBAAkB,MAAM,iBAAiB,CAAC;AAEtD,uBAAuB,CAAC,sBAAsB,EAAE,GAAG,EAAE;IACnD,MAAM,WAAW,GAAG,WAAW,CAAC,iBAAiB,CAAC,iBAAiB,CAAC,QAAQ,EAAE,CAAC;IAC/E,MAAM,EAAC,oBAAoB,EAAC,GAAG,kBAAkB,CAAC,oBAAoB,CAAC;IAEvE,EAAE,CAAC,oDAAoD,EAAE,KAAK;QAC5D,MAAM,EAAC,WAAW,EAAC,GAAG,MAAM,WAAW,CAAC,WAAW,CAAC,IAAI,EAAE,gCAAgC,CAAC,CAAC;QAC5F,MAAM,eAAe,GAAG,WAAW,CAAC,gBAAgB,CAAC,uBAAuB,CAAC;QAC7E,IAAI,CAAC,eAAe,EAAE,CAAC;YACrB,MAAM,IAAI,KAAK,CAAC,oCAAoC,CAAC,CAAC;QACxD,CAAC;QAED,MAAM,SAAS,GAAG,IAAI,oBAAoB,EAAE,CAAC;QAC7C,SAAS,CAAC,KAAK,GAAG,eAAe,CAAC;QAClC,oBAAoB,CAAC,SAAS,CAAC,CAAC;QAChC,MAAM,WAAW,CAAC,IAAI,EAAE,CAAC;QACzB,MAAM,CAAC,SAAS,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC;QAEvC,MAAM,UAAU,GAAG,SAAS,CAAC,UAAU,CAAC,aAAa,CAAC,mCAAmC,CAAC,EAAE,WAAW,CAAC;QACxG,MAAM,CAAC,WAAW,CAAC,UAAU,EAAE,SAAS,CAAC,CAAC;QAC1C,MAAM,kBAAkB,GACpB,SAAS,CAAC,UAAU,CAAC,aAAa,CAAC,2CAA2C,CAAC,EAAE,WAAW,CAAC;QACjG,MAAM,CAAC,WAAW,CAAC,kBAAkB,EAAE,WAAW,CAAC,CAAC;QACpD,MAAM,iBAAiB,GACnB,SAAS,CAAC,UAAU,CAAC,aAAa,CAAC,0CAA0C,CAAC,EAAE,WAAW,CAAC;QAChG,MAAM,CAAC,WAAW,CAAC,iBAAiB,EAAE,SAAS,CAAC,CAAC;IACnD,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["// Copyright 2023 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport {renderElementIntoDOM} from '../../../testing/DOMHelpers.js';\nimport {describeWithEnvironment} from '../../../testing/EnvironmentHelpers.js';\nimport {TraceLoader} from '../../../testing/TraceLoader.js';\nimport * as Coordinator from '../../../ui/components/render_coordinator/render_coordinator.js';\n\nimport * as TimelineComponents from './components.js';\n\ndescribeWithEnvironment('InteractionBreakdown', () => {\n const coordinator = Coordinator.RenderCoordinator.RenderCoordinator.instance();\n const {InteractionBreakdown} = TimelineComponents.InteractionBreakdown;\n\n it('renders the breakdowns for an InteractionBreakdown', async function() {\n const {parsedTrace} = await TraceLoader.traceEngine(this, 'one-second-interaction.json.gz');\n const longInteraction = parsedTrace.UserInteractions.longestInteractionEvent;\n if (!longInteraction) {\n throw new Error('Could not find longest interaction');\n }\n\n const breakdown = new InteractionBreakdown();\n breakdown.entry = longInteraction;\n renderElementIntoDOM(breakdown);\n await coordinator.done();\n assert.isNotNull(breakdown.shadowRoot);\n\n const inputDelay = breakdown.shadowRoot.querySelector('[data-entry=\"input-delay\"] .value')?.textContent;\n assert.strictEqual(inputDelay, '1\\xA0ms');\n const processingDuration =\n breakdown.shadowRoot.querySelector('[data-entry=\"processing-duration\"] .value')?.textContent;\n assert.strictEqual(processingDuration, '977\\xA0ms');\n const presentationDelay =\n breakdown.shadowRoot.querySelector('[data-entry=\"presentation-delay\"] .value')?.textContent;\n assert.strictEqual(presentationDelay, '2\\xA0ms');\n });\n});\n"]} \ No newline at end of file +{"version":3,"file":"InteractionBreakdown.test.js","sourceRoot":"","sources":["../../../../../../../front_end/panels/timeline/components/InteractionBreakdown.test.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,EAAC,oBAAoB,EAAC,MAAM,gCAAgC,CAAC;AACpE,OAAO,EAAC,uBAAuB,EAAC,MAAM,wCAAwC,CAAC;AAC/E,OAAO,EAAC,WAAW,EAAC,MAAM,iCAAiC,CAAC;AAC5D,OAAO,KAAK,iBAAiB,MAAM,iEAAiE,CAAC;AAErG,OAAO,KAAK,kBAAkB,MAAM,iBAAiB,CAAC;AAEtD,uBAAuB,CAAC,sBAAsB,EAAE,GAAG,EAAE;IACnD,MAAM,EAAC,oBAAoB,EAAC,GAAG,kBAAkB,CAAC,oBAAoB,CAAC;IAEvE,EAAE,CAAC,oDAAoD,EAAE,KAAK;QAC5D,MAAM,EAAC,WAAW,EAAC,GAAG,MAAM,WAAW,CAAC,WAAW,CAAC,IAAI,EAAE,gCAAgC,CAAC,CAAC;QAC5F,MAAM,eAAe,GAAG,WAAW,CAAC,gBAAgB,CAAC,uBAAuB,CAAC;QAC7E,IAAI,CAAC,eAAe,EAAE,CAAC;YACrB,MAAM,IAAI,KAAK,CAAC,oCAAoC,CAAC,CAAC;QACxD,CAAC;QAED,MAAM,SAAS,GAAG,IAAI,oBAAoB,EAAE,CAAC;QAC7C,SAAS,CAAC,KAAK,GAAG,eAAe,CAAC;QAClC,oBAAoB,CAAC,SAAS,CAAC,CAAC;QAChC,MAAM,iBAAiB,CAAC,IAAI,EAAE,CAAC;QAC/B,MAAM,CAAC,SAAS,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC;QAEvC,MAAM,UAAU,GAAG,SAAS,CAAC,UAAU,CAAC,aAAa,CAAC,mCAAmC,CAAC,EAAE,WAAW,CAAC;QACxG,MAAM,CAAC,WAAW,CAAC,UAAU,EAAE,SAAS,CAAC,CAAC;QAC1C,MAAM,kBAAkB,GACpB,SAAS,CAAC,UAAU,CAAC,aAAa,CAAC,2CAA2C,CAAC,EAAE,WAAW,CAAC;QACjG,MAAM,CAAC,WAAW,CAAC,kBAAkB,EAAE,WAAW,CAAC,CAAC;QACpD,MAAM,iBAAiB,GACnB,SAAS,CAAC,UAAU,CAAC,aAAa,CAAC,0CAA0C,CAAC,EAAE,WAAW,CAAC;QAChG,MAAM,CAAC,WAAW,CAAC,iBAAiB,EAAE,SAAS,CAAC,CAAC;IACnD,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["// Copyright 2023 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport {renderElementIntoDOM} from '../../../testing/DOMHelpers.js';\nimport {describeWithEnvironment} from '../../../testing/EnvironmentHelpers.js';\nimport {TraceLoader} from '../../../testing/TraceLoader.js';\nimport * as RenderCoordinator from '../../../ui/components/render_coordinator/render_coordinator.js';\n\nimport * as TimelineComponents from './components.js';\n\ndescribeWithEnvironment('InteractionBreakdown', () => {\n const {InteractionBreakdown} = TimelineComponents.InteractionBreakdown;\n\n it('renders the breakdowns for an InteractionBreakdown', async function() {\n const {parsedTrace} = await TraceLoader.traceEngine(this, 'one-second-interaction.json.gz');\n const longInteraction = parsedTrace.UserInteractions.longestInteractionEvent;\n if (!longInteraction) {\n throw new Error('Could not find longest interaction');\n }\n\n const breakdown = new InteractionBreakdown();\n breakdown.entry = longInteraction;\n renderElementIntoDOM(breakdown);\n await RenderCoordinator.done();\n assert.isNotNull(breakdown.shadowRoot);\n\n const inputDelay = breakdown.shadowRoot.querySelector('[data-entry=\"input-delay\"] .value')?.textContent;\n assert.strictEqual(inputDelay, '1\\xA0ms');\n const processingDuration =\n breakdown.shadowRoot.querySelector('[data-entry=\"processing-duration\"] .value')?.textContent;\n assert.strictEqual(processingDuration, '977\\xA0ms');\n const presentationDelay =\n breakdown.shadowRoot.querySelector('[data-entry=\"presentation-delay\"] .value')?.textContent;\n assert.strictEqual(presentationDelay, '2\\xA0ms');\n });\n});\n"]} \ No newline at end of file diff --git a/public/panels/timeline/components/LiveMetricsView.js b/public/panels/timeline/components/LiveMetricsView.js index 371f0ce84..9549f2ed7 100644 --- a/public/panels/timeline/components/LiveMetricsView.js +++ b/public/panels/timeline/components/LiveMetricsView.js @@ -15,7 +15,7 @@ import * as LiveMetrics from '../../../models/live-metrics/live-metrics.js'; import * as Buttons from '../../../ui/components/buttons/buttons.js'; import * as ComponentHelpers from '../../../ui/components/helpers/helpers.js'; import * as LegacyWrapper from '../../../ui/components/legacy_wrapper/legacy_wrapper.js'; -import * as Coordinator from '../../../ui/components/render_coordinator/render_coordinator.js'; +import * as RenderCoordinator from '../../../ui/components/render_coordinator/render_coordinator.js'; import * as UI from '../../../ui/legacy/legacy.js'; import * as LitHtml from '../../../ui/lit-html/lit-html.js'; import * as VisualLogging from '../../../ui/visual_logging/visual_logging.js'; @@ -25,7 +25,6 @@ import liveMetricsViewStyles from './liveMetricsView.css.js'; import metricValueStyles from './metricValueStyles.css.js'; import { CLS_THRESHOLDS, INP_THRESHOLDS, renderMetricValue } from './Utils.js'; const { html, nothing } = LitHtml; -const coordinator = Coordinator.RenderCoordinator.RenderCoordinator.instance(); const DEVICE_OPTION_LIST = ['AUTO', ...CrUXManager.DEVICE_SCOPE_LIST]; const RTT_MINIMUM = 60; const UIStrings = { @@ -754,7 +753,7 @@ export class LiveMetricsView extends LegacyWrapper.LegacyWrapper.WrappableCompon if (!success) { return; } - await coordinator.write(() => { + await RenderCoordinator.write(() => { interactionEl.scrollIntoView({ block: 'center', }); @@ -854,7 +853,7 @@ export class LiveMetricsView extends LegacyWrapper.LegacyWrapper.WrappableCompon if (!success) { return; } - await coordinator.write(() => { + await RenderCoordinator.write(() => { layoutShiftEls[0].scrollIntoView({ block: 'start', }); diff --git a/public/panels/timeline/components/LiveMetricsView.js.map b/public/panels/timeline/components/LiveMetricsView.js.map index 3c8022921..9f1757baf 100644 --- a/public/panels/timeline/components/LiveMetricsView.js.map +++ b/public/panels/timeline/components/LiveMetricsView.js.map @@ -1 +1 @@ -{"version":3,"file":"LiveMetricsView.js","sourceRoot":"","sources":["../../../../../../../front_end/panels/timeline/components/LiveMetricsView.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,mDAAmD,CAAC;AAC3D,OAAO,4BAA4B,CAAC;AACpC,OAAO,0BAA0B,CAAC;AAClC,OAAO,gCAAgC,CAAC;AACxC,OAAO,uCAAuC,CAAC;AAC/C,OAAO,iBAAiB,CAAC;AAEzB,OAAO,KAAK,MAAM,MAAM,gCAAgC,CAAC;AACzD,OAAO,KAAK,IAAI,MAAM,4BAA4B,CAAC;AAEnD,OAAO,KAAK,WAAW,MAAM,8CAA8C,CAAC;AAC5E,OAAO,KAAK,cAAc,MAAM,wCAAwC,CAAC;AACzE,OAAO,KAAK,WAAW,MAAM,8CAA8C,CAAC;AAC5E,OA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AAgB,CAAC,CAAC;QAC7E,IAAI,CAAC,WAAW,CAAC,SAAS,CACtB,eAAe,EAAE,UAAU,CAAC,SAAS,CAAC,YAAY,CAAC,EAAE,eAAe,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EACrG,SAAS,EAAE,SAAS,EAAE,oCAAoC,CAAC,CAAC;QAEhE,MAAM,WAAW,GAAG,IAAI,EAAE,CAAC,OAAO,CAAC,aAAa,CAC5C,UAAU,CAAC,SAAS,CAAC,eAAe,CAAC,EAAE,OAAO,EAAE,SAAS,EAAE,4BAA4B,CAAC,CAAC;QAC7F,WAAW,CAAC,gBAAgB,sDAAwC,IAAI,CAAC,gBAAgB,EAAE,IAAI,CAAC,CAAC;QACjG,IAAI,CAAC,WAAW,CAAC,YAAY,EAAE,CAAC,iBAAiB,CAAC,WAAW,CAAC,CAAC;QAC/D,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,eAAe,CAAC,cAAc,CAAC,CAAC;QAEtD,OAAO,eAAe,CAAC;IACzB,CAAC;CACF;AAED,cAAc,CAAC,MAAM,CAAC,4BAA4B,EAAE,eAAe,CAAC,CAAC;AACrE,cAAc,CAAC,MAAM,CAAC,4BAA4B,EAAE,eAAe,CAAC,CAAC","sourcesContent":["// Copyright 2024 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport '../../../ui/components/icon_button/icon_button.js';\nimport './CPUThrottlingSelector.js';\nimport './FieldSettingsDialog.js';\nimport './NetworkThrottlingSelector.js';\nimport '../../../ui/components/menus/menus.js';\nimport './MetricCard.js';\n\nimport * as Common from '../../../core/common/common.js';\nimport * as i18n from '../../../core/i18n/i18n.js';\nimport type * as Platform from '../../../core/platform/platform.js';\nimport * as CrUXManager from '../../../models/crux-manager/crux-manager.js';\nimport * as EmulationModel from '../../../models/emulation/emulation.js';\nimport * as LiveMetrics from '../../../models/live-metrics/live-metrics.js';\nimport * as Buttons from '../../../ui/components/buttons/buttons.js';\nimport * as ComponentHelpers from '../../../ui/components/helpers/helpers.js';\nimport * as LegacyWrapper from '../../../ui/components/legacy_wrapper/legacy_wrapper.js';\nimport type * as Menus from '../../../ui/components/menus/menus.js';\nimport * as Coordinator from '../../../ui/components/render_coordinator/render_coordinator.js';\nimport type * as Settings from '../../../ui/components/settings/settings.js';\nimport * as UI from '../../../ui/legacy/legacy.js';\nimport * as LitHtml from '../../../ui/lit-html/lit-html.js';\nimport * as VisualLogging from '../../../ui/visual_logging/visual_logging.js';\nimport * as MobileThrottling from '../../mobile_throttling/mobile_throttling.js';\nimport {getThrottlingRecommendations, md} from '../utils/Helpers.js';\n\nimport liveMetricsViewStyles from './liveMetricsView.css.js';\nimport type {MetricCardData} from './MetricCard.js';\nimport metricValueStyles from './metricValueStyles.css.js';\nimport {CLS_THRESHOLDS, INP_THRESHOLDS, renderMetricValue} from './Utils.js';\n\nconst {html, nothing} = LitHtml;\n\ntype DeviceOption = CrUXManager.DeviceScope|'AUTO';\n\nconst coordinator = Coordinator.RenderCoordinator.RenderCoordinator.instance();\n\nconst DEVICE_OPTION_LIST: DeviceOption[] = ['AUTO', ...CrUXManager.DEVICE_SCOPE_LIST];\n\nconst RTT_MINIMUM = 60;\n\nconst UIStrings = {\n /**\n * @description Title of a view that shows performance metrics from the local environment and field metrics collected from real users. \"field metrics\" should be interpreted as \"real user metrics\".\n */\n localAndFieldMetrics: 'Local and field metrics',\n /**\n * @description Title of a view that shows performance metrics from the local environment.\n */\n localMetrics: 'Local metrics',\n /**\n * @description Accessible label for a section that logs user interactions and layout shifts. A layout shift is an event that shifts content in the layout of the page causing a jarring experience for the user.\n */\n eventLogs: 'Interaction and layout shift logs section',\n /**\n * @description Title of a section that lists user interactions.\n */\n interactions: 'Interactions',\n /**\n * @description Title of a section that lists layout shifts. A layout shift is an event that shifts content in the layout of the page causing a jarring experience for the user.\n */\n layoutShifts: 'Layout shifts',\n /**\n * @description Title of a sidebar section that shows options for the user to take after using the main view.\n */\n nextSteps: 'Next steps',\n /**\n * @description Title of a section that shows options for how real user data in the field should be fetched. This should be interpreted as \"Real user data\".\n */\n fieldData: 'Field data',\n /**\n * @description Title of a section that shows settings to control the developers local testing environment.\n */\n environmentSettings: 'Environment settings',\n /**\n * @description Label for an select box that selects which device type field data be shown for (e.g. desktop/mobile/all devices/etc). \"field data\" should be interpreted as \"real user data\".\n * @example {Mobile} PH1\n */\n showFieldDataForDevice: 'Show field data for device type: {PH1}',\n /**\n * @description Text indicating that there is not enough data to report real user statistics.\n */\n notEnoughData: 'Not enough data',\n /**\n * @description Label for a text block that describes the network connections of real users.\n * @example {75th percentile is similar to Slow 4G throttling} PH1\n */\n network: 'Network: {PH1}',\n /**\n * @description Label for an select box that selects which device type real user data should be shown for (e.g. desktop/mobile/all devices/etc).\n * @example {Mobile} PH1\n */\n device: 'Device: {PH1}',\n /**\n * @description Label for an option to select all device form factors.\n */\n allDevices: 'All devices',\n /**\n * @description Label for an option to select the desktop form factor.\n */\n desktop: 'Desktop',\n /**\n * @description Label for an option to select the mobile form factor.\n */\n mobile: 'Mobile',\n /**\n * @description Label for an option to select the tablet form factor.\n */\n tablet: 'Tablet',\n /**\n * @description Label for an option to to automatically select the form factor. The automatic selection will be displayed in PH1.\n * @example {Desktop} PH1\n */\n auto: 'Auto ({PH1})',\n /**\n * @description Label for an option that is loading.\n * @example {Desktop} PH1\n */\n loadingOption: '{PH1} - Loading…',\n /**\n * @description Label for an option that does not have enough data and the user should ignore.\n * @example {Desktop} PH1\n */\n needsDataOption: '{PH1} - No data',\n /**\n * @description Label for an option that selects the page's specific URL as opposed to it's entire origin/domain.\n */\n urlOption: 'URL',\n /**\n * @description Label for an option that selects the page's entire origin/domain as opposed to it's specific URL.\n */\n originOption: 'Origin',\n /**\n * @description Label for an option that selects the page's specific URL as opposed to it's entire origin/domain.\n * @example {https://example.com/} PH1\n */\n urlOptionWithKey: 'URL: {PH1}',\n /**\n * @description Label for an option that selects the page's entire origin/domain as opposed to it's specific URL.\n * @example {https://example.com} PH1\n */\n originOptionWithKey: 'Origin: {PH1}',\n /**\n * @description Label for an combo-box that indicates if field data should be taken from the page's URL or it's origin/domain. \"field data\" should be interpreted as \"real user data\".\n * @example {Origin: https://example.com} PH1\n */\n showFieldDataForPage: 'Show field data for {PH1}',\n /**\n * @description Tooltip text explaining that real user connections are similar to a test environment with no throttling. \"throttling\" is when the network is intentionally slowed down to simulate a slower connection.\n */\n tryDisablingThrottling: '75th percentile is too fast to simulate with throttling',\n /**\n * @description Tooltip text explaining that real user connections are similar to a specif network throttling setup. \"throttling\" is when the network is intentionally slowed down to simulate a slower connection.\n * @example {Slow 4G} PH1\n */\n tryUsingThrottling: '75th percentile is similar to {PH1} throttling',\n /**\n * @description Text block listing what percentage of real users are on different device form factors.\n * @example {60%} PH1\n * @example {30%} PH2\n */\n percentDevices: '{PH1}% mobile, {PH2}% desktop',\n /**\n * @description Text block explaining how to simulate different mobile and desktop devices.\n */\n useDeviceToolbar:\n 'Use the [device toolbar](https://developer.chrome.com/docs/devtools/device-mode) and configure throttling to simulate real user environments and identify more performance issues.',\n /**\n * @description Text label for a checkbox that controls if the network cache is disabled.\n */\n disableNetworkCache: 'Disable network cache',\n /**\n * @description Text label for a link to the Largest Contentful Paint (LCP) related page element. This element represents the largest content on the page. \"LCP\" should not be translated.\n */\n lcpElement: 'LCP element',\n /**\n * @description Text label for a button that reveals the user interaction associated with the Interaction to Next Paint (INP) performance metric. \"INP\" should not be translated.\n */\n inpInteractionLink: 'INP interaction',\n /**\n * @description Text label for a button that reveals the cluster of layout shift events that affected the page content the most. A cluster is a group of layout shift events that occur in quick succession.\n */\n worstCluster: 'Worst cluster',\n /**\n * @description [ICU Syntax] Text content of a button that reveals the cluster of layout shift events that affected the page content the most. A layout shift is an event that shifts content in the layout of the page causing a jarring experience for the user. This text will indicate how many shifts were in the cluster.\n * @example {3} shiftCount\n */\n numShifts: `{shiftCount, plural,\n =1 {{shiftCount} shift}\n other {{shiftCount} shifts}\n }`,\n /**\n * @description Label for a a range of dates that represents the period of time a set of field data is collected from.\n * @example {Oct 1, 2024 - Nov 1, 2024} PH1\n */\n collectionPeriod: 'Collection period: {PH1}',\n /**\n * @description Text showing a range of dates meant to represent a period of time.\n * @example {Oct 1, 2024} PH1\n * @example {Nov 1, 2024} PH2\n */\n dateRange: '{PH1} - {PH2}',\n /**\n * @description Text block telling the user to see how performance metrics measured on their local computer compare to data collected from real users. PH1 will be a link to more information about the Chrome UX Report and the link text will be untranslated because it is a product name.\n * @example {Chrome UX Report} PH1\n */\n seeHowYourLocalMetricsCompare: 'See how your local metrics compare to real user data in the {PH1}.',\n /**\n * @description Text for a link that goes to more documentation about local and field data. \"Local\" refers to performance metrics measured in the developers local environment. \"field data\" should be interpreted as \"real user data\".\n */\n localFieldLearnMoreLink: 'Learn more about local and field data',\n /**\n * @description Tooltip text for a link that goes to documentation explaining the difference between local and field metrics. \"Local metrics\" are performance metrics measured in the developers local environment. \"field data\" should be interpreted as \"real user data\".\n */\n localFieldLearnMoreTooltip:\n 'Local metrics are captured from the current page using your network connection and device. Field data is measured by real users using many different network connections and devices.',\n /**\n * @description Tooltip text explaining that this user interaction was ignored when calculating the Interaction to Next Paint (INP) metric because the interaction delay fell beyond the 98th percentile of interaction delays on this page. \"INP\" is an acronym and should not be translated.\n */\n interactionExcluded:\n 'INP is calculated using the 98th percentile of interaction delays, so some interaction delays may be larger than the INP value.',\n /**\n * @description Tooltip for a button that will remove everything from the currently selected log.\n */\n clearCurrentLog: 'Clear the current log',\n /**\n * @description Title for a page load phase that measures the time between when the page load starts and the time when the first byte of the initial document is downloaded.\n */\n timeToFirstByte: 'Time to first byte',\n /**\n * @description Title for a page load phase that measures the time between when the first byte of the initial document is downloaded and when the request for the largest image content starts.\n */\n resourceLoadDelay: 'Resource load delay',\n /**\n * @description Title for a page load phase that measures the time between when the request for the largest image content starts and when it finishes.\n */\n resourceLoadDuration: 'Resource load duration',\n /**\n * @description Title for a page load phase that measures the time between when the request for the largest image content finishes and when the largest image element is rendered on the page.\n */\n elementRenderDelay: 'Element render delay',\n /**\n * @description Title for a phase during a user interaction that measures the time between when the interaction starts and when the browser starts running interaction handlers.\n */\n inputDelay: 'Input delay',\n /**\n * @description Title for a phase during a user interaction that measures the time between when the browser starts running interaction handlers and when the browser finishes running interaction handlers.\n */\n processingDuration: 'Processing duration',\n /**\n * @description Title for a phase during a user interaction that measures the time between when the browser finishes running interaction handlers and when the browser renders the next visual frame that shows the result of the interaction.\n */\n presentationDelay: 'Presentation delay',\n /**\n * @description Tooltip text for a status chip in a list of user interactions that indicates if the associated interaction is the interaction used in the Interaction to Next Paint (INP) performance metric because it's interaction delay is at the 98th percentile.\n */\n inpInteraction: 'The INP interaction is at the 98th percentile of interaction delays.',\n /**\n * @description Tooltip text for a button that reveals the user interaction associated with the Interaction to Next Paint (INP) performance metric.\n */\n showInpInteraction: 'Go to the INP interaction.',\n /**\n * @description Tooltip text for a button that reveals the cluster of layout shift events that affected the page content the most. A layout shift is an event that shifts content in the layout of the page causing a jarring experience for the user. A cluster is a group of layout shift events that occur in quick succession.\n */\n showClsCluster: 'Go to worst layout shift cluster.',\n /**\n * @description Column header for table cell values representing the phase/component/stage/section of a larger duration.\n */\n phase: 'Phase',\n /**\n * @description Column header for table cell values representing a phase duration (in milliseconds) that was measured in the developers local environment.\n */\n duration: 'Local duration (ms)',\n /**\n * @description Tooltip text for a button that will open the Chrome DevTools console to and log additional details about a user interaction.\n */\n logToConsole: 'Log additional interaction data to the console',\n /**\n * @description Title of a view that can be used to analyze the performance of a Node process as a timeline. \"Node\" is a product name and should not be translated.\n */\n nodePerformanceTimeline: 'Node performance',\n /**\n * @description Description of a view that can be used to analyze the performance of a Node process as a timeline. \"Node\" is a product name and should not be translated.\n */\n nodeClickToRecord: 'Record a performance timeline of the connected Node process.',\n};\n\nconst str_ = i18n.i18n.registerUIStrings('panels/timeline/components/LiveMetricsView.ts', UIStrings);\nconst i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);\n\nexport class LiveMetricsView extends LegacyWrapper.LegacyWrapper.WrappableComponent {\n readonly #shadow = this.attachShadow({mode: 'open'});\n\n #isNode: boolean = false;\n\n #lcpValue?: LiveMetrics.LCPValue;\n #clsValue?: LiveMetrics.CLSValue;\n #inpValue?: LiveMetrics.INPValue;\n #interactions: LiveMetrics.InteractionMap = new Map();\n #layoutShifts: LiveMetrics.LayoutShift[] = [];\n\n #cruxManager = CrUXManager.CrUXManager.instance();\n\n #toggleRecordAction: UI.ActionRegistration.Action;\n #recordReloadAction: UI.ActionRegistration.Action;\n\n #logsEl?: LiveMetricsLogs;\n #tooltipContainerEl?: Element;\n #interactionsListEl?: HTMLElement;\n #layoutShiftsListEl?: HTMLElement;\n #listIsScrolling = false;\n #deviceModeModel = EmulationModel.DeviceModeModel.DeviceModeModel.tryInstance();\n\n constructor() {\n super();\n\n this.#toggleRecordAction = UI.ActionRegistry.ActionRegistry.instance().getAction('timeline.toggle-recording');\n this.#recordReloadAction = UI.ActionRegistry.ActionRegistry.instance().getAction('timeline.record-reload');\n }\n\n set isNode(isNode: boolean) {\n this.#isNode = isNode;\n void ComponentHelpers.ScheduledRender.scheduleRender(this, this.#render);\n }\n\n #onMetricStatus(event: {data: LiveMetrics.StatusEvent}): void {\n this.#lcpValue = event.data.lcp;\n this.#clsValue = event.data.cls;\n this.#inpValue = event.data.inp;\n\n const hasNewLS = this.#layoutShifts.length < event.data.layoutShifts.length;\n this.#layoutShifts = [...event.data.layoutShifts];\n\n const hasNewInteraction = this.#interactions.size < event.data.interactions.size;\n this.#interactions = new Map(event.data.interactions);\n\n const renderPromise = ComponentHelpers.ScheduledRender.scheduleRender(this, this.#render);\n\n if (hasNewInteraction && this.#interactionsListEl) {\n this.#keepScrolledToBottom(renderPromise, this.#interactionsListEl);\n }\n\n if (hasNewLS && this.#layoutShiftsListEl) {\n this.#keepScrolledToBottom(renderPromise, this.#layoutShiftsListEl);\n }\n }\n\n #keepScrolledToBottom(renderPromise: Promise, listEl: HTMLElement): void {\n if (!listEl.checkVisibility()) {\n return;\n }\n\n const isAtBottom = Math.abs(listEl.scrollHeight - listEl.clientHeight - listEl.scrollTop) <= 1;\n\n // We shouldn't scroll to the bottom if the list wasn't already at the bottom.\n // However, if a new item appears while the animation for a previous item is still going,\n // then we should \"finish\" the scroll by sending another scroll command even if the scroll position\n // the element hasn't scrolled all the way to the bottom yet.\n if (!isAtBottom && !this.#listIsScrolling) {\n return;\n }\n\n void renderPromise.then(() => {\n requestAnimationFrame(() => {\n this.#listIsScrolling = true;\n listEl.addEventListener('scrollend', () => {\n this.#listIsScrolling = false;\n }, {once: true});\n listEl.scrollTo({top: listEl.scrollHeight, behavior: 'smooth'});\n });\n });\n }\n\n #onFieldDataChanged(): void {\n void ComponentHelpers.ScheduledRender.scheduleRender(this, this.#render);\n }\n\n #onEmulationChanged(): void {\n void ComponentHelpers.ScheduledRender.scheduleRender(this, this.#render);\n }\n\n async #refreshFieldDataForCurrentPage(): Promise {\n await this.#cruxManager.refresh();\n void ComponentHelpers.ScheduledRender.scheduleRender(this, this.#render);\n }\n\n connectedCallback(): void {\n this.#shadow.adoptedStyleSheets = [liveMetricsViewStyles, metricValueStyles];\n\n const liveMetrics = LiveMetrics.LiveMetrics.instance();\n liveMetrics.addEventListener(LiveMetrics.Events.STATUS, this.#onMetricStatus, this);\n\n const cruxManager = CrUXManager.CrUXManager.instance();\n cruxManager.addEventListener(CrUXManager.Events.FIELD_DATA_CHANGED, this.#onFieldDataChanged, this);\n\n this.#deviceModeModel?.addEventListener(\n EmulationModel.DeviceModeModel.Events.UPDATED, this.#onEmulationChanged, this);\n\n if (cruxManager.getConfigSetting().get().enabled) {\n void this.#refreshFieldDataForCurrentPage();\n }\n\n this.#lcpValue = liveMetrics.lcpValue;\n this.#clsValue = liveMetrics.clsValue;\n this.#inpValue = liveMetrics.inpValue;\n this.#interactions = liveMetrics.interactions;\n this.#layoutShifts = liveMetrics.layoutShifts;\n void ComponentHelpers.ScheduledRender.scheduleRender(this, this.#render);\n }\n\n disconnectedCallback(): void {\n LiveMetrics.LiveMetrics.instance().removeEventListener(LiveMetrics.Events.STATUS, this.#onMetricStatus, this);\n\n const cruxManager = CrUXManager.CrUXManager.instance();\n cruxManager.removeEventListener(CrUXManager.Events.FIELD_DATA_CHANGED, this.#onFieldDataChanged, this);\n\n this.#deviceModeModel?.removeEventListener(\n EmulationModel.DeviceModeModel.Events.UPDATED, this.#onEmulationChanged, this);\n }\n\n #renderLcpCard(): LitHtml.LitTemplate {\n const fieldData = this.#cruxManager.getSelectedFieldMetricData('largest_contentful_paint');\n const nodeLink = this.#lcpValue?.nodeRef?.link;\n const phases = this.#lcpValue?.phases;\n\n // clang-format off\n return html`\n \n ${nodeLink ? html`\n
\n ${i18nString(UIStrings.lcpElement)}\n ${nodeLink}\n
\n `\n : nothing}\n
\n `;\n // clang-format on\n }\n\n #renderClsCard(): LitHtml.LitTemplate {\n const fieldData = this.#cruxManager.getSelectedFieldMetricData('cumulative_layout_shift');\n\n const clusterIds = new Set(this.#clsValue?.clusterShiftIds || []);\n const clusterIsVisible =\n clusterIds.size > 0 && this.#layoutShifts.some(layoutShift => clusterIds.has(layoutShift.uniqueLayoutShiftId));\n\n // clang-format off\n return html`\n \n ${clusterIsVisible ? html`\n
\n ${i18nString(UIStrings.worstCluster)}\n this.#revealLayoutShiftCluster(clusterIds)}\n jslog=${VisualLogging.action('timeline.landing.show-cls-cluster').track({click: true})}\n >${i18nString(UIStrings.numShifts, {shiftCount: clusterIds.size})}\n
\n ` : nothing}\n
\n `;\n // clang-format on\n }\n\n #renderInpCard(): LitHtml.LitTemplate {\n const fieldData = this.#cruxManager.getSelectedFieldMetricData('interaction_to_next_paint');\n const phases = this.#inpValue?.phases;\n const interaction = this.#inpValue && this.#interactions.get(this.#inpValue.interactionId);\n\n // clang-format off\n return html`\n \n ${interaction ? html`\n
\n ${i18nString(UIStrings.inpInteractionLink)}\n this.#revealInteraction(interaction)}\n jslog=${VisualLogging.action('timeline.landing.show-inp-interaction').track({click: true})}\n >${interaction.interactionType}\n
\n ` : nothing}\n
\n `;\n // clang-format on\n }\n\n #renderRecordAction(action: UI.ActionRegistration.Action): LitHtml.LitTemplate {\n function onClick(): void {\n void action.execute();\n }\n\n // clang-format off\n return html`\n
\n \n ${action.title()}\n \n ${UI.ShortcutRegistry.ShortcutRegistry.instance().shortcutTitleForAction(action.id())}\n
\n `;\n // clang-format on\n }\n\n #getNetworkRecTitle(): string|null {\n const response = this.#cruxManager.getSelectedFieldMetricData('round_trip_time');\n if (!response?.percentiles) {\n return null;\n }\n\n const rtt = Number(response.percentiles.p75);\n if (!Number.isFinite(rtt)) {\n return null;\n }\n\n if (rtt < RTT_MINIMUM) {\n return i18nString(UIStrings.tryDisablingThrottling);\n }\n\n const conditions = MobileThrottling.ThrottlingPresets.ThrottlingPresets.getRecommendedNetworkPreset(rtt);\n if (!conditions) {\n return null;\n }\n\n const title = typeof conditions.title === 'function' ? conditions.title() : conditions.title;\n return i18nString(UIStrings.tryUsingThrottling, {PH1: title});\n }\n\n #getDeviceRec(): string|null {\n // `form_factors` metric is only populated if CrUX data is fetched for all devices.\n const fractions = this.#cruxManager.getFieldResponse(this.#cruxManager.fieldPageScope, 'ALL')\n ?.record.metrics.form_factors?.fractions;\n if (!fractions) {\n return null;\n }\n\n return i18nString(UIStrings.percentDevices, {\n PH1: Math.round(fractions.phone * 100),\n PH2: Math.round(fractions.desktop * 100),\n });\n }\n\n #renderRecordingSettings(): LitHtml.LitTemplate {\n const fieldEnabled = this.#cruxManager.getConfigSetting().get().enabled;\n\n const deviceRecEl = document.createElement('span');\n deviceRecEl.classList.add('environment-rec');\n deviceRecEl.textContent = this.#getDeviceRec() || i18nString(UIStrings.notEnoughData);\n\n const networkRecEl = document.createElement('span');\n networkRecEl.classList.add('environment-rec');\n networkRecEl.textContent = this.#getNetworkRecTitle() || i18nString(UIStrings.notEnoughData);\n\n const recs = getThrottlingRecommendations();\n\n // clang-format off\n return html`\n

${i18nString(UIStrings.environmentSettings)}

\n
${md(i18nString(UIStrings.useDeviceToolbar))}
\n ${fieldEnabled ? html`\n
    \n
  • ${i18n.i18n.getFormatLocalizedString(str_, UIStrings.device, {PH1: deviceRecEl})}
  • \n
  • ${i18n.i18n.getFormatLocalizedString(str_, UIStrings.network, {PH1: networkRecEl})}
  • \n
\n ` : nothing}\n
\n \n
\n
\n \n
\n
\n \n
\n `;\n // clang-format on\n }\n\n #getPageScopeLabel(pageScope: CrUXManager.PageScope): string {\n const key = this.#cruxManager.pageResult?.[`${pageScope}-ALL`]?.record.key[pageScope];\n if (key) {\n return pageScope === 'url' ? i18nString(UIStrings.urlOptionWithKey, {PH1: key}) :\n i18nString(UIStrings.originOptionWithKey, {PH1: key});\n }\n\n const baseLabel = pageScope === 'url' ? i18nString(UIStrings.urlOption) : i18nString(UIStrings.originOption);\n return i18nString(UIStrings.needsDataOption, {PH1: baseLabel});\n }\n\n #onPageScopeMenuItemSelected(event: Menus.SelectMenu.SelectMenuItemSelectedEvent): void {\n if (event.itemValue === 'url') {\n this.#cruxManager.fieldPageScope = 'url';\n } else {\n this.#cruxManager.fieldPageScope = 'origin';\n }\n void ComponentHelpers.ScheduledRender.scheduleRender(this, this.#render);\n }\n\n #renderPageScopeSetting(): LitHtml.LitTemplate {\n if (!this.#cruxManager.getConfigSetting().get().enabled) {\n return LitHtml.nothing;\n }\n\n const urlLabel = this.#getPageScopeLabel('url');\n const originLabel = this.#getPageScopeLabel('origin');\n\n const buttonTitle = this.#cruxManager.fieldPageScope === 'url' ? urlLabel : originLabel;\n const accessibleTitle = i18nString(UIStrings.showFieldDataForPage, {PH1: buttonTitle});\n\n // If there is no data at all we should force users to switch pages or reconfigure CrUX.\n const shouldDisable = !this.#cruxManager.pageResult?.['url-ALL'] && !this.#cruxManager.pageResult?.['origin-ALL'];\n\n return html`\n \n \n ${urlLabel}\n \n \n ${originLabel}\n \n \n `;\n }\n\n #getDeviceScopeDisplayName(deviceScope: CrUXManager.DeviceScope): string {\n switch (deviceScope) {\n case 'ALL':\n return i18nString(UIStrings.allDevices);\n case 'DESKTOP':\n return i18nString(UIStrings.desktop);\n case 'PHONE':\n return i18nString(UIStrings.mobile);\n case 'TABLET':\n return i18nString(UIStrings.tablet);\n }\n }\n\n #getLabelForDeviceOption(deviceOption: DeviceOption): string {\n let baseLabel;\n if (deviceOption === 'AUTO') {\n const deviceScope = this.#cruxManager.getSelectedDeviceScope();\n const deviceScopeLabel = this.#getDeviceScopeDisplayName(deviceScope);\n baseLabel = i18nString(UIStrings.auto, {PH1: deviceScopeLabel});\n } else {\n baseLabel = this.#getDeviceScopeDisplayName(deviceOption);\n }\n\n if (!this.#cruxManager.pageResult) {\n return i18nString(UIStrings.loadingOption, {PH1: baseLabel});\n }\n\n const result = this.#cruxManager.getSelectedFieldResponse();\n if (!result) {\n return i18nString(UIStrings.needsDataOption, {PH1: baseLabel});\n }\n\n return baseLabel;\n }\n\n #onDeviceOptionMenuItemSelected(event: Menus.SelectMenu.SelectMenuItemSelectedEvent): void {\n this.#cruxManager.fieldDeviceOption = event.itemValue as DeviceOption;\n void ComponentHelpers.ScheduledRender.scheduleRender(this, this.#render);\n }\n\n #renderDeviceScopeSetting(): LitHtml.LitTemplate {\n if (!this.#cruxManager.getConfigSetting().get().enabled) {\n return LitHtml.nothing;\n }\n\n // If there is no data at all we should force users to try adjusting the page scope\n // before coming back to this option.\n const shouldDisable = !this.#cruxManager.getFieldResponse(this.#cruxManager.fieldPageScope, 'ALL');\n\n const currentDeviceLabel = this.#getLabelForDeviceOption(this.#cruxManager.fieldDeviceOption);\n\n // clang-format off\n return html`\n \n ${DEVICE_OPTION_LIST.map(deviceOption => {\n return html`\n \n ${this.#getLabelForDeviceOption(deviceOption)}\n \n `;\n })}\n \n `;\n // clang-format on\n }\n\n #getCollectionPeriodRange(): string|null {\n const selectedResponse = this.#cruxManager.getSelectedFieldResponse();\n if (!selectedResponse) {\n return null;\n }\n\n const {firstDate, lastDate} = selectedResponse.record.collectionPeriod;\n\n const formattedFirstDate = new Date(\n firstDate.year,\n // CrUX month is 1-indexed but `Date` month is 0-indexed\n firstDate.month - 1,\n firstDate.day,\n );\n const formattedLastDate = new Date(\n lastDate.year,\n // CrUX month is 1-indexed but `Date` month is 0-indexed\n lastDate.month - 1,\n lastDate.day,\n );\n\n const options: Intl.DateTimeFormatOptions = {\n year: 'numeric',\n month: 'short',\n day: 'numeric',\n };\n\n return i18nString(UIStrings.dateRange, {\n PH1: formattedFirstDate.toLocaleDateString(undefined, options),\n PH2: formattedLastDate.toLocaleDateString(undefined, options),\n });\n }\n\n #renderCollectionPeriod(): LitHtml.LitTemplate {\n const range = this.#getCollectionPeriodRange();\n\n const dateEl = document.createElement('span');\n dateEl.classList.add('collection-period-range');\n dateEl.textContent = range || i18nString(UIStrings.notEnoughData);\n\n const message = i18n.i18n.getFormatLocalizedString(str_, UIStrings.collectionPeriod, {\n PH1: dateEl,\n });\n\n const warnings = this.#cruxManager.pageResult?.warnings || [];\n\n return html`\n
\n
${message}
\n ${warnings.map(warning => html`\n
${warning}
\n `)}\n
\n `;\n }\n\n #renderFieldDataMessage(): LitHtml.LitTemplate {\n if (this.#cruxManager.getConfigSetting().get().enabled) {\n return this.#renderCollectionPeriod();\n }\n\n const linkEl =\n UI.XLink.XLink.create('https://developer.chrome.com/docs/crux', i18n.i18n.lockedString('Chrome UX Report'));\n const messageEl = i18n.i18n.getFormatLocalizedString(str_, UIStrings.seeHowYourLocalMetricsCompare, {PH1: linkEl});\n\n return html`\n
${messageEl}
\n `;\n }\n\n #renderLogSection(): LitHtml.LitTemplate {\n // clang-format off\n return html`\n
\n {\n this.#logsEl = node as LiveMetricsLogs;\n })}\n >\n ${this.#renderInteractionsLog()}\n ${this.#renderLayoutShiftsLog()}\n \n
\n `;\n // clang-format on\n }\n\n async #revealInteraction(interaction: LiveMetrics.Interaction): Promise {\n const interactionEl = this.#shadow.getElementById(interaction.interactionId);\n if (!interactionEl || !this.#logsEl) {\n return;\n }\n\n const success = this.#logsEl.selectTab('interactions');\n if (!success) {\n return;\n }\n\n await coordinator.write(() => {\n interactionEl.scrollIntoView({\n block: 'center',\n });\n interactionEl.focus();\n UI.UIUtils.runCSSAnimationOnce(interactionEl, 'highlight');\n });\n }\n\n async #logExtraInteractionDetails(interaction: LiveMetrics.Interaction): Promise {\n const success = await LiveMetrics.LiveMetrics.instance().logInteractionScripts(interaction);\n if (success) {\n await Common.Console.Console.instance().showPromise();\n }\n }\n\n #renderInteractionsLog(): LitHtml.LitTemplate {\n if (!this.#interactions.size) {\n return LitHtml.nothing;\n }\n\n // clang-format off\n return html`\n
    {\n this.#interactionsListEl = node as HTMLElement;\n })}\n >\n ${this.#interactions.values().map(interaction => {\n const metricValue = renderMetricValue(\n 'timeline.landing.interaction-event-timing',\n interaction.duration,\n INP_THRESHOLDS,\n v => i18n.TimeUtilities.preciseMillisToString(v),\n {dim: true},\n );\n\n const isP98Excluded = this.#inpValue && this.#inpValue.value < interaction.duration;\n const isInp = this.#inpValue?.interactionId === interaction.interactionId;\n\n return html`\n
  1. \n
    \n \n \n ${interaction.interactionType}\n ${isInp ?\n html`INP`\n : nothing}\n \n ${interaction.nodeRef?.link}\n ${isP98Excluded ? html`` : nothing}\n ${metricValue}\n \n
    \n
    \n
    ${i18nString(UIStrings.phase)}
    \n
    \n ${interaction.longAnimationFrameTimings.length ? html`\n this.#logExtraInteractionDetails(interaction)}\n >${i18nString(UIStrings.duration)}\n ` : i18nString(UIStrings.duration)}\n
    \n
    \n
    \n
    ${i18nString(UIStrings.inputDelay)}
    \n
    ${Math.round(interaction.phases.inputDelay)}
    \n
    \n
    \n
    ${i18nString(UIStrings.processingDuration)}
    \n
    ${Math.round(interaction.phases.processingDuration)}
    \n
    \n
    \n
    ${i18nString(UIStrings.presentationDelay)}
    \n
    ${Math.round(interaction.phases.presentationDelay)}
    \n
    \n
    \n
    \n
  2. \n `;\n })}\n
\n `;\n // clang-format on\n }\n\n async #revealLayoutShiftCluster(clusterIds: Set): Promise {\n if (!this.#logsEl) {\n return;\n }\n\n const layoutShiftEls: HTMLElement[] = [];\n for (const shiftId of clusterIds) {\n const layoutShiftEl = this.#shadow.getElementById(shiftId);\n if (layoutShiftEl) {\n layoutShiftEls.push(layoutShiftEl);\n }\n }\n\n if (!layoutShiftEls.length) {\n return;\n }\n\n const success = this.#logsEl.selectTab('layout-shifts');\n if (!success) {\n return;\n }\n\n await coordinator.write(() => {\n layoutShiftEls[0].scrollIntoView({\n block: 'start',\n });\n layoutShiftEls[0].focus();\n for (const layoutShiftEl of layoutShiftEls) {\n UI.UIUtils.runCSSAnimationOnce(layoutShiftEl, 'highlight');\n }\n });\n }\n\n #renderLayoutShiftsLog(): LitHtml.LitTemplate {\n if (!this.#layoutShifts.length) {\n return LitHtml.nothing;\n }\n\n // clang-format off\n return html`\n
    {\n this.#layoutShiftsListEl = node as HTMLElement;\n })}\n >\n ${this.#layoutShifts.map(layoutShift => {\n const metricValue = renderMetricValue(\n 'timeline.landing.layout-shift-event-score',\n layoutShift.score,\n CLS_THRESHOLDS,\n // CLS value is 2 decimal places, but individual shift scores tend to be much smaller\n // so we expand the precision here.\n v => v.toFixed(4),\n {dim: true},\n );\n\n return html`\n
  1. \n
    Layout shift score: ${metricValue}
    \n
    \n ${layoutShift.affectedNodeRefs.map(({link}) => html`\n
    ${link}
    \n `)}\n
    \n
  2. \n `;\n })}\n
\n `;\n // clang-format on\n }\n\n #renderNodeView(): LitHtml.LitTemplate {\n return html`\n
\n
\n

${i18nString(UIStrings.nodePerformanceTimeline)}

\n
${i18nString(UIStrings.nodeClickToRecord)}
\n
${this.#renderRecordAction(this.#toggleRecordAction)}
\n
\n
\n `;\n }\n\n #render = (): void => {\n if (this.#isNode) {\n LitHtml.render(this.#renderNodeView(), this.#shadow, {host: this});\n return;\n }\n\n const fieldEnabled = this.#cruxManager.getConfigSetting().get().enabled;\n const liveMetricsTitle =\n fieldEnabled ? i18nString(UIStrings.localAndFieldMetrics) : i18nString(UIStrings.localMetrics);\n\n const helpLink = 'https://web.dev/articles/lab-and-field-data-differences#lab_data_versus_field_data' as\n Platform.DevToolsPath.UrlString;\n\n // clang-format off\n const output = html`\n
\n
\n
\n

${liveMetricsTitle}

\n
{\n this.#tooltipContainerEl = node;\n })}\n >\n
\n ${this.#renderLcpCard()}\n
\n
\n ${this.#renderClsCard()}\n
\n
\n ${this.#renderInpCard()}\n
\n
\n ${i18nString(UIStrings.localFieldLearnMoreLink)}\n ${this.#renderLogSection()}\n
\n \n
\n
\n `;\n LitHtml.render(output, this.#shadow, {host: this});\n };\n // clang-format on\n}\n\nclass LiveMetricsLogs extends UI.Widget.WidgetElement {\n #tabbedPane?: UI.TabbedPane.TabbedPane;\n\n constructor() {\n super();\n this.style.display = 'contents';\n }\n\n /**\n * Returns `true` if selecting the tab was successful.\n */\n selectTab(tabId: string): boolean {\n if (!this.#tabbedPane) {\n return false;\n }\n return this.#tabbedPane.selectTab(tabId);\n }\n\n #clearCurrentLog(): void {\n const liveMetrics = LiveMetrics.LiveMetrics.instance();\n\n switch (this.#tabbedPane?.selectedTabId) {\n case 'interactions':\n liveMetrics.clearInteractions();\n break;\n case 'layout-shifts':\n liveMetrics.clearLayoutShifts();\n break;\n }\n }\n\n override createWidget(): UI.Widget.Widget {\n // We need a generic widget with a shadow DOM as the container widget so that we can take advantage\n // of web component slots. Passing `this` into the container widget will make `this` the root element\n // of that widget.\n //\n // Any children of the root element `this` will be matched to the slots defined within the container\n // widget's shadow DOM.\n const containerWidget = new UI.Widget.Widget(true, undefined, this);\n containerWidget.contentElement.style.display = 'contents';\n\n this.#tabbedPane = new UI.TabbedPane.TabbedPane();\n\n // Taking advantage of web component slots allows us to render updates in the lit templates defined in the\n // main component. This should be more performant and doesn't require us to inject live metrics styles twice.\n const interactionsSlot = document.createElement('slot');\n interactionsSlot.name = 'interactions-log-content';\n const interactionsTab = UI.Widget.Widget.getOrCreateWidget(interactionsSlot);\n this.#tabbedPane.appendTab(\n 'interactions', i18nString(UIStrings.interactions), interactionsTab, undefined, undefined, undefined, undefined,\n undefined, 'timeline.landing.interactions-log');\n\n const layoutShiftsSlot = document.createElement('slot');\n layoutShiftsSlot.name = 'layout-shifts-log-content';\n const layoutShiftsTab = UI.Widget.Widget.getOrCreateWidget(layoutShiftsSlot);\n this.#tabbedPane.appendTab(\n 'layout-shifts', i18nString(UIStrings.layoutShifts), layoutShiftsTab, undefined, undefined, undefined,\n undefined, undefined, 'timeline.landing.layout-shifts-log');\n\n const clearButton = new UI.Toolbar.ToolbarButton(\n i18nString(UIStrings.clearCurrentLog), 'clear', undefined, 'timeline.landing.clear-log');\n clearButton.addEventListener(UI.Toolbar.ToolbarButton.Events.CLICK, this.#clearCurrentLog, this);\n this.#tabbedPane.rightToolbar().appendToolbarItem(clearButton);\n this.#tabbedPane.show(containerWidget.contentElement);\n\n return containerWidget;\n }\n}\n\ncustomElements.define('devtools-live-metrics-view', LiveMetricsView);\ncustomElements.define('devtools-live-metrics-logs', LiveMetricsLogs);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'devtools-live-metrics-view': LiveMetricsView;\n 'devtools-live-metrics-logs': LiveMetricsLogs;\n }\n}\n"]} \ No newline at end of file +{"version":3,"file":"LiveMetricsView.js","sourceRoot":"","sources":["../../../../../../../front_end/panels/timeline/components/LiveMetricsView.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,mDAAmD,CAAC;AAC3D,OAAO,4BAA4B,CAAC;AACpC,OAAO,0BAA0B,CAAC;AAClC,OAAO,gCAAgC,CAAC;AACxC,OAAO,uCAAuC,CAAC;AAC/C,OAAO,iBAAiB,CAAC;AAEzB,OAAO,KAAK,MAAM,MAAM,gCAAgC,CAAC;AACzD,OAAO,KAAK,IAAI,MAAM,4BAA4B,CAAC;AAEnD,OAAO,KAAK,WAAW,MAAM,8CAA8C,CAAC;AAC5E,OAAO,KAAK,cAAc,MAAM,wCAAwC,CAAC;AACzE,OAAO,KAAK,WAAW,MAAM,8CAA8C,CAAC;AAC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AU,CAAC,SAAS,CAAC,YAAY,CAAC,EAAE,eAAe,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EACrG,SAAS,EAAE,SAAS,EAAE,oCAAoC,CAAC,CAAC;QAEhE,MAAM,WAAW,GAAG,IAAI,EAAE,CAAC,OAAO,CAAC,aAAa,CAC5C,UAAU,CAAC,SAAS,CAAC,eAAe,CAAC,EAAE,OAAO,EAAE,SAAS,EAAE,4BAA4B,CAAC,CAAC;QAC7F,WAAW,CAAC,gBAAgB,sDAAwC,IAAI,CAAC,gBAAgB,EAAE,IAAI,CAAC,CAAC;QACjG,IAAI,CAAC,WAAW,CAAC,YAAY,EAAE,CAAC,iBAAiB,CAAC,WAAW,CAAC,CAAC;QAC/D,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,eAAe,CAAC,cAAc,CAAC,CAAC;QAEtD,OAAO,eAAe,CAAC;IACzB,CAAC;CACF;AAED,cAAc,CAAC,MAAM,CAAC,4BAA4B,EAAE,eAAe,CAAC,CAAC;AACrE,cAAc,CAAC,MAAM,CAAC,4BAA4B,EAAE,eAAe,CAAC,CAAC","sourcesContent":["// Copyright 2024 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport '../../../ui/components/icon_button/icon_button.js';\nimport './CPUThrottlingSelector.js';\nimport './FieldSettingsDialog.js';\nimport './NetworkThrottlingSelector.js';\nimport '../../../ui/components/menus/menus.js';\nimport './MetricCard.js';\n\nimport * as Common from '../../../core/common/common.js';\nimport * as i18n from '../../../core/i18n/i18n.js';\nimport type * as Platform from '../../../core/platform/platform.js';\nimport * as CrUXManager from '../../../models/crux-manager/crux-manager.js';\nimport * as EmulationModel from '../../../models/emulation/emulation.js';\nimport * as LiveMetrics from '../../../models/live-metrics/live-metrics.js';\nimport * as Buttons from '../../../ui/components/buttons/buttons.js';\nimport * as ComponentHelpers from '../../../ui/components/helpers/helpers.js';\nimport * as LegacyWrapper from '../../../ui/components/legacy_wrapper/legacy_wrapper.js';\nimport type * as Menus from '../../../ui/components/menus/menus.js';\nimport * as RenderCoordinator from '../../../ui/components/render_coordinator/render_coordinator.js';\nimport type * as Settings from '../../../ui/components/settings/settings.js';\nimport * as UI from '../../../ui/legacy/legacy.js';\nimport * as LitHtml from '../../../ui/lit-html/lit-html.js';\nimport * as VisualLogging from '../../../ui/visual_logging/visual_logging.js';\nimport * as MobileThrottling from '../../mobile_throttling/mobile_throttling.js';\nimport {getThrottlingRecommendations, md} from '../utils/Helpers.js';\n\nimport liveMetricsViewStyles from './liveMetricsView.css.js';\nimport type {MetricCardData} from './MetricCard.js';\nimport metricValueStyles from './metricValueStyles.css.js';\nimport {CLS_THRESHOLDS, INP_THRESHOLDS, renderMetricValue} from './Utils.js';\n\nconst {html, nothing} = LitHtml;\n\ntype DeviceOption = CrUXManager.DeviceScope|'AUTO';\n\nconst DEVICE_OPTION_LIST: DeviceOption[] = ['AUTO', ...CrUXManager.DEVICE_SCOPE_LIST];\n\nconst RTT_MINIMUM = 60;\n\nconst UIStrings = {\n /**\n * @description Title of a view that shows performance metrics from the local environment and field metrics collected from real users. \"field metrics\" should be interpreted as \"real user metrics\".\n */\n localAndFieldMetrics: 'Local and field metrics',\n /**\n * @description Title of a view that shows performance metrics from the local environment.\n */\n localMetrics: 'Local metrics',\n /**\n * @description Accessible label for a section that logs user interactions and layout shifts. A layout shift is an event that shifts content in the layout of the page causing a jarring experience for the user.\n */\n eventLogs: 'Interaction and layout shift logs section',\n /**\n * @description Title of a section that lists user interactions.\n */\n interactions: 'Interactions',\n /**\n * @description Title of a section that lists layout shifts. A layout shift is an event that shifts content in the layout of the page causing a jarring experience for the user.\n */\n layoutShifts: 'Layout shifts',\n /**\n * @description Title of a sidebar section that shows options for the user to take after using the main view.\n */\n nextSteps: 'Next steps',\n /**\n * @description Title of a section that shows options for how real user data in the field should be fetched. This should be interpreted as \"Real user data\".\n */\n fieldData: 'Field data',\n /**\n * @description Title of a section that shows settings to control the developers local testing environment.\n */\n environmentSettings: 'Environment settings',\n /**\n * @description Label for an select box that selects which device type field data be shown for (e.g. desktop/mobile/all devices/etc). \"field data\" should be interpreted as \"real user data\".\n * @example {Mobile} PH1\n */\n showFieldDataForDevice: 'Show field data for device type: {PH1}',\n /**\n * @description Text indicating that there is not enough data to report real user statistics.\n */\n notEnoughData: 'Not enough data',\n /**\n * @description Label for a text block that describes the network connections of real users.\n * @example {75th percentile is similar to Slow 4G throttling} PH1\n */\n network: 'Network: {PH1}',\n /**\n * @description Label for an select box that selects which device type real user data should be shown for (e.g. desktop/mobile/all devices/etc).\n * @example {Mobile} PH1\n */\n device: 'Device: {PH1}',\n /**\n * @description Label for an option to select all device form factors.\n */\n allDevices: 'All devices',\n /**\n * @description Label for an option to select the desktop form factor.\n */\n desktop: 'Desktop',\n /**\n * @description Label for an option to select the mobile form factor.\n */\n mobile: 'Mobile',\n /**\n * @description Label for an option to select the tablet form factor.\n */\n tablet: 'Tablet',\n /**\n * @description Label for an option to to automatically select the form factor. The automatic selection will be displayed in PH1.\n * @example {Desktop} PH1\n */\n auto: 'Auto ({PH1})',\n /**\n * @description Label for an option that is loading.\n * @example {Desktop} PH1\n */\n loadingOption: '{PH1} - Loading…',\n /**\n * @description Label for an option that does not have enough data and the user should ignore.\n * @example {Desktop} PH1\n */\n needsDataOption: '{PH1} - No data',\n /**\n * @description Label for an option that selects the page's specific URL as opposed to it's entire origin/domain.\n */\n urlOption: 'URL',\n /**\n * @description Label for an option that selects the page's entire origin/domain as opposed to it's specific URL.\n */\n originOption: 'Origin',\n /**\n * @description Label for an option that selects the page's specific URL as opposed to it's entire origin/domain.\n * @example {https://example.com/} PH1\n */\n urlOptionWithKey: 'URL: {PH1}',\n /**\n * @description Label for an option that selects the page's entire origin/domain as opposed to it's specific URL.\n * @example {https://example.com} PH1\n */\n originOptionWithKey: 'Origin: {PH1}',\n /**\n * @description Label for an combo-box that indicates if field data should be taken from the page's URL or it's origin/domain. \"field data\" should be interpreted as \"real user data\".\n * @example {Origin: https://example.com} PH1\n */\n showFieldDataForPage: 'Show field data for {PH1}',\n /**\n * @description Tooltip text explaining that real user connections are similar to a test environment with no throttling. \"throttling\" is when the network is intentionally slowed down to simulate a slower connection.\n */\n tryDisablingThrottling: '75th percentile is too fast to simulate with throttling',\n /**\n * @description Tooltip text explaining that real user connections are similar to a specif network throttling setup. \"throttling\" is when the network is intentionally slowed down to simulate a slower connection.\n * @example {Slow 4G} PH1\n */\n tryUsingThrottling: '75th percentile is similar to {PH1} throttling',\n /**\n * @description Text block listing what percentage of real users are on different device form factors.\n * @example {60%} PH1\n * @example {30%} PH2\n */\n percentDevices: '{PH1}% mobile, {PH2}% desktop',\n /**\n * @description Text block explaining how to simulate different mobile and desktop devices.\n */\n useDeviceToolbar:\n 'Use the [device toolbar](https://developer.chrome.com/docs/devtools/device-mode) and configure throttling to simulate real user environments and identify more performance issues.',\n /**\n * @description Text label for a checkbox that controls if the network cache is disabled.\n */\n disableNetworkCache: 'Disable network cache',\n /**\n * @description Text label for a link to the Largest Contentful Paint (LCP) related page element. This element represents the largest content on the page. \"LCP\" should not be translated.\n */\n lcpElement: 'LCP element',\n /**\n * @description Text label for a button that reveals the user interaction associated with the Interaction to Next Paint (INP) performance metric. \"INP\" should not be translated.\n */\n inpInteractionLink: 'INP interaction',\n /**\n * @description Text label for a button that reveals the cluster of layout shift events that affected the page content the most. A cluster is a group of layout shift events that occur in quick succession.\n */\n worstCluster: 'Worst cluster',\n /**\n * @description [ICU Syntax] Text content of a button that reveals the cluster of layout shift events that affected the page content the most. A layout shift is an event that shifts content in the layout of the page causing a jarring experience for the user. This text will indicate how many shifts were in the cluster.\n * @example {3} shiftCount\n */\n numShifts: `{shiftCount, plural,\n =1 {{shiftCount} shift}\n other {{shiftCount} shifts}\n }`,\n /**\n * @description Label for a a range of dates that represents the period of time a set of field data is collected from.\n * @example {Oct 1, 2024 - Nov 1, 2024} PH1\n */\n collectionPeriod: 'Collection period: {PH1}',\n /**\n * @description Text showing a range of dates meant to represent a period of time.\n * @example {Oct 1, 2024} PH1\n * @example {Nov 1, 2024} PH2\n */\n dateRange: '{PH1} - {PH2}',\n /**\n * @description Text block telling the user to see how performance metrics measured on their local computer compare to data collected from real users. PH1 will be a link to more information about the Chrome UX Report and the link text will be untranslated because it is a product name.\n * @example {Chrome UX Report} PH1\n */\n seeHowYourLocalMetricsCompare: 'See how your local metrics compare to real user data in the {PH1}.',\n /**\n * @description Text for a link that goes to more documentation about local and field data. \"Local\" refers to performance metrics measured in the developers local environment. \"field data\" should be interpreted as \"real user data\".\n */\n localFieldLearnMoreLink: 'Learn more about local and field data',\n /**\n * @description Tooltip text for a link that goes to documentation explaining the difference between local and field metrics. \"Local metrics\" are performance metrics measured in the developers local environment. \"field data\" should be interpreted as \"real user data\".\n */\n localFieldLearnMoreTooltip:\n 'Local metrics are captured from the current page using your network connection and device. Field data is measured by real users using many different network connections and devices.',\n /**\n * @description Tooltip text explaining that this user interaction was ignored when calculating the Interaction to Next Paint (INP) metric because the interaction delay fell beyond the 98th percentile of interaction delays on this page. \"INP\" is an acronym and should not be translated.\n */\n interactionExcluded:\n 'INP is calculated using the 98th percentile of interaction delays, so some interaction delays may be larger than the INP value.',\n /**\n * @description Tooltip for a button that will remove everything from the currently selected log.\n */\n clearCurrentLog: 'Clear the current log',\n /**\n * @description Title for a page load phase that measures the time between when the page load starts and the time when the first byte of the initial document is downloaded.\n */\n timeToFirstByte: 'Time to first byte',\n /**\n * @description Title for a page load phase that measures the time between when the first byte of the initial document is downloaded and when the request for the largest image content starts.\n */\n resourceLoadDelay: 'Resource load delay',\n /**\n * @description Title for a page load phase that measures the time between when the request for the largest image content starts and when it finishes.\n */\n resourceLoadDuration: 'Resource load duration',\n /**\n * @description Title for a page load phase that measures the time between when the request for the largest image content finishes and when the largest image element is rendered on the page.\n */\n elementRenderDelay: 'Element render delay',\n /**\n * @description Title for a phase during a user interaction that measures the time between when the interaction starts and when the browser starts running interaction handlers.\n */\n inputDelay: 'Input delay',\n /**\n * @description Title for a phase during a user interaction that measures the time between when the browser starts running interaction handlers and when the browser finishes running interaction handlers.\n */\n processingDuration: 'Processing duration',\n /**\n * @description Title for a phase during a user interaction that measures the time between when the browser finishes running interaction handlers and when the browser renders the next visual frame that shows the result of the interaction.\n */\n presentationDelay: 'Presentation delay',\n /**\n * @description Tooltip text for a status chip in a list of user interactions that indicates if the associated interaction is the interaction used in the Interaction to Next Paint (INP) performance metric because it's interaction delay is at the 98th percentile.\n */\n inpInteraction: 'The INP interaction is at the 98th percentile of interaction delays.',\n /**\n * @description Tooltip text for a button that reveals the user interaction associated with the Interaction to Next Paint (INP) performance metric.\n */\n showInpInteraction: 'Go to the INP interaction.',\n /**\n * @description Tooltip text for a button that reveals the cluster of layout shift events that affected the page content the most. A layout shift is an event that shifts content in the layout of the page causing a jarring experience for the user. A cluster is a group of layout shift events that occur in quick succession.\n */\n showClsCluster: 'Go to worst layout shift cluster.',\n /**\n * @description Column header for table cell values representing the phase/component/stage/section of a larger duration.\n */\n phase: 'Phase',\n /**\n * @description Column header for table cell values representing a phase duration (in milliseconds) that was measured in the developers local environment.\n */\n duration: 'Local duration (ms)',\n /**\n * @description Tooltip text for a button that will open the Chrome DevTools console to and log additional details about a user interaction.\n */\n logToConsole: 'Log additional interaction data to the console',\n /**\n * @description Title of a view that can be used to analyze the performance of a Node process as a timeline. \"Node\" is a product name and should not be translated.\n */\n nodePerformanceTimeline: 'Node performance',\n /**\n * @description Description of a view that can be used to analyze the performance of a Node process as a timeline. \"Node\" is a product name and should not be translated.\n */\n nodeClickToRecord: 'Record a performance timeline of the connected Node process.',\n};\n\nconst str_ = i18n.i18n.registerUIStrings('panels/timeline/components/LiveMetricsView.ts', UIStrings);\nconst i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);\n\nexport class LiveMetricsView extends LegacyWrapper.LegacyWrapper.WrappableComponent {\n readonly #shadow = this.attachShadow({mode: 'open'});\n\n #isNode: boolean = false;\n\n #lcpValue?: LiveMetrics.LCPValue;\n #clsValue?: LiveMetrics.CLSValue;\n #inpValue?: LiveMetrics.INPValue;\n #interactions: LiveMetrics.InteractionMap = new Map();\n #layoutShifts: LiveMetrics.LayoutShift[] = [];\n\n #cruxManager = CrUXManager.CrUXManager.instance();\n\n #toggleRecordAction: UI.ActionRegistration.Action;\n #recordReloadAction: UI.ActionRegistration.Action;\n\n #logsEl?: LiveMetricsLogs;\n #tooltipContainerEl?: Element;\n #interactionsListEl?: HTMLElement;\n #layoutShiftsListEl?: HTMLElement;\n #listIsScrolling = false;\n #deviceModeModel = EmulationModel.DeviceModeModel.DeviceModeModel.tryInstance();\n\n constructor() {\n super();\n\n this.#toggleRecordAction = UI.ActionRegistry.ActionRegistry.instance().getAction('timeline.toggle-recording');\n this.#recordReloadAction = UI.ActionRegistry.ActionRegistry.instance().getAction('timeline.record-reload');\n }\n\n set isNode(isNode: boolean) {\n this.#isNode = isNode;\n void ComponentHelpers.ScheduledRender.scheduleRender(this, this.#render);\n }\n\n #onMetricStatus(event: {data: LiveMetrics.StatusEvent}): void {\n this.#lcpValue = event.data.lcp;\n this.#clsValue = event.data.cls;\n this.#inpValue = event.data.inp;\n\n const hasNewLS = this.#layoutShifts.length < event.data.layoutShifts.length;\n this.#layoutShifts = [...event.data.layoutShifts];\n\n const hasNewInteraction = this.#interactions.size < event.data.interactions.size;\n this.#interactions = new Map(event.data.interactions);\n\n const renderPromise = ComponentHelpers.ScheduledRender.scheduleRender(this, this.#render);\n\n if (hasNewInteraction && this.#interactionsListEl) {\n this.#keepScrolledToBottom(renderPromise, this.#interactionsListEl);\n }\n\n if (hasNewLS && this.#layoutShiftsListEl) {\n this.#keepScrolledToBottom(renderPromise, this.#layoutShiftsListEl);\n }\n }\n\n #keepScrolledToBottom(renderPromise: Promise, listEl: HTMLElement): void {\n if (!listEl.checkVisibility()) {\n return;\n }\n\n const isAtBottom = Math.abs(listEl.scrollHeight - listEl.clientHeight - listEl.scrollTop) <= 1;\n\n // We shouldn't scroll to the bottom if the list wasn't already at the bottom.\n // However, if a new item appears while the animation for a previous item is still going,\n // then we should \"finish\" the scroll by sending another scroll command even if the scroll position\n // the element hasn't scrolled all the way to the bottom yet.\n if (!isAtBottom && !this.#listIsScrolling) {\n return;\n }\n\n void renderPromise.then(() => {\n requestAnimationFrame(() => {\n this.#listIsScrolling = true;\n listEl.addEventListener('scrollend', () => {\n this.#listIsScrolling = false;\n }, {once: true});\n listEl.scrollTo({top: listEl.scrollHeight, behavior: 'smooth'});\n });\n });\n }\n\n #onFieldDataChanged(): void {\n void ComponentHelpers.ScheduledRender.scheduleRender(this, this.#render);\n }\n\n #onEmulationChanged(): void {\n void ComponentHelpers.ScheduledRender.scheduleRender(this, this.#render);\n }\n\n async #refreshFieldDataForCurrentPage(): Promise {\n await this.#cruxManager.refresh();\n void ComponentHelpers.ScheduledRender.scheduleRender(this, this.#render);\n }\n\n connectedCallback(): void {\n this.#shadow.adoptedStyleSheets = [liveMetricsViewStyles, metricValueStyles];\n\n const liveMetrics = LiveMetrics.LiveMetrics.instance();\n liveMetrics.addEventListener(LiveMetrics.Events.STATUS, this.#onMetricStatus, this);\n\n const cruxManager = CrUXManager.CrUXManager.instance();\n cruxManager.addEventListener(CrUXManager.Events.FIELD_DATA_CHANGED, this.#onFieldDataChanged, this);\n\n this.#deviceModeModel?.addEventListener(\n EmulationModel.DeviceModeModel.Events.UPDATED, this.#onEmulationChanged, this);\n\n if (cruxManager.getConfigSetting().get().enabled) {\n void this.#refreshFieldDataForCurrentPage();\n }\n\n this.#lcpValue = liveMetrics.lcpValue;\n this.#clsValue = liveMetrics.clsValue;\n this.#inpValue = liveMetrics.inpValue;\n this.#interactions = liveMetrics.interactions;\n this.#layoutShifts = liveMetrics.layoutShifts;\n void ComponentHelpers.ScheduledRender.scheduleRender(this, this.#render);\n }\n\n disconnectedCallback(): void {\n LiveMetrics.LiveMetrics.instance().removeEventListener(LiveMetrics.Events.STATUS, this.#onMetricStatus, this);\n\n const cruxManager = CrUXManager.CrUXManager.instance();\n cruxManager.removeEventListener(CrUXManager.Events.FIELD_DATA_CHANGED, this.#onFieldDataChanged, this);\n\n this.#deviceModeModel?.removeEventListener(\n EmulationModel.DeviceModeModel.Events.UPDATED, this.#onEmulationChanged, this);\n }\n\n #renderLcpCard(): LitHtml.LitTemplate {\n const fieldData = this.#cruxManager.getSelectedFieldMetricData('largest_contentful_paint');\n const nodeLink = this.#lcpValue?.nodeRef?.link;\n const phases = this.#lcpValue?.phases;\n\n // clang-format off\n return html`\n \n ${nodeLink ? html`\n
\n ${i18nString(UIStrings.lcpElement)}\n ${nodeLink}\n
\n `\n : nothing}\n
\n `;\n // clang-format on\n }\n\n #renderClsCard(): LitHtml.LitTemplate {\n const fieldData = this.#cruxManager.getSelectedFieldMetricData('cumulative_layout_shift');\n\n const clusterIds = new Set(this.#clsValue?.clusterShiftIds || []);\n const clusterIsVisible =\n clusterIds.size > 0 && this.#layoutShifts.some(layoutShift => clusterIds.has(layoutShift.uniqueLayoutShiftId));\n\n // clang-format off\n return html`\n \n ${clusterIsVisible ? html`\n
\n ${i18nString(UIStrings.worstCluster)}\n this.#revealLayoutShiftCluster(clusterIds)}\n jslog=${VisualLogging.action('timeline.landing.show-cls-cluster').track({click: true})}\n >${i18nString(UIStrings.numShifts, {shiftCount: clusterIds.size})}\n
\n ` : nothing}\n
\n `;\n // clang-format on\n }\n\n #renderInpCard(): LitHtml.LitTemplate {\n const fieldData = this.#cruxManager.getSelectedFieldMetricData('interaction_to_next_paint');\n const phases = this.#inpValue?.phases;\n const interaction = this.#inpValue && this.#interactions.get(this.#inpValue.interactionId);\n\n // clang-format off\n return html`\n \n ${interaction ? html`\n
\n ${i18nString(UIStrings.inpInteractionLink)}\n this.#revealInteraction(interaction)}\n jslog=${VisualLogging.action('timeline.landing.show-inp-interaction').track({click: true})}\n >${interaction.interactionType}\n
\n ` : nothing}\n
\n `;\n // clang-format on\n }\n\n #renderRecordAction(action: UI.ActionRegistration.Action): LitHtml.LitTemplate {\n function onClick(): void {\n void action.execute();\n }\n\n // clang-format off\n return html`\n
\n \n ${action.title()}\n \n ${UI.ShortcutRegistry.ShortcutRegistry.instance().shortcutTitleForAction(action.id())}\n
\n `;\n // clang-format on\n }\n\n #getNetworkRecTitle(): string|null {\n const response = this.#cruxManager.getSelectedFieldMetricData('round_trip_time');\n if (!response?.percentiles) {\n return null;\n }\n\n const rtt = Number(response.percentiles.p75);\n if (!Number.isFinite(rtt)) {\n return null;\n }\n\n if (rtt < RTT_MINIMUM) {\n return i18nString(UIStrings.tryDisablingThrottling);\n }\n\n const conditions = MobileThrottling.ThrottlingPresets.ThrottlingPresets.getRecommendedNetworkPreset(rtt);\n if (!conditions) {\n return null;\n }\n\n const title = typeof conditions.title === 'function' ? conditions.title() : conditions.title;\n return i18nString(UIStrings.tryUsingThrottling, {PH1: title});\n }\n\n #getDeviceRec(): string|null {\n // `form_factors` metric is only populated if CrUX data is fetched for all devices.\n const fractions = this.#cruxManager.getFieldResponse(this.#cruxManager.fieldPageScope, 'ALL')\n ?.record.metrics.form_factors?.fractions;\n if (!fractions) {\n return null;\n }\n\n return i18nString(UIStrings.percentDevices, {\n PH1: Math.round(fractions.phone * 100),\n PH2: Math.round(fractions.desktop * 100),\n });\n }\n\n #renderRecordingSettings(): LitHtml.LitTemplate {\n const fieldEnabled = this.#cruxManager.getConfigSetting().get().enabled;\n\n const deviceRecEl = document.createElement('span');\n deviceRecEl.classList.add('environment-rec');\n deviceRecEl.textContent = this.#getDeviceRec() || i18nString(UIStrings.notEnoughData);\n\n const networkRecEl = document.createElement('span');\n networkRecEl.classList.add('environment-rec');\n networkRecEl.textContent = this.#getNetworkRecTitle() || i18nString(UIStrings.notEnoughData);\n\n const recs = getThrottlingRecommendations();\n\n // clang-format off\n return html`\n

${i18nString(UIStrings.environmentSettings)}

\n
${md(i18nString(UIStrings.useDeviceToolbar))}
\n ${fieldEnabled ? html`\n
    \n
  • ${i18n.i18n.getFormatLocalizedString(str_, UIStrings.device, {PH1: deviceRecEl})}
  • \n
  • ${i18n.i18n.getFormatLocalizedString(str_, UIStrings.network, {PH1: networkRecEl})}
  • \n
\n ` : nothing}\n
\n \n
\n
\n \n
\n
\n \n
\n `;\n // clang-format on\n }\n\n #getPageScopeLabel(pageScope: CrUXManager.PageScope): string {\n const key = this.#cruxManager.pageResult?.[`${pageScope}-ALL`]?.record.key[pageScope];\n if (key) {\n return pageScope === 'url' ? i18nString(UIStrings.urlOptionWithKey, {PH1: key}) :\n i18nString(UIStrings.originOptionWithKey, {PH1: key});\n }\n\n const baseLabel = pageScope === 'url' ? i18nString(UIStrings.urlOption) : i18nString(UIStrings.originOption);\n return i18nString(UIStrings.needsDataOption, {PH1: baseLabel});\n }\n\n #onPageScopeMenuItemSelected(event: Menus.SelectMenu.SelectMenuItemSelectedEvent): void {\n if (event.itemValue === 'url') {\n this.#cruxManager.fieldPageScope = 'url';\n } else {\n this.#cruxManager.fieldPageScope = 'origin';\n }\n void ComponentHelpers.ScheduledRender.scheduleRender(this, this.#render);\n }\n\n #renderPageScopeSetting(): LitHtml.LitTemplate {\n if (!this.#cruxManager.getConfigSetting().get().enabled) {\n return LitHtml.nothing;\n }\n\n const urlLabel = this.#getPageScopeLabel('url');\n const originLabel = this.#getPageScopeLabel('origin');\n\n const buttonTitle = this.#cruxManager.fieldPageScope === 'url' ? urlLabel : originLabel;\n const accessibleTitle = i18nString(UIStrings.showFieldDataForPage, {PH1: buttonTitle});\n\n // If there is no data at all we should force users to switch pages or reconfigure CrUX.\n const shouldDisable = !this.#cruxManager.pageResult?.['url-ALL'] && !this.#cruxManager.pageResult?.['origin-ALL'];\n\n return html`\n \n \n ${urlLabel}\n \n \n ${originLabel}\n \n \n `;\n }\n\n #getDeviceScopeDisplayName(deviceScope: CrUXManager.DeviceScope): string {\n switch (deviceScope) {\n case 'ALL':\n return i18nString(UIStrings.allDevices);\n case 'DESKTOP':\n return i18nString(UIStrings.desktop);\n case 'PHONE':\n return i18nString(UIStrings.mobile);\n case 'TABLET':\n return i18nString(UIStrings.tablet);\n }\n }\n\n #getLabelForDeviceOption(deviceOption: DeviceOption): string {\n let baseLabel;\n if (deviceOption === 'AUTO') {\n const deviceScope = this.#cruxManager.getSelectedDeviceScope();\n const deviceScopeLabel = this.#getDeviceScopeDisplayName(deviceScope);\n baseLabel = i18nString(UIStrings.auto, {PH1: deviceScopeLabel});\n } else {\n baseLabel = this.#getDeviceScopeDisplayName(deviceOption);\n }\n\n if (!this.#cruxManager.pageResult) {\n return i18nString(UIStrings.loadingOption, {PH1: baseLabel});\n }\n\n const result = this.#cruxManager.getSelectedFieldResponse();\n if (!result) {\n return i18nString(UIStrings.needsDataOption, {PH1: baseLabel});\n }\n\n return baseLabel;\n }\n\n #onDeviceOptionMenuItemSelected(event: Menus.SelectMenu.SelectMenuItemSelectedEvent): void {\n this.#cruxManager.fieldDeviceOption = event.itemValue as DeviceOption;\n void ComponentHelpers.ScheduledRender.scheduleRender(this, this.#render);\n }\n\n #renderDeviceScopeSetting(): LitHtml.LitTemplate {\n if (!this.#cruxManager.getConfigSetting().get().enabled) {\n return LitHtml.nothing;\n }\n\n // If there is no data at all we should force users to try adjusting the page scope\n // before coming back to this option.\n const shouldDisable = !this.#cruxManager.getFieldResponse(this.#cruxManager.fieldPageScope, 'ALL');\n\n const currentDeviceLabel = this.#getLabelForDeviceOption(this.#cruxManager.fieldDeviceOption);\n\n // clang-format off\n return html`\n \n ${DEVICE_OPTION_LIST.map(deviceOption => {\n return html`\n \n ${this.#getLabelForDeviceOption(deviceOption)}\n \n `;\n })}\n \n `;\n // clang-format on\n }\n\n #getCollectionPeriodRange(): string|null {\n const selectedResponse = this.#cruxManager.getSelectedFieldResponse();\n if (!selectedResponse) {\n return null;\n }\n\n const {firstDate, lastDate} = selectedResponse.record.collectionPeriod;\n\n const formattedFirstDate = new Date(\n firstDate.year,\n // CrUX month is 1-indexed but `Date` month is 0-indexed\n firstDate.month - 1,\n firstDate.day,\n );\n const formattedLastDate = new Date(\n lastDate.year,\n // CrUX month is 1-indexed but `Date` month is 0-indexed\n lastDate.month - 1,\n lastDate.day,\n );\n\n const options: Intl.DateTimeFormatOptions = {\n year: 'numeric',\n month: 'short',\n day: 'numeric',\n };\n\n return i18nString(UIStrings.dateRange, {\n PH1: formattedFirstDate.toLocaleDateString(undefined, options),\n PH2: formattedLastDate.toLocaleDateString(undefined, options),\n });\n }\n\n #renderCollectionPeriod(): LitHtml.LitTemplate {\n const range = this.#getCollectionPeriodRange();\n\n const dateEl = document.createElement('span');\n dateEl.classList.add('collection-period-range');\n dateEl.textContent = range || i18nString(UIStrings.notEnoughData);\n\n const message = i18n.i18n.getFormatLocalizedString(str_, UIStrings.collectionPeriod, {\n PH1: dateEl,\n });\n\n const warnings = this.#cruxManager.pageResult?.warnings || [];\n\n return html`\n
\n
${message}
\n ${warnings.map(warning => html`\n
${warning}
\n `)}\n
\n `;\n }\n\n #renderFieldDataMessage(): LitHtml.LitTemplate {\n if (this.#cruxManager.getConfigSetting().get().enabled) {\n return this.#renderCollectionPeriod();\n }\n\n const linkEl =\n UI.XLink.XLink.create('https://developer.chrome.com/docs/crux', i18n.i18n.lockedString('Chrome UX Report'));\n const messageEl = i18n.i18n.getFormatLocalizedString(str_, UIStrings.seeHowYourLocalMetricsCompare, {PH1: linkEl});\n\n return html`\n
${messageEl}
\n `;\n }\n\n #renderLogSection(): LitHtml.LitTemplate {\n // clang-format off\n return html`\n
\n {\n this.#logsEl = node as LiveMetricsLogs;\n })}\n >\n ${this.#renderInteractionsLog()}\n ${this.#renderLayoutShiftsLog()}\n \n
\n `;\n // clang-format on\n }\n\n async #revealInteraction(interaction: LiveMetrics.Interaction): Promise {\n const interactionEl = this.#shadow.getElementById(interaction.interactionId);\n if (!interactionEl || !this.#logsEl) {\n return;\n }\n\n const success = this.#logsEl.selectTab('interactions');\n if (!success) {\n return;\n }\n\n await RenderCoordinator.write(() => {\n interactionEl.scrollIntoView({\n block: 'center',\n });\n interactionEl.focus();\n UI.UIUtils.runCSSAnimationOnce(interactionEl, 'highlight');\n });\n }\n\n async #logExtraInteractionDetails(interaction: LiveMetrics.Interaction): Promise {\n const success = await LiveMetrics.LiveMetrics.instance().logInteractionScripts(interaction);\n if (success) {\n await Common.Console.Console.instance().showPromise();\n }\n }\n\n #renderInteractionsLog(): LitHtml.LitTemplate {\n if (!this.#interactions.size) {\n return LitHtml.nothing;\n }\n\n // clang-format off\n return html`\n
    {\n this.#interactionsListEl = node as HTMLElement;\n })}\n >\n ${this.#interactions.values().map(interaction => {\n const metricValue = renderMetricValue(\n 'timeline.landing.interaction-event-timing',\n interaction.duration,\n INP_THRESHOLDS,\n v => i18n.TimeUtilities.preciseMillisToString(v),\n {dim: true},\n );\n\n const isP98Excluded = this.#inpValue && this.#inpValue.value < interaction.duration;\n const isInp = this.#inpValue?.interactionId === interaction.interactionId;\n\n return html`\n
  1. \n
    \n \n \n ${interaction.interactionType}\n ${isInp ?\n html`INP`\n : nothing}\n \n ${interaction.nodeRef?.link}\n ${isP98Excluded ? html`` : nothing}\n ${metricValue}\n \n
    \n
    \n
    ${i18nString(UIStrings.phase)}
    \n
    \n ${interaction.longAnimationFrameTimings.length ? html`\n this.#logExtraInteractionDetails(interaction)}\n >${i18nString(UIStrings.duration)}\n ` : i18nString(UIStrings.duration)}\n
    \n
    \n
    \n
    ${i18nString(UIStrings.inputDelay)}
    \n
    ${Math.round(interaction.phases.inputDelay)}
    \n
    \n
    \n
    ${i18nString(UIStrings.processingDuration)}
    \n
    ${Math.round(interaction.phases.processingDuration)}
    \n
    \n
    \n
    ${i18nString(UIStrings.presentationDelay)}
    \n
    ${Math.round(interaction.phases.presentationDelay)}
    \n
    \n
    \n
    \n
  2. \n `;\n })}\n
\n `;\n // clang-format on\n }\n\n async #revealLayoutShiftCluster(clusterIds: Set): Promise {\n if (!this.#logsEl) {\n return;\n }\n\n const layoutShiftEls: HTMLElement[] = [];\n for (const shiftId of clusterIds) {\n const layoutShiftEl = this.#shadow.getElementById(shiftId);\n if (layoutShiftEl) {\n layoutShiftEls.push(layoutShiftEl);\n }\n }\n\n if (!layoutShiftEls.length) {\n return;\n }\n\n const success = this.#logsEl.selectTab('layout-shifts');\n if (!success) {\n return;\n }\n\n await RenderCoordinator.write(() => {\n layoutShiftEls[0].scrollIntoView({\n block: 'start',\n });\n layoutShiftEls[0].focus();\n for (const layoutShiftEl of layoutShiftEls) {\n UI.UIUtils.runCSSAnimationOnce(layoutShiftEl, 'highlight');\n }\n });\n }\n\n #renderLayoutShiftsLog(): LitHtml.LitTemplate {\n if (!this.#layoutShifts.length) {\n return LitHtml.nothing;\n }\n\n // clang-format off\n return html`\n
    {\n this.#layoutShiftsListEl = node as HTMLElement;\n })}\n >\n ${this.#layoutShifts.map(layoutShift => {\n const metricValue = renderMetricValue(\n 'timeline.landing.layout-shift-event-score',\n layoutShift.score,\n CLS_THRESHOLDS,\n // CLS value is 2 decimal places, but individual shift scores tend to be much smaller\n // so we expand the precision here.\n v => v.toFixed(4),\n {dim: true},\n );\n\n return html`\n
  1. \n
    Layout shift score: ${metricValue}
    \n
    \n ${layoutShift.affectedNodeRefs.map(({link}) => html`\n
    ${link}
    \n `)}\n
    \n
  2. \n `;\n })}\n
\n `;\n // clang-format on\n }\n\n #renderNodeView(): LitHtml.LitTemplate {\n return html`\n
\n
\n

${i18nString(UIStrings.nodePerformanceTimeline)}

\n
${i18nString(UIStrings.nodeClickToRecord)}
\n
${this.#renderRecordAction(this.#toggleRecordAction)}
\n
\n
\n `;\n }\n\n #render = (): void => {\n if (this.#isNode) {\n LitHtml.render(this.#renderNodeView(), this.#shadow, {host: this});\n return;\n }\n\n const fieldEnabled = this.#cruxManager.getConfigSetting().get().enabled;\n const liveMetricsTitle =\n fieldEnabled ? i18nString(UIStrings.localAndFieldMetrics) : i18nString(UIStrings.localMetrics);\n\n const helpLink = 'https://web.dev/articles/lab-and-field-data-differences#lab_data_versus_field_data' as\n Platform.DevToolsPath.UrlString;\n\n // clang-format off\n const output = html`\n
\n
\n
\n

${liveMetricsTitle}

\n
{\n this.#tooltipContainerEl = node;\n })}\n >\n
\n ${this.#renderLcpCard()}\n
\n
\n ${this.#renderClsCard()}\n
\n
\n ${this.#renderInpCard()}\n
\n
\n ${i18nString(UIStrings.localFieldLearnMoreLink)}\n ${this.#renderLogSection()}\n
\n \n
\n
\n `;\n LitHtml.render(output, this.#shadow, {host: this});\n };\n // clang-format on\n}\n\nclass LiveMetricsLogs extends UI.Widget.WidgetElement {\n #tabbedPane?: UI.TabbedPane.TabbedPane;\n\n constructor() {\n super();\n this.style.display = 'contents';\n }\n\n /**\n * Returns `true` if selecting the tab was successful.\n */\n selectTab(tabId: string): boolean {\n if (!this.#tabbedPane) {\n return false;\n }\n return this.#tabbedPane.selectTab(tabId);\n }\n\n #clearCurrentLog(): void {\n const liveMetrics = LiveMetrics.LiveMetrics.instance();\n\n switch (this.#tabbedPane?.selectedTabId) {\n case 'interactions':\n liveMetrics.clearInteractions();\n break;\n case 'layout-shifts':\n liveMetrics.clearLayoutShifts();\n break;\n }\n }\n\n override createWidget(): UI.Widget.Widget {\n // We need a generic widget with a shadow DOM as the container widget so that we can take advantage\n // of web component slots. Passing `this` into the container widget will make `this` the root element\n // of that widget.\n //\n // Any children of the root element `this` will be matched to the slots defined within the container\n // widget's shadow DOM.\n const containerWidget = new UI.Widget.Widget(true, undefined, this);\n containerWidget.contentElement.style.display = 'contents';\n\n this.#tabbedPane = new UI.TabbedPane.TabbedPane();\n\n // Taking advantage of web component slots allows us to render updates in the lit templates defined in the\n // main component. This should be more performant and doesn't require us to inject live metrics styles twice.\n const interactionsSlot = document.createElement('slot');\n interactionsSlot.name = 'interactions-log-content';\n const interactionsTab = UI.Widget.Widget.getOrCreateWidget(interactionsSlot);\n this.#tabbedPane.appendTab(\n 'interactions', i18nString(UIStrings.interactions), interactionsTab, undefined, undefined, undefined, undefined,\n undefined, 'timeline.landing.interactions-log');\n\n const layoutShiftsSlot = document.createElement('slot');\n layoutShiftsSlot.name = 'layout-shifts-log-content';\n const layoutShiftsTab = UI.Widget.Widget.getOrCreateWidget(layoutShiftsSlot);\n this.#tabbedPane.appendTab(\n 'layout-shifts', i18nString(UIStrings.layoutShifts), layoutShiftsTab, undefined, undefined, undefined,\n undefined, undefined, 'timeline.landing.layout-shifts-log');\n\n const clearButton = new UI.Toolbar.ToolbarButton(\n i18nString(UIStrings.clearCurrentLog), 'clear', undefined, 'timeline.landing.clear-log');\n clearButton.addEventListener(UI.Toolbar.ToolbarButton.Events.CLICK, this.#clearCurrentLog, this);\n this.#tabbedPane.rightToolbar().appendToolbarItem(clearButton);\n this.#tabbedPane.show(containerWidget.contentElement);\n\n return containerWidget;\n }\n}\n\ncustomElements.define('devtools-live-metrics-view', LiveMetricsView);\ncustomElements.define('devtools-live-metrics-logs', LiveMetricsLogs);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'devtools-live-metrics-view': LiveMetricsView;\n 'devtools-live-metrics-logs': LiveMetricsLogs;\n }\n}\n"]} \ No newline at end of file diff --git a/public/panels/timeline/components/LiveMetricsView.test.js b/public/panels/timeline/components/LiveMetricsView.test.js index c11f5f810..ced9abdbb 100644 --- a/public/panels/timeline/components/LiveMetricsView.test.js +++ b/public/panels/timeline/components/LiveMetricsView.test.js @@ -9,10 +9,9 @@ import * as LiveMetrics from '../../../models/live-metrics/live-metrics.js'; import { renderElementIntoDOM } from '../../../testing/DOMHelpers.js'; import { createTarget } from '../../../testing/EnvironmentHelpers.js'; import { describeWithMockConnection } from '../../../testing/MockConnection.js'; -import * as Coordinator from '../../../ui/components/render_coordinator/render_coordinator.js'; +import * as RenderCoordinator from '../../../ui/components/render_coordinator/render_coordinator.js'; import * as UI from '../../../ui/legacy/legacy.js'; import * as Components from './components.js'; -const coordinator = Coordinator.RenderCoordinator.RenderCoordinator.instance(); function renderLiveMetrics() { const root = document.createElement('div'); renderElementIntoDOM(root); @@ -189,14 +188,14 @@ describeWithMockConnection('LiveMetricsView', () => { ]), layoutShifts: [], }); - await coordinator.done(); + await RenderCoordinator.done(); const interactionsEls = getInteractions(view); assert.lengthOf(interactionsEls, 2); // Click each interaction so we can test the expandable details. for (const interactionEl of interactionsEls) { interactionEl.querySelector('summary').click(); } - await coordinator.done(); + await RenderCoordinator.done(); const typeEl1 = interactionsEls[0].querySelector('.interaction-type'); assert.match(typeEl1.textContent, /pointer/); const inpChip1 = typeEl1.querySelector('.interaction-inp-chip'); @@ -266,7 +265,7 @@ describeWithMockConnection('LiveMetricsView', () => { ]), layoutShifts: [], }); - await coordinator.done(); + await RenderCoordinator.done(); const interactions = getInteractions(view); assert.lengthOf(interactions, 2); assert(interactions[0].querySelector('.log-extra-details-button'), 'First interaction should have log details button'); @@ -308,7 +307,7 @@ describeWithMockConnection('LiveMetricsView', () => { ]), layoutShifts: [], }); - await coordinator.done(); + await RenderCoordinator.done(); const interactionsEls = getInteractions(view); assert.lengthOf(interactionsEls, 2); const typeEl1 = interactionsEls[0].querySelector('.interaction-type'); @@ -340,14 +339,14 @@ describeWithMockConnection('LiveMetricsView', () => { { score: 0.01, affectedNodeRefs: [], uniqueLayoutShiftId: 'layout-shift-1-3' }, ], }); - await coordinator.done(); + await RenderCoordinator.done(); selectVisibleLog(view, 'interactions'); - await coordinator.done(); + await RenderCoordinator.done(); const firstClusterShift = getLayoutShifts(view).find(el => el.id === 'layout-shift-1-2'); assert.isFalse(firstClusterShift.checkVisibility()); assert.isFalse(firstClusterShift.hasFocus()); getClsClusterLink(view).click(); - await coordinator.done(); + await RenderCoordinator.done(); assert.isTrue(firstClusterShift.checkVisibility()); assert.isTrue(firstClusterShift.hasFocus()); }); @@ -365,7 +364,7 @@ describeWithMockConnection('LiveMetricsView', () => { { score: 0.01, affectedNodeRefs: [], uniqueLayoutShiftId: 'layout-shift-1-3' }, ], }); - await coordinator.done(); + await RenderCoordinator.done(); assert.isNull(getClsClusterLink(view)); }); it('should hide CLS cluster link if there are no matching shifts', async () => { @@ -382,7 +381,7 @@ describeWithMockConnection('LiveMetricsView', () => { { score: 0.01, affectedNodeRefs: [], uniqueLayoutShiftId: 'layout-shift-1-3' }, ], }); - await coordinator.done(); + await RenderCoordinator.done(); assert.isNull(getClsClusterLink(view)); }); it('should reveal INP interaction when link clicked', async () => { @@ -421,15 +420,15 @@ describeWithMockConnection('LiveMetricsView', () => { ]), layoutShifts: [], }); - await coordinator.done(); + await RenderCoordinator.done(); selectVisibleLog(view, 'layout-shifts'); - await coordinator.done(); + await RenderCoordinator.done(); const inpInteractionEl = getInteractions(view).find(el => el.id === 'interaction-1-1'); assert.isFalse(inpInteractionEl.checkVisibility()); assert.isFalse(inpInteractionEl.hasFocus()); const inpInteractionLink = getInpInteractionLink(view); inpInteractionLink.click(); - await coordinator.done(); + await RenderCoordinator.done(); assert.isTrue(inpInteractionEl.checkVisibility()); assert.isTrue(inpInteractionEl.hasFocus()); }); @@ -459,13 +458,13 @@ describeWithMockConnection('LiveMetricsView', () => { ]), layoutShifts: [], }); - await coordinator.done(); + await RenderCoordinator.done(); const inpInteractionLink = getInpInteractionLink(view); assert.isNull(inpInteractionLink); }); it('clear interactions log button should work', async () => { const view = renderLiveMetrics(); - await coordinator.done(); + await RenderCoordinator.done(); assert.lengthOf(getInteractions(view), 0); assert.lengthOf(getLayoutShifts(view), 0); LiveMetrics.LiveMetrics.instance().setStatusForTesting({ @@ -504,18 +503,18 @@ describeWithMockConnection('LiveMetricsView', () => { { score: 0.1, affectedNodeRefs: [], uniqueLayoutShiftId: 'layout-shift-1-1' }, ], }); - await coordinator.done(); + await RenderCoordinator.done(); assert.lengthOf(getInteractions(view), 2); assert.lengthOf(getLayoutShifts(view), 1); const clearLogButton = getClearLogButton(view); clearLogButton.click(); - await coordinator.done(); + await RenderCoordinator.done(); assert.lengthOf(getInteractions(view), 0); assert.lengthOf(getLayoutShifts(view), 1); }); it('clear layout shifts log button should work', async () => { const view = renderLiveMetrics(); - await coordinator.done(); + await RenderCoordinator.done(); assert.lengthOf(getInteractions(view), 0); assert.lengthOf(getLayoutShifts(view), 0); LiveMetrics.LiveMetrics.instance().setStatusForTesting({ @@ -554,37 +553,37 @@ describeWithMockConnection('LiveMetricsView', () => { { score: 0.1, affectedNodeRefs: [], uniqueLayoutShiftId: 'layout-shift-1-1' }, ], }); - await coordinator.done(); + await RenderCoordinator.done(); assert.lengthOf(getInteractions(view), 2); assert.lengthOf(getLayoutShifts(view), 1); selectVisibleLog(view, 'layout-shifts'); - await coordinator.done(); + await RenderCoordinator.done(); const clearLogButton = getClearLogButton(view); clearLogButton.click(); - await coordinator.done(); + await RenderCoordinator.done(); assert.lengthOf(getInteractions(view), 2); assert.lengthOf(getLayoutShifts(view), 0); }); it('record action button should work', async () => { const view = renderLiveMetrics(); - await coordinator.done(); + await RenderCoordinator.done(); const recordButton = view.shadowRoot?.querySelector('#record devtools-button'); recordButton.click(); - await coordinator.done(); + await RenderCoordinator.done(); assert.strictEqual(mockHandleAction.firstCall.args[1], 'timeline.toggle-recording'); }); it('record page load button should work', async () => { const view = renderLiveMetrics(); - await coordinator.done(); + await RenderCoordinator.done(); const recordButton = view.shadowRoot?.querySelector('#record-page-load devtools-button'); recordButton.click(); - await coordinator.done(); + await RenderCoordinator.done(); assert.strictEqual(mockHandleAction.firstCall.args[1], 'timeline.record-reload'); }); it('should show minimal view for Node connections', async () => { const view = renderLiveMetrics(); view.isNode = true; - await coordinator.done(); + await RenderCoordinator.done(); const title = view.shadowRoot?.querySelector('.section-title'); assert.strictEqual(title.textContent, 'Node performance'); }); @@ -612,7 +611,7 @@ describeWithMockConnection('LiveMetricsView', () => { CrUXManager.CrUXManager.instance().getConfigSetting().set({ enabled: false, override: '' }); mockFieldData['url-ALL'] = createMockFieldData(); const view = renderLiveMetrics(); - await coordinator.done(); + await RenderCoordinator.done(); const envRecs = getEnvironmentRecs(view); assert.lengthOf(envRecs, 0); const fieldMessage = getFieldMessage(view); @@ -622,14 +621,14 @@ describeWithMockConnection('LiveMetricsView', () => { }); it('should show when crux is enabled', async () => { const view = renderLiveMetrics(); - await coordinator.done(); + await RenderCoordinator.done(); mockFieldData['url-ALL'] = createMockFieldData(); target.model(SDK.ResourceTreeModel.ResourceTreeModel) ?.dispatchEventToListeners(SDK.ResourceTreeModel.Events.FrameNavigated, { url: 'https://example.com', isPrimaryFrame: () => true, }); - await coordinator.done(); + await RenderCoordinator.done(); const envRecs = getEnvironmentRecs(view); assert.lengthOf(envRecs, 2); assert.match(envRecs[0].textContent, /60%.*desktop/); @@ -645,13 +644,13 @@ describeWithMockConnection('LiveMetricsView', () => { }); it('should show empty values when crux is enabled but there is no field data', async () => { const view = renderLiveMetrics(); - await coordinator.done(); + await RenderCoordinator.done(); target.model(SDK.ResourceTreeModel.ResourceTreeModel) ?.dispatchEventToListeners(SDK.ResourceTreeModel.Events.FrameNavigated, { url: 'https://example.com', isPrimaryFrame: () => true, }); - await coordinator.done(); + await RenderCoordinator.done(); const envRecs = getEnvironmentRecs(view); assert.strictEqual(envRecs[0].textContent, 'Not enough data'); assert.strictEqual(envRecs[1].textContent, 'Not enough data'); @@ -663,25 +662,25 @@ describeWithMockConnection('LiveMetricsView', () => { it('should display any warning from crux', async () => { mockFieldData.warnings.push('Warning from crux'); const view = renderLiveMetrics(); - await coordinator.done(); + await RenderCoordinator.done(); const fieldMessage = getFieldMessage(view); assert.match(fieldMessage.textContent, /Warning from crux/); }); it('should make initial request on render when crux is enabled', async () => { mockFieldData['url-ALL'] = createMockFieldData(); const view = renderLiveMetrics(); - await coordinator.done(); + await RenderCoordinator.done(); const lcpFieldEl = getFieldMetricValue(view, 'lcp'); assert.strictEqual(lcpFieldEl.textContent, '1.00 s'); }); it('should be removed once crux is disabled', async () => { mockFieldData['url-ALL'] = createMockFieldData(); const view = renderLiveMetrics(); - await coordinator.done(); + await RenderCoordinator.done(); const lcpFieldEl1 = getFieldMetricValue(view, 'lcp'); assert.strictEqual(lcpFieldEl1.textContent, '1.00 s'); CrUXManager.CrUXManager.instance().getConfigSetting().set({ enabled: false, override: '' }); - await coordinator.done(); + await RenderCoordinator.done(); const lcpFieldEl2 = getFieldMetricValue(view, 'lcp'); assert.isNull(lcpFieldEl2); }); @@ -690,11 +689,11 @@ describeWithMockConnection('LiveMetricsView', () => { mockFieldData['origin-ALL'] = createMockFieldData(); mockFieldData['origin-ALL'].record.metrics.largest_contentful_paint.percentiles.p75 = 2000; const view = renderLiveMetrics(); - await coordinator.done(); + await RenderCoordinator.done(); const lcpFieldEl1 = getFieldMetricValue(view, 'lcp'); assert.strictEqual(lcpFieldEl1.textContent, '1.00 s'); selectPageScope(view, 'origin'); - await coordinator.done(); + await RenderCoordinator.done(); const lcpFieldEl2 = getFieldMetricValue(view, 'lcp'); assert.strictEqual(lcpFieldEl2.textContent, '2.00 s'); }); @@ -703,12 +702,12 @@ describeWithMockConnection('LiveMetricsView', () => { mockFieldData['url-PHONE'] = createMockFieldData(); mockFieldData['url-PHONE'].record.metrics.largest_contentful_paint.percentiles.p75 = 2000; const view = renderLiveMetrics(); - await coordinator.done(); + await RenderCoordinator.done(); selectDeviceOption(view, 'ALL'); const lcpFieldEl1 = getFieldMetricValue(view, 'lcp'); assert.strictEqual(lcpFieldEl1.textContent, '1.00 s'); selectDeviceOption(view, 'PHONE'); - await coordinator.done(); + await RenderCoordinator.done(); const lcpFieldEl2 = getFieldMetricValue(view, 'lcp'); assert.strictEqual(lcpFieldEl2.textContent, '2.00 s'); }); @@ -720,7 +719,7 @@ describeWithMockConnection('LiveMetricsView', () => { // So we should expect the recommended preset to be "Slow 4G". mockFieldData['url-ALL'].record.metrics.round_trip_time.percentiles.p75 = 165; const view = renderLiveMetrics(); - await coordinator.done(); + await RenderCoordinator.done(); const envRecs = getEnvironmentRecs(view); assert.lengthOf(envRecs, 2); assert.strictEqual(envRecs[0].textContent, '30% mobile, 60% desktop'); @@ -733,7 +732,7 @@ describeWithMockConnection('LiveMetricsView', () => { mockFieldData['url-ALL'] = createMockFieldData(); mockFieldData['url-ALL'].record.metrics.round_trip_time = undefined; const view = renderLiveMetrics(); - await coordinator.done(); + await RenderCoordinator.done(); const envRecs = getEnvironmentRecs(view); assert.strictEqual(envRecs[0].textContent, '30% mobile, 60% desktop'); assert.strictEqual(envRecs[1].textContent, 'Not enough data'); @@ -747,7 +746,7 @@ describeWithMockConnection('LiveMetricsView', () => { // but that preset should be ignored. mockFieldData['url-ALL'].record.metrics.round_trip_time.percentiles.p75 = 1; const view = renderLiveMetrics(); - await coordinator.done(); + await RenderCoordinator.done(); const envRecs = getEnvironmentRecs(view); assert.strictEqual(envRecs[0].textContent, '30% mobile, 60% desktop'); assert.match(envRecs[1].textContent, /too fast to simulate with throttling/); @@ -761,7 +760,7 @@ describeWithMockConnection('LiveMetricsView', () => { // still too far away in general. mockFieldData['url-ALL'].record.metrics.round_trip_time.percentiles.p75 = 10_000; const view = renderLiveMetrics(); - await coordinator.done(); + await RenderCoordinator.done(); const envRecs = getEnvironmentRecs(view); assert.strictEqual(envRecs[0].textContent, '30% mobile, 60% desktop'); assert.strictEqual(envRecs[1].textContent, 'Not enough data'); @@ -774,7 +773,7 @@ describeWithMockConnection('LiveMetricsView', () => { it('should recommend desktop if it is the majority', async () => { mockFieldData['url-ALL'] = createMockFieldData(); const view = renderLiveMetrics(); - await coordinator.done(); + await RenderCoordinator.done(); const envRecs = getEnvironmentRecs(view); assert.strictEqual(envRecs[0].textContent, '30% mobile, 60% desktop'); assert.match(envRecs[1].textContent, /Slow 4G/); @@ -787,7 +786,7 @@ describeWithMockConnection('LiveMetricsView', () => { tablet: 0.1, }; const view = renderLiveMetrics(); - await coordinator.done(); + await RenderCoordinator.done(); const envRecs = getEnvironmentRecs(view); assert.strictEqual(envRecs[0].textContent, '80% mobile, 10% desktop'); assert.match(envRecs[1].textContent, /Slow 4G/); @@ -800,7 +799,7 @@ describeWithMockConnection('LiveMetricsView', () => { tablet: 0.02, }; const view = renderLiveMetrics(); - await coordinator.done(); + await RenderCoordinator.done(); const envRecs = getEnvironmentRecs(view); assert.strictEqual(envRecs[0].textContent, '49% mobile, 49% desktop'); assert.match(envRecs[1].textContent, /Slow 4G/); diff --git a/public/panels/timeline/components/LiveMetricsView.test.js.map b/public/panels/timeline/components/LiveMetricsView.test.js.map index 928edfa8d..ee680fd7a 100644 --- a/public/panels/timeline/components/LiveMetricsView.test.js.map +++ b/public/panels/timeline/components/LiveMetricsView.test.js.map @@ -1 +1 @@ -{"version":3,"file":"LiveMetricsView.test.js","sourceRoot":"","sources":["../../../../../../../front_end/panels/timeline/components/LiveMetricsView.test.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,KAAK,MAAM,MAAM,gCAAgC,CAAC;AACzD,OAAO,KAAK,GAAG,MAAM,0BAA0B,CAAC;AAChD,OAAO,KAAK,WAAW,MAAM,8CAA8C,CAAC;AAC5E,OAAO,KAAK,cAAc,MAAM,wCAAwC,CAAC;AACzE,OAAO,KAAK,WAAW,MAAM,8CAA8C,CAAC;AAC5E,OAAO,EAAC,oBAAoB,EAAC,MAAM,gCAAgC,CAAC;AACpE,OAAO,EAAC,YAAY,EAAC,MAAM,wCAAwC,CAAC;AACpE,OAAO,EAAC,0BAA0B,EAAC,MAAM,oCAAoC,CAAC;AAC9E,OAAO,KAAK,WAAW,MAAM,iEAAiE,CAAC;AAC/F,OAAO,KAAK,EAAE,MAAM,8BAA8B,CAAC;AAEnD,OAAO,KAAK,UAAU,MAAM,iBAAiB,CAAC;AAE9C,MAAM,WAAW,GAAG,WAAW,CAAC,iBAAiB,CAAC,iBAAiB,CAAC,QAAQ,EAAE,CAAC;AAE/E,SAAS,iBAAiB;IACxB,MAAM,IAAI,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;IAC3C,oBAAoB,CAAC,IAAI,CAAC,CAAC;IAE3B,MAAM,MAAM,GAAG,IAAI,EAAE,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC;IACtC,MAAM,CAAC,UAAU,EAAE,CAAC;IACpB,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAElB,MAAM,IAAI,GAAG,IA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AC;YACnD,CAAC,CAAC,CAAC;YAEH,EAAE,CAAC,kDAAkD,EAAE,KAAK,IAAI,EAAE;gBAChE,aAAa,CAAC,SAAS,CAAC,GAAG,mBAAmB,EAAE,CAAC;gBAEjD,aAAa,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,YAAa,CAAC,SAAS,GAAG;oBAChE,OAAO,EAAE,IAAI;oBACb,KAAK,EAAE,IAAI;oBACX,MAAM,EAAE,IAAI;iBACb,CAAC;gBAEF,MAAM,IAAI,GAAG,iBAAiB,EAAE,CAAC;gBAEjC,MAAM,WAAW,CAAC,IAAI,EAAE,CAAC;gBAEzB,MAAM,OAAO,GAAG,kBAAkB,CAAC,IAAI,CAAC,CAAC;gBACzC,MAAM,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,yBAAyB,CAAC,CAAC;gBACtE,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,WAAY,EAAE,SAAS,CAAC,CAAC;YACnD,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["// Copyright 2023 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport * as Common from '../../../core/common/common.js';\nimport * as SDK from '../../../core/sdk/sdk.js';\nimport * as CrUXManager from '../../../models/crux-manager/crux-manager.js';\nimport * as EmulationModel from '../../../models/emulation/emulation.js';\nimport * as LiveMetrics from '../../../models/live-metrics/live-metrics.js';\nimport {renderElementIntoDOM} from '../../../testing/DOMHelpers.js';\nimport {createTarget} from '../../../testing/EnvironmentHelpers.js';\nimport {describeWithMockConnection} from '../../../testing/MockConnection.js';\nimport * as Coordinator from '../../../ui/components/render_coordinator/render_coordinator.js';\nimport * as UI from '../../../ui/legacy/legacy.js';\n\nimport * as Components from './components.js';\n\nconst coordinator = Coordinator.RenderCoordinator.RenderCoordinator.instance();\n\nfunction renderLiveMetrics(): Components.LiveMetricsView.LiveMetricsView {\n const root = document.createElement('div');\n renderElementIntoDOM(root);\n\n const widget = new UI.Widget.Widget();\n widget.markAsRoot();\n widget.show(root);\n\n const view = new Components.LiveMetricsView.LiveMetricsView();\n widget.contentElement.append(view);\n\n return view;\n}\n\nfunction getFieldMetricValue(view: Element, metric: string): HTMLElement|null {\n const card = view.shadowRoot!.querySelector(`#${metric} devtools-metric-card`);\n return card!.shadowRoot!.querySelector('#field-value .metric-value');\n}\n\nfunction getEnvironmentRecs(view: Element): HTMLElement[] {\n return Array.from(view.shadowRoot!.querySelectorAll('.environment-rec'));\n}\n\nfunction getInteractions(view: Element): HTMLElement[] {\n const interactionsListEl = view.shadowRoot!.querySelector('.log[slot=\"interactions-log-content\"]');\n return Array.from(interactionsListEl?.querySelectorAll('.interaction') || []) as HTMLElement[];\n}\n\nfunction getLayoutShifts(view: Element): HTMLElement[] {\n const interactionsListEl = view.shadowRoot!.querySelector('.log[slot=\"layout-shifts-log-content\"]');\n return Array.from(interactionsListEl?.querySelectorAll('.layout-shift') || []) as HTMLElement[];\n}\n\nfunction selectVisibleLog(view: Element, logId: string): void {\n view.shadowRoot!.querySelector('devtools-live-metrics-logs')!.shadowRoot!.querySelector('.tabbed-pane')!.shadowRoot!\n .getElementById(`tab-${logId}`)\n ?.dispatchEvent(\n new MouseEvent('mousedown', {bubbles: true}),\n );\n}\n\nfunction getClearLogButton(view: Element): HTMLElementTagNameMap['devtools-button'] {\n return view.shadowRoot!.querySelector('devtools-live-metrics-logs')!.shadowRoot!.querySelector('.tabbed-pane')!\n .shadowRoot!.querySelector('.toolbar')!.shadowRoot!.querySelector('devtools-button')!;\n}\n\nfunction selectDeviceOption(view: Element, deviceOption: string): void {\n const deviceScopeSelector = view.shadowRoot!.querySelector('devtools-select-menu#device-scope-select') as HTMLElement;\n const deviceScopeOptions = Array.from(deviceScopeSelector.querySelectorAll('devtools-menu-item')) as\n HTMLElementTagNameMap['devtools-menu-item'][];\n\n deviceScopeSelector.click();\n deviceScopeOptions.find(o => o.value === deviceOption)!.click();\n}\n\nfunction selectPageScope(view: Element, pageScope: string): void {\n const pageScopeSelector = view.shadowRoot!.querySelector('devtools-select-menu#page-scope-select') as HTMLElement;\n pageScopeSelector.click();\n\n const pageScopeOptions = Array.from(pageScopeSelector.querySelectorAll('devtools-menu-item')) as\n HTMLElementTagNameMap['devtools-menu-item'][];\n const originOption = pageScopeOptions.find(o => o.value === pageScope);\n originOption!.click();\n}\n\nfunction getFieldMessage(view: Element): HTMLElement|null {\n return view.shadowRoot!.querySelector('#field-setup .field-data-message');\n}\n\nfunction getLiveMetricsTitle(view: Element): HTMLElement {\n // There may be multiple, but this should always be the first one.\n return view.shadowRoot!.querySelector('.live-metrics > .section-title') as HTMLElement;\n}\n\nfunction getInpInteractionLink(view: Element): HTMLElement|null {\n return view.shadowRoot!.querySelector('#inp .related-info button');\n}\n\nfunction getClsClusterLink(view: Element): HTMLElement|null {\n return view.shadowRoot!.querySelector('#cls .related-info button');\n}\n\nfunction createMockFieldData() {\n return {\n record: {\n key: {\n // Only one of these keys will be set for a given result in reality\n // Setting both here to make testing easier.\n url: 'https://example.com/',\n origin: 'https://example.com',\n },\n metrics: {\n largest_contentful_paint: {\n histogram: [\n {start: 0, end: 2500, density: 0.5},\n {start: 2500, end: 4000, density: 0.3},\n {start: 4000, density: 0.2},\n ],\n percentiles: {p75: 1000},\n },\n cumulative_layout_shift: {\n histogram: [\n {start: 0, end: 0.1},\n {start: 0.1, end: 0.25, density: 0.2},\n {start: 0.25, density: 0.8},\n ],\n percentiles: {p75: 0.25},\n },\n round_trip_time: {\n percentiles: {p75: 150},\n },\n form_factors: {\n fractions: {\n desktop: 0.6,\n phone: 0.3,\n tablet: 0.1,\n },\n },\n },\n collectionPeriod: {\n firstDate: {year: 2024, month: 1, day: 1},\n lastDate: {year: 2024, month: 1, day: 29},\n },\n },\n };\n}\n\nfunction createInteractionsMap(interactions: LiveMetrics.Interaction[]): LiveMetrics.InteractionMap {\n return new Map(interactions.map(interaction => [interaction.interactionId, interaction]));\n}\n\ndescribeWithMockConnection('LiveMetricsView', () => {\n const mockHandleAction = sinon.stub();\n\n beforeEach(async () => {\n mockHandleAction.reset();\n\n UI.ActionRegistration.registerActionExtension({\n actionId: 'timeline.toggle-recording',\n category: UI.ActionRegistration.ActionCategory.PERFORMANCE,\n loadActionDelegate: async () => ({handleAction: mockHandleAction}),\n });\n UI.ActionRegistration.registerActionExtension({\n actionId: 'timeline.record-reload',\n category: UI.ActionRegistration.ActionCategory.PERFORMANCE,\n loadActionDelegate: async () => ({handleAction: mockHandleAction}),\n });\n\n const dummyStorage = new Common.Settings.SettingsStorage({});\n Common.Settings.Settings.instance({\n forceNew: true,\n syncedStorage: dummyStorage,\n globalStorage: dummyStorage,\n localStorage: dummyStorage,\n });\n\n const actionRegistryInstance = UI.ActionRegistry.ActionRegistry.instance({forceNew: true});\n UI.ShortcutRegistry.ShortcutRegistry.instance({forceNew: true, actionRegistry: actionRegistryInstance});\n LiveMetrics.LiveMetrics.instance({forceNew: true});\n CrUXManager.CrUXManager.instance({forceNew: true});\n EmulationModel.DeviceModeModel.DeviceModeModel.instance({forceNew: true});\n });\n\n afterEach(async () => {\n UI.ActionRegistry.ActionRegistry.reset();\n UI.ShortcutRegistry.ShortcutRegistry.removeInstance();\n\n UI.ActionRegistration.maybeRemoveActionExtension('timeline.toggle-recording');\n UI.ActionRegistration.maybeRemoveActionExtension('timeline.record-reload');\n });\n\n it('should show interactions', async () => {\n const view = renderLiveMetrics();\n LiveMetrics.LiveMetrics.instance().setStatusForTesting({\n inp: {\n value: 500,\n phases: {\n inputDelay: 100,\n processingDuration: 300,\n presentationDelay: 100,\n },\n interactionId: 'interaction-1-1',\n },\n interactions: createInteractionsMap([\n {\n duration: 500,\n startTime: 0,\n nextPaintTime: 500,\n interactionType: 'pointer',\n interactionId: 'interaction-1-1',\n eventNames: ['pointerup'],\n phases: {inputDelay: 100, processingDuration: 300, presentationDelay: 100},\n longAnimationFrameTimings: [],\n },\n {\n duration: 30,\n startTime: 0,\n nextPaintTime: 30,\n interactionType: 'keyboard',\n interactionId: 'interaction-1-2',\n eventNames: ['keyup'],\n phases: {inputDelay: 10, processingDuration: 10, presentationDelay: 10},\n longAnimationFrameTimings: [],\n },\n ]),\n layoutShifts: [],\n });\n await coordinator.done();\n\n const interactionsEls = getInteractions(view);\n assert.lengthOf(interactionsEls, 2);\n\n // Click each interaction so we can test the expandable details.\n for (const interactionEl of interactionsEls) {\n interactionEl.querySelector('summary')!.click();\n }\n\n await coordinator.done();\n\n const typeEl1 = interactionsEls[0].querySelector('.interaction-type') as HTMLDivElement;\n assert.match(typeEl1.textContent!, /pointer/);\n\n const inpChip1 = typeEl1.querySelector('.interaction-inp-chip');\n assert.isNotNull(inpChip1);\n\n const durationEl1 = interactionsEls[0].querySelector('.interaction-duration .metric-value') as HTMLDivElement;\n assert.strictEqual(durationEl1.textContent, '500 ms');\n assert.strictEqual(durationEl1.className, 'metric-value needs-improvement dim');\n\n const phases1 =\n Array.from(interactionsEls[0].querySelectorAll('.phase-table-row:not(.phase-table-header-row)'))\n .map(el => el.innerText);\n assert.deepEqual(phases1, [\n 'Input delay\\n100',\n 'Processing duration\\n300',\n 'Presentation delay\\n100',\n ]);\n\n const typeEl2 = interactionsEls[1].querySelector('.interaction-type') as HTMLDivElement;\n assert.match(typeEl2.textContent!, /keyboard/);\n\n const inpChip2 = typeEl2.querySelector('.interaction-inp-chip');\n assert.isNull(inpChip2);\n\n const durationEl2 = interactionsEls[1].querySelector('.interaction-duration .metric-value') as HTMLDivElement;\n assert.strictEqual(durationEl2.textContent, '30 ms');\n assert.strictEqual(durationEl2.className, 'metric-value good dim');\n\n const phases2 =\n Array.from(interactionsEls[1].querySelectorAll('.phase-table-row:not(.phase-table-header-row)'))\n .map(el => el.innerText);\n assert.deepEqual(phases2, [\n 'Input delay\\n10',\n 'Processing duration\\n10',\n 'Presentation delay\\n10',\n ]);\n });\n\n it('should show button to log script details to console', async () => {\n const view = renderLiveMetrics();\n LiveMetrics.LiveMetrics.instance().setStatusForTesting({\n inp: {\n value: 500,\n phases: {\n inputDelay: 100,\n processingDuration: 300,\n presentationDelay: 100,\n },\n interactionId: 'interaction-1-1',\n },\n interactions: createInteractionsMap([\n {\n duration: 500,\n startTime: 0,\n nextPaintTime: 500,\n interactionType: 'pointer',\n interactionId: 'interaction-1-1',\n eventNames: ['pointerup'],\n phases: {inputDelay: 100, processingDuration: 300, presentationDelay: 100},\n longAnimationFrameTimings: [{\n renderStart: 0,\n duration: 0,\n scripts: [],\n }],\n },\n {\n duration: 30,\n startTime: 0,\n nextPaintTime: 30,\n interactionType: 'keyboard',\n interactionId: 'interaction-1-2',\n eventNames: ['keyup'],\n phases: {inputDelay: 10, processingDuration: 10, presentationDelay: 10},\n longAnimationFrameTimings: [],\n },\n ]),\n layoutShifts: [],\n });\n await coordinator.done();\n\n const interactions = getInteractions(view);\n assert.lengthOf(interactions, 2);\n\n assert(\n interactions[0].querySelector('.log-extra-details-button'), 'First interaction should have log details button');\n assert(\n !interactions[1].querySelector('.log-extra-details-button'),\n 'Second interaction should not have log details button');\n });\n\n it('should show help icon for interaction that is longer than INP', async () => {\n const view = renderLiveMetrics();\n LiveMetrics.LiveMetrics.instance().setStatusForTesting({\n inp: {\n value: 50,\n phases: {\n inputDelay: 10,\n processingDuration: 30,\n presentationDelay: 10,\n },\n interactionId: 'interaction-1-2',\n },\n interactions: createInteractionsMap([\n {\n duration: 50,\n startTime: 0,\n nextPaintTime: 50,\n interactionType: 'keyboard',\n interactionId: 'interaction-1-1',\n eventNames: ['keyup'],\n phases: {inputDelay: 10, processingDuration: 30, presentationDelay: 10},\n longAnimationFrameTimings: [],\n },\n {\n duration: 500,\n startTime: 0,\n nextPaintTime: 500,\n interactionType: 'pointer',\n interactionId: 'interaction-1-2',\n eventNames: ['pointerup'],\n phases: {inputDelay: 100, processingDuration: 300, presentationDelay: 100},\n longAnimationFrameTimings: [],\n },\n ]),\n layoutShifts: [],\n });\n await coordinator.done();\n\n const interactionsEls = getInteractions(view);\n assert.lengthOf(interactionsEls, 2);\n\n const typeEl1 = interactionsEls[0].querySelector('.interaction-type');\n assert.match(typeEl1!.textContent!, /keyboard/);\n\n const durationEl1 = interactionsEls[0].querySelector('.interaction-duration .metric-value');\n assert.strictEqual(durationEl1!.textContent, '50 ms');\n assert.strictEqual(durationEl1!.className, 'metric-value good dim');\n\n const helpEl1 = interactionsEls[0].querySelector('.interaction-info');\n assert.isNull(helpEl1);\n\n const typeEl2 = interactionsEls[1].querySelector('.interaction-type');\n assert.match(typeEl2!.textContent!, /pointer/);\n\n const helpEl2 = interactionsEls[1].querySelector('.interaction-info');\n assert.match(helpEl2!.title, /98th percentile/);\n\n const durationEl2 = interactionsEls[1].querySelector('.interaction-duration .metric-value');\n assert.strictEqual(durationEl2!.textContent, '500 ms');\n assert.strictEqual(durationEl2!.className, 'metric-value needs-improvement dim');\n });\n\n it('should reveal CLS cluster when link clicked', async () => {\n const view = renderLiveMetrics();\n LiveMetrics.LiveMetrics.instance().setStatusForTesting({\n cls: {\n value: 0.11,\n clusterShiftIds: ['layout-shift-1-2', 'layout-shift-1-3'],\n },\n interactions: new Map(),\n layoutShifts: [\n {score: 0.05, affectedNodeRefs: [], uniqueLayoutShiftId: 'layout-shift-1-1'},\n {score: 0.1, affectedNodeRefs: [], uniqueLayoutShiftId: 'layout-shift-1-2'},\n {score: 0.01, affectedNodeRefs: [], uniqueLayoutShiftId: 'layout-shift-1-3'},\n ],\n });\n await coordinator.done();\n\n selectVisibleLog(view, 'interactions');\n\n await coordinator.done();\n\n const firstClusterShift = getLayoutShifts(view).find(el => el.id === 'layout-shift-1-2')!;\n assert.isFalse(firstClusterShift.checkVisibility());\n assert.isFalse(firstClusterShift.hasFocus());\n\n getClsClusterLink(view)!.click();\n\n await coordinator.done();\n\n assert.isTrue(firstClusterShift.checkVisibility());\n assert.isTrue(firstClusterShift.hasFocus());\n });\n\n it('should hide CLS cluster link if there is no defined cluster', async () => {\n const view = renderLiveMetrics();\n LiveMetrics.LiveMetrics.instance().setStatusForTesting({\n cls: {\n value: 0.11,\n clusterShiftIds: [],\n },\n interactions: new Map(),\n layoutShifts: [\n {score: 0.05, affectedNodeRefs: [], uniqueLayoutShiftId: 'layout-shift-1-1'},\n {score: 0.1, affectedNodeRefs: [], uniqueLayoutShiftId: 'layout-shift-1-2'},\n {score: 0.01, affectedNodeRefs: [], uniqueLayoutShiftId: 'layout-shift-1-3'},\n ],\n });\n await coordinator.done();\n\n assert.isNull(getClsClusterLink(view));\n });\n\n it('should hide CLS cluster link if there are no matching shifts', async () => {\n const view = renderLiveMetrics();\n LiveMetrics.LiveMetrics.instance().setStatusForTesting({\n cls: {\n value: 0.11,\n clusterShiftIds: ['layout-shift-2-0'],\n },\n interactions: new Map(),\n layoutShifts: [\n {score: 0.05, affectedNodeRefs: [], uniqueLayoutShiftId: 'layout-shift-1-1'},\n {score: 0.1, affectedNodeRefs: [], uniqueLayoutShiftId: 'layout-shift-1-2'},\n {score: 0.01, affectedNodeRefs: [], uniqueLayoutShiftId: 'layout-shift-1-3'},\n ],\n });\n await coordinator.done();\n\n assert.isNull(getClsClusterLink(view));\n });\n\n it('should reveal INP interaction when link clicked', async () => {\n const view = renderLiveMetrics();\n LiveMetrics.LiveMetrics.instance().setStatusForTesting({\n inp: {\n value: 500,\n phases: {\n inputDelay: 100,\n processingDuration: 300,\n presentationDelay: 100,\n },\n interactionId: 'interaction-1-1',\n },\n interactions: createInteractionsMap([\n {\n duration: 500,\n startTime: 0,\n nextPaintTime: 500,\n interactionType: 'pointer',\n interactionId: 'interaction-1-1',\n eventNames: ['pointerup'],\n phases: {inputDelay: 100, processingDuration: 300, presentationDelay: 100},\n longAnimationFrameTimings: [],\n },\n {\n duration: 30,\n startTime: 0,\n nextPaintTime: 30,\n interactionType: 'keyboard',\n interactionId: 'interaction-1-2',\n eventNames: ['keyup'],\n phases: {inputDelay: 10, processingDuration: 10, presentationDelay: 10},\n longAnimationFrameTimings: [],\n },\n ]),\n layoutShifts: [],\n });\n await coordinator.done();\n\n selectVisibleLog(view, 'layout-shifts');\n\n await coordinator.done();\n\n const inpInteractionEl = getInteractions(view).find(el => el.id === 'interaction-1-1')!;\n assert.isFalse(inpInteractionEl.checkVisibility());\n assert.isFalse(inpInteractionEl.hasFocus());\n\n const inpInteractionLink = getInpInteractionLink(view);\n inpInteractionLink!.click();\n\n await coordinator.done();\n\n assert.isTrue(inpInteractionEl.checkVisibility());\n assert.isTrue(inpInteractionEl.hasFocus());\n });\n\n it('should hide INP link if no matching interaction', async () => {\n const view = renderLiveMetrics();\n LiveMetrics.LiveMetrics.instance().setStatusForTesting({\n inp: {\n value: 500,\n phases: {\n inputDelay: 100,\n processingDuration: 300,\n presentationDelay: 100,\n },\n interactionId: 'interaction-1-1',\n },\n interactions: createInteractionsMap([\n {\n duration: 30,\n startTime: 0,\n nextPaintTime: 30,\n interactionType: 'keyboard',\n interactionId: 'interaction-1-2',\n eventNames: ['keyup'],\n phases: {inputDelay: 10, processingDuration: 10, presentationDelay: 10},\n longAnimationFrameTimings: [],\n },\n ]),\n layoutShifts: [],\n });\n await coordinator.done();\n\n const inpInteractionLink = getInpInteractionLink(view);\n assert.isNull(inpInteractionLink);\n });\n\n it('clear interactions log button should work', async () => {\n const view = renderLiveMetrics();\n await coordinator.done();\n\n assert.lengthOf(getInteractions(view), 0);\n assert.lengthOf(getLayoutShifts(view), 0);\n\n LiveMetrics.LiveMetrics.instance().setStatusForTesting({\n inp: {\n value: 50,\n phases: {\n inputDelay: 10,\n processingDuration: 30,\n presentationDelay: 10,\n },\n interactionId: 'interaction-1-2',\n },\n interactions: createInteractionsMap([\n {\n duration: 50,\n startTime: 0,\n nextPaintTime: 50,\n interactionType: 'keyboard',\n interactionId: 'interaction-1-1',\n eventNames: ['keyup'],\n phases: {inputDelay: 10, processingDuration: 30, presentationDelay: 10},\n longAnimationFrameTimings: [],\n },\n {\n duration: 500,\n startTime: 0,\n nextPaintTime: 500,\n interactionType: 'pointer',\n interactionId: 'interaction-1-2',\n eventNames: ['pointerup'],\n phases: {inputDelay: 100, processingDuration: 300, presentationDelay: 100},\n longAnimationFrameTimings: [],\n },\n ]),\n layoutShifts: [\n {score: 0.1, affectedNodeRefs: [], uniqueLayoutShiftId: 'layout-shift-1-1'},\n ],\n });\n await coordinator.done();\n\n assert.lengthOf(getInteractions(view), 2);\n assert.lengthOf(getLayoutShifts(view), 1);\n\n const clearLogButton = getClearLogButton(view);\n clearLogButton!.click();\n\n await coordinator.done();\n\n assert.lengthOf(getInteractions(view), 0);\n assert.lengthOf(getLayoutShifts(view), 1);\n });\n\n it('clear layout shifts log button should work', async () => {\n const view = renderLiveMetrics();\n await coordinator.done();\n\n assert.lengthOf(getInteractions(view), 0);\n assert.lengthOf(getLayoutShifts(view), 0);\n\n LiveMetrics.LiveMetrics.instance().setStatusForTesting({\n inp: {\n value: 50,\n phases: {\n inputDelay: 10,\n processingDuration: 30,\n presentationDelay: 10,\n },\n interactionId: 'interaction-1-2',\n },\n interactions: createInteractionsMap([\n {\n duration: 50,\n startTime: 0,\n nextPaintTime: 50,\n interactionType: 'keyboard',\n interactionId: 'interaction-1-1',\n eventNames: ['keyup'],\n phases: {inputDelay: 10, processingDuration: 30, presentationDelay: 10},\n longAnimationFrameTimings: [],\n },\n {\n duration: 500,\n startTime: 0,\n nextPaintTime: 500,\n interactionType: 'pointer',\n interactionId: 'interaction-1-2',\n eventNames: ['pointerup'],\n phases: {inputDelay: 100, processingDuration: 300, presentationDelay: 100},\n longAnimationFrameTimings: [],\n },\n ]),\n layoutShifts: [\n {score: 0.1, affectedNodeRefs: [], uniqueLayoutShiftId: 'layout-shift-1-1'},\n ],\n });\n await coordinator.done();\n\n assert.lengthOf(getInteractions(view), 2);\n assert.lengthOf(getLayoutShifts(view), 1);\n\n selectVisibleLog(view, 'layout-shifts');\n\n await coordinator.done();\n\n const clearLogButton = getClearLogButton(view);\n clearLogButton!.click();\n\n await coordinator.done();\n\n assert.lengthOf(getInteractions(view), 2);\n assert.lengthOf(getLayoutShifts(view), 0);\n });\n\n it('record action button should work', async () => {\n const view = renderLiveMetrics();\n await coordinator.done();\n\n const recordButton =\n view.shadowRoot?.querySelector('#record devtools-button') as HTMLElementTagNameMap['devtools-button'];\n recordButton.click();\n\n await coordinator.done();\n\n assert.strictEqual(mockHandleAction.firstCall.args[1], 'timeline.toggle-recording');\n });\n\n it('record page load button should work', async () => {\n const view = renderLiveMetrics();\n await coordinator.done();\n\n const recordButton =\n view.shadowRoot?.querySelector('#record-page-load devtools-button') as HTMLElementTagNameMap['devtools-button'];\n recordButton.click();\n\n await coordinator.done();\n\n assert.strictEqual(mockHandleAction.firstCall.args[1], 'timeline.record-reload');\n });\n\n it('should show minimal view for Node connections', async () => {\n const view = renderLiveMetrics();\n view.isNode = true;\n await coordinator.done();\n\n const title = view.shadowRoot?.querySelector('.section-title');\n assert.strictEqual(title!.textContent!, 'Node performance');\n });\n\n describe('field data', () => {\n let target: SDK.Target.Target;\n let mockFieldData: CrUXManager.PageResult;\n\n beforeEach(async () => {\n const tabTarget = createTarget({type: SDK.Target.Type.TAB});\n target = createTarget({parentTarget: tabTarget});\n\n mockFieldData = {\n 'origin-ALL': null,\n 'origin-DESKTOP': null,\n 'origin-PHONE': null,\n 'origin-TABLET': null,\n 'url-ALL': null,\n 'url-DESKTOP': null,\n 'url-PHONE': null,\n 'url-TABLET': null,\n warnings: [],\n };\n\n sinon.stub(CrUXManager.CrUXManager.instance(), 'getFieldDataForCurrentPage').callsFake(async () => mockFieldData);\n CrUXManager.CrUXManager.instance().getConfigSetting().set({enabled: true, override: ''});\n });\n\n it('should not show when crux is disabled', async () => {\n CrUXManager.CrUXManager.instance().getConfigSetting().set({enabled: false, override: ''});\n\n mockFieldData['url-ALL'] = createMockFieldData();\n\n const view = renderLiveMetrics();\n\n await coordinator.done();\n\n const envRecs = getEnvironmentRecs(view);\n assert.lengthOf(envRecs, 0);\n\n const fieldMessage = getFieldMessage(view);\n assert.match(fieldMessage!.innerText, /See how your local metrics compare/);\n\n const title = getLiveMetricsTitle(view);\n assert.strictEqual(title.innerText, 'Local metrics');\n });\n\n it('should show when crux is enabled', async () => {\n const view = renderLiveMetrics();\n\n await coordinator.done();\n\n mockFieldData['url-ALL'] = createMockFieldData();\n\n target.model(SDK.ResourceTreeModel.ResourceTreeModel)\n ?.dispatchEventToListeners(SDK.ResourceTreeModel.Events.FrameNavigated, {\n url: 'https://example.com',\n isPrimaryFrame: () => true,\n } as SDK.ResourceTreeModel.ResourceTreeFrame);\n\n await coordinator.done();\n\n const envRecs = getEnvironmentRecs(view);\n assert.lengthOf(envRecs, 2);\n assert.match(envRecs[0].textContent!, /60%.*desktop/);\n assert.match(envRecs[1].textContent!, /Slow 4G/);\n\n const fieldMessage = getFieldMessage(view);\n // We can't match the exact string because we format the dates based on\n // locale, so the exact format depends based on where the SWE or bots who\n // run these tests are!\n // We expect it to say something like Jan 1 - Jan 29 2024.\n assert.match(fieldMessage!.innerText, /Jan.+2024/);\n\n const title = getLiveMetricsTitle(view);\n assert.strictEqual(title.innerText, 'Local and field metrics');\n });\n\n it('should show empty values when crux is enabled but there is no field data', async () => {\n const view = renderLiveMetrics();\n\n await coordinator.done();\n\n target.model(SDK.ResourceTreeModel.ResourceTreeModel)\n ?.dispatchEventToListeners(SDK.ResourceTreeModel.Events.FrameNavigated, {\n url: 'https://example.com',\n isPrimaryFrame: () => true,\n } as SDK.ResourceTreeModel.ResourceTreeFrame);\n\n await coordinator.done();\n\n const envRecs = getEnvironmentRecs(view);\n assert.strictEqual(envRecs[0].textContent, 'Not enough data');\n assert.strictEqual(envRecs[1].textContent, 'Not enough data');\n\n const fieldMessage = getFieldMessage(view);\n assert.match(fieldMessage!.textContent!, /Not enough data/);\n\n const title = getLiveMetricsTitle(view);\n assert.strictEqual(title.innerText, 'Local and field metrics');\n });\n\n it('should display any warning from crux', async () => {\n mockFieldData.warnings.push('Warning from crux');\n\n const view = renderLiveMetrics();\n\n await coordinator.done();\n\n const fieldMessage = getFieldMessage(view);\n assert.match(fieldMessage!.textContent!, /Warning from crux/);\n });\n\n it('should make initial request on render when crux is enabled', async () => {\n mockFieldData['url-ALL'] = createMockFieldData();\n\n const view = renderLiveMetrics();\n\n await coordinator.done();\n\n const lcpFieldEl = getFieldMetricValue(view, 'lcp');\n assert.strictEqual(lcpFieldEl!.textContent, '1.00 s');\n });\n\n it('should be removed once crux is disabled', async () => {\n mockFieldData['url-ALL'] = createMockFieldData();\n\n const view = renderLiveMetrics();\n\n await coordinator.done();\n\n const lcpFieldEl1 = getFieldMetricValue(view, 'lcp');\n assert.strictEqual(lcpFieldEl1!.textContent, '1.00 s');\n\n CrUXManager.CrUXManager.instance().getConfigSetting().set({enabled: false, override: ''});\n\n await coordinator.done();\n\n const lcpFieldEl2 = getFieldMetricValue(view, 'lcp');\n assert.isNull(lcpFieldEl2);\n });\n\n it('should take from selected page scope', async () => {\n mockFieldData['url-ALL'] = createMockFieldData();\n\n mockFieldData['origin-ALL'] = createMockFieldData();\n mockFieldData['origin-ALL'].record.metrics.largest_contentful_paint!.percentiles!.p75 = 2000;\n\n const view = renderLiveMetrics();\n\n await coordinator.done();\n\n const lcpFieldEl1 = getFieldMetricValue(view, 'lcp');\n assert.strictEqual(lcpFieldEl1!.textContent, '1.00 s');\n\n selectPageScope(view, 'origin');\n\n await coordinator.done();\n\n const lcpFieldEl2 = getFieldMetricValue(view, 'lcp');\n assert.strictEqual(lcpFieldEl2!.textContent, '2.00 s');\n });\n\n it('should take from selected device scope', async () => {\n mockFieldData['url-ALL'] = createMockFieldData();\n\n mockFieldData['url-PHONE'] = createMockFieldData();\n mockFieldData['url-PHONE'].record.metrics.largest_contentful_paint!.percentiles!.p75 = 2000;\n\n const view = renderLiveMetrics();\n\n await coordinator.done();\n\n selectDeviceOption(view, 'ALL');\n\n const lcpFieldEl1 = getFieldMetricValue(view, 'lcp');\n assert.strictEqual(lcpFieldEl1!.textContent, '1.00 s');\n\n selectDeviceOption(view, 'PHONE');\n\n await coordinator.done();\n\n const lcpFieldEl2 = getFieldMetricValue(view, 'lcp');\n assert.strictEqual(lcpFieldEl2!.textContent, '2.00 s');\n });\n\n describe('network throttling recommendation', () => {\n it('should show for closest target RTT', async () => {\n mockFieldData['url-ALL'] = createMockFieldData();\n\n // 165ms is the adjusted latency of \"Fast 4G\" but 165ms is actually closer to the target RTT\n // of \"Slow 4G\" than the target RTT of \"Fast 4G\".\n // So we should expect the recommended preset to be \"Slow 4G\".\n mockFieldData['url-ALL'].record.metrics.round_trip_time!.percentiles!.p75 = 165;\n\n const view = renderLiveMetrics();\n\n await coordinator.done();\n\n const envRecs = getEnvironmentRecs(view);\n assert.lengthOf(envRecs, 2);\n assert.strictEqual(envRecs[0].textContent, '30% mobile, 60% desktop');\n assert.match(envRecs[1].textContent!, /Slow 4G/);\n\n const recNotice = view.shadowRoot!.querySelector('.environment-option devtools-network-throttling-selector')\n ?.shadowRoot!.querySelector('devtools-button');\n assert.exists(recNotice);\n });\n\n it('should hide if no RTT data', async () => {\n mockFieldData['url-ALL'] = createMockFieldData();\n mockFieldData['url-ALL'].record.metrics.round_trip_time = undefined;\n\n const view = renderLiveMetrics();\n\n await coordinator.done();\n\n const envRecs = getEnvironmentRecs(view);\n assert.strictEqual(envRecs[0].textContent, '30% mobile, 60% desktop');\n assert.strictEqual(envRecs[1].textContent, 'Not enough data');\n\n const recNotice = view.shadowRoot!.querySelector('.environment-option devtools-network-throttling-selector')\n ?.shadowRoot!.querySelector('devtools-button');\n assert.notExists(recNotice);\n });\n\n it('should suggest no throttling for very low latency', async () => {\n mockFieldData['url-ALL'] = createMockFieldData();\n\n // In theory this is closest to the \"offline\" preset latency of 0,\n // but that preset should be ignored.\n mockFieldData['url-ALL'].record.metrics.round_trip_time!.percentiles!.p75 = 1;\n\n const view = renderLiveMetrics();\n\n await coordinator.done();\n\n const envRecs = getEnvironmentRecs(view);\n assert.strictEqual(envRecs[0].textContent, '30% mobile, 60% desktop');\n assert.match(envRecs[1].textContent!, /too fast to simulate with throttling/);\n\n const recNotice = view.shadowRoot!.querySelector('.environment-option devtools-network-throttling-selector')\n ?.shadowRoot!.querySelector('devtools-button');\n assert.notExists(recNotice);\n });\n\n it('should ignore presets that are generally too far off', async () => {\n mockFieldData['url-ALL'] = createMockFieldData();\n\n // This is closest to the \"3G\" preset compared to other presets, but it's\n // still too far away in general.\n mockFieldData['url-ALL'].record.metrics.round_trip_time!.percentiles!.p75 = 10_000;\n\n const view = renderLiveMetrics();\n\n await coordinator.done();\n\n const envRecs = getEnvironmentRecs(view);\n assert.strictEqual(envRecs[0].textContent, '30% mobile, 60% desktop');\n assert.strictEqual(envRecs[1].textContent, 'Not enough data');\n\n const recNotice = view.shadowRoot!.querySelector('.environment-option devtools-network-throttling-selector')\n ?.shadowRoot!.querySelector('devtools-button');\n assert.notExists(recNotice);\n });\n });\n\n describe('form factor recommendation', () => {\n it('should recommend desktop if it is the majority', async () => {\n mockFieldData['url-ALL'] = createMockFieldData();\n\n const view = renderLiveMetrics();\n\n await coordinator.done();\n\n const envRecs = getEnvironmentRecs(view);\n assert.strictEqual(envRecs[0].textContent, '30% mobile, 60% desktop');\n assert.match(envRecs[1].textContent!, /Slow 4G/);\n });\n\n it('should recommend mobile if it is the majority', async () => {\n mockFieldData['url-ALL'] = createMockFieldData();\n\n mockFieldData['url-ALL'].record.metrics.form_factors!.fractions = {\n desktop: 0.1,\n phone: 0.8,\n tablet: 0.1,\n };\n\n const view = renderLiveMetrics();\n\n await coordinator.done();\n\n const envRecs = getEnvironmentRecs(view);\n assert.strictEqual(envRecs[0].textContent, '80% mobile, 10% desktop');\n assert.match(envRecs[1].textContent!, /Slow 4G/);\n });\n\n it('should recommend nothing if there is no majority', async () => {\n mockFieldData['url-ALL'] = createMockFieldData();\n\n mockFieldData['url-ALL'].record.metrics.form_factors!.fractions = {\n desktop: 0.49,\n phone: 0.49,\n tablet: 0.02,\n };\n\n const view = renderLiveMetrics();\n\n await coordinator.done();\n\n const envRecs = getEnvironmentRecs(view);\n assert.strictEqual(envRecs[0].textContent, '49% mobile, 49% desktop');\n assert.match(envRecs[1].textContent!, /Slow 4G/);\n });\n });\n });\n});\n"]} \ No newline at end of file +{"version":3,"file":"LiveMetricsView.test.js","sourceRoot":"","sources":["../../../../../../../front_end/panels/timeline/components/LiveMetricsView.test.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,KAAK,MAAM,MAAM,gCAAgC,CAAC;AACzD,OAAO,KAAK,GAAG,MAAM,0BAA0B,CAAC;AAChD,OAAO,KAAK,WAAW,MAAM,8CAA8C,CAAC;AAC5E,OAAO,KAAK,cAAc,MAAM,wCAAwC,CAAC;AACzE,OAAO,KAAK,WAAW,MAAM,8CAA8C,CAAC;AAC5E,OAAO,EAAC,oBAAoB,EAAC,MAAM,gCAAgC,CAAC;AACpE,OAAO,EAAC,YAAY,EAAC,MAAM,wCAAwC,CAAC;AACpE,OAAO,EAAC,0BAA0B,EAAC,MAAM,oCAAoC,CAAC;AAC9E,OAAO,KAAK,iBAAiB,MAAM,iEAAiE,CAAC;AACrG,OAAO,KAAK,EAAE,MAAM,8BAA8B,CAAC;AAEnD,OAAO,KAAK,UAAU,MAAM,iBAAiB,CAAC;AAE9C,SAAS,iBAAiB;IACxB,MAAM,IAAI,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;IAC3C,oBAAoB,CAAC,IAAI,CAAC,CAAC;IAE3B,MAAM,MAAM,GAAG,IAAI,EAAE,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC;IACtC,MAAM,CAAC,UAAU,EAAE,CAAC;IACpB,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAElB,MAAM,IAAI,GAAG,IAAI,UAAU,CAAC,eAAe,CAAC,eAAe,EAAE,CAAC;IAC9D,MAAM,CAAC,cAAc,CAAC,MAAM,CAAC,I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,SAAS,CAAC,CAAC;YACnD,CAAC,CAAC,CAAC;YAEH,EAAE,CAAC,kDAAkD,EAAE,KAAK,IAAI,EAAE;gBAChE,aAAa,CAAC,SAAS,CAAC,GAAG,mBAAmB,EAAE,CAAC;gBAEjD,aAAa,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,YAAa,CAAC,SAAS,GAAG;oBAChE,OAAO,EAAE,IAAI;oBACb,KAAK,EAAE,IAAI;oBACX,MAAM,EAAE,IAAI;iBACb,CAAC;gBAEF,MAAM,IAAI,GAAG,iBAAiB,EAAE,CAAC;gBAEjC,MAAM,iBAAiB,CAAC,IAAI,EAAE,CAAC;gBAE/B,MAAM,OAAO,GAAG,kBAAkB,CAAC,IAAI,CAAC,CAAC;gBACzC,MAAM,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,yBAAyB,CAAC,CAAC;gBACtE,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,WAAY,EAAE,SAAS,CAAC,CAAC;YACnD,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["// Copyright 2023 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport * as Common from '../../../core/common/common.js';\nimport * as SDK from '../../../core/sdk/sdk.js';\nimport * as CrUXManager from '../../../models/crux-manager/crux-manager.js';\nimport * as EmulationModel from '../../../models/emulation/emulation.js';\nimport * as LiveMetrics from '../../../models/live-metrics/live-metrics.js';\nimport {renderElementIntoDOM} from '../../../testing/DOMHelpers.js';\nimport {createTarget} from '../../../testing/EnvironmentHelpers.js';\nimport {describeWithMockConnection} from '../../../testing/MockConnection.js';\nimport * as RenderCoordinator from '../../../ui/components/render_coordinator/render_coordinator.js';\nimport * as UI from '../../../ui/legacy/legacy.js';\n\nimport * as Components from './components.js';\n\nfunction renderLiveMetrics(): Components.LiveMetricsView.LiveMetricsView {\n const root = document.createElement('div');\n renderElementIntoDOM(root);\n\n const widget = new UI.Widget.Widget();\n widget.markAsRoot();\n widget.show(root);\n\n const view = new Components.LiveMetricsView.LiveMetricsView();\n widget.contentElement.append(view);\n\n return view;\n}\n\nfunction getFieldMetricValue(view: Element, metric: string): HTMLElement|null {\n const card = view.shadowRoot!.querySelector(`#${metric} devtools-metric-card`);\n return card!.shadowRoot!.querySelector('#field-value .metric-value');\n}\n\nfunction getEnvironmentRecs(view: Element): HTMLElement[] {\n return Array.from(view.shadowRoot!.querySelectorAll('.environment-rec'));\n}\n\nfunction getInteractions(view: Element): HTMLElement[] {\n const interactionsListEl = view.shadowRoot!.querySelector('.log[slot=\"interactions-log-content\"]');\n return Array.from(interactionsListEl?.querySelectorAll('.interaction') || []) as HTMLElement[];\n}\n\nfunction getLayoutShifts(view: Element): HTMLElement[] {\n const interactionsListEl = view.shadowRoot!.querySelector('.log[slot=\"layout-shifts-log-content\"]');\n return Array.from(interactionsListEl?.querySelectorAll('.layout-shift') || []) as HTMLElement[];\n}\n\nfunction selectVisibleLog(view: Element, logId: string): void {\n view.shadowRoot!.querySelector('devtools-live-metrics-logs')!.shadowRoot!.querySelector('.tabbed-pane')!.shadowRoot!\n .getElementById(`tab-${logId}`)\n ?.dispatchEvent(\n new MouseEvent('mousedown', {bubbles: true}),\n );\n}\n\nfunction getClearLogButton(view: Element): HTMLElementTagNameMap['devtools-button'] {\n return view.shadowRoot!.querySelector('devtools-live-metrics-logs')!.shadowRoot!.querySelector('.tabbed-pane')!\n .shadowRoot!.querySelector('.toolbar')!.shadowRoot!.querySelector('devtools-button')!;\n}\n\nfunction selectDeviceOption(view: Element, deviceOption: string): void {\n const deviceScopeSelector = view.shadowRoot!.querySelector('devtools-select-menu#device-scope-select') as HTMLElement;\n const deviceScopeOptions = Array.from(deviceScopeSelector.querySelectorAll('devtools-menu-item')) as\n HTMLElementTagNameMap['devtools-menu-item'][];\n\n deviceScopeSelector.click();\n deviceScopeOptions.find(o => o.value === deviceOption)!.click();\n}\n\nfunction selectPageScope(view: Element, pageScope: string): void {\n const pageScopeSelector = view.shadowRoot!.querySelector('devtools-select-menu#page-scope-select') as HTMLElement;\n pageScopeSelector.click();\n\n const pageScopeOptions = Array.from(pageScopeSelector.querySelectorAll('devtools-menu-item')) as\n HTMLElementTagNameMap['devtools-menu-item'][];\n const originOption = pageScopeOptions.find(o => o.value === pageScope);\n originOption!.click();\n}\n\nfunction getFieldMessage(view: Element): HTMLElement|null {\n return view.shadowRoot!.querySelector('#field-setup .field-data-message');\n}\n\nfunction getLiveMetricsTitle(view: Element): HTMLElement {\n // There may be multiple, but this should always be the first one.\n return view.shadowRoot!.querySelector('.live-metrics > .section-title') as HTMLElement;\n}\n\nfunction getInpInteractionLink(view: Element): HTMLElement|null {\n return view.shadowRoot!.querySelector('#inp .related-info button');\n}\n\nfunction getClsClusterLink(view: Element): HTMLElement|null {\n return view.shadowRoot!.querySelector('#cls .related-info button');\n}\n\nfunction createMockFieldData() {\n return {\n record: {\n key: {\n // Only one of these keys will be set for a given result in reality\n // Setting both here to make testing easier.\n url: 'https://example.com/',\n origin: 'https://example.com',\n },\n metrics: {\n largest_contentful_paint: {\n histogram: [\n {start: 0, end: 2500, density: 0.5},\n {start: 2500, end: 4000, density: 0.3},\n {start: 4000, density: 0.2},\n ],\n percentiles: {p75: 1000},\n },\n cumulative_layout_shift: {\n histogram: [\n {start: 0, end: 0.1},\n {start: 0.1, end: 0.25, density: 0.2},\n {start: 0.25, density: 0.8},\n ],\n percentiles: {p75: 0.25},\n },\n round_trip_time: {\n percentiles: {p75: 150},\n },\n form_factors: {\n fractions: {\n desktop: 0.6,\n phone: 0.3,\n tablet: 0.1,\n },\n },\n },\n collectionPeriod: {\n firstDate: {year: 2024, month: 1, day: 1},\n lastDate: {year: 2024, month: 1, day: 29},\n },\n },\n };\n}\n\nfunction createInteractionsMap(interactions: LiveMetrics.Interaction[]): LiveMetrics.InteractionMap {\n return new Map(interactions.map(interaction => [interaction.interactionId, interaction]));\n}\n\ndescribeWithMockConnection('LiveMetricsView', () => {\n const mockHandleAction = sinon.stub();\n\n beforeEach(async () => {\n mockHandleAction.reset();\n\n UI.ActionRegistration.registerActionExtension({\n actionId: 'timeline.toggle-recording',\n category: UI.ActionRegistration.ActionCategory.PERFORMANCE,\n loadActionDelegate: async () => ({handleAction: mockHandleAction}),\n });\n UI.ActionRegistration.registerActionExtension({\n actionId: 'timeline.record-reload',\n category: UI.ActionRegistration.ActionCategory.PERFORMANCE,\n loadActionDelegate: async () => ({handleAction: mockHandleAction}),\n });\n\n const dummyStorage = new Common.Settings.SettingsStorage({});\n Common.Settings.Settings.instance({\n forceNew: true,\n syncedStorage: dummyStorage,\n globalStorage: dummyStorage,\n localStorage: dummyStorage,\n });\n\n const actionRegistryInstance = UI.ActionRegistry.ActionRegistry.instance({forceNew: true});\n UI.ShortcutRegistry.ShortcutRegistry.instance({forceNew: true, actionRegistry: actionRegistryInstance});\n LiveMetrics.LiveMetrics.instance({forceNew: true});\n CrUXManager.CrUXManager.instance({forceNew: true});\n EmulationModel.DeviceModeModel.DeviceModeModel.instance({forceNew: true});\n });\n\n afterEach(async () => {\n UI.ActionRegistry.ActionRegistry.reset();\n UI.ShortcutRegistry.ShortcutRegistry.removeInstance();\n\n UI.ActionRegistration.maybeRemoveActionExtension('timeline.toggle-recording');\n UI.ActionRegistration.maybeRemoveActionExtension('timeline.record-reload');\n });\n\n it('should show interactions', async () => {\n const view = renderLiveMetrics();\n LiveMetrics.LiveMetrics.instance().setStatusForTesting({\n inp: {\n value: 500,\n phases: {\n inputDelay: 100,\n processingDuration: 300,\n presentationDelay: 100,\n },\n interactionId: 'interaction-1-1',\n },\n interactions: createInteractionsMap([\n {\n duration: 500,\n startTime: 0,\n nextPaintTime: 500,\n interactionType: 'pointer',\n interactionId: 'interaction-1-1',\n eventNames: ['pointerup'],\n phases: {inputDelay: 100, processingDuration: 300, presentationDelay: 100},\n longAnimationFrameTimings: [],\n },\n {\n duration: 30,\n startTime: 0,\n nextPaintTime: 30,\n interactionType: 'keyboard',\n interactionId: 'interaction-1-2',\n eventNames: ['keyup'],\n phases: {inputDelay: 10, processingDuration: 10, presentationDelay: 10},\n longAnimationFrameTimings: [],\n },\n ]),\n layoutShifts: [],\n });\n await RenderCoordinator.done();\n\n const interactionsEls = getInteractions(view);\n assert.lengthOf(interactionsEls, 2);\n\n // Click each interaction so we can test the expandable details.\n for (const interactionEl of interactionsEls) {\n interactionEl.querySelector('summary')!.click();\n }\n\n await RenderCoordinator.done();\n\n const typeEl1 = interactionsEls[0].querySelector('.interaction-type') as HTMLDivElement;\n assert.match(typeEl1.textContent!, /pointer/);\n\n const inpChip1 = typeEl1.querySelector('.interaction-inp-chip');\n assert.isNotNull(inpChip1);\n\n const durationEl1 = interactionsEls[0].querySelector('.interaction-duration .metric-value') as HTMLDivElement;\n assert.strictEqual(durationEl1.textContent, '500 ms');\n assert.strictEqual(durationEl1.className, 'metric-value needs-improvement dim');\n\n const phases1 =\n Array.from(interactionsEls[0].querySelectorAll('.phase-table-row:not(.phase-table-header-row)'))\n .map(el => el.innerText);\n assert.deepEqual(phases1, [\n 'Input delay\\n100',\n 'Processing duration\\n300',\n 'Presentation delay\\n100',\n ]);\n\n const typeEl2 = interactionsEls[1].querySelector('.interaction-type') as HTMLDivElement;\n assert.match(typeEl2.textContent!, /keyboard/);\n\n const inpChip2 = typeEl2.querySelector('.interaction-inp-chip');\n assert.isNull(inpChip2);\n\n const durationEl2 = interactionsEls[1].querySelector('.interaction-duration .metric-value') as HTMLDivElement;\n assert.strictEqual(durationEl2.textContent, '30 ms');\n assert.strictEqual(durationEl2.className, 'metric-value good dim');\n\n const phases2 =\n Array.from(interactionsEls[1].querySelectorAll('.phase-table-row:not(.phase-table-header-row)'))\n .map(el => el.innerText);\n assert.deepEqual(phases2, [\n 'Input delay\\n10',\n 'Processing duration\\n10',\n 'Presentation delay\\n10',\n ]);\n });\n\n it('should show button to log script details to console', async () => {\n const view = renderLiveMetrics();\n LiveMetrics.LiveMetrics.instance().setStatusForTesting({\n inp: {\n value: 500,\n phases: {\n inputDelay: 100,\n processingDuration: 300,\n presentationDelay: 100,\n },\n interactionId: 'interaction-1-1',\n },\n interactions: createInteractionsMap([\n {\n duration: 500,\n startTime: 0,\n nextPaintTime: 500,\n interactionType: 'pointer',\n interactionId: 'interaction-1-1',\n eventNames: ['pointerup'],\n phases: {inputDelay: 100, processingDuration: 300, presentationDelay: 100},\n longAnimationFrameTimings: [{\n renderStart: 0,\n duration: 0,\n scripts: [],\n }],\n },\n {\n duration: 30,\n startTime: 0,\n nextPaintTime: 30,\n interactionType: 'keyboard',\n interactionId: 'interaction-1-2',\n eventNames: ['keyup'],\n phases: {inputDelay: 10, processingDuration: 10, presentationDelay: 10},\n longAnimationFrameTimings: [],\n },\n ]),\n layoutShifts: [],\n });\n await RenderCoordinator.done();\n\n const interactions = getInteractions(view);\n assert.lengthOf(interactions, 2);\n\n assert(\n interactions[0].querySelector('.log-extra-details-button'), 'First interaction should have log details button');\n assert(\n !interactions[1].querySelector('.log-extra-details-button'),\n 'Second interaction should not have log details button');\n });\n\n it('should show help icon for interaction that is longer than INP', async () => {\n const view = renderLiveMetrics();\n LiveMetrics.LiveMetrics.instance().setStatusForTesting({\n inp: {\n value: 50,\n phases: {\n inputDelay: 10,\n processingDuration: 30,\n presentationDelay: 10,\n },\n interactionId: 'interaction-1-2',\n },\n interactions: createInteractionsMap([\n {\n duration: 50,\n startTime: 0,\n nextPaintTime: 50,\n interactionType: 'keyboard',\n interactionId: 'interaction-1-1',\n eventNames: ['keyup'],\n phases: {inputDelay: 10, processingDuration: 30, presentationDelay: 10},\n longAnimationFrameTimings: [],\n },\n {\n duration: 500,\n startTime: 0,\n nextPaintTime: 500,\n interactionType: 'pointer',\n interactionId: 'interaction-1-2',\n eventNames: ['pointerup'],\n phases: {inputDelay: 100, processingDuration: 300, presentationDelay: 100},\n longAnimationFrameTimings: [],\n },\n ]),\n layoutShifts: [],\n });\n await RenderCoordinator.done();\n\n const interactionsEls = getInteractions(view);\n assert.lengthOf(interactionsEls, 2);\n\n const typeEl1 = interactionsEls[0].querySelector('.interaction-type');\n assert.match(typeEl1!.textContent!, /keyboard/);\n\n const durationEl1 = interactionsEls[0].querySelector('.interaction-duration .metric-value');\n assert.strictEqual(durationEl1!.textContent, '50 ms');\n assert.strictEqual(durationEl1!.className, 'metric-value good dim');\n\n const helpEl1 = interactionsEls[0].querySelector('.interaction-info');\n assert.isNull(helpEl1);\n\n const typeEl2 = interactionsEls[1].querySelector('.interaction-type');\n assert.match(typeEl2!.textContent!, /pointer/);\n\n const helpEl2 = interactionsEls[1].querySelector('.interaction-info');\n assert.match(helpEl2!.title, /98th percentile/);\n\n const durationEl2 = interactionsEls[1].querySelector('.interaction-duration .metric-value');\n assert.strictEqual(durationEl2!.textContent, '500 ms');\n assert.strictEqual(durationEl2!.className, 'metric-value needs-improvement dim');\n });\n\n it('should reveal CLS cluster when link clicked', async () => {\n const view = renderLiveMetrics();\n LiveMetrics.LiveMetrics.instance().setStatusForTesting({\n cls: {\n value: 0.11,\n clusterShiftIds: ['layout-shift-1-2', 'layout-shift-1-3'],\n },\n interactions: new Map(),\n layoutShifts: [\n {score: 0.05, affectedNodeRefs: [], uniqueLayoutShiftId: 'layout-shift-1-1'},\n {score: 0.1, affectedNodeRefs: [], uniqueLayoutShiftId: 'layout-shift-1-2'},\n {score: 0.01, affectedNodeRefs: [], uniqueLayoutShiftId: 'layout-shift-1-3'},\n ],\n });\n await RenderCoordinator.done();\n\n selectVisibleLog(view, 'interactions');\n\n await RenderCoordinator.done();\n\n const firstClusterShift = getLayoutShifts(view).find(el => el.id === 'layout-shift-1-2')!;\n assert.isFalse(firstClusterShift.checkVisibility());\n assert.isFalse(firstClusterShift.hasFocus());\n\n getClsClusterLink(view)!.click();\n\n await RenderCoordinator.done();\n\n assert.isTrue(firstClusterShift.checkVisibility());\n assert.isTrue(firstClusterShift.hasFocus());\n });\n\n it('should hide CLS cluster link if there is no defined cluster', async () => {\n const view = renderLiveMetrics();\n LiveMetrics.LiveMetrics.instance().setStatusForTesting({\n cls: {\n value: 0.11,\n clusterShiftIds: [],\n },\n interactions: new Map(),\n layoutShifts: [\n {score: 0.05, affectedNodeRefs: [], uniqueLayoutShiftId: 'layout-shift-1-1'},\n {score: 0.1, affectedNodeRefs: [], uniqueLayoutShiftId: 'layout-shift-1-2'},\n {score: 0.01, affectedNodeRefs: [], uniqueLayoutShiftId: 'layout-shift-1-3'},\n ],\n });\n await RenderCoordinator.done();\n\n assert.isNull(getClsClusterLink(view));\n });\n\n it('should hide CLS cluster link if there are no matching shifts', async () => {\n const view = renderLiveMetrics();\n LiveMetrics.LiveMetrics.instance().setStatusForTesting({\n cls: {\n value: 0.11,\n clusterShiftIds: ['layout-shift-2-0'],\n },\n interactions: new Map(),\n layoutShifts: [\n {score: 0.05, affectedNodeRefs: [], uniqueLayoutShiftId: 'layout-shift-1-1'},\n {score: 0.1, affectedNodeRefs: [], uniqueLayoutShiftId: 'layout-shift-1-2'},\n {score: 0.01, affectedNodeRefs: [], uniqueLayoutShiftId: 'layout-shift-1-3'},\n ],\n });\n await RenderCoordinator.done();\n\n assert.isNull(getClsClusterLink(view));\n });\n\n it('should reveal INP interaction when link clicked', async () => {\n const view = renderLiveMetrics();\n LiveMetrics.LiveMetrics.instance().setStatusForTesting({\n inp: {\n value: 500,\n phases: {\n inputDelay: 100,\n processingDuration: 300,\n presentationDelay: 100,\n },\n interactionId: 'interaction-1-1',\n },\n interactions: createInteractionsMap([\n {\n duration: 500,\n startTime: 0,\n nextPaintTime: 500,\n interactionType: 'pointer',\n interactionId: 'interaction-1-1',\n eventNames: ['pointerup'],\n phases: {inputDelay: 100, processingDuration: 300, presentationDelay: 100},\n longAnimationFrameTimings: [],\n },\n {\n duration: 30,\n startTime: 0,\n nextPaintTime: 30,\n interactionType: 'keyboard',\n interactionId: 'interaction-1-2',\n eventNames: ['keyup'],\n phases: {inputDelay: 10, processingDuration: 10, presentationDelay: 10},\n longAnimationFrameTimings: [],\n },\n ]),\n layoutShifts: [],\n });\n await RenderCoordinator.done();\n\n selectVisibleLog(view, 'layout-shifts');\n\n await RenderCoordinator.done();\n\n const inpInteractionEl = getInteractions(view).find(el => el.id === 'interaction-1-1')!;\n assert.isFalse(inpInteractionEl.checkVisibility());\n assert.isFalse(inpInteractionEl.hasFocus());\n\n const inpInteractionLink = getInpInteractionLink(view);\n inpInteractionLink!.click();\n\n await RenderCoordinator.done();\n\n assert.isTrue(inpInteractionEl.checkVisibility());\n assert.isTrue(inpInteractionEl.hasFocus());\n });\n\n it('should hide INP link if no matching interaction', async () => {\n const view = renderLiveMetrics();\n LiveMetrics.LiveMetrics.instance().setStatusForTesting({\n inp: {\n value: 500,\n phases: {\n inputDelay: 100,\n processingDuration: 300,\n presentationDelay: 100,\n },\n interactionId: 'interaction-1-1',\n },\n interactions: createInteractionsMap([\n {\n duration: 30,\n startTime: 0,\n nextPaintTime: 30,\n interactionType: 'keyboard',\n interactionId: 'interaction-1-2',\n eventNames: ['keyup'],\n phases: {inputDelay: 10, processingDuration: 10, presentationDelay: 10},\n longAnimationFrameTimings: [],\n },\n ]),\n layoutShifts: [],\n });\n await RenderCoordinator.done();\n\n const inpInteractionLink = getInpInteractionLink(view);\n assert.isNull(inpInteractionLink);\n });\n\n it('clear interactions log button should work', async () => {\n const view = renderLiveMetrics();\n await RenderCoordinator.done();\n\n assert.lengthOf(getInteractions(view), 0);\n assert.lengthOf(getLayoutShifts(view), 0);\n\n LiveMetrics.LiveMetrics.instance().setStatusForTesting({\n inp: {\n value: 50,\n phases: {\n inputDelay: 10,\n processingDuration: 30,\n presentationDelay: 10,\n },\n interactionId: 'interaction-1-2',\n },\n interactions: createInteractionsMap([\n {\n duration: 50,\n startTime: 0,\n nextPaintTime: 50,\n interactionType: 'keyboard',\n interactionId: 'interaction-1-1',\n eventNames: ['keyup'],\n phases: {inputDelay: 10, processingDuration: 30, presentationDelay: 10},\n longAnimationFrameTimings: [],\n },\n {\n duration: 500,\n startTime: 0,\n nextPaintTime: 500,\n interactionType: 'pointer',\n interactionId: 'interaction-1-2',\n eventNames: ['pointerup'],\n phases: {inputDelay: 100, processingDuration: 300, presentationDelay: 100},\n longAnimationFrameTimings: [],\n },\n ]),\n layoutShifts: [\n {score: 0.1, affectedNodeRefs: [], uniqueLayoutShiftId: 'layout-shift-1-1'},\n ],\n });\n await RenderCoordinator.done();\n\n assert.lengthOf(getInteractions(view), 2);\n assert.lengthOf(getLayoutShifts(view), 1);\n\n const clearLogButton = getClearLogButton(view);\n clearLogButton!.click();\n\n await RenderCoordinator.done();\n\n assert.lengthOf(getInteractions(view), 0);\n assert.lengthOf(getLayoutShifts(view), 1);\n });\n\n it('clear layout shifts log button should work', async () => {\n const view = renderLiveMetrics();\n await RenderCoordinator.done();\n\n assert.lengthOf(getInteractions(view), 0);\n assert.lengthOf(getLayoutShifts(view), 0);\n\n LiveMetrics.LiveMetrics.instance().setStatusForTesting({\n inp: {\n value: 50,\n phases: {\n inputDelay: 10,\n processingDuration: 30,\n presentationDelay: 10,\n },\n interactionId: 'interaction-1-2',\n },\n interactions: createInteractionsMap([\n {\n duration: 50,\n startTime: 0,\n nextPaintTime: 50,\n interactionType: 'keyboard',\n interactionId: 'interaction-1-1',\n eventNames: ['keyup'],\n phases: {inputDelay: 10, processingDuration: 30, presentationDelay: 10},\n longAnimationFrameTimings: [],\n },\n {\n duration: 500,\n startTime: 0,\n nextPaintTime: 500,\n interactionType: 'pointer',\n interactionId: 'interaction-1-2',\n eventNames: ['pointerup'],\n phases: {inputDelay: 100, processingDuration: 300, presentationDelay: 100},\n longAnimationFrameTimings: [],\n },\n ]),\n layoutShifts: [\n {score: 0.1, affectedNodeRefs: [], uniqueLayoutShiftId: 'layout-shift-1-1'},\n ],\n });\n await RenderCoordinator.done();\n\n assert.lengthOf(getInteractions(view), 2);\n assert.lengthOf(getLayoutShifts(view), 1);\n\n selectVisibleLog(view, 'layout-shifts');\n\n await RenderCoordinator.done();\n\n const clearLogButton = getClearLogButton(view);\n clearLogButton!.click();\n\n await RenderCoordinator.done();\n\n assert.lengthOf(getInteractions(view), 2);\n assert.lengthOf(getLayoutShifts(view), 0);\n });\n\n it('record action button should work', async () => {\n const view = renderLiveMetrics();\n await RenderCoordinator.done();\n\n const recordButton =\n view.shadowRoot?.querySelector('#record devtools-button') as HTMLElementTagNameMap['devtools-button'];\n recordButton.click();\n\n await RenderCoordinator.done();\n\n assert.strictEqual(mockHandleAction.firstCall.args[1], 'timeline.toggle-recording');\n });\n\n it('record page load button should work', async () => {\n const view = renderLiveMetrics();\n await RenderCoordinator.done();\n\n const recordButton =\n view.shadowRoot?.querySelector('#record-page-load devtools-button') as HTMLElementTagNameMap['devtools-button'];\n recordButton.click();\n\n await RenderCoordinator.done();\n\n assert.strictEqual(mockHandleAction.firstCall.args[1], 'timeline.record-reload');\n });\n\n it('should show minimal view for Node connections', async () => {\n const view = renderLiveMetrics();\n view.isNode = true;\n await RenderCoordinator.done();\n\n const title = view.shadowRoot?.querySelector('.section-title');\n assert.strictEqual(title!.textContent!, 'Node performance');\n });\n\n describe('field data', () => {\n let target: SDK.Target.Target;\n let mockFieldData: CrUXManager.PageResult;\n\n beforeEach(async () => {\n const tabTarget = createTarget({type: SDK.Target.Type.TAB});\n target = createTarget({parentTarget: tabTarget});\n\n mockFieldData = {\n 'origin-ALL': null,\n 'origin-DESKTOP': null,\n 'origin-PHONE': null,\n 'origin-TABLET': null,\n 'url-ALL': null,\n 'url-DESKTOP': null,\n 'url-PHONE': null,\n 'url-TABLET': null,\n warnings: [],\n };\n\n sinon.stub(CrUXManager.CrUXManager.instance(), 'getFieldDataForCurrentPage').callsFake(async () => mockFieldData);\n CrUXManager.CrUXManager.instance().getConfigSetting().set({enabled: true, override: ''});\n });\n\n it('should not show when crux is disabled', async () => {\n CrUXManager.CrUXManager.instance().getConfigSetting().set({enabled: false, override: ''});\n\n mockFieldData['url-ALL'] = createMockFieldData();\n\n const view = renderLiveMetrics();\n\n await RenderCoordinator.done();\n\n const envRecs = getEnvironmentRecs(view);\n assert.lengthOf(envRecs, 0);\n\n const fieldMessage = getFieldMessage(view);\n assert.match(fieldMessage!.innerText, /See how your local metrics compare/);\n\n const title = getLiveMetricsTitle(view);\n assert.strictEqual(title.innerText, 'Local metrics');\n });\n\n it('should show when crux is enabled', async () => {\n const view = renderLiveMetrics();\n\n await RenderCoordinator.done();\n\n mockFieldData['url-ALL'] = createMockFieldData();\n\n target.model(SDK.ResourceTreeModel.ResourceTreeModel)\n ?.dispatchEventToListeners(SDK.ResourceTreeModel.Events.FrameNavigated, {\n url: 'https://example.com',\n isPrimaryFrame: () => true,\n } as SDK.ResourceTreeModel.ResourceTreeFrame);\n\n await RenderCoordinator.done();\n\n const envRecs = getEnvironmentRecs(view);\n assert.lengthOf(envRecs, 2);\n assert.match(envRecs[0].textContent!, /60%.*desktop/);\n assert.match(envRecs[1].textContent!, /Slow 4G/);\n\n const fieldMessage = getFieldMessage(view);\n // We can't match the exact string because we format the dates based on\n // locale, so the exact format depends based on where the SWE or bots who\n // run these tests are!\n // We expect it to say something like Jan 1 - Jan 29 2024.\n assert.match(fieldMessage!.innerText, /Jan.+2024/);\n\n const title = getLiveMetricsTitle(view);\n assert.strictEqual(title.innerText, 'Local and field metrics');\n });\n\n it('should show empty values when crux is enabled but there is no field data', async () => {\n const view = renderLiveMetrics();\n\n await RenderCoordinator.done();\n\n target.model(SDK.ResourceTreeModel.ResourceTreeModel)\n ?.dispatchEventToListeners(SDK.ResourceTreeModel.Events.FrameNavigated, {\n url: 'https://example.com',\n isPrimaryFrame: () => true,\n } as SDK.ResourceTreeModel.ResourceTreeFrame);\n\n await RenderCoordinator.done();\n\n const envRecs = getEnvironmentRecs(view);\n assert.strictEqual(envRecs[0].textContent, 'Not enough data');\n assert.strictEqual(envRecs[1].textContent, 'Not enough data');\n\n const fieldMessage = getFieldMessage(view);\n assert.match(fieldMessage!.textContent!, /Not enough data/);\n\n const title = getLiveMetricsTitle(view);\n assert.strictEqual(title.innerText, 'Local and field metrics');\n });\n\n it('should display any warning from crux', async () => {\n mockFieldData.warnings.push('Warning from crux');\n\n const view = renderLiveMetrics();\n\n await RenderCoordinator.done();\n\n const fieldMessage = getFieldMessage(view);\n assert.match(fieldMessage!.textContent!, /Warning from crux/);\n });\n\n it('should make initial request on render when crux is enabled', async () => {\n mockFieldData['url-ALL'] = createMockFieldData();\n\n const view = renderLiveMetrics();\n\n await RenderCoordinator.done();\n\n const lcpFieldEl = getFieldMetricValue(view, 'lcp');\n assert.strictEqual(lcpFieldEl!.textContent, '1.00 s');\n });\n\n it('should be removed once crux is disabled', async () => {\n mockFieldData['url-ALL'] = createMockFieldData();\n\n const view = renderLiveMetrics();\n\n await RenderCoordinator.done();\n\n const lcpFieldEl1 = getFieldMetricValue(view, 'lcp');\n assert.strictEqual(lcpFieldEl1!.textContent, '1.00 s');\n\n CrUXManager.CrUXManager.instance().getConfigSetting().set({enabled: false, override: ''});\n\n await RenderCoordinator.done();\n\n const lcpFieldEl2 = getFieldMetricValue(view, 'lcp');\n assert.isNull(lcpFieldEl2);\n });\n\n it('should take from selected page scope', async () => {\n mockFieldData['url-ALL'] = createMockFieldData();\n\n mockFieldData['origin-ALL'] = createMockFieldData();\n mockFieldData['origin-ALL'].record.metrics.largest_contentful_paint!.percentiles!.p75 = 2000;\n\n const view = renderLiveMetrics();\n\n await RenderCoordinator.done();\n\n const lcpFieldEl1 = getFieldMetricValue(view, 'lcp');\n assert.strictEqual(lcpFieldEl1!.textContent, '1.00 s');\n\n selectPageScope(view, 'origin');\n\n await RenderCoordinator.done();\n\n const lcpFieldEl2 = getFieldMetricValue(view, 'lcp');\n assert.strictEqual(lcpFieldEl2!.textContent, '2.00 s');\n });\n\n it('should take from selected device scope', async () => {\n mockFieldData['url-ALL'] = createMockFieldData();\n\n mockFieldData['url-PHONE'] = createMockFieldData();\n mockFieldData['url-PHONE'].record.metrics.largest_contentful_paint!.percentiles!.p75 = 2000;\n\n const view = renderLiveMetrics();\n\n await RenderCoordinator.done();\n\n selectDeviceOption(view, 'ALL');\n\n const lcpFieldEl1 = getFieldMetricValue(view, 'lcp');\n assert.strictEqual(lcpFieldEl1!.textContent, '1.00 s');\n\n selectDeviceOption(view, 'PHONE');\n\n await RenderCoordinator.done();\n\n const lcpFieldEl2 = getFieldMetricValue(view, 'lcp');\n assert.strictEqual(lcpFieldEl2!.textContent, '2.00 s');\n });\n\n describe('network throttling recommendation', () => {\n it('should show for closest target RTT', async () => {\n mockFieldData['url-ALL'] = createMockFieldData();\n\n // 165ms is the adjusted latency of \"Fast 4G\" but 165ms is actually closer to the target RTT\n // of \"Slow 4G\" than the target RTT of \"Fast 4G\".\n // So we should expect the recommended preset to be \"Slow 4G\".\n mockFieldData['url-ALL'].record.metrics.round_trip_time!.percentiles!.p75 = 165;\n\n const view = renderLiveMetrics();\n\n await RenderCoordinator.done();\n\n const envRecs = getEnvironmentRecs(view);\n assert.lengthOf(envRecs, 2);\n assert.strictEqual(envRecs[0].textContent, '30% mobile, 60% desktop');\n assert.match(envRecs[1].textContent!, /Slow 4G/);\n\n const recNotice = view.shadowRoot!.querySelector('.environment-option devtools-network-throttling-selector')\n ?.shadowRoot!.querySelector('devtools-button');\n assert.exists(recNotice);\n });\n\n it('should hide if no RTT data', async () => {\n mockFieldData['url-ALL'] = createMockFieldData();\n mockFieldData['url-ALL'].record.metrics.round_trip_time = undefined;\n\n const view = renderLiveMetrics();\n\n await RenderCoordinator.done();\n\n const envRecs = getEnvironmentRecs(view);\n assert.strictEqual(envRecs[0].textContent, '30% mobile, 60% desktop');\n assert.strictEqual(envRecs[1].textContent, 'Not enough data');\n\n const recNotice = view.shadowRoot!.querySelector('.environment-option devtools-network-throttling-selector')\n ?.shadowRoot!.querySelector('devtools-button');\n assert.notExists(recNotice);\n });\n\n it('should suggest no throttling for very low latency', async () => {\n mockFieldData['url-ALL'] = createMockFieldData();\n\n // In theory this is closest to the \"offline\" preset latency of 0,\n // but that preset should be ignored.\n mockFieldData['url-ALL'].record.metrics.round_trip_time!.percentiles!.p75 = 1;\n\n const view = renderLiveMetrics();\n\n await RenderCoordinator.done();\n\n const envRecs = getEnvironmentRecs(view);\n assert.strictEqual(envRecs[0].textContent, '30% mobile, 60% desktop');\n assert.match(envRecs[1].textContent!, /too fast to simulate with throttling/);\n\n const recNotice = view.shadowRoot!.querySelector('.environment-option devtools-network-throttling-selector')\n ?.shadowRoot!.querySelector('devtools-button');\n assert.notExists(recNotice);\n });\n\n it('should ignore presets that are generally too far off', async () => {\n mockFieldData['url-ALL'] = createMockFieldData();\n\n // This is closest to the \"3G\" preset compared to other presets, but it's\n // still too far away in general.\n mockFieldData['url-ALL'].record.metrics.round_trip_time!.percentiles!.p75 = 10_000;\n\n const view = renderLiveMetrics();\n\n await RenderCoordinator.done();\n\n const envRecs = getEnvironmentRecs(view);\n assert.strictEqual(envRecs[0].textContent, '30% mobile, 60% desktop');\n assert.strictEqual(envRecs[1].textContent, 'Not enough data');\n\n const recNotice = view.shadowRoot!.querySelector('.environment-option devtools-network-throttling-selector')\n ?.shadowRoot!.querySelector('devtools-button');\n assert.notExists(recNotice);\n });\n });\n\n describe('form factor recommendation', () => {\n it('should recommend desktop if it is the majority', async () => {\n mockFieldData['url-ALL'] = createMockFieldData();\n\n const view = renderLiveMetrics();\n\n await RenderCoordinator.done();\n\n const envRecs = getEnvironmentRecs(view);\n assert.strictEqual(envRecs[0].textContent, '30% mobile, 60% desktop');\n assert.match(envRecs[1].textContent!, /Slow 4G/);\n });\n\n it('should recommend mobile if it is the majority', async () => {\n mockFieldData['url-ALL'] = createMockFieldData();\n\n mockFieldData['url-ALL'].record.metrics.form_factors!.fractions = {\n desktop: 0.1,\n phone: 0.8,\n tablet: 0.1,\n };\n\n const view = renderLiveMetrics();\n\n await RenderCoordinator.done();\n\n const envRecs = getEnvironmentRecs(view);\n assert.strictEqual(envRecs[0].textContent, '80% mobile, 10% desktop');\n assert.match(envRecs[1].textContent!, /Slow 4G/);\n });\n\n it('should recommend nothing if there is no majority', async () => {\n mockFieldData['url-ALL'] = createMockFieldData();\n\n mockFieldData['url-ALL'].record.metrics.form_factors!.fractions = {\n desktop: 0.49,\n phone: 0.49,\n tablet: 0.02,\n };\n\n const view = renderLiveMetrics();\n\n await RenderCoordinator.done();\n\n const envRecs = getEnvironmentRecs(view);\n assert.strictEqual(envRecs[0].textContent, '49% mobile, 49% desktop');\n assert.match(envRecs[1].textContent!, /Slow 4G/);\n });\n });\n });\n});\n"]} \ No newline at end of file diff --git a/public/panels/timeline/components/MetricCard.test.js b/public/panels/timeline/components/MetricCard.test.js index 753816757..1e272376a 100644 --- a/public/panels/timeline/components/MetricCard.test.js +++ b/public/panels/timeline/components/MetricCard.test.js @@ -5,9 +5,8 @@ import * as Common from '../../../core/common/common.js'; import * as CrUXManager from '../../../models/crux-manager/crux-manager.js'; import { renderElementIntoDOM } from '../../../testing/DOMHelpers.js'; import { describeWithMockConnection } from '../../../testing/MockConnection.js'; -import * as Coordinator from '../../../ui/components/render_coordinator/render_coordinator.js'; +import * as RenderCoordinator from '../../../ui/components/render_coordinator/render_coordinator.js'; import * as Components from './components.js'; -const coordinator = Coordinator.RenderCoordinator.RenderCoordinator.instance(); function getLocalMetricValue(view) { return view.shadowRoot.querySelector('#local-value .metric-value'); } @@ -75,7 +74,7 @@ describeWithMockConnection('MetricCard', () => { histogram: createMockHistogram(), }; renderElementIntoDOM(view); - await coordinator.done(); + await RenderCoordinator.done(); const localValueEl = getLocalMetricValue(view); assert.strictEqual(localValueEl.className, 'metric-value good'); assert.strictEqual(localValueEl.innerText, '0.10 s'); @@ -96,7 +95,7 @@ describeWithMockConnection('MetricCard', () => { histogram: createMockHistogram(), }; renderElementIntoDOM(view); - await coordinator.done(); + await RenderCoordinator.done(); const localValueEl = getLocalMetricValue(view); assert.strictEqual(localValueEl.className, 'metric-value needs-improvement'); assert.strictEqual(localValueEl.innerText, '0.14'); @@ -117,7 +116,7 @@ describeWithMockConnection('MetricCard', () => { histogram: createMockHistogram(), }; renderElementIntoDOM(view); - await coordinator.done(); + await RenderCoordinator.done(); const localValueEl = getLocalMetricValue(view); assert.strictEqual(localValueEl.className, 'metric-value poor'); assert.strictEqual(localValueEl.innerText, '2,000 ms'); @@ -132,7 +131,7 @@ describeWithMockConnection('MetricCard', () => { it('should show empty metric', async () => { const view = new Components.MetricCard.MetricCard(); renderElementIntoDOM(view); - await coordinator.done(); + await RenderCoordinator.done(); const metricValueEl = getLocalMetricValue(view); assert.strictEqual(metricValueEl.className.trim(), 'metric-value waiting'); assert.strictEqual(metricValueEl.innerText, '-'); @@ -154,7 +153,7 @@ describeWithMockConnection('MetricCard', () => { warnings: ['LCP warning'], }; renderElementIntoDOM(view); - await coordinator.done(); + await RenderCoordinator.done(); const warnings = getWarnings(view); assert.deepEqual(warnings, [ 'LCP warning', @@ -170,7 +169,7 @@ describeWithMockConnection('MetricCard', () => { histogram: createMockHistogram(), }; renderElementIntoDOM(view); - await coordinator.done(); + await RenderCoordinator.done(); const phaseTable = getPhaseTable(view); assert.isNull(phaseTable); }); @@ -188,7 +187,7 @@ describeWithMockConnection('MetricCard', () => { ], }; renderElementIntoDOM(view); - await coordinator.done(); + await RenderCoordinator.done(); const phaseTable = getPhaseTable(view); assert.deepEqual(phaseTable, [ ['TTFB', '500'], @@ -208,7 +207,7 @@ describeWithMockConnection('MetricCard', () => { histogram: createMockHistogram(), }; renderElementIntoDOM(view); - await coordinator.done(); + await RenderCoordinator.done(); const histogramLabels = getFieldHistogramLabels(view); assert.match(histogramLabels[0], /Good\s+\(≤2.50 s\)/); assert.match(histogramLabels[1], /Needs improvement\s+\(2.50 s-4.00 s\)/); @@ -227,7 +226,7 @@ describeWithMockConnection('MetricCard', () => { histogram: createMockHistogram(), }; renderElementIntoDOM(view); - await coordinator.done(); + await RenderCoordinator.done(); const histogramLabels = getFieldHistogramLabels(view); assert.match(histogramLabels[0], /Good\s+\(≤2.50 s\)/); assert.match(histogramLabels[1], /Needs improvement\s+\(2.50 s-4.00 s\)/); @@ -244,7 +243,7 @@ describeWithMockConnection('MetricCard', () => { localValue: 100, }; renderElementIntoDOM(view); - await coordinator.done(); + await RenderCoordinator.done(); const histogramLabels = getFieldHistogramLabels(view); assert.match(histogramLabels[0], /Good\s+\(≤2.50 s\)/); assert.match(histogramLabels[1], /Needs improvement\s+\(2.50 s-4.00 s\)/); @@ -265,7 +264,7 @@ describeWithMockConnection('MetricCard', () => { histogram: createMockHistogram(), }; renderElementIntoDOM(view); - await coordinator.done(); + await RenderCoordinator.done(); const compareText = getCompareText(view); assert.strictEqual(compareText.innerText, 'Your local LCP value of 0.10 s is good, and is similar to your users’ experience.'); }); @@ -278,7 +277,7 @@ describeWithMockConnection('MetricCard', () => { histogram: createMockHistogram(), }; renderElementIntoDOM(view); - await coordinator.done(); + await RenderCoordinator.done(); const compareText = getCompareText(view); assert.strictEqual(compareText.innerText, 'Your local LCP value of 0.10 s is good, but is significantly better than your users’ experience.'); }); @@ -291,7 +290,7 @@ describeWithMockConnection('MetricCard', () => { histogram: createMockHistogram(), }; renderElementIntoDOM(view); - await coordinator.done(); + await RenderCoordinator.done(); const compareText = getCompareText(view); assert.strictEqual(compareText.innerText, 'Your local LCP value of 5.00 s is poor, but is significantly worse than your users’ experience.'); }); @@ -304,7 +303,7 @@ describeWithMockConnection('MetricCard', () => { histogram: createMockHistogram(), }; renderElementIntoDOM(view); - await coordinator.done(); + await RenderCoordinator.done(); const compareText = getCompareText(view); assert.strictEqual(compareText.innerText, 'Your local LCP value of 0.01 s is good, and is similar to your users’ experience.'); }); @@ -315,7 +314,7 @@ describeWithMockConnection('MetricCard', () => { localValue: 3000, }; renderElementIntoDOM(view); - await coordinator.done(); + await RenderCoordinator.done(); const compareText = getCompareText(view); assert.strictEqual(compareText.innerText, 'Your local LCP value of 3.00 s needs improvement.'); }); @@ -325,7 +324,7 @@ describeWithMockConnection('MetricCard', () => { metric: 'INP', }; renderElementIntoDOM(view); - await coordinator.done(); + await RenderCoordinator.done(); const compareText = getCompareText(view); assert.strictEqual(compareText.innerText, 'Interact with the page to measure INP.'); }); @@ -340,7 +339,7 @@ describeWithMockConnection('MetricCard', () => { histogram: createMockHistogram(), }; renderElementIntoDOM(view); - await coordinator.done(); + await RenderCoordinator.done(); const compareText = getDetailedCompareText(view); assert.strictEqual(compareText.textContent, 'Your local LCP value of 0.10 s is good and is rated the same as 50% of real-user LCP experiences. Additionally, the field data 75th percentile LCP value of 1.00 s is good.'); }); @@ -353,7 +352,7 @@ describeWithMockConnection('MetricCard', () => { histogram: createMockHistogram(), }; renderElementIntoDOM(view); - await coordinator.done(); + await RenderCoordinator.done(); const compareText = getDetailedCompareText(view); assert.strictEqual(compareText.textContent, 'Your local LCP value of 0.10 s is good and is rated the same as 50% of real-user LCP experiences. However, the field data 75th percentile LCP value of 5.00 s is poor.'); }); @@ -364,7 +363,7 @@ describeWithMockConnection('MetricCard', () => { localValue: 3000, }; renderElementIntoDOM(view); - await coordinator.done(); + await RenderCoordinator.done(); const compareText = getDetailedCompareText(view); assert.strictEqual(compareText.textContent, 'Your local LCP value of 3.00 s needs improvement.'); }); @@ -374,7 +373,7 @@ describeWithMockConnection('MetricCard', () => { metric: 'INP', }; renderElementIntoDOM(view); - await coordinator.done(); + await RenderCoordinator.done(); const compareText = getDetailedCompareText(view); assert.strictEqual(compareText.textContent, 'Interact with the page to measure INP.'); }); @@ -387,7 +386,7 @@ describeWithMockConnection('MetricCard', () => { localValue: 5000, }; renderElementIntoDOM(view); - await coordinator.done(); + await RenderCoordinator.done(); const recs = getEnvironmentRecs(view); assert.lengthOf(recs, 0); }); @@ -400,7 +399,7 @@ describeWithMockConnection('MetricCard', () => { histogram: createMockHistogram(), }; renderElementIntoDOM(view); - await coordinator.done(); + await RenderCoordinator.done(); const recs = getEnvironmentRecs(view); assert.lengthOf(recs, 0); }); @@ -413,7 +412,7 @@ describeWithMockConnection('MetricCard', () => { histogram: createMockHistogram(), }; renderElementIntoDOM(view); - await coordinator.done(); + await RenderCoordinator.done(); const recs = getEnvironmentRecs(view); assert.deepEqual(recs, [ 'Real users may experience longer page loads due to slower network conditions. Increasing network throttling will simulate slower network conditions.', @@ -430,7 +429,7 @@ describeWithMockConnection('MetricCard', () => { histogram: createMockHistogram(), }; renderElementIntoDOM(view); - await coordinator.done(); + await RenderCoordinator.done(); const recs = getEnvironmentRecs(view); assert.deepEqual(recs, [ 'Screen size can influence what the LCP element is. Ensure you are testing common viewport sizes.', @@ -446,7 +445,7 @@ describeWithMockConnection('MetricCard', () => { histogram: createMockHistogram(), }; renderElementIntoDOM(view); - await coordinator.done(); + await RenderCoordinator.done(); const recs = getEnvironmentRecs(view); assert.deepEqual(recs, [ 'Screen size can influence what layout shifts happen. Ensure you are testing common viewport sizes.', @@ -463,7 +462,7 @@ describeWithMockConnection('MetricCard', () => { histogram: createMockHistogram(), }; renderElementIntoDOM(view); - await coordinator.done(); + await RenderCoordinator.done(); const recs = getEnvironmentRecs(view); assert.deepEqual(recs, [ 'Real users may experience longer interactions due to slower CPU speeds. Increasing CPU throttling will simulate a slower device.', @@ -479,7 +478,7 @@ describeWithMockConnection('MetricCard', () => { histogram: createMockHistogram(), }; renderElementIntoDOM(view); - await coordinator.done(); + await RenderCoordinator.done(); const recs = getEnvironmentRecs(view); assert.deepEqual(recs, [ 'How a user interacts with the page influences interaction delays. Ensure you are testing common interactions.', diff --git a/public/panels/timeline/components/MetricCard.test.js.map b/public/panels/timeline/components/MetricCard.test.js.map index 040f261a1..e5abcbb96 100644 --- a/public/panels/timeline/components/MetricCard.test.js.map +++ b/public/panels/timeline/components/MetricCard.test.js.map @@ -1 +1 @@ -{"version":3,"file":"MetricCard.test.js","sourceRoot":"","sources":["../../../../../../../front_end/panels/timeline/components/MetricCard.test.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,KAAK,MAAM,MAAM,gCAAgC,CAAC;AACzD,OAAO,KAAK,WAAW,MAAM,8CAA8C,CAAC;AAC5E,OAAO,EAAC,oBAAoB,EAAC,MAAM,gCAAgC,CAAC;AACpE,OAAO,EAAC,0BAA0B,EAAC,MAAM,oCAAoC,CAAC;AAC9E,OAAO,KAAK,WAAW,MAAM,iEAAiE,CAAC;AAE/F,OAAO,KAAK,UAAU,MAAM,iBAAiB,CAAC;AAE9C,MAAM,WAAW,GAAG,WAAW,CAAC,iBAAiB,CAAC,iBAAiB,CAAC,QAAQ,EAAE,CAAC;AAE/E,SAAS,mBAAmB,CAAC,IAAa;IACxC,OAAO,IAAI,CAAC,UAAW,CAAC,aAAa,CAAC,4BAA4B,CAAgB,CAAC;AACrF,CAAC;AAED,SAAS,mBAAmB,CAAC,IAAa;IACxC,OAAO,IAAI,CAAC,UAAW,CAAC,aAAa,CAAC,4BAA4B,CAAC,CAAC;AACtE,CAAC;AAED,SAAS,yBAAyB,CAAC,IAAa;IAC9C,MAAM,SAAS,GAAG,IAAI,CAAC,UAAW,CAAC,aAAa,CAAC,mBAAmB,CAAgB,CAAC;IACrF,MAAM,QAAQ,GAAG,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,gBAAgB,CAAC,oBAAoB,CAAC,CAAkB,CAAC;IAC/F,OAAO,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,WAAW,IAAI,EAAE,CAAC,CAAC;AAChD,CAAC;AAED,SAAS,uBAAuB,CAAC,IAAa;IAC5C,MAAM,SAAS,GAAG,IAAI,CAAC,UAAW,CAAC,aAAa,CAAC,mBAAmB,C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WAAW,CAAC,IAAI,EAAE,CAAC;YAEzB,MAAM,IAAI,GAAG,kBAAkB,CAAC,IAAI,CAAC,CAAC;YACtC,MAAM,CAAC,SAAS,CAAC,IAAI,EAAE;gBACrB,+GAA+G;aAChH,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["// Copyright 2023 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport * as Common from '../../../core/common/common.js';\nimport * as CrUXManager from '../../../models/crux-manager/crux-manager.js';\nimport {renderElementIntoDOM} from '../../../testing/DOMHelpers.js';\nimport {describeWithMockConnection} from '../../../testing/MockConnection.js';\nimport * as Coordinator from '../../../ui/components/render_coordinator/render_coordinator.js';\n\nimport * as Components from './components.js';\n\nconst coordinator = Coordinator.RenderCoordinator.RenderCoordinator.instance();\n\nfunction getLocalMetricValue(view: Element): HTMLElement {\n return view.shadowRoot!.querySelector('#local-value .metric-value') as HTMLElement;\n}\n\nfunction getFieldMetricValue(view: Element): HTMLElement|null {\n return view.shadowRoot!.querySelector('#field-value .metric-value');\n}\n\nfunction getFieldHistogramPercents(view: Element): string[] {\n const histogram = view.shadowRoot!.querySelector('.bucket-summaries') as HTMLElement;\n const percents = Array.from(histogram.querySelectorAll('.histogram-percent')) as HTMLElement[];\n return percents.map(p => p.textContent || '');\n}\n\nfunction getFieldHistogramLabels(view: Element): string[] {\n const histogram = view.shadowRoot!.querySelector('.bucket-summaries') as HTMLElement;\n const percents = Array.from(histogram.querySelectorAll('.bucket-label')) as HTMLElement[];\n return percents.map(p => p.textContent || '');\n}\n\nfunction getCompareText(view: Element): HTMLElement|null {\n return view.shadowRoot!.querySelector('.compare-text');\n}\n\nfunction getDetailedCompareText(view: Element): HTMLElement|null {\n return view.shadowRoot!.querySelector('.detailed-compare-text');\n}\n\nfunction getWarnings(view: Element): string[] {\n return Array.from(view.shadowRoot!.querySelectorAll('.warning')).map(w => w.textContent!);\n}\n\nfunction getEnvironmentRecs(view: Element): string[] {\n const recs = Array.from(view.shadowRoot!.querySelectorAll('.environment-recs li'));\n return recs.map(rec => rec.textContent!);\n}\n\nfunction getPhaseTable(view: Element): string[][]|null {\n const phaseTable = view.shadowRoot!.querySelector('.phase-table');\n if (!phaseTable) {\n return null;\n }\n\n const rowEls = Array.from(phaseTable.querySelectorAll('.phase-table-row:not(.phase-table-header-row)'));\n return rowEls.map(rowEl => Array.from(rowEl.querySelectorAll('[role=\"cell\"]')).map(cellEl => cellEl.textContent!));\n}\n\nfunction createMockHistogram() {\n // start/end values aren't actually used but they are filled out just in case\n // the histogram is therefore usable by all metrics\n return [\n {start: 0, end: 2500, density: 0.5},\n {start: 2500, end: 4000, density: 0.3},\n {start: 4000, density: 0.2},\n ];\n}\n\ndescribeWithMockConnection('MetricCard', () => {\n beforeEach(async () => {\n const dummyStorage = new Common.Settings.SettingsStorage({});\n Common.Settings.Settings.instance({\n forceNew: true,\n syncedStorage: dummyStorage,\n globalStorage: dummyStorage,\n localStorage: dummyStorage,\n });\n\n CrUXManager.CrUXManager.instance({forceNew: true});\n CrUXManager.CrUXManager.instance().getConfigSetting().set({enabled: true, override: ''});\n });\n\n it('should show LCP value', async () => {\n const view = new Components.MetricCard.MetricCard();\n view.data = {\n metric: 'LCP',\n localValue: 100,\n fieldValue: 5000,\n histogram: createMockHistogram(),\n };\n\n renderElementIntoDOM(view);\n await coordinator.done();\n\n const localValueEl = getLocalMetricValue(view);\n assert.strictEqual(localValueEl.className, 'metric-value good');\n assert.strictEqual(localValueEl.innerText, '0.10 s');\n\n const fieldValueEl = getFieldMetricValue(view);\n assert.strictEqual(fieldValueEl!.className, 'metric-value poor');\n assert.strictEqual(fieldValueEl!.innerText, '5.00 s');\n\n const histogramLabels = getFieldHistogramLabels(view);\n assert.match(histogramLabels[0], /Good\\s+\\(≤2.50 s\\)/);\n assert.match(histogramLabels[1], /Needs improvement\\s+\\(2.50 s-4.00 s\\)/);\n assert.match(histogramLabels[2], /Poor\\s+\\(>4.00 s\\)/);\n });\n\n it('should show CLS value', async () => {\n const view = new Components.MetricCard.MetricCard();\n view.data = {\n metric: 'CLS',\n localValue: 0.14294789234,\n fieldValue: 0,\n histogram: createMockHistogram(),\n };\n\n renderElementIntoDOM(view);\n await coordinator.done();\n\n const localValueEl = getLocalMetricValue(view);\n assert.strictEqual(localValueEl.className, 'metric-value needs-improvement');\n assert.strictEqual(localValueEl.innerText, '0.14');\n\n const fieldValueEl = getFieldMetricValue(view);\n assert.strictEqual(fieldValueEl!.className, 'metric-value good');\n assert.strictEqual(fieldValueEl!.innerText, '0');\n\n const histogramLabels = getFieldHistogramLabels(view);\n assert.match(histogramLabels[0], /Good\\s+\\(≤0.10\\)/);\n assert.match(histogramLabels[1], /Needs improvement\\s+\\(0.10-0.25\\)/);\n assert.match(histogramLabels[2], /Poor\\s+\\(>0.25\\)/);\n });\n\n it('should show INP value', async () => {\n const view = new Components.MetricCard.MetricCard();\n view.data = {\n metric: 'INP',\n localValue: 2000,\n fieldValue: 1,\n histogram: createMockHistogram(),\n };\n\n renderElementIntoDOM(view);\n await coordinator.done();\n\n const localValueEl = getLocalMetricValue(view);\n assert.strictEqual(localValueEl.className, 'metric-value poor');\n assert.strictEqual(localValueEl.innerText, '2,000 ms');\n\n const fieldValueEl = getFieldMetricValue(view);\n assert.strictEqual(fieldValueEl!.className, 'metric-value good');\n assert.strictEqual(fieldValueEl!.innerText, '1 ms');\n\n const histogramLabels = getFieldHistogramLabels(view);\n assert.match(histogramLabels[0], /Good\\s+\\(≤200 ms\\)/);\n assert.match(histogramLabels[1], /Needs improvement\\s+\\(200 ms-500 ms\\)/);\n assert.match(histogramLabels[2], /Poor\\s+\\(>500 ms\\)/);\n });\n\n it('should show empty metric', async () => {\n const view = new Components.MetricCard.MetricCard();\n\n renderElementIntoDOM(view);\n await coordinator.done();\n\n const metricValueEl = getLocalMetricValue(view);\n assert.strictEqual(metricValueEl.className.trim(), 'metric-value waiting');\n assert.strictEqual(metricValueEl.innerText, '-');\n\n const fieldValueEl = getFieldMetricValue(view);\n assert.strictEqual(fieldValueEl!.className, 'metric-value waiting');\n assert.strictEqual(fieldValueEl!.innerText, '-');\n\n const histogramLabels = getFieldHistogramLabels(view);\n assert.match(histogramLabels[0], /Good\\s+\\(≤2.50 s\\)/);\n assert.match(histogramLabels[1], /Needs improvement\\s+\\(2.50 s-4.00 s\\)/);\n assert.match(histogramLabels[2], /Poor\\s+\\(>4.00 s\\)/);\n });\n\n it('should show warnings', async () => {\n const view = new Components.MetricCard.MetricCard();\n view.data = {\n metric: 'LCP',\n localValue: 2000,\n fieldValue: 1,\n histogram: createMockHistogram(),\n warnings: ['LCP warning'],\n };\n\n renderElementIntoDOM(view);\n await coordinator.done();\n\n const warnings = getWarnings(view);\n assert.deepEqual(warnings, [\n 'LCP warning',\n ]);\n });\n\n describe('phase table', () => {\n it('should not show if there is no phase data', async () => {\n const view = new Components.MetricCard.MetricCard();\n view.data = {\n metric: 'LCP',\n localValue: 100,\n fieldValue: 200,\n histogram: createMockHistogram(),\n };\n renderElementIntoDOM(view);\n\n await coordinator.done();\n\n const phaseTable = getPhaseTable(view);\n assert.isNull(phaseTable);\n });\n\n it('should display phases in a table format', async () => {\n const view = new Components.MetricCard.MetricCard();\n view.data = {\n metric: 'LCP',\n localValue: 100,\n fieldValue: 200,\n histogram: createMockHistogram(),\n phases: [\n ['TTFB', 500],\n ['Phase 1', 0],\n ['Phase 2', 123.783458345],\n ],\n };\n renderElementIntoDOM(view);\n\n await coordinator.done();\n\n const phaseTable = getPhaseTable(view);\n assert.deepEqual(phaseTable, [\n ['TTFB', '500'],\n ['Phase 1', '0'],\n ['Phase 2', '124'],\n ]);\n });\n });\n\n describe('field data', () => {\n it('should not show when crux is disabled', async () => {\n CrUXManager.CrUXManager.instance().getConfigSetting().set({enabled: false, override: ''});\n\n const view = new Components.MetricCard.MetricCard();\n view.data = {\n metric: 'LCP',\n localValue: 100,\n fieldValue: 200,\n histogram: createMockHistogram(),\n };\n renderElementIntoDOM(view);\n\n await coordinator.done();\n\n const histogramLabels = getFieldHistogramLabels(view);\n assert.match(histogramLabels[0], /Good\\s+\\(≤2.50 s\\)/);\n assert.match(histogramLabels[1], /Needs improvement\\s+\\(2.50 s-4.00 s\\)/);\n assert.match(histogramLabels[2], /Poor\\s+\\(>4.00 s\\)/);\n\n const histogramPercents = getFieldHistogramPercents(view);\n assert.lengthOf(histogramPercents, 0);\n\n const fieldValueEl = getFieldMetricValue(view);\n assert.isNull(fieldValueEl);\n });\n\n it('should show when crux is enabled', async () => {\n const view = new Components.MetricCard.MetricCard();\n view.data = {\n metric: 'LCP',\n localValue: 100,\n fieldValue: 200,\n histogram: createMockHistogram(),\n };\n renderElementIntoDOM(view);\n\n await coordinator.done();\n\n const histogramLabels = getFieldHistogramLabels(view);\n assert.match(histogramLabels[0], /Good\\s+\\(≤2.50 s\\)/);\n assert.match(histogramLabels[1], /Needs improvement\\s+\\(2.50 s-4.00 s\\)/);\n assert.match(histogramLabels[2], /Poor\\s+\\(>4.00 s\\)/);\n\n const histogramPercents = getFieldHistogramPercents(view);\n assert.deepEqual(histogramPercents, ['50%', '30%', '20%']);\n\n const fieldValueEl = getFieldMetricValue(view);\n assert.strictEqual(fieldValueEl!.textContent, '0.20 s');\n });\n\n it('should show empty values when crux is enabled but there is no field data', async () => {\n const view = new Components.MetricCard.MetricCard();\n view.data = {\n metric: 'LCP',\n localValue: 100,\n };\n renderElementIntoDOM(view);\n\n await coordinator.done();\n\n const histogramLabels = getFieldHistogramLabels(view);\n assert.match(histogramLabels[0], /Good\\s+\\(≤2.50 s\\)/);\n assert.match(histogramLabels[1], /Needs improvement\\s+\\(2.50 s-4.00 s\\)/);\n assert.match(histogramLabels[2], /Poor\\s+\\(>4.00 s\\)/);\n\n const histogramPercents = getFieldHistogramPercents(view);\n assert.deepEqual(histogramPercents, ['-', '-', '-']);\n\n const fieldValueEl = getFieldMetricValue(view);\n assert.strictEqual(fieldValueEl!.textContent, '-');\n });\n });\n\n describe('local/field comparison', () => {\n it('should show message when values are similar', async () => {\n const view = new Components.MetricCard.MetricCard();\n view.data = {\n metric: 'LCP',\n localValue: 100,\n fieldValue: 200,\n histogram: createMockHistogram(),\n };\n renderElementIntoDOM(view);\n\n await coordinator.done();\n\n const compareText = getCompareText(view);\n assert.strictEqual(\n compareText!.innerText, 'Your local LCP value of 0.10 s is good, and is similar to your users’ experience.');\n });\n\n it('should show message when local is better', async () => {\n const view = new Components.MetricCard.MetricCard();\n view.data = {\n metric: 'LCP',\n localValue: 100,\n fieldValue: 5000,\n histogram: createMockHistogram(),\n };\n renderElementIntoDOM(view);\n\n await coordinator.done();\n\n const compareText = getCompareText(view);\n assert.strictEqual(\n compareText!.innerText,\n 'Your local LCP value of 0.10 s is good, but is significantly better than your users’ experience.');\n });\n\n it('should show message when local is worse', async () => {\n const view = new Components.MetricCard.MetricCard();\n view.data = {\n metric: 'LCP',\n localValue: 5000,\n fieldValue: 100,\n histogram: createMockHistogram(),\n };\n renderElementIntoDOM(view);\n\n await coordinator.done();\n\n const compareText = getCompareText(view);\n assert.strictEqual(\n compareText!.innerText,\n 'Your local LCP value of 5.00 s is poor, but is significantly worse than your users’ experience.');\n });\n\n it('should always be similar if local and field are rated \"good\"', async () => {\n const view = new Components.MetricCard.MetricCard();\n view.data = {\n metric: 'LCP',\n localValue: 10,\n fieldValue: 2490,\n histogram: createMockHistogram(),\n };\n renderElementIntoDOM(view);\n\n await coordinator.done();\n\n const compareText = getCompareText(view);\n assert.strictEqual(\n compareText!.innerText, 'Your local LCP value of 0.01 s is good, and is similar to your users’ experience.');\n });\n\n it('should show generic summary if field is missing', async () => {\n const view = new Components.MetricCard.MetricCard();\n view.data = {\n metric: 'LCP',\n localValue: 3000,\n };\n renderElementIntoDOM(view);\n\n await coordinator.done();\n\n const compareText = getCompareText(view);\n assert.strictEqual(compareText!.innerText, 'Your local LCP value of 3.00 s needs improvement.');\n });\n\n it('should suggest interaction if local INP is missing', async () => {\n const view = new Components.MetricCard.MetricCard();\n view.data = {\n metric: 'INP',\n };\n renderElementIntoDOM(view);\n\n await coordinator.done();\n\n const compareText = getCompareText(view);\n assert.strictEqual(compareText!.innerText, 'Interact with the page to measure INP.');\n });\n });\n\n describe('detailed local/field comparison', () => {\n it('should show message when values are rated the same', async () => {\n const view = new Components.MetricCard.MetricCard();\n view.data = {\n metric: 'LCP',\n localValue: 100,\n fieldValue: 1000,\n histogram: createMockHistogram(),\n };\n renderElementIntoDOM(view);\n\n await coordinator.done();\n\n const compareText = getDetailedCompareText(view);\n assert.strictEqual(\n compareText!.textContent,\n 'Your local LCP value of 0.10 s is good and is rated the same as 50% of real-user LCP experiences. Additionally, the field data 75th percentile LCP value of 1.00 s is good.',\n );\n });\n\n it('should show message when values are rated differently', async () => {\n const view = new Components.MetricCard.MetricCard();\n view.data = {\n metric: 'LCP',\n localValue: 100,\n fieldValue: 5000,\n histogram: createMockHistogram(),\n };\n renderElementIntoDOM(view);\n\n await coordinator.done();\n\n const compareText = getDetailedCompareText(view);\n assert.strictEqual(\n compareText!.textContent,\n 'Your local LCP value of 0.10 s is good and is rated the same as 50% of real-user LCP experiences. However, the field data 75th percentile LCP value of 5.00 s is poor.',\n );\n });\n\n it('should show generic summary if field is missing', async () => {\n const view = new Components.MetricCard.MetricCard();\n view.data = {\n metric: 'LCP',\n localValue: 3000,\n };\n renderElementIntoDOM(view);\n\n await coordinator.done();\n\n const compareText = getDetailedCompareText(view);\n assert.strictEqual(compareText!.textContent, 'Your local LCP value of 3.00 s needs improvement.');\n });\n\n it('should suggest interaction if local INP is missing', async () => {\n const view = new Components.MetricCard.MetricCard();\n view.data = {\n metric: 'INP',\n };\n renderElementIntoDOM(view);\n\n await coordinator.done();\n\n const compareText = getDetailedCompareText(view);\n assert.strictEqual(compareText!.textContent, 'Interact with the page to measure INP.');\n });\n });\n\n describe('environment recommendations', () => {\n it('should show nothing if field is missing', async () => {\n const view = new Components.MetricCard.MetricCard();\n view.data = {\n metric: 'LCP',\n localValue: 5000,\n };\n\n renderElementIntoDOM(view);\n await coordinator.done();\n\n const recs = getEnvironmentRecs(view);\n assert.lengthOf(recs, 0);\n });\n\n it('should show nothing if local/field are similar', async () => {\n const view = new Components.MetricCard.MetricCard();\n view.data = {\n metric: 'LCP',\n localValue: 5000,\n fieldValue: 5500,\n histogram: createMockHistogram(),\n };\n\n renderElementIntoDOM(view);\n await coordinator.done();\n\n const recs = getEnvironmentRecs(view);\n assert.lengthOf(recs, 0);\n });\n\n it('should show LCP recs', async () => {\n const view = new Components.MetricCard.MetricCard();\n view.data = {\n metric: 'LCP',\n localValue: 50,\n fieldValue: 5500,\n histogram: createMockHistogram(),\n };\n\n renderElementIntoDOM(view);\n await coordinator.done();\n\n const recs = getEnvironmentRecs(view);\n assert.deepEqual(recs, [\n 'Real users may experience longer page loads due to slower network conditions. Increasing network throttling will simulate slower network conditions.',\n 'Screen size can influence what the LCP element is. Ensure you are testing common viewport sizes.',\n 'The LCP element can vary between page loads if content is dynamic.',\n ]);\n });\n\n it('should hide LCP throttling rec if local is bigger', async () => {\n const view = new Components.MetricCard.MetricCard();\n view.data = {\n metric: 'LCP',\n localValue: 5000,\n fieldValue: 50,\n histogram: createMockHistogram(),\n };\n\n renderElementIntoDOM(view);\n await coordinator.done();\n\n const recs = getEnvironmentRecs(view);\n assert.deepEqual(recs, [\n 'Screen size can influence what the LCP element is. Ensure you are testing common viewport sizes.',\n 'The LCP element can vary between page loads if content is dynamic.',\n ]);\n });\n\n it('should show CLS recs', async () => {\n const view = new Components.MetricCard.MetricCard();\n view.data = {\n metric: 'CLS',\n localValue: 0,\n fieldValue: 0.2,\n histogram: createMockHistogram(),\n };\n\n renderElementIntoDOM(view);\n await coordinator.done();\n\n const recs = getEnvironmentRecs(view);\n assert.deepEqual(recs, [\n 'Screen size can influence what layout shifts happen. Ensure you are testing common viewport sizes.',\n 'How a user interacts with the page can influence layout shifts. Ensure you are testing common interactions like scrolling the page.',\n 'Dynamic content can influence what layout shifts happen.',\n ]);\n });\n\n it('should show INP recs', async () => {\n const view = new Components.MetricCard.MetricCard();\n view.data = {\n metric: 'INP',\n localValue: 100,\n fieldValue: 500,\n histogram: createMockHistogram(),\n };\n\n renderElementIntoDOM(view);\n await coordinator.done();\n\n const recs = getEnvironmentRecs(view);\n assert.deepEqual(recs, [\n 'Real users may experience longer interactions due to slower CPU speeds. Increasing CPU throttling will simulate a slower device.',\n 'How a user interacts with the page influences interaction delays. Ensure you are testing common interactions.',\n ]);\n });\n\n it('should hide INP throttling rec if local is bigger', async () => {\n const view = new Components.MetricCard.MetricCard();\n view.data = {\n metric: 'INP',\n localValue: 500,\n fieldValue: 100,\n histogram: createMockHistogram(),\n };\n\n renderElementIntoDOM(view);\n await coordinator.done();\n\n const recs = getEnvironmentRecs(view);\n assert.deepEqual(recs, [\n 'How a user interacts with the page influences interaction delays. Ensure you are testing common interactions.',\n ]);\n });\n });\n});\n"]} \ No newline at end of file +{"version":3,"file":"MetricCard.test.js","sourceRoot":"","sources":["../../../../../../../front_end/panels/timeline/components/MetricCard.test.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,KAAK,MAAM,MAAM,gCAAgC,CAAC;AACzD,OAAO,KAAK,WAAW,MAAM,8CAA8C,CAAC;AAC5E,OAAO,EAAC,oBAAoB,EAAC,MAAM,gCAAgC,CAAC;AACpE,OAAO,EAAC,0BAA0B,EAAC,MAAM,oCAAoC,CAAC;AAC9E,OAAO,KAAK,iBAAiB,MAAM,iEAAiE,CAAC;AAErG,OAAO,KAAK,UAAU,MAAM,iBAAiB,CAAC;AAE9C,SAAS,mBAAmB,CAAC,IAAa;IACxC,OAAO,IAAI,CAAC,UAAW,CAAC,aAAa,CAAC,4BAA4B,CAAgB,CAAC;AACrF,CAAC;AAED,SAAS,mBAAmB,CAAC,IAAa;IACxC,OAAO,IAAI,CAAC,UAAW,CAAC,aAAa,CAAC,4BA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M,iBAAiB,CAAC,IAAI,EAAE,CAAC;YAE/B,MAAM,IAAI,GAAG,kBAAkB,CAAC,IAAI,CAAC,CAAC;YACtC,MAAM,CAAC,SAAS,CAAC,IAAI,EAAE;gBACrB,kIAAkI;gBAClI,+GAA+G;aAChH,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,mDAAmD,EAAE,KAAK,IAAI,EAAE;YACjE,MAAM,IAAI,GAAG,IAAI,UAAU,CAAC,UAAU,CAAC,UAAU,EAAE,CAAC;YACpD,IAAI,CAAC,IAAI,GAAG;gBACV,MAAM,EAAE,KAAK;gBACb,UAAU,EAAE,GAAG;gBACf,UAAU,EAAE,GAAG;gBACf,SAAS,EAAE,mBAAmB,EAAE;aACjC,CAAC;YAEF,oBAAoB,CAAC,IAAI,CAAC,CAAC;YAC3B,MAAM,iBAAiB,CAAC,IAAI,EAAE,CAAC;YAE/B,MAAM,IAAI,GAAG,kBAAkB,CAAC,IAAI,CAAC,CAAC;YACtC,MAAM,CAAC,SAAS,CAAC,IAAI,EAAE;gBACrB,+GAA+G;aAChH,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["// Copyright 2023 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport * as Common from '../../../core/common/common.js';\nimport * as CrUXManager from '../../../models/crux-manager/crux-manager.js';\nimport {renderElementIntoDOM} from '../../../testing/DOMHelpers.js';\nimport {describeWithMockConnection} from '../../../testing/MockConnection.js';\nimport * as RenderCoordinator from '../../../ui/components/render_coordinator/render_coordinator.js';\n\nimport * as Components from './components.js';\n\nfunction getLocalMetricValue(view: Element): HTMLElement {\n return view.shadowRoot!.querySelector('#local-value .metric-value') as HTMLElement;\n}\n\nfunction getFieldMetricValue(view: Element): HTMLElement|null {\n return view.shadowRoot!.querySelector('#field-value .metric-value');\n}\n\nfunction getFieldHistogramPercents(view: Element): string[] {\n const histogram = view.shadowRoot!.querySelector('.bucket-summaries') as HTMLElement;\n const percents = Array.from(histogram.querySelectorAll('.histogram-percent')) as HTMLElement[];\n return percents.map(p => p.textContent || '');\n}\n\nfunction getFieldHistogramLabels(view: Element): string[] {\n const histogram = view.shadowRoot!.querySelector('.bucket-summaries') as HTMLElement;\n const percents = Array.from(histogram.querySelectorAll('.bucket-label')) as HTMLElement[];\n return percents.map(p => p.textContent || '');\n}\n\nfunction getCompareText(view: Element): HTMLElement|null {\n return view.shadowRoot!.querySelector('.compare-text');\n}\n\nfunction getDetailedCompareText(view: Element): HTMLElement|null {\n return view.shadowRoot!.querySelector('.detailed-compare-text');\n}\n\nfunction getWarnings(view: Element): string[] {\n return Array.from(view.shadowRoot!.querySelectorAll('.warning')).map(w => w.textContent!);\n}\n\nfunction getEnvironmentRecs(view: Element): string[] {\n const recs = Array.from(view.shadowRoot!.querySelectorAll('.environment-recs li'));\n return recs.map(rec => rec.textContent!);\n}\n\nfunction getPhaseTable(view: Element): string[][]|null {\n const phaseTable = view.shadowRoot!.querySelector('.phase-table');\n if (!phaseTable) {\n return null;\n }\n\n const rowEls = Array.from(phaseTable.querySelectorAll('.phase-table-row:not(.phase-table-header-row)'));\n return rowEls.map(rowEl => Array.from(rowEl.querySelectorAll('[role=\"cell\"]')).map(cellEl => cellEl.textContent!));\n}\n\nfunction createMockHistogram() {\n // start/end values aren't actually used but they are filled out just in case\n // the histogram is therefore usable by all metrics\n return [\n {start: 0, end: 2500, density: 0.5},\n {start: 2500, end: 4000, density: 0.3},\n {start: 4000, density: 0.2},\n ];\n}\n\ndescribeWithMockConnection('MetricCard', () => {\n beforeEach(async () => {\n const dummyStorage = new Common.Settings.SettingsStorage({});\n Common.Settings.Settings.instance({\n forceNew: true,\n syncedStorage: dummyStorage,\n globalStorage: dummyStorage,\n localStorage: dummyStorage,\n });\n\n CrUXManager.CrUXManager.instance({forceNew: true});\n CrUXManager.CrUXManager.instance().getConfigSetting().set({enabled: true, override: ''});\n });\n\n it('should show LCP value', async () => {\n const view = new Components.MetricCard.MetricCard();\n view.data = {\n metric: 'LCP',\n localValue: 100,\n fieldValue: 5000,\n histogram: createMockHistogram(),\n };\n\n renderElementIntoDOM(view);\n await RenderCoordinator.done();\n\n const localValueEl = getLocalMetricValue(view);\n assert.strictEqual(localValueEl.className, 'metric-value good');\n assert.strictEqual(localValueEl.innerText, '0.10 s');\n\n const fieldValueEl = getFieldMetricValue(view);\n assert.strictEqual(fieldValueEl!.className, 'metric-value poor');\n assert.strictEqual(fieldValueEl!.innerText, '5.00 s');\n\n const histogramLabels = getFieldHistogramLabels(view);\n assert.match(histogramLabels[0], /Good\\s+\\(≤2.50 s\\)/);\n assert.match(histogramLabels[1], /Needs improvement\\s+\\(2.50 s-4.00 s\\)/);\n assert.match(histogramLabels[2], /Poor\\s+\\(>4.00 s\\)/);\n });\n\n it('should show CLS value', async () => {\n const view = new Components.MetricCard.MetricCard();\n view.data = {\n metric: 'CLS',\n localValue: 0.14294789234,\n fieldValue: 0,\n histogram: createMockHistogram(),\n };\n\n renderElementIntoDOM(view);\n await RenderCoordinator.done();\n\n const localValueEl = getLocalMetricValue(view);\n assert.strictEqual(localValueEl.className, 'metric-value needs-improvement');\n assert.strictEqual(localValueEl.innerText, '0.14');\n\n const fieldValueEl = getFieldMetricValue(view);\n assert.strictEqual(fieldValueEl!.className, 'metric-value good');\n assert.strictEqual(fieldValueEl!.innerText, '0');\n\n const histogramLabels = getFieldHistogramLabels(view);\n assert.match(histogramLabels[0], /Good\\s+\\(≤0.10\\)/);\n assert.match(histogramLabels[1], /Needs improvement\\s+\\(0.10-0.25\\)/);\n assert.match(histogramLabels[2], /Poor\\s+\\(>0.25\\)/);\n });\n\n it('should show INP value', async () => {\n const view = new Components.MetricCard.MetricCard();\n view.data = {\n metric: 'INP',\n localValue: 2000,\n fieldValue: 1,\n histogram: createMockHistogram(),\n };\n\n renderElementIntoDOM(view);\n await RenderCoordinator.done();\n\n const localValueEl = getLocalMetricValue(view);\n assert.strictEqual(localValueEl.className, 'metric-value poor');\n assert.strictEqual(localValueEl.innerText, '2,000 ms');\n\n const fieldValueEl = getFieldMetricValue(view);\n assert.strictEqual(fieldValueEl!.className, 'metric-value good');\n assert.strictEqual(fieldValueEl!.innerText, '1 ms');\n\n const histogramLabels = getFieldHistogramLabels(view);\n assert.match(histogramLabels[0], /Good\\s+\\(≤200 ms\\)/);\n assert.match(histogramLabels[1], /Needs improvement\\s+\\(200 ms-500 ms\\)/);\n assert.match(histogramLabels[2], /Poor\\s+\\(>500 ms\\)/);\n });\n\n it('should show empty metric', async () => {\n const view = new Components.MetricCard.MetricCard();\n\n renderElementIntoDOM(view);\n await RenderCoordinator.done();\n\n const metricValueEl = getLocalMetricValue(view);\n assert.strictEqual(metricValueEl.className.trim(), 'metric-value waiting');\n assert.strictEqual(metricValueEl.innerText, '-');\n\n const fieldValueEl = getFieldMetricValue(view);\n assert.strictEqual(fieldValueEl!.className, 'metric-value waiting');\n assert.strictEqual(fieldValueEl!.innerText, '-');\n\n const histogramLabels = getFieldHistogramLabels(view);\n assert.match(histogramLabels[0], /Good\\s+\\(≤2.50 s\\)/);\n assert.match(histogramLabels[1], /Needs improvement\\s+\\(2.50 s-4.00 s\\)/);\n assert.match(histogramLabels[2], /Poor\\s+\\(>4.00 s\\)/);\n });\n\n it('should show warnings', async () => {\n const view = new Components.MetricCard.MetricCard();\n view.data = {\n metric: 'LCP',\n localValue: 2000,\n fieldValue: 1,\n histogram: createMockHistogram(),\n warnings: ['LCP warning'],\n };\n\n renderElementIntoDOM(view);\n await RenderCoordinator.done();\n\n const warnings = getWarnings(view);\n assert.deepEqual(warnings, [\n 'LCP warning',\n ]);\n });\n\n describe('phase table', () => {\n it('should not show if there is no phase data', async () => {\n const view = new Components.MetricCard.MetricCard();\n view.data = {\n metric: 'LCP',\n localValue: 100,\n fieldValue: 200,\n histogram: createMockHistogram(),\n };\n renderElementIntoDOM(view);\n\n await RenderCoordinator.done();\n\n const phaseTable = getPhaseTable(view);\n assert.isNull(phaseTable);\n });\n\n it('should display phases in a table format', async () => {\n const view = new Components.MetricCard.MetricCard();\n view.data = {\n metric: 'LCP',\n localValue: 100,\n fieldValue: 200,\n histogram: createMockHistogram(),\n phases: [\n ['TTFB', 500],\n ['Phase 1', 0],\n ['Phase 2', 123.783458345],\n ],\n };\n renderElementIntoDOM(view);\n\n await RenderCoordinator.done();\n\n const phaseTable = getPhaseTable(view);\n assert.deepEqual(phaseTable, [\n ['TTFB', '500'],\n ['Phase 1', '0'],\n ['Phase 2', '124'],\n ]);\n });\n });\n\n describe('field data', () => {\n it('should not show when crux is disabled', async () => {\n CrUXManager.CrUXManager.instance().getConfigSetting().set({enabled: false, override: ''});\n\n const view = new Components.MetricCard.MetricCard();\n view.data = {\n metric: 'LCP',\n localValue: 100,\n fieldValue: 200,\n histogram: createMockHistogram(),\n };\n renderElementIntoDOM(view);\n\n await RenderCoordinator.done();\n\n const histogramLabels = getFieldHistogramLabels(view);\n assert.match(histogramLabels[0], /Good\\s+\\(≤2.50 s\\)/);\n assert.match(histogramLabels[1], /Needs improvement\\s+\\(2.50 s-4.00 s\\)/);\n assert.match(histogramLabels[2], /Poor\\s+\\(>4.00 s\\)/);\n\n const histogramPercents = getFieldHistogramPercents(view);\n assert.lengthOf(histogramPercents, 0);\n\n const fieldValueEl = getFieldMetricValue(view);\n assert.isNull(fieldValueEl);\n });\n\n it('should show when crux is enabled', async () => {\n const view = new Components.MetricCard.MetricCard();\n view.data = {\n metric: 'LCP',\n localValue: 100,\n fieldValue: 200,\n histogram: createMockHistogram(),\n };\n renderElementIntoDOM(view);\n\n await RenderCoordinator.done();\n\n const histogramLabels = getFieldHistogramLabels(view);\n assert.match(histogramLabels[0], /Good\\s+\\(≤2.50 s\\)/);\n assert.match(histogramLabels[1], /Needs improvement\\s+\\(2.50 s-4.00 s\\)/);\n assert.match(histogramLabels[2], /Poor\\s+\\(>4.00 s\\)/);\n\n const histogramPercents = getFieldHistogramPercents(view);\n assert.deepEqual(histogramPercents, ['50%', '30%', '20%']);\n\n const fieldValueEl = getFieldMetricValue(view);\n assert.strictEqual(fieldValueEl!.textContent, '0.20 s');\n });\n\n it('should show empty values when crux is enabled but there is no field data', async () => {\n const view = new Components.MetricCard.MetricCard();\n view.data = {\n metric: 'LCP',\n localValue: 100,\n };\n renderElementIntoDOM(view);\n\n await RenderCoordinator.done();\n\n const histogramLabels = getFieldHistogramLabels(view);\n assert.match(histogramLabels[0], /Good\\s+\\(≤2.50 s\\)/);\n assert.match(histogramLabels[1], /Needs improvement\\s+\\(2.50 s-4.00 s\\)/);\n assert.match(histogramLabels[2], /Poor\\s+\\(>4.00 s\\)/);\n\n const histogramPercents = getFieldHistogramPercents(view);\n assert.deepEqual(histogramPercents, ['-', '-', '-']);\n\n const fieldValueEl = getFieldMetricValue(view);\n assert.strictEqual(fieldValueEl!.textContent, '-');\n });\n });\n\n describe('local/field comparison', () => {\n it('should show message when values are similar', async () => {\n const view = new Components.MetricCard.MetricCard();\n view.data = {\n metric: 'LCP',\n localValue: 100,\n fieldValue: 200,\n histogram: createMockHistogram(),\n };\n renderElementIntoDOM(view);\n\n await RenderCoordinator.done();\n\n const compareText = getCompareText(view);\n assert.strictEqual(\n compareText!.innerText, 'Your local LCP value of 0.10 s is good, and is similar to your users’ experience.');\n });\n\n it('should show message when local is better', async () => {\n const view = new Components.MetricCard.MetricCard();\n view.data = {\n metric: 'LCP',\n localValue: 100,\n fieldValue: 5000,\n histogram: createMockHistogram(),\n };\n renderElementIntoDOM(view);\n\n await RenderCoordinator.done();\n\n const compareText = getCompareText(view);\n assert.strictEqual(\n compareText!.innerText,\n 'Your local LCP value of 0.10 s is good, but is significantly better than your users’ experience.');\n });\n\n it('should show message when local is worse', async () => {\n const view = new Components.MetricCard.MetricCard();\n view.data = {\n metric: 'LCP',\n localValue: 5000,\n fieldValue: 100,\n histogram: createMockHistogram(),\n };\n renderElementIntoDOM(view);\n\n await RenderCoordinator.done();\n\n const compareText = getCompareText(view);\n assert.strictEqual(\n compareText!.innerText,\n 'Your local LCP value of 5.00 s is poor, but is significantly worse than your users’ experience.');\n });\n\n it('should always be similar if local and field are rated \"good\"', async () => {\n const view = new Components.MetricCard.MetricCard();\n view.data = {\n metric: 'LCP',\n localValue: 10,\n fieldValue: 2490,\n histogram: createMockHistogram(),\n };\n renderElementIntoDOM(view);\n\n await RenderCoordinator.done();\n\n const compareText = getCompareText(view);\n assert.strictEqual(\n compareText!.innerText, 'Your local LCP value of 0.01 s is good, and is similar to your users’ experience.');\n });\n\n it('should show generic summary if field is missing', async () => {\n const view = new Components.MetricCard.MetricCard();\n view.data = {\n metric: 'LCP',\n localValue: 3000,\n };\n renderElementIntoDOM(view);\n\n await RenderCoordinator.done();\n\n const compareText = getCompareText(view);\n assert.strictEqual(compareText!.innerText, 'Your local LCP value of 3.00 s needs improvement.');\n });\n\n it('should suggest interaction if local INP is missing', async () => {\n const view = new Components.MetricCard.MetricCard();\n view.data = {\n metric: 'INP',\n };\n renderElementIntoDOM(view);\n\n await RenderCoordinator.done();\n\n const compareText = getCompareText(view);\n assert.strictEqual(compareText!.innerText, 'Interact with the page to measure INP.');\n });\n });\n\n describe('detailed local/field comparison', () => {\n it('should show message when values are rated the same', async () => {\n const view = new Components.MetricCard.MetricCard();\n view.data = {\n metric: 'LCP',\n localValue: 100,\n fieldValue: 1000,\n histogram: createMockHistogram(),\n };\n renderElementIntoDOM(view);\n\n await RenderCoordinator.done();\n\n const compareText = getDetailedCompareText(view);\n assert.strictEqual(\n compareText!.textContent,\n 'Your local LCP value of 0.10 s is good and is rated the same as 50% of real-user LCP experiences. Additionally, the field data 75th percentile LCP value of 1.00 s is good.',\n );\n });\n\n it('should show message when values are rated differently', async () => {\n const view = new Components.MetricCard.MetricCard();\n view.data = {\n metric: 'LCP',\n localValue: 100,\n fieldValue: 5000,\n histogram: createMockHistogram(),\n };\n renderElementIntoDOM(view);\n\n await RenderCoordinator.done();\n\n const compareText = getDetailedCompareText(view);\n assert.strictEqual(\n compareText!.textContent,\n 'Your local LCP value of 0.10 s is good and is rated the same as 50% of real-user LCP experiences. However, the field data 75th percentile LCP value of 5.00 s is poor.',\n );\n });\n\n it('should show generic summary if field is missing', async () => {\n const view = new Components.MetricCard.MetricCard();\n view.data = {\n metric: 'LCP',\n localValue: 3000,\n };\n renderElementIntoDOM(view);\n\n await RenderCoordinator.done();\n\n const compareText = getDetailedCompareText(view);\n assert.strictEqual(compareText!.textContent, 'Your local LCP value of 3.00 s needs improvement.');\n });\n\n it('should suggest interaction if local INP is missing', async () => {\n const view = new Components.MetricCard.MetricCard();\n view.data = {\n metric: 'INP',\n };\n renderElementIntoDOM(view);\n\n await RenderCoordinator.done();\n\n const compareText = getDetailedCompareText(view);\n assert.strictEqual(compareText!.textContent, 'Interact with the page to measure INP.');\n });\n });\n\n describe('environment recommendations', () => {\n it('should show nothing if field is missing', async () => {\n const view = new Components.MetricCard.MetricCard();\n view.data = {\n metric: 'LCP',\n localValue: 5000,\n };\n\n renderElementIntoDOM(view);\n await RenderCoordinator.done();\n\n const recs = getEnvironmentRecs(view);\n assert.lengthOf(recs, 0);\n });\n\n it('should show nothing if local/field are similar', async () => {\n const view = new Components.MetricCard.MetricCard();\n view.data = {\n metric: 'LCP',\n localValue: 5000,\n fieldValue: 5500,\n histogram: createMockHistogram(),\n };\n\n renderElementIntoDOM(view);\n await RenderCoordinator.done();\n\n const recs = getEnvironmentRecs(view);\n assert.lengthOf(recs, 0);\n });\n\n it('should show LCP recs', async () => {\n const view = new Components.MetricCard.MetricCard();\n view.data = {\n metric: 'LCP',\n localValue: 50,\n fieldValue: 5500,\n histogram: createMockHistogram(),\n };\n\n renderElementIntoDOM(view);\n await RenderCoordinator.done();\n\n const recs = getEnvironmentRecs(view);\n assert.deepEqual(recs, [\n 'Real users may experience longer page loads due to slower network conditions. Increasing network throttling will simulate slower network conditions.',\n 'Screen size can influence what the LCP element is. Ensure you are testing common viewport sizes.',\n 'The LCP element can vary between page loads if content is dynamic.',\n ]);\n });\n\n it('should hide LCP throttling rec if local is bigger', async () => {\n const view = new Components.MetricCard.MetricCard();\n view.data = {\n metric: 'LCP',\n localValue: 5000,\n fieldValue: 50,\n histogram: createMockHistogram(),\n };\n\n renderElementIntoDOM(view);\n await RenderCoordinator.done();\n\n const recs = getEnvironmentRecs(view);\n assert.deepEqual(recs, [\n 'Screen size can influence what the LCP element is. Ensure you are testing common viewport sizes.',\n 'The LCP element can vary between page loads if content is dynamic.',\n ]);\n });\n\n it('should show CLS recs', async () => {\n const view = new Components.MetricCard.MetricCard();\n view.data = {\n metric: 'CLS',\n localValue: 0,\n fieldValue: 0.2,\n histogram: createMockHistogram(),\n };\n\n renderElementIntoDOM(view);\n await RenderCoordinator.done();\n\n const recs = getEnvironmentRecs(view);\n assert.deepEqual(recs, [\n 'Screen size can influence what layout shifts happen. Ensure you are testing common viewport sizes.',\n 'How a user interacts with the page can influence layout shifts. Ensure you are testing common interactions like scrolling the page.',\n 'Dynamic content can influence what layout shifts happen.',\n ]);\n });\n\n it('should show INP recs', async () => {\n const view = new Components.MetricCard.MetricCard();\n view.data = {\n metric: 'INP',\n localValue: 100,\n fieldValue: 500,\n histogram: createMockHistogram(),\n };\n\n renderElementIntoDOM(view);\n await RenderCoordinator.done();\n\n const recs = getEnvironmentRecs(view);\n assert.deepEqual(recs, [\n 'Real users may experience longer interactions due to slower CPU speeds. Increasing CPU throttling will simulate a slower device.',\n 'How a user interacts with the page influences interaction delays. Ensure you are testing common interactions.',\n ]);\n });\n\n it('should hide INP throttling rec if local is bigger', async () => {\n const view = new Components.MetricCard.MetricCard();\n view.data = {\n metric: 'INP',\n localValue: 500,\n fieldValue: 100,\n histogram: createMockHistogram(),\n };\n\n renderElementIntoDOM(view);\n await RenderCoordinator.done();\n\n const recs = getEnvironmentRecs(view);\n assert.deepEqual(recs, [\n 'How a user interacts with the page influences interaction delays. Ensure you are testing common interactions.',\n ]);\n });\n });\n});\n"]} \ No newline at end of file diff --git a/public/panels/timeline/components/NetworkThrottlingSelector.test.js b/public/panels/timeline/components/NetworkThrottlingSelector.test.js index 541616cc7..1b08b8835 100644 --- a/public/panels/timeline/components/NetworkThrottlingSelector.test.js +++ b/public/panels/timeline/components/NetworkThrottlingSelector.test.js @@ -5,11 +5,10 @@ import * as Common from '../../../core/common/common.js'; import * as SDK from '../../../core/sdk/sdk.js'; import { getCleanTextContentFromElements, renderElementIntoDOM } from '../../../testing/DOMHelpers.js'; import { describeWithEnvironment } from '../../../testing/EnvironmentHelpers.js'; -import * as Coordinator from '../../../ui/components/render_coordinator/render_coordinator.js'; +import * as RenderCoordinator from '../../../ui/components/render_coordinator/render_coordinator.js'; import * as MobileThrottling from '../../mobile_throttling/mobile_throttling.js'; import * as Components from './components.js'; describeWithEnvironment('NetworkThrottlingSelector', () => { - const coordinator = Coordinator.RenderCoordinator.RenderCoordinator.instance(); let networkManager; let customNetworkSetting; let mockReveal; @@ -25,7 +24,7 @@ describeWithEnvironment('NetworkThrottlingSelector', () => { it('should render all default presets', async () => { const view = new Components.NetworkThrottlingSelector.NetworkThrottlingSelector(); renderElementIntoDOM(view); - await coordinator.done(); + await RenderCoordinator.done(); const groups = view.shadowRoot.querySelectorAll('devtools-menu-group'); assert.lengthOf(groups, 3); assert.strictEqual(groups[0].name, 'Disabled'); @@ -53,12 +52,12 @@ describeWithEnvironment('NetworkThrottlingSelector', () => { it('updates network manager on change', async () => { const view = new Components.NetworkThrottlingSelector.NetworkThrottlingSelector(); renderElementIntoDOM(view); - await coordinator.done(); + await RenderCoordinator.done(); const items = view.shadowRoot.querySelectorAll('devtools-menu-item'); assert.isTrue(items[0].selected); assert.strictEqual(networkManager.networkConditions().i18nTitleKey, 'No throttling'); items[1].click(); - await coordinator.done(); + await RenderCoordinator.done(); assert.isTrue(items[1].selected); assert.isFalse(items[0].selected); assert.strictEqual(networkManager.networkConditions().i18nTitleKey, 'Fast 4G'); @@ -66,7 +65,7 @@ describeWithEnvironment('NetworkThrottlingSelector', () => { it('correctly updates when a custom preset is selected', async () => { const view = new Components.NetworkThrottlingSelector.NetworkThrottlingSelector(); renderElementIntoDOM(view); - await coordinator.done(); + await RenderCoordinator.done(); customNetworkSetting.set([ { title: 'Custom item one', @@ -81,13 +80,13 @@ describeWithEnvironment('NetworkThrottlingSelector', () => { latency: 0, }, ]); - await coordinator.done(); + await RenderCoordinator.done(); assert.isOk(view.shadowRoot); const items = view.shadowRoot.querySelectorAll('devtools-menu-item'); const itemsText = getCleanTextContentFromElements(view.shadowRoot, 'devtools-menu-item'); assert.deepEqual(itemsText, ['No throttling', 'Fast 4G', 'Slow 4G', '3G', 'Offline', 'Custom item one', 'Custom item two', 'Add…']); items[6].click(); - await coordinator.done(); + await RenderCoordinator.done(); assert.deepEqual(Array.from(items).filter(i => i.selected), [items[6]]); assert.strictEqual(networkManager.networkConditions().title, 'Custom item two'); }); @@ -96,7 +95,7 @@ describeWithEnvironment('NetworkThrottlingSelector', () => { // Change the conditions before the component is put into the DOM. networkManager.setNetworkConditions(MobileThrottling.ThrottlingPresets.ThrottlingPresets.networkPresets[1]); renderElementIntoDOM(view); - await coordinator.done(); + await RenderCoordinator.done(); // Ensure that the component picks up the new changes and has selected the right thorttling setting const items = view.shadowRoot.querySelectorAll('devtools-menu-item'); assert.isTrue(items[2].innerText.includes('Slow 4G')); @@ -105,18 +104,18 @@ describeWithEnvironment('NetworkThrottlingSelector', () => { it('reacts to network manager changes', async () => { const view = new Components.NetworkThrottlingSelector.NetworkThrottlingSelector(); renderElementIntoDOM(view); - await coordinator.done(); + await RenderCoordinator.done(); const items = view.shadowRoot.querySelectorAll('devtools-menu-item'); assert.isTrue(items[0].selected); networkManager.setNetworkConditions(MobileThrottling.ThrottlingPresets.ThrottlingPresets.networkPresets[1]); - await coordinator.done(); + await RenderCoordinator.done(); assert.isTrue(items[2].selected); assert.isFalse(items[0].selected); }); it('reacts to custom setting changes', async () => { const view = new Components.NetworkThrottlingSelector.NetworkThrottlingSelector(); renderElementIntoDOM(view); - await coordinator.done(); + await RenderCoordinator.done(); let items = view.shadowRoot.querySelectorAll('devtools-menu-item'); assert.lengthOf(items, 6); customNetworkSetting.set([{ @@ -125,7 +124,7 @@ describeWithEnvironment('NetworkThrottlingSelector', () => { upload: 0, latency: 0, }]); - await coordinator.done(); + await RenderCoordinator.done(); items = view.shadowRoot.querySelectorAll('devtools-menu-item'); assert.lengthOf(items, 7); assert.match(items[5].innerText, /Custom item/); @@ -133,12 +132,12 @@ describeWithEnvironment('NetworkThrottlingSelector', () => { it('reveals custom throttling settings when "Add..." clicked', async () => { const view = new Components.NetworkThrottlingSelector.NetworkThrottlingSelector(); renderElementIntoDOM(view); - await coordinator.done(); + await RenderCoordinator.done(); const items = view.shadowRoot.querySelectorAll('devtools-menu-item'); const addItem = items[items.length - 1]; addItem.click(); assert.isFalse(addItem.selected); - await coordinator.done(); + await RenderCoordinator.done(); assert(mockReveal.calledOnce); assert.isFalse(addItem.selected); }); diff --git a/public/panels/timeline/components/NetworkThrottlingSelector.test.js.map b/public/panels/timeline/components/NetworkThrottlingSelector.test.js.map index d366438f8..2e4848b40 100644 --- a/public/panels/timeline/components/NetworkThrottlingSelector.test.js.map +++ b/public/panels/timeline/components/NetworkThrottlingSelector.test.js.map @@ -1 +1 @@ -{"version":3,"file":"NetworkThrottlingSelector.test.js","sourceRoot":"","sources":["../../../../../../../front_end/panels/timeline/components/NetworkThrottlingSelector.test.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,KAAK,MAAM,MAAM,gCAAgC,CAAC;AACzD,OAAO,KAAK,GAAG,MAAM,0BAA0B,CAAC;AAChD,OAAO,EAAC,+BAA+B,EAAE,oBAAoB,EAAC,MAAM,gCAAgC,CAAC;AACrG,OAAO,EAAC,uBAAuB,EAAC,MAAM,wCAAwC,CAAC;AAE/E,OAAO,KAAK,WAAW,MAAM,iEAAiE,CAAC;AAC/F,OAAO,KAAK,gBAAgB,MAAM,8CAA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,EAAE,CAAC;QAClF,oBAAoB,CAAC,IAAI,CAAC,CAAC;QAE3B,MAAM,WAAW,CAAC,IAAI,EAAE,CAAC;QAEzB,MAAM,KAAK,GAAG,IAAI,CAAC,UAAW,CAAC,gBAAgB,CAAC,oBAAoB,CAAoC,CAAC;QACzG,MAAM,OAAO,GAAG,KAAK,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;QACxC,OAAO,CAAC,KAAK,EAAE,CAAC;QAEhB,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;QAEjC,MAAM,WAAW,CAAC,IAAI,EAAE,CAAC;QAEzB,MAAM,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC;QAC9B,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;IACnC,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["// Copyright 2024 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport * as Common from '../../../core/common/common.js';\nimport * as SDK from '../../../core/sdk/sdk.js';\nimport {getCleanTextContentFromElements, renderElementIntoDOM} from '../../../testing/DOMHelpers.js';\nimport {describeWithEnvironment} from '../../../testing/EnvironmentHelpers.js';\nimport type * as Menus from '../../../ui/components/menus/menus.js';\nimport * as Coordinator from '../../../ui/components/render_coordinator/render_coordinator.js';\nimport * as MobileThrottling from '../../mobile_throttling/mobile_throttling.js';\n\nimport * as Components from './components.js';\n\ndescribeWithEnvironment('NetworkThrottlingSelector', () => {\n const coordinator = Coordinator.RenderCoordinator.RenderCoordinator.instance();\n let networkManager: SDK.NetworkManager.MultitargetNetworkManager;\n let customNetworkSetting: Common.Settings.Setting;\n let mockReveal: sinon.SinonStub;\n\n beforeEach(() => {\n networkManager = SDK.NetworkManager.MultitargetNetworkManager.instance({forceNew: true});\n customNetworkSetting = Common.Settings.Settings.instance().moduleSetting('custom-network-conditions');\n mockReveal = sinon.stub(Common.Revealer.RevealerRegistry.instance(), 'reveal');\n });\n\n afterEach(() => {\n customNetworkSetting.set([]);\n mockReveal.restore();\n });\n\n it('should render all default presets', async () => {\n const view = new Components.NetworkThrottlingSelector.NetworkThrottlingSelector();\n renderElementIntoDOM(view);\n\n await coordinator.done();\n\n const groups = view.shadowRoot!.querySelectorAll('devtools-menu-group') as NodeListOf;\n\n assert.lengthOf(groups, 3);\n\n assert.strictEqual(groups[0].name, 'Disabled');\n const group1Items = groups[0].querySelectorAll('devtools-menu-item') as NodeListOf;\n assert.lengthOf(group1Items, 1);\n assert.match(group1Items[0].innerText, /No throttling/);\n assert.isTrue(group1Items[0].selected);\n\n assert.strictEqual(groups[1].name, 'Presets');\n const group2Items = groups[1].querySelectorAll('devtools-menu-item') as NodeListOf;\n assert.lengthOf(group2Items, 4);\n assert.match(group2Items[0].innerText, /Fast 4G/);\n assert.isFalse(group2Items[0].selected);\n assert.match(group2Items[1].innerText, /Slow 4G/);\n assert.isFalse(group2Items[1].selected);\n assert.match(group2Items[2].innerText, /3G/);\n assert.isFalse(group2Items[2].selected);\n assert.match(group2Items[3].innerText, /Offline/);\n assert.isFalse(group2Items[3].selected);\n\n assert.strictEqual(groups[2].name, 'Custom');\n const group3Items = groups[2].querySelectorAll('devtools-menu-item') as NodeListOf;\n assert.lengthOf(group3Items, 1);\n assert.match(group3Items[0].innerText, /Add…/);\n assert.isFalse(group3Items[0].selected);\n });\n\n it('updates network manager on change', async () => {\n const view = new Components.NetworkThrottlingSelector.NetworkThrottlingSelector();\n renderElementIntoDOM(view);\n\n await coordinator.done();\n\n const items = view.shadowRoot!.querySelectorAll('devtools-menu-item') as NodeListOf;\n assert.isTrue(items[0].selected);\n assert.strictEqual(networkManager.networkConditions().i18nTitleKey, 'No throttling');\n\n items[1].click();\n await coordinator.done();\n\n assert.isTrue(items[1].selected);\n assert.isFalse(items[0].selected);\n assert.strictEqual(networkManager.networkConditions().i18nTitleKey, 'Fast 4G');\n });\n\n it('correctly updates when a custom preset is selected', async () => {\n const view = new Components.NetworkThrottlingSelector.NetworkThrottlingSelector();\n renderElementIntoDOM(view);\n await coordinator.done();\n customNetworkSetting.set([\n {\n title: 'Custom item one',\n download: 0,\n upload: 0,\n latency: 0,\n },\n {\n title: 'Custom item two',\n download: 0,\n upload: 0,\n latency: 0,\n\n },\n ]);\n await coordinator.done();\n\n assert.isOk(view.shadowRoot);\n const items = view.shadowRoot.querySelectorAll('devtools-menu-item');\n const itemsText = getCleanTextContentFromElements(view.shadowRoot, 'devtools-menu-item');\n assert.deepEqual(\n itemsText,\n ['No throttling', 'Fast 4G', 'Slow 4G', '3G', 'Offline', 'Custom item one', 'Custom item two', 'Add…']);\n\n items[6].click();\n await coordinator.done();\n assert.deepEqual(Array.from(items).filter(i => i.selected), [items[6]]);\n assert.strictEqual(networkManager.networkConditions().title, 'Custom item two');\n });\n\n it('reacts to changes when it is unmounted and then remounted', async () => {\n const view = new Components.NetworkThrottlingSelector.NetworkThrottlingSelector();\n // Change the conditions before the component is put into the DOM.\n networkManager.setNetworkConditions(MobileThrottling.ThrottlingPresets.ThrottlingPresets.networkPresets[1]);\n\n renderElementIntoDOM(view);\n await coordinator.done();\n // Ensure that the component picks up the new changes and has selected the right thorttling setting\n const items = view.shadowRoot!.querySelectorAll('devtools-menu-item');\n assert.isTrue(items[2].innerText.includes('Slow 4G'));\n assert.isTrue(items[2].selected);\n });\n\n it('reacts to network manager changes', async () => {\n const view = new Components.NetworkThrottlingSelector.NetworkThrottlingSelector();\n renderElementIntoDOM(view);\n\n await coordinator.done();\n\n const items = view.shadowRoot!.querySelectorAll('devtools-menu-item') as NodeListOf;\n assert.isTrue(items[0].selected);\n\n networkManager.setNetworkConditions(MobileThrottling.ThrottlingPresets.ThrottlingPresets.networkPresets[1]);\n await coordinator.done();\n\n assert.isTrue(items[2].selected);\n assert.isFalse(items[0].selected);\n });\n\n it('reacts to custom setting changes', async () => {\n const view = new Components.NetworkThrottlingSelector.NetworkThrottlingSelector();\n renderElementIntoDOM(view);\n\n await coordinator.done();\n\n let items = view.shadowRoot!.querySelectorAll('devtools-menu-item') as NodeListOf;\n assert.lengthOf(items, 6);\n\n customNetworkSetting.set([{\n title: 'Custom item',\n download: 0,\n upload: 0,\n latency: 0,\n }]);\n await coordinator.done();\n\n items = view.shadowRoot!.querySelectorAll('devtools-menu-item') as NodeListOf;\n assert.lengthOf(items, 7);\n assert.match(items[5].innerText, /Custom item/);\n });\n\n it('reveals custom throttling settings when \"Add...\" clicked', async () => {\n const view = new Components.NetworkThrottlingSelector.NetworkThrottlingSelector();\n renderElementIntoDOM(view);\n\n await coordinator.done();\n\n const items = view.shadowRoot!.querySelectorAll('devtools-menu-item') as NodeListOf;\n const addItem = items[items.length - 1];\n addItem.click();\n\n assert.isFalse(addItem.selected);\n\n await coordinator.done();\n\n assert(mockReveal.calledOnce);\n assert.isFalse(addItem.selected);\n });\n});\n"]} \ No newline at end of file +{"version":3,"file":"NetworkThrottlingSelector.test.js","sourceRoot":"","sources":["../../../../../../../front_end/panels/timeline/components/NetworkThrottlingSelector.test.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,KAAK,MAAM,MAAM,gCAAgC,CAAC;AACzD,OAAO,KAAK,GAAG,MAAM,0BAA0B,CAAC;AAChD,OAAO,EAAC,+BAA+B,EAAE,oBAAoB,EAAC,MAAM,gCAAgC,CAAC;AACrG,OAAO,EAAC,uBAAuB,EAAC,MAAM,wCAAwC,CAAC;AAE/E,OAAO,KAAK,iBAAiB,MAAM,iEAAiE,CAAC;AACrG,OAAO,KAAK,gBAAgB,MAAM,8CAA8C,CAAC;AAEjF,OAAO,KAAK,UAAU,MAAM,iBAAiB,CAAC;AAE9C,uBAAuB,CAAC,2BAA2B,EAAE,GAAG,EAAE;IACxD,IAAI,cAA4D,CAAC;IACjE,IAAI,oBAA8E,CAAC;IACnF,IAAI,UAA2B,CAAC;IAEhC,UAAU,CAAC,GAA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C;QACxC,OAAO,CAAC,KAAK,EAAE,CAAC;QAEhB,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;QAEjC,MAAM,iBAAiB,CAAC,IAAI,EAAE,CAAC;QAE/B,MAAM,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC;QAC9B,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;IACnC,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["// Copyright 2024 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport * as Common from '../../../core/common/common.js';\nimport * as SDK from '../../../core/sdk/sdk.js';\nimport {getCleanTextContentFromElements, renderElementIntoDOM} from '../../../testing/DOMHelpers.js';\nimport {describeWithEnvironment} from '../../../testing/EnvironmentHelpers.js';\nimport type * as Menus from '../../../ui/components/menus/menus.js';\nimport * as RenderCoordinator from '../../../ui/components/render_coordinator/render_coordinator.js';\nimport * as MobileThrottling from '../../mobile_throttling/mobile_throttling.js';\n\nimport * as Components from './components.js';\n\ndescribeWithEnvironment('NetworkThrottlingSelector', () => {\n let networkManager: SDK.NetworkManager.MultitargetNetworkManager;\n let customNetworkSetting: Common.Settings.Setting;\n let mockReveal: sinon.SinonStub;\n\n beforeEach(() => {\n networkManager = SDK.NetworkManager.MultitargetNetworkManager.instance({forceNew: true});\n customNetworkSetting = Common.Settings.Settings.instance().moduleSetting('custom-network-conditions');\n mockReveal = sinon.stub(Common.Revealer.RevealerRegistry.instance(), 'reveal');\n });\n\n afterEach(() => {\n customNetworkSetting.set([]);\n mockReveal.restore();\n });\n\n it('should render all default presets', async () => {\n const view = new Components.NetworkThrottlingSelector.NetworkThrottlingSelector();\n renderElementIntoDOM(view);\n\n await RenderCoordinator.done();\n\n const groups = view.shadowRoot!.querySelectorAll('devtools-menu-group') as NodeListOf;\n\n assert.lengthOf(groups, 3);\n\n assert.strictEqual(groups[0].name, 'Disabled');\n const group1Items = groups[0].querySelectorAll('devtools-menu-item') as NodeListOf;\n assert.lengthOf(group1Items, 1);\n assert.match(group1Items[0].innerText, /No throttling/);\n assert.isTrue(group1Items[0].selected);\n\n assert.strictEqual(groups[1].name, 'Presets');\n const group2Items = groups[1].querySelectorAll('devtools-menu-item') as NodeListOf;\n assert.lengthOf(group2Items, 4);\n assert.match(group2Items[0].innerText, /Fast 4G/);\n assert.isFalse(group2Items[0].selected);\n assert.match(group2Items[1].innerText, /Slow 4G/);\n assert.isFalse(group2Items[1].selected);\n assert.match(group2Items[2].innerText, /3G/);\n assert.isFalse(group2Items[2].selected);\n assert.match(group2Items[3].innerText, /Offline/);\n assert.isFalse(group2Items[3].selected);\n\n assert.strictEqual(groups[2].name, 'Custom');\n const group3Items = groups[2].querySelectorAll('devtools-menu-item') as NodeListOf;\n assert.lengthOf(group3Items, 1);\n assert.match(group3Items[0].innerText, /Add…/);\n assert.isFalse(group3Items[0].selected);\n });\n\n it('updates network manager on change', async () => {\n const view = new Components.NetworkThrottlingSelector.NetworkThrottlingSelector();\n renderElementIntoDOM(view);\n\n await RenderCoordinator.done();\n\n const items = view.shadowRoot!.querySelectorAll('devtools-menu-item') as NodeListOf;\n assert.isTrue(items[0].selected);\n assert.strictEqual(networkManager.networkConditions().i18nTitleKey, 'No throttling');\n\n items[1].click();\n await RenderCoordinator.done();\n\n assert.isTrue(items[1].selected);\n assert.isFalse(items[0].selected);\n assert.strictEqual(networkManager.networkConditions().i18nTitleKey, 'Fast 4G');\n });\n\n it('correctly updates when a custom preset is selected', async () => {\n const view = new Components.NetworkThrottlingSelector.NetworkThrottlingSelector();\n renderElementIntoDOM(view);\n await RenderCoordinator.done();\n customNetworkSetting.set([\n {\n title: 'Custom item one',\n download: 0,\n upload: 0,\n latency: 0,\n },\n {\n title: 'Custom item two',\n download: 0,\n upload: 0,\n latency: 0,\n\n },\n ]);\n await RenderCoordinator.done();\n\n assert.isOk(view.shadowRoot);\n const items = view.shadowRoot.querySelectorAll('devtools-menu-item');\n const itemsText = getCleanTextContentFromElements(view.shadowRoot, 'devtools-menu-item');\n assert.deepEqual(\n itemsText,\n ['No throttling', 'Fast 4G', 'Slow 4G', '3G', 'Offline', 'Custom item one', 'Custom item two', 'Add…']);\n\n items[6].click();\n await RenderCoordinator.done();\n assert.deepEqual(Array.from(items).filter(i => i.selected), [items[6]]);\n assert.strictEqual(networkManager.networkConditions().title, 'Custom item two');\n });\n\n it('reacts to changes when it is unmounted and then remounted', async () => {\n const view = new Components.NetworkThrottlingSelector.NetworkThrottlingSelector();\n // Change the conditions before the component is put into the DOM.\n networkManager.setNetworkConditions(MobileThrottling.ThrottlingPresets.ThrottlingPresets.networkPresets[1]);\n\n renderElementIntoDOM(view);\n await RenderCoordinator.done();\n // Ensure that the component picks up the new changes and has selected the right thorttling setting\n const items = view.shadowRoot!.querySelectorAll('devtools-menu-item');\n assert.isTrue(items[2].innerText.includes('Slow 4G'));\n assert.isTrue(items[2].selected);\n });\n\n it('reacts to network manager changes', async () => {\n const view = new Components.NetworkThrottlingSelector.NetworkThrottlingSelector();\n renderElementIntoDOM(view);\n\n await RenderCoordinator.done();\n\n const items = view.shadowRoot!.querySelectorAll('devtools-menu-item') as NodeListOf;\n assert.isTrue(items[0].selected);\n\n networkManager.setNetworkConditions(MobileThrottling.ThrottlingPresets.ThrottlingPresets.networkPresets[1]);\n await RenderCoordinator.done();\n\n assert.isTrue(items[2].selected);\n assert.isFalse(items[0].selected);\n });\n\n it('reacts to custom setting changes', async () => {\n const view = new Components.NetworkThrottlingSelector.NetworkThrottlingSelector();\n renderElementIntoDOM(view);\n\n await RenderCoordinator.done();\n\n let items = view.shadowRoot!.querySelectorAll('devtools-menu-item') as NodeListOf;\n assert.lengthOf(items, 6);\n\n customNetworkSetting.set([{\n title: 'Custom item',\n download: 0,\n upload: 0,\n latency: 0,\n }]);\n await RenderCoordinator.done();\n\n items = view.shadowRoot!.querySelectorAll('devtools-menu-item') as NodeListOf;\n assert.lengthOf(items, 7);\n assert.match(items[5].innerText, /Custom item/);\n });\n\n it('reveals custom throttling settings when \"Add...\" clicked', async () => {\n const view = new Components.NetworkThrottlingSelector.NetworkThrottlingSelector();\n renderElementIntoDOM(view);\n\n await RenderCoordinator.done();\n\n const items = view.shadowRoot!.querySelectorAll('devtools-menu-item') as NodeListOf;\n const addItem = items[items.length - 1];\n addItem.click();\n\n assert.isFalse(addItem.selected);\n\n await RenderCoordinator.done();\n\n assert(mockReveal.calledOnce);\n assert.isFalse(addItem.selected);\n });\n});\n"]} \ No newline at end of file diff --git a/public/panels/timeline/components/OriginMap.js b/public/panels/timeline/components/OriginMap.js index b9bfd0b0f..ee596ccb1 100644 --- a/public/panels/timeline/components/OriginMap.js +++ b/public/panels/timeline/components/OriginMap.js @@ -5,12 +5,11 @@ import '../../../ui/components/icon_button/icon_button.js'; import * as i18n from '../../../core/i18n/i18n.js'; import * as SDK from '../../../core/sdk/sdk.js'; import * as CrUXManager from '../../../models/crux-manager/crux-manager.js'; -import * as Coordinator from '../../../ui/components/render_coordinator/render_coordinator.js'; +import * as RenderCoordinator from '../../../ui/components/render_coordinator/render_coordinator.js'; import * as UI from '../../../ui/legacy/legacy.js'; import * as LitHtml from '../../../ui/lit-html/lit-html.js'; import originMapStyles from './originMap.css.js'; const { html } = LitHtml; -const coordinator = Coordinator.RenderCoordinator.RenderCoordinator.instance(); const UIStrings = { /** * @description Title for a column in a data table representing a site origin used for development @@ -84,7 +83,7 @@ export class OriginMap extends UI.Widget.WidgetElement { } } #renderOriginWarning(url) { - return coordinator.write(async () => { + return RenderCoordinator.write(async () => { if (!CrUXManager.CrUXManager.instance().isEnabled()) { return LitHtml.nothing; } diff --git a/public/panels/timeline/components/OriginMap.js.map b/public/panels/timeline/components/OriginMap.js.map index bcc68a1ed..067a7bfe5 100644 --- a/public/panels/timeline/components/OriginMap.js.map +++ b/public/panels/timeline/components/OriginMap.js.map @@ -1 +1 @@ -{"version":3,"file":"OriginMap.js","sourceRoot":"","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AC;QAED,OAAO,EAAC,KAAK,EAAE,IAAI,EAAC,CAAC;IACvB,CAAC;IAED,aAAa;QACX,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;YACjB,OAAO,IAAI,CAAC,OAAO,CAAC;QACtB,CAAC;QAED,MAAM,MAAM,GAAG,IAAI,EAAE,CAAC,UAAU,CAAC,MAAM,EAAY,CAAC;QACpD,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;QACtB,MAAM,OAAO,GAAG,MAAM,CAAC,cAAc,EAAE,CAAC,WAAW,CAAC,KAAK,EAAE,uBAAuB,CAAgB,CAAC;QAEnG,MAAM,QAAQ,GAAG,MAAM,CAAC,WAAW,CAC/B,kBAAkB,EAAE,MAAM,EAAE,UAAU,CAAC,SAAS,CAAC,iBAAiB,CAAC,EAAE,IAAI,CAAC,qBAAqB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;QAChH,MAAM,SAAS,GAAG,MAAM,CAAC,WAAW,CAChC,mBAAmB,EAAE,MAAM,EAAE,UAAU,CAAC,SAAS,CAAC,gBAAgB,CAAC,EAAE,IAAI,CAAC,oBAAoB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;QAE/G,mBAAmB;QACnB,OAAO,CAAC,MAAM,CAAC,IAAI,CAAA;;UAEb,UAAU,CAAC,SAAS,CAAC,iBAAiB,CAAC;UACvC,QAAQ;;;UAGR,UAAU,CAAC,SAAS,CAAC,gBAAgB,CAAC;UACtC,SAAS;;KAEd,EAAE,OAAO,EAAE,EAAC,IAAI,EAAE,IAAI,EAAC,CAAC,CAAC;QAC1B,kBAAkB;QAElB,OAAO,MAAM,CAAC;IAChB,CAAC;CACF;AAED,cAAc,CAAC,MAAM,CAAC,qBAAqB,EAAE,SAAS,CAAC,CAAC","sourcesContent":["// Copyright 2024 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport '../../../ui/components/icon_button/icon_button.js';\n\nimport * as i18n from '../../../core/i18n/i18n.js';\nimport * as SDK from '../../../core/sdk/sdk.js';\nimport * as CrUXManager from '../../../models/crux-manager/crux-manager.js';\nimport * as Coordinator from '../../../ui/components/render_coordinator/render_coordinator.js';\nimport * as UI from '../../../ui/legacy/legacy.js';\nimport * as LitHtml from '../../../ui/lit-html/lit-html.js';\n\nimport originMapStyles from './originMap.css.js';\n\nconst {html} = LitHtml;\n\nconst coordinator = Coordinator.RenderCoordinator.RenderCoordinator.instance();\n\nconst UIStrings = {\n /**\n * @description Title for a column in a data table representing a site origin used for development\n */\n developmentOrigin: 'Development origin',\n /**\n * @description Title for a column in a data table representing a site origin used by real users in a production environment\n */\n productionOrigin: 'Production origin',\n /**\n * @description Warning message explaining that an input origin is not a valid origin or URL.\n * @example {http//malformed.com} PH1\n */\n invalidOrigin: '\"{PH1}\" is not a valid origin or URL.',\n /**\n * @description Warning message explaining that an development origin is already mapped to a productionOrigin.\n * @example {https://example.com} PH1\n */\n alreadyMapped: '\"{PH1}\" is already mapped to a production origin.',\n /**\n * @description Warning message explaining that a page doesn't have enough real user data to show any information for. \"Chrome UX Report\" is a product name and should not be translated.\n */\n pageHasNoData: 'The Chrome UX Report does not have sufficient real user data for this page.',\n};\n\nconst str_ = i18n.i18n.registerUIStrings('panels/timeline/components/OriginMap.ts', UIStrings);\nconst i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);\n\nconst DEV_ORIGIN_CONTROL = 'developmentOrigin';\nconst PROD_ORIGIN_CONTROL = 'productionOrigin';\n\ninterface ListItem extends CrUXManager.OriginMapping {\n isTitleRow?: boolean;\n}\n\nexport class OriginMap extends UI.Widget.WidgetElement implements UI.ListWidget.Delegate {\n #list: UI.ListWidget.ListWidget;\n #editor?: UI.ListWidget.Editor;\n\n constructor() {\n super();\n\n this.#list = new UI.ListWidget.ListWidget(this, false /* delegatesFocus */, true /* isTable */);\n\n CrUXManager.CrUXManager.instance().getConfigSetting().addChangeListener(this.#updateListFromSetting, this);\n this.#updateListFromSetting();\n }\n\n override createWidget(): UI.Widget.Widget {\n const containerWidget = new UI.Widget.Widget(false, false, this);\n\n this.#list.registerCSSFiles([originMapStyles]);\n this.#list.show(containerWidget.contentElement);\n\n return containerWidget;\n }\n\n #pullMappingsFromSetting(): ListItem[] {\n return CrUXManager.CrUXManager.instance().getConfigSetting().get().originMappings || [];\n }\n\n #pushMappingsToSetting(originMappings: ListItem[]): void {\n const setting = CrUXManager.CrUXManager.instance().getConfigSetting();\n const settingCopy = {...setting.get()};\n settingCopy.originMappings = originMappings;\n setting.set(settingCopy);\n }\n\n #updateListFromSetting(): void {\n const mappings = this.#pullMappingsFromSetting();\n this.#list.clear();\n this.#list.appendItem(\n {\n developmentOrigin: i18nString(UIStrings.developmentOrigin),\n productionOrigin: i18nString(UIStrings.productionOrigin),\n isTitleRow: true,\n },\n false);\n for (const originMapping of mappings) {\n this.#list.appendItem(originMapping, true);\n }\n }\n\n #getOrigin(url: string): string|null {\n try {\n return new URL(url).origin;\n } catch {\n return null;\n }\n }\n\n #renderOriginWarning(url: string): Promise {\n return coordinator.write(async () => {\n if (!CrUXManager.CrUXManager.instance().isEnabled()) {\n return LitHtml.nothing;\n }\n\n const cruxManager = CrUXManager.CrUXManager.instance();\n const result = await cruxManager.getFieldDataForPage(url);\n\n const hasFieldData = Object.entries(result).some(([key, value]) => {\n if (key === 'warnings') {\n return false;\n }\n return Boolean(value);\n });\n if (hasFieldData) {\n return LitHtml.nothing;\n }\n\n return html`\n \n `;\n });\n }\n\n startCreation(): void {\n const targetManager = SDK.TargetManager.TargetManager.instance();\n const inspectedURL = targetManager.inspectedURL();\n const currentOrigin = this.#getOrigin(inspectedURL) || '';\n\n this.#list.addNewItem(-1, {\n developmentOrigin: currentOrigin,\n productionOrigin: '',\n });\n }\n\n renderItem(originMapping: ListItem): Element {\n const element = document.createElement('div');\n element.classList.add('origin-mapping-row');\n element.role = 'row';\n\n let cellRole: 'columnheader'|'cell';\n let warningIcon;\n if (originMapping.isTitleRow) {\n element.classList.add('header');\n cellRole = 'columnheader';\n warningIcon = LitHtml.nothing;\n } else {\n cellRole = 'cell';\n warningIcon = LitHtml.Directives.until(this.#renderOriginWarning(originMapping.productionOrigin));\n }\n\n // clang-format off\n LitHtml.render(html`\n
\n
${originMapping.developmentOrigin}
\n
\n
\n ${warningIcon}\n
${originMapping.productionOrigin}
\n
\n `, element, {host: this});\n // clang-format on\n return element;\n }\n\n removeItemRequested(_item: ListItem, index: number): void {\n const mappings = this.#pullMappingsFromSetting();\n\n // `index` will be 1-indexed due to the header row\n mappings.splice(index - 1, 1);\n\n this.#pushMappingsToSetting(mappings);\n }\n\n commitEdit(originMapping: ListItem, editor: UI.ListWidget.Editor, isNew: boolean): void {\n originMapping.developmentOrigin = this.#getOrigin(editor.control(DEV_ORIGIN_CONTROL).value) || '';\n originMapping.productionOrigin = this.#getOrigin(editor.control(PROD_ORIGIN_CONTROL).value) || '';\n\n const mappings = this.#pullMappingsFromSetting();\n if (isNew) {\n mappings.push(originMapping);\n }\n this.#pushMappingsToSetting(mappings);\n }\n\n beginEdit(originMapping: ListItem): UI.ListWidget.Editor {\n const editor = this.#createEditor();\n editor.control(DEV_ORIGIN_CONTROL).value = originMapping.developmentOrigin;\n editor.control(PROD_ORIGIN_CONTROL).value = originMapping.productionOrigin;\n return editor;\n }\n\n #developmentValidator(_item: ListItem, index: number, input: UI.ListWidget.EditorControl):\n UI.ListWidget.ValidatorResult {\n const origin = this.#getOrigin(input.value);\n\n if (!origin) {\n return {valid: false, errorMessage: i18nString(UIStrings.invalidOrigin, {PH1: input.value})};\n }\n\n const mappings = this.#pullMappingsFromSetting();\n for (let i = 0; i < mappings.length; ++i) {\n // `index` will be 1-indexed due to the header row\n if (i === index - 1) {\n continue;\n }\n\n const mapping = mappings[i];\n if (mapping.developmentOrigin === origin) {\n return {valid: true, errorMessage: i18nString(UIStrings.alreadyMapped, {PH1: origin})};\n }\n }\n\n return {valid: true};\n }\n\n #productionValidator(_item: ListItem, _index: number, input: UI.ListWidget.EditorControl):\n UI.ListWidget.ValidatorResult {\n const origin = this.#getOrigin(input.value);\n\n if (!origin) {\n return {valid: false, errorMessage: i18nString(UIStrings.invalidOrigin, {PH1: input.value})};\n }\n\n return {valid: true};\n }\n\n #createEditor(): UI.ListWidget.Editor {\n if (this.#editor) {\n return this.#editor;\n }\n\n const editor = new UI.ListWidget.Editor();\n this.#editor = editor;\n const content = editor.contentElement().createChild('div', 'origin-mapping-editor') as HTMLElement;\n\n const devInput = editor.createInput(\n DEV_ORIGIN_CONTROL, 'text', i18nString(UIStrings.developmentOrigin), this.#developmentValidator.bind(this));\n const prodInput = editor.createInput(\n PROD_ORIGIN_CONTROL, 'text', i18nString(UIStrings.productionOrigin), this.#productionValidator.bind(this));\n\n // clang-format off\n LitHtml.render(html`\n \n \n `, content, {host: this});\n // clang-format on\n\n return editor;\n }\n}\n\ncustomElements.define('devtools-origin-map', OriginMap);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'devtools-origin-map': OriginMap;\n }\n}\n"]} \ No newline at end of file +{"version":3,"file":"OriginMap.js","sourceRoot":"","sources":["../../../../../../../front_end/panels/timeline/components/OriginMap.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,mDAAmD,CAAC;AAE3D,OAAO,KAAK,IAAI,MAAM,4BAA4B,CAAC;AACnD,OAAO,KAAK,GAAG,MAAM,0BAA0B,CAAC;AAChD,OAAO,KAAK,WAAW,MAAM,8CAA8C,CAAC;AAC5E,OAAO,KAAK,iBAAiB,MAAM,iEAAiE,CAAC;AACrG,OAAO,KAAK,EAAE,MAAM,8BAA8B,CAAC;AACnD,OAAO,KAAK,OAAO,MAAM,kCAAkC,CAAC;AAE5D,OAAO,eAAe,MAAM,oBAAoB,CAAC;AAEjD,MAAM,EAAC,IAAI,EAAC,GAAG,OAAO,CAAC;AAEvB,MAAM,SAAS,GAAG;IAChB;;OAEG;IACH,iBAAiB,EAAE,oBAAoB;IAC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U,CAAC,SAAS,CAAC,gBAAgB,CAAC,EAAE,IAAI,CAAC,oBAAoB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;QAE/G,mBAAmB;QACnB,OAAO,CAAC,MAAM,CAAC,IAAI,CAAA;;UAEb,UAAU,CAAC,SAAS,CAAC,iBAAiB,CAAC;UACvC,QAAQ;;;UAGR,UAAU,CAAC,SAAS,CAAC,gBAAgB,CAAC;UACtC,SAAS;;KAEd,EAAE,OAAO,EAAE,EAAC,IAAI,EAAE,IAAI,EAAC,CAAC,CAAC;QAC1B,kBAAkB;QAElB,OAAO,MAAM,CAAC;IAChB,CAAC;CACF;AAED,cAAc,CAAC,MAAM,CAAC,qBAAqB,EAAE,SAAS,CAAC,CAAC","sourcesContent":["// Copyright 2024 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport '../../../ui/components/icon_button/icon_button.js';\n\nimport * as i18n from '../../../core/i18n/i18n.js';\nimport * as SDK from '../../../core/sdk/sdk.js';\nimport * as CrUXManager from '../../../models/crux-manager/crux-manager.js';\nimport * as RenderCoordinator from '../../../ui/components/render_coordinator/render_coordinator.js';\nimport * as UI from '../../../ui/legacy/legacy.js';\nimport * as LitHtml from '../../../ui/lit-html/lit-html.js';\n\nimport originMapStyles from './originMap.css.js';\n\nconst {html} = LitHtml;\n\nconst UIStrings = {\n /**\n * @description Title for a column in a data table representing a site origin used for development\n */\n developmentOrigin: 'Development origin',\n /**\n * @description Title for a column in a data table representing a site origin used by real users in a production environment\n */\n productionOrigin: 'Production origin',\n /**\n * @description Warning message explaining that an input origin is not a valid origin or URL.\n * @example {http//malformed.com} PH1\n */\n invalidOrigin: '\"{PH1}\" is not a valid origin or URL.',\n /**\n * @description Warning message explaining that an development origin is already mapped to a productionOrigin.\n * @example {https://example.com} PH1\n */\n alreadyMapped: '\"{PH1}\" is already mapped to a production origin.',\n /**\n * @description Warning message explaining that a page doesn't have enough real user data to show any information for. \"Chrome UX Report\" is a product name and should not be translated.\n */\n pageHasNoData: 'The Chrome UX Report does not have sufficient real user data for this page.',\n};\n\nconst str_ = i18n.i18n.registerUIStrings('panels/timeline/components/OriginMap.ts', UIStrings);\nconst i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);\n\nconst DEV_ORIGIN_CONTROL = 'developmentOrigin';\nconst PROD_ORIGIN_CONTROL = 'productionOrigin';\n\ninterface ListItem extends CrUXManager.OriginMapping {\n isTitleRow?: boolean;\n}\n\nexport class OriginMap extends UI.Widget.WidgetElement implements UI.ListWidget.Delegate {\n #list: UI.ListWidget.ListWidget;\n #editor?: UI.ListWidget.Editor;\n\n constructor() {\n super();\n\n this.#list = new UI.ListWidget.ListWidget(this, false /* delegatesFocus */, true /* isTable */);\n\n CrUXManager.CrUXManager.instance().getConfigSetting().addChangeListener(this.#updateListFromSetting, this);\n this.#updateListFromSetting();\n }\n\n override createWidget(): UI.Widget.Widget {\n const containerWidget = new UI.Widget.Widget(false, false, this);\n\n this.#list.registerCSSFiles([originMapStyles]);\n this.#list.show(containerWidget.contentElement);\n\n return containerWidget;\n }\n\n #pullMappingsFromSetting(): ListItem[] {\n return CrUXManager.CrUXManager.instance().getConfigSetting().get().originMappings || [];\n }\n\n #pushMappingsToSetting(originMappings: ListItem[]): void {\n const setting = CrUXManager.CrUXManager.instance().getConfigSetting();\n const settingCopy = {...setting.get()};\n settingCopy.originMappings = originMappings;\n setting.set(settingCopy);\n }\n\n #updateListFromSetting(): void {\n const mappings = this.#pullMappingsFromSetting();\n this.#list.clear();\n this.#list.appendItem(\n {\n developmentOrigin: i18nString(UIStrings.developmentOrigin),\n productionOrigin: i18nString(UIStrings.productionOrigin),\n isTitleRow: true,\n },\n false);\n for (const originMapping of mappings) {\n this.#list.appendItem(originMapping, true);\n }\n }\n\n #getOrigin(url: string): string|null {\n try {\n return new URL(url).origin;\n } catch {\n return null;\n }\n }\n\n #renderOriginWarning(url: string): Promise {\n return RenderCoordinator.write(async () => {\n if (!CrUXManager.CrUXManager.instance().isEnabled()) {\n return LitHtml.nothing;\n }\n\n const cruxManager = CrUXManager.CrUXManager.instance();\n const result = await cruxManager.getFieldDataForPage(url);\n\n const hasFieldData = Object.entries(result).some(([key, value]) => {\n if (key === 'warnings') {\n return false;\n }\n return Boolean(value);\n });\n if (hasFieldData) {\n return LitHtml.nothing;\n }\n\n return html`\n \n `;\n });\n }\n\n startCreation(): void {\n const targetManager = SDK.TargetManager.TargetManager.instance();\n const inspectedURL = targetManager.inspectedURL();\n const currentOrigin = this.#getOrigin(inspectedURL) || '';\n\n this.#list.addNewItem(-1, {\n developmentOrigin: currentOrigin,\n productionOrigin: '',\n });\n }\n\n renderItem(originMapping: ListItem): Element {\n const element = document.createElement('div');\n element.classList.add('origin-mapping-row');\n element.role = 'row';\n\n let cellRole: 'columnheader'|'cell';\n let warningIcon;\n if (originMapping.isTitleRow) {\n element.classList.add('header');\n cellRole = 'columnheader';\n warningIcon = LitHtml.nothing;\n } else {\n cellRole = 'cell';\n warningIcon = LitHtml.Directives.until(this.#renderOriginWarning(originMapping.productionOrigin));\n }\n\n // clang-format off\n LitHtml.render(html`\n
\n
${originMapping.developmentOrigin}
\n
\n
\n ${warningIcon}\n
${originMapping.productionOrigin}
\n
\n `, element, {host: this});\n // clang-format on\n return element;\n }\n\n removeItemRequested(_item: ListItem, index: number): void {\n const mappings = this.#pullMappingsFromSetting();\n\n // `index` will be 1-indexed due to the header row\n mappings.splice(index - 1, 1);\n\n this.#pushMappingsToSetting(mappings);\n }\n\n commitEdit(originMapping: ListItem, editor: UI.ListWidget.Editor, isNew: boolean): void {\n originMapping.developmentOrigin = this.#getOrigin(editor.control(DEV_ORIGIN_CONTROL).value) || '';\n originMapping.productionOrigin = this.#getOrigin(editor.control(PROD_ORIGIN_CONTROL).value) || '';\n\n const mappings = this.#pullMappingsFromSetting();\n if (isNew) {\n mappings.push(originMapping);\n }\n this.#pushMappingsToSetting(mappings);\n }\n\n beginEdit(originMapping: ListItem): UI.ListWidget.Editor {\n const editor = this.#createEditor();\n editor.control(DEV_ORIGIN_CONTROL).value = originMapping.developmentOrigin;\n editor.control(PROD_ORIGIN_CONTROL).value = originMapping.productionOrigin;\n return editor;\n }\n\n #developmentValidator(_item: ListItem, index: number, input: UI.ListWidget.EditorControl):\n UI.ListWidget.ValidatorResult {\n const origin = this.#getOrigin(input.value);\n\n if (!origin) {\n return {valid: false, errorMessage: i18nString(UIStrings.invalidOrigin, {PH1: input.value})};\n }\n\n const mappings = this.#pullMappingsFromSetting();\n for (let i = 0; i < mappings.length; ++i) {\n // `index` will be 1-indexed due to the header row\n if (i === index - 1) {\n continue;\n }\n\n const mapping = mappings[i];\n if (mapping.developmentOrigin === origin) {\n return {valid: true, errorMessage: i18nString(UIStrings.alreadyMapped, {PH1: origin})};\n }\n }\n\n return {valid: true};\n }\n\n #productionValidator(_item: ListItem, _index: number, input: UI.ListWidget.EditorControl):\n UI.ListWidget.ValidatorResult {\n const origin = this.#getOrigin(input.value);\n\n if (!origin) {\n return {valid: false, errorMessage: i18nString(UIStrings.invalidOrigin, {PH1: input.value})};\n }\n\n return {valid: true};\n }\n\n #createEditor(): UI.ListWidget.Editor {\n if (this.#editor) {\n return this.#editor;\n }\n\n const editor = new UI.ListWidget.Editor();\n this.#editor = editor;\n const content = editor.contentElement().createChild('div', 'origin-mapping-editor');\n\n const devInput = editor.createInput(\n DEV_ORIGIN_CONTROL, 'text', i18nString(UIStrings.developmentOrigin), this.#developmentValidator.bind(this));\n const prodInput = editor.createInput(\n PROD_ORIGIN_CONTROL, 'text', i18nString(UIStrings.productionOrigin), this.#productionValidator.bind(this));\n\n // clang-format off\n LitHtml.render(html`\n \n \n `, content, {host: this});\n // clang-format on\n\n return editor;\n }\n}\n\ncustomElements.define('devtools-origin-map', OriginMap);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'devtools-origin-map': OriginMap;\n }\n}\n"]} \ No newline at end of file diff --git a/public/panels/timeline/components/OriginMap.test.js b/public/panels/timeline/components/OriginMap.test.js index 08c193bb4..ee08aed7c 100644 --- a/public/panels/timeline/components/OriginMap.test.js +++ b/public/panels/timeline/components/OriginMap.test.js @@ -5,10 +5,9 @@ import * as SDK from '../../../core/sdk/sdk.js'; import * as CrUXManager from '../../../models/crux-manager/crux-manager.js'; import { renderElementIntoDOM } from '../../../testing/DOMHelpers.js'; import { describeWithMockConnection } from '../../../testing/MockConnection.js'; -import * as Coordinator from '../../../ui/components/render_coordinator/render_coordinator.js'; +import * as RenderCoordinator from '../../../ui/components/render_coordinator/render_coordinator.js'; import * as UI from '../../../ui/legacy/legacy.js'; import * as Components from './components.js'; -const coordinator = Coordinator.RenderCoordinator.RenderCoordinator.instance(); function getOriginMappings(view) { const rows = view.querySelector('.vbox').shadowRoot.querySelectorAll('.origin-mapping-row:not(.header)'); return Array.from(rows).map(row => { @@ -114,7 +113,7 @@ describeWithMockConnection('OriginMap', () => { ], }); const view = createOriginMap(); - await coordinator.done(); + await RenderCoordinator.done(); const mappings = getOriginMappings(view); assert.deepEqual(mappings, [ ['http://localhost:8080', 'https://example.com', undefined], @@ -130,7 +129,7 @@ describeWithMockConnection('OriginMap', () => { ], }); const view = createOriginMap(); - await coordinator.done(); + await RenderCoordinator.done(); const mappings = getOriginMappings(view); assert.deepEqual(mappings, [ [ @@ -150,7 +149,7 @@ describeWithMockConnection('OriginMap', () => { ], }); const view = createOriginMap(); - await coordinator.done(); + await RenderCoordinator.done(); const mappings = getOriginMappings(view); assert.deepEqual(mappings, [ ['http://localhost:8080', 'https://no-data.com', undefined], @@ -165,7 +164,7 @@ describeWithMockConnection('OriginMap', () => { ], }); const view = createOriginMap(); - await coordinator.done(); + await RenderCoordinator.done(); { const mappings = getOriginMappings(view); assert.deepEqual(mappings, [ @@ -180,7 +179,7 @@ describeWithMockConnection('OriginMap', () => { { developmentOrigin: 'http://localhost:8081', productionOrigin: 'https://example2.com' }, ], }); - await coordinator.done(); + await RenderCoordinator.done(); { const mappings = getOriginMappings(view); assert.deepEqual(mappings, [ @@ -192,7 +191,7 @@ describeWithMockConnection('OriginMap', () => { it('should pre-fill new mapping fields', async () => { const originMap = createOriginMap(); originMap.startCreation(); - await coordinator.done(); + await RenderCoordinator.done(); const devInput = getDevInput(originMap); assert.strictEqual(devInput.value, 'http://localhost:8080'); const prodInput = getProdInput(originMap); @@ -201,16 +200,16 @@ describeWithMockConnection('OriginMap', () => { it('should accept new entries', async () => { const originMap = createOriginMap(); originMap.startCreation(); - await coordinator.done(); + await RenderCoordinator.done(); const devInput = getDevInput(originMap); devInput.value = 'http://localhost:8080'; devInput.dispatchEvent(new Event('input')); const prodInput = getProdInput(originMap); prodInput.value = 'https://example.com'; prodInput.dispatchEvent(new Event('input')); - await coordinator.done(); + await RenderCoordinator.done(); getConfirmButton(originMap).click(); - await coordinator.done(); + await RenderCoordinator.done(); const mappings = getOriginMappings(originMap); assert.deepEqual(mappings, [ ['http://localhost:8080', 'https://example.com', undefined], @@ -219,16 +218,16 @@ describeWithMockConnection('OriginMap', () => { it('should ignore cancelled entries', async () => { const originMap = createOriginMap(); originMap.startCreation(); - await coordinator.done(); + await RenderCoordinator.done(); const devInput = getDevInput(originMap); devInput.value = 'http://localhost:8080'; devInput.dispatchEvent(new Event('input')); const prodInput = getProdInput(originMap); prodInput.value = 'https://example.com'; prodInput.dispatchEvent(new Event('input')); - await coordinator.done(); + await RenderCoordinator.done(); getCancelButton(originMap).click(); - await coordinator.done(); + await RenderCoordinator.done(); const mappings = getOriginMappings(originMap); assert.deepEqual(mappings, []); assert.isNull(getDevInput(originMap)); @@ -237,16 +236,16 @@ describeWithMockConnection('OriginMap', () => { it('should coerce inputs to origin values', async () => { const originMap = createOriginMap(); originMap.startCreation(); - await coordinator.done(); + await RenderCoordinator.done(); const devInput = getDevInput(originMap); devInput.value = 'http://localhost:8080/path/to/something'; devInput.dispatchEvent(new Event('input')); const prodInput = getProdInput(originMap); prodInput.value = 'https://example.com?hello'; prodInput.dispatchEvent(new Event('input')); - await coordinator.done(); + await RenderCoordinator.done(); getConfirmButton(originMap).click(); - await coordinator.done(); + await RenderCoordinator.done(); const mappings = getOriginMappings(originMap); assert.deepEqual(mappings, [ ['http://localhost:8080', 'https://example.com', undefined], @@ -255,14 +254,14 @@ describeWithMockConnection('OriginMap', () => { it('should show errors from invalid origins', async () => { const originMap = createOriginMap(); originMap.startCreation(); - await coordinator.done(); + await RenderCoordinator.done(); const devInput = getDevInput(originMap); devInput.value = 'bad-origin'; devInput.dispatchEvent(new Event('input')); const prodInput = getProdInput(originMap); prodInput.value = 'jj**Sdafsdf'; prodInput.dispatchEvent(new Event('input')); - await coordinator.done(); + await RenderCoordinator.done(); const errors = getValidationErrors(originMap); assert.deepEqual(errors, '"bad-origin" is not a valid origin or URL.\n"jj**Sdafsdf" is not a valid origin or URL.'); const confirmButton = getConfirmButton(originMap); @@ -278,14 +277,14 @@ describeWithMockConnection('OriginMap', () => { }); const originMap = createOriginMap(); originMap.startCreation(); - await coordinator.done(); + await RenderCoordinator.done(); const devInput = getDevInput(originMap); devInput.value = 'http://localhost:8080'; devInput.dispatchEvent(new Event('input')); const prodInput = getProdInput(originMap); prodInput.value = 'https://example2.com'; prodInput.dispatchEvent(new Event('input')); - await coordinator.done(); + await RenderCoordinator.done(); const errors = getValidationErrors(originMap); assert.deepEqual(errors, '"http://localhost:8080" is already mapped to a production origin.'); const confirmButton = getConfirmButton(originMap); diff --git a/public/panels/timeline/components/OriginMap.test.js.map b/public/panels/timeline/components/OriginMap.test.js.map index 7e7720df2..2e4ade1d0 100644 --- a/public/panels/timeline/components/OriginMap.test.js.map +++ b/public/panels/timeline/components/OriginMap.test.js.map @@ -1 +1 @@ -{"version":3,"file":"OriginMap.test.js","sourceRoot":"","sources":["../../../../../../../front_end/panels/timeline/components/OriginMap.test.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,KAAK,GAAG,MAAM,0BAA0B,CAAC;AAChD,OAAO,KAAK,WAAW,MA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AC,SAAS,CAAC,MAAM,EAAE,mEAAmE,CAAC,CAAC;QAE9F,MAAM,aAAa,GAAG,gBAAgB,CAAC,SAAS,CAAC,CAAC;QAClD,MAAM,CAAC,OAAO,CAAC,aAAc,CAAC,UAAU,EAAE,aAAa,CAAC,QAAQ,CAAE,CAAC,QAAQ,CAAC,CAAC;IAC/E,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["// Copyright 2024 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport * as SDK from '../../../core/sdk/sdk.js';\nimport * as CrUXManager from '../../../models/crux-manager/crux-manager.js';\nimport {renderElementIntoDOM} from '../../../testing/DOMHelpers.js';\nimport {describeWithMockConnection} from '../../../testing/MockConnection.js';\nimport * as Coordinator from '../../../ui/components/render_coordinator/render_coordinator.js';\nimport * as UI from '../../../ui/legacy/legacy.js';\n\nimport * as Components from './components.js';\n\nconst coordinator = Coordinator.RenderCoordinator.RenderCoordinator.instance();\n\nfunction getOriginMappings(view: Element): Array<[string, string, string?]> {\n const rows = view.querySelector('.vbox')!.shadowRoot!.querySelectorAll('.origin-mapping-row:not(.header)');\n return Array.from(rows).map(row => {\n const warning = row.querySelector('.origin-warning-icon');\n return [\n row.querySelector('.development-origin .origin')!.textContent || '',\n row.querySelector('.production-origin .origin')!.textContent || '',\n warning?.title,\n ];\n });\n}\n\nfunction getDevInput(view: Element): HTMLInputElement|null {\n return view.querySelector('.vbox')!.shadowRoot!.querySelector('.development-origin-input input');\n}\n\nfunction getProdInput(view: Element): HTMLInputElement|null {\n return view.querySelector('.vbox')!.shadowRoot!.querySelector('.production-origin-input input');\n}\n\nfunction getConfirmButton(view: Element): HTMLElementTagNameMap['devtools-button']|null {\n const buttons = view.querySelector('.vbox')!.shadowRoot!.querySelectorAll('devtools-button');\n return Array.from(buttons).find(b => b.textContent === 'Add') || null;\n}\n\nfunction getCancelButton(view: Element): HTMLElementTagNameMap['devtools-button']|null {\n const buttons = view.querySelector('.vbox')!.shadowRoot!.querySelectorAll('devtools-button');\n return Array.from(buttons).find(b => b.textContent === 'Cancel') || null;\n}\n\nfunction getValidationErrors(view: Element): string {\n const errors =\n view.querySelector('.vbox')!.shadowRoot!.querySelector('.list-widget-input-validation-error');\n return errors?.innerText || '';\n}\n\nfunction mockResponse(): CrUXManager.CrUXResponse {\n return {\n record: {\n key: {},\n metrics: {\n largest_contentful_paint: {\n histogram: [\n {start: 0, end: 2500, density: 0.5},\n {start: 2500, end: 4000, density: 0.3},\n {start: 4000, density: 0.2},\n ],\n percentiles: {p75: 1000},\n },\n cumulative_layout_shift: {\n histogram: [\n {start: 0, end: 0.1, density: 0.1},\n {start: 0.1, end: 0.25, density: 0.1},\n {start: 0.25, density: 0.8},\n ],\n percentiles: {p75: 0.25},\n },\n },\n collectionPeriod: {\n firstDate: {year: 2024, month: 1, day: 1},\n lastDate: {year: 2024, month: 1, day: 29},\n },\n },\n };\n}\n\nfunction createOriginMap(): Components.OriginMap.OriginMap {\n const root = document.createElement('div');\n renderElementIntoDOM(root);\n\n const widget = new UI.Widget.Widget();\n widget.markAsRoot();\n widget.show(root);\n\n const view = new Components.OriginMap.OriginMap();\n widget.contentElement.append(view);\n\n return view;\n}\n\ndescribeWithMockConnection('OriginMap', () => {\n let cruxManager: CrUXManager.CrUXManager;\n let targetManager: SDK.TargetManager.TargetManager;\n let mockFieldData: CrUXManager.PageResult;\n let getFieldDataStub: sinon.SinonStub;\n let mockInspectedURL: sinon.SinonStub;\n\n beforeEach(async () => {\n cruxManager = CrUXManager.CrUXManager.instance({forceNew: true});\n targetManager = SDK.TargetManager.TargetManager.instance({forceNew: true});\n getFieldDataStub = sinon.stub(cruxManager, 'getFieldDataForPage').callsFake(async () => mockFieldData);\n mockInspectedURL = sinon.stub(targetManager, 'inspectedURL').returns('http://localhost:8080');\n\n mockFieldData = {\n 'origin-ALL': mockResponse(),\n 'origin-DESKTOP': null,\n 'origin-PHONE': null,\n 'origin-TABLET': null,\n 'url-ALL': null,\n 'url-DESKTOP': null,\n 'url-PHONE': null,\n 'url-TABLET': null,\n warnings: [],\n };\n\n cruxManager.getConfigSetting().set({enabled: true, override: ''});\n });\n\n afterEach(async () => {\n getFieldDataStub.restore();\n mockInspectedURL.restore();\n });\n\n it('should show mappings from setting', async () => {\n cruxManager.getConfigSetting().set({\n enabled: true,\n override: '',\n originMappings: [\n {developmentOrigin: 'http://localhost:8080', productionOrigin: 'https://example.com'},\n ],\n });\n const view = createOriginMap();\n await coordinator.done();\n\n const mappings = getOriginMappings(view);\n assert.deepEqual(mappings, [\n ['http://localhost:8080', 'https://example.com', undefined],\n ]);\n });\n\n it('should show warning if there is no field data', async () => {\n mockFieldData['origin-ALL'] = null;\n cruxManager.getConfigSetting().set({\n enabled: true,\n override: '',\n originMappings: [\n {developmentOrigin: 'http://localhost:8080', productionOrigin: 'https://no-data.com'},\n ],\n });\n const view = createOriginMap();\n await coordinator.done();\n\n const mappings = getOriginMappings(view);\n assert.deepEqual(mappings, [\n [\n 'http://localhost:8080',\n 'https://no-data.com',\n 'The Chrome UX Report does not have sufficient real user data for this page.',\n ],\n ]);\n });\n\n it('should not show warning if field is disabled', async () => {\n mockFieldData['origin-ALL'] = null;\n cruxManager.getConfigSetting().set({\n enabled: false,\n override: '',\n originMappings: [\n {developmentOrigin: 'http://localhost:8080', productionOrigin: 'https://no-data.com'},\n ],\n });\n const view = createOriginMap();\n await coordinator.done();\n\n const mappings = getOriginMappings(view);\n assert.deepEqual(mappings, [\n ['http://localhost:8080', 'https://no-data.com', undefined],\n ]);\n });\n\n it('should react to setting changes', async () => {\n cruxManager.getConfigSetting().set({\n enabled: true,\n override: '',\n originMappings: [\n {developmentOrigin: 'http://localhost:8080', productionOrigin: 'https://example.com'},\n ],\n });\n const view = createOriginMap();\n await coordinator.done();\n\n {\n const mappings = getOriginMappings(view);\n assert.deepEqual(mappings, [\n ['http://localhost:8080', 'https://example.com', undefined],\n ]);\n }\n\n cruxManager.getConfigSetting().set({\n enabled: true,\n override: '',\n originMappings: [\n {developmentOrigin: 'http://localhost:8080', productionOrigin: 'https://example.com'},\n {developmentOrigin: 'http://localhost:8081', productionOrigin: 'https://example2.com'},\n ],\n });\n await coordinator.done();\n\n {\n const mappings = getOriginMappings(view);\n assert.deepEqual(mappings, [\n ['http://localhost:8080', 'https://example.com', undefined],\n ['http://localhost:8081', 'https://example2.com', undefined],\n ]);\n }\n });\n\n it('should pre-fill new mapping fields', async () => {\n const originMap = createOriginMap();\n originMap.startCreation();\n await coordinator.done();\n\n const devInput = getDevInput(originMap)!;\n assert.strictEqual(devInput.value, 'http://localhost:8080');\n\n const prodInput = getProdInput(originMap)!;\n assert.strictEqual(prodInput.value, '');\n });\n\n it('should accept new entries', async () => {\n const originMap = createOriginMap();\n originMap.startCreation();\n await coordinator.done();\n\n const devInput = getDevInput(originMap)!;\n devInput.value = 'http://localhost:8080';\n devInput.dispatchEvent(new Event('input'));\n\n const prodInput = getProdInput(originMap)!;\n prodInput.value = 'https://example.com';\n prodInput.dispatchEvent(new Event('input'));\n\n await coordinator.done();\n\n getConfirmButton(originMap)!.click();\n\n await coordinator.done();\n\n const mappings = getOriginMappings(originMap);\n assert.deepEqual(mappings, [\n ['http://localhost:8080', 'https://example.com', undefined],\n ]);\n });\n\n it('should ignore cancelled entries', async () => {\n const originMap = createOriginMap();\n originMap.startCreation();\n await coordinator.done();\n\n const devInput = getDevInput(originMap)!;\n devInput.value = 'http://localhost:8080';\n devInput.dispatchEvent(new Event('input'));\n\n const prodInput = getProdInput(originMap)!;\n prodInput.value = 'https://example.com';\n prodInput.dispatchEvent(new Event('input'));\n\n await coordinator.done();\n\n getCancelButton(originMap)!.click();\n\n await coordinator.done();\n\n const mappings = getOriginMappings(originMap);\n assert.deepEqual(mappings, []);\n assert.isNull(getDevInput(originMap));\n assert.isNull(getProdInput(originMap));\n });\n\n it('should coerce inputs to origin values', async () => {\n const originMap = createOriginMap();\n originMap.startCreation();\n await coordinator.done();\n\n const devInput = getDevInput(originMap)!;\n devInput.value = 'http://localhost:8080/path/to/something';\n devInput.dispatchEvent(new Event('input'));\n\n const prodInput = getProdInput(originMap)!;\n prodInput.value = 'https://example.com?hello';\n prodInput.dispatchEvent(new Event('input'));\n\n await coordinator.done();\n\n getConfirmButton(originMap)!.click();\n\n await coordinator.done();\n\n const mappings = getOriginMappings(originMap);\n assert.deepEqual(mappings, [\n ['http://localhost:8080', 'https://example.com', undefined],\n ]);\n });\n\n it('should show errors from invalid origins', async () => {\n const originMap = createOriginMap();\n originMap.startCreation();\n await coordinator.done();\n\n const devInput = getDevInput(originMap)!;\n devInput.value = 'bad-origin';\n devInput.dispatchEvent(new Event('input'));\n\n const prodInput = getProdInput(originMap)!;\n prodInput.value = 'jj**Sdafsdf';\n prodInput.dispatchEvent(new Event('input'));\n\n await coordinator.done();\n\n const errors = getValidationErrors(originMap);\n assert.deepEqual(errors, '\"bad-origin\" is not a valid origin or URL.\\n\"jj**Sdafsdf\" is not a valid origin or URL.');\n\n const confirmButton = getConfirmButton(originMap);\n assert.isTrue(confirmButton!.shadowRoot?.querySelector('button')!.disabled);\n });\n\n it('should show warning for duplicate dev origin', async () => {\n cruxManager.getConfigSetting().set({\n enabled: true,\n override: '',\n originMappings: [\n {developmentOrigin: 'http://localhost:8080', productionOrigin: 'https://example.com'},\n ],\n });\n\n const originMap = createOriginMap();\n originMap.startCreation();\n await coordinator.done();\n\n const devInput = getDevInput(originMap)!;\n devInput.value = 'http://localhost:8080';\n devInput.dispatchEvent(new Event('input'));\n\n const prodInput = getProdInput(originMap)!;\n prodInput.value = 'https://example2.com';\n prodInput.dispatchEvent(new Event('input'));\n\n await coordinator.done();\n\n const errors = getValidationErrors(originMap);\n assert.deepEqual(errors, '\"http://localhost:8080\" is already mapped to a production origin.');\n\n const confirmButton = getConfirmButton(originMap);\n assert.isFalse(confirmButton!.shadowRoot?.querySelector('button')!.disabled);\n });\n});\n"]} \ No newline at end of file +{"version":3,"file":"OriginMap.test.js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AC,OAAO,CAAC,CAAC,CAAC;QAE5C,MAAM,iBAAiB,CAAC,IAAI,EAAE,CAAC;QAE/B,MAAM,MAAM,GAAG,mBAAmB,CAAC,SAAS,CAAC,CAAC;QAC9C,MAAM,CAAC,SAAS,CAAC,MAAM,EAAE,mEAAmE,CAAC,CAAC;QAE9F,MAAM,aAAa,GAAG,gBAAgB,CAAC,SAAS,CAAC,CAAC;QAClD,MAAM,CAAC,OAAO,CAAC,aAAc,CAAC,UAAU,EAAE,aAAa,CAAC,QAAQ,CAAE,CAAC,QAAQ,CAAC,CAAC;IAC/E,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["// Copyright 2024 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport * as SDK from '../../../core/sdk/sdk.js';\nimport * as CrUXManager from '../../../models/crux-manager/crux-manager.js';\nimport {renderElementIntoDOM} from '../../../testing/DOMHelpers.js';\nimport {describeWithMockConnection} from '../../../testing/MockConnection.js';\nimport * as RenderCoordinator from '../../../ui/components/render_coordinator/render_coordinator.js';\nimport * as UI from '../../../ui/legacy/legacy.js';\n\nimport * as Components from './components.js';\n\nfunction getOriginMappings(view: Element): Array<[string, string, string?]> {\n const rows = view.querySelector('.vbox')!.shadowRoot!.querySelectorAll('.origin-mapping-row:not(.header)');\n return Array.from(rows).map(row => {\n const warning = row.querySelector('.origin-warning-icon');\n return [\n row.querySelector('.development-origin .origin')!.textContent || '',\n row.querySelector('.production-origin .origin')!.textContent || '',\n warning?.title,\n ];\n });\n}\n\nfunction getDevInput(view: Element): HTMLInputElement|null {\n return view.querySelector('.vbox')!.shadowRoot!.querySelector('.development-origin-input input');\n}\n\nfunction getProdInput(view: Element): HTMLInputElement|null {\n return view.querySelector('.vbox')!.shadowRoot!.querySelector('.production-origin-input input');\n}\n\nfunction getConfirmButton(view: Element): HTMLElementTagNameMap['devtools-button']|null {\n const buttons = view.querySelector('.vbox')!.shadowRoot!.querySelectorAll('devtools-button');\n return Array.from(buttons).find(b => b.textContent === 'Add') || null;\n}\n\nfunction getCancelButton(view: Element): HTMLElementTagNameMap['devtools-button']|null {\n const buttons = view.querySelector('.vbox')!.shadowRoot!.querySelectorAll('devtools-button');\n return Array.from(buttons).find(b => b.textContent === 'Cancel') || null;\n}\n\nfunction getValidationErrors(view: Element): string {\n const errors =\n view.querySelector('.vbox')!.shadowRoot!.querySelector('.list-widget-input-validation-error');\n return errors?.innerText || '';\n}\n\nfunction mockResponse(): CrUXManager.CrUXResponse {\n return {\n record: {\n key: {},\n metrics: {\n largest_contentful_paint: {\n histogram: [\n {start: 0, end: 2500, density: 0.5},\n {start: 2500, end: 4000, density: 0.3},\n {start: 4000, density: 0.2},\n ],\n percentiles: {p75: 1000},\n },\n cumulative_layout_shift: {\n histogram: [\n {start: 0, end: 0.1, density: 0.1},\n {start: 0.1, end: 0.25, density: 0.1},\n {start: 0.25, density: 0.8},\n ],\n percentiles: {p75: 0.25},\n },\n },\n collectionPeriod: {\n firstDate: {year: 2024, month: 1, day: 1},\n lastDate: {year: 2024, month: 1, day: 29},\n },\n },\n };\n}\n\nfunction createOriginMap(): Components.OriginMap.OriginMap {\n const root = document.createElement('div');\n renderElementIntoDOM(root);\n\n const widget = new UI.Widget.Widget();\n widget.markAsRoot();\n widget.show(root);\n\n const view = new Components.OriginMap.OriginMap();\n widget.contentElement.append(view);\n\n return view;\n}\n\ndescribeWithMockConnection('OriginMap', () => {\n let cruxManager: CrUXManager.CrUXManager;\n let targetManager: SDK.TargetManager.TargetManager;\n let mockFieldData: CrUXManager.PageResult;\n let getFieldDataStub: sinon.SinonStub;\n let mockInspectedURL: sinon.SinonStub;\n\n beforeEach(async () => {\n cruxManager = CrUXManager.CrUXManager.instance({forceNew: true});\n targetManager = SDK.TargetManager.TargetManager.instance({forceNew: true});\n getFieldDataStub = sinon.stub(cruxManager, 'getFieldDataForPage').callsFake(async () => mockFieldData);\n mockInspectedURL = sinon.stub(targetManager, 'inspectedURL').returns('http://localhost:8080');\n\n mockFieldData = {\n 'origin-ALL': mockResponse(),\n 'origin-DESKTOP': null,\n 'origin-PHONE': null,\n 'origin-TABLET': null,\n 'url-ALL': null,\n 'url-DESKTOP': null,\n 'url-PHONE': null,\n 'url-TABLET': null,\n warnings: [],\n };\n\n cruxManager.getConfigSetting().set({enabled: true, override: ''});\n });\n\n afterEach(async () => {\n getFieldDataStub.restore();\n mockInspectedURL.restore();\n });\n\n it('should show mappings from setting', async () => {\n cruxManager.getConfigSetting().set({\n enabled: true,\n override: '',\n originMappings: [\n {developmentOrigin: 'http://localhost:8080', productionOrigin: 'https://example.com'},\n ],\n });\n const view = createOriginMap();\n await RenderCoordinator.done();\n\n const mappings = getOriginMappings(view);\n assert.deepEqual(mappings, [\n ['http://localhost:8080', 'https://example.com', undefined],\n ]);\n });\n\n it('should show warning if there is no field data', async () => {\n mockFieldData['origin-ALL'] = null;\n cruxManager.getConfigSetting().set({\n enabled: true,\n override: '',\n originMappings: [\n {developmentOrigin: 'http://localhost:8080', productionOrigin: 'https://no-data.com'},\n ],\n });\n const view = createOriginMap();\n await RenderCoordinator.done();\n\n const mappings = getOriginMappings(view);\n assert.deepEqual(mappings, [\n [\n 'http://localhost:8080',\n 'https://no-data.com',\n 'The Chrome UX Report does not have sufficient real user data for this page.',\n ],\n ]);\n });\n\n it('should not show warning if field is disabled', async () => {\n mockFieldData['origin-ALL'] = null;\n cruxManager.getConfigSetting().set({\n enabled: false,\n override: '',\n originMappings: [\n {developmentOrigin: 'http://localhost:8080', productionOrigin: 'https://no-data.com'},\n ],\n });\n const view = createOriginMap();\n await RenderCoordinator.done();\n\n const mappings = getOriginMappings(view);\n assert.deepEqual(mappings, [\n ['http://localhost:8080', 'https://no-data.com', undefined],\n ]);\n });\n\n it('should react to setting changes', async () => {\n cruxManager.getConfigSetting().set({\n enabled: true,\n override: '',\n originMappings: [\n {developmentOrigin: 'http://localhost:8080', productionOrigin: 'https://example.com'},\n ],\n });\n const view = createOriginMap();\n await RenderCoordinator.done();\n\n {\n const mappings = getOriginMappings(view);\n assert.deepEqual(mappings, [\n ['http://localhost:8080', 'https://example.com', undefined],\n ]);\n }\n\n cruxManager.getConfigSetting().set({\n enabled: true,\n override: '',\n originMappings: [\n {developmentOrigin: 'http://localhost:8080', productionOrigin: 'https://example.com'},\n {developmentOrigin: 'http://localhost:8081', productionOrigin: 'https://example2.com'},\n ],\n });\n await RenderCoordinator.done();\n\n {\n const mappings = getOriginMappings(view);\n assert.deepEqual(mappings, [\n ['http://localhost:8080', 'https://example.com', undefined],\n ['http://localhost:8081', 'https://example2.com', undefined],\n ]);\n }\n });\n\n it('should pre-fill new mapping fields', async () => {\n const originMap = createOriginMap();\n originMap.startCreation();\n await RenderCoordinator.done();\n\n const devInput = getDevInput(originMap)!;\n assert.strictEqual(devInput.value, 'http://localhost:8080');\n\n const prodInput = getProdInput(originMap)!;\n assert.strictEqual(prodInput.value, '');\n });\n\n it('should accept new entries', async () => {\n const originMap = createOriginMap();\n originMap.startCreation();\n await RenderCoordinator.done();\n\n const devInput = getDevInput(originMap)!;\n devInput.value = 'http://localhost:8080';\n devInput.dispatchEvent(new Event('input'));\n\n const prodInput = getProdInput(originMap)!;\n prodInput.value = 'https://example.com';\n prodInput.dispatchEvent(new Event('input'));\n\n await RenderCoordinator.done();\n\n getConfirmButton(originMap)!.click();\n\n await RenderCoordinator.done();\n\n const mappings = getOriginMappings(originMap);\n assert.deepEqual(mappings, [\n ['http://localhost:8080', 'https://example.com', undefined],\n ]);\n });\n\n it('should ignore cancelled entries', async () => {\n const originMap = createOriginMap();\n originMap.startCreation();\n await RenderCoordinator.done();\n\n const devInput = getDevInput(originMap)!;\n devInput.value = 'http://localhost:8080';\n devInput.dispatchEvent(new Event('input'));\n\n const prodInput = getProdInput(originMap)!;\n prodInput.value = 'https://example.com';\n prodInput.dispatchEvent(new Event('input'));\n\n await RenderCoordinator.done();\n\n getCancelButton(originMap)!.click();\n\n await RenderCoordinator.done();\n\n const mappings = getOriginMappings(originMap);\n assert.deepEqual(mappings, []);\n assert.isNull(getDevInput(originMap));\n assert.isNull(getProdInput(originMap));\n });\n\n it('should coerce inputs to origin values', async () => {\n const originMap = createOriginMap();\n originMap.startCreation();\n await RenderCoordinator.done();\n\n const devInput = getDevInput(originMap)!;\n devInput.value = 'http://localhost:8080/path/to/something';\n devInput.dispatchEvent(new Event('input'));\n\n const prodInput = getProdInput(originMap)!;\n prodInput.value = 'https://example.com?hello';\n prodInput.dispatchEvent(new Event('input'));\n\n await RenderCoordinator.done();\n\n getConfirmButton(originMap)!.click();\n\n await RenderCoordinator.done();\n\n const mappings = getOriginMappings(originMap);\n assert.deepEqual(mappings, [\n ['http://localhost:8080', 'https://example.com', undefined],\n ]);\n });\n\n it('should show errors from invalid origins', async () => {\n const originMap = createOriginMap();\n originMap.startCreation();\n await RenderCoordinator.done();\n\n const devInput = getDevInput(originMap)!;\n devInput.value = 'bad-origin';\n devInput.dispatchEvent(new Event('input'));\n\n const prodInput = getProdInput(originMap)!;\n prodInput.value = 'jj**Sdafsdf';\n prodInput.dispatchEvent(new Event('input'));\n\n await RenderCoordinator.done();\n\n const errors = getValidationErrors(originMap);\n assert.deepEqual(errors, '\"bad-origin\" is not a valid origin or URL.\\n\"jj**Sdafsdf\" is not a valid origin or URL.');\n\n const confirmButton = getConfirmButton(originMap);\n assert.isTrue(confirmButton!.shadowRoot?.querySelector('button')!.disabled);\n });\n\n it('should show warning for duplicate dev origin', async () => {\n cruxManager.getConfigSetting().set({\n enabled: true,\n override: '',\n originMappings: [\n {developmentOrigin: 'http://localhost:8080', productionOrigin: 'https://example.com'},\n ],\n });\n\n const originMap = createOriginMap();\n originMap.startCreation();\n await RenderCoordinator.done();\n\n const devInput = getDevInput(originMap)!;\n devInput.value = 'http://localhost:8080';\n devInput.dispatchEvent(new Event('input'));\n\n const prodInput = getProdInput(originMap)!;\n prodInput.value = 'https://example2.com';\n prodInput.dispatchEvent(new Event('input'));\n\n await RenderCoordinator.done();\n\n const errors = getValidationErrors(originMap);\n assert.deepEqual(errors, '\"http://localhost:8080\" is already mapped to a production origin.');\n\n const confirmButton = getConfirmButton(originMap);\n assert.isFalse(confirmButton!.shadowRoot?.querySelector('button')!.disabled);\n });\n});\n"]} \ No newline at end of file diff --git a/public/panels/timeline/components/RelatedInsightChips.test.js b/public/panels/timeline/components/RelatedInsightChips.test.js index ffe947dfb..ea134a3ff 100644 --- a/public/panels/timeline/components/RelatedInsightChips.test.js +++ b/public/panels/timeline/components/RelatedInsightChips.test.js @@ -3,9 +3,8 @@ // found in the LICENSE file. import { dispatchClickEvent, getCleanTextContentFromElements, renderElementIntoDOM, } from '../../../testing/DOMHelpers.js'; import { describeWithEnvironment } from '../../../testing/EnvironmentHelpers.js'; -import * as Coordinator from '../../../ui/components/render_coordinator/render_coordinator.js'; +import * as RenderCoordinator from '../../../ui/components/render_coordinator/render_coordinator.js'; import * as Components from './components.js'; -const coordinator = Coordinator.RenderCoordinator.RenderCoordinator.instance(); describeWithEnvironment('RelatedInsightChips', () => { // Event doesn't matter, so let's keep this test quick and avoid parsing a trace. const FAKE_EVENT = {}; @@ -14,7 +13,7 @@ describeWithEnvironment('RelatedInsightChips', () => { renderElementIntoDOM(component); component.activeEvent = FAKE_EVENT; component.eventToRelatedInsightsMap = new Map(); - await coordinator.done(); + await RenderCoordinator.done(); assert.isOk(component.shadowRoot); assert.strictEqual(component.shadowRoot.childElementCount, 0); }); @@ -30,7 +29,7 @@ describeWithEnvironment('RelatedInsightChips', () => { renderElementIntoDOM(component); component.activeEvent = FAKE_EVENT; component.eventToRelatedInsightsMap = relatedMap; - await coordinator.done(); + await RenderCoordinator.done(); assert.isOk(component.shadowRoot); const chips = component.shadowRoot.querySelectorAll('li.insight-chip'); assert.lengthOf(chips, 1); @@ -52,7 +51,7 @@ describeWithEnvironment('RelatedInsightChips', () => { renderElementIntoDOM(component); component.activeEvent = FAKE_EVENT; component.eventToRelatedInsightsMap = relatedMap; - await coordinator.done(); + await RenderCoordinator.done(); assert.isOk(component.shadowRoot); const regularChips = component.shadowRoot.querySelectorAll('li.insight-chip'); assert.lengthOf(regularChips, 1); @@ -76,7 +75,7 @@ describeWithEnvironment('RelatedInsightChips', () => { renderElementIntoDOM(component); component.activeEvent = FAKE_EVENT; component.eventToRelatedInsightsMap = relatedMap; - await coordinator.done(); + await RenderCoordinator.done(); assert.isOk(component.shadowRoot); const button = component.shadowRoot.querySelector('button'); assert.isOk(button); diff --git a/public/panels/timeline/components/RelatedInsightChips.test.js.map b/public/panels/timeline/components/RelatedInsightChips.test.js.map index fc9eded19..d4771fa8f 100644 --- a/public/panels/timeline/components/RelatedInsightChips.test.js.map +++ b/public/panels/timeline/components/RelatedInsightChips.test.js.map @@ -1 +1 @@ -{"version":3,"file":"RelatedInsightChips.test.js","sourceRoot":"","sources":["../../../../../../../front_end/panels/timeline/components/RelatedInsightChips.test.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAG7B,OAAO,EACL,kBAAkB,EAClB,+BAA+B,EAC/B,oBAAoB,GACrB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAC,uBAAuB,EAAC,MAAM,wCAAwC,CAAC;AAC/E,OAAO,KAAK,WAAW,MAAM,iEAAiE,CAAC;AAE/F,OAAO,KAAK,UAAU,MAAM,iBAAiB,CAAC;AAE9C,MAAM,WAAW,GAAG,WAAW,CAAC,iBAAiB,CAAC,iBAAiB,CAAC,QAAQ,EAAE,CAAC;AAE/E,uBAAuB,CAAC,qBAAqB,EAAE,GAAG,EAAE;IAClD,iFAAiF;IACjF,MAAM,UAAU,GAAG,EAAyC,CAAC;IAE7D,EAAE,CAAC,8CAA8C,EAAE,KAAK,IAAI,EAAE;QAC5D,MAAM,SAAS,GAAG,IAAI,UAAU,CAAC,mBAAmB,CAAC,mBAAmB,EAAE,CAAC;QAC3E,oBAAoB,CAAC,SAAS,CAAC,CAAC;QAChC,SAAS,CAAC,WAAW,GAAG,UAAU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AC,CAAC,CAAC;IACpE,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,gEAAgE,EAAE,KAAK,IAAI,EAAE;QAC9E,MAAM,YAAY,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC;QAClC,MAAM,cAAc,GAAkD;YACpE,YAAY,EAAE,mBAAmB;YACjC,eAAe,EAAE,GAAG,EAAE,CAAC,YAAY,EAAE;YACrC,QAAQ,EAAE,EAAE;SACb,CAAC;QACF,MAAM,UAAU,GAA6D,IAAI,GAAG,EAAE,CAAC;QACvF,UAAU,CAAC,GAAG,CAAC,UAAU,EAAE,CAAC,cAAc,CAAC,CAAC,CAAC;QAE7C,MAAM,SAAS,GAAG,IAAI,UAAU,CAAC,mBAAmB,CAAC,mBAAmB,EAAE,CAAC;QAC3E,oBAAoB,CAAC,SAAS,CAAC,CAAC;QAChC,SAAS,CAAC,WAAW,GAAG,UAAU,CAAC;QACnC,SAAS,CAAC,yBAAyB,GAAG,UAAU,CAAC;QACjD,MAAM,WAAW,CAAC,IAAI,EAAE,CAAC;QACzB,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC;QAElC,MAAM,MAAM,GAAG,SAAS,CAAC,UAAU,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC;QAC5D,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QACpB,kBAAkB,CAAC,MAAM,CAAC,CAAC;QAC3B,MAAM,CAAC,MAAM,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC;IACrC,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["// Copyright 2024 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport type * as Trace from '../../../models/trace/trace.js';\nimport {\n dispatchClickEvent,\n getCleanTextContentFromElements,\n renderElementIntoDOM,\n} from '../../../testing/DOMHelpers.js';\nimport {describeWithEnvironment} from '../../../testing/EnvironmentHelpers.js';\nimport * as Coordinator from '../../../ui/components/render_coordinator/render_coordinator.js';\n\nimport * as Components from './components.js';\n\nconst coordinator = Coordinator.RenderCoordinator.RenderCoordinator.instance();\n\ndescribeWithEnvironment('RelatedInsightChips', () => {\n // Event doesn't matter, so let's keep this test quick and avoid parsing a trace.\n const FAKE_EVENT = {} as unknown as Trace.Types.Events.Event;\n\n it('renders nothing if the event has no insights', async () => {\n const component = new Components.RelatedInsightChips.RelatedInsightChips();\n renderElementIntoDOM(component);\n component.activeEvent = FAKE_EVENT;\n component.eventToRelatedInsightsMap = new Map();\n await coordinator.done();\n assert.isOk(component.shadowRoot);\n assert.strictEqual(component.shadowRoot.childElementCount, 0);\n });\n\n it('renders a chip for each insight the given event is associated with', async () => {\n const relatedInsight: Components.RelatedInsightChips.RelatedInsight = {\n insightLabel: 'Some fake insight',\n activateInsight: () => {},\n messages: [],\n };\n const relatedMap: Components.RelatedInsightChips.EventToRelatedInsightsMap = new Map();\n relatedMap.set(FAKE_EVENT, [relatedInsight]);\n\n const component = new Components.RelatedInsightChips.RelatedInsightChips();\n renderElementIntoDOM(component);\n component.activeEvent = FAKE_EVENT;\n component.eventToRelatedInsightsMap = relatedMap;\n await coordinator.done();\n assert.isOk(component.shadowRoot);\n\n const chips = component.shadowRoot.querySelectorAll('li.insight-chip');\n assert.lengthOf(chips, 1);\n const text = getCleanTextContentFromElements(chips[0], 'button .insight-label');\n assert.deepEqual(text, ['Some fake insight']);\n });\n\n it('renders any insight messages', async () => {\n const relatedInsight: Components.RelatedInsightChips.RelatedInsight = {\n insightLabel: 'Some fake insight',\n activateInsight: () => {},\n messages: [\n 'Message 1',\n 'Message 2',\n ],\n };\n const relatedMap: Components.RelatedInsightChips.EventToRelatedInsightsMap = new Map();\n relatedMap.set(FAKE_EVENT, [relatedInsight]);\n\n const component = new Components.RelatedInsightChips.RelatedInsightChips();\n renderElementIntoDOM(component);\n component.activeEvent = FAKE_EVENT;\n component.eventToRelatedInsightsMap = relatedMap;\n await coordinator.done();\n assert.isOk(component.shadowRoot);\n\n const regularChips = component.shadowRoot.querySelectorAll('li.insight-chip');\n assert.lengthOf(regularChips, 1);\n\n const optimizationChips = component.shadowRoot.querySelectorAll('li.insight-message-box');\n assert.lengthOf(optimizationChips, 2);\n\n const text1 = getCleanTextContentFromElements(optimizationChips[0], 'button');\n assert.deepEqual(text1, ['Insight: Some fake insight Message 1']);\n const text2 = getCleanTextContentFromElements(optimizationChips[1], 'button');\n assert.deepEqual(text2, ['Insight: Some fake insight Message 2']);\n });\n\n it('calls the activateInsight function when the insight is clicked', async () => {\n const activateStub = sinon.stub();\n const relatedInsight: Components.RelatedInsightChips.RelatedInsight = {\n insightLabel: 'Some fake insight',\n activateInsight: () => activateStub(),\n messages: [],\n };\n const relatedMap: Components.RelatedInsightChips.EventToRelatedInsightsMap = new Map();\n relatedMap.set(FAKE_EVENT, [relatedInsight]);\n\n const component = new Components.RelatedInsightChips.RelatedInsightChips();\n renderElementIntoDOM(component);\n component.activeEvent = FAKE_EVENT;\n component.eventToRelatedInsightsMap = relatedMap;\n await coordinator.done();\n assert.isOk(component.shadowRoot);\n\n const button = component.shadowRoot.querySelector('button');\n assert.isOk(button);\n dispatchClickEvent(button);\n assert.isTrue(activateStub.called);\n });\n});\n"]} \ No newline at end of file +{"version":3,"file":"RelatedInsightChips.test.js","sourceRoot":"","sources":["../../../../../../../front_end/panels/timeline/components/RelatedInsightChips.test.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAG7B,OAAO,EACL,kBAAkB,EAClB,+BAA+B,EAC/B,oBAAoB,GACrB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAC,uBAAuB,EAAC,MAAM,wCAAwC,CAAC;AAC/E,OAAO,KAAK,iBAAiB,MAAM,iEAAiE,CAAC;AAErG,OAAO,KAAK,UAAU,MAAM,iBAAiB,CAAC;AAE9C,uBAAuB,CAAC,qBAAqB,EAAE,GAAG,EAAE;IAClD,iFAAiF;IACjF,MAAM,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esContent":["// Copyright 2024 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport type * as Trace from '../../../models/trace/trace.js';\nimport {\n dispatchClickEvent,\n getCleanTextContentFromElements,\n renderElementIntoDOM,\n} from '../../../testing/DOMHelpers.js';\nimport {describeWithEnvironment} from '../../../testing/EnvironmentHelpers.js';\nimport * as RenderCoordinator from '../../../ui/components/render_coordinator/render_coordinator.js';\n\nimport * as Components from './components.js';\n\ndescribeWithEnvironment('RelatedInsightChips', () => {\n // Event doesn't matter, so let's keep this test quick and avoid parsing a trace.\n const FAKE_EVENT = {} as unknown as Trace.Types.Events.Event;\n\n it('renders nothing if the event has no insights', async () => {\n const component = new Components.RelatedInsightChips.RelatedInsightChips();\n renderElementIntoDOM(component);\n component.activeEvent = FAKE_EVENT;\n component.eventToRelatedInsightsMap = new Map();\n await RenderCoordinator.done();\n assert.isOk(component.shadowRoot);\n assert.strictEqual(component.shadowRoot.childElementCount, 0);\n });\n\n it('renders a chip for each insight the given event is associated with', async () => {\n const relatedInsight: Components.RelatedInsightChips.RelatedInsight = {\n insightLabel: 'Some fake insight',\n activateInsight: () => {},\n messages: [],\n };\n const relatedMap: Components.RelatedInsightChips.EventToRelatedInsightsMap = new Map();\n relatedMap.set(FAKE_EVENT, [relatedInsight]);\n\n const component = new Components.RelatedInsightChips.RelatedInsightChips();\n renderElementIntoDOM(component);\n component.activeEvent = FAKE_EVENT;\n component.eventToRelatedInsightsMap = relatedMap;\n await RenderCoordinator.done();\n assert.isOk(component.shadowRoot);\n\n const chips = component.shadowRoot.querySelectorAll('li.insight-chip');\n assert.lengthOf(chips, 1);\n const text = getCleanTextContentFromElements(chips[0], 'button .insight-label');\n assert.deepEqual(text, ['Some fake insight']);\n });\n\n it('renders any insight messages', async () => {\n const relatedInsight: Components.RelatedInsightChips.RelatedInsight = {\n insightLabel: 'Some fake insight',\n activateInsight: () => {},\n messages: [\n 'Message 1',\n 'Message 2',\n ],\n };\n const relatedMap: Components.RelatedInsightChips.EventToRelatedInsightsMap = new Map();\n relatedMap.set(FAKE_EVENT, [relatedInsight]);\n\n const component = new Components.RelatedInsightChips.RelatedInsightChips();\n renderElementIntoDOM(component);\n component.activeEvent = FAKE_EVENT;\n component.eventToRelatedInsightsMap = relatedMap;\n await RenderCoordinator.done();\n assert.isOk(component.shadowRoot);\n\n const regularChips = component.shadowRoot.querySelectorAll('li.insight-chip');\n assert.lengthOf(regularChips, 1);\n\n const optimizationChips = component.shadowRoot.querySelectorAll('li.insight-message-box');\n assert.lengthOf(optimizationChips, 2);\n\n const text1 = getCleanTextContentFromElements(optimizationChips[0], 'button');\n assert.deepEqual(text1, ['Insight: Some fake insight Message 1']);\n const text2 = getCleanTextContentFromElements(optimizationChips[1], 'button');\n assert.deepEqual(text2, ['Insight: Some fake insight Message 2']);\n });\n\n it('calls the activateInsight function when the insight is clicked', async () => {\n const activateStub = sinon.stub();\n const relatedInsight: Components.RelatedInsightChips.RelatedInsight = {\n insightLabel: 'Some fake insight',\n activateInsight: () => activateStub(),\n messages: [],\n };\n const relatedMap: Components.RelatedInsightChips.EventToRelatedInsightsMap = new Map();\n relatedMap.set(FAKE_EVENT, [relatedInsight]);\n\n const component = new Components.RelatedInsightChips.RelatedInsightChips();\n renderElementIntoDOM(component);\n component.activeEvent = FAKE_EVENT;\n component.eventToRelatedInsightsMap = relatedMap;\n await RenderCoordinator.done();\n assert.isOk(component.shadowRoot);\n\n const button = component.shadowRoot.querySelector('button');\n assert.isOk(button);\n dispatchClickEvent(button);\n assert.isTrue(activateStub.called);\n });\n});\n"]} \ No newline at end of file diff --git a/public/panels/timeline/components/SidebarAnnotationsTab.test.js b/public/panels/timeline/components/SidebarAnnotationsTab.test.js index c2089dea7..4b919455a 100644 --- a/public/panels/timeline/components/SidebarAnnotationsTab.test.js +++ b/public/panels/timeline/components/SidebarAnnotationsTab.test.js @@ -5,15 +5,14 @@ import * as Trace from '../../../models/trace/trace.js'; import { renderElementIntoDOM } from '../../../testing/DOMHelpers.js'; import { describeWithEnvironment } from '../../../testing/EnvironmentHelpers.js'; import { TraceLoader } from '../../../testing/TraceLoader.js'; -import * as Coordinator from '../../../ui/components/render_coordinator/render_coordinator.js'; +import * as RenderCoordinator from '../../../ui/components/render_coordinator/render_coordinator.js'; import * as TimelineComponents from './components.js'; describeWithEnvironment('SidebarAnnotationsTab', () => { const { SidebarAnnotationsTab } = TimelineComponents.SidebarAnnotationsTab; - const coordinator = Coordinator.RenderCoordinator.RenderCoordinator.instance(); it('renders annotations tab in the sidebar', async () => { const component = new SidebarAnnotationsTab(); renderElementIntoDOM(component); - await coordinator.done(); + await RenderCoordinator.done(); assert.isNotNull(component.shadowRoot); const annotationsWrapperElement = component.shadowRoot.querySelector('.annotations'); assert.isNotNull(annotationsWrapperElement); @@ -49,7 +48,7 @@ describeWithEnvironment('SidebarAnnotationsTab', () => { component.annotations = [entryLabelAnnotation, entryLabelAnnotation2, labelledTimeRangeAnnotation]; component.annotationEntryToColorMap = colorsMap; assert.isNotNull(component.shadowRoot); - await coordinator.done(); + await RenderCoordinator.done(); const annotationsWrapperElement = component.shadowRoot.querySelector('.annotations'); assert.isNotNull(annotationsWrapperElement); const deleteButton = component.shadowRoot.querySelector('.bin-icon'); @@ -57,9 +56,9 @@ describeWithEnvironment('SidebarAnnotationsTab', () => { // Ensure annotations identifiers and labels are rendered for all 3 annotations - // 2 entry labels and 1 labelled time range const annotationEntryIdentifierElements = component.shadowRoot.querySelectorAll('.annotation-identifier'); - assert.strictEqual(annotationEntryIdentifierElements.length, 3); + assert.lengthOf(annotationEntryIdentifierElements, 3); const annotationEntryLabelElements = component.shadowRoot.querySelectorAll('.label'); - assert.strictEqual(annotationEntryIdentifierElements.length, 3); + assert.lengthOf(annotationEntryIdentifierElements, 3); assert.strictEqual(annotationEntryLabelElements[0].innerText, 'Entry Label 1'); assert.strictEqual(annotationEntryIdentifierElements[0].style['backgroundColor'], 'rgb(82, 252, 3)'); assert.strictEqual(annotationEntryLabelElements[1].innerText, 'Entry Label 2'); @@ -77,7 +76,7 @@ describeWithEnvironment('SidebarAnnotationsTab', () => { }; component.annotations = [entryLabelAnnotation]; assert.isNotNull(component.shadowRoot); - await coordinator.done(); + await RenderCoordinator.done(); const deleteButton = component.shadowRoot.querySelector('.delete-button'); assert.isNotNull(deleteButton); assert.strictEqual(deleteButton.getAttribute('aria-label'), 'Delete annotation: A "thread_name" event annotated with the text "Entry Label 1"'); @@ -96,7 +95,7 @@ describeWithEnvironment('SidebarAnnotationsTab', () => { const component = new SidebarAnnotationsTab(); renderElementIntoDOM(component); component.annotations = [annotation]; - await coordinator.done(); + await RenderCoordinator.done(); assert.isNotNull(component.shadowRoot); const label = component.shadowRoot.querySelector('.annotation-identifier'); assert.strictEqual(label?.innerText, 'private-aggregation-test.js (shared-storage-demo-content-producer.web.app)'); @@ -116,7 +115,7 @@ describeWithEnvironment('SidebarAnnotationsTab', () => { label: 'Entry Label 1', }; component.annotations = [entryLabelAnnotation]; - await coordinator.done(); + await RenderCoordinator.done(); assert.isNotNull(component.shadowRoot); const deleteButton = component.shadowRoot.querySelector('.delete-button'); assert.isNotNull(deleteButton); @@ -142,14 +141,14 @@ describeWithEnvironment('SidebarAnnotationsTab', () => { }; component.annotations = [entryLabelAnnotation, entryLabelAnnotation2]; assert.isNotNull(component.shadowRoot); - await coordinator.done(); + await RenderCoordinator.done(); const annotationsWrapperElement = component.shadowRoot.querySelector('.annotations'); assert.isNotNull(annotationsWrapperElement); // Ensure there are 2 labels and their entry identifiers and labels and rendered const annotationIdentifierElements = component.shadowRoot.querySelectorAll('.annotation-identifier'); - assert.strictEqual(annotationIdentifierElements.length, 2); + assert.lengthOf(annotationIdentifierElements, 2); let annotationLabelElements = component.shadowRoot.querySelectorAll('.label'); - assert.strictEqual(annotationIdentifierElements.length, 2); + assert.lengthOf(annotationIdentifierElements, 2); assert.strictEqual(annotationLabelElements[0].innerText, 'Entry Label 1'); assert.strictEqual(annotationLabelElements[1].innerText, 'Entry Label 2'); // Update the labels and add a range annotation @@ -165,10 +164,10 @@ describeWithEnvironment('SidebarAnnotationsTab', () => { label: 'Labelled Time Range', }; component.annotations = [entryLabelAnnotation, entryLabelAnnotation2, labelledTimeRangeAnnotation]; - await coordinator.done(); + await RenderCoordinator.done(); annotationLabelElements = component.shadowRoot.querySelectorAll('.label'); // Ensure the labels changed to new ones and a labbel range was added - assert.strictEqual(annotationLabelElements.length, 3); + assert.lengthOf(annotationLabelElements, 3); assert.strictEqual(annotationLabelElements[0].innerText, 'New Entry Label 1'); assert.strictEqual(annotationLabelElements[1].innerText, 'New Entry Label 2'); assert.strictEqual(annotationLabelElements[2].innerText, 'Labelled Time Range'); @@ -191,12 +190,12 @@ describeWithEnvironment('SidebarAnnotationsTab', () => { }; component.annotations = [entryLabelAnnotation, entriesLink]; assert.isNotNull(component.shadowRoot); - await coordinator.done(); + await RenderCoordinator.done(); const annotationsWrapperElement = component.shadowRoot.querySelector('.annotations'); assert.isNotNull(annotationsWrapperElement); // Ensure there is only one annotation displayed const annotationIdentifierElements = component.shadowRoot.querySelectorAll('.annotation-identifier'); - assert.strictEqual(annotationIdentifierElements.length, 1); + assert.lengthOf(annotationIdentifierElements, 1); }); it('displays multiple not started annotations if they are not different entries', async function () { const component = new SidebarAnnotationsTab(); @@ -217,12 +216,12 @@ describeWithEnvironment('SidebarAnnotationsTab', () => { }; component.annotations = [entryLabelAnnotation, entriesLink]; assert.isNotNull(component.shadowRoot); - await coordinator.done(); + await RenderCoordinator.done(); const annotationsWrapperElement = component.shadowRoot.querySelector('.annotations'); assert.isNotNull(annotationsWrapperElement); // Ensure both annotations are displayed const annotationIdentifierElements = component.shadowRoot.querySelectorAll('.annotation-identifier'); - assert.strictEqual(annotationIdentifierElements.length, 2); + assert.lengthOf(annotationIdentifierElements, 2); }); }); //# sourceMappingURL=SidebarAnnotationsTab.test.js.map \ No newline at end of file diff --git a/public/panels/timeline/components/SidebarAnnotationsTab.test.js.map b/public/panels/timeline/components/SidebarAnnotationsTab.test.js.map index 2e534355e..5d66f4af6 100644 --- a/public/panels/timeline/components/SidebarAnnotationsTab.test.js.map +++ b/public/panels/timeline/components/SidebarAnnotationsTab.test.js.map @@ -1 +1 @@ -{"version":3,"file":"SidebarAnnotationsTab.test.js","sourceRoot":"","sources":["../../../../../../../front_end/panels/timeline/components/SidebarAnnotationsTab.test.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,KAAK,KAAK,MAAM,gCAAgC,CAAC;AACxD,OAAO,EAAC,oBAAoB,EAAC,MAAM,gCAAgC,CAAC;AACpE,OAAO,EAAC,uBAAuB,EAAC,MAAM,wCAAwC,CAAC;AAC/E,OAAO,EAAC,WAAW,EAAC,MAAM,iCAAiC,CAAC;AAC5D,OAAO,KAAK,WAAW,MAAM,iEAAiE,CAAC;AAE/F,OAAO,KAAK,kBAAkB,MAAM,iBAAiB,CAAC;AAEtD,uBAAuB,CAAC,uBAAuB,EAAE,GAAG,EAAE;IACpD,MAAM,EAAC,qBAAqB,EAAC,GAAG,kBAAkB,CAAC,qBAAqB,CAAC;IACzE,MAAM,WAAW,GAAG,WAAW,CAAC,iBAAiB,CAAC,iBAAiB,CAAC,QAAQ,EAAE,CAAC;IAE/E,EAAE,CAAC,wCAAwC,EAAE,KAAK,IAAI,EAAE;QACtD,MAAM,SAAS,GAAG,IAAI,qBAAqB,EAAE,CAAC;QAC9C,oBAAoB,CAAC,SAAS,CAAC,CAAC;QAEhC,MAAM,WAAW,CAAC,IAAI,EAAE,CAAC;QAEzB,MAAM,CAAC,SAAS,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC;QACvC,MAAM,yBAAyB,GAAG,SAAS,CAAC,UAAU,CAAC,aAAa,CAAc,cAAc,CAAC,CAAC;QAClG,MAAM,CAAC,SAAS,CAAC,yBAAyB,CAAC,CAAC;IAC9C,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,yCAAyC,EAAE,KAAK;Q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AAW,CAAC,SAAS,CAAC,IAAI,EAAE,eAAe,CAAC,CAAC;QAC9E,oBAAoB,CAAC,SAAS,CAAC,CAAC;QAEhC,+DAA+D;QAC/D,MAAM,oBAAoB,GAAgC;YACxD,IAAI,EAAE,aAAa;YACnB,KAAK,EAAE,kBAAkB,CAAC,CAAC,CAAC;YAC5B,KAAK,EAAE,EAAE;SACV,CAAC;QAEF,yEAAyE;QACzE,iFAAiF;QACjF,MAAM,WAAW,GAAgC;YAC/C,IAAI,EAAE,cAAc;YACpB,SAAS,EAAE,kBAAkB,CAAC,CAAC,CAAC;YAChC,KAAK,qFAAwD;SAC9D,CAAC;QAEF,SAAS,CAAC,WAAW,GAAG,CAAC,oBAAoB,EAAE,WAAW,CAAC,CAAC;QAC5D,MAAM,CAAC,SAAS,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC;QAEvC,MAAM,WAAW,CAAC,IAAI,EAAE,CAAC;QAEzB,MAAM,yBAAyB,GAAG,SAAS,CAAC,UAAU,CAAC,aAAa,CAAc,cAAc,CAAC,CAAC;QAClG,MAAM,CAAC,SAAS,CAAC,yBAAyB,CAAC,CAAC;QAE5C,wCAAwC;QACxC,MAAM,4BAA4B,GAAG,SAAS,CAAC,UAAU,CAAC,gBAAgB,CAAc,wBAAwB,CAAC,CAAC;QAClH,MAAM,CAAC,WAAW,CAAC,4BAA4B,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;IAC7D,CAAC,CAAC,CAAC;AAEL,CAAC,CAAC,CAAC","sourcesContent":["// Copyright 2024 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport * as Trace from '../../../models/trace/trace.js';\nimport {renderElementIntoDOM} from '../../../testing/DOMHelpers.js';\nimport {describeWithEnvironment} from '../../../testing/EnvironmentHelpers.js';\nimport {TraceLoader} from '../../../testing/TraceLoader.js';\nimport * as Coordinator from '../../../ui/components/render_coordinator/render_coordinator.js';\n\nimport * as TimelineComponents from './components.js';\n\ndescribeWithEnvironment('SidebarAnnotationsTab', () => {\n const {SidebarAnnotationsTab} = TimelineComponents.SidebarAnnotationsTab;\n const coordinator = Coordinator.RenderCoordinator.RenderCoordinator.instance();\n\n it('renders annotations tab in the sidebar', async () => {\n const component = new SidebarAnnotationsTab();\n renderElementIntoDOM(component);\n\n await coordinator.done();\n\n assert.isNotNull(component.shadowRoot);\n const annotationsWrapperElement = component.shadowRoot.querySelector('.annotations');\n assert.isNotNull(annotationsWrapperElement);\n });\n\n it('renders annotations list in the sidebar', async function() {\n const component = new SidebarAnnotationsTab();\n const defaultTraceEvents = await TraceLoader.rawEvents(null, 'basic.json.gz');\n renderElementIntoDOM(component);\n\n // Create Entry Label annotations\n const entryLabelAnnotation: Trace.Types.File.Annotation = {\n type: 'ENTRY_LABEL',\n entry: defaultTraceEvents[0],\n label: 'Entry Label 1',\n };\n\n const entryLabelAnnotation2: Trace.Types.File.Annotation = {\n type: 'ENTRY_LABEL',\n entry: defaultTraceEvents[1],\n label: 'Entry Label 2',\n };\n\n const labelledTimeRangeAnnotation: Trace.Types.File.Annotation = {\n type: 'TIME_RANGE',\n bounds: {\n min: Trace.Types.Timing.MicroSeconds(0),\n max: Trace.Types.Timing.MicroSeconds(10),\n range: Trace.Types.Timing.MicroSeconds(10),\n },\n label: 'Labelled Time Range',\n };\n\n const colorsMap = new Map([\n [entryLabelAnnotation.entry, 'rgb(82, 252, 3)'],\n [entryLabelAnnotation2.entry, '#fc039d'],\n ]);\n\n component.annotations = [entryLabelAnnotation, entryLabelAnnotation2, labelledTimeRangeAnnotation];\n component.annotationEntryToColorMap = colorsMap;\n\n assert.isNotNull(component.shadowRoot);\n\n await coordinator.done();\n\n const annotationsWrapperElement = component.shadowRoot.querySelector('.annotations');\n assert.isNotNull(annotationsWrapperElement);\n\n const deleteButton = component.shadowRoot.querySelector('.bin-icon');\n assert.isNotNull(deleteButton);\n\n // Ensure annotations identifiers and labels are rendered for all 3 annotations -\n // 2 entry labels and 1 labelled time range\n const annotationEntryIdentifierElements =\n component.shadowRoot.querySelectorAll('.annotation-identifier');\n assert.strictEqual(annotationEntryIdentifierElements.length, 3);\n\n const annotationEntryLabelElements = component.shadowRoot.querySelectorAll('.label');\n assert.strictEqual(annotationEntryIdentifierElements.length, 3);\n\n assert.strictEqual(annotationEntryLabelElements[0].innerText, 'Entry Label 1');\n assert.strictEqual(annotationEntryIdentifierElements[0].style['backgroundColor'], 'rgb(82, 252, 3)');\n assert.strictEqual(annotationEntryLabelElements[1].innerText, 'Entry Label 2');\n assert.strictEqual(annotationEntryIdentifierElements[1].style['backgroundColor'], 'rgb(252, 3, 157)');\n assert.strictEqual(annotationEntryLabelElements[2].innerText, 'Labelled Time Range');\n });\n\n it('gives the delete button accessible labels', async function() {\n const component = new SidebarAnnotationsTab();\n const defaultTraceEvents = await TraceLoader.rawEvents(null, 'basic.json.gz');\n renderElementIntoDOM(component);\n\n const entryLabelAnnotation: Trace.Types.File.Annotation = {\n type: 'ENTRY_LABEL',\n entry: defaultTraceEvents[0],\n label: 'Entry Label 1',\n };\n component.annotations = [entryLabelAnnotation];\n assert.isNotNull(component.shadowRoot);\n await coordinator.done();\n\n const deleteButton = component.shadowRoot.querySelector('.delete-button');\n assert.isNotNull(deleteButton);\n assert.strictEqual(\n deleteButton.getAttribute('aria-label'),\n 'Delete annotation: A \"thread_name\" event annotated with the text \"Entry Label 1\"');\n });\n\n it('uses the URL for displaying network event labels and truncates it', async function() {\n const {parsedTrace} = await TraceLoader.traceEngine(this, 'web-dev-with-commit.json.gz');\n const event = parsedTrace.NetworkRequests.byTime.find(event => {\n return event.args.data.url.includes('private-aggregation-test');\n });\n assert.isOk(event);\n const annotation: Trace.Types.File.EntryLabelAnnotation = {\n type: 'ENTRY_LABEL',\n entry: event,\n label: 'hello world',\n };\n const component = new SidebarAnnotationsTab();\n renderElementIntoDOM(component);\n component.annotations = [annotation];\n await coordinator.done();\n\n assert.isNotNull(component.shadowRoot);\n\n const label = component.shadowRoot.querySelector('.annotation-identifier');\n assert.strictEqual(label?.innerText, 'private-aggregation-test.js (shared-storage-demo-content-producer.web.app)');\n });\n\n it('dispatches RemoveAnnotation Events when delete annotation button is clicked', async function() {\n const component = new SidebarAnnotationsTab();\n const defaultTraceEvents = await TraceLoader.rawEvents(null, 'basic.json.gz');\n renderElementIntoDOM(component);\n\n let removeAnnotationEventFired = false;\n component.addEventListener('removeannotation', () => {\n removeAnnotationEventFired = true;\n });\n\n // Create Entry Label annotation\n const entryLabelAnnotation: Trace.Types.File.Annotation = {\n type: 'ENTRY_LABEL',\n entry: defaultTraceEvents[0],\n label: 'Entry Label 1',\n };\n\n component.annotations = [entryLabelAnnotation];\n await coordinator.done();\n assert.isNotNull(component.shadowRoot);\n\n const deleteButton = component.shadowRoot.querySelector('.delete-button');\n assert.isNotNull(deleteButton);\n // Make sure the remove annotation event is not fired before clicking the button\n assert.isFalse(removeAnnotationEventFired);\n\n deleteButton.dispatchEvent(new MouseEvent('click'));\n assert.isTrue(removeAnnotationEventFired);\n });\n\n it('updates annotations list in the sidebar when a new list is passed in', async function() {\n const component = new SidebarAnnotationsTab();\n const defaultTraceEvents = await TraceLoader.rawEvents(null, 'basic.json.gz');\n renderElementIntoDOM(component);\n\n // Create Entry Label Annotation\n const entryLabelAnnotation: Trace.Types.File.Annotation = {\n type: 'ENTRY_LABEL',\n entry: defaultTraceEvents[0],\n label: 'Entry Label 1',\n };\n\n const entryLabelAnnotation2: Trace.Types.File.Annotation = {\n type: 'ENTRY_LABEL',\n entry: defaultTraceEvents[1],\n label: 'Entry Label 2',\n };\n\n component.annotations = [entryLabelAnnotation, entryLabelAnnotation2];\n assert.isNotNull(component.shadowRoot);\n\n await coordinator.done();\n\n const annotationsWrapperElement = component.shadowRoot.querySelector('.annotations');\n assert.isNotNull(annotationsWrapperElement);\n\n // Ensure there are 2 labels and their entry identifiers and labels and rendered\n const annotationIdentifierElements = component.shadowRoot.querySelectorAll('.annotation-identifier');\n assert.strictEqual(annotationIdentifierElements.length, 2);\n let annotationLabelElements = component.shadowRoot.querySelectorAll('.label');\n assert.strictEqual(annotationIdentifierElements.length, 2);\n\n assert.strictEqual(annotationLabelElements[0].innerText, 'Entry Label 1');\n assert.strictEqual(annotationLabelElements[1].innerText, 'Entry Label 2');\n\n // Update the labels and add a range annotation\n entryLabelAnnotation.label = 'New Entry Label 1';\n entryLabelAnnotation2.label = 'New Entry Label 2';\n\n const labelledTimeRangeAnnotation: Trace.Types.File.Annotation = {\n type: 'TIME_RANGE',\n bounds: {\n min: Trace.Types.Timing.MicroSeconds(0),\n max: Trace.Types.Timing.MicroSeconds(10),\n range: Trace.Types.Timing.MicroSeconds(10),\n },\n label: 'Labelled Time Range',\n };\n\n component.annotations = [entryLabelAnnotation, entryLabelAnnotation2, labelledTimeRangeAnnotation];\n await coordinator.done();\n\n annotationLabelElements = component.shadowRoot.querySelectorAll('.label');\n\n // Ensure the labels changed to new ones and a labbel range was added\n assert.strictEqual(annotationLabelElements.length, 3);\n assert.strictEqual(annotationLabelElements[0].innerText, 'New Entry Label 1');\n assert.strictEqual(annotationLabelElements[1].innerText, 'New Entry Label 2');\n assert.strictEqual(annotationLabelElements[2].innerText, 'Labelled Time Range');\n });\n\n it('does not display multiple not started annotations for one entry', async function() {\n const component = new SidebarAnnotationsTab();\n const defaultTraceEvents = await TraceLoader.rawEvents(null, 'basic.json.gz');\n renderElementIntoDOM(component);\n\n // Create Empty Entry Label Annotation (considered not started)\n const entryLabelAnnotation: Trace.Types.File.Annotation = {\n type: 'ENTRY_LABEL',\n entry: defaultTraceEvents[0],\n label: '',\n };\n\n // Create Entries link that only has 'to' entry (considered not started)\n const entriesLink: Trace.Types.File.Annotation = {\n type: 'ENTRIES_LINK',\n entryFrom: defaultTraceEvents[0],\n state: Trace.Types.File.EntriesLinkState.CREATION_NOT_STARTED,\n };\n\n component.annotations = [entryLabelAnnotation, entriesLink];\n assert.isNotNull(component.shadowRoot);\n\n await coordinator.done();\n\n const annotationsWrapperElement = component.shadowRoot.querySelector('.annotations');\n assert.isNotNull(annotationsWrapperElement);\n\n // Ensure there is only one annotation displayed\n const annotationIdentifierElements = component.shadowRoot.querySelectorAll('.annotation-identifier');\n assert.strictEqual(annotationIdentifierElements.length, 1);\n });\n\n it('displays multiple not started annotations if they are not different entries', async function() {\n const component = new SidebarAnnotationsTab();\n const defaultTraceEvents = await TraceLoader.rawEvents(null, 'basic.json.gz');\n renderElementIntoDOM(component);\n\n // Create Empty Entry Label Annotation (considered not started)\n const entryLabelAnnotation: Trace.Types.File.Annotation = {\n type: 'ENTRY_LABEL',\n entry: defaultTraceEvents[0],\n label: '',\n };\n\n // Create Entries link that only has 'to' entry (considered not started).\n // Not started link is on a different entry than the other not started annotation\n const entriesLink: Trace.Types.File.Annotation = {\n type: 'ENTRIES_LINK',\n entryFrom: defaultTraceEvents[1],\n state: Trace.Types.File.EntriesLinkState.CREATION_NOT_STARTED,\n };\n\n component.annotations = [entryLabelAnnotation, entriesLink];\n assert.isNotNull(component.shadowRoot);\n\n await coordinator.done();\n\n const annotationsWrapperElement = component.shadowRoot.querySelector('.annotations');\n assert.isNotNull(annotationsWrapperElement);\n\n // Ensure both annotations are displayed\n const annotationIdentifierElements = component.shadowRoot.querySelectorAll('.annotation-identifier');\n assert.strictEqual(annotationIdentifierElements.length, 2);\n });\n\n});\n"]} \ No newline at end of file +{"version":3,"file":"SidebarAnnotationsTab.test.js","sourceRoot":"","sources":["../../../../../../../front_end/panels/timeline/components/SidebarAnnotationsTab.test.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,KAAK,KAAK,MAAM,gCAAgC,CAAC;AACxD,OAAO,EAAC,oBAAoB,EAAC,MAAM,gCAAgC,CAAC;AACpE,OAAO,EAAC,uBAAuB,EAAC,MAAM,wCAAwC,CAAC;AAC/E,OAAO,EAAC,WAAW,EAAC,MAAM,iCAAiC,CAAC;AAC5D,OAAO,KAAK,iBAAiB,MAAM,iEAAiE,CAA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AC,SAAS,CAAC,yBAAyB,CAAC,CAAC;QAE5C,wCAAwC;QACxC,MAAM,4BAA4B,GAAG,SAAS,CAAC,UAAU,CAAC,gBAAgB,CAAc,wBAAwB,CAAC,CAAC;QAClH,MAAM,CAAC,QAAQ,CAAC,4BAA4B,EAAE,CAAC,CAAC,CAAC;IACnD,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["// Copyright 2024 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport * as Trace from '../../../models/trace/trace.js';\nimport {renderElementIntoDOM} from '../../../testing/DOMHelpers.js';\nimport {describeWithEnvironment} from '../../../testing/EnvironmentHelpers.js';\nimport {TraceLoader} from '../../../testing/TraceLoader.js';\nimport * as RenderCoordinator from '../../../ui/components/render_coordinator/render_coordinator.js';\n\nimport * as TimelineComponents from './components.js';\n\ndescribeWithEnvironment('SidebarAnnotationsTab', () => {\n const {SidebarAnnotationsTab} = TimelineComponents.SidebarAnnotationsTab;\n it('renders annotations tab in the sidebar', async () => {\n const component = new SidebarAnnotationsTab();\n renderElementIntoDOM(component);\n\n await RenderCoordinator.done();\n\n assert.isNotNull(component.shadowRoot);\n const annotationsWrapperElement = component.shadowRoot.querySelector('.annotations');\n assert.isNotNull(annotationsWrapperElement);\n });\n\n it('renders annotations list in the sidebar', async function() {\n const component = new SidebarAnnotationsTab();\n const defaultTraceEvents = await TraceLoader.rawEvents(null, 'basic.json.gz');\n renderElementIntoDOM(component);\n\n // Create Entry Label annotations\n const entryLabelAnnotation: Trace.Types.File.Annotation = {\n type: 'ENTRY_LABEL',\n entry: defaultTraceEvents[0],\n label: 'Entry Label 1',\n };\n\n const entryLabelAnnotation2: Trace.Types.File.Annotation = {\n type: 'ENTRY_LABEL',\n entry: defaultTraceEvents[1],\n label: 'Entry Label 2',\n };\n\n const labelledTimeRangeAnnotation: Trace.Types.File.Annotation = {\n type: 'TIME_RANGE',\n bounds: {\n min: Trace.Types.Timing.MicroSeconds(0),\n max: Trace.Types.Timing.MicroSeconds(10),\n range: Trace.Types.Timing.MicroSeconds(10),\n },\n label: 'Labelled Time Range',\n };\n\n const colorsMap = new Map([\n [entryLabelAnnotation.entry, 'rgb(82, 252, 3)'],\n [entryLabelAnnotation2.entry, '#fc039d'],\n ]);\n\n component.annotations = [entryLabelAnnotation, entryLabelAnnotation2, labelledTimeRangeAnnotation];\n component.annotationEntryToColorMap = colorsMap;\n\n assert.isNotNull(component.shadowRoot);\n\n await RenderCoordinator.done();\n\n const annotationsWrapperElement = component.shadowRoot.querySelector('.annotations');\n assert.isNotNull(annotationsWrapperElement);\n\n const deleteButton = component.shadowRoot.querySelector('.bin-icon');\n assert.isNotNull(deleteButton);\n\n // Ensure annotations identifiers and labels are rendered for all 3 annotations -\n // 2 entry labels and 1 labelled time range\n const annotationEntryIdentifierElements =\n component.shadowRoot.querySelectorAll('.annotation-identifier');\n assert.lengthOf(annotationEntryIdentifierElements, 3);\n\n const annotationEntryLabelElements = component.shadowRoot.querySelectorAll('.label');\n assert.lengthOf(annotationEntryIdentifierElements, 3);\n\n assert.strictEqual(annotationEntryLabelElements[0].innerText, 'Entry Label 1');\n assert.strictEqual(annotationEntryIdentifierElements[0].style['backgroundColor'], 'rgb(82, 252, 3)');\n assert.strictEqual(annotationEntryLabelElements[1].innerText, 'Entry Label 2');\n assert.strictEqual(annotationEntryIdentifierElements[1].style['backgroundColor'], 'rgb(252, 3, 157)');\n assert.strictEqual(annotationEntryLabelElements[2].innerText, 'Labelled Time Range');\n });\n\n it('gives the delete button accessible labels', async function() {\n const component = new SidebarAnnotationsTab();\n const defaultTraceEvents = await TraceLoader.rawEvents(null, 'basic.json.gz');\n renderElementIntoDOM(component);\n\n const entryLabelAnnotation: Trace.Types.File.Annotation = {\n type: 'ENTRY_LABEL',\n entry: defaultTraceEvents[0],\n label: 'Entry Label 1',\n };\n component.annotations = [entryLabelAnnotation];\n assert.isNotNull(component.shadowRoot);\n await RenderCoordinator.done();\n\n const deleteButton = component.shadowRoot.querySelector('.delete-button');\n assert.isNotNull(deleteButton);\n assert.strictEqual(\n deleteButton.getAttribute('aria-label'),\n 'Delete annotation: A \"thread_name\" event annotated with the text \"Entry Label 1\"');\n });\n\n it('uses the URL for displaying network event labels and truncates it', async function() {\n const {parsedTrace} = await TraceLoader.traceEngine(this, 'web-dev-with-commit.json.gz');\n const event = parsedTrace.NetworkRequests.byTime.find(event => {\n return event.args.data.url.includes('private-aggregation-test');\n });\n assert.isOk(event);\n const annotation: Trace.Types.File.EntryLabelAnnotation = {\n type: 'ENTRY_LABEL',\n entry: event,\n label: 'hello world',\n };\n const component = new SidebarAnnotationsTab();\n renderElementIntoDOM(component);\n component.annotations = [annotation];\n await RenderCoordinator.done();\n\n assert.isNotNull(component.shadowRoot);\n\n const label = component.shadowRoot.querySelector('.annotation-identifier');\n assert.strictEqual(label?.innerText, 'private-aggregation-test.js (shared-storage-demo-content-producer.web.app)');\n });\n\n it('dispatches RemoveAnnotation Events when delete annotation button is clicked', async function() {\n const component = new SidebarAnnotationsTab();\n const defaultTraceEvents = await TraceLoader.rawEvents(null, 'basic.json.gz');\n renderElementIntoDOM(component);\n\n let removeAnnotationEventFired = false;\n component.addEventListener('removeannotation', () => {\n removeAnnotationEventFired = true;\n });\n\n // Create Entry Label annotation\n const entryLabelAnnotation: Trace.Types.File.Annotation = {\n type: 'ENTRY_LABEL',\n entry: defaultTraceEvents[0],\n label: 'Entry Label 1',\n };\n\n component.annotations = [entryLabelAnnotation];\n await RenderCoordinator.done();\n assert.isNotNull(component.shadowRoot);\n\n const deleteButton = component.shadowRoot.querySelector('.delete-button');\n assert.isNotNull(deleteButton);\n // Make sure the remove annotation event is not fired before clicking the button\n assert.isFalse(removeAnnotationEventFired);\n\n deleteButton.dispatchEvent(new MouseEvent('click'));\n assert.isTrue(removeAnnotationEventFired);\n });\n\n it('updates annotations list in the sidebar when a new list is passed in', async function() {\n const component = new SidebarAnnotationsTab();\n const defaultTraceEvents = await TraceLoader.rawEvents(null, 'basic.json.gz');\n renderElementIntoDOM(component);\n\n // Create Entry Label Annotation\n const entryLabelAnnotation: Trace.Types.File.Annotation = {\n type: 'ENTRY_LABEL',\n entry: defaultTraceEvents[0],\n label: 'Entry Label 1',\n };\n\n const entryLabelAnnotation2: Trace.Types.File.Annotation = {\n type: 'ENTRY_LABEL',\n entry: defaultTraceEvents[1],\n label: 'Entry Label 2',\n };\n\n component.annotations = [entryLabelAnnotation, entryLabelAnnotation2];\n assert.isNotNull(component.shadowRoot);\n\n await RenderCoordinator.done();\n\n const annotationsWrapperElement = component.shadowRoot.querySelector('.annotations');\n assert.isNotNull(annotationsWrapperElement);\n\n // Ensure there are 2 labels and their entry identifiers and labels and rendered\n const annotationIdentifierElements = component.shadowRoot.querySelectorAll('.annotation-identifier');\n assert.lengthOf(annotationIdentifierElements, 2);\n let annotationLabelElements = component.shadowRoot.querySelectorAll('.label');\n assert.lengthOf(annotationIdentifierElements, 2);\n\n assert.strictEqual(annotationLabelElements[0].innerText, 'Entry Label 1');\n assert.strictEqual(annotationLabelElements[1].innerText, 'Entry Label 2');\n\n // Update the labels and add a range annotation\n entryLabelAnnotation.label = 'New Entry Label 1';\n entryLabelAnnotation2.label = 'New Entry Label 2';\n\n const labelledTimeRangeAnnotation: Trace.Types.File.Annotation = {\n type: 'TIME_RANGE',\n bounds: {\n min: Trace.Types.Timing.MicroSeconds(0),\n max: Trace.Types.Timing.MicroSeconds(10),\n range: Trace.Types.Timing.MicroSeconds(10),\n },\n label: 'Labelled Time Range',\n };\n\n component.annotations = [entryLabelAnnotation, entryLabelAnnotation2, labelledTimeRangeAnnotation];\n await RenderCoordinator.done();\n\n annotationLabelElements = component.shadowRoot.querySelectorAll('.label');\n\n // Ensure the labels changed to new ones and a labbel range was added\n assert.lengthOf(annotationLabelElements, 3);\n assert.strictEqual(annotationLabelElements[0].innerText, 'New Entry Label 1');\n assert.strictEqual(annotationLabelElements[1].innerText, 'New Entry Label 2');\n assert.strictEqual(annotationLabelElements[2].innerText, 'Labelled Time Range');\n });\n\n it('does not display multiple not started annotations for one entry', async function() {\n const component = new SidebarAnnotationsTab();\n const defaultTraceEvents = await TraceLoader.rawEvents(null, 'basic.json.gz');\n renderElementIntoDOM(component);\n\n // Create Empty Entry Label Annotation (considered not started)\n const entryLabelAnnotation: Trace.Types.File.Annotation = {\n type: 'ENTRY_LABEL',\n entry: defaultTraceEvents[0],\n label: '',\n };\n\n // Create Entries link that only has 'to' entry (considered not started)\n const entriesLink: Trace.Types.File.Annotation = {\n type: 'ENTRIES_LINK',\n entryFrom: defaultTraceEvents[0],\n state: Trace.Types.File.EntriesLinkState.CREATION_NOT_STARTED,\n };\n\n component.annotations = [entryLabelAnnotation, entriesLink];\n assert.isNotNull(component.shadowRoot);\n\n await RenderCoordinator.done();\n\n const annotationsWrapperElement = component.shadowRoot.querySelector('.annotations');\n assert.isNotNull(annotationsWrapperElement);\n\n // Ensure there is only one annotation displayed\n const annotationIdentifierElements = component.shadowRoot.querySelectorAll('.annotation-identifier');\n assert.lengthOf(annotationIdentifierElements, 1);\n });\n\n it('displays multiple not started annotations if they are not different entries', async function() {\n const component = new SidebarAnnotationsTab();\n const defaultTraceEvents = await TraceLoader.rawEvents(null, 'basic.json.gz');\n renderElementIntoDOM(component);\n\n // Create Empty Entry Label Annotation (considered not started)\n const entryLabelAnnotation: Trace.Types.File.Annotation = {\n type: 'ENTRY_LABEL',\n entry: defaultTraceEvents[0],\n label: '',\n };\n\n // Create Entries link that only has 'to' entry (considered not started).\n // Not started link is on a different entry than the other not started annotation\n const entriesLink: Trace.Types.File.Annotation = {\n type: 'ENTRIES_LINK',\n entryFrom: defaultTraceEvents[1],\n state: Trace.Types.File.EntriesLinkState.CREATION_NOT_STARTED,\n };\n\n component.annotations = [entryLabelAnnotation, entriesLink];\n assert.isNotNull(component.shadowRoot);\n\n await RenderCoordinator.done();\n\n const annotationsWrapperElement = component.shadowRoot.querySelector('.annotations');\n assert.isNotNull(annotationsWrapperElement);\n\n // Ensure both annotations are displayed\n const annotationIdentifierElements = component.shadowRoot.querySelectorAll('.annotation-identifier');\n assert.lengthOf(annotationIdentifierElements, 2);\n });\n});\n"]} \ No newline at end of file diff --git a/public/panels/timeline/components/SidebarInsightsTab.test.js b/public/panels/timeline/components/SidebarInsightsTab.test.js index 31a608ee6..8d3c7ab2f 100644 --- a/public/panels/timeline/components/SidebarInsightsTab.test.js +++ b/public/panels/timeline/components/SidebarInsightsTab.test.js @@ -4,9 +4,8 @@ import { renderElementIntoDOM } from '../../../testing/DOMHelpers.js'; import { describeWithEnvironment } from '../../../testing/EnvironmentHelpers.js'; import { TraceLoader } from '../../../testing/TraceLoader.js'; -import * as Coordinator from '../../../ui/components/render_coordinator/render_coordinator.js'; +import * as RenderCoordinator from '../../../ui/components/render_coordinator/render_coordinator.js'; import * as Components from './components.js'; -const coordinator = Coordinator.RenderCoordinator.RenderCoordinator.instance(); describeWithEnvironment('SidebarInsightsTab', () => { it('renders a list of insights per navigation in the sidebar', async function () { const { parsedTrace, insights } = await TraceLoader.traceEngine(this, 'multiple-navigations.json.gz'); @@ -14,7 +13,7 @@ describeWithEnvironment('SidebarInsightsTab', () => { renderElementIntoDOM(component); component.parsedTrace = parsedTrace; component.insights = insights; - await coordinator.done(); + await RenderCoordinator.done(); assert.isOk(component.shadowRoot); const navigationURLs = Array.from(component.shadowRoot.querySelectorAll('details > summary')).map(elem => elem.title); assert.deepEqual(navigationURLs, [ diff --git a/public/panels/timeline/components/SidebarInsightsTab.test.js.map b/public/panels/timeline/components/SidebarInsightsTab.test.js.map index e5e654d01..f4300ba37 100644 --- a/public/panels/timeline/components/SidebarInsightsTab.test.js.map +++ b/public/panels/timeline/components/SidebarInsightsTab.test.js.map @@ -1 +1 @@ -{"version":3,"file":"SidebarInsightsTab.test.js","sourceRoot":"","sources":["../../../../../../../front_end/panels/timeline/components/SidebarInsightsTab.test.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,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AAc,mBAAmB,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QACpH,MAAM,CAAC,SAAS,CAAC,mBAAmB,EAAE;YACpC,GAAG;YACH,GAAG;YACH,mBAAmB;YACnB,6HAA6H;SAC9H,CAAC,CAAC;QAEH,MAAM,IAAI,GAAG,SAAS,CAAC,UAAU,CAAC,gBAAgB,CAAC,gDAAgD,CAAC,CAAC;QACrG,MAAM,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,CAAE,+CAA+C;IAC5E,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["// Copyright 2024 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport {renderElementIntoDOM} from '../../../testing/DOMHelpers.js';\nimport {describeWithEnvironment} from '../../../testing/EnvironmentHelpers.js';\nimport {TraceLoader} from '../../../testing/TraceLoader.js';\nimport * as Coordinator from '../../../ui/components/render_coordinator/render_coordinator.js';\n\nimport * as Components from './components.js';\nconst coordinator = Coordinator.RenderCoordinator.RenderCoordinator.instance();\n\ndescribeWithEnvironment('SidebarInsightsTab', () => {\n it('renders a list of insights per navigation in the sidebar', async function() {\n const {parsedTrace, insights} = await TraceLoader.traceEngine(this, 'multiple-navigations.json.gz');\n\n const component = new Components.SidebarInsightsTab.SidebarInsightsTab();\n renderElementIntoDOM(component);\n component.parsedTrace = parsedTrace;\n component.insights = insights;\n await coordinator.done();\n assert.isOk(component.shadowRoot);\n\n const navigationURLs =\n Array.from(component.shadowRoot.querySelectorAll('details > summary')).map(elem => elem.title);\n assert.deepEqual(navigationURLs, [\n 'https://www.google.com/',\n 'https://www.google.com/',\n 'https://www.google.com/imghp?hl=en&ogbl',\n 'https://www.google.com/search?q=dogs&hl=en&tbm=isch&source=hp&biw=738&bih=893&ei=_ER4YPD6D4zka4u2t8gM&oq=dogs&gs_lcp=CgNpbWcQAzICCAAyBQgAELEDMgUIABCxAzICCAAyBQgAELEDMgUIABCxAzIFCAAQsQMyAggAMgUIABCxAzIFCAAQsQM6CAgAELEDEIMBOgQIABADUI4QWOISYPsTaABwAHgAgAEiiAFxkgEBNJgBAKABAaoBC2d3cy13aXotaW1n&sclient=img&ved=0ahUKEwjw6IjVsoDwAhUM8hoKHQvbDckQ4dUDCAc&uact=5',\n ]);\n\n const navigationURLLabels =\n Array.from(component.shadowRoot.querySelectorAll('details > summary')).map(elem => elem.innerText);\n assert.deepEqual(navigationURLLabels, [\n '/',\n '/',\n '/imghp?hl=en&ogbl',\n '/search?q=dogs&hl=en&tbm=isch&source=hp&biw=738&bih=893&ei=_ER4YPD…&oq=dogs&gs_lcp=CgNpbWc…&sclient=img&ved=0ahUKEw…&uact=5',\n ]);\n\n const sets = component.shadowRoot.querySelectorAll('devtools-performance-sidebar-single-navigation');\n assert.lengthOf(sets, 4); // same number of sets as there are navigations\n });\n});\n"]} \ No newline at end of file +{"version":3,"file":"SidebarInsightsTab.test.js","sourceRoot":"","sources":["../../../../../../../front_end/panels/timeline/components/SidebarInsightsTab.test.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,EAAC,oBAAoB,EAAC,MAAM,gCAAgC,CAAC;AACpE,OAAO,EAAC,uBAAuB,EAAC,MAAM,wCAAwC,CAAC;AAC/E,OAAO,EAAC,WAAW,EAAC,MAAM,iCAAiC,CAAC;AAC5D,OAAO,KAAK,iBAAiB,MAAM,iEAAiE,CAAC;AAErG,OAAO,KAAK,UAAU,MAAM,iBAAiB,CAAC;AAC9C,uBAAuB,CAAC,oBAAoB,EAAE,GAAG,EAAE;IACjD,EAAE,CAAC,0DAA0D,EAAE,KAAK;QAClE,MAAM,EAAC,WAAW,EAAE,QAAQ,EAAC,GAAG,MAAM,WAAW,CAAC,WAAW,CAAC,IAAI,EAAE,8BAA8B,CAAC,CAAC;QAEpG,MAAM,SAAS,GAAG,IAAI,UAAU,CAAC,kBAAkB,CAAC,kBAAkB,EAAE,CAAC;QACzE,oBAAoB,CAAC,SAAS,CAAC,CAAC;QAChC,SAAS,CAAC,WAAW,GAAG,WAAW,CAAC;QACpC,SAAS,CAAC,QAAQ,GAAG,QAAQ,CAAC;QAC9B,MAAM,iBAAiB,CAAC,IAAI,EAAE,CAAC;QAC/B,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC;QAElC,MAAM,cAAc,GAChB,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,gBAAgB,CAAc,mBAAmB,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAChH,MAAM,CAAC,SAAS,CAAC,cAAc,EAAE;YAC/B,yBAAyB;YACzB,yBAAyB;YACzB,yCAAyC;YACzC,mWAAmW;SACpW,CAAC,CAAC;QAEH,MAAM,mBAAmB,GACrB,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,gBAAgB,CAAc,mBAAmB,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QACpH,MAAM,CAAC,SAAS,CAAC,mBAAmB,EAAE;YACpC,GAAG;YACH,GAAG;YACH,mBAAmB;YACnB,6HAA6H;SAC9H,CAAC,CAAC;QAEH,MAAM,IAAI,GAAG,SAAS,CAAC,UAAU,CAAC,gBAAgB,CAAC,gDAAgD,CAAC,CAAC;QACrG,MAAM,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,CAAE,+CAA+C;IAC5E,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["// Copyright 2024 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport {renderElementIntoDOM} from '../../../testing/DOMHelpers.js';\nimport {describeWithEnvironment} from '../../../testing/EnvironmentHelpers.js';\nimport {TraceLoader} from '../../../testing/TraceLoader.js';\nimport * as RenderCoordinator from '../../../ui/components/render_coordinator/render_coordinator.js';\n\nimport * as Components from './components.js';\ndescribeWithEnvironment('SidebarInsightsTab', () => {\n it('renders a list of insights per navigation in the sidebar', async function() {\n const {parsedTrace, insights} = await TraceLoader.traceEngine(this, 'multiple-navigations.json.gz');\n\n const component = new Components.SidebarInsightsTab.SidebarInsightsTab();\n renderElementIntoDOM(component);\n component.parsedTrace = parsedTrace;\n component.insights = insights;\n await RenderCoordinator.done();\n assert.isOk(component.shadowRoot);\n\n const navigationURLs =\n Array.from(component.shadowRoot.querySelectorAll('details > summary')).map(elem => elem.title);\n assert.deepEqual(navigationURLs, [\n 'https://www.google.com/',\n 'https://www.google.com/',\n 'https://www.google.com/imghp?hl=en&ogbl',\n 'https://www.google.com/search?q=dogs&hl=en&tbm=isch&source=hp&biw=738&bih=893&ei=_ER4YPD6D4zka4u2t8gM&oq=dogs&gs_lcp=CgNpbWcQAzICCAAyBQgAELEDMgUIABCxAzICCAAyBQgAELEDMgUIABCxAzIFCAAQsQMyAggAMgUIABCxAzIFCAAQsQM6CAgAELEDEIMBOgQIABADUI4QWOISYPsTaABwAHgAgAEiiAFxkgEBNJgBAKABAaoBC2d3cy13aXotaW1n&sclient=img&ved=0ahUKEwjw6IjVsoDwAhUM8hoKHQvbDckQ4dUDCAc&uact=5',\n ]);\n\n const navigationURLLabels =\n Array.from(component.shadowRoot.querySelectorAll('details > summary')).map(elem => elem.innerText);\n assert.deepEqual(navigationURLLabels, [\n '/',\n '/',\n '/imghp?hl=en&ogbl',\n '/search?q=dogs&hl=en&tbm=isch&source=hp&biw=738&bih=893&ei=_ER4YPD…&oq=dogs&gs_lcp=CgNpbWc…&sclient=img&ved=0ahUKEw…&uact=5',\n ]);\n\n const sets = component.shadowRoot.querySelectorAll('devtools-performance-sidebar-single-navigation');\n assert.lengthOf(sets, 4); // same number of sets as there are navigations\n });\n});\n"]} \ No newline at end of file diff --git a/public/panels/timeline/components/SidebarSingleInsightSet.js b/public/panels/timeline/components/SidebarSingleInsightSet.js index b8f42c4ca..9c3c370fd 100644 --- a/public/panels/timeline/components/SidebarSingleInsightSet.js +++ b/public/panels/timeline/components/SidebarSingleInsightSet.js @@ -10,7 +10,7 @@ import { shouldRenderForCategory } from './insights/Helpers.js'; import * as Insights from './insights/insights.js'; import styles from './sidebarSingleInsightSet.css.js'; import { NumberWithUnit } from './Utils.js'; -const { html } = LitHtml; +const { html } = LitHtml.StaticHtml; const UIStrings = { /** *@description title used for a metric value to tell the user about its score classification diff --git a/public/panels/timeline/components/SidebarSingleInsightSet.js.map b/public/panels/timeline/components/SidebarSingleInsightSet.js.map index 398fda235..db9d7851e 100644 --- a/public/panels/timeline/components/SidebarSingleInsightSet.js.map +++ b/public/panels/timeline/components/SidebarSingleInsightSet.js.map @@ -1 +1 @@ -{"version":3,"file":"SidebarSingleInsightSet.js","sourceRoot":"","sources":["../../../../../../../front_end/panels/timeline/components/SidebarSingleInsightSet.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,KAAK,IAAI,MAAM,4BAA4B,CAAC;AACnD,OAAO,KAAK,IAAI,MAAM,4BAA4B,CAAC;AACnD,OAAO,KAAK,KAAK,MAAM,gCAAgC,CAAC;AACxD,OAAO,KAAK,gBAAgB,MAAM,2CAA2C,CAAC;AAC9E,OAAO,KAAK,OAAO,MAAM,kCAAkC,CAAC;AAE5D,OAAO,EAAC,uBAAuB,EAAC,MAAM,uBAAuB,CAAC;AAC9D,OAAO,KAAK,QAAQ,MAAM,wBAAwB,CAAC;AAEnD,OAAO,MAAM,MAAM,kCAAkC,CAAC;AACtD,OAAO,EAAC,cAAc,EAA4B,MAAM,YAAY,CAAC;AAErE,MAAM,EAAC,IAAI,EAAC,GAAG,OAAO,CAAC;AAEvB,MAAM,SAAS,GAAG;IAChB;;;;;OAKG;IACH,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AAI,EAAC,CAAC,CAAC;YACnD,OAAO;QACT,CAAC;QAED,mBAAmB;QACnB,OAAO,CAAC,MAAM,CAAC,IAAI,CAAA;;UAEb,IAAI,CAAC,cAAc,CAAC,aAAa,CAAC;UAClC,IAAI,CAAC,eAAe,CAAC,QAAQ,EAAE,aAAa,CAAC;;OAEhD,EAAE,IAAI,CAAC,OAAO,EAAE,EAAC,IAAI,EAAE,IAAI,EAAC,CAAC,CAAC;QACjC,kBAAkB;IACpB,CAAC;CACF;AAQD,cAAc,CAAC,MAAM,CAAC,gDAAgD,EAAE,uBAAuB,CAAC,CAAC","sourcesContent":["// Copyright 2024 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport * as i18n from '../../../core/i18n/i18n.js';\nimport * as Root from '../../../core/root/root.js';\nimport * as Trace from '../../../models/trace/trace.js';\nimport * as ComponentHelpers from '../../../ui/components/helpers/helpers.js';\nimport * as LitHtml from '../../../ui/lit-html/lit-html.js';\n\nimport {shouldRenderForCategory} from './insights/Helpers.js';\nimport * as Insights from './insights/insights.js';\nimport type {ActiveInsight} from './Sidebar.js';\nimport styles from './sidebarSingleInsightSet.css.js';\nimport {NumberWithUnit, type NumberWithUnitString} from './Utils.js';\n\nconst {html} = LitHtml;\n\nconst UIStrings = {\n /**\n *@description title used for a metric value to tell the user about its score classification\n *@example {INP} PH1\n *@example {1.2s} PH2\n *@example {poor} PH3\n */\n metricScore: '{PH1}: {PH2} {PH3} score',\n /**\n * @description Summary text for an expandable dropdown that contains all insights in a passing state.\n * @example {4} PH1\n */\n passedInsights: 'Passed insights ({PH1})',\n};\nconst str_ = i18n.i18n.registerUIStrings('panels/timeline/components/SidebarSingleInsightSet.ts', UIStrings);\nconst i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);\n\nexport interface SidebarSingleInsightSetData {\n insights: Trace.Insights.Types.TraceInsightSets|null;\n insightSetKey: Trace.Types.Events.NavigationId|null;\n activeCategory: Trace.Insights.Types.InsightCategory;\n activeInsight: ActiveInsight|null;\n}\n\n/**\n * These are WIP Insights that are only shown if the user has turned on the\n * \"enable experimental performance insights\" experiment. This is used to enable\n * us to ship incrementally without turning insights on by default for all\n * users. */\nconst EXPERIMENTAL_INSIGHTS: ReadonlySet = new Set([\n 'FontDisplay',\n 'DOMSize',\n]);\n\ntype InsightNameToComponentMapping =\n Record>>;\n\n/**\n * Every insight (INCLUDING experimental ones).\n *\n * Order does not matter (but keep alphabetized).\n */\nconst INSIGHT_NAME_TO_COMPONENT: InsightNameToComponentMapping = {\n CLSCulprits: Insights.CLSCulprits.CLSCulprits,\n DOMSize: Insights.DOMSize.DOMSize,\n DocumentLatency: Insights.DocumentLatency.DocumentLatency,\n FontDisplay: Insights.FontDisplay.FontDisplay,\n ImageDelivery: Insights.ImageDelivery.ImageDelivery,\n InteractionToNextPaint: Insights.InteractionToNextPaint.InteractionToNextPaint,\n LCPDiscovery: Insights.LCPDiscovery.LCPDiscovery,\n LCPPhases: Insights.LCPPhases.LCPPhases,\n RenderBlocking: Insights.RenderBlocking.RenderBlocking,\n SlowCSSSelector: Insights.SlowCSSSelector.SlowCSSSelector,\n ThirdParties: Insights.ThirdParties.ThirdParties,\n Viewport: Insights.Viewport.Viewport,\n};\n\nexport class SidebarSingleInsightSet extends HTMLElement {\n readonly #shadow = this.attachShadow({mode: 'open'});\n #renderBound = this.#render.bind(this);\n\n #data: SidebarSingleInsightSetData = {\n insights: null,\n insightSetKey: null,\n activeCategory: Trace.Insights.Types.InsightCategory.ALL,\n activeInsight: null,\n };\n\n set data(data: SidebarSingleInsightSetData) {\n this.#data = data;\n void ComponentHelpers.ScheduledRender.scheduleRender(this, this.#renderBound);\n }\n connectedCallback(): void {\n this.#shadow.adoptedStyleSheets = [styles];\n this.#render();\n }\n\n #metricIsVisible(label: 'LCP'|'CLS'|'INP'): boolean {\n if (this.#data.activeCategory === Trace.Insights.Types.InsightCategory.ALL) {\n return true;\n }\n return label === this.#data.activeCategory;\n }\n\n #onClickMetric(traceEvent: Trace.Types.Events.Event): void {\n this.dispatchEvent(new Insights.EventRef.EventReferenceClick(traceEvent));\n }\n\n #renderMetricValue(\n label: 'LCP'|'CLS'|'INP', value: string|NumberWithUnitString,\n classification: Trace.Handlers.ModelHandlers.PageLoadMetrics.ScoreClassification,\n eventToSelectOnClick: Trace.Types.Events.Event|null): LitHtml.LitTemplate {\n const valueText = typeof value === 'string' ? value : value.text;\n const valueDisplay = typeof value === 'string' ? value : value.element;\n\n // NOTE: it is deliberate to use the same value for the title and\n // aria-label; the aria-label is used to give more context to\n // screen-readers, and the title is to aid users who may not know what\n // the red/orange/green classification is, or those who are unable to\n // easily distinguish the visual colour differences.\n // clang-format off\n const title = i18nString(UIStrings.metricScore, {PH1: label, PH2: valueText, PH3: classification});\n\n return this.#metricIsVisible(label) ? html`\n \n ` : LitHtml.nothing;\n // clang-format on\n }\n\n #renderMetrics(insightSetKey: string): LitHtml.TemplateResult {\n const lcp = Trace.Insights.Common.getLCP(this.#data.insights, insightSetKey);\n const cls = Trace.Insights.Common.getCLS(this.#data.insights, insightSetKey);\n const inp = Trace.Insights.Common.getINP(this.#data.insights, insightSetKey);\n\n return html`\n
\n ${\n lcp ? this.#renderMetricValue(\n 'LCP', NumberWithUnit.formatMicroSecondsAsSeconds(lcp.value),\n Trace.Handlers.ModelHandlers.PageLoadMetrics.scoreClassificationForLargestContentfulPaint(lcp.value),\n lcp.event ?? null) :\n LitHtml.nothing}\n ${\n inp ? this.#renderMetricValue(\n 'INP', NumberWithUnit.formatMicroSecondsAsMillisFixed(inp.value),\n Trace.Handlers.ModelHandlers.UserInteractions.scoreClassificationForInteractionToNextPaint(inp.value),\n inp.event) :\n LitHtml.nothing}\n ${\n this.#renderMetricValue(\n 'CLS', cls.value ? cls.value.toFixed(2) : '0',\n Trace.Handlers.ModelHandlers.LayoutShifts.scoreClassificationForLayoutShift(cls.value),\n cls.worstShiftEvent)}\n
\n `;\n }\n\n #renderInsights(\n insightSets: Trace.Insights.Types.TraceInsightSets|null,\n insightSetKey: string,\n ): LitHtml.LitTemplate {\n const includeExperimental = Root.Runtime.experiments.isEnabled(\n Root.Runtime.ExperimentName.TIMELINE_EXPERIMENTAL_INSIGHTS,\n );\n\n const insightSet = insightSets?.get(insightSetKey);\n if (!insightSet) {\n return LitHtml.nothing;\n }\n\n const models = insightSet.model;\n const shownInsights: LitHtml.TemplateResult[] = [];\n const passedInsights: LitHtml.TemplateResult[] = [];\n for (const [name, model] of Object.entries(models)) {\n const componentClass = INSIGHT_NAME_TO_COMPONENT[name as keyof Trace.Insights.Types.InsightModels];\n if (!componentClass) {\n continue;\n }\n\n if (!includeExperimental && EXPERIMENTAL_INSIGHTS.has(name)) {\n continue;\n }\n\n if (!model ||\n !shouldRenderForCategory({activeCategory: this.#data.activeCategory, insightCategory: model.category})) {\n continue;\n }\n\n // clang-format off\n const component = html`
\n <${componentClass.litTagName}\n .selected=${this.#data.activeInsight?.model === model}\n .model=${model}\n .bounds=${insightSet.bounds}\n .insightSetKey=${insightSetKey}\n \n
`;\n // clang-format on\n\n if (model.shouldShow) {\n shownInsights.push(component);\n } else {\n passedInsights.push(component);\n }\n }\n\n // clang-format off\n return html`\n ${shownInsights}\n ${passedInsights.length ? html`\n
\n ${i18nString(UIStrings.passedInsights, {\n PH1: passedInsights.length,\n })}\n ${passedInsights}\n
\n ` : LitHtml.nothing}\n `;\n // clang-format on\n }\n\n #render(): void {\n const {\n insights,\n insightSetKey,\n } = this.#data;\n if (!insights || !insightSetKey) {\n LitHtml.render(html``, this.#shadow, {host: this});\n return;\n }\n\n // clang-format off\n LitHtml.render(html`\n
\n ${this.#renderMetrics(insightSetKey)}\n ${this.#renderInsights(insights, insightSetKey)}\n
\n `, this.#shadow, {host: this});\n // clang-format on\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'devtools-performance-sidebar-single-navigation': SidebarSingleInsightSet;\n }\n}\n\ncustomElements.define('devtools-performance-sidebar-single-navigation', SidebarSingleInsightSet);\n"]} \ No newline at end of file +{"version":3,"file":"SidebarSingleInsightSet.js","sourceRoot":"","sources":["../../../../../../../front_end/panels/timeline/components/SidebarSingleInsightSet.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,KAAK,IAAI,MAAM,4BAA4B,CAAC;AACnD,OAAO,KAAK,IAAI,MAAM,4BAA4B,CAAC;AACnD,OAAO,KAAK,KAAK,MAAM,gCAAgC,CAAC;AACxD,OAAO,KAAK,gBAAgB,MAAM,2CAA2C,CAAC;AAC9E,OAAO,KAAK,OAAO,MAAM,kCAAkC,CAAC;AAE5D,OAAO,EAAC,uBAAuB,EAAC,MAAM,uBAAuB,CAAC;AAC9D,OAAO,KAAK,QAAQ,MAAM,wBAAwB,CAAC;AAEnD,OAAO,MAAM,MAAM,kCAAkC,CAAC;AACtD,OAAO,EAAC,cAAc,EAA4B,MAAM,YAAY,CAAC;AAErE,MAAM,EAAC,IAAI,EAAC,GAAG,OAAO,CAAC,UAAU,CAAC;AAElC,MAAM,SAAS,GAAG;IAChB;;;;;OAKG;IACH,WAAW,EAAE,0BAA0B;IACvC;;;OAGG;IACH,cAAc,EAAE,yBAAyB;CAC1C,CAAC;AACF,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,iBAAiB,CAAC,uDAAuD,EAAE,SAAS,CAAC,CAAC;AAC7G,MAAM,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC;AAStE;;;;YAIY;AACZ,MAAM,qBAAqB,GAAwB,IAAI,GAAG,CAAC;IACzD,aAAa;IACb,SAAS;CACV,CAAC,CAAC;AAKH;;;;GAIG;AACH,MAAM,yBAAyB,GAAkC;IAC/D,WAAW,EAAE,QAAQ,CAAC,WAAW,CAAC,WAAW;IAC7C,OAAO,EAAE,QAAQ,CAAC,OAAO,CAAC,OAAO;IACjC,eAAe,EAAE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,KAAK,CAAC,UAAU,EAAE,CAAC;gBACrB,aAAa,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;YAChC,CAAC;iBAAM,CAAC;gBACN,cAAc,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;YACjC,CAAC;QACH,CAAC;QAED,mBAAmB;QACnB,OAAO,IAAI,CAAA;QACP,aAAa;QACb,cAAc,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAA;;qBAEf,UAAU,CAAC,SAAS,CAAC,cAAc,EAAE;YAC9C,GAAG,EAAE,cAAc,CAAC,MAAM;SAC3B,CAAC;YACA,cAAc;;OAEnB,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO;KACpB,CAAC;QACF,kBAAkB;IACpB,CAAC;IAED,OAAO;QACL,MAAM,EACJ,QAAQ,EACR,aAAa,GACd,GAAG,IAAI,CAAC,KAAK,CAAC;QACf,IAAI,CAAC,QAAQ,IAAI,CAAC,aAAa,EAAE,CAAC;YAChC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAA,EAAE,EAAE,IAAI,CAAC,OAAO,EAAE,EAAC,IAAI,EAAE,IAAI,EAAC,CAAC,CAAC;YACnD,OAAO;QACT,CAAC;QAED,mBAAmB;QACnB,OAAO,CAAC,MAAM,CAAC,IAAI,CAAA;;UAEb,IAAI,CAAC,cAAc,CAAC,aAAa,CAAC;UAClC,IAAI,CAAC,eAAe,CAAC,QAAQ,EAAE,aAAa,CAAC;;OAEhD,EAAE,IAAI,CAAC,OAAO,EAAE,EAAC,IAAI,EAAE,IAAI,EAAC,CAAC,CAAC;QACjC,kBAAkB;IACpB,CAAC;CACF;AAQD,cAAc,CAAC,MAAM,CAAC,gDAAgD,EAAE,uBAAuB,CAAC,CAAC","sourcesContent":["// Copyright 2024 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport * as i18n from '../../../core/i18n/i18n.js';\nimport * as Root from '../../../core/root/root.js';\nimport * as Trace from '../../../models/trace/trace.js';\nimport * as ComponentHelpers from '../../../ui/components/helpers/helpers.js';\nimport * as LitHtml from '../../../ui/lit-html/lit-html.js';\n\nimport {shouldRenderForCategory} from './insights/Helpers.js';\nimport * as Insights from './insights/insights.js';\nimport type {ActiveInsight} from './Sidebar.js';\nimport styles from './sidebarSingleInsightSet.css.js';\nimport {NumberWithUnit, type NumberWithUnitString} from './Utils.js';\n\nconst {html} = LitHtml.StaticHtml;\n\nconst UIStrings = {\n /**\n *@description title used for a metric value to tell the user about its score classification\n *@example {INP} PH1\n *@example {1.2s} PH2\n *@example {poor} PH3\n */\n metricScore: '{PH1}: {PH2} {PH3} score',\n /**\n * @description Summary text for an expandable dropdown that contains all insights in a passing state.\n * @example {4} PH1\n */\n passedInsights: 'Passed insights ({PH1})',\n};\nconst str_ = i18n.i18n.registerUIStrings('panels/timeline/components/SidebarSingleInsightSet.ts', UIStrings);\nconst i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);\n\nexport interface SidebarSingleInsightSetData {\n insights: Trace.Insights.Types.TraceInsightSets|null;\n insightSetKey: Trace.Types.Events.NavigationId|null;\n activeCategory: Trace.Insights.Types.InsightCategory;\n activeInsight: ActiveInsight|null;\n}\n\n/**\n * These are WIP Insights that are only shown if the user has turned on the\n * \"enable experimental performance insights\" experiment. This is used to enable\n * us to ship incrementally without turning insights on by default for all\n * users. */\nconst EXPERIMENTAL_INSIGHTS: ReadonlySet = new Set([\n 'FontDisplay',\n 'DOMSize',\n]);\n\ntype InsightNameToComponentMapping =\n Record>>;\n\n/**\n * Every insight (INCLUDING experimental ones).\n *\n * Order does not matter (but keep alphabetized).\n */\nconst INSIGHT_NAME_TO_COMPONENT: InsightNameToComponentMapping = {\n CLSCulprits: Insights.CLSCulprits.CLSCulprits,\n DOMSize: Insights.DOMSize.DOMSize,\n DocumentLatency: Insights.DocumentLatency.DocumentLatency,\n FontDisplay: Insights.FontDisplay.FontDisplay,\n ImageDelivery: Insights.ImageDelivery.ImageDelivery,\n InteractionToNextPaint: Insights.InteractionToNextPaint.InteractionToNextPaint,\n LCPDiscovery: Insights.LCPDiscovery.LCPDiscovery,\n LCPPhases: Insights.LCPPhases.LCPPhases,\n RenderBlocking: Insights.RenderBlocking.RenderBlocking,\n SlowCSSSelector: Insights.SlowCSSSelector.SlowCSSSelector,\n ThirdParties: Insights.ThirdParties.ThirdParties,\n Viewport: Insights.Viewport.Viewport,\n};\n\nexport class SidebarSingleInsightSet extends HTMLElement {\n readonly #shadow = this.attachShadow({mode: 'open'});\n #renderBound = this.#render.bind(this);\n\n #data: SidebarSingleInsightSetData = {\n insights: null,\n insightSetKey: null,\n activeCategory: Trace.Insights.Types.InsightCategory.ALL,\n activeInsight: null,\n };\n\n set data(data: SidebarSingleInsightSetData) {\n this.#data = data;\n void ComponentHelpers.ScheduledRender.scheduleRender(this, this.#renderBound);\n }\n connectedCallback(): void {\n this.#shadow.adoptedStyleSheets = [styles];\n this.#render();\n }\n\n #metricIsVisible(label: 'LCP'|'CLS'|'INP'): boolean {\n if (this.#data.activeCategory === Trace.Insights.Types.InsightCategory.ALL) {\n return true;\n }\n return label === this.#data.activeCategory;\n }\n\n #onClickMetric(traceEvent: Trace.Types.Events.Event): void {\n this.dispatchEvent(new Insights.EventRef.EventReferenceClick(traceEvent));\n }\n\n #renderMetricValue(\n label: 'LCP'|'CLS'|'INP', value: string|NumberWithUnitString,\n classification: Trace.Handlers.ModelHandlers.PageLoadMetrics.ScoreClassification,\n eventToSelectOnClick: Trace.Types.Events.Event|null): LitHtml.LitTemplate {\n const valueText = typeof value === 'string' ? value : value.text;\n const valueDisplay = typeof value === 'string' ? value : value.element;\n\n // NOTE: it is deliberate to use the same value for the title and\n // aria-label; the aria-label is used to give more context to\n // screen-readers, and the title is to aid users who may not know what\n // the red/orange/green classification is, or those who are unable to\n // easily distinguish the visual colour differences.\n // clang-format off\n const title = i18nString(UIStrings.metricScore, {PH1: label, PH2: valueText, PH3: classification});\n\n return this.#metricIsVisible(label) ? html`\n \n ` : LitHtml.nothing;\n // clang-format on\n }\n\n #renderMetrics(insightSetKey: string): LitHtml.TemplateResult {\n const lcp = Trace.Insights.Common.getLCP(this.#data.insights, insightSetKey);\n const cls = Trace.Insights.Common.getCLS(this.#data.insights, insightSetKey);\n const inp = Trace.Insights.Common.getINP(this.#data.insights, insightSetKey);\n\n return html`\n
\n ${\n lcp ? this.#renderMetricValue(\n 'LCP', NumberWithUnit.formatMicroSecondsAsSeconds(lcp.value),\n Trace.Handlers.ModelHandlers.PageLoadMetrics.scoreClassificationForLargestContentfulPaint(lcp.value),\n lcp.event ?? null) :\n LitHtml.nothing}\n ${\n inp ? this.#renderMetricValue(\n 'INP', NumberWithUnit.formatMicroSecondsAsMillisFixed(inp.value),\n Trace.Handlers.ModelHandlers.UserInteractions.scoreClassificationForInteractionToNextPaint(inp.value),\n inp.event) :\n LitHtml.nothing}\n ${\n this.#renderMetricValue(\n 'CLS', cls.value ? cls.value.toFixed(2) : '0',\n Trace.Handlers.ModelHandlers.LayoutShifts.scoreClassificationForLayoutShift(cls.value),\n cls.worstShiftEvent)}\n
\n `;\n }\n\n #renderInsights(\n insightSets: Trace.Insights.Types.TraceInsightSets|null,\n insightSetKey: string,\n ): LitHtml.LitTemplate {\n const includeExperimental = Root.Runtime.experiments.isEnabled(\n Root.Runtime.ExperimentName.TIMELINE_EXPERIMENTAL_INSIGHTS,\n );\n\n const insightSet = insightSets?.get(insightSetKey);\n if (!insightSet) {\n return LitHtml.nothing;\n }\n\n const models = insightSet.model;\n const shownInsights: LitHtml.TemplateResult[] = [];\n const passedInsights: LitHtml.TemplateResult[] = [];\n for (const [name, model] of Object.entries(models)) {\n const componentClass = INSIGHT_NAME_TO_COMPONENT[name as keyof Trace.Insights.Types.InsightModels];\n if (!componentClass) {\n continue;\n }\n\n if (!includeExperimental && EXPERIMENTAL_INSIGHTS.has(name)) {\n continue;\n }\n\n if (!model ||\n !shouldRenderForCategory({activeCategory: this.#data.activeCategory, insightCategory: model.category})) {\n continue;\n }\n\n // clang-format off\n const component = html`
\n <${componentClass.litTagName}\n .selected=${this.#data.activeInsight?.model === model}\n .model=${model}\n .bounds=${insightSet.bounds}\n .insightSetKey=${insightSetKey}\n \n
`;\n // clang-format on\n\n if (model.shouldShow) {\n shownInsights.push(component);\n } else {\n passedInsights.push(component);\n }\n }\n\n // clang-format off\n return html`\n ${shownInsights}\n ${passedInsights.length ? html`\n
\n ${i18nString(UIStrings.passedInsights, {\n PH1: passedInsights.length,\n })}\n ${passedInsights}\n
\n ` : LitHtml.nothing}\n `;\n // clang-format on\n }\n\n #render(): void {\n const {\n insights,\n insightSetKey,\n } = this.#data;\n if (!insights || !insightSetKey) {\n LitHtml.render(html``, this.#shadow, {host: this});\n return;\n }\n\n // clang-format off\n LitHtml.render(html`\n
\n ${this.#renderMetrics(insightSetKey)}\n ${this.#renderInsights(insights, insightSetKey)}\n
\n `, this.#shadow, {host: this});\n // clang-format on\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'devtools-performance-sidebar-single-navigation': SidebarSingleInsightSet;\n }\n}\n\ncustomElements.define('devtools-performance-sidebar-single-navigation', SidebarSingleInsightSet);\n"]} \ No newline at end of file diff --git a/public/panels/timeline/components/SidebarSingleInsightSet.test.js b/public/panels/timeline/components/SidebarSingleInsightSet.test.js index add81985e..bbedf5e12 100644 --- a/public/panels/timeline/components/SidebarSingleInsightSet.test.js +++ b/public/panels/timeline/components/SidebarSingleInsightSet.test.js @@ -6,9 +6,8 @@ import * as Trace from '../../../models/trace/trace.js'; import { getCleanTextContentFromElements, renderElementIntoDOM } from '../../../testing/DOMHelpers.js'; import { describeWithEnvironment } from '../../../testing/EnvironmentHelpers.js'; import { TraceLoader } from '../../../testing/TraceLoader.js'; -import * as Coordinator from '../../../ui/components/render_coordinator/render_coordinator.js'; +import * as RenderCoordinator from '../../../ui/components/render_coordinator/render_coordinator.js'; import * as Components from './components.js'; -const coordinator = Coordinator.RenderCoordinator.RenderCoordinator.instance(); function getUserVisibleInsights(component) { assert.isOk(component.shadowRoot); return [...component.shadowRoot.querySelectorAll('[data-insight-name]')]; @@ -34,7 +33,7 @@ describeWithEnvironment('SidebarSingleInsightSet', () => { activeCategory: Trace.Insights.Types.InsightCategory.ALL, activeInsight: null, }; - await coordinator.done(); + await RenderCoordinator.done(); const userVisibleTitles = getUserVisibleInsights(component).flatMap(component => { return getCleanTextContentFromElements(component.shadowRoot, '.insight-title'); }); @@ -73,7 +72,7 @@ describeWithEnvironment('SidebarSingleInsightSet', () => { activeCategory: Trace.Insights.Types.InsightCategory.ALL, activeInsight: null, }; - await coordinator.done(); + await RenderCoordinator.done(); const userVisibleTitles = getUserVisibleInsights(component).flatMap(component => { return getCleanTextContentFromElements(component.shadowRoot, '.insight-title'); }); @@ -115,7 +114,7 @@ describeWithEnvironment('SidebarSingleInsightSet', () => { activeCategory: Trace.Insights.Types.InsightCategory.ALL, activeInsight: null, }; - await coordinator.done(); + await RenderCoordinator.done(); const userVisibleTitles = getUserVisibleInsights(component).flatMap(component => { return getCleanTextContentFromElements(component.shadowRoot, '.insight-title'); }); @@ -169,7 +168,7 @@ describeWithEnvironment('SidebarSingleInsightSet', () => { insightSetKey: navigationId, }, }; - await coordinator.done(); + await RenderCoordinator.done(); const expandedInsight = getUserVisibleInsights(component).find(insight => { return insight.selected; }); diff --git a/public/panels/timeline/components/SidebarSingleInsightSet.test.js.map b/public/panels/timeline/components/SidebarSingleInsightSet.test.js.map index 5d72455b0..550f5931d 100644 --- a/public/panels/timeline/components/SidebarSingleInsightSet.test.js.map +++ b/public/panels/timeline/components/SidebarSingleInsightSet.test.js.map @@ -1 +1 @@ -{"version":3,"file":"SidebarSingleInsightSet.test.js","sourceRoot":"","sources":["../../../../../../../front_end/panels/timeline/components/SidebarSingleInsightSet.test.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,KAAK,IAAI,MAAM,4BAA4B,CAAC;AACnD,OAAO,KAAK,KAAK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,EAAE,CAAC;QAEzB,MAAM,eAAe,GAAG,sBAAsB,CAAC,SAAS,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE;YACvE,OAAO,OAAO,CAAC,QAAQ,CAAC;QAC1B,CAAC,CAAC,CAAC;QACH,MAAM,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;QAC7B,MAAM,CAAC,WAAW,CAAC,eAAe,CAAC,KAAK,EAAE,KAAK,EAAE,cAAc,CAAC,CAAC;IACnE,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["// Copyright 2024 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport * as Root from '../../../core/root/root.js';\nimport * as Trace from '../../../models/trace/trace.js';\nimport {getCleanTextContentFromElements, renderElementIntoDOM} from '../../../testing/DOMHelpers.js';\nimport {describeWithEnvironment} from '../../../testing/EnvironmentHelpers.js';\nimport {TraceLoader} from '../../../testing/TraceLoader.js';\nimport * as Coordinator from '../../../ui/components/render_coordinator/render_coordinator.js';\n\nimport * as Components from './components.js';\nimport type * as InsightComponents from './insights/insights.js';\n\ntype BaseInsightComponent =\n InsightComponents.BaseInsightComponent.BaseInsightComponent>;\n\nconst coordinator = Coordinator.RenderCoordinator.RenderCoordinator.instance();\n\nfunction getUserVisibleInsights(component: Components.SidebarSingleInsightSet.SidebarSingleInsightSet):\n BaseInsightComponent[] {\n assert.isOk(component.shadowRoot);\n return [...component.shadowRoot.querySelectorAll('[data-insight-name]')];\n}\n\nfunction getPassedInsights(component: Components.SidebarSingleInsightSet.SidebarSingleInsightSet):\n BaseInsightComponent[] {\n assert.isOk(component.shadowRoot);\n return [...component.shadowRoot.querySelectorAll(\n '.passed-insights-section [data-insight-name]')];\n}\n\ndescribeWithEnvironment('SidebarSingleInsightSet', () => {\n it('renders a list of insights', async function() {\n const {insights} = await TraceLoader.traceEngine(this, 'web-dev-with-commit.json.gz');\n\n assert.isOk(insights);\n // only one navigation in this trace.\n assert.strictEqual(insights.size, 1);\n // This is the navigationID from this trace.\n const navigationId = '8463DF94CD61B265B664E7F768183DE3';\n assert.isTrue(insights.has(navigationId));\n\n const component = new Components.SidebarSingleInsightSet.SidebarSingleInsightSet();\n renderElementIntoDOM(component);\n component.data = {\n insights,\n insightSetKey: navigationId,\n activeCategory: Trace.Insights.Types.InsightCategory.ALL,\n activeInsight: null,\n };\n await coordinator.done();\n\n const userVisibleTitles = getUserVisibleInsights(component).flatMap(component => {\n return getCleanTextContentFromElements(component.shadowRoot!, '.insight-title');\n });\n assert.deepEqual(userVisibleTitles, [\n 'LCP by phase',\n 'LCP request discovery',\n 'Render blocking requests',\n 'Document request latency',\n 'Third parties',\n 'INP by phase',\n 'Layout shift culprits',\n 'Improve image delivery',\n 'Optimize viewport for mobile',\n 'CSS Selector costs',\n ]);\n\n const passedInsightTitles = getPassedInsights(component).flatMap(component => {\n return getCleanTextContentFromElements(component.shadowRoot!, '.insight-title');\n });\n assert.deepEqual(passedInsightTitles, [\n 'INP by phase',\n 'Layout shift culprits',\n 'Improve image delivery',\n 'Optimize viewport for mobile',\n 'CSS Selector costs',\n ]);\n });\n\n it('does not render experimental insights by default', async function() {\n const {parsedTrace, insights} = await TraceLoader.traceEngine(this, 'font-display.json.gz');\n const component = new Components.SidebarSingleInsightSet.SidebarSingleInsightSet();\n renderElementIntoDOM(component);\n const firstNavigation = parsedTrace.Meta.mainFrameNavigations.at(0)?.args.data?.navigationId;\n assert.isOk(firstNavigation);\n component.data = {\n insights,\n insightSetKey: firstNavigation,\n activeCategory: Trace.Insights.Types.InsightCategory.ALL,\n activeInsight: null,\n };\n await coordinator.done();\n const userVisibleTitles = getUserVisibleInsights(component).flatMap(component => {\n return getCleanTextContentFromElements(component.shadowRoot!, '.insight-title');\n });\n // Does not include \"font display\", which is experimental.\n assert.deepEqual(userVisibleTitles, [\n 'LCP by phase',\n 'LCP request discovery',\n 'Layout shift culprits',\n 'Improve image delivery',\n 'Third parties',\n 'INP by phase',\n 'Render blocking requests',\n 'Document request latency',\n 'Optimize viewport for mobile',\n 'CSS Selector costs',\n ]);\n\n const passedInsightTitles = getPassedInsights(component).flatMap(component => {\n return getCleanTextContentFromElements(component.shadowRoot!, '.insight-title');\n });\n // Does not include \"font display\", which is experimental.\n assert.deepEqual(passedInsightTitles, [\n 'INP by phase',\n 'Render blocking requests',\n 'Document request latency',\n 'Optimize viewport for mobile',\n 'CSS Selector costs',\n ]);\n });\n\n it('renders experimental insights if the experiment is turned on', async function() {\n const {parsedTrace, insights} = await TraceLoader.traceEngine(this, 'font-display.json.gz');\n const component = new Components.SidebarSingleInsightSet.SidebarSingleInsightSet();\n Root.Runtime.experiments.enableForTest(\n Root.Runtime.ExperimentName.TIMELINE_EXPERIMENTAL_INSIGHTS,\n );\n renderElementIntoDOM(component);\n const firstNavigation = parsedTrace.Meta.mainFrameNavigations.at(0)?.args.data?.navigationId;\n assert.isOk(firstNavigation);\n component.data = {\n insights,\n insightSetKey: firstNavigation,\n activeCategory: Trace.Insights.Types.InsightCategory.ALL,\n activeInsight: null,\n };\n await coordinator.done();\n const userVisibleTitles = getUserVisibleInsights(component).flatMap(component => {\n return getCleanTextContentFromElements(component.shadowRoot!, '.insight-title');\n });\n // Includes \"font display\", which is experimental.\n assert.deepEqual(userVisibleTitles, [\n 'LCP by phase',\n 'LCP request discovery',\n 'Layout shift culprits',\n 'Improve image delivery',\n 'Font display',\n 'Third parties',\n 'INP by phase',\n 'Render blocking requests',\n 'Document request latency',\n 'Optimize viewport for mobile',\n 'Optimize DOM size',\n 'CSS Selector costs',\n ]);\n\n const passedInsightTitles = getPassedInsights(component).flatMap(component => {\n return getCleanTextContentFromElements(component.shadowRoot!, '.insight-title');\n });\n assert.deepEqual(passedInsightTitles, [\n 'INP by phase',\n 'Render blocking requests',\n 'Document request latency',\n 'Optimize viewport for mobile',\n 'Optimize DOM size',\n 'CSS Selector costs',\n ]);\n });\n\n it('will render the active insight fully', async function() {\n const {insights} = await TraceLoader.traceEngine(this, 'web-dev-with-commit.json.gz');\n\n assert.isOk(insights);\n // only one navigation in this trace.\n assert.strictEqual(insights.size, 1);\n // This is the navigationID from this trace.\n const navigationId = '8463DF94CD61B265B664E7F768183DE3';\n assert.isTrue(insights.has(navigationId));\n\n const model = insights.get(navigationId)?.model.LCPPhases;\n if (!model) {\n throw new Error('missing LCPPhases model');\n }\n\n const component = new Components.SidebarSingleInsightSet.SidebarSingleInsightSet();\n renderElementIntoDOM(component);\n component.data = {\n insights,\n insightSetKey: navigationId,\n activeCategory: Trace.Insights.Types.InsightCategory.ALL,\n activeInsight: {\n model,\n insightSetKey: navigationId,\n },\n };\n await coordinator.done();\n\n const expandedInsight = getUserVisibleInsights(component).find(insight => {\n return insight.selected;\n });\n assert.isOk(expandedInsight);\n assert.strictEqual(expandedInsight.model?.title, 'LCP by phase');\n });\n});\n"]} \ No newline at end of file +{"version":3,"file":"SidebarSingleInsightSet.test.js","sourceRoot":"","sources":["../../../../../../../front_end/panels/timeline/components/SidebarSingleInsightSet.test.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,KAAK,IAAI,MAAM,4BAA4B,CAAC;AACnD,OAAO,KAAK,KAAK,MAAM,gCAAgC,CAAC;AACxD,OAAO,EAAC,+BAA+B,EAAE,oBAAoB,EAAC,MAAM,gCAAgC,CAAC;AACrG,OAAO,EAAC,uBAAuB,EAAC,MAAM,wCAAwC,CAAC;AAC/E,OAAO,EAAC,WAAW,EAAC,MAAM,iCAAiC,CAAC;AAC5D,OAAO,KAAK,iBAAiB,MAAM,iEAAiE,CAAC;AAErG,OAAO,KAAK,UAAU,MAAM,iBAAiB,CAAC;AAM9C,SAAS,sBAAsB,CAAC,SAAqE;IAEnG,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC;IAClC,OAAO,CAAC,GAAG,SAAS,CAAC,UAAU,CAAC,gBAAgB,CAAuB,qBAAqB,CAAC,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AAC,CAAC,CAAC;QACrC,4CAA4C;QAC5C,MAAM,YAAY,GAAG,kCAAkC,CAAC;QACxD,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC,CAAC;QAE1C,MAAM,KAAK,GAAG,QAAQ,CAAC,GAAG,CAAC,YAAY,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;QAC1D,IAAI,CAAC,KAAK,EAAE,CAAC;YACX,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;QAC7C,CAAC;QAED,MAAM,SAAS,GAAG,IAAI,UAAU,CAAC,uBAAuB,CAAC,uBAAuB,EAAE,CAAC;QACnF,oBAAoB,CAAC,SAAS,CAAC,CAAC;QAChC,SAAS,CAAC,IAAI,GAAG;YACf,QAAQ;YACR,aAAa,EAAE,YAAY;YAC3B,cAAc,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,eAAe,CAAC,GAAG;YACxD,aAAa,EAAE;gBACb,KAAK;gBACL,aAAa,EAAE,YAAY;aAC5B;SACF,CAAC;QACF,MAAM,iBAAiB,CAAC,IAAI,EAAE,CAAC;QAE/B,MAAM,eAAe,GAAG,sBAAsB,CAAC,SAAS,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE;YACvE,OAAO,OAAO,CAAC,QAAQ,CAAC;QAC1B,CAAC,CAAC,CAAC;QACH,MAAM,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;QAC7B,MAAM,CAAC,WAAW,CAAC,eAAe,CAAC,KAAK,EAAE,KAAK,EAAE,cAAc,CAAC,CAAC;IACnE,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["// Copyright 2024 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport * as Root from '../../../core/root/root.js';\nimport * as Trace from '../../../models/trace/trace.js';\nimport {getCleanTextContentFromElements, renderElementIntoDOM} from '../../../testing/DOMHelpers.js';\nimport {describeWithEnvironment} from '../../../testing/EnvironmentHelpers.js';\nimport {TraceLoader} from '../../../testing/TraceLoader.js';\nimport * as RenderCoordinator from '../../../ui/components/render_coordinator/render_coordinator.js';\n\nimport * as Components from './components.js';\nimport type * as InsightComponents from './insights/insights.js';\n\ntype BaseInsightComponent =\n InsightComponents.BaseInsightComponent.BaseInsightComponent>;\n\nfunction getUserVisibleInsights(component: Components.SidebarSingleInsightSet.SidebarSingleInsightSet):\n BaseInsightComponent[] {\n assert.isOk(component.shadowRoot);\n return [...component.shadowRoot.querySelectorAll('[data-insight-name]')];\n}\n\nfunction getPassedInsights(component: Components.SidebarSingleInsightSet.SidebarSingleInsightSet):\n BaseInsightComponent[] {\n assert.isOk(component.shadowRoot);\n return [...component.shadowRoot.querySelectorAll(\n '.passed-insights-section [data-insight-name]')];\n}\n\ndescribeWithEnvironment('SidebarSingleInsightSet', () => {\n it('renders a list of insights', async function() {\n const {insights} = await TraceLoader.traceEngine(this, 'web-dev-with-commit.json.gz');\n\n assert.isOk(insights);\n // only one navigation in this trace.\n assert.strictEqual(insights.size, 1);\n // This is the navigationID from this trace.\n const navigationId = '8463DF94CD61B265B664E7F768183DE3';\n assert.isTrue(insights.has(navigationId));\n\n const component = new Components.SidebarSingleInsightSet.SidebarSingleInsightSet();\n renderElementIntoDOM(component);\n component.data = {\n insights,\n insightSetKey: navigationId,\n activeCategory: Trace.Insights.Types.InsightCategory.ALL,\n activeInsight: null,\n };\n await RenderCoordinator.done();\n\n const userVisibleTitles = getUserVisibleInsights(component).flatMap(component => {\n return getCleanTextContentFromElements(component.shadowRoot!, '.insight-title');\n });\n assert.deepEqual(userVisibleTitles, [\n 'LCP by phase',\n 'LCP request discovery',\n 'Render blocking requests',\n 'Document request latency',\n 'Third parties',\n 'INP by phase',\n 'Layout shift culprits',\n 'Improve image delivery',\n 'Optimize viewport for mobile',\n 'CSS Selector costs',\n ]);\n\n const passedInsightTitles = getPassedInsights(component).flatMap(component => {\n return getCleanTextContentFromElements(component.shadowRoot!, '.insight-title');\n });\n assert.deepEqual(passedInsightTitles, [\n 'INP by phase',\n 'Layout shift culprits',\n 'Improve image delivery',\n 'Optimize viewport for mobile',\n 'CSS Selector costs',\n ]);\n });\n\n it('does not render experimental insights by default', async function() {\n const {parsedTrace, insights} = await TraceLoader.traceEngine(this, 'font-display.json.gz');\n const component = new Components.SidebarSingleInsightSet.SidebarSingleInsightSet();\n renderElementIntoDOM(component);\n const firstNavigation = parsedTrace.Meta.mainFrameNavigations.at(0)?.args.data?.navigationId;\n assert.isOk(firstNavigation);\n component.data = {\n insights,\n insightSetKey: firstNavigation,\n activeCategory: Trace.Insights.Types.InsightCategory.ALL,\n activeInsight: null,\n };\n await RenderCoordinator.done();\n const userVisibleTitles = getUserVisibleInsights(component).flatMap(component => {\n return getCleanTextContentFromElements(component.shadowRoot!, '.insight-title');\n });\n // Does not include \"font display\", which is experimental.\n assert.deepEqual(userVisibleTitles, [\n 'LCP by phase',\n 'LCP request discovery',\n 'Layout shift culprits',\n 'Improve image delivery',\n 'Third parties',\n 'INP by phase',\n 'Render blocking requests',\n 'Document request latency',\n 'Optimize viewport for mobile',\n 'CSS Selector costs',\n ]);\n\n const passedInsightTitles = getPassedInsights(component).flatMap(component => {\n return getCleanTextContentFromElements(component.shadowRoot!, '.insight-title');\n });\n // Does not include \"font display\", which is experimental.\n assert.deepEqual(passedInsightTitles, [\n 'INP by phase',\n 'Render blocking requests',\n 'Document request latency',\n 'Optimize viewport for mobile',\n 'CSS Selector costs',\n ]);\n });\n\n it('renders experimental insights if the experiment is turned on', async function() {\n const {parsedTrace, insights} = await TraceLoader.traceEngine(this, 'font-display.json.gz');\n const component = new Components.SidebarSingleInsightSet.SidebarSingleInsightSet();\n Root.Runtime.experiments.enableForTest(\n Root.Runtime.ExperimentName.TIMELINE_EXPERIMENTAL_INSIGHTS,\n );\n renderElementIntoDOM(component);\n const firstNavigation = parsedTrace.Meta.mainFrameNavigations.at(0)?.args.data?.navigationId;\n assert.isOk(firstNavigation);\n component.data = {\n insights,\n insightSetKey: firstNavigation,\n activeCategory: Trace.Insights.Types.InsightCategory.ALL,\n activeInsight: null,\n };\n await RenderCoordinator.done();\n const userVisibleTitles = getUserVisibleInsights(component).flatMap(component => {\n return getCleanTextContentFromElements(component.shadowRoot!, '.insight-title');\n });\n // Includes \"font display\", which is experimental.\n assert.deepEqual(userVisibleTitles, [\n 'LCP by phase',\n 'LCP request discovery',\n 'Layout shift culprits',\n 'Improve image delivery',\n 'Font display',\n 'Third parties',\n 'INP by phase',\n 'Render blocking requests',\n 'Document request latency',\n 'Optimize viewport for mobile',\n 'Optimize DOM size',\n 'CSS Selector costs',\n ]);\n\n const passedInsightTitles = getPassedInsights(component).flatMap(component => {\n return getCleanTextContentFromElements(component.shadowRoot!, '.insight-title');\n });\n assert.deepEqual(passedInsightTitles, [\n 'INP by phase',\n 'Render blocking requests',\n 'Document request latency',\n 'Optimize viewport for mobile',\n 'Optimize DOM size',\n 'CSS Selector costs',\n ]);\n });\n\n it('will render the active insight fully', async function() {\n const {insights} = await TraceLoader.traceEngine(this, 'web-dev-with-commit.json.gz');\n\n assert.isOk(insights);\n // only one navigation in this trace.\n assert.strictEqual(insights.size, 1);\n // This is the navigationID from this trace.\n const navigationId = '8463DF94CD61B265B664E7F768183DE3';\n assert.isTrue(insights.has(navigationId));\n\n const model = insights.get(navigationId)?.model.LCPPhases;\n if (!model) {\n throw new Error('missing LCPPhases model');\n }\n\n const component = new Components.SidebarSingleInsightSet.SidebarSingleInsightSet();\n renderElementIntoDOM(component);\n component.data = {\n insights,\n insightSetKey: navigationId,\n activeCategory: Trace.Insights.Types.InsightCategory.ALL,\n activeInsight: {\n model,\n insightSetKey: navigationId,\n },\n };\n await RenderCoordinator.done();\n\n const expandedInsight = getUserVisibleInsights(component).find(insight => {\n return insight.selected;\n });\n assert.isOk(expandedInsight);\n assert.strictEqual(expandedInsight.model?.title, 'LCP by phase');\n });\n});\n"]} \ No newline at end of file diff --git a/public/panels/timeline/components/Utils.test.js b/public/panels/timeline/components/Utils.test.js index da72d01a5..ee2cbdb2d 100644 --- a/public/panels/timeline/components/Utils.test.js +++ b/public/panels/timeline/components/Utils.test.js @@ -38,12 +38,12 @@ describeWithEnvironment('Utils', () => { assert.deepEqual(NumberWithUnit.parse('[Sek]()100'), { firstPart: '', unitPart: 'Sek', lastPart: '100' }); assert.deepEqual(NumberWithUnit.parse('[Sek]() 100'), { firstPart: '', unitPart: 'Sek', lastPart: ' 100' }); // error cases - assert.deepEqual(NumberWithUnit.parse(''), null); - assert.deepEqual(NumberWithUnit.parse('100s'), null); - assert.deepEqual(NumberWithUnit.parse('100[s]('), null); - assert.deepEqual(NumberWithUnit.parse('100[s]'), null); - assert.deepEqual(NumberWithUnit.parse('100[s'), null); - assert.deepEqual(NumberWithUnit.parse('100 s]('), null); + assert.isNull(NumberWithUnit.parse('')); + assert.isNull(NumberWithUnit.parse('100s')); + assert.isNull(NumberWithUnit.parse('100[s](')); + assert.isNull(NumberWithUnit.parse('100[s]')); + assert.isNull(NumberWithUnit.parse('100[s')); + assert.isNull(NumberWithUnit.parse('100 s](')); }); }); describe('networkResourceCategory', function () { diff --git a/public/panels/timeline/components/Utils.test.js.map b/public/panels/timeline/components/Utils.test.js.map index 464583b62..9ac93cbdd 100644 --- a/public/panels/timeline/components/Utils.test.js.map +++ b/public/panels/timeline/components/Utils.test.js.map @@ -1 +1 @@ -{"version":3,"file":"Utils.test.js","sourceRoot":"","sources":["../../../../../../../front_end/panels/timeline/components/Utils.test.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAI7B,OAAO,EAAC,uBAAuB,EAAC,MAAM,wCAAwC,CAAC;AAC/E,OAAO,EAAC,WAAW,EAAC,MAAM,iCAAiC,CAAC;AAE5D,OAAO,KAAK,KAAK,MAAM,YAAY,CAAC;AAEpC,uBAAuB,CAAC,OAAO,EAAE,GAAG,EAAE;IACpC,QAAQ,CAAC,gBAAg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AAe,CAAC,IAAI,CAAC,CAAC;YAC9F,MAAM,CAAC,WAAW,CAAC,WAAW,CAAC,YAAY,CAAC,mBAAmB,CAAC,CAAC,EAAE,eAAe,CAAC,KAAK,CAAC,CAAC;QAC5F,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["// Copyright 2024 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport * as Protocol from '../../../generated/protocol.js';\nimport type * as Trace from '../../../models/trace/trace.js';\nimport {describeWithEnvironment} from '../../../testing/EnvironmentHelpers.js';\nimport {TraceLoader} from '../../../testing/TraceLoader.js';\n\nimport * as Utils from './Utils.js';\n\ndescribeWithEnvironment('Utils', () => {\n describe('NumberWithUnit', () => {\n const {NumberWithUnit} = Utils;\n\n it('renders number with unit (formatMicroSecondsAsSeconds)', () => {\n const result = NumberWithUnit.formatMicroSecondsAsSeconds(100_000 as Trace.Types.Timing.MicroSeconds);\n assert.strictEqual(result.text, '0.10s');\n assert.strictEqual(result.element.textContent, '0.10s');\n assert.strictEqual(result.element.querySelector('.unit')?.textContent, 's');\n });\n\n it('renders number with unit (formatMicroSecondsAsMillisFixed)', () => {\n const result = NumberWithUnit.formatMicroSecondsAsMillisFixed(100_000 as Trace.Types.Timing.MicroSeconds);\n assert.strictEqual(result.text, '100ms');\n assert.strictEqual(result.element.textContent, '100ms');\n assert.strictEqual(result.element.querySelector('.unit')?.textContent, 'ms');\n });\n\n it('parse', () => {\n // en\n assert.deepEqual(NumberWithUnit.parse('100[s]()'), {firstPart: '100', unitPart: 's', lastPart: ''});\n assert.deepEqual(NumberWithUnit.parse('100 [s]()'), {firstPart: '100 ', unitPart: 's', lastPart: ''});\n\n // Decimal separators\n assert.deepEqual(NumberWithUnit.parse('100.123[ms]()'), {firstPart: '100.123', unitPart: 'ms', lastPart: ''});\n assert.deepEqual(NumberWithUnit.parse('100,2[s]()'), {firstPart: '100,2', unitPart: 's', lastPart: ''});\n\n // zh\n assert.deepEqual(NumberWithUnit.parse('100[毫秒]()'), {firstPart: '100', unitPart: '毫秒', lastPart: ''});\n // zh-Hans-CN-u-nu-hanidec\n assert.deepEqual(NumberWithUnit.parse('一〇〇[毫秒]()'), {firstPart: '一〇〇', unitPart: '毫秒', lastPart: ''});\n\n // ar-SA (RTL language, but the UIString still places the number first in the string)\n assert.deepEqual(\n NumberWithUnit.parse('١٠٠[ملي ثانية]()'), {firstPart: '١٠٠', unitPart: 'ملي ثانية', lastPart: ''});\n\n // ar\n assert.deepEqual(\n NumberWithUnit.parse('100[ملي ثانية]()'), {firstPart: '100', unitPart: 'ملي ثانية', lastPart: ''});\n\n // sw (only one that places unit first)\n assert.deepEqual(NumberWithUnit.parse('[Sek]()100'), {firstPart: '', unitPart: 'Sek', lastPart: '100'});\n assert.deepEqual(NumberWithUnit.parse('[Sek]() 100'), {firstPart: '', unitPart: 'Sek', lastPart: ' 100'});\n\n // error cases\n assert.deepEqual(NumberWithUnit.parse(''), null);\n assert.deepEqual(NumberWithUnit.parse('100s'), null);\n assert.deepEqual(NumberWithUnit.parse('100[s]('), null);\n assert.deepEqual(NumberWithUnit.parse('100[s]'), null);\n assert.deepEqual(NumberWithUnit.parse('100[s'), null);\n assert.deepEqual(NumberWithUnit.parse('100 s]('), null);\n });\n });\n\n describe('networkResourceCategory', function() {\n const {networkResourceCategory, NetworkCategory} = Utils;\n const {ResourceType} = Protocol.Network;\n const getCategory = networkResourceCategory;\n let req: Trace.Types.Events.SyntheticNetworkRequest|undefined;\n\n before(async function() {\n const events = await TraceLoader.fixtureContents(this, 'load-simple.json.gz');\n const {parsedTrace} = await TraceLoader.executeTraceEngineOnFileContents(events);\n req = parsedTrace.NetworkRequests.byId.get('2648544.35');\n });\n\n function tweakRequest(\n mimeType: string, resourceType: Protocol.Network.ResourceType = Protocol.Network.ResourceType.Other):\n Trace.Types.Events.SyntheticNetworkRequest {\n assert.exists(req);\n req.args.data.mimeType = mimeType;\n req.args.data.resourceType = resourceType;\n return req;\n }\n\n it('uses resource type when available', () => {\n assert.strictEqual(getCategory(tweakRequest('text/html', ResourceType.Document)), NetworkCategory.DOC);\n assert.strictEqual(getCategory(tweakRequest('text/css', ResourceType.Stylesheet)), NetworkCategory.CSS);\n assert.strictEqual(getCategory(tweakRequest('image/png', ResourceType.Image)), NetworkCategory.IMG);\n assert.strictEqual(getCategory(tweakRequest('video/webm', ResourceType.Media)), NetworkCategory.MEDIA);\n assert.strictEqual(getCategory(tweakRequest('font/woff2', ResourceType.Font)), NetworkCategory.FONT);\n assert.strictEqual(getCategory(tweakRequest('text/javascript', ResourceType.Script)), NetworkCategory.JS);\n assert.strictEqual(getCategory(tweakRequest('something/unknown', ResourceType.WebSocket)), NetworkCategory.JS);\n assert.strictEqual(getCategory(tweakRequest('something/unknown', ResourceType.Other)), NetworkCategory.OTHER);\n });\n\n it('falls back to mime type for older traces', () => {\n assert.strictEqual(getCategory(tweakRequest('text/html')), NetworkCategory.DOC);\n assert.strictEqual(getCategory(tweakRequest('text/css')), NetworkCategory.CSS);\n assert.strictEqual(getCategory(tweakRequest('image/png')), NetworkCategory.IMG);\n assert.strictEqual(getCategory(tweakRequest('video/webm')), NetworkCategory.MEDIA);\n assert.strictEqual(getCategory(tweakRequest('font/woff2')), NetworkCategory.FONT);\n assert.strictEqual(getCategory(tweakRequest('text/javascript')), NetworkCategory.JS);\n assert.strictEqual(getCategory(tweakRequest('application/javascript')), NetworkCategory.JS);\n assert.strictEqual(getCategory(tweakRequest('application/wasm')), NetworkCategory.WASM);\n assert.strictEqual(getCategory(tweakRequest('application/x-font-woff')), NetworkCategory.FONT);\n assert.strictEqual(getCategory(tweakRequest('application/font-woff2')), NetworkCategory.FONT);\n assert.strictEqual(getCategory(tweakRequest('something/unknown')), NetworkCategory.OTHER);\n });\n });\n});\n"]} \ No newline at end of file +{"version":3,"file":"Utils.test.js","sourceRoot":"","sources":["../../../../../../../front_end/panels/timeline/components/Utils.test.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C,IAAI,CAAC,CAAC;YACxF,MAAM,CAAC,WAAW,CAAC,WAAW,CAAC,YAAY,CAAC,yBAAyB,CAAC,CAAC,EAAE,eAAe,CAAC,IAAI,CAAC,CAAC;YAC/F,MAAM,CAAC,WAAW,CAAC,WAAW,CAAC,YAAY,CAAC,wBAAwB,CAAC,CAAC,EAAE,eAAe,CAAC,IAAI,CAAC,CAAC;YAC9F,MAAM,CAAC,WAAW,CAAC,WAAW,CAAC,YAAY,CAAC,mBAAmB,CAAC,CAAC,EAAE,eAAe,CAAC,KAAK,CAAC,CAAC;QAC5F,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["// Copyright 2024 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport * as Protocol from '../../../generated/protocol.js';\nimport type * as Trace from '../../../models/trace/trace.js';\nimport {describeWithEnvironment} from '../../../testing/EnvironmentHelpers.js';\nimport {TraceLoader} from '../../../testing/TraceLoader.js';\n\nimport * as Utils from './Utils.js';\n\ndescribeWithEnvironment('Utils', () => {\n describe('NumberWithUnit', () => {\n const {NumberWithUnit} = Utils;\n\n it('renders number with unit (formatMicroSecondsAsSeconds)', () => {\n const result = NumberWithUnit.formatMicroSecondsAsSeconds(100_000 as Trace.Types.Timing.MicroSeconds);\n assert.strictEqual(result.text, '0.10s');\n assert.strictEqual(result.element.textContent, '0.10s');\n assert.strictEqual(result.element.querySelector('.unit')?.textContent, 's');\n });\n\n it('renders number with unit (formatMicroSecondsAsMillisFixed)', () => {\n const result = NumberWithUnit.formatMicroSecondsAsMillisFixed(100_000 as Trace.Types.Timing.MicroSeconds);\n assert.strictEqual(result.text, '100ms');\n assert.strictEqual(result.element.textContent, '100ms');\n assert.strictEqual(result.element.querySelector('.unit')?.textContent, 'ms');\n });\n\n it('parse', () => {\n // en\n assert.deepEqual(NumberWithUnit.parse('100[s]()'), {firstPart: '100', unitPart: 's', lastPart: ''});\n assert.deepEqual(NumberWithUnit.parse('100 [s]()'), {firstPart: '100 ', unitPart: 's', lastPart: ''});\n\n // Decimal separators\n assert.deepEqual(NumberWithUnit.parse('100.123[ms]()'), {firstPart: '100.123', unitPart: 'ms', lastPart: ''});\n assert.deepEqual(NumberWithUnit.parse('100,2[s]()'), {firstPart: '100,2', unitPart: 's', lastPart: ''});\n\n // zh\n assert.deepEqual(NumberWithUnit.parse('100[毫秒]()'), {firstPart: '100', unitPart: '毫秒', lastPart: ''});\n // zh-Hans-CN-u-nu-hanidec\n assert.deepEqual(NumberWithUnit.parse('一〇〇[毫秒]()'), {firstPart: '一〇〇', unitPart: '毫秒', lastPart: ''});\n\n // ar-SA (RTL language, but the UIString still places the number first in the string)\n assert.deepEqual(\n NumberWithUnit.parse('١٠٠[ملي ثانية]()'), {firstPart: '١٠٠', unitPart: 'ملي ثانية', lastPart: ''});\n\n // ar\n assert.deepEqual(\n NumberWithUnit.parse('100[ملي ثانية]()'), {firstPart: '100', unitPart: 'ملي ثانية', lastPart: ''});\n\n // sw (only one that places unit first)\n assert.deepEqual(NumberWithUnit.parse('[Sek]()100'), {firstPart: '', unitPart: 'Sek', lastPart: '100'});\n assert.deepEqual(NumberWithUnit.parse('[Sek]() 100'), {firstPart: '', unitPart: 'Sek', lastPart: ' 100'});\n\n // error cases\n assert.isNull(NumberWithUnit.parse(''));\n assert.isNull(NumberWithUnit.parse('100s'));\n assert.isNull(NumberWithUnit.parse('100[s]('));\n assert.isNull(NumberWithUnit.parse('100[s]'));\n assert.isNull(NumberWithUnit.parse('100[s'));\n assert.isNull(NumberWithUnit.parse('100 s]('));\n });\n });\n\n describe('networkResourceCategory', function() {\n const {networkResourceCategory, NetworkCategory} = Utils;\n const {ResourceType} = Protocol.Network;\n const getCategory = networkResourceCategory;\n let req: Trace.Types.Events.SyntheticNetworkRequest|undefined;\n\n before(async function() {\n const events = await TraceLoader.fixtureContents(this, 'load-simple.json.gz');\n const {parsedTrace} = await TraceLoader.executeTraceEngineOnFileContents(events);\n req = parsedTrace.NetworkRequests.byId.get('2648544.35');\n });\n\n function tweakRequest(\n mimeType: string, resourceType: Protocol.Network.ResourceType = Protocol.Network.ResourceType.Other):\n Trace.Types.Events.SyntheticNetworkRequest {\n assert.exists(req);\n req.args.data.mimeType = mimeType;\n req.args.data.resourceType = resourceType;\n return req;\n }\n\n it('uses resource type when available', () => {\n assert.strictEqual(getCategory(tweakRequest('text/html', ResourceType.Document)), NetworkCategory.DOC);\n assert.strictEqual(getCategory(tweakRequest('text/css', ResourceType.Stylesheet)), NetworkCategory.CSS);\n assert.strictEqual(getCategory(tweakRequest('image/png', ResourceType.Image)), NetworkCategory.IMG);\n assert.strictEqual(getCategory(tweakRequest('video/webm', ResourceType.Media)), NetworkCategory.MEDIA);\n assert.strictEqual(getCategory(tweakRequest('font/woff2', ResourceType.Font)), NetworkCategory.FONT);\n assert.strictEqual(getCategory(tweakRequest('text/javascript', ResourceType.Script)), NetworkCategory.JS);\n assert.strictEqual(getCategory(tweakRequest('something/unknown', ResourceType.WebSocket)), NetworkCategory.JS);\n assert.strictEqual(getCategory(tweakRequest('something/unknown', ResourceType.Other)), NetworkCategory.OTHER);\n });\n\n it('falls back to mime type for older traces', () => {\n assert.strictEqual(getCategory(tweakRequest('text/html')), NetworkCategory.DOC);\n assert.strictEqual(getCategory(tweakRequest('text/css')), NetworkCategory.CSS);\n assert.strictEqual(getCategory(tweakRequest('image/png')), NetworkCategory.IMG);\n assert.strictEqual(getCategory(tweakRequest('video/webm')), NetworkCategory.MEDIA);\n assert.strictEqual(getCategory(tweakRequest('font/woff2')), NetworkCategory.FONT);\n assert.strictEqual(getCategory(tweakRequest('text/javascript')), NetworkCategory.JS);\n assert.strictEqual(getCategory(tweakRequest('application/javascript')), NetworkCategory.JS);\n assert.strictEqual(getCategory(tweakRequest('application/wasm')), NetworkCategory.WASM);\n assert.strictEqual(getCategory(tweakRequest('application/x-font-woff')), NetworkCategory.FONT);\n assert.strictEqual(getCategory(tweakRequest('application/font-woff2')), NetworkCategory.FONT);\n assert.strictEqual(getCategory(tweakRequest('something/unknown')), NetworkCategory.OTHER);\n });\n });\n});\n"]} \ No newline at end of file diff --git a/public/panels/timeline/components/breadcrumbsUI.css.js b/public/panels/timeline/components/breadcrumbsUI.css.js index f179c0fd2..68902f2f4 100644 --- a/public/panels/timeline/components/breadcrumbsUI.css.js +++ b/public/panels/timeline/components/breadcrumbsUI.css.js @@ -16,8 +16,7 @@ styles.replaceSync( align-items: center; height: 29px; padding: 3px; - overflow-y: hidden; - overflow-x: scroll; + overflow: scroll hidden; } .breadcrumbs::-webkit-scrollbar { diff --git a/public/panels/timeline/components/fieldSettingsDialog.css.js b/public/panels/timeline/components/fieldSettingsDialog.css.js index 67ff71e43..fd1cfe416 100644 --- a/public/panels/timeline/components/fieldSettingsDialog.css.js +++ b/public/panels/timeline/components/fieldSettingsDialog.css.js @@ -20,7 +20,7 @@ styles.replaceSync( } devtools-dialog { - --override-transparent: color-mix(in sRGB, var(--color-background) 80%, transparent); + --override-transparent: color-mix(in srgb, var(--color-background) 80%, transparent); } .section-title { diff --git a/public/panels/timeline/components/ignoreListSetting.css.js b/public/panels/timeline/components/ignoreListSetting.css.js index c0cb6adbb..5e3d7c565 100644 --- a/public/panels/timeline/components/ignoreListSetting.css.js +++ b/public/panels/timeline/components/ignoreListSetting.css.js @@ -55,11 +55,11 @@ styles.replaceSync( border-color: var(--sys-color-error); } - &:not(.error-input):not(:invalid):focus { + &:not(.error-input, :invalid):focus { border-color: var(--sys-color-state-focus-ring); } - &:not(.error-input):not(:invalid):hover:not(:focus) { + &:not(.error-input, :invalid):hover:not(:focus) { background: var(--sys-color-state-hover-on-subtle); } } diff --git a/public/panels/timeline/components/insights/BaseInsightComponent.d.ts b/public/panels/timeline/components/insights/BaseInsightComponent.d.ts index 10fe596a6..3864eae23 100644 --- a/public/panels/timeline/components/insights/BaseInsightComponent.d.ts +++ b/public/panels/timeline/components/insights/BaseInsightComponent.d.ts @@ -12,7 +12,7 @@ export interface BaseInsightData { export declare abstract class BaseInsightComponent> extends HTMLElement { #private; abstract internalName: string; - static readonly litTagName: import("../../../../ui/lit-html/static.js").Static; + static readonly litTagName: LitHtml.StaticHtml.StaticValue; get model(): T | null; protected data: BaseInsightData; readonly sharedTableState: TableState; diff --git a/public/panels/timeline/components/insights/BaseInsightComponent.js b/public/panels/timeline/components/insights/BaseInsightComponent.js index fd949c21b..5318ff955 100644 --- a/public/panels/timeline/components/insights/BaseInsightComponent.js +++ b/public/panels/timeline/components/insights/BaseInsightComponent.js @@ -35,7 +35,7 @@ const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_); export class BaseInsightComponent extends HTMLElement { // So we can use the TypeScript BaseInsight class without getting warnings // about litTagName. Every child should overrwrite this. - static litTagName = LitHtml.literal ``; + static litTagName = LitHtml.StaticHtml.literal ``; #shadowRoot = this.attachShadow({ mode: 'open' }); #selected = false; #model = null; diff --git a/public/panels/timeline/components/insights/BaseInsightComponent.js.map b/public/panels/timeline/components/insights/BaseInsightComponent.js.map index c83f0d766..548d2e3f4 100644 --- a/public/panels/timeline/components/insights/BaseInsightComponent.js.map +++ b/public/panels/timeline/components/insights/BaseInsightComponent.js.map @@ -1 +1 @@ -{"version":3,"file":"BaseInsightComponent.js","sourceRoot":"","sources":["../../../../../../../../front_end/panels/timeline/components/insights/BaseInsightComponent.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,0DAA0D,CAAC;AAElE,OAAO,KAAK,IAAI,MAAM,+BAA+B,CAAC;AAGtD,OAAO,KAAK,OAAO,MAAM,8CAA8C,CAAC;AACxE,OAAO,KAAK,gBAAgB,MAAM,8CAA8C,CAAC;AACjF,OAAO,KAAK,OAAO,MAAM,qCAAqC,CAAC;AAC/D,OAAO,KAAK,aAAa,MAAM,iDAAiD,CAAC;AAEjF,OAAO,EAAC,EAAE,EAAC,MAAM,wBAAwB,CAAC;AAE1C,OAAO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AI,EAAC,CAAC;;;0BAGjF,IAAI,CAAC,SAAS;uBACjB,UAAU,CAAC,SAAS,CAAC,WAAW,EAAE,EAAC,GAAG,EAAE,IAAI,CAAC,MAAM,CAAC,KAAK,EAAC,CAAC;;YAEtE,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,SAAS,CAAC;sCACX,IAAI,CAAC,MAAM,EAAE,KAAK;YAC5C,sBAAsB,CAAC,CAAC;YACxB,IAAI,CAAA;;gBAEA,sBAAsB;;iBAErB;YACP,CAAC,CAAC,OAAO,CAAC,OAAO;;UAEjB,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAA;;+CAEgB,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC;2CAC/B,OAAO;iBACjC;YACP,CAAC,CAAC,OAAO,CAAC,OACZ;;KAEH,CAAC;QACF,kBAAkB;QAElB,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,WAAW,EAAE,EAAC,IAAI,EAAE,IAAI,EAAC,CAAC,CAAC;QAEvD,IAAI,IAAI,CAAC,SAAS,EAAE,CAAC;YACnB,qBAAqB,CAAC,GAAG,EAAE,CAAC,qBAAqB,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,sBAAsB,EAAE,CAAC,CAAC,CAAC;QAC1F,CAAC;IACH,CAAC","sourcesContent":["// Copyright 2024 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport '../../../../ui/components/markdown_view/markdown_view.js';\n\nimport * as i18n from '../../../../core/i18n/i18n.js';\nimport type {InsightModel} from '../../../../models/trace/insights/types.js';\nimport type * as Trace from '../../../../models/trace/trace.js';\nimport * as Buttons from '../../../../ui/components/buttons/buttons.js';\nimport * as ComponentHelpers from '../../../../ui/components/helpers/helpers.js';\nimport * as LitHtml from '../../../../ui/lit-html/lit-html.js';\nimport * as VisualLogging from '../../../../ui/visual_logging/visual_logging.js';\nimport type * as Overlays from '../../overlays/overlays.js';\nimport {md} from '../../utils/Helpers.js';\n\nimport baseInsightComponentStyles from './baseInsightComponent.css.js';\nimport * as SidebarInsight from './SidebarInsight.js';\nimport type {TableState} from './Table.js';\n\nconst {html} = LitHtml;\n\nconst UIStrings = {\n /**\n * @description Text to tell the user the estimated time or size savings for this insight. \"&\" means \"and\" - space is limited to prefer abbreviated terms if possible. Text will still fit if not short, it just won't look very good, so using no abbreviations is fine if necessary.\n * @example {401 ms} PH1\n * @example {112 kB} PH1\n */\n estimatedSavings: 'Est savings: {PH1}',\n /**\n * @description Text to tell the user the estimated time and size savings for this insight. \"&\" means \"and\", \"Est\" means \"Estimated\" - space is limited to prefer abbreviated terms if possible. Text will still fit if not short, it just won't look very good, so using no abbreviations is fine if necessary.\n * @example {401 ms} PH1\n * @example {112 kB} PH2\n */\n estimatedSavingsTimingAndBytes: 'Est savings: {PH1} & {PH2}',\n /**\n * @description Used for screen-readers as a label on the button to expand an insight to view details\n * @example {LCP by phase} PH1\n */\n viewDetails: 'View details for {PH1}',\n};\n\nconst str_ = i18n.i18n.registerUIStrings('panels/timeline/components/insights/BaseInsightComponent.ts', UIStrings);\nconst i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);\n\nexport interface BaseInsightData {\n bounds: Trace.Types.Timing.TraceWindowMicroSeconds|null;\n /** The key into `insights` that contains this particular insight. */\n insightSetKey: string|null;\n}\n\nexport abstract class BaseInsightComponent> extends HTMLElement {\n abstract internalName: string;\n // So we can use the TypeScript BaseInsight class without getting warnings\n // about litTagName. Every child should overrwrite this.\n static readonly litTagName = LitHtml.literal``;\n\n readonly #shadowRoot = this.attachShadow({mode: 'open'});\n\n #selected = false;\n #model: T|null = null;\n\n get model(): T|null {\n return this.#model;\n }\n\n protected data: BaseInsightData = {\n bounds: null,\n insightSetKey: null,\n };\n\n // eslint-disable-next-line rulesdir/no-bound-component-methods\n readonly #boundRender = this.#render.bind(this);\n readonly sharedTableState: TableState = {\n selectedRowEl: null,\n selectionIsSticky: false,\n };\n #initialOverlays: Overlays.Overlays.TimelineOverlay[]|null = null;\n\n protected scheduleRender(): void {\n void ComponentHelpers.ScheduledRender.scheduleRender(this, this.#boundRender);\n }\n\n connectedCallback(): void {\n this.#shadowRoot.adoptedStyleSheets.push(baseInsightComponentStyles);\n this.setAttribute('jslog', `${VisualLogging.section(`timeline.insights.${this.internalName}`)}`);\n // Used for unit test purposes when querying the DOM.\n this.dataset.insightName = this.internalName;\n }\n\n set selected(selected: boolean) {\n if (!this.#selected && selected) {\n this.dispatchEvent(\n new SidebarInsight.InsightProvideOverlays(this.getInitialOverlays(), {updateTraceWindow: true}));\n }\n\n this.#selected = selected;\n void ComponentHelpers.ScheduledRender.scheduleRender(this, this.#boundRender);\n }\n\n get selected(): boolean {\n return this.#selected;\n }\n\n set model(model: T) {\n this.#model = model;\n void ComponentHelpers.ScheduledRender.scheduleRender(this, this.#boundRender);\n }\n\n set insightSetKey(insightSetKey: string|null) {\n this.data.insightSetKey = insightSetKey;\n void ComponentHelpers.ScheduledRender.scheduleRender(this, this.#boundRender);\n }\n\n get bounds(): Trace.Types.Timing.TraceWindowMicroSeconds|null {\n return this.data.bounds;\n }\n\n set bounds(bounds: Trace.Types.Timing.TraceWindowMicroSeconds|null) {\n this.data.bounds = bounds;\n void ComponentHelpers.ScheduledRender.scheduleRender(this, this.#boundRender);\n }\n\n #dispatchInsightToggle(): void {\n if (this.#selected) {\n this.dispatchEvent(new SidebarInsight.InsightDeactivated());\n return;\n }\n\n if (!this.data.insightSetKey) {\n // Shouldn't happen, but needed to satisfy TS.\n return;\n }\n\n this.sharedTableState.selectedRowEl?.classList.remove('selected');\n this.sharedTableState.selectedRowEl = null;\n this.sharedTableState.selectionIsSticky = false;\n\n this.dispatchEvent(new SidebarInsight.InsightActivated(this.model, this.data.insightSetKey));\n }\n\n #renderHoverIcon(insightIsActive: boolean): LitHtml.TemplateResult {\n // clang-format off\n const containerClasses = LitHtml.Directives.classMap({\n 'insight-hover-icon': true,\n active: insightIsActive,\n });\n return html`\n
\n \n
\n\n `;\n // clang-format on\n }\n\n /**\n * Ensure that if the user presses enter or space on a header, we treat it\n * like a click and toggle the insight.\n */\n #handleHeaderKeyDown(event: KeyboardEvent): void {\n if (event.key === 'Enter' || event.key === ' ') {\n event.preventDefault();\n event.stopPropagation();\n this.#dispatchInsightToggle();\n }\n }\n\n /**\n * Replaces the initial insight overlays with the ones provided.\n *\n * If `overlays` is null, reverts back to the initial overlays.\n *\n * This allows insights to provide an initial set of overlays,\n * and later temporarily replace all of those insights with a different set.\n * This enables the hover/click table interactions.\n */\n toggleTemporaryOverlays(\n overlays: Overlays.Overlays.TimelineOverlay[]|null, options: Overlays.Overlays.TimelineOverlaySetOptions): void {\n if (!this.#selected) {\n return;\n }\n\n this.dispatchEvent(new SidebarInsight.InsightProvideOverlays(overlays ?? this.getInitialOverlays(), options));\n }\n\n getInitialOverlays(): Overlays.Overlays.TimelineOverlay[] {\n if (this.#initialOverlays) {\n return this.#initialOverlays;\n }\n\n this.#initialOverlays = this.createOverlays();\n return this.#initialOverlays;\n }\n\n protected abstract createOverlays(): Overlays.Overlays.TimelineOverlay[];\n\n protected abstract renderContent(): LitHtml.LitTemplate;\n\n #render(): void {\n if (!this.model) {\n return;\n }\n\n const output = this.renderContent();\n this.#renderWithContent(output);\n }\n\n getEstimatedSavingsTime(): Trace.Types.Timing.MilliSeconds|null {\n return null;\n }\n\n getEstimatedSavingsBytes(): number|null {\n return null;\n }\n\n #getEstimatedSavingsString(): string|null {\n const savingsTime = this.getEstimatedSavingsTime();\n const savingsBytes = this.getEstimatedSavingsBytes();\n\n let timeString, bytesString;\n if (savingsTime) {\n timeString = i18n.TimeUtilities.millisToString(savingsTime);\n }\n if (savingsBytes) {\n bytesString = i18n.ByteUtilities.bytesToString(savingsBytes);\n }\n\n if (timeString && bytesString) {\n return i18nString(UIStrings.estimatedSavingsTimingAndBytes, {\n PH1: timeString,\n PH2: bytesString,\n });\n }\n if (timeString) {\n return i18nString(UIStrings.estimatedSavings, {\n PH1: timeString,\n });\n }\n if (bytesString) {\n return i18nString(UIStrings.estimatedSavings, {\n PH1: bytesString,\n });\n }\n\n return null;\n }\n\n #renderWithContent(content: LitHtml.LitTemplate): void {\n if (!this.#model) {\n LitHtml.render(LitHtml.nothing, this.#shadowRoot, {host: this});\n return;\n }\n\n const containerClasses = LitHtml.Directives.classMap({\n insight: true,\n closed: !this.#selected,\n });\n const estimatedSavingsString = this.#getEstimatedSavingsString();\n\n // clang-format off\n const output = html`\n
\n
\n ${this.#renderHoverIcon(this.#selected)}\n

${this.#model?.title}

\n ${estimatedSavingsString ?\n html`\n \n ${estimatedSavingsString}\n \n
`\n : LitHtml.nothing}\n \n ${this.#selected ? html`\n
\n
${md(this.#model.description)}
\n
${content}
\n
`\n : LitHtml.nothing\n }\n \n `;\n // clang-format on\n\n LitHtml.render(output, this.#shadowRoot, {host: this});\n\n if (this.#selected) {\n requestAnimationFrame(() => requestAnimationFrame(() => this.scrollIntoViewIfNeeded()));\n }\n }\n}\n"]} \ No newline at end of file +{"version":3,"file":"BaseInsightComponent.js","sourceRoot":"","sources":["../../../../../../../../front_end/panels/timeline/components/insights/BaseInsightComponent.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,0DAA0D,CAAC;AAElE,OAAO,KAAK,IAAI,MAAM,+BAA+B,CAAC;AAGtD,OAAO,KAAK,OAAO,MAAM,8CAA8C,CAAC;AACxE,OAAO,KAAK,gBAAgB,MAAM,8CAA8C,CAAC;AACjF,OAAO,KAAK,OAAO,MAAM,qCAAqC,CAAC;AAC/D,OAAO,KAAK,aAAa,MAAM,iDAAiD,CAAC;AAEjF,OAAO,EAAC,EAAE,EAAC,MAAM,wBAAwB,CAAC;AAE1C,OAAO,0BAA0B,MAAM,+BAA+B,CAAC;AACvE,OAAO,KAAK,cAAc,MAAM,qBAAqB,CAAC;AAGtD,MAAM,EAAC,IAAI,EAAC,GAAG,OA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AE,IAAI,CAAC,MAAM,CAAC,KAAK,EAAC,CAAC;;YAEtE,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,SAAS,CAAC;sCACX,IAAI,CAAC,MAAM,EAAE,KAAK;YAC5C,sBAAsB,CAAC,CAAC;YACxB,IAAI,CAAA;;gBAEA,sBAAsB;;iBAErB;YACP,CAAC,CAAC,OAAO,CAAC,OAAO;;UAEjB,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAA;;+CAEgB,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC;2CAC/B,OAAO;iBACjC;YACP,CAAC,CAAC,OAAO,CAAC,OACZ;;KAEH,CAAC;QACF,kBAAkB;QAElB,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,WAAW,EAAE,EAAC,IAAI,EAAE,IAAI,EAAC,CAAC,CAAC;QAEvD,IAAI,IAAI,CAAC,SAAS,EAAE,CAAC;YACnB,qBAAqB,CAAC,GAAG,EAAE,CAAC,qBAAqB,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,sBAAsB,EAAE,CAAC,CAAC,CAAC;QAC1F,CAAC;IACH,CAAC","sourcesContent":["// Copyright 2024 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport '../../../../ui/components/markdown_view/markdown_view.js';\n\nimport * as i18n from '../../../../core/i18n/i18n.js';\nimport type {InsightModel} from '../../../../models/trace/insights/types.js';\nimport type * as Trace from '../../../../models/trace/trace.js';\nimport * as Buttons from '../../../../ui/components/buttons/buttons.js';\nimport * as ComponentHelpers from '../../../../ui/components/helpers/helpers.js';\nimport * as LitHtml from '../../../../ui/lit-html/lit-html.js';\nimport * as VisualLogging from '../../../../ui/visual_logging/visual_logging.js';\nimport type * as Overlays from '../../overlays/overlays.js';\nimport {md} from '../../utils/Helpers.js';\n\nimport baseInsightComponentStyles from './baseInsightComponent.css.js';\nimport * as SidebarInsight from './SidebarInsight.js';\nimport type {TableState} from './Table.js';\n\nconst {html} = LitHtml;\n\nconst UIStrings = {\n /**\n * @description Text to tell the user the estimated time or size savings for this insight. \"&\" means \"and\" - space is limited to prefer abbreviated terms if possible. Text will still fit if not short, it just won't look very good, so using no abbreviations is fine if necessary.\n * @example {401 ms} PH1\n * @example {112 kB} PH1\n */\n estimatedSavings: 'Est savings: {PH1}',\n /**\n * @description Text to tell the user the estimated time and size savings for this insight. \"&\" means \"and\", \"Est\" means \"Estimated\" - space is limited to prefer abbreviated terms if possible. Text will still fit if not short, it just won't look very good, so using no abbreviations is fine if necessary.\n * @example {401 ms} PH1\n * @example {112 kB} PH2\n */\n estimatedSavingsTimingAndBytes: 'Est savings: {PH1} & {PH2}',\n /**\n * @description Used for screen-readers as a label on the button to expand an insight to view details\n * @example {LCP by phase} PH1\n */\n viewDetails: 'View details for {PH1}',\n};\n\nconst str_ = i18n.i18n.registerUIStrings('panels/timeline/components/insights/BaseInsightComponent.ts', UIStrings);\nconst i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);\n\nexport interface BaseInsightData {\n bounds: Trace.Types.Timing.TraceWindowMicroSeconds|null;\n /** The key into `insights` that contains this particular insight. */\n insightSetKey: string|null;\n}\n\nexport abstract class BaseInsightComponent> extends HTMLElement {\n abstract internalName: string;\n // So we can use the TypeScript BaseInsight class without getting warnings\n // about litTagName. Every child should overrwrite this.\n static readonly litTagName = LitHtml.StaticHtml.literal``;\n\n readonly #shadowRoot = this.attachShadow({mode: 'open'});\n\n #selected = false;\n #model: T|null = null;\n\n get model(): T|null {\n return this.#model;\n }\n\n protected data: BaseInsightData = {\n bounds: null,\n insightSetKey: null,\n };\n\n // eslint-disable-next-line rulesdir/no-bound-component-methods\n readonly #boundRender = this.#render.bind(this);\n readonly sharedTableState: TableState = {\n selectedRowEl: null,\n selectionIsSticky: false,\n };\n #initialOverlays: Overlays.Overlays.TimelineOverlay[]|null = null;\n\n protected scheduleRender(): void {\n void ComponentHelpers.ScheduledRender.scheduleRender(this, this.#boundRender);\n }\n\n connectedCallback(): void {\n this.#shadowRoot.adoptedStyleSheets.push(baseInsightComponentStyles);\n this.setAttribute('jslog', `${VisualLogging.section(`timeline.insights.${this.internalName}`)}`);\n // Used for unit test purposes when querying the DOM.\n this.dataset.insightName = this.internalName;\n }\n\n set selected(selected: boolean) {\n if (!this.#selected && selected) {\n this.dispatchEvent(\n new SidebarInsight.InsightProvideOverlays(this.getInitialOverlays(), {updateTraceWindow: true}));\n }\n\n this.#selected = selected;\n void ComponentHelpers.ScheduledRender.scheduleRender(this, this.#boundRender);\n }\n\n get selected(): boolean {\n return this.#selected;\n }\n\n set model(model: T) {\n this.#model = model;\n void ComponentHelpers.ScheduledRender.scheduleRender(this, this.#boundRender);\n }\n\n set insightSetKey(insightSetKey: string|null) {\n this.data.insightSetKey = insightSetKey;\n void ComponentHelpers.ScheduledRender.scheduleRender(this, this.#boundRender);\n }\n\n get bounds(): Trace.Types.Timing.TraceWindowMicroSeconds|null {\n return this.data.bounds;\n }\n\n set bounds(bounds: Trace.Types.Timing.TraceWindowMicroSeconds|null) {\n this.data.bounds = bounds;\n void ComponentHelpers.ScheduledRender.scheduleRender(this, this.#boundRender);\n }\n\n #dispatchInsightToggle(): void {\n if (this.#selected) {\n this.dispatchEvent(new SidebarInsight.InsightDeactivated());\n return;\n }\n\n if (!this.data.insightSetKey) {\n // Shouldn't happen, but needed to satisfy TS.\n return;\n }\n\n this.sharedTableState.selectedRowEl?.classList.remove('selected');\n this.sharedTableState.selectedRowEl = null;\n this.sharedTableState.selectionIsSticky = false;\n\n this.dispatchEvent(new SidebarInsight.InsightActivated(this.model, this.data.insightSetKey));\n }\n\n #renderHoverIcon(insightIsActive: boolean): LitHtml.TemplateResult {\n // clang-format off\n const containerClasses = LitHtml.Directives.classMap({\n 'insight-hover-icon': true,\n active: insightIsActive,\n });\n return html`\n
\n \n
\n\n `;\n // clang-format on\n }\n\n /**\n * Ensure that if the user presses enter or space on a header, we treat it\n * like a click and toggle the insight.\n */\n #handleHeaderKeyDown(event: KeyboardEvent): void {\n if (event.key === 'Enter' || event.key === ' ') {\n event.preventDefault();\n event.stopPropagation();\n this.#dispatchInsightToggle();\n }\n }\n\n /**\n * Replaces the initial insight overlays with the ones provided.\n *\n * If `overlays` is null, reverts back to the initial overlays.\n *\n * This allows insights to provide an initial set of overlays,\n * and later temporarily replace all of those insights with a different set.\n * This enables the hover/click table interactions.\n */\n toggleTemporaryOverlays(\n overlays: Overlays.Overlays.TimelineOverlay[]|null, options: Overlays.Overlays.TimelineOverlaySetOptions): void {\n if (!this.#selected) {\n return;\n }\n\n this.dispatchEvent(new SidebarInsight.InsightProvideOverlays(overlays ?? this.getInitialOverlays(), options));\n }\n\n getInitialOverlays(): Overlays.Overlays.TimelineOverlay[] {\n if (this.#initialOverlays) {\n return this.#initialOverlays;\n }\n\n this.#initialOverlays = this.createOverlays();\n return this.#initialOverlays;\n }\n\n protected abstract createOverlays(): Overlays.Overlays.TimelineOverlay[];\n\n protected abstract renderContent(): LitHtml.LitTemplate;\n\n #render(): void {\n if (!this.model) {\n return;\n }\n\n const output = this.renderContent();\n this.#renderWithContent(output);\n }\n\n getEstimatedSavingsTime(): Trace.Types.Timing.MilliSeconds|null {\n return null;\n }\n\n getEstimatedSavingsBytes(): number|null {\n return null;\n }\n\n #getEstimatedSavingsString(): string|null {\n const savingsTime = this.getEstimatedSavingsTime();\n const savingsBytes = this.getEstimatedSavingsBytes();\n\n let timeString, bytesString;\n if (savingsTime) {\n timeString = i18n.TimeUtilities.millisToString(savingsTime);\n }\n if (savingsBytes) {\n bytesString = i18n.ByteUtilities.bytesToString(savingsBytes);\n }\n\n if (timeString && bytesString) {\n return i18nString(UIStrings.estimatedSavingsTimingAndBytes, {\n PH1: timeString,\n PH2: bytesString,\n });\n }\n if (timeString) {\n return i18nString(UIStrings.estimatedSavings, {\n PH1: timeString,\n });\n }\n if (bytesString) {\n return i18nString(UIStrings.estimatedSavings, {\n PH1: bytesString,\n });\n }\n\n return null;\n }\n\n #renderWithContent(content: LitHtml.LitTemplate): void {\n if (!this.#model) {\n LitHtml.render(LitHtml.nothing, this.#shadowRoot, {host: this});\n return;\n }\n\n const containerClasses = LitHtml.Directives.classMap({\n insight: true,\n closed: !this.#selected,\n });\n const estimatedSavingsString = this.#getEstimatedSavingsString();\n\n // clang-format off\n const output = html`\n
\n
\n ${this.#renderHoverIcon(this.#selected)}\n

${this.#model?.title}

\n ${estimatedSavingsString ?\n html`\n \n ${estimatedSavingsString}\n \n
`\n : LitHtml.nothing}\n \n ${this.#selected ? html`\n
\n
${md(this.#model.description)}
\n
${content}
\n
`\n : LitHtml.nothing\n }\n \n `;\n // clang-format on\n\n LitHtml.render(output, this.#shadowRoot, {host: this});\n\n if (this.#selected) {\n requestAnimationFrame(() => requestAnimationFrame(() => this.scrollIntoViewIfNeeded()));\n }\n }\n}\n"]} \ No newline at end of file diff --git a/public/panels/timeline/components/insights/BaseInsightComponent.test.js b/public/panels/timeline/components/insights/BaseInsightComponent.test.js index 7b433d265..4ab1d35d5 100644 --- a/public/panels/timeline/components/insights/BaseInsightComponent.test.js +++ b/public/panels/timeline/components/insights/BaseInsightComponent.test.js @@ -4,13 +4,12 @@ import * as Trace from '../../../../models/trace/trace.js'; import { renderElementIntoDOM } from '../../../../testing/DOMHelpers.js'; import { describeWithEnvironment } from '../../../../testing/EnvironmentHelpers.js'; -import * as Coordinator from '../../../../ui/components/render_coordinator/render_coordinator.js'; +import * as RenderCoordinator from '../../../../ui/components/render_coordinator/render_coordinator.js'; import * as LitHtml from '../../../../ui/lit-html/lit-html.js'; import * as Insights from './insights.js'; const { html } = LitHtml; describeWithEnvironment('BaseInsightComponent', () => { const { BaseInsightComponent } = Insights.BaseInsightComponent; - const coordinator = Coordinator.RenderCoordinator.RenderCoordinator.instance(); class TestInsightComponent extends BaseInsightComponent { internalName = 'test-insight'; createOverlays() { @@ -32,7 +31,7 @@ describeWithEnvironment('BaseInsightComponent', () => { shouldShow: true, }; renderElementIntoDOM(component); - await coordinator.done(); + await RenderCoordinator.done(); assert.isNotNull(component.shadowRoot); const titleElement = component.shadowRoot.querySelector('.insight-title'); assert.isNotNull(titleElement); @@ -52,7 +51,7 @@ describeWithEnvironment('BaseInsightComponent', () => { shouldShow: true, }; renderElementIntoDOM(component); - await coordinator.done(); + await RenderCoordinator.done(); assert.isNotNull(component.shadowRoot); const titleElement = component.shadowRoot.querySelector('.insight-title'); assert.isNotNull(titleElement); diff --git a/public/panels/timeline/components/insights/BaseInsightComponent.test.js.map b/public/panels/timeline/components/insights/BaseInsightComponent.test.js.map index 5e8dce330..c61bb48eb 100644 --- a/public/panels/timeline/components/insights/BaseInsightComponent.test.js.map +++ b/public/panels/timeline/components/insights/BaseInsightComponent.test.js.map @@ -1 +1 @@ -{"version":3,"file":"BaseInsightComponent.test.js","sourceRoot":"","sources":["../../../../../../../../front_end/panels/timeline/components/insights/BaseInsightComponent.test.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAG7B,OAAO,KAAK,KAAK,MAAM,mCAAmC,CAAC;AAC3D,OAAO,EAAC,oBAAoB,EAAC,MAAM,mCAAmC,CAAC;AACvE,OAAO,EAAC,uBAAuB,EAAC,MAAM,2CAA2C,CAAC;AAClF,OAAO,KAAK,WAAW,MAAM,oEAAoE,CAAC;AAClG,OAAO,KAAK,OAAO,MAAM,qCAAqC,CAAC;AAG/D,OAAO,KAAK,QAAQ,MAAM,eAAe,CAAC;AAE1C,MAAM,EAAC,IAAI,EAAC,GAAG,OAAO,CAAC;AAEvB,uBAAuB,CAAC,sBAAsB,EAAE,GAAG,EAAE;IACnD,MAAM,EAAC,oBAAoB,EAAC,GAAG,QAAQ,CAAC,oBAAoB,CAAC;IAC7D,MAAM,WAAW,GAAG,WAAW,CAAC,iBAAiB,CAAC,iBAAiB,CAAC,QAAQ,EAAE,CAAC;IAE/E,MAAM,oBAAqB,SAAQ,oBAA2D;QACnF,YAAY,GAAG,cAA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":["// Copyright 2024 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport type * as Common from '../../../../core/common/common.js';\nimport * as Trace from '../../../../models/trace/trace.js';\nimport {renderElementIntoDOM} from '../../../../testing/DOMHelpers.js';\nimport {describeWithEnvironment} from '../../../../testing/EnvironmentHelpers.js';\nimport * as Coordinator from '../../../../ui/components/render_coordinator/render_coordinator.js';\nimport * as LitHtml from '../../../../ui/lit-html/lit-html.js';\nimport type {TimelineOverlay} from '../../overlays/OverlaysImpl.js';\n\nimport * as Insights from './insights.js';\n\nconst {html} = LitHtml;\n\ndescribeWithEnvironment('BaseInsightComponent', () => {\n const {BaseInsightComponent} = Insights.BaseInsightComponent;\n const coordinator = Coordinator.RenderCoordinator.RenderCoordinator.instance();\n\n class TestInsightComponent extends BaseInsightComponent> {\n override internalName = 'test-insight';\n override createOverlays(): TimelineOverlay[] {\n return [];\n }\n override renderContent(): LitHtml.LitTemplate {\n return html`
test content
`;\n }\n }\n customElements.define('test-insight-component', TestInsightComponent);\n\n describe('sidebar insight component rendering', () => {\n it('renders insight title even when not active', async () => {\n const component = new TestInsightComponent();\n component.selected = false;\n component.model = {\n title: 'LCP by Phase' as Common.UIString.LocalizedString,\n description: 'some description' as Common.UIString.LocalizedString,\n category: Trace.Insights.Types.InsightCategory.ALL,\n shouldShow: true,\n };\n renderElementIntoDOM(component);\n\n await coordinator.done();\n\n assert.isNotNull(component.shadowRoot);\n const titleElement = component.shadowRoot.querySelector('.insight-title');\n assert.isNotNull(titleElement);\n const descElement = component.shadowRoot.querySelector('.insight-description');\n assert.isNull(descElement);\n const contentElement = component.shadowRoot.querySelector('.insight-content');\n assert.isNull(contentElement);\n assert.deepEqual(titleElement.textContent, 'LCP by Phase');\n });\n\n it('renders title, description and content when toggled', async () => {\n const component = new TestInsightComponent();\n component.selected = true;\n component.model = {\n title: 'LCP by Phase' as Common.UIString.LocalizedString,\n description: 'some description' as Common.UIString.LocalizedString,\n category: Trace.Insights.Types.InsightCategory.ALL,\n shouldShow: true,\n };\n renderElementIntoDOM(component);\n\n await coordinator.done();\n\n assert.isNotNull(component.shadowRoot);\n const titleElement = component.shadowRoot.querySelector('.insight-title');\n assert.isNotNull(titleElement);\n assert.deepEqual(titleElement.textContent, 'LCP by Phase');\n\n const descElement = component.shadowRoot.querySelector('.insight-description');\n assert.isNotNull(descElement);\n // It's in the markdown component.\n assert.strictEqual(descElement.children[0].shadowRoot?.textContent?.trim(), 'some description');\n\n const contentElement = component.shadowRoot.querySelector('.insight-content');\n assert.isNotNull(contentElement);\n assert.strictEqual(contentElement.textContent, 'test content');\n });\n });\n});\n"]} \ No newline at end of file +{"version":3,"file":"BaseInsightComponent.test.js","sourceRoot":"","sources":["../../../../../../../../front_end/panels/timeline/components/insights/BaseInsightComponent.test.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAG7B,OAAO,KAAK,KAAK,MAAM,mCAAmC,CAAC;AAC3D,OAAO,EAAC,oBAAoB,EAAC,MAAM,mCAAmC,CAAC;AACvE,OAAO,EAAC,uBAAuB,EAAC,MAAM,2CAA2C,CAAC;AAClF,OAAO,KAAK,iBAAiB,MAAM,oEAAoE,CAAC;AACxG,OAAO,KAAK,OAAO,MAAM,qCAAqC,CAAC;AAG/D,OAAO,KAAK,QAAQ,MAAM,eAAe,CAAC;AAE1C,MAAM,EAAC,IAAI,EAAC,GAAG,OAAO,CAAC;AAEvB,uBAAuB,CAAC,sBAAsB,EAAE,GAAG,EAAE;IACnD,MAAM,EAAC,oBAAoB,EAAC,GAAG,QAAQ,CAAC,oBAAoB,CAAC;IAC7D,MAAM,oBAAqB,SAAQ,oBAA2D;QACnF,YAAY,GAAG,cAAc,CAAC;QAC9B,cAAc;YACrB,OAAO,EAAE,CAAC;QACZ,CAAC;QACQ,aAAa;YACpB,OAAO,IAAI,CAAA,yBAAyB,CAAC;QACvC,CAAC;KACF;IACD,cAAc,CAAC,MA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AC,KAAK,GAAG;gBAChB,KAAK,EAAE,cAAiD;gBACxD,WAAW,EAAE,kBAAqD;gBAClE,QAAQ,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,eAAe,CAAC,GAAG;gBAClD,UAAU,EAAE,IAAI;aACjB,CAAC;YACF,oBAAoB,CAAC,SAAS,CAAC,CAAC;YAEhC,MAAM,iBAAiB,CAAC,IAAI,EAAE,CAAC;YAE/B,MAAM,CAAC,SAAS,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC;YACvC,MAAM,YAAY,GAAG,SAAS,CAAC,UAAU,CAAC,aAAa,CAAc,gBAAgB,CAAC,CAAC;YACvF,MAAM,CAAC,SAAS,CAAC,YAAY,CAAC,CAAC;YAC/B,MAAM,CAAC,SAAS,CAAC,YAAY,CAAC,WAAW,EAAE,cAAc,CAAC,CAAC;YAE3D,MAAM,WAAW,GAAG,SAAS,CAAC,UAAU,CAAC,aAAa,CAAc,sBAAsB,CAAC,CAAC;YAC5F,MAAM,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC;YAC9B,kCAAkC;YAClC,MAAM,CAAC,WAAW,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,UAAU,EAAE,WAAW,EAAE,IAAI,EAAE,EAAE,kBAAkB,CAAC,CAAC;YAEhG,MAAM,cAAc,GAAG,SAAS,CAAC,UAAU,CAAC,aAAa,CAAc,kBAAkB,CAAC,CAAC;YAC3F,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC;YACjC,MAAM,CAAC,WAAW,CAAC,cAAc,CAAC,WAAW,EAAE,cAAc,CAAC,CAAC;QACjE,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["// Copyright 2024 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport type * as Common from '../../../../core/common/common.js';\nimport * as Trace from '../../../../models/trace/trace.js';\nimport {renderElementIntoDOM} from '../../../../testing/DOMHelpers.js';\nimport {describeWithEnvironment} from '../../../../testing/EnvironmentHelpers.js';\nimport * as RenderCoordinator from '../../../../ui/components/render_coordinator/render_coordinator.js';\nimport * as LitHtml from '../../../../ui/lit-html/lit-html.js';\nimport type {TimelineOverlay} from '../../overlays/OverlaysImpl.js';\n\nimport * as Insights from './insights.js';\n\nconst {html} = LitHtml;\n\ndescribeWithEnvironment('BaseInsightComponent', () => {\n const {BaseInsightComponent} = Insights.BaseInsightComponent;\n class TestInsightComponent extends BaseInsightComponent> {\n override internalName = 'test-insight';\n override createOverlays(): TimelineOverlay[] {\n return [];\n }\n override renderContent(): LitHtml.LitTemplate {\n return html`
test content
`;\n }\n }\n customElements.define('test-insight-component', TestInsightComponent);\n\n describe('sidebar insight component rendering', () => {\n it('renders insight title even when not active', async () => {\n const component = new TestInsightComponent();\n component.selected = false;\n component.model = {\n title: 'LCP by Phase' as Common.UIString.LocalizedString,\n description: 'some description' as Common.UIString.LocalizedString,\n category: Trace.Insights.Types.InsightCategory.ALL,\n shouldShow: true,\n };\n renderElementIntoDOM(component);\n\n await RenderCoordinator.done();\n\n assert.isNotNull(component.shadowRoot);\n const titleElement = component.shadowRoot.querySelector('.insight-title');\n assert.isNotNull(titleElement);\n const descElement = component.shadowRoot.querySelector('.insight-description');\n assert.isNull(descElement);\n const contentElement = component.shadowRoot.querySelector('.insight-content');\n assert.isNull(contentElement);\n assert.deepEqual(titleElement.textContent, 'LCP by Phase');\n });\n\n it('renders title, description and content when toggled', async () => {\n const component = new TestInsightComponent();\n component.selected = true;\n component.model = {\n title: 'LCP by Phase' as Common.UIString.LocalizedString,\n description: 'some description' as Common.UIString.LocalizedString,\n category: Trace.Insights.Types.InsightCategory.ALL,\n shouldShow: true,\n };\n renderElementIntoDOM(component);\n\n await RenderCoordinator.done();\n\n assert.isNotNull(component.shadowRoot);\n const titleElement = component.shadowRoot.querySelector('.insight-title');\n assert.isNotNull(titleElement);\n assert.deepEqual(titleElement.textContent, 'LCP by Phase');\n\n const descElement = component.shadowRoot.querySelector('.insight-description');\n assert.isNotNull(descElement);\n // It's in the markdown component.\n assert.strictEqual(descElement.children[0].shadowRoot?.textContent?.trim(), 'some description');\n\n const contentElement = component.shadowRoot.querySelector('.insight-content');\n assert.isNotNull(contentElement);\n assert.strictEqual(contentElement.textContent, 'test content');\n });\n });\n});\n"]} \ No newline at end of file diff --git a/public/panels/timeline/components/insights/CLSCulprits.d.ts b/public/panels/timeline/components/insights/CLSCulprits.d.ts index d0f3a09a5..98cf741cf 100644 --- a/public/panels/timeline/components/insights/CLSCulprits.d.ts +++ b/public/panels/timeline/components/insights/CLSCulprits.d.ts @@ -5,7 +5,7 @@ import type * as Overlays from '../../overlays/overlays.js'; import { BaseInsightComponent } from './BaseInsightComponent.js'; export declare class CLSCulprits extends BaseInsightComponent { #private; - static readonly litTagName: import("../../../../ui/lit-html/static.js").Static; + static readonly litTagName: LitHtml.StaticHtml.StaticValue; internalName: string; createOverlays(): Overlays.Overlays.TimelineOverlay[]; /** diff --git a/public/panels/timeline/components/insights/CLSCulprits.js b/public/panels/timeline/components/insights/CLSCulprits.js index 87c647710..65b77500b 100644 --- a/public/panels/timeline/components/insights/CLSCulprits.js +++ b/public/panels/timeline/components/insights/CLSCulprits.js @@ -53,7 +53,7 @@ const UIStrings = { const str_ = i18n.i18n.registerUIStrings('panels/timeline/components/insights/CLSCulprits.ts', UIStrings); const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_); export class CLSCulprits extends BaseInsightComponent { - static litTagName = LitHtml.literal `devtools-performance-cls-culprits`; + static litTagName = LitHtml.StaticHtml.literal `devtools-performance-cls-culprits`; internalName = 'cls-culprits'; createOverlays() { const clustersByScore = this.model?.clusters.toSorted((a, b) => b.clusterCumulativeScore - a.clusterCumulativeScore) ?? []; diff --git a/public/panels/timeline/components/insights/CLSCulprits.js.map b/public/panels/timeline/components/insights/CLSCulprits.js.map index bfd653097..701dff72e 100644 --- a/public/panels/timeline/components/insights/CLSCulprits.js.map +++ b/public/panels/timeline/components/insights/CLSCulprits.js.map @@ -1 +1 @@ -{"version":3,"file":"CLSCulprits.js","sourceRoot":"","sources":["../../../../../../../../front_end/panels/timeline/components/insights/CLSCulprits.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,KAAK,IAAI,MAAM,+BAA+B,CAAC;AAEtD,OAAO,KAAK,KAAK,MAAM,mCAAmC,CAAC;AAC3D,OAAO,KAAK,OAAO,MAAM,qCAAqC,CAAC;AAG/D,OAAO,EAAC,oBAAoB,EAAC,MAAM,2BAA2B,CAAC;AAC/D,OAAO,EAAC,mBAAmB,EAAC,MAAM,eAAe,CAAC;AAElD,MAAM,EAAC,IAAI,EAAC,GAAG,OAAO,CAAC;AAEvB,MAAM,SAAS,GAAG;IAChB;;OAEG;IACH,uBAAuB,EAAE,4BAA4B;IACrD;;OAEG;IACH,YAAY,EAAE,eAAe;IAC7B;;;OAGG;IACH,kBAAkB,EAAE,8BAA8B;IAClD;;OAEG;IACH,WAAW,EAAE,2BAA2B;IACxC;;OAEG;IACH,cAAc,EAAE,iBAAiB;IACjC;;OAEG;IACH,WAAW,EAAE,cAAc;IAC3B;;OAEG;IACH,SAAS,EAAE,WAAW;IACtB;;OAEG;IACH,aAAa,EAAE,gBAAgB;IAC/B;;OAEG;IACH,cAAc,EAAE,kBAAkB;IAClC;;OAEG;IACH,UAAU,EAAE,4CAA4C;CACzD,CAAC;AACF,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,iBAAiB,CAAC,oDAAoD,EAAE,SAAS,CAAC,CAAC;AAC1G,MAAM,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC;AAEtE,MAAM,OAAO,WAAY,SAAQ,oBAA6C;IAC5E,MAAM,CAAmB,UAAU,GAAG,OAAO,CAAC,OAAO,CAAA,mCA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CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;QAC9E,MAAM,SAAS,GAAG,IAAI,CAAC,aAAa,CAAC,sBAAsB,CAAC,EAAE,CAAC,CAAC;QAEhE,mBAAmB;QACnB,OAAO,IAAI,CAAA;;sCAEuB,UAAU,CAAC,SAAS,CAAC,YAAY,CAAC,wDAAwD,GAAG,EAAE,CAAC,IAAI,CAAC,WAAW,CAAC,YAAY,CAAC,IAAI,UAAU,CAAC,SAAS,CAAC,kBAAkB,EAAE,EAAC,GAAG,EAAE,SAAS,EAAC,CAAC;kCAChM,UAAU,CAAC,SAAS,CAAC,WAAW,CAAC;;cAErD,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE;YACvB,OAAO,IAAI,CAAC;sBACJ,OAAO;eACd,CAAC;QACJ,CAAC,CAAC;;aAED,CAAC;QACV,kBAAkB;IACpB,CAAC;;AASH,cAAc,CAAC,MAAM,CAAC,mCAAmC,EAAE,WAAW,CAAC,CAAC","sourcesContent":["// Copyright 2024 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport * as i18n from '../../../../core/i18n/i18n.js';\nimport type {CLSCulpritsInsightModel} from '../../../../models/trace/insights/CLSCulprits.js';\nimport * as Trace from '../../../../models/trace/trace.js';\nimport * as LitHtml from '../../../../ui/lit-html/lit-html.js';\nimport type * as Overlays from '../../overlays/overlays.js';\n\nimport {BaseInsightComponent} from './BaseInsightComponent.js';\nimport {EventReferenceClick} from './EventRef.js';\n\nconst {html} = LitHtml;\n\nconst UIStrings = {\n /**\n *@description Text indicating the worst layout shift cluster.\n */\n worstLayoutShiftCluster: 'Worst layout shift cluster',\n /**\n * @description Text indicating the worst layout shift cluster.\n */\n worstCluster: 'Worst cluster',\n /**\n * @description Text indicating a layout shift cluster and its start time.\n * @example {32 ms} PH1\n */\n layoutShiftCluster: 'Layout shift cluster @ {PH1}',\n /**\n *@description Text indicating the biggest reasons for the layout shifts.\n */\n topCulprits: 'Top layout shift culprits',\n /**\n * @description Text for a culprit type of Injected iframe.\n */\n injectedIframe: 'Injected iframe',\n /**\n * @description Text for a culprit type of Font request.\n */\n fontRequest: 'Font request',\n /**\n * @description Text for a culprit type of Animation.\n */\n animation: 'Animation',\n /**\n * @description Text for a culprit type of Unsized images.\n */\n unsizedImages: 'Unsized Images',\n /**\n * @description Text status when there were no layout shifts detected.\n */\n noLayoutShifts: 'No layout shifts',\n /**\n * @description Text status when there no layout shifts culprits/root causes were found.\n */\n noCulprits: 'Could not detect any layout shift culprits',\n};\nconst str_ = i18n.i18n.registerUIStrings('panels/timeline/components/insights/CLSCulprits.ts', UIStrings);\nconst i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);\n\nexport class CLSCulprits extends BaseInsightComponent {\n static override readonly litTagName = LitHtml.literal`devtools-performance-cls-culprits`;\n override internalName: string = 'cls-culprits';\n\n override createOverlays(): Overlays.Overlays.TimelineOverlay[] {\n const clustersByScore =\n this.model?.clusters.toSorted((a, b) => b.clusterCumulativeScore - a.clusterCumulativeScore) ?? [];\n const worstCluster = clustersByScore[0];\n if (!worstCluster) {\n return [];\n }\n\n const range = Trace.Types.Timing.MicroSeconds(worstCluster.dur ?? 0);\n const max = Trace.Types.Timing.MicroSeconds(worstCluster.ts + range);\n\n const label = html`
${i18nString(UIStrings.worstLayoutShiftCluster)}
`;\n return [{\n type: 'TIMESPAN_BREAKDOWN',\n sections: [\n {bounds: {min: worstCluster.ts, range, max}, label, showDuration: false},\n ],\n // This allows for the overlay to sit over the layout shift.\n entry: worstCluster.events[0],\n renderLocation: 'ABOVE_EVENT',\n }];\n }\n\n /**\n * getTopCulprits gets the top 3 shift root causes based on worst cluster.\n */\n getTopCulprits(\n cluster: Trace.Types.Events.SyntheticLayoutShiftCluster,\n culpritsByShift:\n Map): string[] {\n const MAX_TOP_CULPRITS = 3;\n const causes: Array = [];\n if (causes.length === MAX_TOP_CULPRITS) {\n return causes;\n }\n const shifts = cluster.events;\n for (const shift of shifts) {\n if (causes.length === MAX_TOP_CULPRITS) {\n break;\n }\n\n const culprits = culpritsByShift.get(shift);\n if (!culprits) {\n continue;\n }\n const fontReq = culprits.fontRequests;\n const iframes = culprits.iframeIds;\n const animations = culprits.nonCompositedAnimations;\n const unsizedImages = culprits.unsizedImages;\n\n for (let i = 0; i < fontReq.length && causes.length < MAX_TOP_CULPRITS; i++) {\n causes.push(i18nString(UIStrings.fontRequest));\n }\n for (let i = 0; i < iframes.length && causes.length < MAX_TOP_CULPRITS; i++) {\n causes.push(i18nString(UIStrings.injectedIframe));\n }\n for (let i = 0; i < animations.length && causes.length < MAX_TOP_CULPRITS; i++) {\n causes.push(i18nString(UIStrings.animation));\n }\n for (let i = 0; i < unsizedImages.length && causes.length < MAX_TOP_CULPRITS; i++) {\n causes.push(i18nString(UIStrings.unsizedImages));\n }\n }\n return causes.slice(0, MAX_TOP_CULPRITS);\n }\n\n #clickEvent(event: Trace.Types.Events.Event): void {\n this.dispatchEvent(new EventReferenceClick(event));\n }\n\n override renderContent(): LitHtml.LitTemplate {\n if (!this.model || !this.bounds) {\n return LitHtml.nothing;\n }\n\n if (!this.model.clusters.length || !this.model.worstCluster) {\n return html`
${i18nString(UIStrings.noLayoutShifts)}
`;\n }\n\n const worstCluster = this.model.worstCluster;\n const culpritsByShift = this.model.shifts;\n\n // TODO: getTopCulprits needs to move to model.\n const culprits = this.getTopCulprits(worstCluster, culpritsByShift);\n if (culprits.length === 0) {\n return html`
${i18nString(UIStrings.noCulprits)}
`;\n }\n\n const ts = Trace.Types.Timing.MicroSeconds(worstCluster.ts - this.bounds.min);\n const clusterTs = i18n.TimeUtilities.formatMicroSecondsTime(ts);\n\n // clang-format off\n return html`\n
\n ${i18nString(UIStrings.worstCluster)}: \n

${i18nString(UIStrings.topCulprits)}:

\n
    \n ${culprits.map(culprit => {\n return html `\n
  • ${culprit}
  • \n `;\n })}\n
\n
`;\n // clang-format on\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'devtools-performance-cls-culprits': CLSCulprits;\n }\n}\n\ncustomElements.define('devtools-performance-cls-culprits', CLSCulprits);\n"]} \ No newline at end of file +{"version":3,"file":"CLSCulprits.js","sourceRoot":"","sources":["../../../../../../../../front_end/panels/timeline/components/insights/CLSCulprits.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,KAAK,IAAI,MAAM,+BAA+B,CAAC;AAEtD,OAAO,KAAK,KAAK,MAAM,mCAAmC,CAAC;AAC3D,OAAO,KAAK,OAAO,MAAM,qCAAqC,CAAC;AAG/D,OAAO,EAAC,oBAAoB,EAAC,MAAM,2BAA2B,CAAC;AAC/D,OAAO,EAAC,mBAAmB,EAAC,MAAM,eAAe,CAAC;AAElD,MAAM,EAAC,IAAI,EAAC,GAAG,OAAO,CAAC;AAEvB,MAAM,SAAS,GAAG;IAChB;;OAEG;IACH,uBAAuB,EAAE,4BAA4B;IACrD;;OAEG;IACH,YAAY,EAAE,eAAe;IAC7B;;;OAGG;IACH,kBAAkB,EAAE,8BAA8B;IAClD;;OAEG;IACH,WAAW,EAAE,2BAA2B;IACxC;;OAEG;IACH,cAAc,EAAE,iBAAiB;IACjC;;OAEG;IACH,WAAW,EAAE,cAAc;IAC3B;;OAEG;IACH,SAAS,EAAE,WAAW;IACtB;;OAEG;IACH,aAAa,EAAE,gBAAgB;IAC/B;;OAEG;IACH,cAAc,EAAE,kBAAkB;IAClC;;OAEG;IACH,UAAU,EAAE,4CAA4C;CACzD,CAAC;AACF,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,iBAAiB,CAAC,oDAAoD,EAAE,SAAS,CAAC,CAAC;AAC1G,MAAM,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC;AAEtE,MAAM,OAAO,WAAY,SAAQ,oBAA6C;IAC5E,MAAM,CAAmB,UAAU,GAAG,OAAO,CAA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,YAAY,CAAC,EAAE,GAAG,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;QAC9E,MAAM,SAAS,GAAG,IAAI,CAAC,aAAa,CAAC,sBAAsB,CAAC,EAAE,CAAC,CAAC;QAEhE,mBAAmB;QACnB,OAAO,IAAI,CAAA;;sCAEuB,UAAU,CAAC,SAAS,CAAC,YAAY,CAAC,wDAAwD,GAAG,EAAE,CAAC,IAAI,CAAC,WAAW,CAAC,YAAY,CAAC,IAAI,UAAU,CAAC,SAAS,CAAC,kBAAkB,EAAE,EAAC,GAAG,EAAE,SAAS,EAAC,CAAC;kCAChM,UAAU,CAAC,SAAS,CAAC,WAAW,CAAC;;cAErD,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE;YACvB,OAAO,IAAI,CAAC;sBACJ,OAAO;eACd,CAAC;QACJ,CAAC,CAAC;;aAED,CAAC;QACV,kBAAkB;IACpB,CAAC;;AASH,cAAc,CAAC,MAAM,CAAC,mCAAmC,EAAE,WAAW,CAAC,CAAC","sourcesContent":["// Copyright 2024 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport * as i18n from '../../../../core/i18n/i18n.js';\nimport type {CLSCulpritsInsightModel} from '../../../../models/trace/insights/CLSCulprits.js';\nimport * as Trace from '../../../../models/trace/trace.js';\nimport * as LitHtml from '../../../../ui/lit-html/lit-html.js';\nimport type * as Overlays from '../../overlays/overlays.js';\n\nimport {BaseInsightComponent} from './BaseInsightComponent.js';\nimport {EventReferenceClick} from './EventRef.js';\n\nconst {html} = LitHtml;\n\nconst UIStrings = {\n /**\n *@description Text indicating the worst layout shift cluster.\n */\n worstLayoutShiftCluster: 'Worst layout shift cluster',\n /**\n * @description Text indicating the worst layout shift cluster.\n */\n worstCluster: 'Worst cluster',\n /**\n * @description Text indicating a layout shift cluster and its start time.\n * @example {32 ms} PH1\n */\n layoutShiftCluster: 'Layout shift cluster @ {PH1}',\n /**\n *@description Text indicating the biggest reasons for the layout shifts.\n */\n topCulprits: 'Top layout shift culprits',\n /**\n * @description Text for a culprit type of Injected iframe.\n */\n injectedIframe: 'Injected iframe',\n /**\n * @description Text for a culprit type of Font request.\n */\n fontRequest: 'Font request',\n /**\n * @description Text for a culprit type of Animation.\n */\n animation: 'Animation',\n /**\n * @description Text for a culprit type of Unsized images.\n */\n unsizedImages: 'Unsized Images',\n /**\n * @description Text status when there were no layout shifts detected.\n */\n noLayoutShifts: 'No layout shifts',\n /**\n * @description Text status when there no layout shifts culprits/root causes were found.\n */\n noCulprits: 'Could not detect any layout shift culprits',\n};\nconst str_ = i18n.i18n.registerUIStrings('panels/timeline/components/insights/CLSCulprits.ts', UIStrings);\nconst i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);\n\nexport class CLSCulprits extends BaseInsightComponent {\n static override readonly litTagName = LitHtml.StaticHtml.literal`devtools-performance-cls-culprits`;\n override internalName: string = 'cls-culprits';\n\n override createOverlays(): Overlays.Overlays.TimelineOverlay[] {\n const clustersByScore =\n this.model?.clusters.toSorted((a, b) => b.clusterCumulativeScore - a.clusterCumulativeScore) ?? [];\n const worstCluster = clustersByScore[0];\n if (!worstCluster) {\n return [];\n }\n\n const range = Trace.Types.Timing.MicroSeconds(worstCluster.dur ?? 0);\n const max = Trace.Types.Timing.MicroSeconds(worstCluster.ts + range);\n\n const label = html`
${i18nString(UIStrings.worstLayoutShiftCluster)}
`;\n return [{\n type: 'TIMESPAN_BREAKDOWN',\n sections: [\n {bounds: {min: worstCluster.ts, range, max}, label, showDuration: false},\n ],\n // This allows for the overlay to sit over the layout shift.\n entry: worstCluster.events[0],\n renderLocation: 'ABOVE_EVENT',\n }];\n }\n\n /**\n * getTopCulprits gets the top 3 shift root causes based on worst cluster.\n */\n getTopCulprits(\n cluster: Trace.Types.Events.SyntheticLayoutShiftCluster,\n culpritsByShift:\n Map): string[] {\n const MAX_TOP_CULPRITS = 3;\n const causes: Array = [];\n if (causes.length === MAX_TOP_CULPRITS) {\n return causes;\n }\n const shifts = cluster.events;\n for (const shift of shifts) {\n if (causes.length === MAX_TOP_CULPRITS) {\n break;\n }\n\n const culprits = culpritsByShift.get(shift);\n if (!culprits) {\n continue;\n }\n const fontReq = culprits.fontRequests;\n const iframes = culprits.iframeIds;\n const animations = culprits.nonCompositedAnimations;\n const unsizedImages = culprits.unsizedImages;\n\n for (let i = 0; i < fontReq.length && causes.length < MAX_TOP_CULPRITS; i++) {\n causes.push(i18nString(UIStrings.fontRequest));\n }\n for (let i = 0; i < iframes.length && causes.length < MAX_TOP_CULPRITS; i++) {\n causes.push(i18nString(UIStrings.injectedIframe));\n }\n for (let i = 0; i < animations.length && causes.length < MAX_TOP_CULPRITS; i++) {\n causes.push(i18nString(UIStrings.animation));\n }\n for (let i = 0; i < unsizedImages.length && causes.length < MAX_TOP_CULPRITS; i++) {\n causes.push(i18nString(UIStrings.unsizedImages));\n }\n }\n return causes.slice(0, MAX_TOP_CULPRITS);\n }\n\n #clickEvent(event: Trace.Types.Events.Event): void {\n this.dispatchEvent(new EventReferenceClick(event));\n }\n\n override renderContent(): LitHtml.LitTemplate {\n if (!this.model || !this.bounds) {\n return LitHtml.nothing;\n }\n\n if (!this.model.clusters.length || !this.model.worstCluster) {\n return html`
${i18nString(UIStrings.noLayoutShifts)}
`;\n }\n\n const worstCluster = this.model.worstCluster;\n const culpritsByShift = this.model.shifts;\n\n // TODO: getTopCulprits needs to move to model.\n const culprits = this.getTopCulprits(worstCluster, culpritsByShift);\n if (culprits.length === 0) {\n return html`
${i18nString(UIStrings.noCulprits)}
`;\n }\n\n const ts = Trace.Types.Timing.MicroSeconds(worstCluster.ts - this.bounds.min);\n const clusterTs = i18n.TimeUtilities.formatMicroSecondsTime(ts);\n\n // clang-format off\n return html`\n
\n ${i18nString(UIStrings.worstCluster)}: \n

${i18nString(UIStrings.topCulprits)}:

\n
    \n ${culprits.map(culprit => {\n return html `\n
  • ${culprit}
  • \n `;\n })}\n
\n
`;\n // clang-format on\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'devtools-performance-cls-culprits': CLSCulprits;\n }\n}\n\ncustomElements.define('devtools-performance-cls-culprits', CLSCulprits);\n"]} \ No newline at end of file diff --git a/public/panels/timeline/components/insights/CLSCulprits.test.js b/public/panels/timeline/components/insights/CLSCulprits.test.js index aea5d0fa4..b5fb02104 100644 --- a/public/panels/timeline/components/insights/CLSCulprits.test.js +++ b/public/panels/timeline/components/insights/CLSCulprits.test.js @@ -4,9 +4,8 @@ import { getCleanTextContentFromElements, getCleanTextContentFromSingleElement, renderElementIntoDOM, } from '../../../../testing/DOMHelpers.js'; import { describeWithEnvironment } from '../../../../testing/EnvironmentHelpers.js'; import { TraceLoader } from '../../../../testing/TraceLoader.js'; -import * as Coordinator from '../../../../ui/components/render_coordinator/render_coordinator.js'; +import * as RenderCoordinator from '../../../../ui/components/render_coordinator/render_coordinator.js'; import * as Insights from './insights.js'; -const coordinator = Coordinator.RenderCoordinator.RenderCoordinator.instance(); describeWithEnvironment('CLSCulprits component', () => { it('renders unsized image culprits', async function () { const traceData = await TraceLoader.traceEngine(this, 'unsized-images.json.gz'); @@ -19,7 +18,7 @@ describeWithEnvironment('CLSCulprits component', () => { component.bounds = traceData.parsedTrace.Meta.traceBounds; component.selected = true; renderElementIntoDOM(component); - await coordinator.done(); + await RenderCoordinator.done(); assert.isOk(component.shadowRoot); const titleText = getCleanTextContentFromSingleElement(component.shadowRoot, '.insight-title'); assert.strictEqual(titleText, 'Layout shift culprits'); diff --git a/public/panels/timeline/components/insights/CLSCulprits.test.js.map b/public/panels/timeline/components/insights/CLSCulprits.test.js.map index 99f30b9ed..d4d479979 100644 --- a/public/panels/timeline/components/insights/CLSCulprits.test.js.map +++ b/public/panels/timeline/components/insights/CLSCulprits.test.js.map @@ -1 +1 @@ -{"version":3,"file":"CLSCulprits.test.js","sourceRoot":"","sources":["../../../../../../../../front_end/panels/timeline/components/insights/CLSCulprits.test.ts"],"names":[],"mappings":"AAAA,4DA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MAAM,SAAS,GAAG,oCAAoC,CAAC,SAAS,CAAC,UAAU,EAAE,gBAAgB,CAAC,CAAC;QAC/F,MAAM,CAAC,WAAW,CAAC,SAAS,EAAE,uBAAuB,CAAC,CAAC;QAEvD,MAAM,gBAAgB,GAAG,oCAAoC,CAAC,SAAS,CAAC,UAAU,EAAE,gBAAgB,CAAC,CAAC;QACtG,MAAM,CAAC,WAAW,CAAC,gBAAgB,EAAE,8CAA8C,CAAC,CAAC;QAErF,MAAM,YAAY,GAAG,SAAS,CAAC,UAAU,CAAC,aAAa,CAAmB,iBAAiB,CAAC,CAAC;QAC7F,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;QAC1B,MAAM,YAAY,GAAG,+BAA+B,CAAC,YAAY,EAAE,IAAI,CAAC,CAAC;QACzE,+CAA+C;QAC/C,MAAM,CAAC,SAAS,CAAC,YAAY,EAAE,CAAC,gBAAgB,EAAE,gBAAgB,CAAC,CAAC,CAAC;IACvE,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["// Copyright 2024 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport {\n getCleanTextContentFromElements,\n getCleanTextContentFromSingleElement,\n renderElementIntoDOM,\n} from '../../../../testing/DOMHelpers.js';\nimport {describeWithEnvironment} from '../../../../testing/EnvironmentHelpers.js';\nimport {TraceLoader} from '../../../../testing/TraceLoader.js';\nimport * as Coordinator from '../../../../ui/components/render_coordinator/render_coordinator.js';\n\nimport * as Insights from './insights.js';\n\nconst coordinator = Coordinator.RenderCoordinator.RenderCoordinator.instance();\ndescribeWithEnvironment('CLSCulprits component', () => {\n it('renders unsized image culprits', async function() {\n const traceData = await TraceLoader.traceEngine(this, 'unsized-images.json.gz');\n const firstNavInsights = traceData.insights?.values().next()?.value;\n assert.isOk(firstNavInsights);\n const clsModel = firstNavInsights.model.CLSCulprits;\n const component = new Insights.CLSCulprits.CLSCulprits();\n component.model = clsModel;\n component.insightSetKey = firstNavInsights.id;\n component.bounds = traceData.parsedTrace.Meta.traceBounds;\n component.selected = true;\n\n renderElementIntoDOM(component);\n await coordinator.done();\n assert.isOk(component.shadowRoot);\n\n const titleText = getCleanTextContentFromSingleElement(component.shadowRoot, '.insight-title');\n assert.strictEqual(titleText, 'Layout shift culprits');\n\n const worstClusterText = getCleanTextContentFromSingleElement(component.shadowRoot, '.worst-cluster');\n assert.strictEqual(worstClusterText, 'Worst cluster: Layout shift cluster @ 1.37 s');\n\n const culpritsList = component.shadowRoot.querySelector('.worst-culprits');\n assert.isOk(culpritsList);\n const culpritsText = getCleanTextContentFromElements(culpritsList, 'li');\n // There are two shifts hence the two culprits.\n assert.deepEqual(culpritsText, ['Unsized Images', 'Unsized Images']);\n });\n});\n"]} \ No newline at end of file +{"version":3,"file":"CLSCulprits.test.js","sourceRoot":"","sources":["../../../../../../../../front_end/panels/timeline/components/insights/CLSCulprits.test.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,EACL,+BAA+B,EAC/B,oCAAoC,EACpC,oBAAoB,GACrB,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EAAC,uBAAuB,EAAC,MAAM,2CAA2C,CAAC;AAClF,OAAO,EAAC,WAAW,EAAC,MAAM,oCAAoC,CAAC;AAC/D,OAAO,KAAK,iBAAiB,MAAM,oEAAoE,CAAC;AAExG,OAAO,KAAK,QAAQ,MAAM,eAAe,CAAC;AAE1C,uBAAuB,CAAC,uBAAuB,EAAE,GAAG,EAAE;IACpD,EAAE,CAAC,gCAAgC,EAAE,KAAK;QACxC,MAAM,SAAS,GAAG,MAAM,WAAW,CAAC,WAAW,CAAC,IAAI,EAAE,wBAAwB,CAAC,CAAC;QAChF,MAAM,gBAAgB,GAAG,SAAS,CAAC,QAAQ,EAAE,MAAM,EAAE,CAAC,IAAI,EAAE,EAAE,KAAK,CAAC;QACpE,MAAM,CAAC,IAAI,CAAC,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governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport {\n getCleanTextContentFromElements,\n getCleanTextContentFromSingleElement,\n renderElementIntoDOM,\n} from '../../../../testing/DOMHelpers.js';\nimport {describeWithEnvironment} from '../../../../testing/EnvironmentHelpers.js';\nimport {TraceLoader} from '../../../../testing/TraceLoader.js';\nimport * as RenderCoordinator from '../../../../ui/components/render_coordinator/render_coordinator.js';\n\nimport * as Insights from './insights.js';\n\ndescribeWithEnvironment('CLSCulprits component', () => {\n it('renders unsized image culprits', async function() {\n const traceData = await TraceLoader.traceEngine(this, 'unsized-images.json.gz');\n const firstNavInsights = traceData.insights?.values().next()?.value;\n assert.isOk(firstNavInsights);\n const clsModel = firstNavInsights.model.CLSCulprits;\n const component = new Insights.CLSCulprits.CLSCulprits();\n component.model = clsModel;\n component.insightSetKey = firstNavInsights.id;\n component.bounds = traceData.parsedTrace.Meta.traceBounds;\n component.selected = true;\n\n renderElementIntoDOM(component);\n await RenderCoordinator.done();\n assert.isOk(component.shadowRoot);\n\n const titleText = getCleanTextContentFromSingleElement(component.shadowRoot, '.insight-title');\n assert.strictEqual(titleText, 'Layout shift culprits');\n\n const worstClusterText = getCleanTextContentFromSingleElement(component.shadowRoot, '.worst-cluster');\n assert.strictEqual(worstClusterText, 'Worst cluster: Layout shift cluster @ 1.37 s');\n\n const culpritsList = component.shadowRoot.querySelector('.worst-culprits');\n assert.isOk(culpritsList);\n const culpritsText = getCleanTextContentFromElements(culpritsList, 'li');\n // There are two shifts hence the two culprits.\n assert.deepEqual(culpritsText, ['Unsized Images', 'Unsized Images']);\n });\n});\n"]} \ No newline at end of file diff --git a/public/panels/timeline/components/insights/DOMSize.d.ts b/public/panels/timeline/components/insights/DOMSize.d.ts index ab4607fdd..a4783d538 100644 --- a/public/panels/timeline/components/insights/DOMSize.d.ts +++ b/public/panels/timeline/components/insights/DOMSize.d.ts @@ -4,7 +4,7 @@ import * as LitHtml from '../../../../ui/lit-html/lit-html.js'; import type * as Overlays from '../../overlays/overlays.js'; import { BaseInsightComponent } from './BaseInsightComponent.js'; export declare class DOMSize extends BaseInsightComponent { - static readonly litTagName: import("../../../../ui/lit-html/static.js").Static; + static readonly litTagName: LitHtml.StaticHtml.StaticValue; internalName: string; createOverlays(): Overlays.Overlays.TimelineOverlay[]; renderContent(): LitHtml.LitTemplate; diff --git a/public/panels/timeline/components/insights/DOMSize.js b/public/panels/timeline/components/insights/DOMSize.js index 085350a18..65c68ab27 100644 --- a/public/panels/timeline/components/insights/DOMSize.js +++ b/public/panels/timeline/components/insights/DOMSize.js @@ -15,7 +15,7 @@ const str_ = i18n.i18n.registerUIStrings('panels/timeline/components/insights/DO const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_); const { html } = LitHtml; export class DOMSize extends BaseInsightComponent { - static litTagName = LitHtml.literal `devtools-performance-dom-size`; + static litTagName = LitHtml.StaticHtml.literal `devtools-performance-dom-size`; internalName = 'dom-size'; createOverlays() { if (!this.model) { diff --git a/public/panels/timeline/components/insights/DOMSize.js.map b/public/panels/timeline/components/insights/DOMSize.js.map index 258596124..1dd097407 100644 --- a/public/panels/timeline/components/insights/DOMSize.js.map +++ b/public/panels/timeline/components/insights/DOMSize.js.map @@ -1 +1 @@ -{"version":3,"file":"DOMSize.js","sourceRoot":"","sources":["../../../../../../../../front_end/panels/timeline/components/insights/DOMSize.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,sDAAsD,CAAC;AAE9D,OAAO,KAAK,IAAI,MAAM,+BAA+B,CAAC;AAEtD,OAAO,KAAK,OAAO,MAAM,qCAAqC,CAAC;AAG/D,OAAO,EAAC,oBAAoB,EAAC,MAAM,2BAA2B,CAAC;AAE/D,MAAM,SAAS,GAAG;IAChB;;OAEG;IACH,kBAAkB,EAAE,yCAAyC;CAC9D,CAAC;AAEF,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,iBAAiB,CAAC,gDAAgD,EAAE,SAAS,CAAC,CAAC;AACtG,MAAM,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC;AAEtE,MAAM,EAAC,IAAI,EAAC,GAAG,OAAO,CAAC;AAEvB,MAAM,OAAO,OAAQ,SAAQ,oBAAyC;IACpE,MAAM,CAAmB,UAAU,GAAG,OAAO,CAAC,OAAO,CAAA,+BAA+B,CAAC;IAC5E,YAAY,GAAW,UAAU,CAAC;IAElC,cAAc;QACrB,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC;YAChB,OAAO,EAAE,CAAC;QACZ,CAAC;QAED,MAAM,OAAO,GAAG,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,iBAAiB,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,kBAAkB,CAAC,CAAC;QACpF,OAAO,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;YACR,IAAI,EAAE,eAAe;YACrB,KAAK;YACL,aAAa,EAAE,OAAO;SACvB,CAAC,CAAC,CAAC;IACzB,CAAC;IAEQ,aAAa;QACpB,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC;YAChB,OAAO,OAAO,CAAC,OAAO,CAAC;QACzB,CAAC;QAED,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,iBAAiB,CAAC,MAAM,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,kBAAkB,CAAC,MAAM,EAAE,CAAC;YAClF,OAAO,IAAI,CAAA,gCAAgC,UAAU,CAAC,SAAS,CAAC,kBAAkB,CAAC,QAAQ,CAAC;QAC9F,CAAC;QAED,OAAO,OAAO,CAAC,OAAO,CAAC;IACzB,CAAC;;AASH,cAAc,CAAC,MAAM,CAAC,+BAA+B,EAAE,OAAO,CAAC,CAAC","sourcesContent":["// Copyright 2024 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport '../../../../ui/components/icon_button/icon_button.js';\n\nimport * as i18n from '../../../../core/i18n/i18n.js';\nimport type {DOMSizeInsightModel} from '../../../../models/trace/insights/DOMSize.js';\nimport * as LitHtml from '../../../../ui/lit-html/lit-html.js';\nimport type * as Overlays from '../../overlays/overlays.js';\n\nimport {BaseInsightComponent} from './BaseInsightComponent.js';\n\nconst UIStrings = {\n /**\n * @description Text status indicating that browser operations to re-render the page were not impacted by the size of the DOM. \"DOM\" is an acronym and should not be translated.\n */\n noLargeRenderTasks: 'No rendering tasks impacted by DOM size',\n};\n\nconst str_ = i18n.i18n.registerUIStrings('panels/timeline/components/insights/DOMSize.ts', UIStrings);\nconst i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);\n\nconst {html} = LitHtml;\n\nexport class DOMSize extends BaseInsightComponent {\n static override readonly litTagName = LitHtml.literal`devtools-performance-dom-size`;\n override internalName: string = 'dom-size';\n\n override createOverlays(): Overlays.Overlays.TimelineOverlay[] {\n if (!this.model) {\n return [];\n }\n\n const entries = [...this.model.largeStyleRecalcs, ...this.model.largeLayoutUpdates];\n return entries.map(entry => ({\n type: 'ENTRY_OUTLINE',\n entry,\n outlineReason: 'ERROR',\n }));\n }\n\n override renderContent(): LitHtml.LitTemplate {\n if (!this.model) {\n return LitHtml.nothing;\n }\n\n if (!this.model.largeStyleRecalcs.length && !this.model.largeLayoutUpdates.length) {\n return html`
${i18nString(UIStrings.noLargeRenderTasks)}
`;\n }\n\n return LitHtml.nothing;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'devtools-performance-dom-size': DOMSize;\n }\n}\n\ncustomElements.define('devtools-performance-dom-size', DOMSize);\n"]} \ No newline at end of file +{"version":3,"file":"DOMSize.js","sourceRoot":"","sources":["../../../../../../../../front_end/panels/timeline/components/insights/DOMSize.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,sDAAsD,CAAC;AAE9D,OAAO,KAAK,IAAI,MAAM,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I,CAAA,gCAAgC,UAAU,CAAC,SAAS,CAAC,kBAAkB,CAAC,QAAQ,CAAC;QAC9F,CAAC;QAED,OAAO,OAAO,CAAC,OAAO,CAAC;IACzB,CAAC;;AASH,cAAc,CAAC,MAAM,CAAC,+BAA+B,EAAE,OAAO,CAAC,CAAC","sourcesContent":["// Copyright 2024 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport '../../../../ui/components/icon_button/icon_button.js';\n\nimport * as i18n from '../../../../core/i18n/i18n.js';\nimport type {DOMSizeInsightModel} from '../../../../models/trace/insights/DOMSize.js';\nimport * as LitHtml from '../../../../ui/lit-html/lit-html.js';\nimport type * as Overlays from '../../overlays/overlays.js';\n\nimport {BaseInsightComponent} from './BaseInsightComponent.js';\n\nconst UIStrings = {\n /**\n * @description Text status indicating that browser operations to re-render the page were not impacted by the size of the DOM. \"DOM\" is an acronym and should not be translated.\n */\n noLargeRenderTasks: 'No rendering tasks impacted by DOM size',\n};\n\nconst str_ = i18n.i18n.registerUIStrings('panels/timeline/components/insights/DOMSize.ts', UIStrings);\nconst i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);\n\nconst {html} = LitHtml;\n\nexport class DOMSize extends BaseInsightComponent {\n static override readonly litTagName = LitHtml.StaticHtml.literal`devtools-performance-dom-size`;\n override internalName: string = 'dom-size';\n\n override createOverlays(): Overlays.Overlays.TimelineOverlay[] {\n if (!this.model) {\n return [];\n }\n\n const entries = [...this.model.largeStyleRecalcs, ...this.model.largeLayoutUpdates];\n return entries.map(entry => ({\n type: 'ENTRY_OUTLINE',\n entry,\n outlineReason: 'ERROR',\n }));\n }\n\n override renderContent(): LitHtml.LitTemplate {\n if (!this.model) {\n return LitHtml.nothing;\n }\n\n if (!this.model.largeStyleRecalcs.length && !this.model.largeLayoutUpdates.length) {\n return html`
${i18nString(UIStrings.noLargeRenderTasks)}
`;\n }\n\n return LitHtml.nothing;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'devtools-performance-dom-size': DOMSize;\n }\n}\n\ncustomElements.define('devtools-performance-dom-size', DOMSize);\n"]} \ No newline at end of file diff --git a/public/panels/timeline/components/insights/DocumentLatency.d.ts b/public/panels/timeline/components/insights/DocumentLatency.d.ts index 4495c900f..3da58dc5a 100644 --- a/public/panels/timeline/components/insights/DocumentLatency.d.ts +++ b/public/panels/timeline/components/insights/DocumentLatency.d.ts @@ -6,7 +6,7 @@ import type * as Overlays from '../../overlays/overlays.js'; import { BaseInsightComponent } from './BaseInsightComponent.js'; export declare class DocumentLatency extends BaseInsightComponent { #private; - static readonly litTagName: import("../../../../ui/lit-html/static.js").Static; + static readonly litTagName: LitHtml.StaticHtml.StaticValue; internalName: string; createOverlays(): Overlays.Overlays.TimelineOverlay[]; getEstimatedSavingsTime(): Trace.Types.Timing.MilliSeconds | null; diff --git a/public/panels/timeline/components/insights/DocumentLatency.js b/public/panels/timeline/components/insights/DocumentLatency.js index 5de2af0f4..1b0d7db01 100644 --- a/public/panels/timeline/components/insights/DocumentLatency.js +++ b/public/panels/timeline/components/insights/DocumentLatency.js @@ -58,7 +58,7 @@ const UIStrings = { const str_ = i18n.i18n.registerUIStrings('panels/timeline/components/insights/DocumentLatency.ts', UIStrings); const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_); export class DocumentLatency extends BaseInsightComponent { - static litTagName = LitHtml.literal `devtools-performance-document-latency`; + static litTagName = LitHtml.StaticHtml.literal `devtools-performance-document-latency`; internalName = 'document-latency'; #check(didPass, good, bad) { const icon = didPass ? 'check-circle' : 'clear'; diff --git a/public/panels/timeline/components/insights/DocumentLatency.js.map b/public/panels/timeline/components/insights/DocumentLatency.js.map index a8b009d6a..6c39e8868 100644 --- a/public/panels/timeline/components/insights/DocumentLatency.js.map +++ b/public/panels/timeline/components/insights/DocumentLatency.js.map @@ -1 +1 @@ -{"version":3,"file":"DocumentLatency.js","sourceRoot":"","sources":["../../../../../../../../front_end/panels/timeline/components/insights/Docum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AC,SAAS,CAAC,eAAe,CAAC,CAAC;;;cAG9E,IAAI,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,qBAAqB,EAClD,UAAU,CAAC,SAAS,CAAC,yBAAyB,CAAC,EAAE,UAAU,CAAC,SAAS,CAAC,wBAAwB,CAAC,CAAC;;;cAGhG,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,yBAAyB,KAAK,CAAC,EAC3D,UAAU,CAAC,SAAS,CAAC,sBAAsB,CAAC,EAAE,UAAU,CAAC,SAAS,CAAC,qBAAqB,CAAC,CAAC;;;aAG3F,CAAC;QACV,kBAAkB;IACpB,CAAC;;AASH,cAAc,CAAC,MAAM,CAAC,uCAAuC,EAAE,eAAe,CAAC,CAAC","sourcesContent":["// Copyright 2024 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport '../../../../ui/components/icon_button/icon_button.js';\n\nimport * as i18n from '../../../../core/i18n/i18n.js';\nimport type {DocumentLatencyInsightModel} from '../../../../models/trace/insights/DocumentLatency.js';\nimport * as Trace from '../../../../models/trace/trace.js';\nimport * as LitHtml from '../../../../ui/lit-html/lit-html.js';\nimport type * as Overlays from '../../overlays/overlays.js';\n\nimport {BaseInsightComponent} from './BaseInsightComponent.js';\n\nconst {html} = LitHtml;\n\nconst UIStrings = {\n /**\n * @description Text to tell the user that the document request does not have redirects.\n */\n passingRedirects: 'Avoids redirects',\n /**\n * @description Text to tell the user that the document request had redirects.\n */\n failedRedirects: 'Had redirects',\n /**\n * @description Text to tell the user that the time starting the document request to when the server started responding is acceptable.\n */\n passingServerResponseTime: 'Server responds quickly',\n /**\n * @description Text to tell the user that the time starting the document request to when the server started responding is not acceptable.\n */\n failedServerResponseTime: 'Server responded slowly',\n /**\n * @description Text to tell the user that text compression (like gzip) was applied.\n */\n passingTextCompression: 'Applies text compression',\n /**\n * @description Text to tell the user that text compression (like gzip) was not applied.\n */\n failedTextCompression: 'No compression applied',\n /**\n * @description Text for a label describing a network request event as having redirects.\n */\n redirectsLabel: 'Redirects',\n /**\n * @description Text for a label describing a network request event as taking too long to start delivery by the server.\n */\n serverResponseTimeLabel: 'Server response time',\n /**\n * @description Text for a label describing a network request event as taking longer to download because it wasn't compressed.\n */\n uncompressedDownload: 'Uncompressed download',\n /**\n *@description Text for a screen-reader label to tell the user that the icon represents a successful insight check\n *@example {Server response time} PH1\n */\n successAriaLabel: 'Insight check passed: {PH1}',\n /**\n *@description Text for a screen-reader label to tell the user that the icon represents an unsuccessful insight check\n *@example {Server response time} PH1\n */\n failedAriaLabel: 'Insight check failed: {PH1}',\n};\n\nconst str_ = i18n.i18n.registerUIStrings('panels/timeline/components/insights/DocumentLatency.ts', UIStrings);\nconst i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);\n\nexport class DocumentLatency extends BaseInsightComponent {\n static override readonly litTagName = LitHtml.literal`devtools-performance-document-latency`;\n override internalName: string = 'document-latency';\n\n #check(didPass: boolean, good: string, bad: string): LitHtml.TemplateResult {\n const icon = didPass ? 'check-circle' : 'clear';\n\n const ariaLabel = didPass ? i18nString(UIStrings.successAriaLabel, {PH1: good}) :\n i18nString(UIStrings.failedAriaLabel, {PH1: bad});\n return html`\n \n ${didPass ? good : bad}\n `;\n }\n\n override createOverlays(): Overlays.Overlays.TimelineOverlay[] {\n if (!this.model?.data?.documentRequest) {\n return [];\n }\n\n const overlays: Overlays.Overlays.TimelineOverlay[] = [];\n const event = this.model.data.documentRequest;\n const redirectDurationMicro = Trace.Helpers.Timing.millisecondsToMicroseconds(this.model.data.redirectDuration);\n\n const sections = [];\n if (this.model.data.redirectDuration) {\n const bounds = Trace.Helpers.Timing.traceWindowFromMicroSeconds(\n event.ts,\n (event.ts + redirectDurationMicro) as Trace.Types.Timing.MicroSeconds,\n );\n sections.push({bounds, label: i18nString(UIStrings.redirectsLabel), showDuration: true});\n overlays.push({type: 'CANDY_STRIPED_TIME_RANGE', bounds, entry: event});\n }\n if (this.model.data.serverResponseTooSlow) {\n const serverResponseTimeMicro =\n Trace.Helpers.Timing.millisecondsToMicroseconds(this.model.data.serverResponseTime);\n // NOTE: NetworkRequestHandlers never makes a synthetic network request event if `timing` is missing.\n const sendEnd = event.args.data.timing?.sendEnd ?? Trace.Types.Timing.MilliSeconds(0);\n const sendEndMicro = Trace.Helpers.Timing.millisecondsToMicroseconds(sendEnd);\n const bounds = Trace.Helpers.Timing.traceWindowFromMicroSeconds(\n sendEndMicro,\n (sendEndMicro + serverResponseTimeMicro) as Trace.Types.Timing.MicroSeconds,\n );\n sections.push({bounds, label: i18nString(UIStrings.serverResponseTimeLabel), showDuration: true});\n }\n if (this.model.data.uncompressedResponseBytes) {\n const bounds = Trace.Helpers.Timing.traceWindowFromMicroSeconds(\n event.args.data.syntheticData.downloadStart,\n (event.args.data.syntheticData.downloadStart + event.args.data.syntheticData.download) as\n Trace.Types.Timing.MicroSeconds,\n );\n sections.push({bounds, label: i18nString(UIStrings.uncompressedDownload), showDuration: true});\n overlays.push({type: 'CANDY_STRIPED_TIME_RANGE', bounds, entry: event});\n }\n\n if (sections.length) {\n overlays.push({\n type: 'TIMESPAN_BREAKDOWN',\n sections,\n entry: this.model.data.documentRequest,\n // Always render below because the document request is guaranteed to be\n // the first request in the network track.\n renderLocation: 'BELOW_EVENT',\n });\n }\n overlays.push({\n type: 'ENTRY_SELECTED',\n entry: this.model.data.documentRequest,\n });\n\n return overlays;\n }\n\n override getEstimatedSavingsTime(): Trace.Types.Timing.MilliSeconds|null {\n return this.model?.metricSavings?.FCP ?? null;\n }\n\n override getEstimatedSavingsBytes(): number|null {\n return this.model?.data?.uncompressedResponseBytes ?? null;\n }\n\n override renderContent(): LitHtml.LitTemplate {\n if (!this.model?.data) {\n return LitHtml.nothing;\n }\n\n // clang-format off\n return html`\n
\n
    \n
  • \n ${this.#check(this.model.data.redirectDuration === 0,\n i18nString(UIStrings.passingRedirects), i18nString(UIStrings.failedRedirects))}\n
  • \n
  • \n ${this.#check(!this.model.data.serverResponseTooSlow,\n i18nString(UIStrings.passingServerResponseTime), i18nString(UIStrings.failedServerResponseTime))}\n
  • \n
  • \n ${this.#check(this.model.data.uncompressedResponseBytes === 0,\n i18nString(UIStrings.passingTextCompression), i18nString(UIStrings.failedTextCompression))}\n
  • \n
\n
`;\n // clang-format on\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'devtools-performance-document-latency': DocumentLatency;\n }\n}\n\ncustomElements.define('devtools-performance-document-latency', DocumentLatency);\n"]} \ No newline at end of file +{"version":3,"file":"DocumentLatency.js","sourceRoot":"","sources":["../../../../../../../../front_end/panels/timeline/components/insights/DocumentLatency.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,sDAAsD,CAAC;AAE9D,OAAO,KAAK,IAAI,MAAM,+BAA+B,CAAC;AAEtD,OAAO,KAAK,KAAK,MAAM,mCAAmC,CAAC;AAC3D,OAAO,KAAK,OAAO,MAAM,qCAAqC,CAAC;AAG/D,OAAO,EAAC,oBAAoB,EAAC,MAAM,2BAA2B,CAAC;AAE/D,MAAM,EAAC,IAAI,EAAC,GAAG,OAAO,CAAC;AAEvB,MAAM,SAAS,GAAG;IAChB;;OAEG;IACH,gBAAgB,EAAE,kBAAkB;IACpC;;OAEG;IACH,eAAe,EAAE,eAAe;IAChC;;OAEG;IACH,yBAAyB,EAAE,yBAAyB;IACpD;;OAEG;IACH,wBAAwB,EAAE,yBAAyB;IACnD;;OAEG;IACH,sBAAsB,EAAE,0BAA0B;IAClD;;OAEG;IACH,qBAAqB,EAAE,wBAAwB;IAC/C;;OAEG;IACH,cAAc,EAAE,WAAW;IAC3B;;OAEG;IACH,uBAAuB,EAAE,sBAAsB;IAC/C;;OAEG;IACH,oBAAoB,EAAE,uBAAuB;IAC7C;;;OAGG;IACH,gBAAgB,EAAE,6BAA6B;IAC/C;;;OAGG;IACH,eAAe,EAA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GAAG,IAAI,IAAI,CAAC;IAChD,CAAC;IAEQ,wBAAwB;QAC/B,OAAO,IAAI,CAAC,KAAK,EAAE,IAAI,EAAE,yBAAyB,IAAI,IAAI,CAAC;IAC7D,CAAC;IAEQ,aAAa;QACpB,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,EAAE,CAAC;YACtB,OAAO,OAAO,CAAC,OAAO,CAAC;QACzB,CAAC;QAED,mBAAmB;QACnB,OAAO,IAAI,CAAA;;;;cAID,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,gBAAgB,KAAK,CAAC,EAClD,UAAU,CAAC,SAAS,CAAC,gBAAgB,CAAC,EAAE,UAAU,CAAC,SAAS,CAAC,eAAe,CAAC,CAAC;;;cAG9E,IAAI,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,qBAAqB,EAClD,UAAU,CAAC,SAAS,CAAC,yBAAyB,CAAC,EAAE,UAAU,CAAC,SAAS,CAAC,wBAAwB,CAAC,CAAC;;;cAGhG,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,yBAAyB,KAAK,CAAC,EAC3D,UAAU,CAAC,SAAS,CAAC,sBAAsB,CAAC,EAAE,UAAU,CAAC,SAAS,CAAC,qBAAqB,CAAC,CAAC;;;aAG3F,CAAC;QACV,kBAAkB;IACpB,CAAC;;AASH,cAAc,CAAC,MAAM,CAAC,uCAAuC,EAAE,eAAe,CAAC,CAAC","sourcesContent":["// Copyright 2024 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport '../../../../ui/components/icon_button/icon_button.js';\n\nimport * as i18n from '../../../../core/i18n/i18n.js';\nimport type {DocumentLatencyInsightModel} from '../../../../models/trace/insights/DocumentLatency.js';\nimport * as Trace from '../../../../models/trace/trace.js';\nimport * as LitHtml from '../../../../ui/lit-html/lit-html.js';\nimport type * as Overlays from '../../overlays/overlays.js';\n\nimport {BaseInsightComponent} from './BaseInsightComponent.js';\n\nconst {html} = LitHtml;\n\nconst UIStrings = {\n /**\n * @description Text to tell the user that the document request does not have redirects.\n */\n passingRedirects: 'Avoids redirects',\n /**\n * @description Text to tell the user that the document request had redirects.\n */\n failedRedirects: 'Had redirects',\n /**\n * @description Text to tell the user that the time starting the document request to when the server started responding is acceptable.\n */\n passingServerResponseTime: 'Server responds quickly',\n /**\n * @description Text to tell the user that the time starting the document request to when the server started responding is not acceptable.\n */\n failedServerResponseTime: 'Server responded slowly',\n /**\n * @description Text to tell the user that text compression (like gzip) was applied.\n */\n passingTextCompression: 'Applies text compression',\n /**\n * @description Text to tell the user that text compression (like gzip) was not applied.\n */\n failedTextCompression: 'No compression applied',\n /**\n * @description Text for a label describing a network request event as having redirects.\n */\n redirectsLabel: 'Redirects',\n /**\n * @description Text for a label describing a network request event as taking too long to start delivery by the server.\n */\n serverResponseTimeLabel: 'Server response time',\n /**\n * @description Text for a label describing a network request event as taking longer to download because it wasn't compressed.\n */\n uncompressedDownload: 'Uncompressed download',\n /**\n *@description Text for a screen-reader label to tell the user that the icon represents a successful insight check\n *@example {Server response time} PH1\n */\n successAriaLabel: 'Insight check passed: {PH1}',\n /**\n *@description Text for a screen-reader label to tell the user that the icon represents an unsuccessful insight check\n *@example {Server response time} PH1\n */\n failedAriaLabel: 'Insight check failed: {PH1}',\n};\n\nconst str_ = i18n.i18n.registerUIStrings('panels/timeline/components/insights/DocumentLatency.ts', UIStrings);\nconst i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);\n\nexport class DocumentLatency extends BaseInsightComponent {\n static override readonly litTagName = LitHtml.StaticHtml.literal`devtools-performance-document-latency`;\n override internalName: string = 'document-latency';\n\n #check(didPass: boolean, good: string, bad: string): LitHtml.TemplateResult {\n const icon = didPass ? 'check-circle' : 'clear';\n\n const ariaLabel = didPass ? i18nString(UIStrings.successAriaLabel, {PH1: good}) :\n i18nString(UIStrings.failedAriaLabel, {PH1: bad});\n return html`\n \n ${didPass ? good : bad}\n `;\n }\n\n override createOverlays(): Overlays.Overlays.TimelineOverlay[] {\n if (!this.model?.data?.documentRequest) {\n return [];\n }\n\n const overlays: Overlays.Overlays.TimelineOverlay[] = [];\n const event = this.model.data.documentRequest;\n const redirectDurationMicro = Trace.Helpers.Timing.millisecondsToMicroseconds(this.model.data.redirectDuration);\n\n const sections = [];\n if (this.model.data.redirectDuration) {\n const bounds = Trace.Helpers.Timing.traceWindowFromMicroSeconds(\n event.ts,\n (event.ts + redirectDurationMicro) as Trace.Types.Timing.MicroSeconds,\n );\n sections.push({bounds, label: i18nString(UIStrings.redirectsLabel), showDuration: true});\n overlays.push({type: 'CANDY_STRIPED_TIME_RANGE', bounds, entry: event});\n }\n if (this.model.data.serverResponseTooSlow) {\n const serverResponseTimeMicro =\n Trace.Helpers.Timing.millisecondsToMicroseconds(this.model.data.serverResponseTime);\n // NOTE: NetworkRequestHandlers never makes a synthetic network request event if `timing` is missing.\n const sendEnd = event.args.data.timing?.sendEnd ?? Trace.Types.Timing.MilliSeconds(0);\n const sendEndMicro = Trace.Helpers.Timing.millisecondsToMicroseconds(sendEnd);\n const bounds = Trace.Helpers.Timing.traceWindowFromMicroSeconds(\n sendEndMicro,\n (sendEndMicro + serverResponseTimeMicro) as Trace.Types.Timing.MicroSeconds,\n );\n sections.push({bounds, label: i18nString(UIStrings.serverResponseTimeLabel), showDuration: true});\n }\n if (this.model.data.uncompressedResponseBytes) {\n const bounds = Trace.Helpers.Timing.traceWindowFromMicroSeconds(\n event.args.data.syntheticData.downloadStart,\n (event.args.data.syntheticData.downloadStart + event.args.data.syntheticData.download) as\n Trace.Types.Timing.MicroSeconds,\n );\n sections.push({bounds, label: i18nString(UIStrings.uncompressedDownload), showDuration: true});\n overlays.push({type: 'CANDY_STRIPED_TIME_RANGE', bounds, entry: event});\n }\n\n if (sections.length) {\n overlays.push({\n type: 'TIMESPAN_BREAKDOWN',\n sections,\n entry: this.model.data.documentRequest,\n // Always render below because the document request is guaranteed to be\n // the first request in the network track.\n renderLocation: 'BELOW_EVENT',\n });\n }\n overlays.push({\n type: 'ENTRY_SELECTED',\n entry: this.model.data.documentRequest,\n });\n\n return overlays;\n }\n\n override getEstimatedSavingsTime(): Trace.Types.Timing.MilliSeconds|null {\n return this.model?.metricSavings?.FCP ?? null;\n }\n\n override getEstimatedSavingsBytes(): number|null {\n return this.model?.data?.uncompressedResponseBytes ?? null;\n }\n\n override renderContent(): LitHtml.LitTemplate {\n if (!this.model?.data) {\n return LitHtml.nothing;\n }\n\n // clang-format off\n return html`\n
\n
    \n
  • \n ${this.#check(this.model.data.redirectDuration === 0,\n i18nString(UIStrings.passingRedirects), i18nString(UIStrings.failedRedirects))}\n
  • \n
  • \n ${this.#check(!this.model.data.serverResponseTooSlow,\n i18nString(UIStrings.passingServerResponseTime), i18nString(UIStrings.failedServerResponseTime))}\n
  • \n
  • \n ${this.#check(this.model.data.uncompressedResponseBytes === 0,\n i18nString(UIStrings.passingTextCompression), i18nString(UIStrings.failedTextCompression))}\n
  • \n
\n
`;\n // clang-format on\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'devtools-performance-document-latency': DocumentLatency;\n }\n}\n\ncustomElements.define('devtools-performance-document-latency', DocumentLatency);\n"]} \ No newline at end of file diff --git a/public/panels/timeline/components/insights/FontDisplay.d.ts b/public/panels/timeline/components/insights/FontDisplay.d.ts index ae4683ed1..df25f85f6 100644 --- a/public/panels/timeline/components/insights/FontDisplay.d.ts +++ b/public/panels/timeline/components/insights/FontDisplay.d.ts @@ -6,7 +6,7 @@ import type * as Overlays from '../../overlays/overlays.js'; import { BaseInsightComponent } from './BaseInsightComponent.js'; export declare class FontDisplay extends BaseInsightComponent { #private; - static readonly litTagName: import("../../../../ui/lit-html/static.js").Static; + static readonly litTagName: LitHtml.StaticHtml.StaticValue; internalName: string; createOverlays(): Overlays.Overlays.TimelineOverlay[]; getEstimatedSavingsTime(): Trace.Types.Timing.MilliSeconds | null; diff --git a/public/panels/timeline/components/insights/FontDisplay.js b/public/panels/timeline/components/insights/FontDisplay.js index 0cff5b9b3..7e02ce916 100644 --- a/public/panels/timeline/components/insights/FontDisplay.js +++ b/public/panels/timeline/components/insights/FontDisplay.js @@ -16,7 +16,7 @@ const UIStrings = { const str_ = i18n.i18n.registerUIStrings('panels/timeline/components/insights/FontDisplay.ts', UIStrings); const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_); export class FontDisplay extends BaseInsightComponent { - static litTagName = LitHtml.literal `devtools-performance-font-display`; + static litTagName = LitHtml.StaticHtml.literal `devtools-performance-font-display`; internalName = 'font-display'; #overlayForRequest = new Map(); createOverlays() { diff --git a/public/panels/timeline/components/insights/FontDisplay.js.map b/public/panels/timeline/components/insights/FontDisplay.js.map index 25c8de72e..c59cd5293 100644 --- a/public/panels/timeline/components/insights/FontDisplay.js.map +++ b/public/panels/timeline/components/insights/FontDisplay.js.map @@ -1 +1 @@ -{"version":3,"file":"FontDisplay.js","sourceRoot":"","sources":["../../../../../../../../front_end/panels/timeline/components/insights/FontDisplay.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,YAAY,CAAC;AAEpB,OAAO,KAAK,IAAI,MAAM,+BAA+B,CAAC;AAGtD,OAAO,KAAK,OAAO,MAAM,qCAAqC,CAAC;AAG/D,OAAO,EAAC,oBAAoB,EAAC,MAAM,2BAA2B,CAAC;AAC/D,OAAO,EAAC,QAAQ,EAAC,MAAM,eAAe,CAAC;AAGvC,MAAM,EAAC,IAAI,EAAC,GAAG,OAAO,CAAC;AAEvB,MAAM,SAAS,GAAG;IAChB,2DAA2D;IAC3D,UAAU,EAAE,MAAM;IAClB,4CAA4C;IAC5C,gBAAgB,EAAE,aAAa;CAChC,CAAC;AAEF,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,iBAAiB,CAAC,oDAAoD,EAAE,SAAS,CAAC,CAAC;AAC1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CAAC,gBAAgB,CAAC,CAAC;YACnG,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;gBAClC,MAAM,EAAE;oBACN,gEAAgE;oBAChE,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC;oBACtB,IAAI,CAAC,OAAO;oBACZ,IAAI,CAAC,aAAa,CAAC,cAAc,CAAC,IAAI,CAAC,UAAU,CAAC;iBACnD;gBACD,QAAQ,EAAE,CAAC,IAAI,CAAC,kBAAkB,CAAC,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;aACtD,CAAC,CAAC;SACS;sCACc;aACzB,CAAC;QACV,kBAAkB;IACpB,CAAC;;AASH,cAAc,CAAC,MAAM,CAAC,mCAAmC,EAAE,WAAW,CAAC,CAAC","sourcesContent":["// Copyright 2024 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport './Table.js';\n\nimport * as i18n from '../../../../core/i18n/i18n.js';\nimport type {FontDisplayInsightModel} from '../../../../models/trace/insights/FontDisplay.js';\nimport type * as Trace from '../../../../models/trace/trace.js';\nimport * as LitHtml from '../../../../ui/lit-html/lit-html.js';\nimport type * as Overlays from '../../overlays/overlays.js';\n\nimport {BaseInsightComponent} from './BaseInsightComponent.js';\nimport {eventRef} from './EventRef.js';\nimport type {TableData} from './Table.js';\n\nconst {html} = LitHtml;\n\nconst UIStrings = {\n /** Column for a font loaded by the page to render text. */\n fontColumn: 'Font',\n /** Column for the amount of time wasted. */\n wastedTimeColumn: 'Wasted time',\n};\n\nconst str_ = i18n.i18n.registerUIStrings('panels/timeline/components/insights/FontDisplay.ts', UIStrings);\nconst i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);\n\nexport class FontDisplay extends BaseInsightComponent {\n static override readonly litTagName = LitHtml.literal`devtools-performance-font-display`;\n override internalName: string = 'font-display';\n\n #overlayForRequest = new Map();\n\n override createOverlays(): Overlays.Overlays.TimelineOverlay[] {\n this.#overlayForRequest.clear();\n\n if (!this.model) {\n return [];\n }\n\n for (const font of this.model.fonts) {\n this.#overlayForRequest.set(font.request, {\n type: 'ENTRY_OUTLINE',\n entry: font.request,\n outlineReason: font.wastedTime ? 'ERROR' : 'INFO',\n });\n }\n\n return [...this.#overlayForRequest.values()];\n }\n\n override getEstimatedSavingsTime(): Trace.Types.Timing.MilliSeconds|null {\n return this.model?.metricSavings?.FCP ?? null;\n }\n\n override renderContent(): LitHtml.LitTemplate {\n if (!this.model) {\n return LitHtml.nothing;\n }\n\n // clang-format off\n return html`\n
\n ${html` ({\n values: [\n // TODO(crbug.com/369422196): the font name would be nicer here.\n eventRef(font.request),\n font.display,\n i18n.TimeUtilities.millisToString(font.wastedTime),\n ],\n overlays: [this.#overlayForRequest.get(font.request)],\n })),\n } as TableData}>\n `}\n
`;\n // clang-format on\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'devtools-performance-font-display': FontDisplay;\n }\n}\n\ncustomElements.define('devtools-performance-font-display', FontDisplay);\n"]} \ No newline at end of file +{"version":3,"file":"FontDisplay.js","sourceRoot":"","sources":["../../../../../../../../front_end/panels/timeline/components/insights/FontDisplay.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,YAAY,CAAC;AAEpB,OAAO,KAAK,IAAI,MAAM,+BAA+B,CAAC;AAGtD,OAAO,KAAK,OAAO,MAAM,qCAAqC,CAAC;AAG/D,OAAO,EAAC,oBAAoB,EAAC,MAAM,2BAA2B,CAAC;AAC/D,OAAO,EAAC,QAAQ,EAAC,MAAM,eAAe,CAAC;AAGvC,MAAM,EAAC,IAAI,EAAC,GAAG,OAAO,CAAC;AAEvB,MAAM,SAAS,GAAG;IAChB,2DAA2D;IAC3D,UAAU,EAAE,MAAM;IAClB,4CAA4C;IAC5C,gBAAgB,EAAE,aAAa;CAChC,CAAC;AAEF,MAAM,IAA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I;YACb,OAAO,EAAE,CAAC,UAAU,CAAC,SAAS,CAAC,UAAU,CAAC,EAAE,cAAc,EAAE,UAAU,CAAC,SAAS,CAAC,gBAAgB,CAAC,CAAC;YACnG,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;gBAClC,MAAM,EAAE;oBACN,gEAAgE;oBAChE,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC;oBACtB,IAAI,CAAC,OAAO;oBACZ,IAAI,CAAC,aAAa,CAAC,cAAc,CAAC,IAAI,CAAC,UAAU,CAAC;iBACnD;gBACD,QAAQ,EAAE,CAAC,IAAI,CAAC,kBAAkB,CAAC,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;aACtD,CAAC,CAAC;SACS;sCACc;aACzB,CAAC;QACV,kBAAkB;IACpB,CAAC;;AASH,cAAc,CAAC,MAAM,CAAC,mCAAmC,EAAE,WAAW,CAAC,CAAC","sourcesContent":["// Copyright 2024 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport './Table.js';\n\nimport * as i18n from '../../../../core/i18n/i18n.js';\nimport type {FontDisplayInsightModel} from '../../../../models/trace/insights/FontDisplay.js';\nimport type * as Trace from '../../../../models/trace/trace.js';\nimport * as LitHtml from '../../../../ui/lit-html/lit-html.js';\nimport type * as Overlays from '../../overlays/overlays.js';\n\nimport {BaseInsightComponent} from './BaseInsightComponent.js';\nimport {eventRef} from './EventRef.js';\nimport type {TableData} from './Table.js';\n\nconst {html} = LitHtml;\n\nconst UIStrings = {\n /** Column for a font loaded by the page to render text. */\n fontColumn: 'Font',\n /** Column for the amount of time wasted. */\n wastedTimeColumn: 'Wasted time',\n};\n\nconst str_ = i18n.i18n.registerUIStrings('panels/timeline/components/insights/FontDisplay.ts', UIStrings);\nconst i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);\n\nexport class FontDisplay extends BaseInsightComponent {\n static override readonly litTagName = LitHtml.StaticHtml.literal`devtools-performance-font-display`;\n override internalName: string = 'font-display';\n\n #overlayForRequest = new Map();\n\n override createOverlays(): Overlays.Overlays.TimelineOverlay[] {\n this.#overlayForRequest.clear();\n\n if (!this.model) {\n return [];\n }\n\n for (const font of this.model.fonts) {\n this.#overlayForRequest.set(font.request, {\n type: 'ENTRY_OUTLINE',\n entry: font.request,\n outlineReason: font.wastedTime ? 'ERROR' : 'INFO',\n });\n }\n\n return [...this.#overlayForRequest.values()];\n }\n\n override getEstimatedSavingsTime(): Trace.Types.Timing.MilliSeconds|null {\n return this.model?.metricSavings?.FCP ?? null;\n }\n\n override renderContent(): LitHtml.LitTemplate {\n if (!this.model) {\n return LitHtml.nothing;\n }\n\n // clang-format off\n return html`\n
\n ${html` ({\n values: [\n // TODO(crbug.com/369422196): the font name would be nicer here.\n eventRef(font.request),\n font.display,\n i18n.TimeUtilities.millisToString(font.wastedTime),\n ],\n overlays: [this.#overlayForRequest.get(font.request)],\n })),\n } as TableData}>\n `}\n
`;\n // clang-format on\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'devtools-performance-font-display': FontDisplay;\n }\n}\n\ncustomElements.define('devtools-performance-font-display', FontDisplay);\n"]} \ No newline at end of file diff --git a/public/panels/timeline/components/insights/ImageDelivery.d.ts b/public/panels/timeline/components/insights/ImageDelivery.d.ts index 47882de7c..7fb4aca15 100644 --- a/public/panels/timeline/components/insights/ImageDelivery.d.ts +++ b/public/panels/timeline/components/insights/ImageDelivery.d.ts @@ -6,7 +6,7 @@ import type * as Overlays from '../../overlays/overlays.js'; import { BaseInsightComponent } from './BaseInsightComponent.js'; export declare class ImageDelivery extends BaseInsightComponent { #private; - static readonly litTagName: import("../../../../ui/lit-html/static.js").Static; + static readonly litTagName: LitHtml.StaticHtml.StaticValue; internalName: string; createOverlays(): Overlays.Overlays.TimelineOverlay[]; getEstimatedSavingsBytes(): number | null; diff --git a/public/panels/timeline/components/insights/ImageDelivery.js b/public/panels/timeline/components/insights/ImageDelivery.js index 22b4f434a..f2b22e21a 100644 --- a/public/panels/timeline/components/insights/ImageDelivery.js +++ b/public/panels/timeline/components/insights/ImageDelivery.js @@ -27,7 +27,7 @@ const str_ = i18n.i18n.registerUIStrings('panels/timeline/components/insights/Im const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_); const MAX_REQUESTS = 10; export class ImageDelivery extends BaseInsightComponent { - static litTagName = LitHtml.literal `devtools-performance-image-delivery`; + static litTagName = LitHtml.StaticHtml.literal `devtools-performance-image-delivery`; internalName = 'image-delivery'; createOverlays() { if (!this.model) { diff --git a/public/panels/timeline/components/insights/ImageDelivery.js.map b/public/panels/timeline/components/insights/ImageDelivery.js.map index 60e25389b..9a45996ff 100644 --- a/public/panels/timeline/components/insights/ImageDelivery.js.map +++ b/public/panels/timeline/components/insights/ImageDelivery.js.map @@ -1 +1 @@ -{"version":3,"file":"ImageDelivery.js","sourceRoot":"","sources":["../../../../../../../../front_end/panels/timeline/components/insights/ImageDelivery.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,sDAAsD,CAAC;AAC9D,OAAO,YAAY,CAAC;AAEpB,OAAO,KAAK,IAAI,MAAM,+BAA+B,CAAC;AAGtD,OAAO,KAAK,OAAO,MAAM,qCAAqC,CAAC;AAG/D,OAAO,EAAC,oBAAoB,EAAC,MAAM,2BAA2B,CAAC;AAC/D,OAAO,EAAC,QAAQ,EAAC,MAAM,eAAe,CAAC;AAGvC,MAAM,EAAC,IAAI,EAAC,GAAG,OAAO,CAAC;AAEvB,MAAM,SAAS,GAAG;IAChB;;OAEG;IACH,YAAY,EAAE,oBAAoB;IAClC;;;OAGG;IACH,MAAM,EAAE,cAAc;IACtB;;OAEG;IACH,mBAAmB,EAAE,uBAAuB;CAC7C,CAAC;AAEF,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,iBAAiB,CAAC,sDAAsD,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C,CAAC","sourcesContent":["// Copyright 2024 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport '../../../../ui/components/icon_button/icon_button.js';\nimport './Table.js';\n\nimport * as i18n from '../../../../core/i18n/i18n.js';\nimport type {ImageDeliveryInsightModel} from '../../../../models/trace/insights/ImageDelivery.js';\nimport type * as Trace from '../../../../models/trace/trace.js';\nimport * as LitHtml from '../../../../ui/lit-html/lit-html.js';\nimport type * as Overlays from '../../overlays/overlays.js';\n\nimport {BaseInsightComponent} from './BaseInsightComponent.js';\nimport {imageRef} from './EventRef.js';\nimport type {TableDataRow} from './Table.js';\n\nconst {html} = LitHtml;\n\nconst UIStrings = {\n /**\n * @description Column header for a table column containing network requests for images which can improve their file size (e.g. use a different format, increase compression, etc).\n */\n optimizeFile: 'Optimize file size',\n /**\n * @description Table row value representing the remaining items not shown in the table due to size constraints. This row will always represent at least 2 items.\n * @example {5} PH1\n */\n others: '{PH1} others',\n /**\n * @description Text status indicating that no potential optimizations were found for any image file\n */\n noOptimizableImages: 'No optimizable images',\n};\n\nconst str_ = i18n.i18n.registerUIStrings('panels/timeline/components/insights/ImageDelivery.ts', UIStrings);\nconst i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);\n\nconst MAX_REQUESTS = 10;\n\nexport class ImageDelivery extends BaseInsightComponent {\n static override readonly litTagName = LitHtml.literal`devtools-performance-image-delivery`;\n override internalName: string = 'image-delivery';\n\n override createOverlays(): Overlays.Overlays.TimelineOverlay[] {\n if (!this.model) {\n return [];\n }\n\n const {optimizableImages} = this.model;\n return optimizableImages.map(image => this.#createOverlayForRequest(image.request));\n }\n\n #createOverlayForRequest(request: Trace.Types.Events.SyntheticNetworkRequest): Overlays.Overlays.EntryOutline {\n return {\n type: 'ENTRY_OUTLINE',\n entry: request,\n outlineReason: 'ERROR',\n };\n }\n\n override getEstimatedSavingsBytes(): number|null {\n return this.model?.totalByteSavings ?? null;\n }\n\n override renderContent(): LitHtml.LitTemplate {\n if (!this.model) {\n return LitHtml.nothing;\n }\n\n const optimizableImages = [...this.model.optimizableImages];\n\n const topImages =\n optimizableImages.sort((a, b) => b.request.args.data.decodedBodyLength - a.request.args.data.decodedBodyLength);\n\n const remaining = topImages.splice(MAX_REQUESTS);\n const rows: TableDataRow[] = topImages.map(image => ({\n values: [imageRef(image.request)],\n overlays: [this.#createOverlayForRequest(image.request)],\n }));\n\n if (remaining.length > 0) {\n const value =\n remaining.length > 1 ? i18nString(UIStrings.others, {PH1: remaining.length}) : imageRef(remaining[0].request);\n rows.push({\n values: [value],\n overlays: remaining.map(r => this.#createOverlayForRequest(r.request)),\n });\n }\n\n if (!rows.length) {\n return html`
${i18nString(UIStrings.noOptimizableImages)}
`;\n }\n\n // clang-format off\n return html`\n
\n \n \n
\n `;\n // clang-format on\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'devtools-performance-image-delivery': ImageDelivery;\n }\n}\n\ncustomElements.define('devtools-performance-image-delivery', ImageDelivery);\n"]} \ No newline at end of file +{"version":3,"file":"ImageDelivery.js","sourceRoot":"","sources":["../../../../../../../../front_end/panels/timeline/components/insights/ImageDelivery.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,sDAAsD,CAAC;AAC9D,OAAO,YAAY,CAAC;AAEpB,OAAO,KAAK,IAAI,MAAM,+BAA+B,CAAC;AAGtD,OAAO,KAAK,OAAO,MAAM,qCAAqC,CAAC;AAG/D,OAAO,EAAC,oBAAoB,EAAC,MAAM,2BAA2B,CAAC;AAC/D,OAAO,EAAC,QAAQ,EAAC,MAAM,eAAe,CAAC;AAGvC,MAAM,EAAC,IAAI,EAAC,GAAG,OAAO,CAAC;AAEvB,MAAM,SAAS,GAAG;IAChB;;OAEG;IACH,YAAY,EAAE,oBAAoB;IAClC;;;OAGG;IACH,MAAM,EAAE,cAAc;IACtB;;OAEG;IACH,mBAAmB,EAAE,uBAAuB;CA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;;;KAGN,CAAC;QACF,kBAAkB;IACpB,CAAC;;AASH,cAAc,CAAC,MAAM,CAAC,qCAAqC,EAAE,aAAa,CAAC,CAAC","sourcesContent":["// Copyright 2024 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport '../../../../ui/components/icon_button/icon_button.js';\nimport './Table.js';\n\nimport * as i18n from '../../../../core/i18n/i18n.js';\nimport type {ImageDeliveryInsightModel} from '../../../../models/trace/insights/ImageDelivery.js';\nimport type * as Trace from '../../../../models/trace/trace.js';\nimport * as LitHtml from '../../../../ui/lit-html/lit-html.js';\nimport type * as Overlays from '../../overlays/overlays.js';\n\nimport {BaseInsightComponent} from './BaseInsightComponent.js';\nimport {imageRef} from './EventRef.js';\nimport type {TableDataRow} from './Table.js';\n\nconst {html} = LitHtml;\n\nconst UIStrings = {\n /**\n * @description Column header for a table column containing network requests for images which can improve their file size (e.g. use a different format, increase compression, etc).\n */\n optimizeFile: 'Optimize file size',\n /**\n * @description Table row value representing the remaining items not shown in the table due to size constraints. This row will always represent at least 2 items.\n * @example {5} PH1\n */\n others: '{PH1} others',\n /**\n * @description Text status indicating that no potential optimizations were found for any image file\n */\n noOptimizableImages: 'No optimizable images',\n};\n\nconst str_ = i18n.i18n.registerUIStrings('panels/timeline/components/insights/ImageDelivery.ts', UIStrings);\nconst i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);\n\nconst MAX_REQUESTS = 10;\n\nexport class ImageDelivery extends BaseInsightComponent {\n static override readonly litTagName = LitHtml.StaticHtml.literal`devtools-performance-image-delivery`;\n override internalName: string = 'image-delivery';\n\n override createOverlays(): Overlays.Overlays.TimelineOverlay[] {\n if (!this.model) {\n return [];\n }\n\n const {optimizableImages} = this.model;\n return optimizableImages.map(image => this.#createOverlayForRequest(image.request));\n }\n\n #createOverlayForRequest(request: Trace.Types.Events.SyntheticNetworkRequest): Overlays.Overlays.EntryOutline {\n return {\n type: 'ENTRY_OUTLINE',\n entry: request,\n outlineReason: 'ERROR',\n };\n }\n\n override getEstimatedSavingsBytes(): number|null {\n return this.model?.totalByteSavings ?? null;\n }\n\n override renderContent(): LitHtml.LitTemplate {\n if (!this.model) {\n return LitHtml.nothing;\n }\n\n const optimizableImages = [...this.model.optimizableImages];\n\n const topImages =\n optimizableImages.sort((a, b) => b.request.args.data.decodedBodyLength - a.request.args.data.decodedBodyLength);\n\n const remaining = topImages.splice(MAX_REQUESTS);\n const rows: TableDataRow[] = topImages.map(image => ({\n values: [imageRef(image.request)],\n overlays: [this.#createOverlayForRequest(image.request)],\n }));\n\n if (remaining.length > 0) {\n const value =\n remaining.length > 1 ? i18nString(UIStrings.others, {PH1: remaining.length}) : imageRef(remaining[0].request);\n rows.push({\n values: [value],\n overlays: remaining.map(r => this.#createOverlayForRequest(r.request)),\n });\n }\n\n if (!rows.length) {\n return html`
${i18nString(UIStrings.noOptimizableImages)}
`;\n }\n\n // clang-format off\n return html`\n
\n \n \n
\n `;\n // clang-format on\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'devtools-performance-image-delivery': ImageDelivery;\n }\n}\n\ncustomElements.define('devtools-performance-image-delivery', ImageDelivery);\n"]} \ No newline at end of file diff --git a/public/panels/timeline/components/insights/InteractionToNextPaint.d.ts b/public/panels/timeline/components/insights/InteractionToNextPaint.d.ts index 65ff090ba..e657b4c30 100644 --- a/public/panels/timeline/components/insights/InteractionToNextPaint.d.ts +++ b/public/panels/timeline/components/insights/InteractionToNextPaint.d.ts @@ -5,7 +5,7 @@ import type * as Overlays from '../../overlays/overlays.js'; import { BaseInsightComponent } from './BaseInsightComponent.js'; export declare class InteractionToNextPaint extends BaseInsightComponent { #private; - static readonly litTagName: import("../../../../ui/lit-html/static.js").Static; + static readonly litTagName: LitHtml.StaticHtml.StaticValue; internalName: string; createOverlays(): Overlays.Overlays.TimelineOverlay[]; renderContent(): LitHtml.LitTemplate; diff --git a/public/panels/timeline/components/insights/InteractionToNextPaint.js b/public/panels/timeline/components/insights/InteractionToNextPaint.js index 3e6cabaee..8f60bb32a 100644 --- a/public/panels/timeline/components/insights/InteractionToNextPaint.js +++ b/public/panels/timeline/components/insights/InteractionToNextPaint.js @@ -38,7 +38,7 @@ const UIStrings = { const str_ = i18n.i18n.registerUIStrings('panels/timeline/components/insights/InteractionToNextPaint.ts', UIStrings); const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_); export class InteractionToNextPaint extends BaseInsightComponent { - static litTagName = LitHtml.literal `devtools-performance-inp`; + static litTagName = LitHtml.StaticHtml.literal `devtools-performance-inp`; internalName = 'inp'; createOverlays() { if (!this.model) { diff --git a/public/panels/timeline/components/insights/InteractionToNextPaint.js.map b/public/panels/timeline/components/insights/InteractionToNextPaint.js.map index a96ddb189..2ae3b1fe4 100644 --- a/public/panels/timeline/components/insights/InteractionToNextPaint.js.map +++ b/public/panels/timeline/components/insights/InteractionToNextPaint.js.map @@ -1 +1 @@ -{"version":3,"file":"InteractionToNextPaint.js","sourceRoot":"","sources":["../../../../../../../../front_end/panels/timeline/components/insights/InteractionToNextPaint.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,YAAY,CAAC;AAEpB,OAAO,KAAK,IAAI,MAAM,+BAA+B,CAAC;AACtD,OAAO,KAAK,QAAQ,MAAM,uCAAuC,CAAC;AAElE,OAAO,KAAK,KAAK,MAAM,mCAAmC,CAAC;AAC3D,OAAO,KAAK,OAAO,MAAM,qCAAqC,CAAC;AAG/D,OAAO,EAAC,oBAAoB,EAAC,MAAM,2BAA2B,CAAC;AAE/D,MAAM,EAAC,IAAI,EAAC,GAAG,OAAO,CAAC;AAEvB,MAAM,SAAS,GAAG;IAChB;;OAEG;IACH,KAAK,EAAE,OAAO;IACd;;OAEG;IACH,QAAQ,EAAE,UAAU;IAEpB,oFAAoF;IACpF;;OAEG;IACH,UAAU,EAAE,aAAa;IACzB;;OAEG;IACH,kBAAkB,EAAE,qBAAqB;I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AAC,SAAS,CAAC,QAAQ,CAAC,CAAC;YACtE,IAAI,EAAE;gBACJ;oBACE,MAAM,EAAE,CAAC,UAAU,CAAC,SAAS,CAAC,UAAU,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;oBAClE,QAAQ,EAAE,IAAI,CAAC,uBAAuB,CAAC,KAAK,EAAE,CAAC,CAAC;iBACjD;gBACD;oBACE,MAAM,EAAE,CAAC,UAAU,CAAC,SAAS,CAAC,kBAAkB,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,kBAAkB,CAAC,CAAC;oBAClF,QAAQ,EAAE,IAAI,CAAC,uBAAuB,CAAC,KAAK,EAAE,CAAC,CAAC;iBACjD;gBACD;oBACE,MAAM,EAAE,CAAC,UAAU,CAAC,SAAS,CAAC,iBAAiB,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAAC;oBAChF,QAAQ,EAAE,IAAI,CAAC,uBAAuB,CAAC,KAAK,EAAE,CAAC,CAAC;iBACjD;aACF;SACF;sCAC2B;aACzB,CAAC;QACV,kBAAkB;IACpB,CAAC;;AASH,cAAc,CAAC,MAAM,CAAC,0BAA0B,EAAE,sBAAsB,CAAC,CAAC","sourcesContent":["// Copyright 2024 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport './Table.js';\n\nimport * as i18n from '../../../../core/i18n/i18n.js';\nimport * as Platform from '../../../../core/platform/platform.js';\nimport type {INPInsightModel} from '../../../../models/trace/insights/InteractionToNextPaint.js';\nimport * as Trace from '../../../../models/trace/trace.js';\nimport * as LitHtml from '../../../../ui/lit-html/lit-html.js';\nimport type * as Overlays from '../../overlays/overlays.js';\n\nimport {BaseInsightComponent} from './BaseInsightComponent.js';\n\nconst {html} = LitHtml;\n\nconst UIStrings = {\n /**\n *@description Label used for the phase/component/stage/section of a larger duration.\n */\n phase: 'Phase',\n /**\n *@description Label used for a time duration.\n */\n duration: 'Duration',\n\n // TODO: these are repeated in InteractionBreakdown. Add a place for common strings?\n /**\n *@description Text shown next to the interaction event's input delay time in the detail view.\n */\n inputDelay: 'Input delay',\n /**\n *@description Text shown next to the interaction event's thread processing duration in the detail view.\n */\n processingDuration: 'Processing duration',\n /**\n *@description Text shown next to the interaction event's presentation delay time in the detail view.\n */\n presentationDelay: 'Presentation delay',\n /**\n * @description Text status indicating that no user interactions were detected.\n */\n noInteractions: 'No interactions detected',\n};\n\nconst str_ = i18n.i18n.registerUIStrings('panels/timeline/components/insights/InteractionToNextPaint.ts', UIStrings);\nconst i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);\n\nexport class InteractionToNextPaint extends BaseInsightComponent {\n static override readonly litTagName = LitHtml.literal`devtools-performance-inp`;\n override internalName: string = 'inp';\n\n override createOverlays(): Overlays.Overlays.TimelineOverlay[] {\n if (!this.model) {\n return [];\n }\n\n const event = this.model.longestInteractionEvent;\n if (!event) {\n return [];\n }\n\n return this.#createOverlaysForPhase(event);\n }\n\n // If `phase` is -1, then all phases are included. Otherwise it's just that phase index.\n #createOverlaysForPhase(event: Trace.Types.Events.SyntheticInteractionPair, phase = -1):\n Overlays.Overlays.TimelineOverlay[] {\n const p1 = Trace.Helpers.Timing.traceWindowFromMicroSeconds(\n event.ts,\n (event.ts + event.inputDelay) as Trace.Types.Timing.MicroSeconds,\n );\n const p2 = Trace.Helpers.Timing.traceWindowFromMicroSeconds(\n p1.max,\n (p1.max + event.mainThreadHandling) as Trace.Types.Timing.MicroSeconds,\n );\n const p3 = Trace.Helpers.Timing.traceWindowFromMicroSeconds(\n p2.max,\n (p2.max + event.presentationDelay) as Trace.Types.Timing.MicroSeconds,\n );\n let sections = [\n {bounds: p1, label: i18nString(UIStrings.inputDelay), showDuration: true},\n {bounds: p2, label: i18nString(UIStrings.processingDuration), showDuration: true},\n {bounds: p3, label: i18nString(UIStrings.presentationDelay), showDuration: true},\n ];\n if (phase !== -1) {\n sections = [sections[phase]];\n }\n\n return [\n {\n type: 'TIMESPAN_BREAKDOWN',\n sections,\n renderLocation: 'BELOW_EVENT',\n entry: event,\n },\n ];\n }\n\n override renderContent(): LitHtml.LitTemplate {\n const event = this.model?.longestInteractionEvent;\n if (!event) {\n return html`
${i18nString(UIStrings.noInteractions)}
`;\n }\n\n const time = (us: Trace.Types.Timing.MicroSeconds): string =>\n i18n.TimeUtilities.millisToString(Platform.Timing.microSecondsToMilliSeconds(us));\n\n // clang-format off\n return html`\n
\n ${html`\n `}\n
`;\n // clang-format on\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'devtools-performance-inp': InteractionToNextPaint;\n }\n}\n\ncustomElements.define('devtools-performance-inp', InteractionToNextPaint);\n"]} \ No newline at end of file +{"version":3,"file":"InteractionToNextPaint.js","sourceRoot":"","sources":["../../../../../../../../front_end/panels/timeline/components/insights/InteractionToNextPaint.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,YAAY,CAAC;AAEpB,OAAO,KAAK,IAAI,MAAM,+BAA+B,CAAC;AACtD,OAAO,KAAK,QAAQ,MAAM,uCAAuC,CAAC;AAElE,OAAO,KAAK,KAAK,MAAM,mCAAmC,CAAC;AAC3D,OAAO,KAAK,OAAO,MAAM,qCAAqC,CAAC;AAG/D,OAAO,EAAC,oBAAoB,EAAC,MAAM,2BAA2B,CAAC;AAE/D,MAAM,EAAC,IAAI,EAAC,GAAG,OAAO,CAAC;AAEvB,MAAM,SAAS,GAAG;IAChB;;OAEG;IACH,KAAK,EAAE,OAAO;IACd;;OAEG;IACH,QAAQ,EAAE,UAAU;IAEpB,oFAAoF;IACpF;;OAEG;IACH,UAAU,EAAE,aAAa;IACzB;;OAEG;IACH,kBAAkB,EAAE,qBAAqB;IACzC;;OAEG;IACH,iBAAiB,EAAE,oBAAoB;IACvC;;OAEG;IACH,cAAc,EAAE,0BAA0B;CAC3C,CAAC;AAEF,MAAM,IAAI,GAAG,IAAI,CAAC,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CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;oBAClE,QAAQ,EAAE,IAAI,CAAC,uBAAuB,CAAC,KAAK,EAAE,CAAC,CAAC;iBACjD;gBACD;oBACE,MAAM,EAAE,CAAC,UAAU,CAAC,SAAS,CAAC,kBAAkB,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,kBAAkB,CAAC,CAAC;oBAClF,QAAQ,EAAE,IAAI,CAAC,uBAAuB,CAAC,KAAK,EAAE,CAAC,CAAC;iBACjD;gBACD;oBACE,MAAM,EAAE,CAAC,UAAU,CAAC,SAAS,CAAC,iBAAiB,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAAC;oBAChF,QAAQ,EAAE,IAAI,CAAC,uBAAuB,CAAC,KAAK,EAAE,CAAC,CAAC;iBACjD;aACF;SACF;sCAC2B;aACzB,CAAC;QACV,kBAAkB;IACpB,CAAC;;AASH,cAAc,CAAC,MAAM,CAAC,0BAA0B,EAAE,sBAAsB,CAAC,CAAC","sourcesContent":["// Copyright 2024 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport './Table.js';\n\nimport * as i18n from '../../../../core/i18n/i18n.js';\nimport * as Platform from '../../../../core/platform/platform.js';\nimport type {INPInsightModel} from '../../../../models/trace/insights/InteractionToNextPaint.js';\nimport * as Trace from '../../../../models/trace/trace.js';\nimport * as LitHtml from '../../../../ui/lit-html/lit-html.js';\nimport type * as Overlays from '../../overlays/overlays.js';\n\nimport {BaseInsightComponent} from './BaseInsightComponent.js';\n\nconst {html} = LitHtml;\n\nconst UIStrings = {\n /**\n *@description Label used for the phase/component/stage/section of a larger duration.\n */\n phase: 'Phase',\n /**\n *@description Label used for a time duration.\n */\n duration: 'Duration',\n\n // TODO: these are repeated in InteractionBreakdown. Add a place for common strings?\n /**\n *@description Text shown next to the interaction event's input delay time in the detail view.\n */\n inputDelay: 'Input delay',\n /**\n *@description Text shown next to the interaction event's thread processing duration in the detail view.\n */\n processingDuration: 'Processing duration',\n /**\n *@description Text shown next to the interaction event's presentation delay time in the detail view.\n */\n presentationDelay: 'Presentation delay',\n /**\n * @description Text status indicating that no user interactions were detected.\n */\n noInteractions: 'No interactions detected',\n};\n\nconst str_ = i18n.i18n.registerUIStrings('panels/timeline/components/insights/InteractionToNextPaint.ts', UIStrings);\nconst i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);\n\nexport class InteractionToNextPaint extends BaseInsightComponent {\n static override readonly litTagName = LitHtml.StaticHtml.literal`devtools-performance-inp`;\n override internalName: string = 'inp';\n\n override createOverlays(): Overlays.Overlays.TimelineOverlay[] {\n if (!this.model) {\n return [];\n }\n\n const event = this.model.longestInteractionEvent;\n if (!event) {\n return [];\n }\n\n return this.#createOverlaysForPhase(event);\n }\n\n // If `phase` is -1, then all phases are included. Otherwise it's just that phase index.\n #createOverlaysForPhase(event: Trace.Types.Events.SyntheticInteractionPair, phase = -1):\n Overlays.Overlays.TimelineOverlay[] {\n const p1 = Trace.Helpers.Timing.traceWindowFromMicroSeconds(\n event.ts,\n (event.ts + event.inputDelay) as Trace.Types.Timing.MicroSeconds,\n );\n const p2 = Trace.Helpers.Timing.traceWindowFromMicroSeconds(\n p1.max,\n (p1.max + event.mainThreadHandling) as Trace.Types.Timing.MicroSeconds,\n );\n const p3 = Trace.Helpers.Timing.traceWindowFromMicroSeconds(\n p2.max,\n (p2.max + event.presentationDelay) as Trace.Types.Timing.MicroSeconds,\n );\n let sections = [\n {bounds: p1, label: i18nString(UIStrings.inputDelay), showDuration: true},\n {bounds: p2, label: i18nString(UIStrings.processingDuration), showDuration: true},\n {bounds: p3, label: i18nString(UIStrings.presentationDelay), showDuration: true},\n ];\n if (phase !== -1) {\n sections = [sections[phase]];\n }\n\n return [\n {\n type: 'TIMESPAN_BREAKDOWN',\n sections,\n renderLocation: 'BELOW_EVENT',\n entry: event,\n },\n ];\n }\n\n override renderContent(): LitHtml.LitTemplate {\n const event = this.model?.longestInteractionEvent;\n if (!event) {\n return html`
${i18nString(UIStrings.noInteractions)}
`;\n }\n\n const time = (us: Trace.Types.Timing.MicroSeconds): string =>\n i18n.TimeUtilities.millisToString(Platform.Timing.microSecondsToMilliSeconds(us));\n\n // clang-format off\n return html`\n
\n ${html`\n `}\n
`;\n // clang-format on\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'devtools-performance-inp': InteractionToNextPaint;\n }\n}\n\ncustomElements.define('devtools-performance-inp', InteractionToNextPaint);\n"]} \ No newline at end of file diff --git a/public/panels/timeline/components/insights/LCPDiscovery.d.ts b/public/panels/timeline/components/insights/LCPDiscovery.d.ts index 22afe4f00..68738bbf0 100644 --- a/public/panels/timeline/components/insights/LCPDiscovery.d.ts +++ b/public/panels/timeline/components/insights/LCPDiscovery.d.ts @@ -6,7 +6,7 @@ import type * as Overlays from '../../overlays/overlays.js'; import { BaseInsightComponent } from './BaseInsightComponent.js'; export declare class LCPDiscovery extends BaseInsightComponent { #private; - static readonly litTagName: import("../../../../ui/lit-html/static.js").Static; + static readonly litTagName: LitHtml.StaticHtml.StaticValue; internalName: string; createOverlays(): Overlays.Overlays.TimelineOverlay[]; getEstimatedSavingsTime(): Trace.Types.Timing.MilliSeconds | null; diff --git a/public/panels/timeline/components/insights/LCPDiscovery.js b/public/panels/timeline/components/insights/LCPDiscovery.js index 576e2eb2e..2838d56d4 100644 --- a/public/panels/timeline/components/insights/LCPDiscovery.js +++ b/public/panels/timeline/components/insights/LCPDiscovery.js @@ -75,7 +75,7 @@ function getImageData(model) { return data; } export class LCPDiscovery extends BaseInsightComponent { - static litTagName = LitHtml.literal `devtools-performance-lcp-discovery`; + static litTagName = LitHtml.StaticHtml.literal `devtools-performance-lcp-discovery`; internalName = 'lcp-discovery'; #adviceIcon(didFail, label) { const icon = didFail ? 'clear' : 'check-circle'; diff --git a/public/panels/timeline/components/insights/LCPDiscovery.js.map b/public/panels/timeline/components/insights/LCPDiscovery.js.map index 0085d0cab..31af517e3 100644 --- a/public/panels/timeline/components/insights/LCPDiscovery.js.map +++ b/public/panels/timeline/components/insights/LCPDiscovery.js.map @@ -1 +1 @@ -{"version":3,"file":"LCPDiscovery.js","sourceRoot":"","sources":["../../../../../../../../front_end/panels/timeline/components/insights/LCPDiscovery.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,sDAAsD,CAAC;AAE9D,OAAO,KAAK,IAAI,MAAM,+BAA+B,CAAC;AAEtD,OAAO,KAAK,KAAK,MAAM,mCAAmC,CAAC;AAC3D,OAAO,KAAK,OAAO,MAAM,qCAAqC,CAAC;AAG/D,OAAO,EAAC,oBAAoB,EAAC,MAAM,2BAA2B,CAAC;AAC/D,OAAO,EAAC,QAAQ,EAAC,MAAM,eAAe,CAAC;AAEvC,MAAM,EAAC,IAAI,EAAC,GAAG,OAAO,CAAC;AAEvB,MAAM,SAAS,GAAG;IAChB;;;OAGG;IACH,YAAY,EAAE,oDAAoD;IAClE;;OAEG;IACH,oBAAoB,EAAE,4BAA4B;IAClD;;OAEG;IACH,mBAAmB,EAAE,6CAA6C;IAClE;;OAEG;IACH,kBAAkB,EAAE,uBAAuB;IAC3C;;;OAGG;IACH,gBAAgB,EAAE,6BAA6B;IAC/C;;;OAGG;IACH,eAAe,EAAE,6BAA6B;IAC9C;;OAEG;IACH,KAAK,EAAE,iBAAiB;IACxB;;OAEG;IACH,aAAa,EAAE,0DAA0D;CAC1E,CAAC;AAEF,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,iBAAiB,CAAC,qDAAqD,EAAE,SAAS,CAAC,CAAC;AAC3G,MAAM,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC;AAWtE,SAAS,YAAY,CAAC,KAA+B;IACnD,IAAI,KAAK,CAAC,UAAU,KAAK,SAAS,EAAE,CAAC;QACnC,OAAO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AS,CAAC,oBAAoB,CAAC,CAAC;sBAC5F,UAAU,CAAC,SAAS,CAAC,oBAAoB,CAAC;;;gBAGhD,IAAI,CAAC,WAAW,CAAC,SAAS,CAAC,kBAAkB,EAAE,UAAU,CAAC,SAAS,CAAC,mBAAmB,CAAC,CAAC;sBACnF,UAAU,CAAC,SAAS,CAAC,mBAAmB,CAAC;;;gBAG/C,IAAI,CAAC,WAAW,CAAC,SAAS,CAAC,uBAAuB,EAAE,UAAU,CAAC,SAAS,CAAC,kBAAkB,CAAC,CAAC;sBACvF,UAAU,CAAC,SAAS,CAAC,kBAAkB,CAAC;;;;UAIpD,QAAQ,CAAC,SAAS,CAAC,OAAO,CAAC;aACxB,CAAC;QACV,kBAAkB;IACpB,CAAC;;AASH,cAAc,CAAC,MAAM,CAAC,oCAAoC,EAAE,YAAY,CAAC,CAAC","sourcesContent":["// Copyright 2024 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport '../../../../ui/components/icon_button/icon_button.js';\n\nimport * as i18n from '../../../../core/i18n/i18n.js';\nimport type {LCPDiscoveryInsightModel} from '../../../../models/trace/insights/LCPDiscovery.js';\nimport * as Trace from '../../../../models/trace/trace.js';\nimport * as LitHtml from '../../../../ui/lit-html/lit-html.js';\nimport type * as Overlays from '../../overlays/overlays.js';\n\nimport {BaseInsightComponent} from './BaseInsightComponent.js';\nimport {imageRef} from './EventRef.js';\n\nconst {html} = LitHtml;\n\nconst UIStrings = {\n /**\n * @description Text to tell the user how long after the earliest discovery time their LCP element loaded.\n * @example {401ms} PH1\n */\n lcpLoadDelay: 'LCP image loaded {PH1} after earliest start point.',\n /**\n * @description Text to tell the user that a fetchpriority property value of \"high\" is applied to the LCP request.\n */\n fetchPriorityApplied: 'fetchpriority=high applied',\n /**\n * @description Text to tell the user that the LCP request is discoverable in the initial document.\n */\n requestDiscoverable: 'Request is discoverable in initial document',\n /**\n * @description Text to tell the user that the LCP request does not have the lazy load property applied.\n */\n lazyLoadNotApplied: 'lazy load not applied',\n /**\n *@description Text for a screen-reader label to tell the user that the icon represents a successful insight check\n *@example {Server response time} PH1\n */\n successAriaLabel: 'Insight check passed: {PH1}',\n /**\n *@description Text for a screen-reader label to tell the user that the icon represents an unsuccessful insight check\n *@example {Server response time} PH1\n */\n failedAriaLabel: 'Insight check failed: {PH1}',\n /**\n * @description Text status indicating that the the Largest Contentful Paint (LCP) metric timing was not found. \"LCP\" is an acronym and should not be translated.\n */\n noLcp: 'No LCP detected',\n /**\n * @description Text status indicating that the Largest Contentful Paint (LCP) metric was text rather than an image. \"LCP\" is an acronym and should not be translated.\n */\n noLcpResource: 'No LCP resource detected because the LCP is not an image',\n};\n\nconst str_ = i18n.i18n.registerUIStrings('panels/timeline/components/insights/LCPDiscovery.ts', UIStrings);\nconst i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);\n\ninterface LCPImageDiscoveryData {\n shouldIncreasePriorityHint: boolean;\n shouldPreloadImage: boolean;\n shouldRemoveLazyLoading: boolean;\n request: Trace.Types.Events.SyntheticNetworkRequest;\n discoveryDelay: Trace.Types.Timing.MicroSeconds|null;\n estimatedSavings: Trace.Types.Timing.MilliSeconds|null;\n}\n\nfunction getImageData(model: LCPDiscoveryInsightModel): LCPImageDiscoveryData|null {\n if (model.lcpRequest === undefined) {\n return null;\n }\n\n const shouldIncreasePriorityHint = model.shouldIncreasePriorityHint;\n const shouldPreloadImage = model.shouldPreloadImage;\n const shouldRemoveLazyLoading = model.shouldRemoveLazyLoading;\n\n const imageLCP = shouldIncreasePriorityHint !== undefined && shouldPreloadImage !== undefined &&\n shouldRemoveLazyLoading !== undefined;\n\n // Shouldn't render anything if lcp insight is null or lcp is text.\n if (!imageLCP) {\n return null;\n }\n\n const data: LCPImageDiscoveryData = {\n shouldIncreasePriorityHint,\n shouldPreloadImage,\n shouldRemoveLazyLoading,\n request: model.lcpRequest,\n discoveryDelay: null,\n estimatedSavings: model.metricSavings?.LCP ?? null,\n };\n\n if (model.earliestDiscoveryTimeTs && model.lcpRequest) {\n const discoveryDelay = model.lcpRequest.ts - model.earliestDiscoveryTimeTs;\n data.discoveryDelay = Trace.Types.Timing.MicroSeconds(discoveryDelay);\n }\n\n return data;\n}\n\nexport class LCPDiscovery extends BaseInsightComponent {\n static override readonly litTagName = LitHtml.literal`devtools-performance-lcp-discovery`;\n override internalName: string = 'lcp-discovery';\n\n #adviceIcon(didFail: boolean, label: string): LitHtml.TemplateResult {\n const icon = didFail ? 'clear' : 'check-circle';\n\n const ariaLabel = didFail ? i18nString(UIStrings.failedAriaLabel, {PH1: label}) :\n i18nString(UIStrings.successAriaLabel, {PH1: label});\n return html`\n \n `;\n }\n\n #renderDiscoveryDelay(delay: Trace.Types.Timing.MicroSeconds): Element {\n const timeWrapper = document.createElement('span');\n timeWrapper.classList.add('discovery-time-ms');\n timeWrapper.innerText = i18n.TimeUtilities.formatMicroSecondsTime(delay);\n return i18n.i18n.getFormatLocalizedString(str_, UIStrings.lcpLoadDelay, {PH1: timeWrapper});\n }\n\n override createOverlays(): Overlays.Overlays.TimelineOverlay[] {\n if (!this.model) {\n return [];\n }\n\n const imageResults = getImageData(this.model);\n if (!imageResults || !imageResults.discoveryDelay) {\n return [];\n }\n\n const delay = Trace.Helpers.Timing.traceWindowFromMicroSeconds(\n Trace.Types.Timing.MicroSeconds(imageResults.request.ts - imageResults.discoveryDelay),\n imageResults.request.ts,\n );\n\n const label = html`
${this.#renderDiscoveryDelay(delay.range)}
`;\n\n return [\n {\n type: 'ENTRY_OUTLINE',\n entry: imageResults.request,\n outlineReason: 'ERROR',\n },\n {\n type: 'CANDY_STRIPED_TIME_RANGE',\n bounds: delay,\n entry: imageResults.request,\n },\n {\n type: 'TIMESPAN_BREAKDOWN',\n sections: [{\n bounds: delay,\n label,\n showDuration: false,\n }],\n entry: imageResults.request,\n renderLocation: 'ABOVE_EVENT',\n },\n ];\n }\n\n override getEstimatedSavingsTime(): Trace.Types.Timing.MilliSeconds|null {\n if (!this.model) {\n return null;\n }\n\n return getImageData(this.model)?.estimatedSavings ?? null;\n }\n\n override renderContent(): LitHtml.LitTemplate {\n if (!this.model) {\n return LitHtml.nothing;\n }\n\n const imageData = getImageData(this.model);\n if (!imageData) {\n if (!this.model.lcpEvent) {\n return html`
${i18nString(UIStrings.noLcp)}
`;\n }\n return html`
${i18nString(UIStrings.noLcpResource)}
`;\n }\n\n // clang-format off\n return html`\n
\n
\n
    \n
  • \n ${this.#adviceIcon(imageData.shouldIncreasePriorityHint, i18nString(UIStrings.fetchPriorityApplied))}\n ${i18nString(UIStrings.fetchPriorityApplied)}\n
  • \n
  • \n ${this.#adviceIcon(imageData.shouldPreloadImage, i18nString(UIStrings.requestDiscoverable))}\n ${i18nString(UIStrings.requestDiscoverable)}\n
  • \n
  • \n ${this.#adviceIcon(imageData.shouldRemoveLazyLoading, i18nString(UIStrings.lazyLoadNotApplied))}\n ${i18nString(UIStrings.lazyLoadNotApplied)}\n
  • \n
\n
\n ${imageRef(imageData.request)}\n
`;\n // clang-format on\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'devtools-performance-lcp-discovery': LCPDiscovery;\n }\n}\n\ncustomElements.define('devtools-performance-lcp-discovery', LCPDiscovery);\n"]} \ No newline at end of file +{"version":3,"file":"LCPDiscovery.js","sourceRoot":"","sources":["../../../../../../../../front_end/panels/timeline/components/insights/LCPDiscovery.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,sDAAsD,CAAC;AAE9D,OAAO,KAAK,IAAI,MAAM,+BAA+B,CAAC;AAEtD,OAAO,KAAK,KAAK,MAAM,mCAAmC,CAAC;AAC3D,OAAO,KAAK,OAAO,MAAM,qCAAqC,CAAC;AAG/D,OAAO,EAAC,oBAAoB,EAAC,MAAM,2BAA2B,CAAC;AAC/D,OAAO,EAAC,QAAQ,EAAC,MAAM,eAAe,CAAC;AAEvC,MAAM,EAAC,IAAI,EAAC,GAAG,O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024 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport '../../../../ui/components/icon_button/icon_button.js';\n\nimport * as i18n from '../../../../core/i18n/i18n.js';\nimport type {LCPDiscoveryInsightModel} from '../../../../models/trace/insights/LCPDiscovery.js';\nimport * as Trace from '../../../../models/trace/trace.js';\nimport * as LitHtml from '../../../../ui/lit-html/lit-html.js';\nimport type * as Overlays from '../../overlays/overlays.js';\n\nimport {BaseInsightComponent} from './BaseInsightComponent.js';\nimport {imageRef} from './EventRef.js';\n\nconst {html} = LitHtml;\n\nconst UIStrings = {\n /**\n * @description Text to tell the user how long after the earliest discovery time their LCP element loaded.\n * @example {401ms} PH1\n */\n lcpLoadDelay: 'LCP image loaded {PH1} after earliest start point.',\n /**\n * @description Text to tell the user that a fetchpriority property value of \"high\" is applied to the LCP request.\n */\n fetchPriorityApplied: 'fetchpriority=high applied',\n /**\n * @description Text to tell the user that the LCP request is discoverable in the initial document.\n */\n requestDiscoverable: 'Request is discoverable in initial document',\n /**\n * @description Text to tell the user that the LCP request does not have the lazy load property applied.\n */\n lazyLoadNotApplied: 'lazy load not applied',\n /**\n *@description Text for a screen-reader label to tell the user that the icon represents a successful insight check\n *@example {Server response time} PH1\n */\n successAriaLabel: 'Insight check passed: {PH1}',\n /**\n *@description Text for a screen-reader label to tell the user that the icon represents an unsuccessful insight check\n *@example {Server response time} PH1\n */\n failedAriaLabel: 'Insight check failed: {PH1}',\n /**\n * @description Text status indicating that the the Largest Contentful Paint (LCP) metric timing was not found. \"LCP\" is an acronym and should not be translated.\n */\n noLcp: 'No LCP detected',\n /**\n * @description Text status indicating that the Largest Contentful Paint (LCP) metric was text rather than an image. \"LCP\" is an acronym and should not be translated.\n */\n noLcpResource: 'No LCP resource detected because the LCP is not an image',\n};\n\nconst str_ = i18n.i18n.registerUIStrings('panels/timeline/components/insights/LCPDiscovery.ts', UIStrings);\nconst i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);\n\ninterface LCPImageDiscoveryData {\n shouldIncreasePriorityHint: boolean;\n shouldPreloadImage: boolean;\n shouldRemoveLazyLoading: boolean;\n request: Trace.Types.Events.SyntheticNetworkRequest;\n discoveryDelay: Trace.Types.Timing.MicroSeconds|null;\n estimatedSavings: Trace.Types.Timing.MilliSeconds|null;\n}\n\nfunction getImageData(model: LCPDiscoveryInsightModel): LCPImageDiscoveryData|null {\n if (model.lcpRequest === undefined) {\n return null;\n }\n\n const shouldIncreasePriorityHint = model.shouldIncreasePriorityHint;\n const shouldPreloadImage = model.shouldPreloadImage;\n const shouldRemoveLazyLoading = model.shouldRemoveLazyLoading;\n\n const imageLCP = shouldIncreasePriorityHint !== undefined && shouldPreloadImage !== undefined &&\n shouldRemoveLazyLoading !== undefined;\n\n // Shouldn't render anything if lcp insight is null or lcp is text.\n if (!imageLCP) {\n return null;\n }\n\n const data: LCPImageDiscoveryData = {\n shouldIncreasePriorityHint,\n shouldPreloadImage,\n shouldRemoveLazyLoading,\n request: model.lcpRequest,\n discoveryDelay: null,\n estimatedSavings: model.metricSavings?.LCP ?? null,\n };\n\n if (model.earliestDiscoveryTimeTs && model.lcpRequest) {\n const discoveryDelay = model.lcpRequest.ts - model.earliestDiscoveryTimeTs;\n data.discoveryDelay = Trace.Types.Timing.MicroSeconds(discoveryDelay);\n }\n\n return data;\n}\n\nexport class LCPDiscovery extends BaseInsightComponent {\n static override readonly litTagName = LitHtml.StaticHtml.literal`devtools-performance-lcp-discovery`;\n override internalName: string = 'lcp-discovery';\n\n #adviceIcon(didFail: boolean, label: string): LitHtml.TemplateResult {\n const icon = didFail ? 'clear' : 'check-circle';\n\n const ariaLabel = didFail ? i18nString(UIStrings.failedAriaLabel, {PH1: label}) :\n i18nString(UIStrings.successAriaLabel, {PH1: label});\n return html`\n \n `;\n }\n\n #renderDiscoveryDelay(delay: Trace.Types.Timing.MicroSeconds): Element {\n const timeWrapper = document.createElement('span');\n timeWrapper.classList.add('discovery-time-ms');\n timeWrapper.innerText = i18n.TimeUtilities.formatMicroSecondsTime(delay);\n return i18n.i18n.getFormatLocalizedString(str_, UIStrings.lcpLoadDelay, {PH1: timeWrapper});\n }\n\n override createOverlays(): Overlays.Overlays.TimelineOverlay[] {\n if (!this.model) {\n return [];\n }\n\n const imageResults = getImageData(this.model);\n if (!imageResults || !imageResults.discoveryDelay) {\n return [];\n }\n\n const delay = Trace.Helpers.Timing.traceWindowFromMicroSeconds(\n Trace.Types.Timing.MicroSeconds(imageResults.request.ts - imageResults.discoveryDelay),\n imageResults.request.ts,\n );\n\n const label = html`
${this.#renderDiscoveryDelay(delay.range)}
`;\n\n return [\n {\n type: 'ENTRY_OUTLINE',\n entry: imageResults.request,\n outlineReason: 'ERROR',\n },\n {\n type: 'CANDY_STRIPED_TIME_RANGE',\n bounds: delay,\n entry: imageResults.request,\n },\n {\n type: 'TIMESPAN_BREAKDOWN',\n sections: [{\n bounds: delay,\n label,\n showDuration: false,\n }],\n entry: imageResults.request,\n renderLocation: 'ABOVE_EVENT',\n },\n ];\n }\n\n override getEstimatedSavingsTime(): Trace.Types.Timing.MilliSeconds|null {\n if (!this.model) {\n return null;\n }\n\n return getImageData(this.model)?.estimatedSavings ?? null;\n }\n\n override renderContent(): LitHtml.LitTemplate {\n if (!this.model) {\n return LitHtml.nothing;\n }\n\n const imageData = getImageData(this.model);\n if (!imageData) {\n if (!this.model.lcpEvent) {\n return html`
${i18nString(UIStrings.noLcp)}
`;\n }\n return html`
${i18nString(UIStrings.noLcpResource)}
`;\n }\n\n // clang-format off\n return html`\n
\n
\n
    \n
  • \n ${this.#adviceIcon(imageData.shouldIncreasePriorityHint, i18nString(UIStrings.fetchPriorityApplied))}\n ${i18nString(UIStrings.fetchPriorityApplied)}\n
  • \n
  • \n ${this.#adviceIcon(imageData.shouldPreloadImage, i18nString(UIStrings.requestDiscoverable))}\n ${i18nString(UIStrings.requestDiscoverable)}\n
  • \n
  • \n ${this.#adviceIcon(imageData.shouldRemoveLazyLoading, i18nString(UIStrings.lazyLoadNotApplied))}\n ${i18nString(UIStrings.lazyLoadNotApplied)}\n
  • \n
\n
\n ${imageRef(imageData.request)}\n
`;\n // clang-format on\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'devtools-performance-lcp-discovery': LCPDiscovery;\n }\n}\n\ncustomElements.define('devtools-performance-lcp-discovery', LCPDiscovery);\n"]} \ No newline at end of file diff --git a/public/panels/timeline/components/insights/LCPPhases.d.ts b/public/panels/timeline/components/insights/LCPPhases.d.ts index c6572fb3d..62c0ee230 100644 --- a/public/panels/timeline/components/insights/LCPPhases.d.ts +++ b/public/panels/timeline/components/insights/LCPPhases.d.ts @@ -5,7 +5,7 @@ import type * as Overlays from '../../overlays/overlays.js'; import { BaseInsightComponent } from './BaseInsightComponent.js'; export declare class LCPPhases extends BaseInsightComponent { #private; - static readonly litTagName: import("../../../../ui/lit-html/static.js").Static; + static readonly litTagName: LitHtml.StaticHtml.StaticValue; internalName: string; createOverlays(): Overlays.Overlays.TimelineOverlay[]; renderContent(): LitHtml.LitTemplate; diff --git a/public/panels/timeline/components/insights/LCPPhases.js b/public/panels/timeline/components/insights/LCPPhases.js index 1754fdfd8..2626d8218 100644 --- a/public/panels/timeline/components/insights/LCPPhases.js +++ b/public/panels/timeline/components/insights/LCPPhases.js @@ -40,7 +40,7 @@ const UIStrings = { const str_ = i18n.i18n.registerUIStrings('panels/timeline/components/insights/LCPPhases.ts', UIStrings); const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_); export class LCPPhases extends BaseInsightComponent { - static litTagName = LitHtml.literal `devtools-performance-lcp-by-phases`; + static litTagName = LitHtml.StaticHtml.literal `devtools-performance-lcp-by-phases`; internalName = 'lcp-by-phase'; #overlay = null; #getPhaseData() { diff --git a/public/panels/timeline/components/insights/LCPPhases.js.map b/public/panels/timeline/components/insights/LCPPhases.js.map index 4d6727cc9..8b3d8aa3a 100644 --- a/public/panels/timeline/components/insights/LCPPhases.js.map +++ b/public/panels/timeline/components/insights/LCPPhases.js.map @@ -1 +1 @@ -{"version":3,"file":"LCPPhases.js","sourceRoot":"","sources":["../../../../../../../../front_end/panels/timeline/components/insights/LCPPhases.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,YAAY,CAAC;AAEpB,OAAO,KAAK,IAAI,MAAM,+BAA+B,CAAC;AAEtD,OAAO,KAAK,KAAK,MAAM,mCAAmC,CAAC;AAC3D,OAAO,KAAK,OAAO,MAAM,qCAAqC,CAAC;AAG/D,OAAO,EAAC,oBAAoB,EAAC,MAAM,2BAA2B,CAAC;AAG/D,MAAM,EAAC,IAAI,EAAC,GAAG,OAAO,CAAC;AAEvB,MAAM,SAAS,GAAG;IAChB;;OAEG;IACH,eAAe,EAAE,oBAAoB;IACrC;;OAEG;IACH,iBAAiB,EAAE,qBAAqB;IACxC;;OAEG;IACH,oBAAoB,EAAE,wBAAwB;IAC9C;;OAEG;IACH,kBAAkB,EAAE,sBAAsB;IAC1C;;OAEG;IACH,KAAK,EAAE,OAAO;IACd;;OAEG;IACH,UAAU,EAAE,UAAU;IACtB;;OAEG;IACH,KAAK,EAAE,iBAAiB;CACzB,CAAC;AACF,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,iBAAiB,CAAC,kDAAkD,EAAE,SAAS,CAAC,CAAC;AACxG,MAAM,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC;AAQtE,MAAM,OAAO,SAAU,SAAQ,oBAA2C;IACxE,MAAM,CAAmB,UAAU,GAAG,OAAO,CAAC,OAAO,CAAA,oCAAoC,CAAC;IACjF,YAAY,GAAW,cAAc,CAAC;IAC/C,QAAQ,GAA6C,IAAI,CAAC;IAE1D,aAAa;QACX,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC;YAChB,OAAO,EAAE,CAAC;QACZ,CAAC;QAED,MAAM,MAAM,GAAG,I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CAAC,UAAU,CAAC,CAAC;YACxE,IAAI;SACQ;sCACc;aACzB,CAAC;QACV,kBAAkB;IACpB,CAAC;;AASH,cAAc,CAAC,MAAM,CAAC,oCAAoC,EAAE,SAAS,CAAC,CAAC","sourcesContent":["// Copyright 2024 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport './Table.js';\n\nimport * as i18n from '../../../../core/i18n/i18n.js';\nimport type {LCPPhasesInsightModel} from '../../../../models/trace/insights/LCPPhases.js';\nimport * as Trace from '../../../../models/trace/trace.js';\nimport * as LitHtml from '../../../../ui/lit-html/lit-html.js';\nimport type * as Overlays from '../../overlays/overlays.js';\n\nimport {BaseInsightComponent} from './BaseInsightComponent.js';\nimport type {TableData} from './Table.js';\n\nconst {html} = LitHtml;\n\nconst UIStrings = {\n /**\n *@description Time to first byte title for the Largest Contentful Paint's phases timespan breakdown.\n */\n timeToFirstByte: 'Time to first byte',\n /**\n *@description Resource load delay title for the Largest Contentful Paint phases timespan breakdown.\n */\n resourceLoadDelay: 'Resource load delay',\n /**\n *@description Resource load duration title for the Largest Contentful Paint phases timespan breakdown.\n */\n resourceLoadDuration: 'Resource load duration',\n /**\n *@description Element render delay title for the Largest Contentful Paint phases timespan breakdown.\n */\n elementRenderDelay: 'Element render delay',\n /**\n *@description Label used for the phase/component/stage/section of a larger duration.\n */\n phase: 'Phase',\n /**\n *@description Label used for the percentage a single phase/component/stage/section takes up of a larger duration.\n */\n percentLCP: '% of LCP',\n /**\n * @description Text status indicating that the the Largest Contentful Paint (LCP) metric timing was not found. \"LCP\" is an acronym and should not be translated.\n */\n noLcp: 'No LCP detected',\n};\nconst str_ = i18n.i18n.registerUIStrings('panels/timeline/components/insights/LCPPhases.ts', UIStrings);\nconst i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);\n\ninterface PhaseData {\n phase: string;\n timing: number|Trace.Types.Timing.MilliSeconds;\n percent: string;\n}\n\nexport class LCPPhases extends BaseInsightComponent {\n static override readonly litTagName = LitHtml.literal`devtools-performance-lcp-by-phases`;\n override internalName: string = 'lcp-by-phase';\n #overlay: Overlays.Overlays.TimespanBreakdown|null = null;\n\n #getPhaseData(): PhaseData[] {\n if (!this.model) {\n return [];\n }\n\n const timing = this.model.lcpMs;\n const phases = this.model.phases;\n\n if (!timing || !phases) {\n return [];\n }\n\n const {ttfb, loadDelay, loadTime, renderDelay} = phases;\n\n if (loadDelay && loadTime) {\n const phaseData = [\n {phase: i18nString(UIStrings.timeToFirstByte), timing: ttfb, percent: `${(100 * ttfb / timing).toFixed(0)}%`},\n {\n phase: i18nString(UIStrings.resourceLoadDelay),\n timing: loadDelay,\n percent: `${(100 * loadDelay / timing).toFixed(0)}%`,\n },\n {\n phase: i18nString(UIStrings.resourceLoadDuration),\n timing: loadTime,\n percent: `${(100 * loadTime / timing).toFixed(0)}%`,\n },\n {\n phase: i18nString(UIStrings.elementRenderDelay),\n timing: renderDelay,\n percent: `${(100 * renderDelay / timing).toFixed(0)}%`,\n },\n ];\n return phaseData;\n }\n\n // If the lcp is text, we only have ttfb and render delay.\n const phaseData = [\n {phase: i18nString(UIStrings.timeToFirstByte), timing: ttfb, percent: `${(100 * ttfb / timing).toFixed(0)}%`},\n {\n phase: i18nString(UIStrings.elementRenderDelay),\n timing: renderDelay,\n percent: `${(100 * renderDelay / timing).toFixed(0)}%`,\n },\n ];\n return phaseData;\n }\n\n override createOverlays(): Overlays.Overlays.TimelineOverlay[] {\n this.#overlay = null;\n\n if (!this.model) {\n return [];\n }\n\n const phases = this.model.phases;\n const lcpTs = this.model.lcpTs;\n if (!phases || !lcpTs) {\n return [];\n }\n const lcpMicroseconds = Trace.Types.Timing.MicroSeconds(Trace.Helpers.Timing.millisecondsToMicroseconds(lcpTs));\n\n const overlays: Overlays.Overlays.TimelineOverlay[] = [];\n if (this.model.lcpRequest) {\n overlays.push({type: 'ENTRY_OUTLINE', entry: this.model.lcpRequest, outlineReason: 'INFO'});\n }\n\n const sections = [];\n // For text LCP, we should only have ttfb and renderDelay sections.\n if (!phases?.loadDelay && !phases?.loadTime) {\n const renderBegin: Trace.Types.Timing.MicroSeconds = Trace.Types.Timing.MicroSeconds(\n lcpMicroseconds - Trace.Helpers.Timing.millisecondsToMicroseconds(phases.renderDelay));\n const renderDelay = Trace.Helpers.Timing.traceWindowFromMicroSeconds(\n renderBegin,\n lcpMicroseconds,\n );\n\n const mainReqStart =\n Trace.Types.Timing.MicroSeconds(renderBegin - Trace.Helpers.Timing.millisecondsToMicroseconds(phases.ttfb));\n const ttfb = Trace.Helpers.Timing.traceWindowFromMicroSeconds(\n mainReqStart,\n renderBegin,\n );\n sections.push(\n {bounds: ttfb, label: i18nString(UIStrings.timeToFirstByte), showDuration: true},\n {bounds: renderDelay, label: i18nString(UIStrings.elementRenderDelay), showDuration: true});\n } else if (phases?.loadDelay && phases?.loadTime) {\n const renderBegin: Trace.Types.Timing.MicroSeconds = Trace.Types.Timing.MicroSeconds(\n lcpMicroseconds - Trace.Helpers.Timing.millisecondsToMicroseconds(phases.renderDelay));\n const renderDelay = Trace.Helpers.Timing.traceWindowFromMicroSeconds(\n renderBegin,\n lcpMicroseconds,\n );\n\n const loadBegin = Trace.Types.Timing.MicroSeconds(\n renderBegin - Trace.Helpers.Timing.millisecondsToMicroseconds(phases.loadTime));\n const loadTime = Trace.Helpers.Timing.traceWindowFromMicroSeconds(\n loadBegin,\n renderBegin,\n );\n\n const loadDelayStart = Trace.Types.Timing.MicroSeconds(\n loadBegin - Trace.Helpers.Timing.millisecondsToMicroseconds(phases.loadDelay));\n const loadDelay = Trace.Helpers.Timing.traceWindowFromMicroSeconds(\n loadDelayStart,\n loadBegin,\n );\n\n const mainReqStart = Trace.Types.Timing.MicroSeconds(\n loadDelayStart - Trace.Helpers.Timing.millisecondsToMicroseconds(phases.ttfb));\n const ttfb = Trace.Helpers.Timing.traceWindowFromMicroSeconds(\n mainReqStart,\n loadDelayStart,\n );\n\n sections.push(\n {bounds: ttfb, label: i18nString(UIStrings.timeToFirstByte), showDuration: true},\n {bounds: loadDelay, label: i18nString(UIStrings.resourceLoadDelay), showDuration: true},\n {bounds: loadTime, label: i18nString(UIStrings.resourceLoadDuration), showDuration: true},\n {bounds: renderDelay, label: i18nString(UIStrings.elementRenderDelay), showDuration: true},\n );\n }\n\n this.#overlay = {\n type: 'TIMESPAN_BREAKDOWN',\n sections,\n };\n overlays.push(this.#overlay);\n return overlays;\n }\n\n override renderContent(): LitHtml.LitTemplate {\n if (!this.model) {\n return LitHtml.nothing;\n }\n\n const phaseData = this.#getPhaseData();\n if (!phaseData.length) {\n return html`
${i18nString(UIStrings.noLcp)}
`;\n }\n\n const rows = phaseData.map(({phase, percent}) => {\n const section = this.#overlay?.sections.find(section => phase === section.label);\n return {\n values: [phase, percent],\n overlays: section && [{\n type: 'TIMESPAN_BREAKDOWN',\n sections: [section],\n }],\n };\n });\n\n // clang-format off\n return html`\n
\n ${html`\n `}\n
`;\n // clang-format on\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'devtools-performance-lcp-by-phases': LCPPhases;\n }\n}\n\ncustomElements.define('devtools-performance-lcp-by-phases', LCPPhases);\n"]} \ No newline at end of file +{"version":3,"file":"LCPPhases.js","sourceRoot":"","sources":["../../../../../../../../front_end/panels/timeline/components/insights/LCPPhases.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,YAAY,CAAC;AAEpB,OAAO,KAAK,IAAI,MAAM,+BAA+B,CAAC;AAEtD,OAAO,KAAK,KAAK,MAAM,mCAAmC,CAAC;AAC3D,OAAO,KAAK,OAAO,MAAM,qCAAqC,CAAC;AAG/D,OAAO,EAAC,oBAAoB,EAAC,MAAM,2BAA2B,CAAC;AAG/D,MAAM,EAAC,IAAI,EAAC,GAAG,OAAO,CAAC;AAEvB,MAAM,SAAS,GAAG;IAChB;;OAEG;IACH,eAAe,EAAE,oBAAoB;IACrC;;OAEG;IACH,iBAAiB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M,EAAE,CAAC;YACtB,OAAO,IAAI,CAAA,gCAAgC,UAAU,CAAC,SAAS,CAAC,KAAK,CAAC,QAAQ,CAAC;QACjF,CAAC;QAED,MAAM,IAAI,GAAG,SAAS,CAAC,GAAG,CAAC,CAAC,EAAC,KAAK,EAAE,OAAO,EAAC,EAAE,EAAE;YAC9C,MAAM,OAAO,GAAG,IAAI,CAAC,QAAQ,EAAE,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,KAAK,KAAK,OAAO,CAAC,KAAK,CAAC,CAAC;YACjF,OAAO;gBACL,MAAM,EAAE,CAAC,KAAK,EAAE,OAAO,CAAC;gBACxB,QAAQ,EAAE,OAAO,IAAI,CAAC;wBACV,IAAI,EAAE,oBAAoB;wBAC1B,QAAQ,EAAE,CAAC,OAAO,CAAC;qBACpB,CAAC;aACb,CAAC;QACJ,CAAC,CAAC,CAAC;QAEH,mBAAmB;QACnB,OAAO,IAAI,CAAA;;UAEL,IAAI,CAAA;kBACI;YACN,OAAO,EAAE,IAAI;YACb,OAAO,EAAE,CAAC,UAAU,CAAC,SAAS,CAAC,KAAK,CAAC,EAAE,UAAU,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC;YACxE,IAAI;SACQ;sCACc;aACzB,CAAC;QACV,kBAAkB;IACpB,CAAC;;AASH,cAAc,CAAC,MAAM,CAAC,oCAAoC,EAAE,SAAS,CAAC,CAAC","sourcesContent":["// Copyright 2024 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport './Table.js';\n\nimport * as i18n from '../../../../core/i18n/i18n.js';\nimport type {LCPPhasesInsightModel} from '../../../../models/trace/insights/LCPPhases.js';\nimport * as Trace from '../../../../models/trace/trace.js';\nimport * as LitHtml from '../../../../ui/lit-html/lit-html.js';\nimport type * as Overlays from '../../overlays/overlays.js';\n\nimport {BaseInsightComponent} from './BaseInsightComponent.js';\nimport type {TableData} from './Table.js';\n\nconst {html} = LitHtml;\n\nconst UIStrings = {\n /**\n *@description Time to first byte title for the Largest Contentful Paint's phases timespan breakdown.\n */\n timeToFirstByte: 'Time to first byte',\n /**\n *@description Resource load delay title for the Largest Contentful Paint phases timespan breakdown.\n */\n resourceLoadDelay: 'Resource load delay',\n /**\n *@description Resource load duration title for the Largest Contentful Paint phases timespan breakdown.\n */\n resourceLoadDuration: 'Resource load duration',\n /**\n *@description Element render delay title for the Largest Contentful Paint phases timespan breakdown.\n */\n elementRenderDelay: 'Element render delay',\n /**\n *@description Label used for the phase/component/stage/section of a larger duration.\n */\n phase: 'Phase',\n /**\n *@description Label used for the percentage a single phase/component/stage/section takes up of a larger duration.\n */\n percentLCP: '% of LCP',\n /**\n * @description Text status indicating that the the Largest Contentful Paint (LCP) metric timing was not found. \"LCP\" is an acronym and should not be translated.\n */\n noLcp: 'No LCP detected',\n};\nconst str_ = i18n.i18n.registerUIStrings('panels/timeline/components/insights/LCPPhases.ts', UIStrings);\nconst i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);\n\ninterface PhaseData {\n phase: string;\n timing: number|Trace.Types.Timing.MilliSeconds;\n percent: string;\n}\n\nexport class LCPPhases extends BaseInsightComponent {\n static override readonly litTagName = LitHtml.StaticHtml.literal`devtools-performance-lcp-by-phases`;\n override internalName: string = 'lcp-by-phase';\n #overlay: Overlays.Overlays.TimespanBreakdown|null = null;\n\n #getPhaseData(): PhaseData[] {\n if (!this.model) {\n return [];\n }\n\n const timing = this.model.lcpMs;\n const phases = this.model.phases;\n\n if (!timing || !phases) {\n return [];\n }\n\n const {ttfb, loadDelay, loadTime, renderDelay} = phases;\n\n if (loadDelay && loadTime) {\n const phaseData = [\n {phase: i18nString(UIStrings.timeToFirstByte), timing: ttfb, percent: `${(100 * ttfb / timing).toFixed(0)}%`},\n {\n phase: i18nString(UIStrings.resourceLoadDelay),\n timing: loadDelay,\n percent: `${(100 * loadDelay / timing).toFixed(0)}%`,\n },\n {\n phase: i18nString(UIStrings.resourceLoadDuration),\n timing: loadTime,\n percent: `${(100 * loadTime / timing).toFixed(0)}%`,\n },\n {\n phase: i18nString(UIStrings.elementRenderDelay),\n timing: renderDelay,\n percent: `${(100 * renderDelay / timing).toFixed(0)}%`,\n },\n ];\n return phaseData;\n }\n\n // If the lcp is text, we only have ttfb and render delay.\n const phaseData = [\n {phase: i18nString(UIStrings.timeToFirstByte), timing: ttfb, percent: `${(100 * ttfb / timing).toFixed(0)}%`},\n {\n phase: i18nString(UIStrings.elementRenderDelay),\n timing: renderDelay,\n percent: `${(100 * renderDelay / timing).toFixed(0)}%`,\n },\n ];\n return phaseData;\n }\n\n override createOverlays(): Overlays.Overlays.TimelineOverlay[] {\n this.#overlay = null;\n\n if (!this.model) {\n return [];\n }\n\n const phases = this.model.phases;\n const lcpTs = this.model.lcpTs;\n if (!phases || !lcpTs) {\n return [];\n }\n const lcpMicroseconds = Trace.Types.Timing.MicroSeconds(Trace.Helpers.Timing.millisecondsToMicroseconds(lcpTs));\n\n const overlays: Overlays.Overlays.TimelineOverlay[] = [];\n if (this.model.lcpRequest) {\n overlays.push({type: 'ENTRY_OUTLINE', entry: this.model.lcpRequest, outlineReason: 'INFO'});\n }\n\n const sections = [];\n // For text LCP, we should only have ttfb and renderDelay sections.\n if (!phases?.loadDelay && !phases?.loadTime) {\n const renderBegin: Trace.Types.Timing.MicroSeconds = Trace.Types.Timing.MicroSeconds(\n lcpMicroseconds - Trace.Helpers.Timing.millisecondsToMicroseconds(phases.renderDelay));\n const renderDelay = Trace.Helpers.Timing.traceWindowFromMicroSeconds(\n renderBegin,\n lcpMicroseconds,\n );\n\n const mainReqStart =\n Trace.Types.Timing.MicroSeconds(renderBegin - Trace.Helpers.Timing.millisecondsToMicroseconds(phases.ttfb));\n const ttfb = Trace.Helpers.Timing.traceWindowFromMicroSeconds(\n mainReqStart,\n renderBegin,\n );\n sections.push(\n {bounds: ttfb, label: i18nString(UIStrings.timeToFirstByte), showDuration: true},\n {bounds: renderDelay, label: i18nString(UIStrings.elementRenderDelay), showDuration: true});\n } else if (phases?.loadDelay && phases?.loadTime) {\n const renderBegin: Trace.Types.Timing.MicroSeconds = Trace.Types.Timing.MicroSeconds(\n lcpMicroseconds - Trace.Helpers.Timing.millisecondsToMicroseconds(phases.renderDelay));\n const renderDelay = Trace.Helpers.Timing.traceWindowFromMicroSeconds(\n renderBegin,\n lcpMicroseconds,\n );\n\n const loadBegin = Trace.Types.Timing.MicroSeconds(\n renderBegin - Trace.Helpers.Timing.millisecondsToMicroseconds(phases.loadTime));\n const loadTime = Trace.Helpers.Timing.traceWindowFromMicroSeconds(\n loadBegin,\n renderBegin,\n );\n\n const loadDelayStart = Trace.Types.Timing.MicroSeconds(\n loadBegin - Trace.Helpers.Timing.millisecondsToMicroseconds(phases.loadDelay));\n const loadDelay = Trace.Helpers.Timing.traceWindowFromMicroSeconds(\n loadDelayStart,\n loadBegin,\n );\n\n const mainReqStart = Trace.Types.Timing.MicroSeconds(\n loadDelayStart - Trace.Helpers.Timing.millisecondsToMicroseconds(phases.ttfb));\n const ttfb = Trace.Helpers.Timing.traceWindowFromMicroSeconds(\n mainReqStart,\n loadDelayStart,\n );\n\n sections.push(\n {bounds: ttfb, label: i18nString(UIStrings.timeToFirstByte), showDuration: true},\n {bounds: loadDelay, label: i18nString(UIStrings.resourceLoadDelay), showDuration: true},\n {bounds: loadTime, label: i18nString(UIStrings.resourceLoadDuration), showDuration: true},\n {bounds: renderDelay, label: i18nString(UIStrings.elementRenderDelay), showDuration: true},\n );\n }\n\n this.#overlay = {\n type: 'TIMESPAN_BREAKDOWN',\n sections,\n };\n overlays.push(this.#overlay);\n return overlays;\n }\n\n override renderContent(): LitHtml.LitTemplate {\n if (!this.model) {\n return LitHtml.nothing;\n }\n\n const phaseData = this.#getPhaseData();\n if (!phaseData.length) {\n return html`
${i18nString(UIStrings.noLcp)}
`;\n }\n\n const rows = phaseData.map(({phase, percent}) => {\n const section = this.#overlay?.sections.find(section => phase === section.label);\n return {\n values: [phase, percent],\n overlays: section && [{\n type: 'TIMESPAN_BREAKDOWN',\n sections: [section],\n }],\n };\n });\n\n // clang-format off\n return html`\n
\n ${html`\n `}\n
`;\n // clang-format on\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'devtools-performance-lcp-by-phases': LCPPhases;\n }\n}\n\ncustomElements.define('devtools-performance-lcp-by-phases', LCPPhases);\n"]} \ No newline at end of file diff --git a/public/panels/timeline/components/insights/RenderBlocking.d.ts b/public/panels/timeline/components/insights/RenderBlocking.d.ts index 7968c5562..3848759a8 100644 --- a/public/panels/timeline/components/insights/RenderBlocking.d.ts +++ b/public/panels/timeline/components/insights/RenderBlocking.d.ts @@ -6,7 +6,7 @@ import type * as Overlays from '../../overlays/overlays.js'; import { BaseInsightComponent } from './BaseInsightComponent.js'; export declare class RenderBlocking extends BaseInsightComponent { #private; - static readonly litTagName: import("../../../../ui/lit-html/static.js").Static; + static readonly litTagName: LitHtml.StaticHtml.StaticValue; internalName: string; createOverlays(): Overlays.Overlays.TimelineOverlay[]; getEstimatedSavingsTime(): Trace.Types.Timing.MilliSeconds | null; diff --git a/public/panels/timeline/components/insights/RenderBlocking.js b/public/panels/timeline/components/insights/RenderBlocking.js index e84b2b651..147f3325f 100644 --- a/public/panels/timeline/components/insights/RenderBlocking.js +++ b/public/panels/timeline/components/insights/RenderBlocking.js @@ -25,7 +25,7 @@ const UIStrings = { const str_ = i18n.i18n.registerUIStrings('panels/timeline/components/insights/RenderBlocking.ts', UIStrings); const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_); export class RenderBlocking extends BaseInsightComponent { - static litTagName = LitHtml.literal `devtools-performance-render-blocking-requests`; + static litTagName = LitHtml.StaticHtml.literal `devtools-performance-render-blocking-requests`; internalName = 'render-blocking-requests'; createOverlays() { if (!this.model) { diff --git a/public/panels/timeline/components/insights/RenderBlocking.js.map b/public/panels/timeline/components/insights/RenderBlocking.js.map index 73ba9d555..d2b5295ad 100644 --- a/public/panels/timeline/components/insights/RenderBlocking.js.map +++ b/public/panels/timeline/components/insights/RenderBlocking.js.map @@ -1 +1 @@ -{"version":3,"file":"RenderBlocking.js","sourceRoot":"","sources":["../../../../../../../../front_end/panels/timeline/components/insights/RenderBlocking.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,YAAY,CAAC;AAEpB,OAAO,KAAK,IAAI,MAAM,+BAA+B,CAAC;AACtD,OAAO,KAAK,QAAQ,MAAM,uCAAuC,CAAC;AAGlE,OAAO,KAAK,OAAO,MAAM,qCAAqC,CAAC;AAG/D,OAAO,EAAC,oBAAoB,EAAC,MAAM,2BAA2B,CAAC;AAC/D,OAAO,EAAC,QAAQ,EAAC,MAAM,eAAe,CAAC;AAEvC,MAAM,EAAC,IAAI,EAAC,GAAG,OAAO,CAAC;AAEvB,MAAM,SAAS,GAAG;IAChB;;OAEG;IACH,qBAAqB,EAAE,SAAS;IAChC;;OAEG;IACH,QAAQ,EAAE,UAAU;IACpB;;OAEG;IACH,gBAAgB,EAAE,iDAAiD;CACpE,CAAC;AAEF,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,iBAAiB,CAAC,uDAAuD,EAAE,SAAS,CAAC,CAAC;AAC7G,MAAM,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC;AAEtE,MAAM,OAAO,cAAe,SAAQ,oBAAgD;IAClF,MAAM,CAAmB,UAAU,GAAG,OAAO,CAAC,OAAO,CAAA,+CAA+C,CAAC;IAC5F,YAAY,GAAW,0BAA0B,CAAC;IAElD,cAAc;QACrB,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC;YAChB,OAAO,EAAE,CAAC;QACZ,CAAC;QAED,OAAO,IAAI,CAAC,KAAK,CAAC,sBAAsB,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,CAAC,IAAI,CAAC,wBAAwB,CAAC,OAAO,CAAC,CAA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,CAAC,+CAA+C,EAAE,cAAc,CAAC,CAAC","sourcesContent":["// Copyright 2024 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport './Table.js';\n\nimport * as i18n from '../../../../core/i18n/i18n.js';\nimport * as Platform from '../../../../core/platform/platform.js';\nimport type {RenderBlockingInsightModel} from '../../../../models/trace/insights/RenderBlocking.js';\nimport type * as Trace from '../../../../models/trace/trace.js';\nimport * as LitHtml from '../../../../ui/lit-html/lit-html.js';\nimport type * as Overlays from '../../overlays/overlays.js';\n\nimport {BaseInsightComponent} from './BaseInsightComponent.js';\nimport {eventRef} from './EventRef.js';\n\nconst {html} = LitHtml;\n\nconst UIStrings = {\n /**\n * @description Label to describe a network request (that happens to be render-blocking).\n */\n renderBlockingRequest: 'Request',\n /**\n *@description Label used for a time duration.\n */\n duration: 'Duration',\n /**\n * @description Text status indicating that no requests blocked the initial render of a navigation\n */\n noRenderBlocking: 'No render blocking requests for this navigation',\n};\n\nconst str_ = i18n.i18n.registerUIStrings('panels/timeline/components/insights/RenderBlocking.ts', UIStrings);\nconst i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);\n\nexport class RenderBlocking extends BaseInsightComponent {\n static override readonly litTagName = LitHtml.literal`devtools-performance-render-blocking-requests`;\n override internalName: string = 'render-blocking-requests';\n\n override createOverlays(): Overlays.Overlays.TimelineOverlay[] {\n if (!this.model) {\n return [];\n }\n\n return this.model.renderBlockingRequests.map(request => this.#createOverlayForRequest(request));\n }\n\n #createOverlayForRequest(request: Trace.Types.Events.SyntheticNetworkRequest): Overlays.Overlays.EntryOutline {\n return {\n type: 'ENTRY_OUTLINE',\n entry: request,\n outlineReason: 'ERROR',\n };\n }\n\n override getEstimatedSavingsTime(): Trace.Types.Timing.MilliSeconds|null {\n return this.model?.metricSavings?.FCP ?? null;\n }\n\n override renderContent(): LitHtml.LitTemplate {\n if (!this.model) {\n return LitHtml.nothing;\n }\n\n const MAX_REQUESTS = 3;\n const topRequests = this.model.renderBlockingRequests.slice(0, MAX_REQUESTS);\n\n if (!topRequests.length) {\n return html`
${i18nString(UIStrings.noRenderBlocking)}
`;\n }\n\n // clang-format off\n return html`\n
\n ({\n values: [\n eventRef(request),\n i18n.TimeUtilities.millisToString(Platform.Timing.microSecondsToMilliSeconds(request.dur)),\n ],\n overlays: [this.#createOverlayForRequest(request)],\n })),\n }}>\n \n
\n `;\n // clang-format on\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'devtools-performance-render-blocking-requests': RenderBlocking;\n }\n}\n\ncustomElements.define('devtools-performance-render-blocking-requests', RenderBlocking);\n"]} \ No newline at end of file +{"version":3,"file":"RenderBlocking.js","sourceRoot":"","sources":["../../../../../../../../front_end/panels/timeline/components/insights/RenderBlocking.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,YAAY,CAAC;AAEpB,OAAO,KAAK,IAAI,MAAM,+BAA+B,CAAC;AACtD,OAAO,KAAK,QAAQ,MAAM,uCAAuC,CAAC;AAGlE,OAAO,KAAK,OAAO,MAAM,qCAAqC,CAAC;AAG/D,OAAO,EAAC,oBAAoB,EAAC,MAAM,2BAA2B,CAAC;AAC/D,OAAO,EAAC,QAAQ,EAAC,MAAM,eAAe,CAAC;AAEvC,MAAM,EAAC,IAAI,EAAC,GAAG,OAAO,CAAC;AAEvB,MAAM,SAAS,GAAG;IAChB;;OAEG;IACH,qBAAqB,EAAE,SAAS;IAChC;;OAEG;IACH,QAAQ,EAAE,UAAU;IACpB;;OAEG;IACH,gBAAgB,EAAE,iDAAiD;CACpE,CAAC;AAEF,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,iBAAiB,CAAC,uDAAuD,EAAE,SAAS,CAAC,CAAC;AAC7G,MAAM,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC;AAEtE,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,GAAG,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;gBAChC,MAAM,EAAE;oBACN,QAAQ,CAAC,OAAO,CAAC;oBACjB,IAAI,CAAC,aAAa,CAAC,cAAc,CAAC,QAAQ,CAAC,MAAM,CAAC,0BAA0B,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;iBAC3F;gBACD,QAAQ,EAAE,CAAC,IAAI,CAAC,wBAAwB,CAAC,OAAO,CAAC,CAAC;aACnD,CAAC,CAAC;SACJ;;;KAGN,CAAC;QACF,kBAAkB;IACpB,CAAC;;AASH,cAAc,CAAC,MAAM,CAAC,+CAA+C,EAAE,cAAc,CAAC,CAAC","sourcesContent":["// Copyright 2024 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport './Table.js';\n\nimport * as i18n from '../../../../core/i18n/i18n.js';\nimport * as Platform from '../../../../core/platform/platform.js';\nimport type {RenderBlockingInsightModel} from '../../../../models/trace/insights/RenderBlocking.js';\nimport type * as Trace from '../../../../models/trace/trace.js';\nimport * as LitHtml from '../../../../ui/lit-html/lit-html.js';\nimport type * as Overlays from '../../overlays/overlays.js';\n\nimport {BaseInsightComponent} from './BaseInsightComponent.js';\nimport {eventRef} from './EventRef.js';\n\nconst {html} = LitHtml;\n\nconst UIStrings = {\n /**\n * @description Label to describe a network request (that happens to be render-blocking).\n */\n renderBlockingRequest: 'Request',\n /**\n *@description Label used for a time duration.\n */\n duration: 'Duration',\n /**\n * @description Text status indicating that no requests blocked the initial render of a navigation\n */\n noRenderBlocking: 'No render blocking requests for this navigation',\n};\n\nconst str_ = i18n.i18n.registerUIStrings('panels/timeline/components/insights/RenderBlocking.ts', UIStrings);\nconst i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);\n\nexport class RenderBlocking extends BaseInsightComponent {\n static override readonly litTagName = LitHtml.StaticHtml.literal`devtools-performance-render-blocking-requests`;\n override internalName: string = 'render-blocking-requests';\n\n override createOverlays(): Overlays.Overlays.TimelineOverlay[] {\n if (!this.model) {\n return [];\n }\n\n return this.model.renderBlockingRequests.map(request => this.#createOverlayForRequest(request));\n }\n\n #createOverlayForRequest(request: Trace.Types.Events.SyntheticNetworkRequest): Overlays.Overlays.EntryOutline {\n return {\n type: 'ENTRY_OUTLINE',\n entry: request,\n outlineReason: 'ERROR',\n };\n }\n\n override getEstimatedSavingsTime(): Trace.Types.Timing.MilliSeconds|null {\n return this.model?.metricSavings?.FCP ?? null;\n }\n\n override renderContent(): LitHtml.LitTemplate {\n if (!this.model) {\n return LitHtml.nothing;\n }\n\n const MAX_REQUESTS = 3;\n const topRequests = this.model.renderBlockingRequests.slice(0, MAX_REQUESTS);\n\n if (!topRequests.length) {\n return html`
${i18nString(UIStrings.noRenderBlocking)}
`;\n }\n\n // clang-format off\n return html`\n
\n ({\n values: [\n eventRef(request),\n i18n.TimeUtilities.millisToString(Platform.Timing.microSecondsToMilliSeconds(request.dur)),\n ],\n overlays: [this.#createOverlayForRequest(request)],\n })),\n }}>\n \n
\n `;\n // clang-format on\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'devtools-performance-render-blocking-requests': RenderBlocking;\n }\n}\n\ncustomElements.define('devtools-performance-render-blocking-requests', RenderBlocking);\n"]} \ No newline at end of file diff --git a/public/panels/timeline/components/insights/SlowCSSSelector.d.ts b/public/panels/timeline/components/insights/SlowCSSSelector.d.ts index 62e843352..53e27e874 100644 --- a/public/panels/timeline/components/insights/SlowCSSSelector.d.ts +++ b/public/panels/timeline/components/insights/SlowCSSSelector.d.ts @@ -6,7 +6,7 @@ import type * as Overlays from '../../overlays/overlays.js'; import { BaseInsightComponent } from './BaseInsightComponent.js'; export declare class SlowCSSSelector extends BaseInsightComponent { #private; - static readonly litTagName: import("../../../../ui/lit-html/static.js").Static; + static readonly litTagName: LitHtml.StaticHtml.StaticValue; internalName: string; createOverlays(): Overlays.Overlays.TimelineOverlay[]; private toSourceFileLocation; diff --git a/public/panels/timeline/components/insights/SlowCSSSelector.js b/public/panels/timeline/components/insights/SlowCSSSelector.js index 8a2c2d257..ad4a85bb7 100644 --- a/public/panels/timeline/components/insights/SlowCSSSelector.js +++ b/public/panels/timeline/components/insights/SlowCSSSelector.js @@ -39,7 +39,7 @@ const UIStrings = { const str_ = i18n.i18n.registerUIStrings('panels/timeline/components/insights/SlowCSSSelector.ts', UIStrings); const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_); export class SlowCSSSelector extends BaseInsightComponent { - static litTagName = LitHtml.literal `devtools-performance-slow-css-selector`; + static litTagName = LitHtml.StaticHtml.literal `devtools-performance-slow-css-selector`; internalName = 'slow-css-selector'; #selectorLocations = new Map(); createOverlays() { diff --git a/public/panels/timeline/components/insights/SlowCSSSelector.js.map b/public/panels/timeline/components/insights/SlowCSSSelector.js.map index 1f0a374cf..5f117255b 100644 --- a/public/panels/timeline/components/insights/SlowCSSSelector.js.map +++ b/public/panels/timeline/components/insights/SlowCSSSelector.js.map @@ -1 +1 @@ -{"version":3,"file":"SlowCSSSelector.js","sourceRoot":"","sources":["../../../../../../../../front_end/panels/timeline/components/insights/SlowCSSSelector.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,YAAY,CAAC;AACpB,OAAO,kDAAkD,CAAC;AAE1D,OAAO,KAAK,IAAI,MAAM,+BAA+B,CAAC;AACtD,OAAO,KAAK,QAAQ,MAAM,uCAAuC,CAAC;AAClE,OAAO,KAAK,GAAG,MAAM,6BAA6B,CAAC;AAGnD,OAAO,KAAK,KAAK,MAAM,mCAAmC,CAAC;AAE3D,OAAO,KAAK,OAAO,MAAM,qCAAqC,CAAC;AAG/D,OAAO,EAAC,oBAAoB,EAAC,MAAM,2BAA2B,CAAC;AAG/D,MAAM,EAAC,IAAI,EAAC,GAAG,OAAO,CAAC;AAEvB,MAAM,SAAS,GAAG;IAChB;;OAEG;IACH,aAAa,EAAE,gBAAgB;IAC/B;;OAEG;IACH,UAAU,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KAAK,CAAC,gBAAgB,CAAC,MAAM,EAAE,CAAC;YACvC,mBAAmB;YACnB,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAA;;;oBAGJ;gBACN,OAAO,EAAE,IAAI;gBACb,OAAO,EAAE,CAAC,UAAU,CAAC,SAAS,CAAC,YAAY,CAAC,EAAE,UAAU,CAAC,SAAS,CAAC,aAAa,CAAC,CAAC;gBAClF,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,gBAAgB,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE;oBAC/C,OAAO;wBACL,MAAM,EAAE;4BACR,IAAI,CAAA,GAAG,QAAQ,CAAC,QAAQ,IAAI,OAAO,CAAC,UAAU,CAAC,KAAK,CAAC,IAAI,CAAC,gBAAgB,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC,EAAuB;4BACtH,QAAQ,CAAC,gBAAgB,CAAC;yBAAC;qBAC5B,CAAC;gBACJ,CAAC,CAAC;aACU;;;OAGnB,CAAC,CAAC;YACH,kBAAkB;QACpB,CAAC;QAED,OAAO,IAAI,CAAA,GAAG,QAAQ,EAAE,CAAC;IAC3B,CAAC;;AASH,cAAc,CAAC,MAAM,CAAC,wCAAwC,EAAE,eAAe,CAAC,CAAC","sourcesContent":["// Copyright 2024 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport './Table.js';\nimport '../../../../ui/components/linkifier/linkifier.js';\n\nimport * as i18n from '../../../../core/i18n/i18n.js';\nimport * as Platform from '../../../../core/platform/platform.js';\nimport * as SDK from '../../../../core/sdk/sdk.js';\nimport type * as Protocol from '../../../../generated/protocol.js';\nimport type {SlowCSSSelectorInsightModel} from '../../../../models/trace/insights/SlowCSSSelector.js';\nimport * as Trace from '../../../../models/trace/trace.js';\nimport type * as Linkifier from '../../../../ui/components/linkifier/linkifier.js';\nimport * as LitHtml from '../../../../ui/lit-html/lit-html.js';\nimport type * as Overlays from '../../overlays/overlays.js';\n\nimport {BaseInsightComponent} from './BaseInsightComponent.js';\nimport type {TableData} from './Table.js';\n\nconst {html} = LitHtml;\n\nconst UIStrings = {\n /**\n *@description Column name for count of elements that the engine attempted to match against a style rule\n */\n matchAttempts: 'Match attempts',\n /**\n *@description Column name for count of elements that matched a style rule\n */\n matchCount: 'Match count',\n /**\n *@description Column name for elapsed time spent computing a style rule\n */\n elapsed: 'Elapsed time',\n /**\n *@description Column name for the selectors that took the longest amount of time/effort.\n */\n topSelectors: 'Top selectors',\n /**\n *@description Column name for a total sum.\n */\n total: 'Total',\n /**\n * @description Text status indicating that no CSS selector data was found.\n */\n enableSelectorData:\n 'No CSS selector data was found. CSS selector stats need to be enabled in the performance panel settings.',\n};\n\nconst str_ = i18n.i18n.registerUIStrings('panels/timeline/components/insights/SlowCSSSelector.ts', UIStrings);\nconst i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);\n\nexport class SlowCSSSelector extends BaseInsightComponent {\n static override readonly litTagName = LitHtml.literal`devtools-performance-slow-css-selector`;\n override internalName: string = 'slow-css-selector';\n #selectorLocations: Map = new Map();\n\n override createOverlays(): Overlays.Overlays.TimelineOverlay[] {\n return [];\n }\n\n private async toSourceFileLocation(cssModel: SDK.CSSModel.CSSModel, selector: Trace.Types.Events.SelectorTiming):\n Promise {\n if (!cssModel) {\n return undefined;\n }\n const styleSheetHeader = cssModel.styleSheetHeaderForId(selector.style_sheet_id as Protocol.CSS.StyleSheetId);\n if (!styleSheetHeader || !styleSheetHeader.resourceURL()) {\n return undefined;\n }\n\n // get the locations from cache if available\n const key: string = JSON.stringify({selectorText: selector.selector, styleSheetId: selector.style_sheet_id});\n let ranges = this.#selectorLocations.get(key);\n if (!ranges) {\n const result = await cssModel.agent.invoke_getLocationForSelector(\n {selectorText: selector.selector, styleSheetId: selector.style_sheet_id as Protocol.CSS.StyleSheetId});\n if (result.getError() || !result.ranges) {\n return undefined;\n }\n ranges = result.ranges;\n this.#selectorLocations.set(key, ranges);\n }\n\n const locations = ranges.map((range, itemIndex) => {\n return {\n url: styleSheetHeader.resourceURL() as Platform.DevToolsPath.UrlString,\n lineNumber: range.startLine,\n columnNumber: range.startColumn,\n linkText: `[${itemIndex + 1}]`,\n title: `${styleSheetHeader.id} line ${range.startLine + 1}:${range.startColumn + 1}`,\n } as Linkifier.Linkifier.LinkifierData;\n });\n return locations;\n }\n\n private async getSelectorLinks(\n cssModel: SDK.CSSModel.CSSModel|null|undefined,\n selector: Trace.Types.Events.SelectorTiming): Promise {\n if (!cssModel) {\n return LitHtml.nothing;\n }\n\n if (!selector.style_sheet_id) {\n return LitHtml.nothing;\n }\n\n const locations = await this.toSourceFileLocation(cssModel, selector);\n if (!locations) {\n return LitHtml.nothing;\n }\n\n const links = html`\n ${locations.map((location, itemIndex) => {\n const divider = itemIndex !== locations.length - 1 ? ', ' : '';\n return html`${\n divider}`;\n })}`;\n\n return links;\n }\n\n override renderContent(): LitHtml.LitTemplate {\n if (!this.model) {\n return LitHtml.nothing;\n }\n\n const target = SDK.TargetManager.TargetManager.instance().primaryPageTarget();\n const cssModel = target?.model(SDK.CSSModel.CSSModel);\n const time = (us: Trace.Types.Timing.MicroSeconds): string =>\n i18n.TimeUtilities.millisToString(Platform.Timing.microSecondsToMilliSeconds(us));\n\n if (!this.model.topMatchAttempts.length && !this.model.topElapsedMs.length) {\n return html`
${i18nString(UIStrings.enableSelectorData)}
`;\n }\n\n // clang-format off\n const sections = [html`\n
\n \n \n
\n `];\n // clang-format on\n\n if (this.model.topElapsedMs.length) {\n // clang-format off\n sections.push(html`\n
\n {\n return {\n values: [\n html`${selector.selector} ${LitHtml.Directives.until(this.getSelectorLinks(cssModel, selector))}`,\n time(Trace.Types.Timing.MicroSeconds(selector['elapsed (us)']))],\n };\n }),\n } as TableData}>\n \n
\n `);\n // clang-format on\n }\n\n if (this.model.topMatchAttempts.length) {\n // clang-format off\n sections.push(html`\n
\n {\n return {\n values: [\n html`${selector.selector} ${LitHtml.Directives.until(this.getSelectorLinks(cssModel, selector))}` as unknown as string,\n selector['match_attempts']],\n };\n }),\n } as TableData}>\n \n
\n `);\n // clang-format on\n }\n\n return html`${sections}`;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'devtools-performance-slow-css-selector': SlowCSSSelector;\n }\n}\n\ncustomElements.define('devtools-performance-slow-css-selector', SlowCSSSelector);\n"]} \ No newline at end of file +{"version":3,"file":"SlowCSSSelector.js","sourceRoot":"","sources":["../../../../../../../../front_end/panels/timeline/components/insights/SlowCSSSelector.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,YAAY,CAAC;AACpB,OAAO,kDAAkD,CAAC;AAE1D,OAAO,KAAK,IAAI,MAAM,+BAA+B,CAAC;AACtD,OAAO,KAAK,QAAQ,MAAM,uCAAuC,CAAC;AAClE,OAAO,KAAK,GAAG,MAAM,6BAA6B,CAAC;AAGnD,OAAO,KAAK,KAAK,MAAM,mCAAmC,CAAC;AAE3D,OAAO,KAAK,OAAO,MAAM,qCAAqC,CAAC;AAG/D,OAAO,EAAC,oBAAoB,EAAC,MAAM,2BAA2B,CAAC;AAG/D,MAAM,EAAC,IAAI,EAAC,GAAG,OAAO,CAAC;AAEvB,MAAM,SAAS,GAAG;IAChB;;OAEG;IACH,aAAa,EAAE,gBAAgB;IAC/B;;OAEG;IACH,UAAU,EAAE,aAAa;IACzB;;OAEG;IACH,OAAO,EAAE,cAAc;IACvB;;OAEG;IACH,YAAY,EAAE,eAAe;IAC7B;;OAEG;IACH,KAAK,EAAE,OAAO;IACd;;OAEG;IACH,kBAAkB,EACd,0GAA0G;CAC/G,CAAC;AAEF,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,iBAAiB,CAAC,wDAAwD,EAAE,SAAS,CAAC,CAAC;AAC9G,MAAM,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC;AAEtE,MAA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IAAI,CAAA,GAAG,QAAQ,CAAC,QAAQ,IAAI,OAAO,CAAC,UAAU,CAAC,KAAK,CAAC,IAAI,CAAC,gBAAgB,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC,EAAuB;4BACtH,QAAQ,CAAC,gBAAgB,CAAC;yBAAC;qBAC5B,CAAC;gBACJ,CAAC,CAAC;aACU;;;OAGnB,CAAC,CAAC;YACH,kBAAkB;QACpB,CAAC;QAED,OAAO,IAAI,CAAA,GAAG,QAAQ,EAAE,CAAC;IAC3B,CAAC;;AASH,cAAc,CAAC,MAAM,CAAC,wCAAwC,EAAE,eAAe,CAAC,CAAC","sourcesContent":["// Copyright 2024 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport './Table.js';\nimport '../../../../ui/components/linkifier/linkifier.js';\n\nimport * as i18n from '../../../../core/i18n/i18n.js';\nimport * as Platform from '../../../../core/platform/platform.js';\nimport * as SDK from '../../../../core/sdk/sdk.js';\nimport type * as Protocol from '../../../../generated/protocol.js';\nimport type {SlowCSSSelectorInsightModel} from '../../../../models/trace/insights/SlowCSSSelector.js';\nimport * as Trace from '../../../../models/trace/trace.js';\nimport type * as Linkifier from '../../../../ui/components/linkifier/linkifier.js';\nimport * as LitHtml from '../../../../ui/lit-html/lit-html.js';\nimport type * as Overlays from '../../overlays/overlays.js';\n\nimport {BaseInsightComponent} from './BaseInsightComponent.js';\nimport type {TableData} from './Table.js';\n\nconst {html} = LitHtml;\n\nconst UIStrings = {\n /**\n *@description Column name for count of elements that the engine attempted to match against a style rule\n */\n matchAttempts: 'Match attempts',\n /**\n *@description Column name for count of elements that matched a style rule\n */\n matchCount: 'Match count',\n /**\n *@description Column name for elapsed time spent computing a style rule\n */\n elapsed: 'Elapsed time',\n /**\n *@description Column name for the selectors that took the longest amount of time/effort.\n */\n topSelectors: 'Top selectors',\n /**\n *@description Column name for a total sum.\n */\n total: 'Total',\n /**\n * @description Text status indicating that no CSS selector data was found.\n */\n enableSelectorData:\n 'No CSS selector data was found. CSS selector stats need to be enabled in the performance panel settings.',\n};\n\nconst str_ = i18n.i18n.registerUIStrings('panels/timeline/components/insights/SlowCSSSelector.ts', UIStrings);\nconst i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);\n\nexport class SlowCSSSelector extends BaseInsightComponent {\n static override readonly litTagName = LitHtml.StaticHtml.literal`devtools-performance-slow-css-selector`;\n override internalName: string = 'slow-css-selector';\n #selectorLocations: Map = new Map();\n\n override createOverlays(): Overlays.Overlays.TimelineOverlay[] {\n return [];\n }\n\n private async toSourceFileLocation(cssModel: SDK.CSSModel.CSSModel, selector: Trace.Types.Events.SelectorTiming):\n Promise {\n if (!cssModel) {\n return undefined;\n }\n const styleSheetHeader = cssModel.styleSheetHeaderForId(selector.style_sheet_id as Protocol.CSS.StyleSheetId);\n if (!styleSheetHeader || !styleSheetHeader.resourceURL()) {\n return undefined;\n }\n\n // get the locations from cache if available\n const key: string = JSON.stringify({selectorText: selector.selector, styleSheetId: selector.style_sheet_id});\n let ranges = this.#selectorLocations.get(key);\n if (!ranges) {\n const result = await cssModel.agent.invoke_getLocationForSelector(\n {selectorText: selector.selector, styleSheetId: selector.style_sheet_id as Protocol.CSS.StyleSheetId});\n if (result.getError() || !result.ranges) {\n return undefined;\n }\n ranges = result.ranges;\n this.#selectorLocations.set(key, ranges);\n }\n\n const locations = ranges.map((range, itemIndex) => {\n return {\n url: styleSheetHeader.resourceURL() as Platform.DevToolsPath.UrlString,\n lineNumber: range.startLine,\n columnNumber: range.startColumn,\n linkText: `[${itemIndex + 1}]`,\n title: `${styleSheetHeader.id} line ${range.startLine + 1}:${range.startColumn + 1}`,\n } as Linkifier.Linkifier.LinkifierData;\n });\n return locations;\n }\n\n private async getSelectorLinks(\n cssModel: SDK.CSSModel.CSSModel|null|undefined,\n selector: Trace.Types.Events.SelectorTiming): Promise {\n if (!cssModel) {\n return LitHtml.nothing;\n }\n\n if (!selector.style_sheet_id) {\n return LitHtml.nothing;\n }\n\n const locations = await this.toSourceFileLocation(cssModel, selector);\n if (!locations) {\n return LitHtml.nothing;\n }\n\n const links = html`\n ${locations.map((location, itemIndex) => {\n const divider = itemIndex !== locations.length - 1 ? ', ' : '';\n return html`${\n divider}`;\n })}`;\n\n return links;\n }\n\n override renderContent(): LitHtml.LitTemplate {\n if (!this.model) {\n return LitHtml.nothing;\n }\n\n const target = SDK.TargetManager.TargetManager.instance().primaryPageTarget();\n const cssModel = target?.model(SDK.CSSModel.CSSModel);\n const time = (us: Trace.Types.Timing.MicroSeconds): string =>\n i18n.TimeUtilities.millisToString(Platform.Timing.microSecondsToMilliSeconds(us));\n\n if (!this.model.topMatchAttempts.length && !this.model.topElapsedMs.length) {\n return html`
${i18nString(UIStrings.enableSelectorData)}
`;\n }\n\n // clang-format off\n const sections = [html`\n
\n \n \n
\n `];\n // clang-format on\n\n if (this.model.topElapsedMs.length) {\n // clang-format off\n sections.push(html`\n
\n {\n return {\n values: [\n html`${selector.selector} ${LitHtml.Directives.until(this.getSelectorLinks(cssModel, selector))}`,\n time(Trace.Types.Timing.MicroSeconds(selector['elapsed (us)']))],\n };\n }),\n } as TableData}>\n \n
\n `);\n // clang-format on\n }\n\n if (this.model.topMatchAttempts.length) {\n // clang-format off\n sections.push(html`\n
\n {\n return {\n values: [\n html`${selector.selector} ${LitHtml.Directives.until(this.getSelectorLinks(cssModel, selector))}` as unknown as string,\n selector['match_attempts']],\n };\n }),\n } as TableData}>\n \n
\n `);\n // clang-format on\n }\n\n return html`${sections}`;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'devtools-performance-slow-css-selector': SlowCSSSelector;\n }\n}\n\ncustomElements.define('devtools-performance-slow-css-selector', SlowCSSSelector);\n"]} \ No newline at end of file diff --git a/public/panels/timeline/components/insights/ThirdParties.d.ts b/public/panels/timeline/components/insights/ThirdParties.d.ts index 5d1447d90..989a9c927 100644 --- a/public/panels/timeline/components/insights/ThirdParties.d.ts +++ b/public/panels/timeline/components/insights/ThirdParties.d.ts @@ -5,7 +5,7 @@ import type * as Overlays from '../../overlays/overlays.js'; import { BaseInsightComponent } from './BaseInsightComponent.js'; export declare class ThirdParties extends BaseInsightComponent { #private; - static readonly litTagName: import("../../../../ui/lit-html/static.js").Static; + static readonly litTagName: LitHtml.StaticHtml.StaticValue; internalName: string; createOverlays(): Overlays.Overlays.TimelineOverlay[]; renderContent(): LitHtml.LitTemplate; diff --git a/public/panels/timeline/components/insights/ThirdParties.js b/public/panels/timeline/components/insights/ThirdParties.js index 55449ee78..c0e4079d4 100644 --- a/public/panels/timeline/components/insights/ThirdParties.js +++ b/public/panels/timeline/components/insights/ThirdParties.js @@ -22,7 +22,7 @@ const UIStrings = { const str_ = i18n.i18n.registerUIStrings('panels/timeline/components/insights/ThirdParties.ts', UIStrings); const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_); export class ThirdParties extends BaseInsightComponent { - static litTagName = LitHtml.literal `devtools-performance-third-parties`; + static litTagName = LitHtml.StaticHtml.literal `devtools-performance-third-parties`; internalName = 'third-parties'; #overlaysForEntity = new Map(); createOverlays() { diff --git a/public/panels/timeline/components/insights/ThirdParties.js.map b/public/panels/timeline/components/insights/ThirdParties.js.map index f31d0491b..43dd822ed 100644 --- a/public/panels/timeline/components/insights/ThirdParties.js.map +++ b/public/panels/timeline/components/insights/ThirdParties.js.map @@ -1 +1 @@ -{"version":3,"file":"ThirdParties.js","sourceRoot":"","sources":["../../../../../../../../front_end/panels/timeline/components/insights/ThirdParties.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,YAAY,CAAC;AAEpB,OAAO,KAAK,IAAI,MAAM,+BAA+B,CAAC;AACtD,OAAO,KAAK,QAAQ,MAAM,uCAAuC,CAAC;AAGlE,OAAO,KAAK,OAAO,MAAM,qCAAqC,CAAC;AAG/D,OAAO,EAAC,oBAAoB,EAAC,MAAM,2BAA2B,CAAC;AAE/D,MAAM,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AAG,QAAQ,EAAE,CAAC;IAC3B,CAAC;;AASH,cAAc,CAAC,MAAM,CAAC,oCAAoC,EAAE,YAAY,CAAC,CAAC","sourcesContent":["// Copyright 2024 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport './Table.js';\n\nimport * as i18n from '../../../../core/i18n/i18n.js';\nimport * as Platform from '../../../../core/platform/platform.js';\nimport type {ThirdPartiesInsightModel} from '../../../../models/trace/insights/ThirdParties.js';\nimport type * as Trace from '../../../../models/trace/trace.js';\nimport * as LitHtml from '../../../../ui/lit-html/lit-html.js';\nimport type * as Overlays from '../../overlays/overlays.js';\n\nimport {BaseInsightComponent} from './BaseInsightComponent.js';\n\nconst {html} = LitHtml;\n\nconst UIStrings = {\n /** Label for a table column that displays the name of a third-party provider. */\n columnThirdParty: 'Third party',\n /** Label for a column in a data table; entries will be the download size of a web resource in kilobytes. */\n columnTransferSize: 'Transfer size',\n /** Label for a table column that displays how much time each row spent blocking other work on the main thread, entries will be the number of milliseconds spent. */\n columnBlockingTime: 'Blocking time',\n /**\n * @description Text block indicating that no third party content was detected on the page\n */\n noThirdParties: 'No third parties found',\n};\n\nconst str_ = i18n.i18n.registerUIStrings('panels/timeline/components/insights/ThirdParties.ts', UIStrings);\nconst i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);\n\nexport class ThirdParties extends BaseInsightComponent {\n static override readonly litTagName = LitHtml.literal`devtools-performance-third-parties`;\n override internalName: string = 'third-parties';\n\n #overlaysForEntity = new Map();\n\n override createOverlays(): Overlays.Overlays.TimelineOverlay[] {\n this.#overlaysForEntity.clear();\n\n if (!this.model) {\n return [];\n }\n\n const overlays: Overlays.Overlays.TimelineOverlay[] = [];\n for (const [entity, requests] of this.model.requestsByEntity) {\n if (entity === this.model.firstPartyEntity) {\n continue;\n }\n\n const overlaysForThisEntity = [];\n for (const request of requests) {\n const overlay: Overlays.Overlays.TimelineOverlay = {\n type: 'ENTRY_OUTLINE',\n entry: request,\n outlineReason: 'INFO',\n };\n overlaysForThisEntity.push(overlay);\n overlays.push(overlay);\n }\n\n this.#overlaysForEntity.set(entity, overlaysForThisEntity);\n }\n\n return overlays;\n }\n\n override renderContent(): LitHtml.LitTemplate {\n if (!this.model) {\n return LitHtml.nothing;\n }\n\n const entries = [...this.model.summaryByEntity.entries()].filter(kv => kv[0] !== this.model?.firstPartyEntity);\n if (!entries.length) {\n return html`
${i18nString(UIStrings.noThirdParties)}
`;\n }\n\n const topTransferSizeEntries = entries.sort((a, b) => b[1].transferSize - a[1].transferSize).slice(0, 6);\n const topMainThreadTimeEntries = entries.sort((a, b) => b[1].mainThreadTime - a[1].mainThreadTime).slice(0, 6);\n\n const sections = [];\n if (topTransferSizeEntries.length) {\n // clang-format off\n sections.push(html`\n
\n ({\n values: [\n entity.name,\n i18n.ByteUtilities.bytesToString(summary.transferSize),\n ],\n overlays: this.#overlaysForEntity.get(entity),\n })),\n }}>\n \n
\n `);\n // clang-format on\n }\n\n if (topMainThreadTimeEntries.length) {\n // clang-format off\n sections.push(html`\n
\n ({\n values: [\n entity.name,\n i18n.TimeUtilities.millisToString(Platform.Timing.microSecondsToMilliSeconds(summary.mainThreadTime)),\n ],\n overlays: this.#overlaysForEntity.get(entity),\n })),\n }}>\n \n
\n `);\n // clang-format on\n }\n\n return html`${sections}`;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'devtools-performance-third-parties': ThirdParties;\n }\n}\n\ncustomElements.define('devtools-performance-third-parties', ThirdParties);\n"]} \ No newline at end of file +{"version":3,"file":"ThirdParties.js","sourceRoot":"","sources":["../../../../../../../../front_end/panels/timeline/components/insights/ThirdParties.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,YAAY,CAAC;AAEpB,OAAO,KAAK,IAAI,MAAM,+BAA+B,CAAC;AACtD,OAAO,KAAK,QAAQ,MAAM,uCAAuC,CAAC;AAGlE,OAAO,K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AC,MAAM,CAAC;iBAC9C,CAAC,CAAC;aACJ;;;OAGN,CAAC,CAAC;YACH,kBAAkB;QACpB,CAAC;QAED,OAAO,IAAI,CAAA,GAAG,QAAQ,EAAE,CAAC;IAC3B,CAAC;;AASH,cAAc,CAAC,MAAM,CAAC,oCAAoC,EAAE,YAAY,CAAC,CAAC","sourcesContent":["// Copyright 2024 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport './Table.js';\n\nimport * as i18n from '../../../../core/i18n/i18n.js';\nimport * as Platform from '../../../../core/platform/platform.js';\nimport type {ThirdPartiesInsightModel} from '../../../../models/trace/insights/ThirdParties.js';\nimport type * as Trace from '../../../../models/trace/trace.js';\nimport * as LitHtml from '../../../../ui/lit-html/lit-html.js';\nimport type * as Overlays from '../../overlays/overlays.js';\n\nimport {BaseInsightComponent} from './BaseInsightComponent.js';\n\nconst {html} = LitHtml;\n\nconst UIStrings = {\n /** Label for a table column that displays the name of a third-party provider. */\n columnThirdParty: 'Third party',\n /** Label for a column in a data table; entries will be the download size of a web resource in kilobytes. */\n columnTransferSize: 'Transfer size',\n /** Label for a table column that displays how much time each row spent blocking other work on the main thread, entries will be the number of milliseconds spent. */\n columnBlockingTime: 'Blocking time',\n /**\n * @description Text block indicating that no third party content was detected on the page\n */\n noThirdParties: 'No third parties found',\n};\n\nconst str_ = i18n.i18n.registerUIStrings('panels/timeline/components/insights/ThirdParties.ts', UIStrings);\nconst i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);\n\nexport class ThirdParties extends BaseInsightComponent {\n static override readonly litTagName = LitHtml.StaticHtml.literal`devtools-performance-third-parties`;\n override internalName: string = 'third-parties';\n\n #overlaysForEntity = new Map();\n\n override createOverlays(): Overlays.Overlays.TimelineOverlay[] {\n this.#overlaysForEntity.clear();\n\n if (!this.model) {\n return [];\n }\n\n const overlays: Overlays.Overlays.TimelineOverlay[] = [];\n for (const [entity, requests] of this.model.requestsByEntity) {\n if (entity === this.model.firstPartyEntity) {\n continue;\n }\n\n const overlaysForThisEntity = [];\n for (const request of requests) {\n const overlay: Overlays.Overlays.TimelineOverlay = {\n type: 'ENTRY_OUTLINE',\n entry: request,\n outlineReason: 'INFO',\n };\n overlaysForThisEntity.push(overlay);\n overlays.push(overlay);\n }\n\n this.#overlaysForEntity.set(entity, overlaysForThisEntity);\n }\n\n return overlays;\n }\n\n override renderContent(): LitHtml.LitTemplate {\n if (!this.model) {\n return LitHtml.nothing;\n }\n\n const entries = [...this.model.summaryByEntity.entries()].filter(kv => kv[0] !== this.model?.firstPartyEntity);\n if (!entries.length) {\n return html`
${i18nString(UIStrings.noThirdParties)}
`;\n }\n\n const topTransferSizeEntries = entries.sort((a, b) => b[1].transferSize - a[1].transferSize).slice(0, 6);\n const topMainThreadTimeEntries = entries.sort((a, b) => b[1].mainThreadTime - a[1].mainThreadTime).slice(0, 6);\n\n const sections = [];\n if (topTransferSizeEntries.length) {\n // clang-format off\n sections.push(html`\n
\n ({\n values: [\n entity.name,\n i18n.ByteUtilities.bytesToString(summary.transferSize),\n ],\n overlays: this.#overlaysForEntity.get(entity),\n })),\n }}>\n \n
\n `);\n // clang-format on\n }\n\n if (topMainThreadTimeEntries.length) {\n // clang-format off\n sections.push(html`\n
\n ({\n values: [\n entity.name,\n i18n.TimeUtilities.millisToString(Platform.Timing.microSecondsToMilliSeconds(summary.mainThreadTime)),\n ],\n overlays: this.#overlaysForEntity.get(entity),\n })),\n }}>\n \n
\n `);\n // clang-format on\n }\n\n return html`${sections}`;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'devtools-performance-third-parties': ThirdParties;\n }\n}\n\ncustomElements.define('devtools-performance-third-parties', ThirdParties);\n"]} \ No newline at end of file diff --git a/public/panels/timeline/components/insights/Viewport.d.ts b/public/panels/timeline/components/insights/Viewport.d.ts index 2e06ff6de..6ada72519 100644 --- a/public/panels/timeline/components/insights/Viewport.d.ts +++ b/public/panels/timeline/components/insights/Viewport.d.ts @@ -5,7 +5,7 @@ import * as LitHtml from '../../../../ui/lit-html/lit-html.js'; import type * as Overlays from '../../overlays/overlays.js'; import { BaseInsightComponent } from './BaseInsightComponent.js'; export declare class Viewport extends BaseInsightComponent { - static readonly litTagName: import("../../../../ui/lit-html/static.js").Static; + static readonly litTagName: LitHtml.StaticHtml.StaticValue; internalName: string; createOverlays(): Overlays.Overlays.TimelineOverlay[]; getEstimatedSavingsTime(): Trace.Types.Timing.MilliSeconds | null; diff --git a/public/panels/timeline/components/insights/Viewport.js b/public/panels/timeline/components/insights/Viewport.js index a34b35fb0..e0a3cf4c1 100644 --- a/public/panels/timeline/components/insights/Viewport.js +++ b/public/panels/timeline/components/insights/Viewport.js @@ -6,7 +6,7 @@ import * as LitHtml from '../../../../ui/lit-html/lit-html.js'; import { BaseInsightComponent } from './BaseInsightComponent.js'; const { html } = LitHtml; export class Viewport extends BaseInsightComponent { - static litTagName = LitHtml.literal `devtools-performance-viewport`; + static litTagName = LitHtml.StaticHtml.literal `devtools-performance-viewport`; internalName = 'viewport'; createOverlays() { // TODO(b/351757418): create overlay for synthetic input delay events diff --git a/public/panels/timeline/components/insights/Viewport.js.map b/public/panels/timeline/components/insights/Viewport.js.map index 318dad47a..8f938ef2c 100644 --- a/public/panels/timeline/components/insights/Viewport.js.map +++ b/public/panels/timeline/components/insights/Viewport.js.map @@ -1 +1 @@ -{"version":3,"file":"Viewport.js","sourceRoot":"","sources":["../../../../../../../../front_end/panels/timeline/components/insights/Viewport.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,eAAe,CAAC;AAIvB,OAAO,KAAK,OAAO,MAAM,qCAAqC,CAAC;AAG/D,OAAO,EAAC,oBAAoB,EAAC,MAAM,2BAA2B,CAAC;AAE/D,MAAM,EAAC,IAAI,EAAC,GAAG,OAAO,CAAC;AAEvB,MAAM,OAAO,QAAS,SAAQ,oBAA0C;IACtE,MAAM,CAAmB,UAAU,GAAG,OAAO,CAAC,OAAO,CAAA,+BAA+B,CAAC;IAC5E,YAAY,GAAW,UAAU,CAAC;IAElC,cAAc;QACrB,qEAAqE;QACrE,OAAO,EAAE,CAAC;IACZ,CAAC;IAEQ,uBAAuB;QAC9B,OAAO,IAAI,CAAC,KAAK,EAAE,aAAa,EAAE,GAAG,IAAI,IAAI,CAAC;IAChD,CAAC;IAEQ,aAAa;QACpB,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC;YAChB,OAAO,OAAO,CAAC,OAAO,CAAC;QACzB,CAAC;QAED,MAAM,aAAa,GAAG,IAAI,CAAC,KAAK,CAAC,aAAa,EAAE,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC;QAElE,mBAAmB;QACnB,OAAO,IAAI,CAAA;;UAEL,aAAa,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAA;kBAC1B;YACN,aAAa;YACb,OAAO,EAAE,EAAC,OAAO,EAAE,IAAI,CAAC,KAAK,CAAC,aAAa,EAAE,IAAI,CAAC,IAAI,CAAC,OAAO,EAAC;SAChE;0CAC+B,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO;aAC/C,CAAC;QACV,kBAAkB;IACpB,CAAC;;AASH,cAAc,CAAC,MAAM,CAAC,+BAA+B,EAAE,QAAQ,CAAC,CAAC","sourcesContent":["// Copyright 2024 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport './NodeLink.js';\n\nimport type {ViewportInsightModel} from '../../../../models/trace/insights/Viewport.js';\nimport type * as Trace from '../../../../models/trace/trace.js';\nimport * as LitHtml from '../../../../ui/lit-html/lit-html.js';\nimport type * as Overlays from '../../overlays/overlays.js';\n\nimport {BaseInsightComponent} from './BaseInsightComponent.js';\n\nconst {html} = LitHtml;\n\nexport class Viewport extends BaseInsightComponent {\n static override readonly litTagName = LitHtml.literal`devtools-performance-viewport`;\n override internalName: string = 'viewport';\n\n override createOverlays(): Overlays.Overlays.TimelineOverlay[] {\n // TODO(b/351757418): create overlay for synthetic input delay events\n return [];\n }\n\n override getEstimatedSavingsTime(): Trace.Types.Timing.MilliSeconds|null {\n return this.model?.metricSavings?.INP ?? null;\n }\n\n override renderContent(): LitHtml.LitTemplate {\n if (!this.model) {\n return LitHtml.nothing;\n }\n\n const backendNodeId = this.model.viewportEvent?.args.data.node_id;\n\n // clang-format off\n return html`\n
\n ${backendNodeId !== undefined ? html`\n ` : LitHtml.nothing}\n
`;\n // clang-format on\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'devtools-performance-viewport': Viewport;\n }\n}\n\ncustomElements.define('devtools-performance-viewport', Viewport);\n"]} \ No newline at end of file +{"version":3,"file":"Viewport.js","sourceRoot":"","sources":["../../../../../../../../front_end/panels/timeline/components/insights/Viewport.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,eAAe,CAAC;AAIvB,OAAO,KAAK,OAAO,MAAM,qCAAqC,CAAC;AAG/D,OAAO,EAAC,oBAAoB,EAAC,MAAM,2BAA2B,CAAC;AAE/D,MAAM,EAAC,IAAI,EAAC,GAAG,OAAO,CAAC;AAEvB,MAAM,OAAO,QAAS,SAAQ,oBAA0C;IACtE,MAAM,CAAmB,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC,OAAO,CAAA,+BAA+B,CAAC;IACvF,YAAY,GAAW,UAAU,CAAC;IAElC,cAAc;QACrB,qEAAqE;QACrE,OAAO,EAAE,CAAC;IACZ,CAAC;IAEQ,uBAAuB;QAC9B,OAAO,IAAI,CAAC,KAAK,EAAE,aAAa,EAAE,GAAG,IAAI,IAAI,CAAC;IAChD,CAAC;IAEQ,aAAa;QACpB,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC;YAChB,OAAO,OAAO,CAAC,OAAO,CAAC;QACzB,CAAC;QAED,MAAM,aAAa,GAAG,IAAI,CAAC,KAAK,CAAC,aAAa,EAAE,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC;QAElE,mBAAmB;QACnB,OAAO,IAAI,CAAA;;UAEL,aAAa,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAA;kBAC1B;YACN,aAAa;YACb,OAAO,EAAE,EAAC,OAAO,EAAE,IAAI,CAAC,KAAK,CAAC,aAAa,EAAE,IAAI,CAAC,IAAI,CAAC,OAAO,EAAC;SAChE;0CAC+B,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO;aAC/C,CAAC;QACV,kBAAkB;IACpB,CAAC;;AASH,cAAc,CAAC,MAAM,CAAC,+BAA+B,EAAE,QAAQ,CAAC,CAAC","sourcesContent":["// Copyright 2024 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport './NodeLink.js';\n\nimport type {ViewportInsightModel} from '../../../../models/trace/insights/Viewport.js';\nimport type * as Trace from '../../../../models/trace/trace.js';\nimport * as LitHtml from '../../../../ui/lit-html/lit-html.js';\nimport type * as Overlays from '../../overlays/overlays.js';\n\nimport {BaseInsightComponent} from './BaseInsightComponent.js';\n\nconst {html} = LitHtml;\n\nexport class Viewport extends BaseInsightComponent {\n static override readonly litTagName = LitHtml.StaticHtml.literal`devtools-performance-viewport`;\n override internalName: string = 'viewport';\n\n override createOverlays(): Overlays.Overlays.TimelineOverlay[] {\n // TODO(b/351757418): create overlay for synthetic input delay events\n return [];\n }\n\n override getEstimatedSavingsTime(): Trace.Types.Timing.MilliSeconds|null {\n return this.model?.metricSavings?.INP ?? null;\n }\n\n override renderContent(): LitHtml.LitTemplate {\n if (!this.model) {\n return LitHtml.nothing;\n }\n\n const backendNodeId = this.model.viewportEvent?.args.data.node_id;\n\n // clang-format off\n return html`\n
\n ${backendNodeId !== undefined ? html`\n ` : LitHtml.nothing}\n
`;\n // clang-format on\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'devtools-performance-viewport': Viewport;\n }\n}\n\ncustomElements.define('devtools-performance-viewport', Viewport);\n"]} \ No newline at end of file diff --git a/public/panels/timeline/components/metricCard.css.js b/public/panels/timeline/components/metricCard.css.js index 1a45d57c5..aae4b9f2c 100644 --- a/public/panels/timeline/components/metricCard.css.js +++ b/public/panels/timeline/components/metricCard.css.js @@ -155,8 +155,7 @@ details.environment-recs[open] > summary::before { grid-template-columns: minmax(min-content, auto) minmax(20px, 50px) max-content; grid-auto-rows: 1fr; column-gap: 8px; - justify-items: flex-end; - align-items: center; + place-items: center flex-end; } .bucket-label { diff --git a/public/panels/timeline/components/timelineSummary.css.js b/public/panels/timeline/components/timelineSummary.css.js index 72d49f467..f65bbed65 100644 --- a/public/panels/timeline/components/timelineSummary.css.js +++ b/public/panels/timeline/components/timelineSummary.css.js @@ -58,10 +58,7 @@ styles.replaceSync( .background-bar-container { position: absolute; - left: var(--sys-size-3); - right: 0; - top: 0; - bottom: 0; + inset: 0 0 0 var(--sys-size-3); z-index: -1; } diff --git a/public/panels/timeline/overlays/OverlaysImpl.d.ts b/public/panels/timeline/overlays/OverlaysImpl.d.ts index f6e7e58b7..530b0914d 100644 --- a/public/panels/timeline/overlays/OverlaysImpl.d.ts +++ b/public/panels/timeline/overlays/OverlaysImpl.d.ts @@ -176,6 +176,7 @@ export declare class Overlays extends EventTarget { charts: TimelineCharts; entryQueries: OverlayEntryQueries; }); + toggleAllOverlaysDisplayed(allOverlaysDisplayed: boolean): void; /** * Add a new overlay to the view. */ diff --git a/public/panels/timeline/overlays/OverlaysImpl.js b/public/panels/timeline/overlays/OverlaysImpl.js index 26a8f2dd3..f4ec817ad 100644 --- a/public/panels/timeline/overlays/OverlaysImpl.js +++ b/public/panels/timeline/overlays/OverlaysImpl.js @@ -276,6 +276,16 @@ export class Overlays extends EventTarget { init.flameChartsContainers.main.addEventListener('mousemove', event => this.#updateMouseCoordinatesProgressEntriesLink.bind(this)(event, 'main')); init.flameChartsContainers.network.addEventListener('mousemove', event => this.#updateMouseCoordinatesProgressEntriesLink.bind(this)(event, 'network')); } + // Toggle display of the whole OverlaysContainer. + // This function is used to hide all overlays when the Flamechart is in the 'reorder tracks' state. + // If the tracks are being reordered, they are collapsed and we do not want to display + // anything except the tracks reordering interface. + // + // Do not change individual overlays visibility with 'setOverlayElementVisibility' since we do not + // want to overwrite the overlays visibility state that was set before entering the reordering state. + toggleAllOverlaysDisplayed(allOverlaysDisplayed) { + this.#overlaysContainer.style.display = allOverlaysDisplayed ? 'block' : 'none'; + } // Mousemove event listener to get mouse coordinates and update them for the entries link that is being created. // // The 'mousemove' event is attached to `flameChartsContainers` instead of `overlaysContainer` diff --git a/public/panels/timeline/overlays/OverlaysImpl.js.map b/public/panels/timeline/overlays/OverlaysImpl.js.map index a5a5c45d1..f49369993 100644 --- a/public/panels/timeline/overlays/OverlaysImpl.js.map +++ b/public/panels/timeline/overlays/OverlaysImpl.js.map @@ -1 +1 @@ -{"version":3,"file":"OverlaysImpl.js","sourceRoot":"","sources":["../../../../../../../front_end/panels/timeline/overlays/OverlaysImpl.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAC7B,OAAO,KAAK,MAAM,MAAM,gCAAgC,CAAC;AACzD,OAAO,KAAK,IAAI,MAAM,4BAA4B,CAAC;AACnD,OAAO,KAAK,QAAQ,MAAM,oCAAoC,CAAC;AAC/D,OAAO,KAAK,KAAK,MAAM,gCAAgC,CAAC;AAExD,OAAO,KAAK,aAAa,MAAM,8CAA8C,CAAC;AAC9E,OAAO,EAAC,WAAW,EAAC,MAAM,+BAA+B,CAAC;AAE1D,OAAO,KAAK,UAAU,MAAM,4BAA4B,CAAC;AAEzD;;GAEG;AACH,MAAM,6BAA6B,GAAG,CAAC,CAAC;AAgExC;;;;GAIG;AACH,MAAM,UAAU,6BAA6B,CAAC,QAA2B;IAEvE,IAAI,OAAO,GAAG,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,YAAY,CAAC,MAAM,CAAC,iBAAiB,CAAC,CAAC;IACxE,IAAI,OAAO,GAA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AM,CAAC,wBAAwB,CAAC,KAAK,CAAC,CAAC;AAC9D,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,YAAY,CAAC,OAAwB;IACnD,QAAQ,OAAO,CAAC,IAAI,EAAE,CAAC;QACrB,KAAK,gBAAgB,CAAC,CAAC,CAAC;YACtB,iEAAiE;YACjE,OAAO,IAAI,CAAC;QACd,CAAC;QACD,KAAK,eAAe,CAAC,CAAC,CAAC;YACrB,OAAO,mCAAmC,QAAQ,CAAC,eAAe,CAAC,WAAW,CAAC,OAAO,CAAC,aAAa,CAAC,EAAE,CAAC;QAC1G,CAAC;QACD,KAAK,aAAa,CAAC,CAAC,CAAC;YACnB,OAAO,+BAA+B,CAAC;QACzC,CAAC;QACD,KAAK,cAAc,CAAC,CAAC,CAAC;YACpB,oDAAoD;YACpD,IAAI,OAAO,CAAC,KAAK,kEAAgD,EAAE,CAAC;gBAClE,OAAO,IAAI,CAAC;YACd,CAAC;YACD,OAAO,gCAAgC,CAAC;QAC1C,CAAC;QACD,KAAK,YAAY,CAAC,CAAC,CAAC;YAClB,OAAO,8BAA8B,CAAC;QACxC,CAAC;QACD,KAAK,oBAAoB,CAAC,CAAC,CAAC;YAC1B,OAAO,sCAAsC,CAAC;QAChD,CAAC;QACD,KAAK,kBAAkB,CAAC,CAAC,CAAC;YACxB,OAAO,2CAA2C,CAAC;QACrD,CAAC;QACD,KAAK,0BAA0B,CAAC,CAAC,CAAC;YAChC,OAAO,4CAA4C,CAAC;QACtD,CAAC;QACD,KAAK,gBAAgB,CAAC,CAAC,CAAC;YACtB,OAAO,kCAAkC,CAAC;QAC5C,CAAC;QACD;YACE,QAAQ,CAAC,WAAW,CAAC,OAAO,EAAE,sBAAsB,CAAC,CAAC;IAC1D,CAAC;AACH,CAAC","sourcesContent":["// Copyright 2024 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\nimport * as Common from '../../../core/common/common.js';\nimport * as i18n from '../../../core/i18n/i18n.js';\nimport * as Platform from '../../../core/platform/platform.js';\nimport * as Trace from '../../../models/trace/trace.js';\nimport type * as PerfUI from '../../../ui/legacy/components/perf_ui/perf_ui.js';\nimport * as VisualLogging from '../../../ui/visual_logging/visual_logging.js';\nimport {EntryStyles} from '../../timeline/utils/utils.js';\n\nimport * as Components from './components/components.js';\n\n/**\n * Below the network track there is a resize bar the user can click and drag.\n */\nconst NETWORK_RESIZE_ELEM_HEIGHT_PX = 8;\n\n/**\n * Represents which flamechart an entry is rendered in.\n * We need to know this because when we place an overlay for an entry we need\n * to adjust its Y value if it's in the main chart which is drawn below the\n * network chart\n */\nexport type EntryChartLocation = 'main'|'network';\n\n/**\n * You can add overlays to trace events, but also right now frames are drawn on\n * the timeline but they are not trace events, so we need to allow for that.\n * In the future when the frames track has been migrated to be powered by\n * animation frames (crbug.com/345144583), we can remove the requirement to\n * support TimelineFrame instances (which themselves will be removed from the\n * codebase.)\n */\nexport type OverlayEntry = Trace.Types.Events.Event|Trace.Types.Events.LegacyTimelineFrame;\n\n/**\n * Represents when a user has selected an entry in the timeline\n */\nexport interface EntrySelected {\n type: 'ENTRY_SELECTED';\n entry: OverlayEntry;\n}\n\n/**\n * Drawn around an entry when we want to highlight it to the user.\n */\nexport interface EntryOutline {\n type: 'ENTRY_OUTLINE';\n entry: OverlayEntry;\n outlineReason: 'ERROR'|'INFO';\n}\n\n/**\n * Represents an object created when a user creates a label for an entry in the timeline.\n */\nexport interface EntryLabel {\n type: 'ENTRY_LABEL';\n entry: OverlayEntry;\n label: string;\n}\n\nexport interface EntriesLink {\n type: 'ENTRIES_LINK';\n state: Trace.Types.File.EntriesLinkState;\n entryFrom: OverlayEntry;\n entryTo?: OverlayEntry;\n}\n\n/**\n * Represents a time range on the trace. Also used when the user shift+clicks\n * and drags to create a time range.\n */\nexport interface TimeRangeLabel {\n type: 'TIME_RANGE';\n bounds: Trace.Types.Timing.TraceWindowMicroSeconds;\n label: string;\n showDuration: boolean;\n}\n\n/**\n * Given a list of overlays, this method will calculate the smallest possible\n * trace window that will contain all of the overlays.\n * `overlays` is expected to be non-empty, and this will return `null` if it is empty.\n */\nexport function traceWindowContainingOverlays(overlays: TimelineOverlay[]): Trace.Types.Timing.TraceWindowMicroSeconds|\n null {\n let minTime = Trace.Types.Timing.MicroSeconds(Number.POSITIVE_INFINITY);\n let maxTime = Trace.Types.Timing.MicroSeconds(Number.NEGATIVE_INFINITY);\n\n if (overlays.length === 0) {\n return null;\n }\n\n for (const overlay of overlays) {\n const windowForOverlay = traceWindowForOverlay(overlay);\n if (windowForOverlay.min < minTime) {\n minTime = windowForOverlay.min;\n }\n if (windowForOverlay.max > maxTime) {\n maxTime = windowForOverlay.max;\n }\n }\n\n return Trace.Helpers.Timing.traceWindowFromMicroSeconds(minTime, maxTime);\n}\n\nfunction traceWindowForOverlay(overlay: TimelineOverlay): Trace.Types.Timing.TraceWindowMicroSeconds {\n const overlayMinBounds: Trace.Types.Timing.MicroSeconds[] = [];\n const overlayMaxBounds: Trace.Types.Timing.MicroSeconds[] = [];\n\n switch (overlay.type) {\n case 'ENTRY_SELECTED': {\n const timings = timingsForOverlayEntry(overlay.entry);\n overlayMinBounds.push(timings.startTime);\n overlayMaxBounds.push(timings.endTime);\n break;\n }\n case 'ENTRY_OUTLINE': {\n const timings = timingsForOverlayEntry(overlay.entry);\n overlayMinBounds.push(timings.startTime);\n overlayMaxBounds.push(timings.endTime);\n break;\n }\n\n case 'TIME_RANGE': {\n overlayMinBounds.push(overlay.bounds.min);\n overlayMaxBounds.push(overlay.bounds.max);\n break;\n }\n case 'ENTRY_LABEL': {\n const timings = timingsForOverlayEntry(overlay.entry);\n overlayMinBounds.push(timings.startTime);\n overlayMaxBounds.push(timings.endTime);\n break;\n }\n\n case 'ENTRIES_LINK': {\n const timingsFrom = timingsForOverlayEntry(overlay.entryFrom);\n overlayMinBounds.push(timingsFrom.startTime);\n if (overlay.entryTo) {\n const timingsTo = timingsForOverlayEntry(overlay.entryTo);\n // No need to push the startTime; it must be larger than the entryFrom start time.\n overlayMaxBounds.push(timingsTo.endTime);\n } else {\n // Only use the end time if we have no entryTo; otherwise the entryTo\n // endTime is guaranteed to be larger than the entryFrom endTime.\n overlayMaxBounds.push(timingsFrom.endTime);\n }\n\n break;\n }\n case 'TIMESPAN_BREAKDOWN': {\n if (overlay.entry) {\n const timings = timingsForOverlayEntry(overlay.entry);\n overlayMinBounds.push(timings.startTime);\n overlayMaxBounds.push(timings.endTime);\n }\n for (const section of overlay.sections) {\n overlayMinBounds.push(section.bounds.min);\n overlayMaxBounds.push(section.bounds.max);\n }\n break;\n }\n case 'TIMESTAMP_MARKER': {\n overlayMinBounds.push(overlay.timestamp);\n break;\n }\n case 'CANDY_STRIPED_TIME_RANGE': {\n const timings = timingsForOverlayEntry(overlay.entry);\n overlayMinBounds.push(timings.startTime);\n overlayMaxBounds.push(timings.endTime);\n overlayMinBounds.push(overlay.bounds.min);\n overlayMaxBounds.push(overlay.bounds.max);\n break;\n }\n case 'TIMINGS_MARKER': {\n const timings = timingsForOverlayEntry(overlay.entries[0]);\n overlayMinBounds.push(timings.startTime);\n break;\n }\n default:\n Platform.TypeScriptUtilities.assertNever(overlay, `Unexpected overlay ${overlay}`);\n }\n\n const min = Trace.Types.Timing.MicroSeconds(Math.min(...overlayMinBounds));\n const max = Trace.Types.Timing.MicroSeconds(Math.max(...overlayMaxBounds));\n return Trace.Helpers.Timing.traceWindowFromMicroSeconds(min, max);\n}\n\n/**\n * Get a list of entries for a given overlay.\n */\nexport function entriesForOverlay(overlay: TimelineOverlay): readonly OverlayEntry[] {\n const entries: OverlayEntry[] = [];\n\n switch (overlay.type) {\n case 'ENTRY_SELECTED': {\n entries.push(overlay.entry);\n break;\n }\n case 'ENTRY_OUTLINE': {\n entries.push(overlay.entry);\n break;\n }\n case 'TIME_RANGE': {\n // Time ranges are not associated with entries.\n break;\n }\n case 'ENTRY_LABEL': {\n entries.push(overlay.entry);\n break;\n }\n case 'ENTRIES_LINK': {\n entries.push(overlay.entryFrom);\n if (overlay.entryTo) {\n entries.push(overlay.entryTo);\n }\n break;\n }\n case 'TIMESPAN_BREAKDOWN': {\n if (overlay.entry) {\n entries.push(overlay.entry);\n }\n break;\n }\n case 'TIMESTAMP_MARKER': {\n // This overlay type isn't associated to any entry, so just break here.\n break;\n }\n case 'CANDY_STRIPED_TIME_RANGE': {\n entries.push(overlay.entry);\n break;\n }\n case 'TIMINGS_MARKER': {\n entries.push(...overlay.entries);\n break;\n }\n default:\n Platform.assertNever(overlay, `Unknown overlay type ${JSON.stringify(overlay)}`);\n }\n\n return entries;\n}\nexport function chartForEntry(entry: OverlayEntry): EntryChartLocation {\n if (Trace.Types.Events.isNetworkTrackEntry(entry)) {\n return 'network';\n }\n\n return 'main';\n}\n\n/**\n * Used to highlight with a red-candy stripe a time range. It takes an entry\n * because this entry is the row that will be used to place the candy stripe,\n * and its height will be set to the height of that row.\n */\nexport interface CandyStripedTimeRange {\n type: 'CANDY_STRIPED_TIME_RANGE';\n bounds: Trace.Types.Timing.TraceWindowMicroSeconds;\n entry: Trace.Types.Events.Event;\n}\n\n/**\n * Represents a timespan on a trace broken down into parts. Each part has a label to it.\n * If an entry is defined, the breakdown will be vertically positioned based on it.\n */\nexport interface TimespanBreakdown {\n type: 'TIMESPAN_BREAKDOWN';\n sections: Array;\n entry?: Trace.Types.Events.Event;\n renderLocation?: 'BOTTOM_OF_TIMELINE'|'BELOW_EVENT'|'ABOVE_EVENT';\n}\n\nexport interface TimestampMarker {\n type: 'TIMESTAMP_MARKER';\n timestamp: Trace.Types.Timing.MicroSeconds;\n}\n\n/**\n * Represents a timings marker. This has a line that runs up the whole canvas.\n * We can hold an array of entries, in the case we want to hold more than one with the same timestamp.\n * The adjusted timestamp being the timestamp for the event adjusted by closest navigation.\n */\nexport interface TimingsMarker {\n type: 'TIMINGS_MARKER';\n entries: Trace.Types.Events.Event[];\n adjustedTimestamp: Trace.Types.Timing.MicroSeconds;\n}\n\n/**\n * All supported overlay types.\n */\nexport type TimelineOverlay = EntrySelected|EntryOutline|TimeRangeLabel|EntryLabel|EntriesLink|TimespanBreakdown|\n TimestampMarker|CandyStripedTimeRange|TimingsMarker;\n\nexport interface TimelineOverlaySetOptions {\n updateTraceWindow: boolean;\n}\n\n/**\n * Denotes overlays that are singletons; only one of these will be allowed to\n * exist at any given time. If one exists and the add() method is called, the\n * new overlay will replace the existing one.\n */\ntype SingletonOverlay = EntrySelected|TimestampMarker;\nexport function overlayIsSingleton(overlay: TimelineOverlay): overlay is SingletonOverlay {\n return overlay.type === 'TIMESTAMP_MARKER' || overlay.type === 'ENTRY_SELECTED';\n}\n\n/**\n * To be able to draw overlays accurately at the correct pixel position, we\n * need a variety of pixel values from both flame charts (Network and \"Rest\").\n * As each FlameChart draws, it emits an event with its latest set of\n * dimensions. That updates the Overlays and causes them to redraw.\n * Note that we can't use the visible trace window from the TraceBounds\n * service as that can get out of sync with rapid FlameChart draws. To ensure\n * we draw overlays smoothly as the FlameChart renders we use the latest values\n * provided to us from the FlameChart. In `FlameChart#draw` we dispatch an\n * event containing the latest dimensions, and those are passed into the\n * Overlays system via TimelineFlameChartView.\n */\ninterface ActiveDimensions {\n trace: {\n visibleWindow: Trace.Types.Timing.TraceWindowMicroSeconds|null,\n };\n charts: {\n main: FlameChartDimensions|null,\n network: FlameChartDimensions|null,\n };\n}\n\n/**\n * The dimensions each flame chart reports. Note that in the current UI they\n * will always have the same width, so theoretically we could only gather that\n * from one chart, but we gather it from both for simplicity and to cover us in\n * the future should the UI change and the charts have different widths.\n */\ninterface FlameChartDimensions {\n widthPixels: number;\n heightPixels: number;\n scrollOffsetPixels: number;\n // If every single group (e.g. track) within the chart is collapsed or not.\n // This matters because in the network track if every group (there is only\n // one) is collapsed, there is no resizer bar shown, which impacts our pixel\n // calculations for overlay positioning.\n allGroupsCollapsed: boolean;\n}\n\nexport interface TimelineCharts {\n mainChart: PerfUI.FlameChart.FlameChart;\n mainProvider: PerfUI.FlameChart.FlameChartDataProvider;\n networkChart: PerfUI.FlameChart.FlameChart;\n networkProvider: PerfUI.FlameChart.FlameChartDataProvider;\n}\n\nexport interface OverlayEntryQueries {\n isEntryCollapsedByUser: (entry: Trace.Types.Events.Event) => boolean;\n firstVisibleParentForEntry: (entry: Trace.Types.Events.Event) => Trace.Types.Events.Event | null;\n}\n\n// An event dispatched when one of the Annotation Overlays (overlay created by the user,\n// ex. EntryLabel) is removed or updated. When one of the Annotation Overlays is removed or updated,\n// ModificationsManager listens to this event and updates the current annotations.\nexport type UpdateAction = 'Remove'|'Update';\nexport class AnnotationOverlayActionEvent extends Event {\n static readonly eventName = 'annotationoverlayactionsevent';\n\n constructor(public overlay: TimelineOverlay, public action: UpdateAction) {\n super(AnnotationOverlayActionEvent.eventName);\n }\n}\n\nexport class TimeRangeMouseOverEvent extends Event {\n static readonly eventName = 'timerangemouseoverevent';\n\n constructor(public overlay: TimeRangeLabel) {\n super(TimeRangeMouseOverEvent.eventName, {bubbles: true});\n }\n}\n\nexport class TimeRangeMouseOutEvent extends Event {\n static readonly eventName = 'timerangemouseoutevent';\n\n constructor() {\n super(TimeRangeMouseOutEvent.eventName, {bubbles: true});\n }\n}\n\ninterface EntriesLinkVisibleEntries {\n entryFrom: Trace.Types.Events.Event;\n entryTo: Trace.Types.Events.Event|undefined;\n entryFromIsSource: boolean;\n entryToIsSource: boolean;\n}\n\nexport class EventReferenceClick extends Event {\n static readonly eventName = 'eventreferenceclick';\n\n constructor(public event: Trace.Types.Events.Event) {\n super(EventReferenceClick.eventName, {bubbles: true, composed: true});\n }\n}\n\n/**\n * This class manages all the overlays that get drawn onto the performance\n * timeline. Overlays are DOM and are drawn above the network and main flame\n * chart.\n *\n * For more documentation, see `timeline/README.md` which has a section on overlays.\n */\nexport class Overlays extends EventTarget {\n /**\n * The list of active overlays. Overlays can't be marked as visible or\n * hidden; every overlay in this list is rendered.\n * We track each overlay against the HTML Element we have rendered. This is\n * because on first render of a new overlay, we create it, but then on\n * subsequent renders we do not destroy and recreate it, instead we update it\n * based on the new position of the timeline.\n */\n #overlaysToElements: Map = new Map();\n\n // When the Entries Link Annotation is created, the arrow needs to follow the mouse.\n // Update the mouse coordinates while it is being created.\n #lastMouseOffsetX: number|null = null;\n #lastMouseOffsetY: number|null = null;\n // `entriesLinkInProgress` is the entries link Overlay that has not yet been fully created\n // and only has the entry that the link starts from set.\n // We save it as a separate variable because when the second entry of the link is not chosen yet,\n // the arrow follows the mouse. To achieve that, update the coordinates of `entriesLinkInProgress`\n // on mousemove. There can only be one link in the process on being created so the mousemove\n // only needs to update `entriesLinkInProgress` link overlay.\n #entriesLinkInProgress: EntriesLink|null;\n\n #dimensions: ActiveDimensions = {\n trace: {\n visibleWindow: null,\n },\n charts: {\n main: null,\n network: null,\n },\n };\n\n /**\n * To calculate the Y pixel value for an event we need access to the chart\n * and data provider in order to find out what level the event is on, and from\n * there calculate the pixel value for that level.\n */\n #charts: TimelineCharts;\n\n /**\n * The Overlays class will take each overlay, generate its HTML, and add it\n * to the container. This container is provided for us when the class is\n * created so we can manage its contents as overlays come and go.\n */\n #overlaysContainer: HTMLElement;\n\n // Setting that specififed if the annotations overlays need to be visible.\n // It is switched on/off from the annotations tab in the sidebar.\n readonly #annotationsHiddenSetting: Common.Settings.Setting;\n\n /**\n * The OverlaysManager sometimes needs to find out if an entry is visible or\n * not, and if not, why not - for example, if the user has collapsed its\n * parent. We define these query functions that must be supplied in order to\n * answer these questions.\n */\n #queries: OverlayEntryQueries;\n\n constructor(init: {\n container: HTMLElement,\n flameChartsContainers: {\n main: HTMLElement,\n network: HTMLElement,\n },\n charts: TimelineCharts,\n entryQueries: OverlayEntryQueries,\n }) {\n super();\n this.#overlaysContainer = init.container;\n this.#charts = init.charts;\n this.#queries = init.entryQueries;\n this.#entriesLinkInProgress = null;\n this.#annotationsHiddenSetting = Common.Settings.Settings.instance().moduleSetting('annotations-hidden');\n this.#annotationsHiddenSetting.addChangeListener(this.update.bind(this));\n\n // HTMLElements of both Flamecharts. They are used to get the mouse position over the Flamecharts.\n init.flameChartsContainers.main.addEventListener(\n 'mousemove', event => this.#updateMouseCoordinatesProgressEntriesLink.bind(this)(event, 'main'));\n init.flameChartsContainers.network.addEventListener(\n 'mousemove', event => this.#updateMouseCoordinatesProgressEntriesLink.bind(this)(event, 'network'));\n }\n\n // Mousemove event listener to get mouse coordinates and update them for the entries link that is being created.\n //\n // The 'mousemove' event is attached to `flameChartsContainers` instead of `overlaysContainer`\n // because `overlaysContainer` doesn't have events to enable the interaction with the\n // Flamecharts beneath it.\n #updateMouseCoordinatesProgressEntriesLink(event: Event, chart: EntryChartLocation): void {\n const mouseEvent = (event as MouseEvent);\n this.#lastMouseOffsetX = mouseEvent.offsetX;\n this.#lastMouseOffsetY = mouseEvent.offsetY;\n\n if (this.#entriesLinkInProgress?.state !== Trace.Types.File.EntriesLinkState.PENDING_TO_EVENT) {\n return;\n }\n\n // The Overlays layer coordinates cover both Network and Main Charts, while the mousemove\n // coordinates are received from the charts individually and start from 0 for each chart.\n //\n // To make it work on the overlays, we need to know which chart the entry belongs to and,\n // if it is on the main chart, add the height of the Network chart to get correct Entry\n // coordinates on the Overlays layer.\n const networkHeight = this.#dimensions.charts.network?.heightPixels ?? 0;\n const linkInProgressElement = this.#overlaysToElements.get(this.#entriesLinkInProgress);\n\n if (linkInProgressElement) {\n const component = linkInProgressElement.querySelector('devtools-entries-link-overlay') as\n Components.EntriesLinkOverlay.EntriesLinkOverlay;\n const yCoordinate = mouseEvent.offsetY + ((chart === 'main') ? networkHeight : 0);\n component.toEntryCoordinateAndDimentions = {x: mouseEvent.offsetX, y: yCoordinate};\n }\n }\n\n /**\n * Add a new overlay to the view.\n */\n add(newOverlay: T): T {\n if (this.#overlaysToElements.has(newOverlay)) {\n return newOverlay;\n }\n\n /**\n * If the overlay type is a singleton, and we already have one, we update\n * the existing one, rather than create a new one. This ensures you can only\n * ever have one instance of the overlay type.\n */\n const existing = this.overlaysOfType(newOverlay.type);\n if (overlayIsSingleton(newOverlay) && existing[0]) {\n this.updateExisting(existing[0], newOverlay);\n return existing[0];\n }\n\n // By setting the value to null, we ensure that on the next render that the\n // overlay will have a new HTML element created for it.\n this.#overlaysToElements.set(newOverlay, null);\n return newOverlay;\n }\n\n /**\n * Update an existing overlay without destroying and recreating its\n * associated DOM.\n *\n * This is useful if you need to rapidly update an overlay's data - e.g.\n * dragging to create time ranges - without the thrashing of destroying the\n * old overlay and re-creating the new one.\n */\n updateExisting(existingOverlay: T, newData: Partial): void {\n if (!this.#overlaysToElements.has(existingOverlay)) {\n console.error('Trying to update an overlay that does not exist.');\n return;\n }\n\n for (const [key, value] of Object.entries(newData)) {\n // newData is of type Partial, so each key must exist in T, but\n // Object.entries doesn't carry that information.\n const k = key as keyof T;\n existingOverlay[k] = value;\n }\n }\n\n enterLabelEditMode(overlay: EntryLabel): void {\n // Entry edit state can be triggered from outside the label component by clicking on the\n // Entry that already has a label. Instead of creating a new label, set the existing entry\n // label into an editable state.\n const element = this.#overlaysToElements.get(overlay);\n const component = element?.querySelector('devtools-entry-label-overlay');\n if (component) {\n component.setLabelEditabilityAndRemoveEmptyLabel(true);\n }\n }\n\n /**\n * @returns the list of overlays associated with a given entry.\n */\n overlaysForEntry(entry: OverlayEntry): TimelineOverlay[] {\n const matches: TimelineOverlay[] = [];\n for (const [overlay] of this.#overlaysToElements) {\n if ('entry' in overlay && overlay.entry === entry) {\n matches.push(overlay);\n }\n }\n return matches;\n }\n\n /**\n * Removes any active overlays that match the provided type.\n * @returns the number of overlays that were removed.\n */\n removeOverlaysOfType(type: TimelineOverlay['type']): number {\n const overlaysToRemove = Array.from(this.#overlaysToElements.keys()).filter(overlay => {\n return overlay.type === type;\n });\n for (const overlay of overlaysToRemove) {\n this.remove(overlay);\n }\n return overlaysToRemove.length;\n }\n\n /**\n * @returns all overlays that match the provided type.\n */\n overlaysOfType(type: T['type']): NoInfer[] {\n const matches: T[] = [];\n\n function overlayIsOfType(overlay: TimelineOverlay): overlay is T {\n return overlay.type === type;\n }\n\n for (const [overlay] of this.#overlaysToElements) {\n if (overlayIsOfType(overlay)) {\n matches.push(overlay);\n }\n }\n return matches;\n }\n\n /**\n * Removes the provided overlay from the list of overlays and destroys any\n * DOM associated with it.\n */\n remove(overlay: TimelineOverlay): void {\n const htmlElement = this.#overlaysToElements.get(overlay);\n if (htmlElement && this.#overlaysContainer) {\n this.#overlaysContainer.removeChild(htmlElement);\n }\n this.#overlaysToElements.delete(overlay);\n }\n\n /**\n * Update the dimenions of a chart.\n * IMPORTANT: this does not trigger a re-draw. You must call the render() method manually.\n */\n updateChartDimensions(chart: EntryChartLocation, dimensions: FlameChartDimensions): void {\n this.#dimensions.charts[chart] = dimensions;\n }\n\n /**\n * Update the visible window of the UI.\n * IMPORTANT: this does not trigger a re-draw. You must call the render() method manually.\n */\n updateVisibleWindow(visibleWindow: Trace.Types.Timing.TraceWindowMicroSeconds): void {\n this.#dimensions.trace.visibleWindow = visibleWindow;\n }\n\n /**\n * Clears all overlays and all data. Call this when the trace is changing\n * (e.g. the user has imported/recorded a new trace) and we need to start from\n * scratch and remove all overlays relating to the preivous trace.\n */\n reset(): void {\n if (this.#overlaysContainer) {\n this.#overlaysContainer.innerHTML = '';\n }\n this.#overlaysToElements.clear();\n\n // Clear out dimensions from the old Flame Charts.\n this.#dimensions.trace.visibleWindow = null;\n this.#dimensions.charts.main = null;\n this.#dimensions.charts.network = null;\n }\n\n /**\n * Updates the Overlays UI: new overlays will be rendered onto the view, and\n * existing overlays will have their positions changed to ensure they are\n * rendered in the right place.\n */\n async update(): Promise {\n const timeRangeOverlays: TimeRangeLabel[] = [];\n const timingsMarkerOverlays: TimingsMarker[] = [];\n\n for (const [overlay, existingElement] of this.#overlaysToElements) {\n const element = existingElement || this.#createElementForNewOverlay(overlay);\n if (!existingElement) {\n // This is a new overlay, so we have to store the element and add it to the DOM.\n this.#overlaysToElements.set(overlay, element);\n this.#overlaysContainer.appendChild(element);\n }\n\n // A chance to update the overlay before we re-position it. If an\n // overlay's data changed, this is where we can pass that data into the\n // overlay's component so it has the latest data.\n this.#updateOverlayBeforePositioning(overlay, element);\n\n // Now we position the overlay on the timeline.\n this.#positionOverlay(overlay, element);\n\n // And now we give every overlay a chance to react to its new position,\n // if it needs to\n this.#updateOverlayAfterPositioning(overlay, element);\n\n if (overlay.type === 'TIME_RANGE') {\n timeRangeOverlays.push(overlay);\n }\n if (overlay.type === 'TIMINGS_MARKER') {\n timingsMarkerOverlays.push(overlay);\n }\n }\n\n if (timeRangeOverlays.length > 1) { // If there are 0 or 1 overlays, they can't overlap\n this.#positionOverlappingTimeRangeLabels(timeRangeOverlays);\n }\n }\n\n /**\n * If any time-range overlays overlap, we try to adjust their horizontal\n * position in order to make sure you can distinguish them and that the labels\n * do not entirely overlap.\n * This is very much minimal best effort, and does not guarantee that all\n * labels will remain readable.\n */\n #positionOverlappingTimeRangeLabels(overlays: readonly TimeRangeLabel[]): void {\n const overlaysSorted = overlays.toSorted((o1, o2) => {\n return o1.bounds.min - o2.bounds.min;\n });\n\n // Track the overlays which overlap other overlays.\n // This isn't bi-directional: if we find that O2 overlaps O1, we will\n // store O1 => [O2]. We will not then also store O2 => [O1], because we\n // only need to deal with the overlap once.\n const overlapsByOverlay: Map = new Map();\n\n for (let i = 0; i < overlaysSorted.length; i++) {\n const current = overlaysSorted[i];\n const overlaps: TimeRangeLabel[] = [];\n\n // Walk through subsequent overlays and find stop when you find the next one that does not overlap.\n for (let j = i + 1; j < overlaysSorted.length; j++) {\n const next = overlaysSorted[j];\n const currentAndNextOverlap = Trace.Helpers.Timing.boundsIncludeTimeRange({\n bounds: current.bounds,\n timeRange: next.bounds,\n });\n if (currentAndNextOverlap) {\n overlaps.push(next);\n } else {\n // Overlays are sorted by time, if this one does not overlap, the next one will not, so we can break.\n break;\n }\n }\n overlapsByOverlay.set(current, overlaps);\n }\n for (const [firstOverlay, overlappingOverlays] of overlapsByOverlay) {\n const element = this.#overlaysToElements.get(firstOverlay);\n if (!element) {\n continue;\n }\n\n // If the first overlay is adjusted, we can start back from 0 again\n // rather than continually increment up.\n let firstIndexForOverlapClass = 1;\n if (element.getAttribute('class')?.includes('overlap-')) {\n firstIndexForOverlapClass = 0;\n }\n\n overlappingOverlays.forEach(overlay => {\n const element = this.#overlaysToElements.get(overlay);\n element?.classList.add(`overlap-${firstIndexForOverlapClass++}`);\n });\n }\n }\n\n #positionOverlay(overlay: TimelineOverlay, element: HTMLElement): void {\n const annotationsAreHidden = this.#annotationsHiddenSetting.get();\n switch (overlay.type) {\n case 'ENTRY_SELECTED': {\n const isVisible = this.entryIsVisibleOnChart(overlay.entry);\n this.#setOverlayElementVisibility(element, isVisible);\n if (isVisible) {\n this.#positionEntryBorderOutlineType(overlay.entry, element);\n }\n break;\n }\n case 'ENTRY_OUTLINE': {\n if (this.entryIsVisibleOnChart(overlay.entry)) {\n this.#setOverlayElementVisibility(element, true);\n this.#positionEntryBorderOutlineType(overlay.entry, element);\n } else {\n this.#setOverlayElementVisibility(element, false);\n }\n break;\n }\n\n case 'TIME_RANGE': {\n // The time range annotation can also be used to measure a selection in the timeline and is not saved if no label is added.\n // Therefore, we only care about the annotation hidden setting if the time range has a label.\n if (overlay.label.length) {\n this.#setOverlayElementVisibility(element, !annotationsAreHidden);\n }\n this.#positionTimeRangeOverlay(overlay, element);\n break;\n }\n case 'ENTRY_LABEL': {\n const entryVisible = this.entryIsVisibleOnChart(overlay.entry);\n this.#setOverlayElementVisibility(element, entryVisible && !annotationsAreHidden);\n if (entryVisible) {\n const entryLabelVisibleHeight = this.#positionEntryLabelOverlay(overlay, element);\n const component = element.querySelector('devtools-entry-label-overlay');\n if (component && entryLabelVisibleHeight) {\n component.entryLabelVisibleHeight = entryLabelVisibleHeight;\n }\n }\n break;\n }\n case 'ENTRIES_LINK': {\n // The exact entries that are linked to could be collapsed in a flame\n // chart, so we figure out the best visible entry pairs to draw\n // between.\n const entriesToConnect = this.#calculateFromAndToForEntriesLink(overlay);\n const isVisible = entriesToConnect !== null && !annotationsAreHidden;\n this.#setOverlayElementVisibility(element, isVisible);\n\n if (isVisible) {\n this.#positionEntriesLinkOverlay(overlay, element, entriesToConnect);\n }\n break;\n }\n case 'TIMESPAN_BREAKDOWN': {\n this.#positionTimespanBreakdownOverlay(overlay, element);\n // TODO: Have the timespan squeeze instead.\n if (overlay.entry) {\n const {visibleWindow} = this.#dimensions.trace;\n const isVisible = Boolean(\n visibleWindow && this.#entryIsVerticallyVisibleOnChart(overlay.entry) &&\n Trace.Helpers.Timing.boundsIncludeTimeRange({\n bounds: visibleWindow,\n timeRange: overlay.sections[0].bounds,\n }),\n );\n this.#setOverlayElementVisibility(element, isVisible);\n }\n break;\n }\n\n case 'TIMESTAMP_MARKER': {\n const {visibleWindow} = this.#dimensions.trace;\n // Only update the position if the timestamp of this marker is within\n // the visible bounds.\n const isVisible =\n Boolean(visibleWindow && Trace.Helpers.Timing.timestampIsInBounds(visibleWindow, overlay.timestamp));\n this.#setOverlayElementVisibility(element, isVisible);\n if (isVisible) {\n this.#positionTimingOverlay(overlay, element);\n }\n break;\n }\n\n case 'CANDY_STRIPED_TIME_RANGE': {\n const {visibleWindow} = this.#dimensions.trace;\n // If the bounds of this overlay are not within the visible bounds, we\n // can skip updating its position and just hide it.\n\n const isVisible = Boolean(\n visibleWindow && this.#entryIsVerticallyVisibleOnChart(overlay.entry) &&\n Trace.Helpers.Timing.boundsIncludeTimeRange({\n bounds: visibleWindow,\n timeRange: overlay.bounds,\n }));\n this.#setOverlayElementVisibility(element, isVisible);\n if (isVisible) {\n this.#positionCandyStripedTimeRange(overlay, element);\n }\n break;\n }\n\n case 'TIMINGS_MARKER': {\n const {visibleWindow} = this.#dimensions.trace;\n // All the entries have the same ts, so can use the first.\n const isVisible = Boolean(visibleWindow && this.#entryIsHorizontallyVisibleOnChart(overlay.entries[0]));\n this.#setOverlayElementVisibility(element, isVisible);\n if (isVisible) {\n this.#positionTimingOverlay(overlay, element);\n }\n break;\n }\n\n default: {\n Platform.TypeScriptUtilities.assertNever(overlay, `Unknown overlay: ${JSON.stringify(overlay)}`);\n }\n }\n }\n\n #positionTimingOverlay(overlay: TimestampMarker|TimingsMarker, element: HTMLElement): void {\n let left;\n switch (overlay.type) {\n case 'TIMINGS_MARKER': {\n // All the entries have the same ts, so can use the first.\n const timings = Trace.Helpers.Timing.eventTimingsMicroSeconds(overlay.entries[0]);\n left = this.#xPixelForMicroSeconds('main', timings.startTime);\n break;\n }\n case 'TIMESTAMP_MARKER': {\n // Because we are adjusting the x position, we can use either chart here.\n left = this.#xPixelForMicroSeconds('main', overlay.timestamp);\n break;\n }\n }\n element.style.left = `${left}px`;\n }\n\n #positionTimespanBreakdownOverlay(overlay: TimespanBreakdown, element: HTMLElement): void {\n if (overlay.sections.length === 0) {\n return;\n }\n\n const component = element.querySelector('devtools-timespan-breakdown-overlay');\n const elementSections = component?.renderedSections() ?? [];\n\n // Handle horizontal positioning.\n const leftEdgePixel = this.#xPixelForMicroSeconds('main', overlay.sections[0].bounds.min);\n const rightEdgePixel =\n this.#xPixelForMicroSeconds('main', overlay.sections[overlay.sections.length - 1].bounds.max);\n if (leftEdgePixel === null || rightEdgePixel === null) {\n return;\n }\n\n const rangeWidth = rightEdgePixel - leftEdgePixel;\n element.style.left = `${leftEdgePixel}px`;\n element.style.width = `${rangeWidth}px`;\n\n if (elementSections.length === 0) {\n return;\n }\n\n let count = 0;\n for (const section of overlay.sections) {\n const leftPixel = this.#xPixelForMicroSeconds('main', section.bounds.min);\n const rightPixel = this.#xPixelForMicroSeconds('main', section.bounds.max);\n if (leftPixel === null || rightPixel === null) {\n return;\n }\n const rangeWidth = rightPixel - leftPixel;\n const sectionElement = elementSections[count];\n\n sectionElement.style.left = `${leftPixel}px`;\n sectionElement.style.width = `${rangeWidth}px`;\n count++;\n }\n\n // Handle vertical positioning based on the entry's vertical position.\n if (overlay.entry && (overlay.renderLocation === 'BELOW_EVENT' || overlay.renderLocation === 'ABOVE_EVENT')) {\n // Max height for the overlay box when attached to an entry.\n const MAX_BOX_HEIGHT = 50;\n element.style.maxHeight = `${MAX_BOX_HEIGHT}px`;\n\n const y = this.yPixelForEventOnChart(overlay.entry);\n if (y === null) {\n return;\n }\n const eventHeight = this.pixelHeightForEventOnChart(overlay.entry);\n if (eventHeight === null) {\n return;\n }\n\n if (overlay.renderLocation === 'BELOW_EVENT') {\n const top = y + eventHeight;\n element.style.top = `${top}px`;\n } else {\n // Some padding so the box hovers just on top.\n const PADDING = 7;\n\n // Where the timespan breakdown should sit. Slightly on top of the entry.\n const bottom = y - PADDING;\n\n // Available space between the bottom of the overlay and top of the chart.\n const minSpace = Math.max(bottom, 0);\n // Contrain height to available space.\n const height = Math.min(MAX_BOX_HEIGHT, minSpace);\n\n const top = bottom - height;\n element.style.top = `${top}px`;\n }\n }\n }\n\n /**\n * Positions the arrow between two entries. Takes in the entriesToConnect\n * because if one of the original entries is hidden in a collapsed main thread\n * icicle, we use its parent to connect to.\n */\n #positionEntriesLinkOverlay(overlay: EntriesLink, element: HTMLElement, entriesToConnect: EntriesLinkVisibleEntries):\n void {\n const component = element.querySelector('devtools-entries-link-overlay');\n\n if (component) {\n const fromEntryInCollapsedTrack = this.#entryIsInCollapsedTrack(entriesToConnect.entryFrom);\n const toEntryInCollapsedTrack =\n entriesToConnect.entryTo && this.#entryIsInCollapsedTrack(entriesToConnect.entryTo);\n\n const bothEntriesInCollapsedTrack = Boolean(fromEntryInCollapsedTrack && toEntryInCollapsedTrack);\n // If both entries are in collapsed tracks, we hide the overlay completely.\n if (bothEntriesInCollapsedTrack) {\n this.#setOverlayElementVisibility(element, false);\n return;\n }\n\n // If either entry (but not both) is in a track that the user has collapsed, we do not\n // show the connection at all, but we still show the borders around\n // the entry. So in this case we mark the overlay as visible, but\n // tell it to not draw the arrow.\n const hideArrow = Boolean(fromEntryInCollapsedTrack || toEntryInCollapsedTrack);\n component.hideArrow = hideArrow;\n\n const {entryFrom, entryTo, entryFromIsSource, entryToIsSource} = entriesToConnect;\n const entryFromWrapper = component.entryFromWrapper();\n\n // Should not happen, the 'from' wrapper should always exist. Something went wrong, return in this case.\n if (!entryFromWrapper) {\n return;\n }\n\n const entryFromVisibility = this.entryIsVisibleOnChart(entryFrom) && !fromEntryInCollapsedTrack;\n const entryToVisibility = entryTo ? this.entryIsVisibleOnChart(entryTo) && !toEntryInCollapsedTrack : false;\n\n // If the entry is not currently visible, draw the arrow to the edge of the screen towards the entry on the Y-axis.\n let fromEntryX = 0;\n let fromEntryY = this.#yCoordinateForNotVisibleEntry(entryFrom);\n\n // If the entry is visible, draw the arrow to the entry.\n if (entryFromVisibility) {\n const fromEntryParams = this.#positionEntryBorderOutlineType(entriesToConnect.entryFrom, entryFromWrapper);\n if (fromEntryParams) {\n const fromEntryHeight = fromEntryParams?.entryHeight;\n const fromEntryWidth = fromEntryParams?.entryWidth;\n const fromCutOffHeight = fromEntryParams?.cutOffHeight;\n fromEntryX = fromEntryParams?.x;\n fromEntryY = fromEntryParams?.y;\n\n component.fromEntryCoordinateAndDimentions =\n {x: fromEntryX, y: fromEntryY, length: fromEntryWidth, height: fromEntryHeight - fromCutOffHeight};\n } else {\n // Something went if the entry is visible and we cannot get its' parameters.\n return;\n }\n }\n\n // If `fromEntry` is not visible and the link creation is not started yet, meaning that\n // only the button to create the link is displayed, delete the whole overlay.\n if (!entryFromVisibility && overlay.state === Trace.Types.File.EntriesLinkState.CREATION_NOT_STARTED) {\n this.dispatchEvent(new AnnotationOverlayActionEvent(overlay, 'Remove'));\n }\n\n // If entryTo exists, pass the coordinates and dimentions of the entry that the arrow snaps to.\n // If it does not, the event tracking mouse coordinates updates 'to coordinates' so the arrow follows the mouse instead.\n const entryToWrapper = component.entryToWrapper();\n\n if (entryTo && entryToWrapper) {\n let toEntryX = 0;\n // If the 'to' entry is visible, set the entry Y as an arrow coordinate to point to. If not, get the canvas edge coordate to point the arrow to.\n let toEntryY = this.#yCoordinateForNotVisibleEntry(entryTo);\n\n if (entryToVisibility) {\n const toEntryParams = this.#positionEntryBorderOutlineType(entryTo, entryToWrapper);\n\n if (toEntryParams) {\n const toEntryHeight = toEntryParams?.entryHeight;\n const toEntryWidth = toEntryParams?.entryWidth;\n const toCutOffHeight = toEntryParams?.cutOffHeight;\n toEntryX = toEntryParams?.x;\n toEntryY = toEntryParams?.y;\n\n component.toEntryCoordinateAndDimentions = {\n x: toEntryX,\n y: toEntryY,\n length: toEntryWidth,\n height: toEntryHeight - toCutOffHeight,\n };\n } else {\n // Something went if the entry is visible and we cannot get its' parameters.\n return;\n }\n }\n\n } else if (this.#lastMouseOffsetX && this.#lastMouseOffsetY) {\n // The second coordinate for in progress link gets updated on mousemove\n this.#entriesLinkInProgress = overlay;\n }\n\n component.fromEntryIsSource = entryFromIsSource;\n component.toEntryIsSource = entryToIsSource;\n component.entriesVisibility = {\n fromEntryVisibility: entryFromVisibility,\n toEntryVisibility: entryToVisibility,\n };\n }\n }\n\n /**\n * Return Y coordinate for an arrow connecting 2 entries to attach to if the entry is not visible.\n * For example, if the entry is scrolled up from the visible area , return the y index of the edge of the track:\n * --\n * | | - entry off the visible chart\n * --\n *\n * --Y--------------- -- Y is the returned coordinate that the arrow should point to\n *\n * flamechart data -- visible flamechart data between the 2 lines\n * ------------------\n *\n * On the contrary, if the entry is scrolled off the bottom, get the coordinate of the top of the visible canvas.\n */\n #yCoordinateForNotVisibleEntry(entry: OverlayEntry): number {\n const chartName = chartForEntry(entry);\n\n const y = this.yPixelForEventOnChart(entry);\n if (y === null) {\n return 0;\n }\n\n if (chartName === 'main') {\n if (!this.#dimensions.charts.main?.heightPixels) {\n // Shouldn't happen, but if the main chart has no height, nothing on it is visible.\n return 0;\n }\n\n const yWithoutNetwork = y - this.networkChartOffsetHeight();\n // Check if the y position is less than 0. If it, the entry is off the top of the track canvas.\n // In that case, return the height of network track, which is also the top of main track.\n if (yWithoutNetwork < 0) {\n return this.networkChartOffsetHeight();\n }\n }\n\n if (chartName === 'network') {\n if (!this.#dimensions.charts.network) {\n return 0;\n }\n\n // The event is off the bottom of the network chart. In this case return the bottom of the network chart.\n if (y > this.#dimensions.charts.network.heightPixels) {\n return this.#dimensions.charts.network.heightPixels;\n }\n }\n\n // In other cases, return the y of the entry\n return y;\n }\n\n #positionTimeRangeOverlay(overlay: TimeRangeLabel, element: HTMLElement): void {\n // Time ranges span both charts, it doesn't matter which one we pass here.\n // It's used to get the width of the container, and both charts have the\n // same width.\n const leftEdgePixel = this.#xPixelForMicroSeconds('main', overlay.bounds.min);\n const rightEdgePixel = this.#xPixelForMicroSeconds('main', overlay.bounds.max);\n if (leftEdgePixel === null || rightEdgePixel === null) {\n return;\n }\n\n const rangeWidth = rightEdgePixel - leftEdgePixel;\n\n element.style.left = `${leftEdgePixel}px`;\n element.style.width = `${rangeWidth}px`;\n }\n\n /**\n * Positions an EntryLabel overlay\n * @param overlay - the EntrySelected overlay that we need to position.\n * @param element - the DOM element representing the overlay\n */\n #positionEntryLabelOverlay(overlay: EntryLabel, element: HTMLElement): number|null {\n // Because the entry outline is a common Overlay pattern, get the wrapper of the entry\n // that comes with the EntryLabel Overlay and pass it into the `positionEntryBorderOutlineType`\n // to draw and position it. The other parts of EntryLabel are drawn by the `EntryLabelOverlay` class.\n const component = element.querySelector('devtools-entry-label-overlay');\n if (!component) {\n return null;\n }\n const entryWrapper = component.entryHighlightWrapper();\n\n if (!entryWrapper) {\n return null;\n }\n\n const {entryHeight, entryWidth, cutOffHeight = 0, x, y} =\n this.#positionEntryBorderOutlineType(overlay.entry, entryWrapper) || {};\n\n if (!entryHeight || !entryWidth || x === null || !y) {\n return null;\n }\n\n // Position the start of label overlay at the start of the entry + length of connector + legth of the label element\n element.style.top = `${y - Components.EntryLabelOverlay.EntryLabelOverlay.LABEL_AND_CONNECTOR_HEIGHT}px`;\n element.style.left = `${x}px`;\n element.style.width = `${entryWidth}px`;\n\n return entryHeight - cutOffHeight;\n }\n\n #positionCandyStripedTimeRange(overlay: CandyStripedTimeRange, element: HTMLElement): void {\n const chartName = chartForEntry(overlay.entry);\n\n const startX = this.#xPixelForMicroSeconds(chartName, overlay.bounds.min);\n const endX = this.#xPixelForMicroSeconds(chartName, overlay.bounds.max);\n if (startX === null || endX === null) {\n return;\n }\n\n const widthPixels = endX - startX;\n // The entry selected overlay is always at least 2px wide.\n const finalWidth = Math.max(2, widthPixels);\n element.style.width = `${finalWidth}px`;\n element.style.left = `${startX}px`;\n\n let y = this.yPixelForEventOnChart(overlay.entry);\n if (y === null) {\n return;\n }\n\n const totalHeight = this.pixelHeightForEventOnChart(overlay.entry) ?? 0;\n\n // We might modify the height we use when drawing the overlay, hence copying the totalHeight.\n let height = totalHeight;\n if (height === null) {\n return;\n }\n\n // If the event is on the main chart, we need to adjust its selected border\n // if the event is cut off the top of the screen, because we need to ensure\n // that it does not overlap the resize element. Unfortunately we cannot\n // z-index our way out of this, so instead we calculate if the event is cut\n // off, and if it is, we draw the partial selected outline and do not draw\n // the top border, making it appear like it is going behind the resizer.\n // We don't need to worry about it going off the bottom, because in that\n // case we don't draw the overlay anyway.\n if (chartName === 'main') {\n const chartTopPadding = this.networkChartOffsetHeight();\n // We now calculate the available height: if the entry is cut off we don't\n // show the border for the part that is cut off.\n const cutOffTop = y < chartTopPadding;\n\n height = cutOffTop ? Math.abs(y + height - chartTopPadding) : height;\n element.classList.toggle('cut-off-top', cutOffTop);\n if (cutOffTop) {\n // Adjust the y position: we need to move it down from the top Y\n // position to the Y position of the first visible pixel. The\n // adjustment is totalHeight - height because if the totalHeight is 17,\n // and the visibleHeight is 5, we need to draw the overay at 17-5=12px\n // vertically from the top of the event.\n y = y + totalHeight - height;\n }\n } else {\n // If the event is on the network chart, we use the same logic as above\n // for the main chart, but to check if the event is cut off the bottom of\n // the network track and only part of the overlay is visible.\n // We don't need to worry about the event going off the top of the panel\n // as we can show the full overlay and it gets cut off by the minimap UI.\n const networkHeight = this.#dimensions.charts.network?.heightPixels ?? 0;\n const lastVisibleY = y + totalHeight;\n const cutOffBottom = lastVisibleY > networkHeight;\n const cutOffTop = y > networkHeight;\n element.classList.toggle('cut-off-top', cutOffTop);\n element.classList.toggle('cut-off-bottom', cutOffBottom);\n if (cutOffBottom) {\n // Adjust the height of the overlay to be the amount of visible pixels.\n height = networkHeight - y;\n }\n }\n\n element.style.height = `${height}px`;\n element.style.top = `${y}px`;\n }\n\n /**\n * Draw and position borders around an entry. Multiple overlays either fully consist\n * of a border around an entry of have an entry border as a part of the overlay.\n * Positions an EntrySelected or EntryOutline overlay and a part of the EntryLabel.\n * @param overlay - the EntrySelected/EntryOutline/EntryLabel overlay that we need to position.\n * @param element - the DOM element representing the overlay\n */\n #positionEntryBorderOutlineType(entry: OverlayEntry, element: HTMLElement):\n {entryHeight: number, entryWidth: number, cutOffHeight: number, x: number, y: number}|null {\n const chartName = chartForEntry(entry);\n let x = this.xPixelForEventStartOnChart(entry);\n let y = this.yPixelForEventOnChart(entry);\n const chartWidth = (chartName === 'main') ? this.#dimensions.charts.main?.widthPixels :\n this.#dimensions.charts.network?.widthPixels;\n\n if (x === null || y === null || !chartWidth) {\n return null;\n }\n\n const {endTime} = timingsForOverlayEntry(entry);\n const endX = this.#xPixelForMicroSeconds(chartName, endTime);\n if (endX === null) {\n return null;\n }\n\n const totalHeight = this.pixelHeightForEventOnChart(entry) ?? 0;\n\n // We might modify the height we use when drawing the overlay, hence copying the totalHeight.\n let height = totalHeight;\n if (height === null) {\n return null;\n }\n\n // The width of the overlay is by default the width of the entry. However\n // we modify that for instant events like LCP markers, and also ensure a\n // minimum width.\n let widthPixels = endX - x;\n\n const provider = chartName === 'main' ? this.#charts.mainProvider : this.#charts.networkProvider;\n const chart = chartName === 'main' ? this.#charts.mainChart : this.#charts.networkChart;\n const index = provider.indexForEvent?.(entry);\n const customPos = chart.getCustomDrawnPositionForEntryIndex(index ?? -1);\n if (customPos) {\n // Some events like markers and layout shifts define their exact coordinates explicitly.\n // If this is one of those events we should change the overlay coordinates to match.\n x = customPos.x;\n widthPixels = customPos.width;\n }\n\n // Calculate the visible overlay width by substracting the entry width that is outside of the flamechart width\n const cutOffRight = (x + widthPixels > chartWidth) ? (x + widthPixels) - chartWidth : null;\n const cutOffLeft = (x < 0) ? Math.abs(x) : null;\n element.classList.toggle('cut-off-right', cutOffRight !== null);\n\n if (cutOffRight) {\n widthPixels = widthPixels - cutOffRight;\n }\n\n if (cutOffLeft) {\n // If the entry is cut off from the left, move its beginning to the left most part of the flamechart\n x = 0;\n widthPixels = widthPixels - cutOffLeft;\n }\n\n // The entry selected overlay is always at least 2px wide.\n const finalWidth = Math.max(2, widthPixels);\n element.style.width = `${finalWidth}px`;\n\n // If the event is on the main chart, we need to adjust its selected border\n // if the event is cut off the top of the screen, because we need to ensure\n // that it does not overlap the resize element. Unfortunately we cannot\n // z-index our way out of this, so instead we calculate if the event is cut\n // off, and if it is, we draw the partial selected outline and do not draw\n // the top border, making it appear like it is going behind the resizer.\n // We don't need to worry about it going off the bottom, because in that\n // case we don't draw the overlay anyway.\n if (chartName === 'main') {\n const chartTopPadding = this.networkChartOffsetHeight();\n // We now calculate the available height: if the entry is cut off we don't\n // show the border for the part that is cut off.\n const cutOffTop = y < chartTopPadding;\n\n height = cutOffTop ? Math.abs(y + height - chartTopPadding) : height;\n element.classList.toggle('cut-off-top', cutOffTop);\n if (cutOffTop) {\n // Adjust the y position: we need to move it down from the top Y\n // position to the Y position of the first visible pixel. The\n // adjustment is totalHeight - height because if the totalHeight is 17,\n // and the visibleHeight is 5, we need to draw the overay at 17-5=12px\n // vertically from the top of the event.\n y = y + totalHeight - height;\n }\n } else {\n // If the event is on the network chart, we use the same logic as above\n // for the main chart, but to check if the event is cut off the bottom of\n // the network track and only part of the overlay is visible.\n // We don't need to worry about the even going off the top of the panel\n // as we can show the full overlay and it gets cut off by the minimap UI.\n const networkHeight = this.#dimensions.charts.network?.heightPixels ?? 0;\n const lastVisibleY = y + totalHeight;\n const cutOffBottom = lastVisibleY > networkHeight;\n element.classList.toggle('cut-off-bottom', cutOffBottom);\n if (cutOffBottom) {\n // Adjust the height of the overlay to be the amount of visible pixels.\n height = networkHeight - y;\n }\n }\n\n element.style.height = `${height}px`;\n element.style.top = `${y}px`;\n element.style.left = `${x}px`;\n\n return {entryHeight: totalHeight, entryWidth: finalWidth, cutOffHeight: totalHeight - height, x, y};\n }\n\n /**\n * We draw an arrow between connected entries but this can get complicated\n * depending on if the entries are visible or not. For example, the user might\n * draw a connection to an entry in the main thread but then collapse the\n * parent of that entry. In this case the entry we want to draw to is the\n * first visible parent of that entry rather than the (invisible) entry.\n */\n #calculateFromAndToForEntriesLink(overlay: EntriesLink): EntriesLinkVisibleEntries|null {\n if (!overlay.entryTo) {\n // This case is where the user has clicked on the first entry and needs\n // to pick a second. In this case they can only pick from visible\n // entries, so we don't need to do any checks and can just return.\n return {\n entryFrom: overlay.entryFrom,\n entryTo: overlay.entryTo,\n entryFromIsSource: true,\n entryToIsSource: true,\n };\n }\n\n let entryFrom: OverlayEntry|null = overlay.entryFrom;\n let entryTo: OverlayEntry|null = overlay.entryTo ?? null;\n\n if (this.#queries.isEntryCollapsedByUser(overlay.entryFrom)) {\n entryFrom = this.#queries.firstVisibleParentForEntry(overlay.entryFrom);\n }\n if (overlay.entryTo && this.#queries.isEntryCollapsedByUser(overlay.entryTo)) {\n entryTo = this.#queries.firstVisibleParentForEntry(overlay.entryTo);\n }\n\n if (entryFrom === null || entryTo === null) {\n // We cannot draw this overlay; so return null;\n // The only valid case of entryTo being null/undefined has been dealt\n // with already at the start of this function.\n return null;\n }\n\n return {\n entryFrom,\n entryFromIsSource: entryFrom === overlay.entryFrom,\n entryTo,\n entryToIsSource: entryTo === overlay.entryTo,\n };\n }\n\n #createElementForNewOverlay(overlay: TimelineOverlay): HTMLElement {\n const div = document.createElement('div');\n div.classList.add('overlay-item', `overlay-type-${overlay.type}`);\n\n const jslogContext = jsLogContext(overlay);\n if (jslogContext) {\n div.setAttribute('jslog', `${VisualLogging.item(jslogContext)}`);\n }\n\n switch (overlay.type) {\n case 'ENTRY_LABEL': {\n const shouldDrawLabelBelowEntry = Trace.Types.Events.isLegacyTimelineFrame(overlay.entry);\n const component = new Components.EntryLabelOverlay.EntryLabelOverlay(overlay.label, shouldDrawLabelBelowEntry);\n component.addEventListener(Components.EntryLabelOverlay.EmptyEntryLabelRemoveEvent.eventName, () => {\n this.dispatchEvent(new AnnotationOverlayActionEvent(overlay, 'Remove'));\n });\n component.addEventListener(Components.EntryLabelOverlay.EntryLabelChangeEvent.eventName, event => {\n const newLabel = (event as Components.EntryLabelOverlay.EntryLabelChangeEvent).newLabel;\n overlay.label = newLabel;\n this.dispatchEvent(new AnnotationOverlayActionEvent(overlay, 'Update'));\n });\n div.appendChild(component);\n return div;\n }\n case 'ENTRIES_LINK': {\n const entries = this.#calculateFromAndToForEntriesLink(overlay);\n if (entries === null) {\n // For some reason, we don't have two entries we can draw between\n // (can happen if the user has collapsed an icicle in the flame\n // chart, or a track), so just draw an empty div.\n return div;\n }\n const entryEndX = this.xPixelForEventEndOnChart(entries.entryFrom) ?? 0;\n const entryStartX = this.xPixelForEventEndOnChart(entries.entryFrom) ?? 0;\n const entryStartY = (this.yPixelForEventOnChart(entries.entryFrom) ?? 0);\n const entryWidth = entryEndX - entryStartX;\n const entryHeight = this.pixelHeightForEventOnChart(entries.entryFrom) ?? 0;\n\n const component = new Components.EntriesLinkOverlay.EntriesLinkOverlay(\n {x: entryEndX, y: entryStartY, width: entryWidth, height: entryHeight}, overlay.state);\n\n component.addEventListener(Components.EntriesLinkOverlay.EntryLinkStartCreating.eventName, () => {\n overlay.state = Trace.Types.File.EntriesLinkState.PENDING_TO_EVENT;\n this.dispatchEvent(new AnnotationOverlayActionEvent(overlay, 'Update'));\n });\n div.appendChild(component);\n return div;\n }\n case 'ENTRY_OUTLINE': {\n div.classList.add(`outline-reason-${overlay.outlineReason}`);\n return div;\n }\n case 'TIME_RANGE': {\n const component = new Components.TimeRangeOverlay.TimeRangeOverlay(overlay.label);\n component.duration = overlay.showDuration ? overlay.bounds.range : null;\n component.canvasRect = this.#charts.mainChart.canvasBoundingClientRect();\n component.addEventListener(Components.TimeRangeOverlay.TimeRangeLabelChangeEvent.eventName, event => {\n const newLabel = (event as Components.TimeRangeOverlay.TimeRangeLabelChangeEvent).newLabel;\n overlay.label = newLabel;\n this.dispatchEvent(new AnnotationOverlayActionEvent(overlay, 'Update'));\n });\n component.addEventListener(Components.TimeRangeOverlay.TimeRangeRemoveEvent.eventName, () => {\n this.dispatchEvent(new AnnotationOverlayActionEvent(overlay, 'Remove'));\n });\n component.addEventListener('mouseover', () => {\n this.dispatchEvent(new TimeRangeMouseOverEvent(overlay));\n });\n component.addEventListener('mouseout', () => {\n this.dispatchEvent(new TimeRangeMouseOutEvent());\n });\n div.appendChild(component);\n return div;\n }\n case 'TIMESPAN_BREAKDOWN': {\n const component = new Components.TimespanBreakdownOverlay.TimespanBreakdownOverlay();\n component.sections = overlay.sections;\n component.canvasRect = this.#charts.mainChart.canvasBoundingClientRect();\n component.isBelowEntry = overlay.renderLocation === 'BELOW_EVENT';\n div.appendChild(component);\n return div;\n }\n case 'TIMINGS_MARKER': {\n const {color} = EntryStyles.markerDetailsForEvent(overlay.entries[0]);\n const markersComponent = this.#createTimingsMarkerElement(overlay);\n div.appendChild(markersComponent);\n div.style.backgroundColor = color;\n return div;\n }\n default: {\n return div;\n }\n }\n }\n\n #clickEvent(event: Trace.Types.Events.Event): void {\n this.dispatchEvent(new EventReferenceClick(event));\n }\n\n #createOverlayPopover(adjustedTimestamp: Trace.Types.Timing.MicroSeconds, name: string): HTMLElement {\n const popoverElement = document.createElement('div');\n const popoverContents = popoverElement.createChild('div', 'overlay-popover');\n popoverContents.createChild('span', 'overlay-popover-time').textContent =\n i18n.TimeUtilities.formatMicroSecondsTime(adjustedTimestamp);\n popoverContents.createChild('span', 'overlay-popover-title').textContent = name;\n return popoverElement;\n }\n\n #mouseMoveOverlay(event: MouseEvent, name: string, overlay: TimingsMarker, markers: HTMLElement, marker: HTMLElement):\n void {\n const popoverElement = this.#createOverlayPopover(overlay.adjustedTimestamp, name);\n this.#lastMouseOffsetX = event.offsetX + (markers.offsetLeft || 0) + (marker.offsetLeft || 0);\n this.#lastMouseOffsetY = event.offsetY + markers.offsetTop || 0;\n this.#charts.mainChart.updateMouseOffset(this.#lastMouseOffsetX, this.#lastMouseOffsetY);\n this.#charts.mainChart.updatePopoverContents(popoverElement);\n }\n\n #mouseOutOverlay(): void {\n this.#lastMouseOffsetX = -1;\n this.#lastMouseOffsetY = -1;\n this.#charts.mainChart.updateMouseOffset(this.#lastMouseOffsetX, this.#lastMouseOffsetY);\n this.#charts.mainChart.hideHighlight();\n }\n\n #createTimingsMarkerElement(overlay: TimingsMarker): HTMLElement {\n const markers = document.createElement('div');\n markers.classList.add('markers');\n for (const entry of overlay.entries) {\n const {color, title} = EntryStyles.markerDetailsForEvent(entry);\n const marker = document.createElement('div');\n marker.classList.add('marker-title');\n marker.textContent = title;\n marker.style.backgroundColor = color;\n markers.appendChild(marker);\n\n marker.addEventListener('click', () => this.#clickEvent(entry));\n // Popover.\n marker.addEventListener('mousemove', event => this.#mouseMoveOverlay(event, title, overlay, markers, marker));\n marker.addEventListener('mouseout', () => this.#mouseOutOverlay());\n }\n return markers;\n }\n\n /**\n * Some overlays store data in their components that needs to be updated\n * before we position an overlay. Else, we might position an overlay based on\n * stale data. This method is used to update an overlay BEFORE it is then\n * positioned onto the canvas. It is the right place to ensure an overlay has\n * the latest data it needs.\n */\n #updateOverlayBeforePositioning(overlay: TimelineOverlay, element: HTMLElement): void {\n switch (overlay.type) {\n case 'ENTRY_SELECTED':\n break;\n case 'TIME_RANGE': {\n const component = element.querySelector('devtools-time-range-overlay');\n if (component) {\n component.duration = overlay.showDuration ? overlay.bounds.range : null;\n component.canvasRect = this.#charts.mainChart.canvasBoundingClientRect();\n }\n break;\n }\n case 'ENTRY_LABEL':\n case 'ENTRY_OUTLINE':\n case 'ENTRIES_LINK': {\n const component = element.querySelector('devtools-entries-link-overlay');\n if (component) {\n component.canvasRect = this.#charts.mainChart.canvasBoundingClientRect();\n }\n break;\n }\n case 'TIMESPAN_BREAKDOWN': {\n const component = element.querySelector('devtools-timespan-breakdown-overlay');\n if (component) {\n component.sections = overlay.sections;\n component.canvasRect = this.#charts.mainChart.canvasBoundingClientRect();\n }\n break;\n }\n case 'TIMESTAMP_MARKER':\n break;\n case 'CANDY_STRIPED_TIME_RANGE':\n break;\n case 'TIMINGS_MARKER':\n break;\n default:\n Platform.TypeScriptUtilities.assertNever(overlay, `Unexpected overlay ${overlay}`);\n }\n }\n /**\n * Some overlays have custom logic within them to manage visibility of\n * labels/etc that can be impacted if the positioning or size of the overlay\n * has changed. This method can be used to run code after an overlay has\n * been updated + repositioned on the timeline.\n */\n #updateOverlayAfterPositioning(overlay: TimelineOverlay, element: HTMLElement): void {\n switch (overlay.type) {\n case 'ENTRY_SELECTED':\n break;\n case 'TIME_RANGE': {\n const component = element.querySelector('devtools-time-range-overlay');\n component?.updateLabelPositioning();\n break;\n }\n case 'ENTRY_LABEL':\n break;\n case 'ENTRY_OUTLINE':\n break;\n case 'ENTRIES_LINK':\n break;\n case 'TIMESPAN_BREAKDOWN': {\n const component = element.querySelector('devtools-timespan-breakdown-overlay');\n component?.checkSectionLabelPositioning();\n break;\n }\n case 'TIMESTAMP_MARKER':\n break;\n case 'CANDY_STRIPED_TIME_RANGE':\n break;\n case 'TIMINGS_MARKER':\n break;\n default:\n Platform.TypeScriptUtilities.assertNever(overlay, `Unexpected overlay ${overlay}`);\n }\n }\n\n /**\n * @returns true if the entry is visible on chart, which means that both\n * horizontally and vertically it is at least partially in view.\n */\n entryIsVisibleOnChart(entry: OverlayEntry): boolean {\n const verticallyVisible = this.#entryIsVerticallyVisibleOnChart(entry);\n const horiziontallyVisible = this.#entryIsHorizontallyVisibleOnChart(entry);\n return verticallyVisible && horiziontallyVisible;\n }\n\n /**\n * Calculates if an entry is visible horizontally. This is easy because we\n * don't have to consider any pixels and can instead check that its start and\n * end times intersect with the visible window.\n */\n #entryIsHorizontallyVisibleOnChart(entry: OverlayEntry): boolean {\n if (this.#dimensions.trace.visibleWindow === null) {\n return false;\n }\n const {startTime, endTime} = timingsForOverlayEntry(entry);\n\n const entryTimeRange = Trace.Helpers.Timing.traceWindowFromMicroSeconds(startTime, endTime);\n\n return Trace.Helpers.Timing.boundsIncludeTimeRange({\n bounds: this.#dimensions.trace.visibleWindow,\n timeRange: entryTimeRange,\n });\n }\n\n #entryIsInCollapsedTrack(entry: OverlayEntry): boolean {\n const chartName = chartForEntry(entry);\n const provider = chartName === 'main' ? this.#charts.mainProvider : this.#charts.networkProvider;\n\n const entryIndex = provider.indexForEvent?.(entry) ?? null;\n if (entryIndex === null) {\n return false;\n }\n\n const group = provider.groupForEvent?.(entryIndex) ?? null;\n if (!group) {\n return false;\n }\n\n return Boolean(group.expanded) === false;\n }\n\n /**\n * Calculate if an entry is visible vertically on the chart. A bit fiddly as\n * we have to figure out its pixel offset and go on that. Unlike horizontal\n * visibility, we can't work soley from its microsecond values.\n */\n #entryIsVerticallyVisibleOnChart(entry: OverlayEntry): boolean {\n const chartName = chartForEntry(entry);\n\n const y = this.yPixelForEventOnChart(entry);\n if (y === null) {\n return false;\n }\n\n const eventHeight = this.pixelHeightForEventOnChart(entry);\n if (!eventHeight) {\n return false;\n }\n\n if (chartName === 'main') {\n if (!this.#dimensions.charts.main?.heightPixels) {\n // Shouldn't happen, but if the main chart has no height, nothing on it is visible.\n return false;\n }\n\n // The yPixelForEventOnChart method returns the y pixel including an adjustment for the network track.\n // To see if an entry on the main flame chart is visible, we can check\n // its y value without the network track adjustment. If it is < 0, then\n // it's off the top of the screen.\n //\n const yWithoutNetwork = y - this.networkChartOffsetHeight();\n // Check if the y position + the height is less than 0. We add height so\n // that we correctly consider an event only partially scrolled off to be\n // visible.\n if (yWithoutNetwork + eventHeight < 0) {\n return false;\n }\n\n if (yWithoutNetwork > this.#dimensions.charts.main.heightPixels) {\n // The event is off the bottom of the screen.\n return false;\n }\n }\n\n if (chartName === 'network') {\n if (!this.#dimensions.charts.network) {\n // The network chart can be hidden if there are no requests in the trace.\n return false;\n }\n if (y <= -14) {\n // Weird value, but the network chart has the header row with\n // timestamps on it: events stay visible behind those timestamps, so we\n // want any overlays to treat themselves as visible too.\n return false;\n }\n\n if (y > this.#dimensions.charts.network.heightPixels) {\n // The event is off the bottom of the network chart.\n return false;\n }\n }\n // If we got here, none of the conditions to mark an event as invisible got\n // triggered, so the event must be visible.\n return true;\n }\n\n /**\n * Calculate the X pixel position for an event start on the timeline.\n * @param chartName - the chart that the event is on. It is expected that both\n * charts have the same width so this doesn't make a difference - but it might\n * in the future if the UI changes, hence asking for it.\n *\n * @param event - the trace event you want to get the pixel position of\n */\n xPixelForEventStartOnChart(event: OverlayEntry): number|null {\n const chartName = chartForEntry(event);\n const {startTime} = timingsForOverlayEntry(event);\n return this.#xPixelForMicroSeconds(chartName, startTime);\n }\n\n /**\n * Calculate the X pixel position for an event end on the timeline.\n * @param chartName - the chart that the event is on. It is expected that both\n * charts have the same width so this doesn't make a difference - but it might\n * in the future if the UI changes, hence asking for it.\n *\n * @param event - the trace event you want to get the pixel position of\n */\n xPixelForEventEndOnChart(event: OverlayEntry): number|null {\n const chartName = chartForEntry(event);\n const {endTime} = timingsForOverlayEntry(event);\n return this.#xPixelForMicroSeconds(chartName, endTime);\n }\n\n /**\n * Calculate the xPixel for a given timestamp. To do this we calculate how\n * far in microseconds from the left of the visible window an event is, and\n * divide that by the total time span. This gives us a fraction representing\n * how far along the timeline the event is. We can then multiply that by the\n * width of the canvas to get its pixel position.\n */\n #xPixelForMicroSeconds(chart: EntryChartLocation, timestamp: Trace.Types.Timing.MicroSeconds): number|null {\n if (this.#dimensions.trace.visibleWindow === null) {\n console.error('Cannot calculate xPixel without visible trace window.');\n return null;\n }\n const canvasWidthPixels = this.#dimensions.charts[chart]?.widthPixels ?? null;\n if (canvasWidthPixels === null) {\n console.error(`Cannot calculate xPixel without ${chart} dimensions.`);\n return null;\n }\n\n const timeFromLeft = timestamp - this.#dimensions.trace.visibleWindow.min;\n const totalTimeSpan = this.#dimensions.trace.visibleWindow.range;\n return Math.floor(\n timeFromLeft / totalTimeSpan * canvasWidthPixels,\n );\n }\n\n /**\n * Calculate the Y pixel position for the event on the timeline relative to\n * the entire window.\n * This means if the event is in the main flame chart and below the network,\n * we add the height of the network chart to the Y value to position it\n * correctly.\n * This can return null if any data was missing, or if the event is not\n * visible (if the level it's on is hidden because the track is collapsed,\n * for example)\n */\n yPixelForEventOnChart(event: OverlayEntry): number|null {\n const chartName = chartForEntry(event);\n const chart = chartName === 'main' ? this.#charts.mainChart : this.#charts.networkChart;\n const provider = chartName === 'main' ? this.#charts.mainProvider : this.#charts.networkProvider;\n\n const indexForEntry = provider.indexForEvent?.(event);\n if (typeof indexForEntry !== 'number') {\n return null;\n }\n const timelineData = provider.timelineData();\n if (timelineData === null) {\n return null;\n }\n const level = timelineData.entryLevels.at(indexForEntry);\n if (typeof level === 'undefined') {\n return null;\n }\n\n if (!chart.levelIsVisible(level)) {\n return null;\n }\n\n const pixelOffsetForLevel = chart.levelToOffset(level);\n // Now we have the offset for the level, we need to adjust it by the user's scroll offset.\n let pixelAdjustedForScroll = pixelOffsetForLevel - (this.#dimensions.charts[chartName]?.scrollOffsetPixels ?? 0);\n\n // Now if the event is in the main chart, we need to pad its Y position\n // down by the height of the network chart + the network resize element.\n if (chartName === 'main') {\n pixelAdjustedForScroll += this.networkChartOffsetHeight();\n }\n\n return pixelAdjustedForScroll;\n }\n\n /**\n * Calculate the height of the event on the timeline.\n */\n pixelHeightForEventOnChart(event: OverlayEntry): number|null {\n const chartName = chartForEntry(event);\n const chart = chartName === 'main' ? this.#charts.mainChart : this.#charts.networkChart;\n const provider = chartName === 'main' ? this.#charts.mainProvider : this.#charts.networkProvider;\n\n const indexForEntry = provider.indexForEvent?.(event);\n if (typeof indexForEntry !== 'number') {\n return null;\n }\n const timelineData = provider.timelineData();\n if (timelineData === null) {\n return null;\n }\n const level = timelineData.entryLevels.at(indexForEntry);\n if (typeof level === 'undefined') {\n return null;\n }\n return chart.levelHeight(level);\n }\n\n /**\n * Calculate the height of the network chart. If the network chart has\n * height, we also allow for the size of the resize handle shown between the\n * two charts.\n *\n * Note that it is possible for the chart to have 0 height if the user is\n * looking at a trace with no network requests.\n */\n networkChartOffsetHeight(): number {\n if (this.#dimensions.charts.network === null) {\n return 0;\n }\n\n if (this.#dimensions.charts.network.heightPixels === 0) {\n return 0;\n }\n\n // At this point we know the network track exists and has height. But we\n // need to check if it is collapsed, because if it is collapsed there is no\n // resizer shown.\n if (this.#dimensions.charts.network.allGroupsCollapsed) {\n return this.#dimensions.charts.network.heightPixels;\n }\n\n return this.#dimensions.charts.network.heightPixels + NETWORK_RESIZE_ELEM_HEIGHT_PX;\n }\n\n /**\n * Hides or shows an element. We used to use visibility rather than display,\n * but a child of an element with visibility: hidden may still be visible if\n * its own `display` property is set.\n */\n #setOverlayElementVisibility(element: HTMLElement, isVisible: boolean): void {\n element.style.display = isVisible ? 'block' : 'none';\n }\n}\n\n/**\n * Because entries can be a TimelineFrame, which is not a trace event, this\n * helper exists to return a consistent set of timings regardless of the type\n * of entry.\n */\nexport function timingsForOverlayEntry(entry: OverlayEntry):\n Trace.Helpers.Timing.EventTimingsData {\n if (Trace.Types.Events.isLegacyTimelineFrame(entry)) {\n return {\n startTime: entry.startTime,\n endTime: entry.endTime,\n duration: entry.duration,\n };\n }\n return Trace.Helpers.Timing.eventTimingsMicroSeconds(entry);\n}\n\n/**\n * Defines if the overlay container `div` should have a jslog context attached.\n * Note that despite some of the overlays being used currently exclusively\n * for annotations, we log here with `overlays` to be generic as overlays can\n * be used for insights, annotations or in the future, who knows...\n */\nexport function jsLogContext(overlay: TimelineOverlay): string|null {\n switch (overlay.type) {\n case 'ENTRY_SELECTED': {\n // No jslog for this; it would be very noisy and not very useful.\n return null;\n }\n case 'ENTRY_OUTLINE': {\n return `timeline.overlays.entry-outline-${Platform.StringUtilities.toKebabCase(overlay.outlineReason)}`;\n }\n case 'ENTRY_LABEL': {\n return 'timeline.overlays.entry-label';\n }\n case 'ENTRIES_LINK': {\n // do not log impressions for incomplete entry links\n if (overlay.state !== Trace.Types.File.EntriesLinkState.CONNECTED) {\n return null;\n }\n return 'timeline.overlays.entries-link';\n }\n case 'TIME_RANGE': {\n return 'timeline.overlays.time-range';\n }\n case 'TIMESPAN_BREAKDOWN': {\n return 'timeline.overlays.timespan-breakdown';\n }\n case 'TIMESTAMP_MARKER': {\n return 'timeline.overlays.cursor-timestamp-marker';\n }\n case 'CANDY_STRIPED_TIME_RANGE': {\n return 'timeline.overlays.candy-striped-time-range';\n }\n case 'TIMINGS_MARKER': {\n return 'timeline.overlays.timings-marker';\n }\n default:\n Platform.assertNever(overlay, 'Unknown overlay type');\n }\n}\n"]} \ No newline at end of file +{"version":3,"file":"OverlaysImpl.js","sourceRoot":"","sources":["../../../../../../../front_end/panels/timeline/overlays/OverlaysImpl.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAC7B,OAAO,KAAK,MAAM,MAAM,gCAAgC,CAAC;AACzD,OAAO,KAAK,IAAI,MAAM,4BAA4B,CAAC;AACnD,OAAO,KAAK,QAAQ,MAAM,oCAAoC,CAAC;AAC/D,OAAO,KAAK,KAAK,MAAM,gCAAgC,CAAC;AAExD,OAAO,KAAK,aAAa,MAAM,8CAA8C,CAAC;AAC9E,OAAO,EAAC,WAAW,EAAC,MAAM,+BAA+B,CAAC;AAE1D,OAAO,KAAK,UAAU,MAAM,4BAA4B,CAAC;AAEzD;;GAEG;AACH,MAAM,6BAA6B,GAAG,CAAC,CAAC;AAgExC;;;;GAIG;AACH,MAAM,UAAU,6BAA6B,CAAC,QAA2B;IAEvE,IAAI,OAAO,GAAG,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,YAAY,CAAC,MAAM,CAAC,iBAAiB,CAAC,CAAC;IACxE,IAAI,OAAO,GAAG,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,YAAY,CAAC,MAAM,CAAC,iBAAiB,CAAC,CAAC;IAExE,IAAI,QA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;IAC1D,CAAC;AACH,CAAC","sourcesContent":["// Copyright 2024 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\nimport * as Common from '../../../core/common/common.js';\nimport * as i18n from '../../../core/i18n/i18n.js';\nimport * as Platform from '../../../core/platform/platform.js';\nimport * as Trace from '../../../models/trace/trace.js';\nimport type * as PerfUI from '../../../ui/legacy/components/perf_ui/perf_ui.js';\nimport * as VisualLogging from '../../../ui/visual_logging/visual_logging.js';\nimport {EntryStyles} from '../../timeline/utils/utils.js';\n\nimport * as Components from './components/components.js';\n\n/**\n * Below the network track there is a resize bar the user can click and drag.\n */\nconst NETWORK_RESIZE_ELEM_HEIGHT_PX = 8;\n\n/**\n * Represents which flamechart an entry is rendered in.\n * We need to know this because when we place an overlay for an entry we need\n * to adjust its Y value if it's in the main chart which is drawn below the\n * network chart\n */\nexport type EntryChartLocation = 'main'|'network';\n\n/**\n * You can add overlays to trace events, but also right now frames are drawn on\n * the timeline but they are not trace events, so we need to allow for that.\n * In the future when the frames track has been migrated to be powered by\n * animation frames (crbug.com/345144583), we can remove the requirement to\n * support TimelineFrame instances (which themselves will be removed from the\n * codebase.)\n */\nexport type OverlayEntry = Trace.Types.Events.Event|Trace.Types.Events.LegacyTimelineFrame;\n\n/**\n * Represents when a user has selected an entry in the timeline\n */\nexport interface EntrySelected {\n type: 'ENTRY_SELECTED';\n entry: OverlayEntry;\n}\n\n/**\n * Drawn around an entry when we want to highlight it to the user.\n */\nexport interface EntryOutline {\n type: 'ENTRY_OUTLINE';\n entry: OverlayEntry;\n outlineReason: 'ERROR'|'INFO';\n}\n\n/**\n * Represents an object created when a user creates a label for an entry in the timeline.\n */\nexport interface EntryLabel {\n type: 'ENTRY_LABEL';\n entry: OverlayEntry;\n label: string;\n}\n\nexport interface EntriesLink {\n type: 'ENTRIES_LINK';\n state: Trace.Types.File.EntriesLinkState;\n entryFrom: OverlayEntry;\n entryTo?: OverlayEntry;\n}\n\n/**\n * Represents a time range on the trace. Also used when the user shift+clicks\n * and drags to create a time range.\n */\nexport interface TimeRangeLabel {\n type: 'TIME_RANGE';\n bounds: Trace.Types.Timing.TraceWindowMicroSeconds;\n label: string;\n showDuration: boolean;\n}\n\n/**\n * Given a list of overlays, this method will calculate the smallest possible\n * trace window that will contain all of the overlays.\n * `overlays` is expected to be non-empty, and this will return `null` if it is empty.\n */\nexport function traceWindowContainingOverlays(overlays: TimelineOverlay[]): Trace.Types.Timing.TraceWindowMicroSeconds|\n null {\n let minTime = Trace.Types.Timing.MicroSeconds(Number.POSITIVE_INFINITY);\n let maxTime = Trace.Types.Timing.MicroSeconds(Number.NEGATIVE_INFINITY);\n\n if (overlays.length === 0) {\n return null;\n }\n\n for (const overlay of overlays) {\n const windowForOverlay = traceWindowForOverlay(overlay);\n if (windowForOverlay.min < minTime) {\n minTime = windowForOverlay.min;\n }\n if (windowForOverlay.max > maxTime) {\n maxTime = windowForOverlay.max;\n }\n }\n\n return Trace.Helpers.Timing.traceWindowFromMicroSeconds(minTime, maxTime);\n}\n\nfunction traceWindowForOverlay(overlay: TimelineOverlay): Trace.Types.Timing.TraceWindowMicroSeconds {\n const overlayMinBounds: Trace.Types.Timing.MicroSeconds[] = [];\n const overlayMaxBounds: Trace.Types.Timing.MicroSeconds[] = [];\n\n switch (overlay.type) {\n case 'ENTRY_SELECTED': {\n const timings = timingsForOverlayEntry(overlay.entry);\n overlayMinBounds.push(timings.startTime);\n overlayMaxBounds.push(timings.endTime);\n break;\n }\n case 'ENTRY_OUTLINE': {\n const timings = timingsForOverlayEntry(overlay.entry);\n overlayMinBounds.push(timings.startTime);\n overlayMaxBounds.push(timings.endTime);\n break;\n }\n\n case 'TIME_RANGE': {\n overlayMinBounds.push(overlay.bounds.min);\n overlayMaxBounds.push(overlay.bounds.max);\n break;\n }\n case 'ENTRY_LABEL': {\n const timings = timingsForOverlayEntry(overlay.entry);\n overlayMinBounds.push(timings.startTime);\n overlayMaxBounds.push(timings.endTime);\n break;\n }\n\n case 'ENTRIES_LINK': {\n const timingsFrom = timingsForOverlayEntry(overlay.entryFrom);\n overlayMinBounds.push(timingsFrom.startTime);\n if (overlay.entryTo) {\n const timingsTo = timingsForOverlayEntry(overlay.entryTo);\n // No need to push the startTime; it must be larger than the entryFrom start time.\n overlayMaxBounds.push(timingsTo.endTime);\n } else {\n // Only use the end time if we have no entryTo; otherwise the entryTo\n // endTime is guaranteed to be larger than the entryFrom endTime.\n overlayMaxBounds.push(timingsFrom.endTime);\n }\n\n break;\n }\n case 'TIMESPAN_BREAKDOWN': {\n if (overlay.entry) {\n const timings = timingsForOverlayEntry(overlay.entry);\n overlayMinBounds.push(timings.startTime);\n overlayMaxBounds.push(timings.endTime);\n }\n for (const section of overlay.sections) {\n overlayMinBounds.push(section.bounds.min);\n overlayMaxBounds.push(section.bounds.max);\n }\n break;\n }\n case 'TIMESTAMP_MARKER': {\n overlayMinBounds.push(overlay.timestamp);\n break;\n }\n case 'CANDY_STRIPED_TIME_RANGE': {\n const timings = timingsForOverlayEntry(overlay.entry);\n overlayMinBounds.push(timings.startTime);\n overlayMaxBounds.push(timings.endTime);\n overlayMinBounds.push(overlay.bounds.min);\n overlayMaxBounds.push(overlay.bounds.max);\n break;\n }\n case 'TIMINGS_MARKER': {\n const timings = timingsForOverlayEntry(overlay.entries[0]);\n overlayMinBounds.push(timings.startTime);\n break;\n }\n default:\n Platform.TypeScriptUtilities.assertNever(overlay, `Unexpected overlay ${overlay}`);\n }\n\n const min = Trace.Types.Timing.MicroSeconds(Math.min(...overlayMinBounds));\n const max = Trace.Types.Timing.MicroSeconds(Math.max(...overlayMaxBounds));\n return Trace.Helpers.Timing.traceWindowFromMicroSeconds(min, max);\n}\n\n/**\n * Get a list of entries for a given overlay.\n */\nexport function entriesForOverlay(overlay: TimelineOverlay): readonly OverlayEntry[] {\n const entries: OverlayEntry[] = [];\n\n switch (overlay.type) {\n case 'ENTRY_SELECTED': {\n entries.push(overlay.entry);\n break;\n }\n case 'ENTRY_OUTLINE': {\n entries.push(overlay.entry);\n break;\n }\n case 'TIME_RANGE': {\n // Time ranges are not associated with entries.\n break;\n }\n case 'ENTRY_LABEL': {\n entries.push(overlay.entry);\n break;\n }\n case 'ENTRIES_LINK': {\n entries.push(overlay.entryFrom);\n if (overlay.entryTo) {\n entries.push(overlay.entryTo);\n }\n break;\n }\n case 'TIMESPAN_BREAKDOWN': {\n if (overlay.entry) {\n entries.push(overlay.entry);\n }\n break;\n }\n case 'TIMESTAMP_MARKER': {\n // This overlay type isn't associated to any entry, so just break here.\n break;\n }\n case 'CANDY_STRIPED_TIME_RANGE': {\n entries.push(overlay.entry);\n break;\n }\n case 'TIMINGS_MARKER': {\n entries.push(...overlay.entries);\n break;\n }\n default:\n Platform.assertNever(overlay, `Unknown overlay type ${JSON.stringify(overlay)}`);\n }\n\n return entries;\n}\nexport function chartForEntry(entry: OverlayEntry): EntryChartLocation {\n if (Trace.Types.Events.isNetworkTrackEntry(entry)) {\n return 'network';\n }\n\n return 'main';\n}\n\n/**\n * Used to highlight with a red-candy stripe a time range. It takes an entry\n * because this entry is the row that will be used to place the candy stripe,\n * and its height will be set to the height of that row.\n */\nexport interface CandyStripedTimeRange {\n type: 'CANDY_STRIPED_TIME_RANGE';\n bounds: Trace.Types.Timing.TraceWindowMicroSeconds;\n entry: Trace.Types.Events.Event;\n}\n\n/**\n * Represents a timespan on a trace broken down into parts. Each part has a label to it.\n * If an entry is defined, the breakdown will be vertically positioned based on it.\n */\nexport interface TimespanBreakdown {\n type: 'TIMESPAN_BREAKDOWN';\n sections: Array;\n entry?: Trace.Types.Events.Event;\n renderLocation?: 'BOTTOM_OF_TIMELINE'|'BELOW_EVENT'|'ABOVE_EVENT';\n}\n\nexport interface TimestampMarker {\n type: 'TIMESTAMP_MARKER';\n timestamp: Trace.Types.Timing.MicroSeconds;\n}\n\n/**\n * Represents a timings marker. This has a line that runs up the whole canvas.\n * We can hold an array of entries, in the case we want to hold more than one with the same timestamp.\n * The adjusted timestamp being the timestamp for the event adjusted by closest navigation.\n */\nexport interface TimingsMarker {\n type: 'TIMINGS_MARKER';\n entries: Trace.Types.Events.Event[];\n adjustedTimestamp: Trace.Types.Timing.MicroSeconds;\n}\n\n/**\n * All supported overlay types.\n */\nexport type TimelineOverlay = EntrySelected|EntryOutline|TimeRangeLabel|EntryLabel|EntriesLink|TimespanBreakdown|\n TimestampMarker|CandyStripedTimeRange|TimingsMarker;\n\nexport interface TimelineOverlaySetOptions {\n updateTraceWindow: boolean;\n}\n\n/**\n * Denotes overlays that are singletons; only one of these will be allowed to\n * exist at any given time. If one exists and the add() method is called, the\n * new overlay will replace the existing one.\n */\ntype SingletonOverlay = EntrySelected|TimestampMarker;\nexport function overlayIsSingleton(overlay: TimelineOverlay): overlay is SingletonOverlay {\n return overlay.type === 'TIMESTAMP_MARKER' || overlay.type === 'ENTRY_SELECTED';\n}\n\n/**\n * To be able to draw overlays accurately at the correct pixel position, we\n * need a variety of pixel values from both flame charts (Network and \"Rest\").\n * As each FlameChart draws, it emits an event with its latest set of\n * dimensions. That updates the Overlays and causes them to redraw.\n * Note that we can't use the visible trace window from the TraceBounds\n * service as that can get out of sync with rapid FlameChart draws. To ensure\n * we draw overlays smoothly as the FlameChart renders we use the latest values\n * provided to us from the FlameChart. In `FlameChart#draw` we dispatch an\n * event containing the latest dimensions, and those are passed into the\n * Overlays system via TimelineFlameChartView.\n */\ninterface ActiveDimensions {\n trace: {\n visibleWindow: Trace.Types.Timing.TraceWindowMicroSeconds|null,\n };\n charts: {\n main: FlameChartDimensions|null,\n network: FlameChartDimensions|null,\n };\n}\n\n/**\n * The dimensions each flame chart reports. Note that in the current UI they\n * will always have the same width, so theoretically we could only gather that\n * from one chart, but we gather it from both for simplicity and to cover us in\n * the future should the UI change and the charts have different widths.\n */\ninterface FlameChartDimensions {\n widthPixels: number;\n heightPixels: number;\n scrollOffsetPixels: number;\n // If every single group (e.g. track) within the chart is collapsed or not.\n // This matters because in the network track if every group (there is only\n // one) is collapsed, there is no resizer bar shown, which impacts our pixel\n // calculations for overlay positioning.\n allGroupsCollapsed: boolean;\n}\n\nexport interface TimelineCharts {\n mainChart: PerfUI.FlameChart.FlameChart;\n mainProvider: PerfUI.FlameChart.FlameChartDataProvider;\n networkChart: PerfUI.FlameChart.FlameChart;\n networkProvider: PerfUI.FlameChart.FlameChartDataProvider;\n}\n\nexport interface OverlayEntryQueries {\n isEntryCollapsedByUser: (entry: Trace.Types.Events.Event) => boolean;\n firstVisibleParentForEntry: (entry: Trace.Types.Events.Event) => Trace.Types.Events.Event | null;\n}\n\n// An event dispatched when one of the Annotation Overlays (overlay created by the user,\n// ex. EntryLabel) is removed or updated. When one of the Annotation Overlays is removed or updated,\n// ModificationsManager listens to this event and updates the current annotations.\nexport type UpdateAction = 'Remove'|'Update';\nexport class AnnotationOverlayActionEvent extends Event {\n static readonly eventName = 'annotationoverlayactionsevent';\n\n constructor(public overlay: TimelineOverlay, public action: UpdateAction) {\n super(AnnotationOverlayActionEvent.eventName);\n }\n}\n\nexport class TimeRangeMouseOverEvent extends Event {\n static readonly eventName = 'timerangemouseoverevent';\n\n constructor(public overlay: TimeRangeLabel) {\n super(TimeRangeMouseOverEvent.eventName, {bubbles: true});\n }\n}\n\nexport class TimeRangeMouseOutEvent extends Event {\n static readonly eventName = 'timerangemouseoutevent';\n\n constructor() {\n super(TimeRangeMouseOutEvent.eventName, {bubbles: true});\n }\n}\n\ninterface EntriesLinkVisibleEntries {\n entryFrom: Trace.Types.Events.Event;\n entryTo: Trace.Types.Events.Event|undefined;\n entryFromIsSource: boolean;\n entryToIsSource: boolean;\n}\n\nexport class EventReferenceClick extends Event {\n static readonly eventName = 'eventreferenceclick';\n\n constructor(public event: Trace.Types.Events.Event) {\n super(EventReferenceClick.eventName, {bubbles: true, composed: true});\n }\n}\n\n/**\n * This class manages all the overlays that get drawn onto the performance\n * timeline. Overlays are DOM and are drawn above the network and main flame\n * chart.\n *\n * For more documentation, see `timeline/README.md` which has a section on overlays.\n */\nexport class Overlays extends EventTarget {\n /**\n * The list of active overlays. Overlays can't be marked as visible or\n * hidden; every overlay in this list is rendered.\n * We track each overlay against the HTML Element we have rendered. This is\n * because on first render of a new overlay, we create it, but then on\n * subsequent renders we do not destroy and recreate it, instead we update it\n * based on the new position of the timeline.\n */\n #overlaysToElements: Map = new Map();\n\n // When the Entries Link Annotation is created, the arrow needs to follow the mouse.\n // Update the mouse coordinates while it is being created.\n #lastMouseOffsetX: number|null = null;\n #lastMouseOffsetY: number|null = null;\n // `entriesLinkInProgress` is the entries link Overlay that has not yet been fully created\n // and only has the entry that the link starts from set.\n // We save it as a separate variable because when the second entry of the link is not chosen yet,\n // the arrow follows the mouse. To achieve that, update the coordinates of `entriesLinkInProgress`\n // on mousemove. There can only be one link in the process on being created so the mousemove\n // only needs to update `entriesLinkInProgress` link overlay.\n #entriesLinkInProgress: EntriesLink|null;\n\n #dimensions: ActiveDimensions = {\n trace: {\n visibleWindow: null,\n },\n charts: {\n main: null,\n network: null,\n },\n };\n\n /**\n * To calculate the Y pixel value for an event we need access to the chart\n * and data provider in order to find out what level the event is on, and from\n * there calculate the pixel value for that level.\n */\n #charts: TimelineCharts;\n\n /**\n * The Overlays class will take each overlay, generate its HTML, and add it\n * to the container. This container is provided for us when the class is\n * created so we can manage its contents as overlays come and go.\n */\n #overlaysContainer: HTMLElement;\n\n // Setting that specififed if the annotations overlays need to be visible.\n // It is switched on/off from the annotations tab in the sidebar.\n readonly #annotationsHiddenSetting: Common.Settings.Setting;\n\n /**\n * The OverlaysManager sometimes needs to find out if an entry is visible or\n * not, and if not, why not - for example, if the user has collapsed its\n * parent. We define these query functions that must be supplied in order to\n * answer these questions.\n */\n #queries: OverlayEntryQueries;\n\n constructor(init: {\n container: HTMLElement,\n flameChartsContainers: {\n main: HTMLElement,\n network: HTMLElement,\n },\n charts: TimelineCharts,\n entryQueries: OverlayEntryQueries,\n }) {\n super();\n this.#overlaysContainer = init.container;\n this.#charts = init.charts;\n this.#queries = init.entryQueries;\n this.#entriesLinkInProgress = null;\n this.#annotationsHiddenSetting = Common.Settings.Settings.instance().moduleSetting('annotations-hidden');\n this.#annotationsHiddenSetting.addChangeListener(this.update.bind(this));\n\n // HTMLElements of both Flamecharts. They are used to get the mouse position over the Flamecharts.\n init.flameChartsContainers.main.addEventListener(\n 'mousemove', event => this.#updateMouseCoordinatesProgressEntriesLink.bind(this)(event, 'main'));\n init.flameChartsContainers.network.addEventListener(\n 'mousemove', event => this.#updateMouseCoordinatesProgressEntriesLink.bind(this)(event, 'network'));\n }\n\n // Toggle display of the whole OverlaysContainer.\n // This function is used to hide all overlays when the Flamechart is in the 'reorder tracks' state.\n // If the tracks are being reordered, they are collapsed and we do not want to display\n // anything except the tracks reordering interface.\n //\n // Do not change individual overlays visibility with 'setOverlayElementVisibility' since we do not\n // want to overwrite the overlays visibility state that was set before entering the reordering state.\n toggleAllOverlaysDisplayed(allOverlaysDisplayed: boolean): void {\n this.#overlaysContainer.style.display = allOverlaysDisplayed ? 'block' : 'none';\n }\n\n // Mousemove event listener to get mouse coordinates and update them for the entries link that is being created.\n //\n // The 'mousemove' event is attached to `flameChartsContainers` instead of `overlaysContainer`\n // because `overlaysContainer` doesn't have events to enable the interaction with the\n // Flamecharts beneath it.\n #updateMouseCoordinatesProgressEntriesLink(event: Event, chart: EntryChartLocation): void {\n const mouseEvent = (event as MouseEvent);\n this.#lastMouseOffsetX = mouseEvent.offsetX;\n this.#lastMouseOffsetY = mouseEvent.offsetY;\n\n if (this.#entriesLinkInProgress?.state !== Trace.Types.File.EntriesLinkState.PENDING_TO_EVENT) {\n return;\n }\n\n // The Overlays layer coordinates cover both Network and Main Charts, while the mousemove\n // coordinates are received from the charts individually and start from 0 for each chart.\n //\n // To make it work on the overlays, we need to know which chart the entry belongs to and,\n // if it is on the main chart, add the height of the Network chart to get correct Entry\n // coordinates on the Overlays layer.\n const networkHeight = this.#dimensions.charts.network?.heightPixels ?? 0;\n const linkInProgressElement = this.#overlaysToElements.get(this.#entriesLinkInProgress);\n\n if (linkInProgressElement) {\n const component = linkInProgressElement.querySelector('devtools-entries-link-overlay') as\n Components.EntriesLinkOverlay.EntriesLinkOverlay;\n const yCoordinate = mouseEvent.offsetY + ((chart === 'main') ? networkHeight : 0);\n component.toEntryCoordinateAndDimentions = {x: mouseEvent.offsetX, y: yCoordinate};\n }\n }\n\n /**\n * Add a new overlay to the view.\n */\n add(newOverlay: T): T {\n if (this.#overlaysToElements.has(newOverlay)) {\n return newOverlay;\n }\n\n /**\n * If the overlay type is a singleton, and we already have one, we update\n * the existing one, rather than create a new one. This ensures you can only\n * ever have one instance of the overlay type.\n */\n const existing = this.overlaysOfType(newOverlay.type);\n if (overlayIsSingleton(newOverlay) && existing[0]) {\n this.updateExisting(existing[0], newOverlay);\n return existing[0];\n }\n\n // By setting the value to null, we ensure that on the next render that the\n // overlay will have a new HTML element created for it.\n this.#overlaysToElements.set(newOverlay, null);\n return newOverlay;\n }\n\n /**\n * Update an existing overlay without destroying and recreating its\n * associated DOM.\n *\n * This is useful if you need to rapidly update an overlay's data - e.g.\n * dragging to create time ranges - without the thrashing of destroying the\n * old overlay and re-creating the new one.\n */\n updateExisting(existingOverlay: T, newData: Partial): void {\n if (!this.#overlaysToElements.has(existingOverlay)) {\n console.error('Trying to update an overlay that does not exist.');\n return;\n }\n\n for (const [key, value] of Object.entries(newData)) {\n // newData is of type Partial, so each key must exist in T, but\n // Object.entries doesn't carry that information.\n const k = key as keyof T;\n existingOverlay[k] = value;\n }\n }\n\n enterLabelEditMode(overlay: EntryLabel): void {\n // Entry edit state can be triggered from outside the label component by clicking on the\n // Entry that already has a label. Instead of creating a new label, set the existing entry\n // label into an editable state.\n const element = this.#overlaysToElements.get(overlay);\n const component = element?.querySelector('devtools-entry-label-overlay');\n if (component) {\n component.setLabelEditabilityAndRemoveEmptyLabel(true);\n }\n }\n\n /**\n * @returns the list of overlays associated with a given entry.\n */\n overlaysForEntry(entry: OverlayEntry): TimelineOverlay[] {\n const matches: TimelineOverlay[] = [];\n for (const [overlay] of this.#overlaysToElements) {\n if ('entry' in overlay && overlay.entry === entry) {\n matches.push(overlay);\n }\n }\n return matches;\n }\n\n /**\n * Removes any active overlays that match the provided type.\n * @returns the number of overlays that were removed.\n */\n removeOverlaysOfType(type: TimelineOverlay['type']): number {\n const overlaysToRemove = Array.from(this.#overlaysToElements.keys()).filter(overlay => {\n return overlay.type === type;\n });\n for (const overlay of overlaysToRemove) {\n this.remove(overlay);\n }\n return overlaysToRemove.length;\n }\n\n /**\n * @returns all overlays that match the provided type.\n */\n overlaysOfType(type: T['type']): NoInfer[] {\n const matches: T[] = [];\n\n function overlayIsOfType(overlay: TimelineOverlay): overlay is T {\n return overlay.type === type;\n }\n\n for (const [overlay] of this.#overlaysToElements) {\n if (overlayIsOfType(overlay)) {\n matches.push(overlay);\n }\n }\n return matches;\n }\n\n /**\n * Removes the provided overlay from the list of overlays and destroys any\n * DOM associated with it.\n */\n remove(overlay: TimelineOverlay): void {\n const htmlElement = this.#overlaysToElements.get(overlay);\n if (htmlElement && this.#overlaysContainer) {\n this.#overlaysContainer.removeChild(htmlElement);\n }\n this.#overlaysToElements.delete(overlay);\n }\n\n /**\n * Update the dimenions of a chart.\n * IMPORTANT: this does not trigger a re-draw. You must call the render() method manually.\n */\n updateChartDimensions(chart: EntryChartLocation, dimensions: FlameChartDimensions): void {\n this.#dimensions.charts[chart] = dimensions;\n }\n\n /**\n * Update the visible window of the UI.\n * IMPORTANT: this does not trigger a re-draw. You must call the render() method manually.\n */\n updateVisibleWindow(visibleWindow: Trace.Types.Timing.TraceWindowMicroSeconds): void {\n this.#dimensions.trace.visibleWindow = visibleWindow;\n }\n\n /**\n * Clears all overlays and all data. Call this when the trace is changing\n * (e.g. the user has imported/recorded a new trace) and we need to start from\n * scratch and remove all overlays relating to the preivous trace.\n */\n reset(): void {\n if (this.#overlaysContainer) {\n this.#overlaysContainer.innerHTML = '';\n }\n this.#overlaysToElements.clear();\n\n // Clear out dimensions from the old Flame Charts.\n this.#dimensions.trace.visibleWindow = null;\n this.#dimensions.charts.main = null;\n this.#dimensions.charts.network = null;\n }\n\n /**\n * Updates the Overlays UI: new overlays will be rendered onto the view, and\n * existing overlays will have their positions changed to ensure they are\n * rendered in the right place.\n */\n async update(): Promise {\n const timeRangeOverlays: TimeRangeLabel[] = [];\n const timingsMarkerOverlays: TimingsMarker[] = [];\n\n for (const [overlay, existingElement] of this.#overlaysToElements) {\n const element = existingElement || this.#createElementForNewOverlay(overlay);\n if (!existingElement) {\n // This is a new overlay, so we have to store the element and add it to the DOM.\n this.#overlaysToElements.set(overlay, element);\n this.#overlaysContainer.appendChild(element);\n }\n\n // A chance to update the overlay before we re-position it. If an\n // overlay's data changed, this is where we can pass that data into the\n // overlay's component so it has the latest data.\n this.#updateOverlayBeforePositioning(overlay, element);\n\n // Now we position the overlay on the timeline.\n this.#positionOverlay(overlay, element);\n\n // And now we give every overlay a chance to react to its new position,\n // if it needs to\n this.#updateOverlayAfterPositioning(overlay, element);\n\n if (overlay.type === 'TIME_RANGE') {\n timeRangeOverlays.push(overlay);\n }\n if (overlay.type === 'TIMINGS_MARKER') {\n timingsMarkerOverlays.push(overlay);\n }\n }\n\n if (timeRangeOverlays.length > 1) { // If there are 0 or 1 overlays, they can't overlap\n this.#positionOverlappingTimeRangeLabels(timeRangeOverlays);\n }\n }\n\n /**\n * If any time-range overlays overlap, we try to adjust their horizontal\n * position in order to make sure you can distinguish them and that the labels\n * do not entirely overlap.\n * This is very much minimal best effort, and does not guarantee that all\n * labels will remain readable.\n */\n #positionOverlappingTimeRangeLabels(overlays: readonly TimeRangeLabel[]): void {\n const overlaysSorted = overlays.toSorted((o1, o2) => {\n return o1.bounds.min - o2.bounds.min;\n });\n\n // Track the overlays which overlap other overlays.\n // This isn't bi-directional: if we find that O2 overlaps O1, we will\n // store O1 => [O2]. We will not then also store O2 => [O1], because we\n // only need to deal with the overlap once.\n const overlapsByOverlay: Map = new Map();\n\n for (let i = 0; i < overlaysSorted.length; i++) {\n const current = overlaysSorted[i];\n const overlaps: TimeRangeLabel[] = [];\n\n // Walk through subsequent overlays and find stop when you find the next one that does not overlap.\n for (let j = i + 1; j < overlaysSorted.length; j++) {\n const next = overlaysSorted[j];\n const currentAndNextOverlap = Trace.Helpers.Timing.boundsIncludeTimeRange({\n bounds: current.bounds,\n timeRange: next.bounds,\n });\n if (currentAndNextOverlap) {\n overlaps.push(next);\n } else {\n // Overlays are sorted by time, if this one does not overlap, the next one will not, so we can break.\n break;\n }\n }\n overlapsByOverlay.set(current, overlaps);\n }\n for (const [firstOverlay, overlappingOverlays] of overlapsByOverlay) {\n const element = this.#overlaysToElements.get(firstOverlay);\n if (!element) {\n continue;\n }\n\n // If the first overlay is adjusted, we can start back from 0 again\n // rather than continually increment up.\n let firstIndexForOverlapClass = 1;\n if (element.getAttribute('class')?.includes('overlap-')) {\n firstIndexForOverlapClass = 0;\n }\n\n overlappingOverlays.forEach(overlay => {\n const element = this.#overlaysToElements.get(overlay);\n element?.classList.add(`overlap-${firstIndexForOverlapClass++}`);\n });\n }\n }\n\n #positionOverlay(overlay: TimelineOverlay, element: HTMLElement): void {\n const annotationsAreHidden = this.#annotationsHiddenSetting.get();\n switch (overlay.type) {\n case 'ENTRY_SELECTED': {\n const isVisible = this.entryIsVisibleOnChart(overlay.entry);\n this.#setOverlayElementVisibility(element, isVisible);\n if (isVisible) {\n this.#positionEntryBorderOutlineType(overlay.entry, element);\n }\n break;\n }\n case 'ENTRY_OUTLINE': {\n if (this.entryIsVisibleOnChart(overlay.entry)) {\n this.#setOverlayElementVisibility(element, true);\n this.#positionEntryBorderOutlineType(overlay.entry, element);\n } else {\n this.#setOverlayElementVisibility(element, false);\n }\n break;\n }\n\n case 'TIME_RANGE': {\n // The time range annotation can also be used to measure a selection in the timeline and is not saved if no label is added.\n // Therefore, we only care about the annotation hidden setting if the time range has a label.\n if (overlay.label.length) {\n this.#setOverlayElementVisibility(element, !annotationsAreHidden);\n }\n this.#positionTimeRangeOverlay(overlay, element);\n break;\n }\n case 'ENTRY_LABEL': {\n const entryVisible = this.entryIsVisibleOnChart(overlay.entry);\n this.#setOverlayElementVisibility(element, entryVisible && !annotationsAreHidden);\n if (entryVisible) {\n const entryLabelVisibleHeight = this.#positionEntryLabelOverlay(overlay, element);\n const component = element.querySelector('devtools-entry-label-overlay');\n if (component && entryLabelVisibleHeight) {\n component.entryLabelVisibleHeight = entryLabelVisibleHeight;\n }\n }\n break;\n }\n case 'ENTRIES_LINK': {\n // The exact entries that are linked to could be collapsed in a flame\n // chart, so we figure out the best visible entry pairs to draw\n // between.\n const entriesToConnect = this.#calculateFromAndToForEntriesLink(overlay);\n const isVisible = entriesToConnect !== null && !annotationsAreHidden;\n this.#setOverlayElementVisibility(element, isVisible);\n\n if (isVisible) {\n this.#positionEntriesLinkOverlay(overlay, element, entriesToConnect);\n }\n break;\n }\n case 'TIMESPAN_BREAKDOWN': {\n this.#positionTimespanBreakdownOverlay(overlay, element);\n // TODO: Have the timespan squeeze instead.\n if (overlay.entry) {\n const {visibleWindow} = this.#dimensions.trace;\n const isVisible = Boolean(\n visibleWindow && this.#entryIsVerticallyVisibleOnChart(overlay.entry) &&\n Trace.Helpers.Timing.boundsIncludeTimeRange({\n bounds: visibleWindow,\n timeRange: overlay.sections[0].bounds,\n }),\n );\n this.#setOverlayElementVisibility(element, isVisible);\n }\n break;\n }\n\n case 'TIMESTAMP_MARKER': {\n const {visibleWindow} = this.#dimensions.trace;\n // Only update the position if the timestamp of this marker is within\n // the visible bounds.\n const isVisible =\n Boolean(visibleWindow && Trace.Helpers.Timing.timestampIsInBounds(visibleWindow, overlay.timestamp));\n this.#setOverlayElementVisibility(element, isVisible);\n if (isVisible) {\n this.#positionTimingOverlay(overlay, element);\n }\n break;\n }\n\n case 'CANDY_STRIPED_TIME_RANGE': {\n const {visibleWindow} = this.#dimensions.trace;\n // If the bounds of this overlay are not within the visible bounds, we\n // can skip updating its position and just hide it.\n\n const isVisible = Boolean(\n visibleWindow && this.#entryIsVerticallyVisibleOnChart(overlay.entry) &&\n Trace.Helpers.Timing.boundsIncludeTimeRange({\n bounds: visibleWindow,\n timeRange: overlay.bounds,\n }));\n this.#setOverlayElementVisibility(element, isVisible);\n if (isVisible) {\n this.#positionCandyStripedTimeRange(overlay, element);\n }\n break;\n }\n\n case 'TIMINGS_MARKER': {\n const {visibleWindow} = this.#dimensions.trace;\n // All the entries have the same ts, so can use the first.\n const isVisible = Boolean(visibleWindow && this.#entryIsHorizontallyVisibleOnChart(overlay.entries[0]));\n this.#setOverlayElementVisibility(element, isVisible);\n if (isVisible) {\n this.#positionTimingOverlay(overlay, element);\n }\n break;\n }\n\n default: {\n Platform.TypeScriptUtilities.assertNever(overlay, `Unknown overlay: ${JSON.stringify(overlay)}`);\n }\n }\n }\n\n #positionTimingOverlay(overlay: TimestampMarker|TimingsMarker, element: HTMLElement): void {\n let left;\n switch (overlay.type) {\n case 'TIMINGS_MARKER': {\n // All the entries have the same ts, so can use the first.\n const timings = Trace.Helpers.Timing.eventTimingsMicroSeconds(overlay.entries[0]);\n left = this.#xPixelForMicroSeconds('main', timings.startTime);\n break;\n }\n case 'TIMESTAMP_MARKER': {\n // Because we are adjusting the x position, we can use either chart here.\n left = this.#xPixelForMicroSeconds('main', overlay.timestamp);\n break;\n }\n }\n element.style.left = `${left}px`;\n }\n\n #positionTimespanBreakdownOverlay(overlay: TimespanBreakdown, element: HTMLElement): void {\n if (overlay.sections.length === 0) {\n return;\n }\n\n const component = element.querySelector('devtools-timespan-breakdown-overlay');\n const elementSections = component?.renderedSections() ?? [];\n\n // Handle horizontal positioning.\n const leftEdgePixel = this.#xPixelForMicroSeconds('main', overlay.sections[0].bounds.min);\n const rightEdgePixel =\n this.#xPixelForMicroSeconds('main', overlay.sections[overlay.sections.length - 1].bounds.max);\n if (leftEdgePixel === null || rightEdgePixel === null) {\n return;\n }\n\n const rangeWidth = rightEdgePixel - leftEdgePixel;\n element.style.left = `${leftEdgePixel}px`;\n element.style.width = `${rangeWidth}px`;\n\n if (elementSections.length === 0) {\n return;\n }\n\n let count = 0;\n for (const section of overlay.sections) {\n const leftPixel = this.#xPixelForMicroSeconds('main', section.bounds.min);\n const rightPixel = this.#xPixelForMicroSeconds('main', section.bounds.max);\n if (leftPixel === null || rightPixel === null) {\n return;\n }\n const rangeWidth = rightPixel - leftPixel;\n const sectionElement = elementSections[count];\n\n sectionElement.style.left = `${leftPixel}px`;\n sectionElement.style.width = `${rangeWidth}px`;\n count++;\n }\n\n // Handle vertical positioning based on the entry's vertical position.\n if (overlay.entry && (overlay.renderLocation === 'BELOW_EVENT' || overlay.renderLocation === 'ABOVE_EVENT')) {\n // Max height for the overlay box when attached to an entry.\n const MAX_BOX_HEIGHT = 50;\n element.style.maxHeight = `${MAX_BOX_HEIGHT}px`;\n\n const y = this.yPixelForEventOnChart(overlay.entry);\n if (y === null) {\n return;\n }\n const eventHeight = this.pixelHeightForEventOnChart(overlay.entry);\n if (eventHeight === null) {\n return;\n }\n\n if (overlay.renderLocation === 'BELOW_EVENT') {\n const top = y + eventHeight;\n element.style.top = `${top}px`;\n } else {\n // Some padding so the box hovers just on top.\n const PADDING = 7;\n\n // Where the timespan breakdown should sit. Slightly on top of the entry.\n const bottom = y - PADDING;\n\n // Available space between the bottom of the overlay and top of the chart.\n const minSpace = Math.max(bottom, 0);\n // Contrain height to available space.\n const height = Math.min(MAX_BOX_HEIGHT, minSpace);\n\n const top = bottom - height;\n element.style.top = `${top}px`;\n }\n }\n }\n\n /**\n * Positions the arrow between two entries. Takes in the entriesToConnect\n * because if one of the original entries is hidden in a collapsed main thread\n * icicle, we use its parent to connect to.\n */\n #positionEntriesLinkOverlay(overlay: EntriesLink, element: HTMLElement, entriesToConnect: EntriesLinkVisibleEntries):\n void {\n const component = element.querySelector('devtools-entries-link-overlay');\n\n if (component) {\n const fromEntryInCollapsedTrack = this.#entryIsInCollapsedTrack(entriesToConnect.entryFrom);\n const toEntryInCollapsedTrack =\n entriesToConnect.entryTo && this.#entryIsInCollapsedTrack(entriesToConnect.entryTo);\n\n const bothEntriesInCollapsedTrack = Boolean(fromEntryInCollapsedTrack && toEntryInCollapsedTrack);\n // If both entries are in collapsed tracks, we hide the overlay completely.\n if (bothEntriesInCollapsedTrack) {\n this.#setOverlayElementVisibility(element, false);\n return;\n }\n\n // If either entry (but not both) is in a track that the user has collapsed, we do not\n // show the connection at all, but we still show the borders around\n // the entry. So in this case we mark the overlay as visible, but\n // tell it to not draw the arrow.\n const hideArrow = Boolean(fromEntryInCollapsedTrack || toEntryInCollapsedTrack);\n component.hideArrow = hideArrow;\n\n const {entryFrom, entryTo, entryFromIsSource, entryToIsSource} = entriesToConnect;\n const entryFromWrapper = component.entryFromWrapper();\n\n // Should not happen, the 'from' wrapper should always exist. Something went wrong, return in this case.\n if (!entryFromWrapper) {\n return;\n }\n\n const entryFromVisibility = this.entryIsVisibleOnChart(entryFrom) && !fromEntryInCollapsedTrack;\n const entryToVisibility = entryTo ? this.entryIsVisibleOnChart(entryTo) && !toEntryInCollapsedTrack : false;\n\n // If the entry is not currently visible, draw the arrow to the edge of the screen towards the entry on the Y-axis.\n let fromEntryX = 0;\n let fromEntryY = this.#yCoordinateForNotVisibleEntry(entryFrom);\n\n // If the entry is visible, draw the arrow to the entry.\n if (entryFromVisibility) {\n const fromEntryParams = this.#positionEntryBorderOutlineType(entriesToConnect.entryFrom, entryFromWrapper);\n if (fromEntryParams) {\n const fromEntryHeight = fromEntryParams?.entryHeight;\n const fromEntryWidth = fromEntryParams?.entryWidth;\n const fromCutOffHeight = fromEntryParams?.cutOffHeight;\n fromEntryX = fromEntryParams?.x;\n fromEntryY = fromEntryParams?.y;\n\n component.fromEntryCoordinateAndDimentions =\n {x: fromEntryX, y: fromEntryY, length: fromEntryWidth, height: fromEntryHeight - fromCutOffHeight};\n } else {\n // Something went if the entry is visible and we cannot get its' parameters.\n return;\n }\n }\n\n // If `fromEntry` is not visible and the link creation is not started yet, meaning that\n // only the button to create the link is displayed, delete the whole overlay.\n if (!entryFromVisibility && overlay.state === Trace.Types.File.EntriesLinkState.CREATION_NOT_STARTED) {\n this.dispatchEvent(new AnnotationOverlayActionEvent(overlay, 'Remove'));\n }\n\n // If entryTo exists, pass the coordinates and dimentions of the entry that the arrow snaps to.\n // If it does not, the event tracking mouse coordinates updates 'to coordinates' so the arrow follows the mouse instead.\n const entryToWrapper = component.entryToWrapper();\n\n if (entryTo && entryToWrapper) {\n let toEntryX = 0;\n // If the 'to' entry is visible, set the entry Y as an arrow coordinate to point to. If not, get the canvas edge coordate to point the arrow to.\n let toEntryY = this.#yCoordinateForNotVisibleEntry(entryTo);\n\n if (entryToVisibility) {\n const toEntryParams = this.#positionEntryBorderOutlineType(entryTo, entryToWrapper);\n\n if (toEntryParams) {\n const toEntryHeight = toEntryParams?.entryHeight;\n const toEntryWidth = toEntryParams?.entryWidth;\n const toCutOffHeight = toEntryParams?.cutOffHeight;\n toEntryX = toEntryParams?.x;\n toEntryY = toEntryParams?.y;\n\n component.toEntryCoordinateAndDimentions = {\n x: toEntryX,\n y: toEntryY,\n length: toEntryWidth,\n height: toEntryHeight - toCutOffHeight,\n };\n } else {\n // Something went if the entry is visible and we cannot get its' parameters.\n return;\n }\n }\n\n } else if (this.#lastMouseOffsetX && this.#lastMouseOffsetY) {\n // The second coordinate for in progress link gets updated on mousemove\n this.#entriesLinkInProgress = overlay;\n }\n\n component.fromEntryIsSource = entryFromIsSource;\n component.toEntryIsSource = entryToIsSource;\n component.entriesVisibility = {\n fromEntryVisibility: entryFromVisibility,\n toEntryVisibility: entryToVisibility,\n };\n }\n }\n\n /**\n * Return Y coordinate for an arrow connecting 2 entries to attach to if the entry is not visible.\n * For example, if the entry is scrolled up from the visible area , return the y index of the edge of the track:\n * --\n * | | - entry off the visible chart\n * --\n *\n * --Y--------------- -- Y is the returned coordinate that the arrow should point to\n *\n * flamechart data -- visible flamechart data between the 2 lines\n * ------------------\n *\n * On the contrary, if the entry is scrolled off the bottom, get the coordinate of the top of the visible canvas.\n */\n #yCoordinateForNotVisibleEntry(entry: OverlayEntry): number {\n const chartName = chartForEntry(entry);\n\n const y = this.yPixelForEventOnChart(entry);\n if (y === null) {\n return 0;\n }\n\n if (chartName === 'main') {\n if (!this.#dimensions.charts.main?.heightPixels) {\n // Shouldn't happen, but if the main chart has no height, nothing on it is visible.\n return 0;\n }\n\n const yWithoutNetwork = y - this.networkChartOffsetHeight();\n // Check if the y position is less than 0. If it, the entry is off the top of the track canvas.\n // In that case, return the height of network track, which is also the top of main track.\n if (yWithoutNetwork < 0) {\n return this.networkChartOffsetHeight();\n }\n }\n\n if (chartName === 'network') {\n if (!this.#dimensions.charts.network) {\n return 0;\n }\n\n // The event is off the bottom of the network chart. In this case return the bottom of the network chart.\n if (y > this.#dimensions.charts.network.heightPixels) {\n return this.#dimensions.charts.network.heightPixels;\n }\n }\n\n // In other cases, return the y of the entry\n return y;\n }\n\n #positionTimeRangeOverlay(overlay: TimeRangeLabel, element: HTMLElement): void {\n // Time ranges span both charts, it doesn't matter which one we pass here.\n // It's used to get the width of the container, and both charts have the\n // same width.\n const leftEdgePixel = this.#xPixelForMicroSeconds('main', overlay.bounds.min);\n const rightEdgePixel = this.#xPixelForMicroSeconds('main', overlay.bounds.max);\n if (leftEdgePixel === null || rightEdgePixel === null) {\n return;\n }\n\n const rangeWidth = rightEdgePixel - leftEdgePixel;\n\n element.style.left = `${leftEdgePixel}px`;\n element.style.width = `${rangeWidth}px`;\n }\n\n /**\n * Positions an EntryLabel overlay\n * @param overlay - the EntrySelected overlay that we need to position.\n * @param element - the DOM element representing the overlay\n */\n #positionEntryLabelOverlay(overlay: EntryLabel, element: HTMLElement): number|null {\n // Because the entry outline is a common Overlay pattern, get the wrapper of the entry\n // that comes with the EntryLabel Overlay and pass it into the `positionEntryBorderOutlineType`\n // to draw and position it. The other parts of EntryLabel are drawn by the `EntryLabelOverlay` class.\n const component = element.querySelector('devtools-entry-label-overlay');\n if (!component) {\n return null;\n }\n const entryWrapper = component.entryHighlightWrapper();\n\n if (!entryWrapper) {\n return null;\n }\n\n const {entryHeight, entryWidth, cutOffHeight = 0, x, y} =\n this.#positionEntryBorderOutlineType(overlay.entry, entryWrapper) || {};\n\n if (!entryHeight || !entryWidth || x === null || !y) {\n return null;\n }\n\n // Position the start of label overlay at the start of the entry + length of connector + legth of the label element\n element.style.top = `${y - Components.EntryLabelOverlay.EntryLabelOverlay.LABEL_AND_CONNECTOR_HEIGHT}px`;\n element.style.left = `${x}px`;\n element.style.width = `${entryWidth}px`;\n\n return entryHeight - cutOffHeight;\n }\n\n #positionCandyStripedTimeRange(overlay: CandyStripedTimeRange, element: HTMLElement): void {\n const chartName = chartForEntry(overlay.entry);\n\n const startX = this.#xPixelForMicroSeconds(chartName, overlay.bounds.min);\n const endX = this.#xPixelForMicroSeconds(chartName, overlay.bounds.max);\n if (startX === null || endX === null) {\n return;\n }\n\n const widthPixels = endX - startX;\n // The entry selected overlay is always at least 2px wide.\n const finalWidth = Math.max(2, widthPixels);\n element.style.width = `${finalWidth}px`;\n element.style.left = `${startX}px`;\n\n let y = this.yPixelForEventOnChart(overlay.entry);\n if (y === null) {\n return;\n }\n\n const totalHeight = this.pixelHeightForEventOnChart(overlay.entry) ?? 0;\n\n // We might modify the height we use when drawing the overlay, hence copying the totalHeight.\n let height = totalHeight;\n if (height === null) {\n return;\n }\n\n // If the event is on the main chart, we need to adjust its selected border\n // if the event is cut off the top of the screen, because we need to ensure\n // that it does not overlap the resize element. Unfortunately we cannot\n // z-index our way out of this, so instead we calculate if the event is cut\n // off, and if it is, we draw the partial selected outline and do not draw\n // the top border, making it appear like it is going behind the resizer.\n // We don't need to worry about it going off the bottom, because in that\n // case we don't draw the overlay anyway.\n if (chartName === 'main') {\n const chartTopPadding = this.networkChartOffsetHeight();\n // We now calculate the available height: if the entry is cut off we don't\n // show the border for the part that is cut off.\n const cutOffTop = y < chartTopPadding;\n\n height = cutOffTop ? Math.abs(y + height - chartTopPadding) : height;\n element.classList.toggle('cut-off-top', cutOffTop);\n if (cutOffTop) {\n // Adjust the y position: we need to move it down from the top Y\n // position to the Y position of the first visible pixel. The\n // adjustment is totalHeight - height because if the totalHeight is 17,\n // and the visibleHeight is 5, we need to draw the overay at 17-5=12px\n // vertically from the top of the event.\n y = y + totalHeight - height;\n }\n } else {\n // If the event is on the network chart, we use the same logic as above\n // for the main chart, but to check if the event is cut off the bottom of\n // the network track and only part of the overlay is visible.\n // We don't need to worry about the event going off the top of the panel\n // as we can show the full overlay and it gets cut off by the minimap UI.\n const networkHeight = this.#dimensions.charts.network?.heightPixels ?? 0;\n const lastVisibleY = y + totalHeight;\n const cutOffBottom = lastVisibleY > networkHeight;\n const cutOffTop = y > networkHeight;\n element.classList.toggle('cut-off-top', cutOffTop);\n element.classList.toggle('cut-off-bottom', cutOffBottom);\n if (cutOffBottom) {\n // Adjust the height of the overlay to be the amount of visible pixels.\n height = networkHeight - y;\n }\n }\n\n element.style.height = `${height}px`;\n element.style.top = `${y}px`;\n }\n\n /**\n * Draw and position borders around an entry. Multiple overlays either fully consist\n * of a border around an entry of have an entry border as a part of the overlay.\n * Positions an EntrySelected or EntryOutline overlay and a part of the EntryLabel.\n * @param overlay - the EntrySelected/EntryOutline/EntryLabel overlay that we need to position.\n * @param element - the DOM element representing the overlay\n */\n #positionEntryBorderOutlineType(entry: OverlayEntry, element: HTMLElement):\n {entryHeight: number, entryWidth: number, cutOffHeight: number, x: number, y: number}|null {\n const chartName = chartForEntry(entry);\n let x = this.xPixelForEventStartOnChart(entry);\n let y = this.yPixelForEventOnChart(entry);\n const chartWidth = (chartName === 'main') ? this.#dimensions.charts.main?.widthPixels :\n this.#dimensions.charts.network?.widthPixels;\n\n if (x === null || y === null || !chartWidth) {\n return null;\n }\n\n const {endTime} = timingsForOverlayEntry(entry);\n const endX = this.#xPixelForMicroSeconds(chartName, endTime);\n if (endX === null) {\n return null;\n }\n\n const totalHeight = this.pixelHeightForEventOnChart(entry) ?? 0;\n\n // We might modify the height we use when drawing the overlay, hence copying the totalHeight.\n let height = totalHeight;\n if (height === null) {\n return null;\n }\n\n // The width of the overlay is by default the width of the entry. However\n // we modify that for instant events like LCP markers, and also ensure a\n // minimum width.\n let widthPixels = endX - x;\n\n const provider = chartName === 'main' ? this.#charts.mainProvider : this.#charts.networkProvider;\n const chart = chartName === 'main' ? this.#charts.mainChart : this.#charts.networkChart;\n const index = provider.indexForEvent?.(entry);\n const customPos = chart.getCustomDrawnPositionForEntryIndex(index ?? -1);\n if (customPos) {\n // Some events like markers and layout shifts define their exact coordinates explicitly.\n // If this is one of those events we should change the overlay coordinates to match.\n x = customPos.x;\n widthPixels = customPos.width;\n }\n\n // Calculate the visible overlay width by substracting the entry width that is outside of the flamechart width\n const cutOffRight = (x + widthPixels > chartWidth) ? (x + widthPixels) - chartWidth : null;\n const cutOffLeft = (x < 0) ? Math.abs(x) : null;\n element.classList.toggle('cut-off-right', cutOffRight !== null);\n\n if (cutOffRight) {\n widthPixels = widthPixels - cutOffRight;\n }\n\n if (cutOffLeft) {\n // If the entry is cut off from the left, move its beginning to the left most part of the flamechart\n x = 0;\n widthPixels = widthPixels - cutOffLeft;\n }\n\n // The entry selected overlay is always at least 2px wide.\n const finalWidth = Math.max(2, widthPixels);\n element.style.width = `${finalWidth}px`;\n\n // If the event is on the main chart, we need to adjust its selected border\n // if the event is cut off the top of the screen, because we need to ensure\n // that it does not overlap the resize element. Unfortunately we cannot\n // z-index our way out of this, so instead we calculate if the event is cut\n // off, and if it is, we draw the partial selected outline and do not draw\n // the top border, making it appear like it is going behind the resizer.\n // We don't need to worry about it going off the bottom, because in that\n // case we don't draw the overlay anyway.\n if (chartName === 'main') {\n const chartTopPadding = this.networkChartOffsetHeight();\n // We now calculate the available height: if the entry is cut off we don't\n // show the border for the part that is cut off.\n const cutOffTop = y < chartTopPadding;\n\n height = cutOffTop ? Math.abs(y + height - chartTopPadding) : height;\n element.classList.toggle('cut-off-top', cutOffTop);\n if (cutOffTop) {\n // Adjust the y position: we need to move it down from the top Y\n // position to the Y position of the first visible pixel. The\n // adjustment is totalHeight - height because if the totalHeight is 17,\n // and the visibleHeight is 5, we need to draw the overay at 17-5=12px\n // vertically from the top of the event.\n y = y + totalHeight - height;\n }\n } else {\n // If the event is on the network chart, we use the same logic as above\n // for the main chart, but to check if the event is cut off the bottom of\n // the network track and only part of the overlay is visible.\n // We don't need to worry about the even going off the top of the panel\n // as we can show the full overlay and it gets cut off by the minimap UI.\n const networkHeight = this.#dimensions.charts.network?.heightPixels ?? 0;\n const lastVisibleY = y + totalHeight;\n const cutOffBottom = lastVisibleY > networkHeight;\n element.classList.toggle('cut-off-bottom', cutOffBottom);\n if (cutOffBottom) {\n // Adjust the height of the overlay to be the amount of visible pixels.\n height = networkHeight - y;\n }\n }\n\n element.style.height = `${height}px`;\n element.style.top = `${y}px`;\n element.style.left = `${x}px`;\n\n return {entryHeight: totalHeight, entryWidth: finalWidth, cutOffHeight: totalHeight - height, x, y};\n }\n\n /**\n * We draw an arrow between connected entries but this can get complicated\n * depending on if the entries are visible or not. For example, the user might\n * draw a connection to an entry in the main thread but then collapse the\n * parent of that entry. In this case the entry we want to draw to is the\n * first visible parent of that entry rather than the (invisible) entry.\n */\n #calculateFromAndToForEntriesLink(overlay: EntriesLink): EntriesLinkVisibleEntries|null {\n if (!overlay.entryTo) {\n // This case is where the user has clicked on the first entry and needs\n // to pick a second. In this case they can only pick from visible\n // entries, so we don't need to do any checks and can just return.\n return {\n entryFrom: overlay.entryFrom,\n entryTo: overlay.entryTo,\n entryFromIsSource: true,\n entryToIsSource: true,\n };\n }\n\n let entryFrom: OverlayEntry|null = overlay.entryFrom;\n let entryTo: OverlayEntry|null = overlay.entryTo ?? null;\n\n if (this.#queries.isEntryCollapsedByUser(overlay.entryFrom)) {\n entryFrom = this.#queries.firstVisibleParentForEntry(overlay.entryFrom);\n }\n if (overlay.entryTo && this.#queries.isEntryCollapsedByUser(overlay.entryTo)) {\n entryTo = this.#queries.firstVisibleParentForEntry(overlay.entryTo);\n }\n\n if (entryFrom === null || entryTo === null) {\n // We cannot draw this overlay; so return null;\n // The only valid case of entryTo being null/undefined has been dealt\n // with already at the start of this function.\n return null;\n }\n\n return {\n entryFrom,\n entryFromIsSource: entryFrom === overlay.entryFrom,\n entryTo,\n entryToIsSource: entryTo === overlay.entryTo,\n };\n }\n\n #createElementForNewOverlay(overlay: TimelineOverlay): HTMLElement {\n const div = document.createElement('div');\n div.classList.add('overlay-item', `overlay-type-${overlay.type}`);\n\n const jslogContext = jsLogContext(overlay);\n if (jslogContext) {\n div.setAttribute('jslog', `${VisualLogging.item(jslogContext)}`);\n }\n\n switch (overlay.type) {\n case 'ENTRY_LABEL': {\n const shouldDrawLabelBelowEntry = Trace.Types.Events.isLegacyTimelineFrame(overlay.entry);\n const component = new Components.EntryLabelOverlay.EntryLabelOverlay(overlay.label, shouldDrawLabelBelowEntry);\n component.addEventListener(Components.EntryLabelOverlay.EmptyEntryLabelRemoveEvent.eventName, () => {\n this.dispatchEvent(new AnnotationOverlayActionEvent(overlay, 'Remove'));\n });\n component.addEventListener(Components.EntryLabelOverlay.EntryLabelChangeEvent.eventName, event => {\n const newLabel = (event as Components.EntryLabelOverlay.EntryLabelChangeEvent).newLabel;\n overlay.label = newLabel;\n this.dispatchEvent(new AnnotationOverlayActionEvent(overlay, 'Update'));\n });\n div.appendChild(component);\n return div;\n }\n case 'ENTRIES_LINK': {\n const entries = this.#calculateFromAndToForEntriesLink(overlay);\n if (entries === null) {\n // For some reason, we don't have two entries we can draw between\n // (can happen if the user has collapsed an icicle in the flame\n // chart, or a track), so just draw an empty div.\n return div;\n }\n const entryEndX = this.xPixelForEventEndOnChart(entries.entryFrom) ?? 0;\n const entryStartX = this.xPixelForEventEndOnChart(entries.entryFrom) ?? 0;\n const entryStartY = (this.yPixelForEventOnChart(entries.entryFrom) ?? 0);\n const entryWidth = entryEndX - entryStartX;\n const entryHeight = this.pixelHeightForEventOnChart(entries.entryFrom) ?? 0;\n\n const component = new Components.EntriesLinkOverlay.EntriesLinkOverlay(\n {x: entryEndX, y: entryStartY, width: entryWidth, height: entryHeight}, overlay.state);\n\n component.addEventListener(Components.EntriesLinkOverlay.EntryLinkStartCreating.eventName, () => {\n overlay.state = Trace.Types.File.EntriesLinkState.PENDING_TO_EVENT;\n this.dispatchEvent(new AnnotationOverlayActionEvent(overlay, 'Update'));\n });\n div.appendChild(component);\n return div;\n }\n case 'ENTRY_OUTLINE': {\n div.classList.add(`outline-reason-${overlay.outlineReason}`);\n return div;\n }\n case 'TIME_RANGE': {\n const component = new Components.TimeRangeOverlay.TimeRangeOverlay(overlay.label);\n component.duration = overlay.showDuration ? overlay.bounds.range : null;\n component.canvasRect = this.#charts.mainChart.canvasBoundingClientRect();\n component.addEventListener(Components.TimeRangeOverlay.TimeRangeLabelChangeEvent.eventName, event => {\n const newLabel = (event as Components.TimeRangeOverlay.TimeRangeLabelChangeEvent).newLabel;\n overlay.label = newLabel;\n this.dispatchEvent(new AnnotationOverlayActionEvent(overlay, 'Update'));\n });\n component.addEventListener(Components.TimeRangeOverlay.TimeRangeRemoveEvent.eventName, () => {\n this.dispatchEvent(new AnnotationOverlayActionEvent(overlay, 'Remove'));\n });\n component.addEventListener('mouseover', () => {\n this.dispatchEvent(new TimeRangeMouseOverEvent(overlay));\n });\n component.addEventListener('mouseout', () => {\n this.dispatchEvent(new TimeRangeMouseOutEvent());\n });\n div.appendChild(component);\n return div;\n }\n case 'TIMESPAN_BREAKDOWN': {\n const component = new Components.TimespanBreakdownOverlay.TimespanBreakdownOverlay();\n component.sections = overlay.sections;\n component.canvasRect = this.#charts.mainChart.canvasBoundingClientRect();\n component.isBelowEntry = overlay.renderLocation === 'BELOW_EVENT';\n div.appendChild(component);\n return div;\n }\n case 'TIMINGS_MARKER': {\n const {color} = EntryStyles.markerDetailsForEvent(overlay.entries[0]);\n const markersComponent = this.#createTimingsMarkerElement(overlay);\n div.appendChild(markersComponent);\n div.style.backgroundColor = color;\n return div;\n }\n default: {\n return div;\n }\n }\n }\n\n #clickEvent(event: Trace.Types.Events.Event): void {\n this.dispatchEvent(new EventReferenceClick(event));\n }\n\n #createOverlayPopover(adjustedTimestamp: Trace.Types.Timing.MicroSeconds, name: string): HTMLElement {\n const popoverElement = document.createElement('div');\n const popoverContents = popoverElement.createChild('div', 'overlay-popover');\n popoverContents.createChild('span', 'overlay-popover-time').textContent =\n i18n.TimeUtilities.formatMicroSecondsTime(adjustedTimestamp);\n popoverContents.createChild('span', 'overlay-popover-title').textContent = name;\n return popoverElement;\n }\n\n #mouseMoveOverlay(event: MouseEvent, name: string, overlay: TimingsMarker, markers: HTMLElement, marker: HTMLElement):\n void {\n const popoverElement = this.#createOverlayPopover(overlay.adjustedTimestamp, name);\n this.#lastMouseOffsetX = event.offsetX + (markers.offsetLeft || 0) + (marker.offsetLeft || 0);\n this.#lastMouseOffsetY = event.offsetY + markers.offsetTop || 0;\n this.#charts.mainChart.updateMouseOffset(this.#lastMouseOffsetX, this.#lastMouseOffsetY);\n this.#charts.mainChart.updatePopoverContents(popoverElement);\n }\n\n #mouseOutOverlay(): void {\n this.#lastMouseOffsetX = -1;\n this.#lastMouseOffsetY = -1;\n this.#charts.mainChart.updateMouseOffset(this.#lastMouseOffsetX, this.#lastMouseOffsetY);\n this.#charts.mainChart.hideHighlight();\n }\n\n #createTimingsMarkerElement(overlay: TimingsMarker): HTMLElement {\n const markers = document.createElement('div');\n markers.classList.add('markers');\n for (const entry of overlay.entries) {\n const {color, title} = EntryStyles.markerDetailsForEvent(entry);\n const marker = document.createElement('div');\n marker.classList.add('marker-title');\n marker.textContent = title;\n marker.style.backgroundColor = color;\n markers.appendChild(marker);\n\n marker.addEventListener('click', () => this.#clickEvent(entry));\n // Popover.\n marker.addEventListener('mousemove', event => this.#mouseMoveOverlay(event, title, overlay, markers, marker));\n marker.addEventListener('mouseout', () => this.#mouseOutOverlay());\n }\n return markers;\n }\n\n /**\n * Some overlays store data in their components that needs to be updated\n * before we position an overlay. Else, we might position an overlay based on\n * stale data. This method is used to update an overlay BEFORE it is then\n * positioned onto the canvas. It is the right place to ensure an overlay has\n * the latest data it needs.\n */\n #updateOverlayBeforePositioning(overlay: TimelineOverlay, element: HTMLElement): void {\n switch (overlay.type) {\n case 'ENTRY_SELECTED':\n break;\n case 'TIME_RANGE': {\n const component = element.querySelector('devtools-time-range-overlay');\n if (component) {\n component.duration = overlay.showDuration ? overlay.bounds.range : null;\n component.canvasRect = this.#charts.mainChart.canvasBoundingClientRect();\n }\n break;\n }\n case 'ENTRY_LABEL':\n case 'ENTRY_OUTLINE':\n case 'ENTRIES_LINK': {\n const component = element.querySelector('devtools-entries-link-overlay');\n if (component) {\n component.canvasRect = this.#charts.mainChart.canvasBoundingClientRect();\n }\n break;\n }\n case 'TIMESPAN_BREAKDOWN': {\n const component = element.querySelector('devtools-timespan-breakdown-overlay');\n if (component) {\n component.sections = overlay.sections;\n component.canvasRect = this.#charts.mainChart.canvasBoundingClientRect();\n }\n break;\n }\n case 'TIMESTAMP_MARKER':\n break;\n case 'CANDY_STRIPED_TIME_RANGE':\n break;\n case 'TIMINGS_MARKER':\n break;\n default:\n Platform.TypeScriptUtilities.assertNever(overlay, `Unexpected overlay ${overlay}`);\n }\n }\n /**\n * Some overlays have custom logic within them to manage visibility of\n * labels/etc that can be impacted if the positioning or size of the overlay\n * has changed. This method can be used to run code after an overlay has\n * been updated + repositioned on the timeline.\n */\n #updateOverlayAfterPositioning(overlay: TimelineOverlay, element: HTMLElement): void {\n switch (overlay.type) {\n case 'ENTRY_SELECTED':\n break;\n case 'TIME_RANGE': {\n const component = element.querySelector('devtools-time-range-overlay');\n component?.updateLabelPositioning();\n break;\n }\n case 'ENTRY_LABEL':\n break;\n case 'ENTRY_OUTLINE':\n break;\n case 'ENTRIES_LINK':\n break;\n case 'TIMESPAN_BREAKDOWN': {\n const component = element.querySelector('devtools-timespan-breakdown-overlay');\n component?.checkSectionLabelPositioning();\n break;\n }\n case 'TIMESTAMP_MARKER':\n break;\n case 'CANDY_STRIPED_TIME_RANGE':\n break;\n case 'TIMINGS_MARKER':\n break;\n default:\n Platform.TypeScriptUtilities.assertNever(overlay, `Unexpected overlay ${overlay}`);\n }\n }\n\n /**\n * @returns true if the entry is visible on chart, which means that both\n * horizontally and vertically it is at least partially in view.\n */\n entryIsVisibleOnChart(entry: OverlayEntry): boolean {\n const verticallyVisible = this.#entryIsVerticallyVisibleOnChart(entry);\n const horiziontallyVisible = this.#entryIsHorizontallyVisibleOnChart(entry);\n return verticallyVisible && horiziontallyVisible;\n }\n\n /**\n * Calculates if an entry is visible horizontally. This is easy because we\n * don't have to consider any pixels and can instead check that its start and\n * end times intersect with the visible window.\n */\n #entryIsHorizontallyVisibleOnChart(entry: OverlayEntry): boolean {\n if (this.#dimensions.trace.visibleWindow === null) {\n return false;\n }\n const {startTime, endTime} = timingsForOverlayEntry(entry);\n\n const entryTimeRange = Trace.Helpers.Timing.traceWindowFromMicroSeconds(startTime, endTime);\n\n return Trace.Helpers.Timing.boundsIncludeTimeRange({\n bounds: this.#dimensions.trace.visibleWindow,\n timeRange: entryTimeRange,\n });\n }\n\n #entryIsInCollapsedTrack(entry: OverlayEntry): boolean {\n const chartName = chartForEntry(entry);\n const provider = chartName === 'main' ? this.#charts.mainProvider : this.#charts.networkProvider;\n\n const entryIndex = provider.indexForEvent?.(entry) ?? null;\n if (entryIndex === null) {\n return false;\n }\n\n const group = provider.groupForEvent?.(entryIndex) ?? null;\n if (!group) {\n return false;\n }\n\n return Boolean(group.expanded) === false;\n }\n\n /**\n * Calculate if an entry is visible vertically on the chart. A bit fiddly as\n * we have to figure out its pixel offset and go on that. Unlike horizontal\n * visibility, we can't work soley from its microsecond values.\n */\n #entryIsVerticallyVisibleOnChart(entry: OverlayEntry): boolean {\n const chartName = chartForEntry(entry);\n\n const y = this.yPixelForEventOnChart(entry);\n if (y === null) {\n return false;\n }\n\n const eventHeight = this.pixelHeightForEventOnChart(entry);\n if (!eventHeight) {\n return false;\n }\n\n if (chartName === 'main') {\n if (!this.#dimensions.charts.main?.heightPixels) {\n // Shouldn't happen, but if the main chart has no height, nothing on it is visible.\n return false;\n }\n\n // The yPixelForEventOnChart method returns the y pixel including an adjustment for the network track.\n // To see if an entry on the main flame chart is visible, we can check\n // its y value without the network track adjustment. If it is < 0, then\n // it's off the top of the screen.\n //\n const yWithoutNetwork = y - this.networkChartOffsetHeight();\n // Check if the y position + the height is less than 0. We add height so\n // that we correctly consider an event only partially scrolled off to be\n // visible.\n if (yWithoutNetwork + eventHeight < 0) {\n return false;\n }\n\n if (yWithoutNetwork > this.#dimensions.charts.main.heightPixels) {\n // The event is off the bottom of the screen.\n return false;\n }\n }\n\n if (chartName === 'network') {\n if (!this.#dimensions.charts.network) {\n // The network chart can be hidden if there are no requests in the trace.\n return false;\n }\n if (y <= -14) {\n // Weird value, but the network chart has the header row with\n // timestamps on it: events stay visible behind those timestamps, so we\n // want any overlays to treat themselves as visible too.\n return false;\n }\n\n if (y > this.#dimensions.charts.network.heightPixels) {\n // The event is off the bottom of the network chart.\n return false;\n }\n }\n // If we got here, none of the conditions to mark an event as invisible got\n // triggered, so the event must be visible.\n return true;\n }\n\n /**\n * Calculate the X pixel position for an event start on the timeline.\n * @param chartName - the chart that the event is on. It is expected that both\n * charts have the same width so this doesn't make a difference - but it might\n * in the future if the UI changes, hence asking for it.\n *\n * @param event - the trace event you want to get the pixel position of\n */\n xPixelForEventStartOnChart(event: OverlayEntry): number|null {\n const chartName = chartForEntry(event);\n const {startTime} = timingsForOverlayEntry(event);\n return this.#xPixelForMicroSeconds(chartName, startTime);\n }\n\n /**\n * Calculate the X pixel position for an event end on the timeline.\n * @param chartName - the chart that the event is on. It is expected that both\n * charts have the same width so this doesn't make a difference - but it might\n * in the future if the UI changes, hence asking for it.\n *\n * @param event - the trace event you want to get the pixel position of\n */\n xPixelForEventEndOnChart(event: OverlayEntry): number|null {\n const chartName = chartForEntry(event);\n const {endTime} = timingsForOverlayEntry(event);\n return this.#xPixelForMicroSeconds(chartName, endTime);\n }\n\n /**\n * Calculate the xPixel for a given timestamp. To do this we calculate how\n * far in microseconds from the left of the visible window an event is, and\n * divide that by the total time span. This gives us a fraction representing\n * how far along the timeline the event is. We can then multiply that by the\n * width of the canvas to get its pixel position.\n */\n #xPixelForMicroSeconds(chart: EntryChartLocation, timestamp: Trace.Types.Timing.MicroSeconds): number|null {\n if (this.#dimensions.trace.visibleWindow === null) {\n console.error('Cannot calculate xPixel without visible trace window.');\n return null;\n }\n const canvasWidthPixels = this.#dimensions.charts[chart]?.widthPixels ?? null;\n if (canvasWidthPixels === null) {\n console.error(`Cannot calculate xPixel without ${chart} dimensions.`);\n return null;\n }\n\n const timeFromLeft = timestamp - this.#dimensions.trace.visibleWindow.min;\n const totalTimeSpan = this.#dimensions.trace.visibleWindow.range;\n return Math.floor(\n timeFromLeft / totalTimeSpan * canvasWidthPixels,\n );\n }\n\n /**\n * Calculate the Y pixel position for the event on the timeline relative to\n * the entire window.\n * This means if the event is in the main flame chart and below the network,\n * we add the height of the network chart to the Y value to position it\n * correctly.\n * This can return null if any data was missing, or if the event is not\n * visible (if the level it's on is hidden because the track is collapsed,\n * for example)\n */\n yPixelForEventOnChart(event: OverlayEntry): number|null {\n const chartName = chartForEntry(event);\n const chart = chartName === 'main' ? this.#charts.mainChart : this.#charts.networkChart;\n const provider = chartName === 'main' ? this.#charts.mainProvider : this.#charts.networkProvider;\n\n const indexForEntry = provider.indexForEvent?.(event);\n if (typeof indexForEntry !== 'number') {\n return null;\n }\n const timelineData = provider.timelineData();\n if (timelineData === null) {\n return null;\n }\n const level = timelineData.entryLevels.at(indexForEntry);\n if (typeof level === 'undefined') {\n return null;\n }\n\n if (!chart.levelIsVisible(level)) {\n return null;\n }\n\n const pixelOffsetForLevel = chart.levelToOffset(level);\n // Now we have the offset for the level, we need to adjust it by the user's scroll offset.\n let pixelAdjustedForScroll = pixelOffsetForLevel - (this.#dimensions.charts[chartName]?.scrollOffsetPixels ?? 0);\n\n // Now if the event is in the main chart, we need to pad its Y position\n // down by the height of the network chart + the network resize element.\n if (chartName === 'main') {\n pixelAdjustedForScroll += this.networkChartOffsetHeight();\n }\n\n return pixelAdjustedForScroll;\n }\n\n /**\n * Calculate the height of the event on the timeline.\n */\n pixelHeightForEventOnChart(event: OverlayEntry): number|null {\n const chartName = chartForEntry(event);\n const chart = chartName === 'main' ? this.#charts.mainChart : this.#charts.networkChart;\n const provider = chartName === 'main' ? this.#charts.mainProvider : this.#charts.networkProvider;\n\n const indexForEntry = provider.indexForEvent?.(event);\n if (typeof indexForEntry !== 'number') {\n return null;\n }\n const timelineData = provider.timelineData();\n if (timelineData === null) {\n return null;\n }\n const level = timelineData.entryLevels.at(indexForEntry);\n if (typeof level === 'undefined') {\n return null;\n }\n return chart.levelHeight(level);\n }\n\n /**\n * Calculate the height of the network chart. If the network chart has\n * height, we also allow for the size of the resize handle shown between the\n * two charts.\n *\n * Note that it is possible for the chart to have 0 height if the user is\n * looking at a trace with no network requests.\n */\n networkChartOffsetHeight(): number {\n if (this.#dimensions.charts.network === null) {\n return 0;\n }\n\n if (this.#dimensions.charts.network.heightPixels === 0) {\n return 0;\n }\n\n // At this point we know the network track exists and has height. But we\n // need to check if it is collapsed, because if it is collapsed there is no\n // resizer shown.\n if (this.#dimensions.charts.network.allGroupsCollapsed) {\n return this.#dimensions.charts.network.heightPixels;\n }\n\n return this.#dimensions.charts.network.heightPixels + NETWORK_RESIZE_ELEM_HEIGHT_PX;\n }\n\n /**\n * Hides or shows an element. We used to use visibility rather than display,\n * but a child of an element with visibility: hidden may still be visible if\n * its own `display` property is set.\n */\n #setOverlayElementVisibility(element: HTMLElement, isVisible: boolean): void {\n element.style.display = isVisible ? 'block' : 'none';\n }\n}\n\n/**\n * Because entries can be a TimelineFrame, which is not a trace event, this\n * helper exists to return a consistent set of timings regardless of the type\n * of entry.\n */\nexport function timingsForOverlayEntry(entry: OverlayEntry):\n Trace.Helpers.Timing.EventTimingsData {\n if (Trace.Types.Events.isLegacyTimelineFrame(entry)) {\n return {\n startTime: entry.startTime,\n endTime: entry.endTime,\n duration: entry.duration,\n };\n }\n return Trace.Helpers.Timing.eventTimingsMicroSeconds(entry);\n}\n\n/**\n * Defines if the overlay container `div` should have a jslog context attached.\n * Note that despite some of the overlays being used currently exclusively\n * for annotations, we log here with `overlays` to be generic as overlays can\n * be used for insights, annotations or in the future, who knows...\n */\nexport function jsLogContext(overlay: TimelineOverlay): string|null {\n switch (overlay.type) {\n case 'ENTRY_SELECTED': {\n // No jslog for this; it would be very noisy and not very useful.\n return null;\n }\n case 'ENTRY_OUTLINE': {\n return `timeline.overlays.entry-outline-${Platform.StringUtilities.toKebabCase(overlay.outlineReason)}`;\n }\n case 'ENTRY_LABEL': {\n return 'timeline.overlays.entry-label';\n }\n case 'ENTRIES_LINK': {\n // do not log impressions for incomplete entry links\n if (overlay.state !== Trace.Types.File.EntriesLinkState.CONNECTED) {\n return null;\n }\n return 'timeline.overlays.entries-link';\n }\n case 'TIME_RANGE': {\n return 'timeline.overlays.time-range';\n }\n case 'TIMESPAN_BREAKDOWN': {\n return 'timeline.overlays.timespan-breakdown';\n }\n case 'TIMESTAMP_MARKER': {\n return 'timeline.overlays.cursor-timestamp-marker';\n }\n case 'CANDY_STRIPED_TIME_RANGE': {\n return 'timeline.overlays.candy-striped-time-range';\n }\n case 'TIMINGS_MARKER': {\n return 'timeline.overlays.timings-marker';\n }\n default:\n Platform.assertNever(overlay, 'Unknown overlay type');\n }\n}\n"]} \ No newline at end of file diff --git a/public/panels/timeline/overlays/OverlaysImpl.test.js b/public/panels/timeline/overlays/OverlaysImpl.test.js index 9eeea5e0b..b8e379dfc 100644 --- a/public/panels/timeline/overlays/OverlaysImpl.test.js +++ b/public/panels/timeline/overlays/OverlaysImpl.test.js @@ -10,7 +10,6 @@ import * as PerfUI from '../../../ui/legacy/components/perf_ui/perf_ui.js'; import * as Timeline from '../timeline.js'; import * as Components from './components/components.js'; import * as Overlays from './overlays.js'; -const coordinator = RenderCoordinator.RenderCoordinator.RenderCoordinator.instance(); const FAKE_OVERLAY_ENTRY_QUERIES = { isEntryCollapsedByUser() { return false; @@ -333,6 +332,19 @@ describeWithEnvironment('Overlays', () => { const overlayDOM = container.querySelector('.overlay-type-ENTRY_LABEL'); assert.isOk(overlayDOM); }); + it('toggles overlays container display', async function () { + const { parsedTrace } = await TraceLoader.traceEngine(this, 'web-dev.json.gz'); + const { overlays, container } = setupChartWithDimensionsAndAnnotationOverlayListeners(parsedTrace); + overlays.toggleAllOverlaysDisplayed(true); + await overlays.update(); + assert.strictEqual(container.style.display, 'block'); + overlays.toggleAllOverlaysDisplayed(false); + await overlays.update(); + assert.strictEqual(container.style.display, 'none'); + overlays.toggleAllOverlaysDisplayed(true); + await overlays.update(); + assert.strictEqual(container.style.display, 'block'); + }); it('only renders one TIMESTAMP_MARKER as it is a singleton', async function () { const { parsedTrace } = await TraceLoader.traceEngine(this, 'web-dev.json.gz'); const { overlays, container } = setupChartWithDimensionsAndAnnotationOverlayListeners(parsedTrace); @@ -428,7 +440,7 @@ describeWithEnvironment('Overlays', () => { // Press `Enter` on the label field labelBox.dispatchEvent(new KeyboardEvent('keydown', { key: 'Enter', cancelable: true, bubbles: true })); // Ensure that the entry overlay has been removed because it was saved empty - assert.strictEqual(overlays.overlaysOfType('TIME_RANGE').length, 0); + assert.lengthOf(overlays.overlaysOfType('TIME_RANGE'), 0); }); it('Inputting `Enter` into time range label field when the label is not empty does not remove the overlay', async function () { const { parsedTrace } = await TraceLoader.traceEngine(this, 'web-dev.json.gz'); @@ -459,7 +471,7 @@ describeWithEnvironment('Overlays', () => { // Press `Enter` on the label field labelBox.dispatchEvent(new KeyboardEvent('keydown', { key: 'Enter', cancelable: true, bubbles: true })); // Ensure that the entry overlay has not been because it was has a non-empty label - assert.strictEqual(overlays.overlaysOfType('TIME_RANGE').length, 1); + assert.lengthOf(overlays.overlaysOfType('TIME_RANGE'), 1); }); it('Can create multiple Time Range Overlays for Time Range annotations', async function () { const { parsedTrace } = await TraceLoader.traceEngine(this, 'web-dev.json.gz'); @@ -477,7 +489,7 @@ describeWithEnvironment('Overlays', () => { bounds: parsedTrace.Meta.traceBounds, }); await overlays.update(); - assert.strictEqual(overlays.overlaysOfType('TIME_RANGE').length, 2); + assert.lengthOf(overlays.overlaysOfType('TIME_RANGE'), 2); }); it('Removes empty label if it is empty when navigated away from (removed focused from)', async function () { const { parsedTrace } = await TraceLoader.traceEngine(this, 'web-dev.json.gz'); @@ -504,12 +516,12 @@ describeWithEnvironment('Overlays', () => { // Double click on the label box to make it editable and focus on it inputField.dispatchEvent(new FocusEvent('dblclick', { bubbles: true })); // Ensure that the entry has 1 overlay - assert.strictEqual(overlays.overlaysForEntry(event).length, 1); + assert.lengthOf(overlays.overlaysForEntry(event), 1); // Change the content to not editable by changing the element blur like when clicking outside of it. // The label is empty since no initial value was passed into it and no characters were entered. inputField.dispatchEvent(new FocusEvent('blur', { bubbles: true })); // Ensure that the entry overlay has been removed because it was saved empty - assert.strictEqual(overlays.overlaysForEntry(event).length, 0); + assert.lengthOf(overlays.overlaysForEntry(event), 0); }); it('Update label overlay when the label changes', async function () { const { parsedTrace } = await TraceLoader.traceEngine(this, 'web-dev.json.gz'); @@ -615,7 +627,7 @@ describeWithEnvironment('Overlays', () => { bounds: parsedTrace.Meta.traceBounds, }); await overlays.update(); - await coordinator.done(); + await RenderCoordinator.done(); const overlayDOM = container.querySelector('.overlay-type-TIME_RANGE'); const component = overlayDOM?.querySelector('devtools-time-range-overlay'); assert.isOk(component?.shadowRoot); diff --git a/public/panels/timeline/overlays/OverlaysImpl.test.js.map b/public/panels/timeline/overlays/OverlaysImpl.test.js.map index 545e50073..533d5c95c 100644 --- a/public/panels/timeline/overlays/OverlaysImpl.test.js.map +++ b/public/panels/timeline/overlays/OverlaysImpl.test.js.map @@ -1 +1 @@ -{"version":3,"file":"OverlaysImpl.test.js","sourceRoot":"","sources":["../../../../../../../front_end/panels/timeline/overlays/OverlaysImpl.test.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,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M,cAAc,GAAkC;gBACpD,IAAI,EAAE,cAAc;gBACpB,SAAS,EAAE,UAAU;gBACrB,OAAO,EAAE,SAAS;gBAClB,KAAK,6EAAoD;aAC1D,CAAC;YACF,MAAM,gBAAgB,GAAG,QAAQ,CAAC,QAAQ,CAAC,YAAY,CAAC,gBAAgB,CAAC,CAAC;YAC1E,MAAM,CAAC,WAAW,CAAC,gBAAgB,EAAE,gCAAgC,CAAC,CAAC;YAEvE,MAAM,cAAc,GAAG,QAAQ,CAAC,QAAQ,CAAC,YAAY,CAAC,cAAc,CAAC,CAAC;YACtE,MAAM,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC;QAChC,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["// Copyright 2024 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport * as Trace from '../../../models/trace/trace.js';\nimport {describeWithEnvironment} from '../../../testing/EnvironmentHelpers.js';\nimport {\n makeInstantEvent,\n microsecondsTraceWindow,\n MockFlameChartDelegate,\n setupIgnoreListManagerEnvironment,\n} from '../../../testing/TraceHelpers.js';\nimport {TraceLoader} from '../../../testing/TraceLoader.js';\nimport * as RenderCoordinator from '../../../ui/components/render_coordinator/render_coordinator.js';\nimport * as PerfUI from '../../../ui/legacy/components/perf_ui/perf_ui.js';\nimport * as Timeline from '../timeline.js';\n\nimport * as Components from './components/components.js';\nimport * as Overlays from './overlays.js';\n\nconst coordinator = RenderCoordinator.RenderCoordinator.RenderCoordinator.instance();\n\nconst FAKE_OVERLAY_ENTRY_QUERIES: Overlays.Overlays.OverlayEntryQueries = {\n isEntryCollapsedByUser() {\n return false;\n },\n firstVisibleParentForEntry() {\n return null;\n },\n};\n\n/**\n * The Overlays expects to be provided with both the main and network charts\n * and data providers. This function creates all of those and optionally sets\n * the trace data for the providers if it is provided.\n */\nfunction createCharts(parsedTrace?: Trace.Handlers.Types.ParsedTrace): Overlays.Overlays.TimelineCharts {\n const mainProvider = new Timeline.TimelineFlameChartDataProvider.TimelineFlameChartDataProvider();\n const networkProvider = new Timeline.TimelineFlameChartNetworkDataProvider.TimelineFlameChartNetworkDataProvider();\n if (parsedTrace) {\n mainProvider.setModel(parsedTrace);\n networkProvider.setModel(parsedTrace);\n }\n\n const delegate = new MockFlameChartDelegate();\n const mainChart = new PerfUI.FlameChart.FlameChart(mainProvider, delegate);\n const networkChart = new PerfUI.FlameChart.FlameChart(networkProvider, delegate);\n // Add to DOM for offsetWidth, etc working\n document.body.append(mainChart.element, networkChart.element);\n\n if (parsedTrace) {\n // Force the charts to render. Normally the TimelineFlameChartView would do\n // this, but we aren't creating one for these tests.\n mainChart.update();\n networkChart.update();\n }\n\n return {\n mainProvider,\n mainChart,\n networkProvider,\n networkChart,\n };\n}\n\ndescribeWithEnvironment('Overlays', () => {\n beforeEach(() => {\n setupIgnoreListManagerEnvironment();\n });\n\n afterEach(() => {\n // Remove any FlameChart elements from the DOM\n document.body.querySelectorAll('widget').forEach(e => e.remove());\n });\n\n it('can calculate the x position of an event based on the dimensions and its timestamp', async () => {\n const flameChartsContainer = document.createElement('div');\n const mainFlameChartsContainer = flameChartsContainer.createChild('div');\n const networkFlameChartsContainer = flameChartsContainer.createChild('div');\n const container = flameChartsContainer.createChild('div');\n\n const overlays = new Overlays.Overlays.Overlays({\n container,\n flameChartsContainers: {\n main: mainFlameChartsContainer,\n network: networkFlameChartsContainer,\n },\n charts: createCharts(),\n entryQueries: FAKE_OVERLAY_ENTRY_QUERIES,\n });\n\n // Set up the dimensions so it is 100px wide\n overlays.updateChartDimensions('main', {\n widthPixels: 100,\n heightPixels: 50,\n scrollOffsetPixels: 0,\n allGroupsCollapsed: false,\n });\n overlays.updateChartDimensions('network', {\n widthPixels: 100,\n heightPixels: 50,\n scrollOffsetPixels: 0,\n allGroupsCollapsed: false,\n });\n\n const windowMin = Trace.Types.Timing.MicroSeconds(0);\n const windowMax = Trace.Types.Timing.MicroSeconds(100);\n // Set the visible window to be 0-100 microseconds\n overlays.updateVisibleWindow(Trace.Helpers.Timing.traceWindowFromMicroSeconds(windowMin, windowMax));\n\n // Now set an event to be at 50 microseconds.\n const event = makeInstantEvent('test-event', 50);\n\n const xPosition = overlays.xPixelForEventStartOnChart(event);\n assert.strictEqual(xPosition, 50);\n });\n\n it('can calculate the y position of a main chart event', async function() {\n const {parsedTrace} = await TraceLoader.traceEngine(this, 'web-dev.json.gz');\n const charts = createCharts(parsedTrace);\n\n const flameChartsContainer = document.createElement('div');\n const mainFlameChartsContainer = flameChartsContainer.createChild('div');\n const networkFlameChartsContainer = flameChartsContainer.createChild('div');\n const container = flameChartsContainer.createChild('div');\n\n const overlays = new Overlays.Overlays.Overlays({\n container,\n flameChartsContainers: {\n main: mainFlameChartsContainer,\n network: networkFlameChartsContainer,\n },\n charts,\n entryQueries: FAKE_OVERLAY_ENTRY_QUERIES,\n });\n\n overlays.updateChartDimensions('main', {\n widthPixels: 1000,\n heightPixels: 500,\n scrollOffsetPixels: 0,\n allGroupsCollapsed: false,\n });\n overlays.updateChartDimensions('network', {\n widthPixels: 1000,\n heightPixels: 200,\n scrollOffsetPixels: 0,\n allGroupsCollapsed: false,\n });\n\n // Set the visible window to be the entire trace.\n overlays.updateVisibleWindow(parsedTrace.Meta.traceBounds);\n\n const event = charts.mainProvider.eventByIndex?.(50);\n assert.isOk(event);\n const yPixel = overlays.yPixelForEventOnChart(event);\n // The Y offset for the main chart is 280px, but we add 208px on (200px for the\n // network chart, and 8px for the re-size handle) giving us the expected\n // 441px.\n assert.strictEqual(yPixel, 488);\n });\n\n it('can adjust the y position of a main chart event when the network track is collapsed', async function() {\n const {parsedTrace} = await TraceLoader.traceEngine(this, 'web-dev.json.gz');\n const charts = createCharts(parsedTrace);\n\n const flameChartsContainer = document.createElement('div');\n const mainFlameChartsContainer = flameChartsContainer.createChild('div');\n const networkFlameChartsContainer = flameChartsContainer.createChild('div');\n const container = flameChartsContainer.createChild('div');\n\n const overlays = new Overlays.Overlays.Overlays({\n container,\n flameChartsContainers: {\n main: mainFlameChartsContainer,\n network: networkFlameChartsContainer,\n },\n charts,\n entryQueries: FAKE_OVERLAY_ENTRY_QUERIES,\n });\n\n overlays.updateChartDimensions('main', {\n widthPixels: 1000,\n heightPixels: 500,\n scrollOffsetPixels: 0,\n allGroupsCollapsed: false,\n });\n overlays.updateChartDimensions('network', {\n widthPixels: 1000,\n heightPixels: 34,\n scrollOffsetPixels: 0,\n // Make the network track collapsed\n allGroupsCollapsed: true,\n });\n\n // Set the visible window to be the entire trace.\n overlays.updateVisibleWindow(parsedTrace.Meta.traceBounds);\n\n const event = charts.mainProvider.eventByIndex?.(50);\n assert.isOk(event);\n const yPixel = overlays.yPixelForEventOnChart(event);\n // The Y offset for the main chart is 280px, but we add 34px on (the height\n // of the collapsed network chart, with no resizer bar as it is hidden when\n // the network track is collapsed). This gives us 280+34 = 314.\n assert.strictEqual(yPixel, 314);\n });\n\n it('can calculate the y position of a network chart event', async function() {\n const {parsedTrace} = await TraceLoader.traceEngine(this, 'web-dev.json.gz');\n const charts = createCharts(parsedTrace);\n\n const flameChartsContainer = document.createElement('div');\n const mainFlameChartsContainer = flameChartsContainer.createChild('div');\n const networkFlameChartsContainer = flameChartsContainer.createChild('div');\n const container = flameChartsContainer.createChild('div');\n\n const overlays = new Overlays.Overlays.Overlays({\n container,\n flameChartsContainers: {\n main: mainFlameChartsContainer,\n network: networkFlameChartsContainer,\n },\n charts,\n entryQueries: FAKE_OVERLAY_ENTRY_QUERIES,\n });\n\n overlays.updateChartDimensions('main', {\n widthPixels: 1000,\n heightPixels: 500,\n scrollOffsetPixels: 0,\n allGroupsCollapsed: false,\n });\n overlays.updateChartDimensions('network', {\n widthPixels: 1000,\n heightPixels: 200,\n scrollOffsetPixels: 0,\n allGroupsCollapsed: false,\n });\n\n // Set the visible window to be the entire trace.\n overlays.updateVisibleWindow(parsedTrace.Meta.traceBounds);\n\n // Fake the level being visible: because we don't fully render the chart we\n // need to fake this for this test.\n sinon.stub(charts.networkChart, 'levelIsVisible').callsFake(() => true);\n\n // Find an event on the network chart\n const event = charts.networkProvider.eventByIndex?.(0);\n assert.isOk(event);\n const yPixel = overlays.yPixelForEventOnChart(event);\n // This event is in the first level, but the first level has some offset\n // above it to allow for the header row and the row with the timestamps on\n // it, hence why this value is not 0px.\n assert.strictEqual(yPixel, 34);\n });\n\n describe('rendering overlays', () => {\n function setupChartWithDimensionsAndAnnotationOverlayListeners(parsedTrace: Trace.Handlers.Types.ParsedTrace): {\n container: HTMLElement,\n overlays: Overlays.Overlays.Overlays,\n charts: Overlays.Overlays.TimelineCharts,\n } {\n const charts = createCharts(parsedTrace);\n\n const flameChartsContainer = document.createElement('div');\n const mainFlameChartsContainer = flameChartsContainer.createChild('div');\n const networkFlameChartsContainer = flameChartsContainer.createChild('div');\n const container = flameChartsContainer.createChild('div');\n\n const overlays = new Overlays.Overlays.Overlays({\n container,\n flameChartsContainers: {\n main: mainFlameChartsContainer,\n network: networkFlameChartsContainer,\n },\n charts,\n entryQueries: FAKE_OVERLAY_ENTRY_QUERIES,\n });\n const currManager = Timeline.ModificationsManager.ModificationsManager.activeManager();\n // The Annotations Overlays are added through the ModificationsManager listener\n currManager?.addEventListener(Timeline.ModificationsManager.AnnotationModifiedEvent.eventName, async event => {\n const {overlay, action} = (event as Timeline.ModificationsManager.AnnotationModifiedEvent);\n if (action === 'Add') {\n overlays.add(overlay);\n }\n await overlays.update();\n });\n\n // When an annotation overlay is remomved, this event is dispatched to the Modifications Manager.\n overlays.addEventListener(Overlays.Overlays.AnnotationOverlayActionEvent.eventName, async event => {\n const {overlay, action} = (event as Overlays.Overlays.AnnotationOverlayActionEvent);\n if (action === 'Remove') {\n overlays.remove(overlay);\n }\n await overlays.update();\n });\n\n overlays.updateChartDimensions('main', {\n widthPixels: 1000,\n heightPixels: 500,\n scrollOffsetPixels: 0,\n allGroupsCollapsed: false,\n });\n overlays.updateChartDimensions('network', {\n widthPixels: 1000,\n heightPixels: 200,\n scrollOffsetPixels: 0,\n allGroupsCollapsed: false,\n });\n\n // Set the visible window to be the entire trace.\n overlays.updateVisibleWindow(parsedTrace.Meta.traceBounds);\n return {overlays, container, charts};\n }\n\n it('can render an entry selected overlay', async function() {\n const {parsedTrace} = await TraceLoader.traceEngine(this, 'web-dev.json.gz');\n const {overlays, container, charts} = setupChartWithDimensionsAndAnnotationOverlayListeners(parsedTrace);\n const event = charts.mainProvider.eventByIndex?.(50);\n assert.isOk(event);\n\n overlays.add({\n type: 'ENTRY_SELECTED',\n entry: event,\n });\n await overlays.update();\n\n // Ensure that the overlay was created.\n const overlayDOM = container.querySelector('.overlay-type-ENTRY_SELECTED');\n assert.isOk(overlayDOM);\n });\n\n it('renders an ENTRY_OUTLINE even if the entry is also the ENTRY_SELECTED entry', async function() {\n const {parsedTrace} = await TraceLoader.traceEngine(this, 'web-dev.json.gz');\n const {overlays, container, charts} = setupChartWithDimensionsAndAnnotationOverlayListeners(parsedTrace);\n const event = charts.mainProvider.eventByIndex?.(50);\n assert.isOk(event);\n overlays.add({\n type: 'ENTRY_OUTLINE',\n entry: event,\n outlineReason: 'ERROR',\n });\n await overlays.update();\n\n const outlineVisible =\n container.querySelector('.overlay-type-ENTRY_OUTLINE')?.style.display === 'block';\n assert.isTrue(outlineVisible, 'The ENTRY_OUTLINE should be visible');\n\n // Now make a selected entry too\n overlays.add({\n type: 'ENTRY_SELECTED',\n entry: event,\n });\n await overlays.update();\n const outlineStillVisible =\n container.querySelector('.overlay-type-ENTRY_OUTLINE')?.style.display === 'block';\n assert.isTrue(outlineStillVisible, 'The ENTRY_OUTLINE should be visible');\n });\n\n it('only ever renders a single selected overlay', async function() {\n const {parsedTrace} = await TraceLoader.traceEngine(this, 'web-dev.json.gz');\n const {overlays, container, charts} = setupChartWithDimensionsAndAnnotationOverlayListeners(parsedTrace);\n const event1 = charts.mainProvider.eventByIndex?.(50);\n const event2 = charts.mainProvider.eventByIndex?.(51);\n assert.isOk(event1);\n assert.isOk(event2);\n\n overlays.add({\n type: 'ENTRY_SELECTED',\n entry: event1,\n });\n await overlays.update();\n overlays.add({\n type: 'ENTRY_SELECTED',\n entry: event2,\n });\n await overlays.update();\n\n // There should only be one of these\n const entrySelectedOverlays = container.querySelectorAll('.overlay-type-ENTRY_SELECTED');\n assert.lengthOf(entrySelectedOverlays, 1);\n });\n\n it('can render entry label overlay', async function() {\n const {parsedTrace} = await TraceLoader.traceEngine(this, 'web-dev.json.gz');\n const {overlays, container, charts} = setupChartWithDimensionsAndAnnotationOverlayListeners(parsedTrace);\n const event = charts.mainProvider.eventByIndex?.(50);\n assert.isOk(event);\n\n overlays.add({\n type: 'ENTRY_LABEL',\n entry: event,\n label: 'entry label',\n });\n await overlays.update();\n\n // Ensure that the overlay was created.\n const overlayDOM = container.querySelector('.overlay-type-ENTRY_LABEL');\n assert.isOk(overlayDOM);\n });\n\n it('only renders one TIMESTAMP_MARKER as it is a singleton', async function() {\n const {parsedTrace} = await TraceLoader.traceEngine(this, 'web-dev.json.gz');\n const {overlays, container} = setupChartWithDimensionsAndAnnotationOverlayListeners(parsedTrace);\n overlays.add({\n type: 'TIMESTAMP_MARKER',\n timestamp: parsedTrace.Meta.traceBounds.min,\n });\n overlays.add({\n type: 'TIMESTAMP_MARKER',\n timestamp: parsedTrace.Meta.traceBounds.max,\n });\n await overlays.update();\n assert.lengthOf(container.children, 1);\n });\n\n it('can render the label for entry label overlay', async function() {\n const {parsedTrace} = await TraceLoader.traceEngine(this, 'web-dev.json.gz');\n const {overlays, container, charts} = setupChartWithDimensionsAndAnnotationOverlayListeners(parsedTrace);\n const event = charts.mainProvider.eventByIndex?.(50);\n assert.isOk(event);\n\n overlays.add({\n type: 'ENTRY_LABEL',\n entry: event,\n label: 'entry label',\n });\n await overlays.update();\n\n const overlayDOM = container.querySelector('.overlay-type-ENTRY_LABEL');\n assert.isOk(overlayDOM);\n const component = overlayDOM?.querySelector('devtools-entry-label-overlay');\n assert.isOk(component?.shadowRoot);\n\n const elementsWrapper = component.shadowRoot.querySelector('.label-parts-wrapper');\n assert.isOk(elementsWrapper);\n\n const inputField = elementsWrapper.querySelector('.input-field');\n assert.isOk(inputField);\n\n assert.strictEqual(inputField?.innerText, 'entry label');\n });\n\n it('Inputting `Enter`into label overlay makes it non-editable', async function() {\n const {parsedTrace} = await TraceLoader.traceEngine(this, 'web-dev.json.gz');\n const {overlays, container, charts} = setupChartWithDimensionsAndAnnotationOverlayListeners(parsedTrace);\n const event = charts.mainProvider.eventByIndex?.(50);\n assert.isOk(event);\n\n // Create an entry label overlay\n overlays.add({\n type: 'ENTRY_LABEL',\n entry: event,\n label: 'label',\n });\n await overlays.update();\n\n // Ensure that the overlay was created.\n const overlayDOM = container.querySelector('.overlay-type-ENTRY_LABEL');\n assert.isOk(overlayDOM);\n\n const component = overlayDOM?.querySelector('devtools-entry-label-overlay');\n assert.isOk(component?.shadowRoot);\n component.connectedCallback();\n const elementsWrapper = component.shadowRoot.querySelector('.label-parts-wrapper');\n assert.isOk(elementsWrapper);\n\n const inputField = elementsWrapper.querySelector('.input-field');\n assert.isOk(inputField);\n\n // Double click on the label box to make it editable and focus on it\n inputField.dispatchEvent(new FocusEvent('dblclick', {bubbles: true}));\n\n // Ensure the label content is editable\n assert.isTrue(inputField.isContentEditable);\n\n // Press `Enter` to make the lable not editable\n inputField.dispatchEvent(new KeyboardEvent('keydown', {key: 'Enter', cancelable: true, bubbles: true}));\n\n // Ensure the label content is not editable\n assert.isFalse(inputField.isContentEditable);\n });\n\n it('Inputting `Enter` into time range label field when the label is empty removes the overlay', async function() {\n const {parsedTrace} = await TraceLoader.traceEngine(this, 'web-dev.json.gz');\n const {overlays, container, charts} = setupChartWithDimensionsAndAnnotationOverlayListeners(parsedTrace);\n const event = charts.mainProvider.eventByIndex?.(50);\n assert.isOk(event);\n\n // Create a time range overlay with an empty label\n overlays.add({\n type: 'TIME_RANGE',\n label: '',\n showDuration: true,\n // Make this overlay the entire span of the trace\n bounds: parsedTrace.Meta.traceBounds,\n });\n await overlays.update();\n\n // Ensure that the overlay was created.\n const overlayDOM = container.querySelector('.overlay-type-TIME_RANGE');\n assert.isOk(overlayDOM);\n\n const component = overlayDOM?.querySelector('devtools-time-range-overlay');\n assert.isOk(component?.shadowRoot);\n component.connectedCallback();\n const rangeContainer = component.shadowRoot.querySelector('.range-container');\n assert.isOk(rangeContainer);\n\n const labelBox = rangeContainer.querySelector('.label-text');\n assert.isOk(labelBox);\n\n // Double click on the label box to make it editable and focus on it\n labelBox.dispatchEvent(new FocusEvent('dblclick', {bubbles: true}));\n\n // Press `Enter` on the label field\n labelBox.dispatchEvent(new KeyboardEvent('keydown', {key: 'Enter', cancelable: true, bubbles: true}));\n\n // Ensure that the entry overlay has been removed because it was saved empty\n assert.strictEqual(overlays.overlaysOfType('TIME_RANGE').length, 0);\n });\n\n it('Inputting `Enter` into time range label field when the label is not empty does not remove the overlay',\n async function() {\n const {parsedTrace} = await TraceLoader.traceEngine(this, 'web-dev.json.gz');\n const {overlays, container, charts} = setupChartWithDimensionsAndAnnotationOverlayListeners(parsedTrace);\n const event = charts.mainProvider.eventByIndex?.(50);\n assert.isOk(event);\n\n // Create a time range overlay with a label\n overlays.add({\n type: 'TIME_RANGE',\n label: 'label',\n showDuration: true,\n // Make this overlay the entire span of the trace\n bounds: parsedTrace.Meta.traceBounds,\n });\n await overlays.update();\n\n // Ensure that the overlay was created.\n const overlayDOM = container.querySelector('.overlay-type-TIME_RANGE');\n assert.isOk(overlayDOM);\n\n const component = overlayDOM?.querySelector('devtools-time-range-overlay');\n assert.isOk(component?.shadowRoot);\n component.connectedCallback();\n const rangeContainer = component.shadowRoot.querySelector('.range-container');\n assert.isOk(rangeContainer);\n\n const labelBox = rangeContainer.querySelector('.label-text');\n assert.isOk(labelBox);\n\n // Double click on the label box to make it editable and focus on it\n labelBox.dispatchEvent(new FocusEvent('dblclick', {bubbles: true}));\n\n // Press `Enter` on the label field\n labelBox.dispatchEvent(new KeyboardEvent('keydown', {key: 'Enter', cancelable: true, bubbles: true}));\n\n // Ensure that the entry overlay has not been because it was has a non-empty label\n assert.strictEqual(overlays.overlaysOfType('TIME_RANGE').length, 1);\n });\n\n it('Can create multiple Time Range Overlays for Time Range annotations', async function() {\n const {parsedTrace} = await TraceLoader.traceEngine(this, 'web-dev.json.gz');\n const {overlays, charts} = setupChartWithDimensionsAndAnnotationOverlayListeners(parsedTrace);\n const event = charts.mainProvider.eventByIndex?.(50);\n assert.isOk(event);\n\n Timeline.ModificationsManager.ModificationsManager.activeManager()?.createAnnotation({\n type: 'TIME_RANGE',\n label: 'label',\n bounds: parsedTrace.Meta.traceBounds,\n });\n\n Timeline.ModificationsManager.ModificationsManager.activeManager()?.createAnnotation({\n type: 'TIME_RANGE',\n label: 'label2',\n bounds: parsedTrace.Meta.traceBounds,\n });\n await overlays.update();\n\n assert.strictEqual(overlays.overlaysOfType('TIME_RANGE').length, 2);\n });\n\n it('Removes empty label if it is empty when navigated away from (removed focused from)', async function() {\n const {parsedTrace} = await TraceLoader.traceEngine(this, 'web-dev.json.gz');\n const {overlays, container, charts} = setupChartWithDimensionsAndAnnotationOverlayListeners(parsedTrace);\n const event = charts.mainProvider.eventByIndex?.(50);\n assert.isOk(event);\n\n // Create an entry label overlay\n Timeline.ModificationsManager.ModificationsManager.activeManager()?.createAnnotation({\n type: 'ENTRY_LABEL',\n entry: event as Trace.Types.Events.Event,\n label: '',\n });\n await overlays.update();\n\n // Ensure that the overlay was created.\n const overlayDOM = container.querySelector('.overlay-type-ENTRY_LABEL');\n assert.isOk(overlayDOM);\n const component = overlayDOM?.querySelector('devtools-entry-label-overlay');\n assert.isOk(component?.shadowRoot);\n\n component.connectedCallback();\n const elementsWrapper = component.shadowRoot.querySelector('.label-parts-wrapper');\n assert.isOk(elementsWrapper);\n\n const inputField = elementsWrapper.querySelector('.input-field');\n assert.isOk(inputField);\n\n // Double click on the label box to make it editable and focus on it\n inputField.dispatchEvent(new FocusEvent('dblclick', {bubbles: true}));\n\n // Ensure that the entry has 1 overlay\n assert.strictEqual(overlays.overlaysForEntry(event).length, 1);\n\n // Change the content to not editable by changing the element blur like when clicking outside of it.\n // The label is empty since no initial value was passed into it and no characters were entered.\n inputField.dispatchEvent(new FocusEvent('blur', {bubbles: true}));\n\n // Ensure that the entry overlay has been removed because it was saved empty\n assert.strictEqual(overlays.overlaysForEntry(event).length, 0);\n });\n\n it('Update label overlay when the label changes', async function() {\n const {parsedTrace} = await TraceLoader.traceEngine(this, 'web-dev.json.gz');\n const {overlays, container, charts} = setupChartWithDimensionsAndAnnotationOverlayListeners(parsedTrace);\n const event = charts.mainProvider.eventByIndex?.(50);\n assert.isOk(event);\n\n // Create an entry label overlay\n Timeline.ModificationsManager.ModificationsManager.activeManager()?.createAnnotation({\n type: 'ENTRY_LABEL',\n entry: event as Trace.Types.Events.Event,\n label: '',\n });\n await overlays.update();\n\n // Ensure that the overlay was created.\n const overlayDOM = container.querySelector('.overlay-type-ENTRY_LABEL');\n assert.isOk(overlayDOM);\n const component = overlayDOM?.querySelector('devtools-entry-label-overlay');\n assert.isOk(component?.shadowRoot);\n\n component.connectedCallback();\n component.dispatchEvent(new Components.EntryLabelOverlay.EntryLabelChangeEvent('new label'));\n\n const updatedOverlay = overlays.overlaysForEntry(event)[0] as Overlays.Overlays.EntryLabel;\n assert.isOk(updatedOverlay);\n // Make sure the label was updated in the Overlay Object\n assert.strictEqual(updatedOverlay.label, 'new label');\n });\n\n it('creates an overlay for a time range when an time range annotation is created', async function() {\n const {parsedTrace} = await TraceLoader.traceEngine(this, 'web-dev.json.gz');\n const {overlays, container} = setupChartWithDimensionsAndAnnotationOverlayListeners(parsedTrace);\n\n // Since TIME_RANGE is AnnotationOverlay, create it through ModificationsManager\n Timeline.ModificationsManager.ModificationsManager.activeManager()?.createAnnotation({\n type: 'TIME_RANGE',\n label: '',\n // Make this overlay the entire span of the trace\n bounds: parsedTrace.Meta.traceBounds,\n });\n await overlays.update();\n const overlayDOM = container.querySelector('.overlay-type-TIME_RANGE');\n assert.isOk(overlayDOM);\n });\n\n it('can render an overlay for a time range', async function() {\n const {parsedTrace} = await TraceLoader.traceEngine(this, 'web-dev.json.gz');\n const {overlays, container} = setupChartWithDimensionsAndAnnotationOverlayListeners(parsedTrace);\n overlays.add({\n type: 'TIME_RANGE',\n label: '',\n showDuration: true,\n // Make this overlay the entire span of the trace\n bounds: parsedTrace.Meta.traceBounds,\n });\n await overlays.update();\n const overlayDOM = container.querySelector('.overlay-type-TIME_RANGE');\n assert.isOk(overlayDOM);\n });\n\n it('can update a time range overlay with new bounds', async function() {\n const {parsedTrace} = await TraceLoader.traceEngine(this, 'web-dev.json.gz');\n const {overlays, container} = setupChartWithDimensionsAndAnnotationOverlayListeners(parsedTrace);\n const rangeOverlay = overlays.add({\n type: 'TIME_RANGE',\n label: '',\n showDuration: true,\n // Make this overlay the entire span of the trace\n bounds: parsedTrace.Meta.traceBounds,\n });\n await overlays.update();\n const overlayDOM = container.querySelector('.overlay-type-TIME_RANGE');\n assert.isOk(overlayDOM);\n const firstWidth = window.parseInt(overlayDOM.style.width);\n\n // change the bounds so the new min is +1second of time.\n const newBounds = Trace.Helpers.Timing.traceWindowFromMicroSeconds(\n Trace.Types.Timing.MicroSeconds(rangeOverlay.bounds.min + (1_000 * 1_000)),\n rangeOverlay.bounds.max,\n );\n overlays.updateExisting(rangeOverlay, {bounds: newBounds});\n await overlays.update();\n const secondWidth = window.parseInt(overlayDOM.style.width);\n // The new time range is smaller so the DOM element should have less width\n assert.isTrue(secondWidth < firstWidth);\n });\n\n it('renders the overlay for a selected layout shift entry correctly', async function() {\n const {parsedTrace} = await TraceLoader.traceEngine(this, 'cls-single-frame.json.gz');\n const {overlays, container} = setupChartWithDimensionsAndAnnotationOverlayListeners(parsedTrace);\n const layoutShiftEvent = parsedTrace.LayoutShifts.clusters.at(0)?.events.at(0);\n if (!layoutShiftEvent) {\n throw new Error('layoutShiftEvent was unexpectedly undefined');\n }\n overlays.add({\n type: 'ENTRY_SELECTED',\n entry: layoutShiftEvent,\n });\n const boundsRange = Trace.Types.Timing.MicroSeconds(20_000);\n const boundsMax = Trace.Types.Timing.MicroSeconds(layoutShiftEvent.ts + boundsRange);\n overlays.updateVisibleWindow({min: layoutShiftEvent.ts, max: boundsMax, range: boundsRange});\n await overlays.update();\n const overlayDOM = container.querySelector('.overlay-type-ENTRY_SELECTED');\n assert.isOk(overlayDOM);\n assert.strictEqual(window.parseInt(overlayDOM.style.width), 17);\n });\n\n it('renders the duration and label for a time range overlay', async function() {\n const {parsedTrace} = await TraceLoader.traceEngine(this, 'web-dev.json.gz');\n const {overlays, container} = setupChartWithDimensionsAndAnnotationOverlayListeners(parsedTrace);\n overlays.add({\n type: 'TIME_RANGE',\n label: '',\n showDuration: true,\n // Make this overlay the entire span of the trace\n bounds: parsedTrace.Meta.traceBounds,\n });\n await overlays.update();\n await coordinator.done();\n const overlayDOM = container.querySelector('.overlay-type-TIME_RANGE');\n const component = overlayDOM?.querySelector('devtools-time-range-overlay');\n assert.isOk(component?.shadowRoot);\n const rangeContainer = component.shadowRoot.querySelector('.range-container');\n assert.isOk(rangeContainer);\n const duration = rangeContainer.querySelector('.duration');\n assert.isOk(duration);\n assert.strictEqual(duration?.innerText, '1.26\\xA0s');\n });\n\n it('can remove an overlay', async function() {\n const {parsedTrace} = await TraceLoader.traceEngine(this, 'web-dev.json.gz');\n const {overlays, container, charts} = setupChartWithDimensionsAndAnnotationOverlayListeners(parsedTrace);\n const event = charts.mainProvider.eventByIndex?.(50);\n assert.isOk(event);\n\n const selectedOverlay = overlays.add({\n type: 'ENTRY_SELECTED',\n entry: event,\n });\n await overlays.update();\n assert.lengthOf(container.children, 1);\n\n overlays.remove(selectedOverlay);\n await overlays.update();\n assert.lengthOf(container.children, 0);\n });\n\n it('can render an entry selected overlay for a frame', async function() {\n const {parsedTrace} = await TraceLoader.traceEngine(this, 'web-dev-with-commit.json.gz');\n const {overlays, container, charts} = setupChartWithDimensionsAndAnnotationOverlayListeners(parsedTrace);\n const timelineFrame = charts.mainProvider.eventByIndex?.(5);\n assert.isOk(timelineFrame);\n\n overlays.add({\n type: 'ENTRY_SELECTED',\n entry: timelineFrame,\n });\n await overlays.update();\n\n // Ensure that the overlay was created.\n const overlayDOM = container.querySelector('.overlay-type-ENTRY_SELECTED');\n assert.isOk(overlayDOM);\n });\n\n it('can return a list of overlays for an entry', async function() {\n const {parsedTrace} = await TraceLoader.traceEngine(this, 'web-dev.json.gz');\n const {overlays, charts} = setupChartWithDimensionsAndAnnotationOverlayListeners(parsedTrace);\n const event = charts.mainProvider.eventByIndex?.(50);\n assert.isOk(event);\n\n overlays.add({\n type: 'ENTRY_SELECTED',\n entry: event,\n });\n\n const existingOverlays = overlays.overlaysForEntry(event);\n assert.deepEqual(existingOverlays, [{\n type: 'ENTRY_SELECTED',\n entry: event,\n }]);\n });\n\n it('can delete overlays and remove them from the DOM', async function() {\n const {parsedTrace} = await TraceLoader.traceEngine(this, 'web-dev.json.gz');\n const {container, overlays, charts} = setupChartWithDimensionsAndAnnotationOverlayListeners(parsedTrace);\n const event = charts.mainProvider.eventByIndex?.(50);\n assert.isOk(event);\n\n overlays.add({\n type: 'ENTRY_SELECTED',\n entry: event,\n });\n await overlays.update();\n\n assert.lengthOf(container.children, 1);\n const removedCount = overlays.removeOverlaysOfType('ENTRY_SELECTED');\n assert.strictEqual(removedCount, 1);\n assert.lengthOf(container.children, 0);\n });\n\n it('the label entry field is editable when created', async function() {\n const {parsedTrace} = await TraceLoader.traceEngine(this, 'web-dev.json.gz');\n const {overlays, container} = setupChartWithDimensionsAndAnnotationOverlayListeners(parsedTrace);\n const charts = createCharts(parsedTrace);\n const event = charts.mainProvider.eventByIndex?.(50);\n assert.isOk(event);\n\n // Since ENTRY_LABEL is AnnotationOverlay, create it through ModificationsManager\n Timeline.ModificationsManager.ModificationsManager.activeManager()?.createAnnotation({\n type: 'ENTRY_LABEL',\n label: '',\n entry: event as Trace.Types.Events.Event,\n });\n\n await overlays.update();\n const overlayDOM = container.querySelector('.overlay-type-ENTRY_LABEL');\n assert.isOk(overlayDOM);\n const component = overlayDOM?.querySelector('devtools-entry-label-overlay');\n assert.isOk(component?.shadowRoot);\n\n const elementsWrapper = component.shadowRoot.querySelector('.label-parts-wrapper');\n const inputField = elementsWrapper?.querySelector('.input-field') as HTMLSpanElement;\n assert.isOk(inputField);\n // The label input box should be editable after it is created and before anything else happened\n assert.isTrue(inputField.isContentEditable);\n });\n\n it('the label entry field is in focus after being double clicked on', async function() {\n const {parsedTrace} = await TraceLoader.traceEngine(this, 'web-dev.json.gz');\n const {overlays, container} = setupChartWithDimensionsAndAnnotationOverlayListeners(parsedTrace);\n const charts = createCharts(parsedTrace);\n const event = charts.mainProvider.eventByIndex?.(50);\n assert.isOk(event);\n\n // Since ENTRY_LABEL is AnnotationOverlay, create it through ModificationsManager\n Timeline.ModificationsManager.ModificationsManager.activeManager()?.createAnnotation({\n type: 'ENTRY_LABEL',\n label: '',\n entry: event as Trace.Types.Events.Event,\n });\n\n await overlays.update();\n const overlayDOM = container.querySelector('.overlay-type-ENTRY_LABEL');\n assert.isOk(overlayDOM);\n const component = overlayDOM?.querySelector('devtools-entry-label-overlay');\n assert.isOk(component?.shadowRoot);\n\n const elementsWrapper = component.shadowRoot.querySelector('.label-parts-wrapper');\n assert.isOk(elementsWrapper);\n const labelBox = elementsWrapper.querySelector('.input-field') as HTMLSpanElement;\n\n assert.isOk(labelBox);\n\n // The label input box should be editable after it is created and before anything else happened\n assert.isTrue(labelBox.isContentEditable);\n\n // Make the content to editable by changing the element blur like when clicking outside of it.\n // When that happens, the content should be set to not editable.\n labelBox.dispatchEvent(new FocusEvent('blur', {bubbles: true}));\n assert.isFalse(labelBox.isContentEditable);\n\n // Double click on the label to make it editable again\n labelBox.dispatchEvent(new FocusEvent('dblclick', {bubbles: true}));\n assert.isTrue(labelBox.isContentEditable);\n });\n });\n\n describe('traceWindowContainingOverlays', () => {\n it('calculates the smallest window that fits the overlay inside', () => {\n const FAKE_EVENT_1 = {\n ts: 0,\n dur: 10,\n } as Trace.Types.Events.Event;\n const FAKE_EVENT_2 = {\n ts: 5,\n dur: 100,\n } as Trace.Types.Events.Event;\n\n const overlay1: Overlays.Overlays.EntryOutline = {\n entry: FAKE_EVENT_1,\n type: 'ENTRY_OUTLINE',\n outlineReason: 'INFO',\n };\n const overlay2: Overlays.Overlays.EntryOutline = {\n entry: FAKE_EVENT_2,\n type: 'ENTRY_OUTLINE',\n outlineReason: 'INFO',\n };\n const traceWindow = Overlays.Overlays.traceWindowContainingOverlays([overlay1, overlay2]);\n if (!traceWindow) {\n throw new Error('No trace window for overlays');\n }\n\n assert.strictEqual(traceWindow.min, 0);\n assert.strictEqual(traceWindow.max, 105);\n });\n\n it('returns null for no overlays', () => {\n const traceWindow = Overlays.Overlays.traceWindowContainingOverlays([]);\n assert.isNull(traceWindow);\n });\n });\n\n describe('jslogcontext for overlays', () => {\n const FAKE_EVENT = {\n ts: 0,\n dur: 10,\n } as Trace.Types.Events.Event;\n\n it('does not define a log for an entry_selected overlay', () => {\n const overlay: Overlays.Overlays.EntrySelected = {\n type: 'ENTRY_SELECTED',\n entry: FAKE_EVENT,\n };\n const context = Overlays.Overlays.jsLogContext(overlay);\n assert.isNull(context);\n });\n\n it('defines a log for an entry outline based on its type', () => {\n const overlayInfo: Overlays.Overlays.EntryOutline = {\n type: 'ENTRY_OUTLINE',\n outlineReason: 'INFO',\n entry: FAKE_EVENT,\n };\n const overlayError: Overlays.Overlays.EntryOutline = {\n type: 'ENTRY_OUTLINE',\n outlineReason: 'ERROR',\n entry: FAKE_EVENT,\n };\n const infoContext = Overlays.Overlays.jsLogContext(overlayInfo);\n assert.strictEqual(infoContext, 'timeline.overlays.entry-outline-info');\n const errorContext = Overlays.Overlays.jsLogContext(overlayError);\n assert.strictEqual(errorContext, 'timeline.overlays.entry-outline-error');\n });\n\n it('defines a log for entry labels', () => {\n const overlay: Overlays.Overlays.EntryLabel = {\n type: 'ENTRY_LABEL',\n entry: FAKE_EVENT,\n label: 'hello world',\n };\n const context = Overlays.Overlays.jsLogContext(overlay);\n assert.strictEqual(context, 'timeline.overlays.entry-label');\n });\n\n it('defines a log for time ranges', () => {\n const overlay: Overlays.Overlays.TimeRangeLabel = {\n showDuration: true,\n type: 'TIME_RANGE',\n bounds: microsecondsTraceWindow(1_000, 10_000),\n label: 'hello world',\n };\n const context = Overlays.Overlays.jsLogContext(overlay);\n assert.strictEqual(context, 'timeline.overlays.time-range');\n });\n\n it('defines a log for timespan breakdowns', () => {\n const overlay: Overlays.Overlays.TimespanBreakdown = {\n type: 'TIMESPAN_BREAKDOWN',\n sections: [],\n };\n const context = Overlays.Overlays.jsLogContext(overlay);\n assert.strictEqual(context, 'timeline.overlays.timespan-breakdown');\n });\n\n it('defines a log for cursor timestamp marker', () => {\n const overlay: Overlays.Overlays.TimestampMarker = {\n type: 'TIMESTAMP_MARKER',\n timestamp: 1_000 as Trace.Types.Timing.MicroSeconds,\n };\n const context = Overlays.Overlays.jsLogContext(overlay);\n assert.strictEqual(context, 'timeline.overlays.cursor-timestamp-marker');\n });\n\n it('defines a log for candy striped time ranges', () => {\n const overlay: Overlays.Overlays.CandyStripedTimeRange = {\n type: 'CANDY_STRIPED_TIME_RANGE',\n bounds: microsecondsTraceWindow(1_000, 10_000),\n entry: FAKE_EVENT,\n };\n const context = Overlays.Overlays.jsLogContext(overlay);\n assert.strictEqual(context, 'timeline.overlays.candy-striped-time-range');\n });\n\n it('defines a log for entries links but only if they are connected', () => {\n const overlayConnected: Overlays.Overlays.EntriesLink = {\n type: 'ENTRIES_LINK',\n entryFrom: FAKE_EVENT,\n entryTo: FAKE_EVENT,\n state: Trace.Types.File.EntriesLinkState.CONNECTED,\n };\n const overlayPending: Overlays.Overlays.EntriesLink = {\n type: 'ENTRIES_LINK',\n entryFrom: FAKE_EVENT,\n entryTo: undefined,\n state: Trace.Types.File.EntriesLinkState.PENDING_TO_EVENT,\n };\n const connectedContext = Overlays.Overlays.jsLogContext(overlayConnected);\n assert.strictEqual(connectedContext, 'timeline.overlays.entries-link');\n\n const pendingContext = Overlays.Overlays.jsLogContext(overlayPending);\n assert.isNull(pendingContext);\n });\n });\n});\n"]} \ No newline at end of file +{"version":3,"file":"OverlaysImpl.test.js","sourceRoot":"","sources":["../../../../../../../front_end/panels/timeline/overlays/OverlaysImpl.test.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,KAAK,KAAK,MAAM,gCAAgC,CAAC;AACxD,OAAO,EAAC,uBAAuB,EAAC,MAAM,wCAAwC,CAAC;AAC/E,OAAO,EACL,gBAAgB,EAChB,uBAAuB,EACvB,sBAAsB,EACtB,iCAAiC,GAClC,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAAC,WAAW,EAAC,MAAM,iCAAiC,CAAC;AAC5D,OAAO,KAAK,iBAAiB,MAAM,iEAAiE,CAAC;AACrG,OAAO,KAAK,MAAM,MAAM,kDAAkD,CAAC;AAC3E,OAAO,KAAK,QAAQ,MAAM,gBAAgB,CAAC;AAE3C,OAAO,KAAK,UAAU,MAAM,4BAA4B,CAAC;AACzD,OAAO,KAAK,QAAQ,MAAM,eAAe,CAAC;AAE1C,MAAM,0BAA0B,GAA0C;IACxE,sBAAsB;QACpB,OAAO,KAAK,CAAC;IACf,CAAC;IACD,0BAA0B;QACxB,OAAO,IAAI,CAAC;IACd,CAAC;CACF,CAAC;AAEF;;;;GAIG;AACH,SAAS,YAAY,CAAC,WAA8C;IAClE,MAAM,YAAY,GAAG,IAAI,QAAQ,CAAC,8BAA8B,CAAC,8BAA8B,EAAE,CAAC;IAClG,MAAM,eAAe,GAAG,IAAI,QAAQ,CAAC,qCAAqC,CAAC,qCAAqC,EAAE,CAAC;IACnH,IAAI,WAAW,EAAE,CAAC;QAChB,YAAY,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC;QACnC,eAAe,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC;IACxC,CAAC;IAED,M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QAAQ,CAAC,YAAY,CAAC,cAAc,CAAC,CAAC;YACtE,MAAM,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC;QAChC,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["// Copyright 2024 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport * as Trace from '../../../models/trace/trace.js';\nimport {describeWithEnvironment} from '../../../testing/EnvironmentHelpers.js';\nimport {\n makeInstantEvent,\n microsecondsTraceWindow,\n MockFlameChartDelegate,\n setupIgnoreListManagerEnvironment,\n} from '../../../testing/TraceHelpers.js';\nimport {TraceLoader} from '../../../testing/TraceLoader.js';\nimport * as RenderCoordinator from '../../../ui/components/render_coordinator/render_coordinator.js';\nimport * as PerfUI from '../../../ui/legacy/components/perf_ui/perf_ui.js';\nimport * as Timeline from '../timeline.js';\n\nimport * as Components from './components/components.js';\nimport * as Overlays from './overlays.js';\n\nconst FAKE_OVERLAY_ENTRY_QUERIES: Overlays.Overlays.OverlayEntryQueries = {\n isEntryCollapsedByUser() {\n return false;\n },\n firstVisibleParentForEntry() {\n return null;\n },\n};\n\n/**\n * The Overlays expects to be provided with both the main and network charts\n * and data providers. This function creates all of those and optionally sets\n * the trace data for the providers if it is provided.\n */\nfunction createCharts(parsedTrace?: Trace.Handlers.Types.ParsedTrace): Overlays.Overlays.TimelineCharts {\n const mainProvider = new Timeline.TimelineFlameChartDataProvider.TimelineFlameChartDataProvider();\n const networkProvider = new Timeline.TimelineFlameChartNetworkDataProvider.TimelineFlameChartNetworkDataProvider();\n if (parsedTrace) {\n mainProvider.setModel(parsedTrace);\n networkProvider.setModel(parsedTrace);\n }\n\n const delegate = new MockFlameChartDelegate();\n const mainChart = new PerfUI.FlameChart.FlameChart(mainProvider, delegate);\n const networkChart = new PerfUI.FlameChart.FlameChart(networkProvider, delegate);\n // Add to DOM for offsetWidth, etc working\n document.body.append(mainChart.element, networkChart.element);\n\n if (parsedTrace) {\n // Force the charts to render. Normally the TimelineFlameChartView would do\n // this, but we aren't creating one for these tests.\n mainChart.update();\n networkChart.update();\n }\n\n return {\n mainProvider,\n mainChart,\n networkProvider,\n networkChart,\n };\n}\n\ndescribeWithEnvironment('Overlays', () => {\n beforeEach(() => {\n setupIgnoreListManagerEnvironment();\n });\n\n afterEach(() => {\n // Remove any FlameChart elements from the DOM\n document.body.querySelectorAll('widget').forEach(e => e.remove());\n });\n\n it('can calculate the x position of an event based on the dimensions and its timestamp', async () => {\n const flameChartsContainer = document.createElement('div');\n const mainFlameChartsContainer = flameChartsContainer.createChild('div');\n const networkFlameChartsContainer = flameChartsContainer.createChild('div');\n const container = flameChartsContainer.createChild('div');\n\n const overlays = new Overlays.Overlays.Overlays({\n container,\n flameChartsContainers: {\n main: mainFlameChartsContainer,\n network: networkFlameChartsContainer,\n },\n charts: createCharts(),\n entryQueries: FAKE_OVERLAY_ENTRY_QUERIES,\n });\n\n // Set up the dimensions so it is 100px wide\n overlays.updateChartDimensions('main', {\n widthPixels: 100,\n heightPixels: 50,\n scrollOffsetPixels: 0,\n allGroupsCollapsed: false,\n });\n overlays.updateChartDimensions('network', {\n widthPixels: 100,\n heightPixels: 50,\n scrollOffsetPixels: 0,\n allGroupsCollapsed: false,\n });\n\n const windowMin = Trace.Types.Timing.MicroSeconds(0);\n const windowMax = Trace.Types.Timing.MicroSeconds(100);\n // Set the visible window to be 0-100 microseconds\n overlays.updateVisibleWindow(Trace.Helpers.Timing.traceWindowFromMicroSeconds(windowMin, windowMax));\n\n // Now set an event to be at 50 microseconds.\n const event = makeInstantEvent('test-event', 50);\n\n const xPosition = overlays.xPixelForEventStartOnChart(event);\n assert.strictEqual(xPosition, 50);\n });\n\n it('can calculate the y position of a main chart event', async function() {\n const {parsedTrace} = await TraceLoader.traceEngine(this, 'web-dev.json.gz');\n const charts = createCharts(parsedTrace);\n\n const flameChartsContainer = document.createElement('div');\n const mainFlameChartsContainer = flameChartsContainer.createChild('div');\n const networkFlameChartsContainer = flameChartsContainer.createChild('div');\n const container = flameChartsContainer.createChild('div');\n\n const overlays = new Overlays.Overlays.Overlays({\n container,\n flameChartsContainers: {\n main: mainFlameChartsContainer,\n network: networkFlameChartsContainer,\n },\n charts,\n entryQueries: FAKE_OVERLAY_ENTRY_QUERIES,\n });\n\n overlays.updateChartDimensions('main', {\n widthPixels: 1000,\n heightPixels: 500,\n scrollOffsetPixels: 0,\n allGroupsCollapsed: false,\n });\n overlays.updateChartDimensions('network', {\n widthPixels: 1000,\n heightPixels: 200,\n scrollOffsetPixels: 0,\n allGroupsCollapsed: false,\n });\n\n // Set the visible window to be the entire trace.\n overlays.updateVisibleWindow(parsedTrace.Meta.traceBounds);\n\n const event = charts.mainProvider.eventByIndex?.(50);\n assert.isOk(event);\n const yPixel = overlays.yPixelForEventOnChart(event);\n // The Y offset for the main chart is 280px, but we add 208px on (200px for the\n // network chart, and 8px for the re-size handle) giving us the expected\n // 441px.\n assert.strictEqual(yPixel, 488);\n });\n\n it('can adjust the y position of a main chart event when the network track is collapsed', async function() {\n const {parsedTrace} = await TraceLoader.traceEngine(this, 'web-dev.json.gz');\n const charts = createCharts(parsedTrace);\n\n const flameChartsContainer = document.createElement('div');\n const mainFlameChartsContainer = flameChartsContainer.createChild('div');\n const networkFlameChartsContainer = flameChartsContainer.createChild('div');\n const container = flameChartsContainer.createChild('div');\n\n const overlays = new Overlays.Overlays.Overlays({\n container,\n flameChartsContainers: {\n main: mainFlameChartsContainer,\n network: networkFlameChartsContainer,\n },\n charts,\n entryQueries: FAKE_OVERLAY_ENTRY_QUERIES,\n });\n\n overlays.updateChartDimensions('main', {\n widthPixels: 1000,\n heightPixels: 500,\n scrollOffsetPixels: 0,\n allGroupsCollapsed: false,\n });\n overlays.updateChartDimensions('network', {\n widthPixels: 1000,\n heightPixels: 34,\n scrollOffsetPixels: 0,\n // Make the network track collapsed\n allGroupsCollapsed: true,\n });\n\n // Set the visible window to be the entire trace.\n overlays.updateVisibleWindow(parsedTrace.Meta.traceBounds);\n\n const event = charts.mainProvider.eventByIndex?.(50);\n assert.isOk(event);\n const yPixel = overlays.yPixelForEventOnChart(event);\n // The Y offset for the main chart is 280px, but we add 34px on (the height\n // of the collapsed network chart, with no resizer bar as it is hidden when\n // the network track is collapsed). This gives us 280+34 = 314.\n assert.strictEqual(yPixel, 314);\n });\n\n it('can calculate the y position of a network chart event', async function() {\n const {parsedTrace} = await TraceLoader.traceEngine(this, 'web-dev.json.gz');\n const charts = createCharts(parsedTrace);\n\n const flameChartsContainer = document.createElement('div');\n const mainFlameChartsContainer = flameChartsContainer.createChild('div');\n const networkFlameChartsContainer = flameChartsContainer.createChild('div');\n const container = flameChartsContainer.createChild('div');\n\n const overlays = new Overlays.Overlays.Overlays({\n container,\n flameChartsContainers: {\n main: mainFlameChartsContainer,\n network: networkFlameChartsContainer,\n },\n charts,\n entryQueries: FAKE_OVERLAY_ENTRY_QUERIES,\n });\n\n overlays.updateChartDimensions('main', {\n widthPixels: 1000,\n heightPixels: 500,\n scrollOffsetPixels: 0,\n allGroupsCollapsed: false,\n });\n overlays.updateChartDimensions('network', {\n widthPixels: 1000,\n heightPixels: 200,\n scrollOffsetPixels: 0,\n allGroupsCollapsed: false,\n });\n\n // Set the visible window to be the entire trace.\n overlays.updateVisibleWindow(parsedTrace.Meta.traceBounds);\n\n // Fake the level being visible: because we don't fully render the chart we\n // need to fake this for this test.\n sinon.stub(charts.networkChart, 'levelIsVisible').callsFake(() => true);\n\n // Find an event on the network chart\n const event = charts.networkProvider.eventByIndex?.(0);\n assert.isOk(event);\n const yPixel = overlays.yPixelForEventOnChart(event);\n // This event is in the first level, but the first level has some offset\n // above it to allow for the header row and the row with the timestamps on\n // it, hence why this value is not 0px.\n assert.strictEqual(yPixel, 34);\n });\n\n describe('rendering overlays', () => {\n function setupChartWithDimensionsAndAnnotationOverlayListeners(parsedTrace: Trace.Handlers.Types.ParsedTrace): {\n container: HTMLElement,\n overlays: Overlays.Overlays.Overlays,\n charts: Overlays.Overlays.TimelineCharts,\n } {\n const charts = createCharts(parsedTrace);\n\n const flameChartsContainer = document.createElement('div');\n const mainFlameChartsContainer = flameChartsContainer.createChild('div');\n const networkFlameChartsContainer = flameChartsContainer.createChild('div');\n const container = flameChartsContainer.createChild('div');\n\n const overlays = new Overlays.Overlays.Overlays({\n container,\n flameChartsContainers: {\n main: mainFlameChartsContainer,\n network: networkFlameChartsContainer,\n },\n charts,\n entryQueries: FAKE_OVERLAY_ENTRY_QUERIES,\n });\n const currManager = Timeline.ModificationsManager.ModificationsManager.activeManager();\n // The Annotations Overlays are added through the ModificationsManager listener\n currManager?.addEventListener(Timeline.ModificationsManager.AnnotationModifiedEvent.eventName, async event => {\n const {overlay, action} = (event as Timeline.ModificationsManager.AnnotationModifiedEvent);\n if (action === 'Add') {\n overlays.add(overlay);\n }\n await overlays.update();\n });\n\n // When an annotation overlay is remomved, this event is dispatched to the Modifications Manager.\n overlays.addEventListener(Overlays.Overlays.AnnotationOverlayActionEvent.eventName, async event => {\n const {overlay, action} = (event as Overlays.Overlays.AnnotationOverlayActionEvent);\n if (action === 'Remove') {\n overlays.remove(overlay);\n }\n await overlays.update();\n });\n\n overlays.updateChartDimensions('main', {\n widthPixels: 1000,\n heightPixels: 500,\n scrollOffsetPixels: 0,\n allGroupsCollapsed: false,\n });\n overlays.updateChartDimensions('network', {\n widthPixels: 1000,\n heightPixels: 200,\n scrollOffsetPixels: 0,\n allGroupsCollapsed: false,\n });\n\n // Set the visible window to be the entire trace.\n overlays.updateVisibleWindow(parsedTrace.Meta.traceBounds);\n return {overlays, container, charts};\n }\n\n it('can render an entry selected overlay', async function() {\n const {parsedTrace} = await TraceLoader.traceEngine(this, 'web-dev.json.gz');\n const {overlays, container, charts} = setupChartWithDimensionsAndAnnotationOverlayListeners(parsedTrace);\n const event = charts.mainProvider.eventByIndex?.(50);\n assert.isOk(event);\n\n overlays.add({\n type: 'ENTRY_SELECTED',\n entry: event,\n });\n await overlays.update();\n\n // Ensure that the overlay was created.\n const overlayDOM = container.querySelector('.overlay-type-ENTRY_SELECTED');\n assert.isOk(overlayDOM);\n });\n\n it('renders an ENTRY_OUTLINE even if the entry is also the ENTRY_SELECTED entry', async function() {\n const {parsedTrace} = await TraceLoader.traceEngine(this, 'web-dev.json.gz');\n const {overlays, container, charts} = setupChartWithDimensionsAndAnnotationOverlayListeners(parsedTrace);\n const event = charts.mainProvider.eventByIndex?.(50);\n assert.isOk(event);\n overlays.add({\n type: 'ENTRY_OUTLINE',\n entry: event,\n outlineReason: 'ERROR',\n });\n await overlays.update();\n\n const outlineVisible =\n container.querySelector('.overlay-type-ENTRY_OUTLINE')?.style.display === 'block';\n assert.isTrue(outlineVisible, 'The ENTRY_OUTLINE should be visible');\n\n // Now make a selected entry too\n overlays.add({\n type: 'ENTRY_SELECTED',\n entry: event,\n });\n await overlays.update();\n const outlineStillVisible =\n container.querySelector('.overlay-type-ENTRY_OUTLINE')?.style.display === 'block';\n assert.isTrue(outlineStillVisible, 'The ENTRY_OUTLINE should be visible');\n });\n\n it('only ever renders a single selected overlay', async function() {\n const {parsedTrace} = await TraceLoader.traceEngine(this, 'web-dev.json.gz');\n const {overlays, container, charts} = setupChartWithDimensionsAndAnnotationOverlayListeners(parsedTrace);\n const event1 = charts.mainProvider.eventByIndex?.(50);\n const event2 = charts.mainProvider.eventByIndex?.(51);\n assert.isOk(event1);\n assert.isOk(event2);\n\n overlays.add({\n type: 'ENTRY_SELECTED',\n entry: event1,\n });\n await overlays.update();\n overlays.add({\n type: 'ENTRY_SELECTED',\n entry: event2,\n });\n await overlays.update();\n\n // There should only be one of these\n const entrySelectedOverlays = container.querySelectorAll('.overlay-type-ENTRY_SELECTED');\n assert.lengthOf(entrySelectedOverlays, 1);\n });\n\n it('can render entry label overlay', async function() {\n const {parsedTrace} = await TraceLoader.traceEngine(this, 'web-dev.json.gz');\n const {overlays, container, charts} = setupChartWithDimensionsAndAnnotationOverlayListeners(parsedTrace);\n const event = charts.mainProvider.eventByIndex?.(50);\n assert.isOk(event);\n\n overlays.add({\n type: 'ENTRY_LABEL',\n entry: event,\n label: 'entry label',\n });\n await overlays.update();\n\n // Ensure that the overlay was created.\n const overlayDOM = container.querySelector('.overlay-type-ENTRY_LABEL');\n assert.isOk(overlayDOM);\n });\n\n it('toggles overlays container display', async function() {\n const {parsedTrace} = await TraceLoader.traceEngine(this, 'web-dev.json.gz');\n const {overlays, container} = setupChartWithDimensionsAndAnnotationOverlayListeners(parsedTrace);\n\n overlays.toggleAllOverlaysDisplayed(true);\n await overlays.update();\n\n assert.strictEqual(container.style.display, 'block');\n\n overlays.toggleAllOverlaysDisplayed(false);\n await overlays.update();\n\n assert.strictEqual(container.style.display, 'none');\n\n overlays.toggleAllOverlaysDisplayed(true);\n await overlays.update();\n\n assert.strictEqual(container.style.display, 'block');\n });\n\n it('only renders one TIMESTAMP_MARKER as it is a singleton', async function() {\n const {parsedTrace} = await TraceLoader.traceEngine(this, 'web-dev.json.gz');\n const {overlays, container} = setupChartWithDimensionsAndAnnotationOverlayListeners(parsedTrace);\n overlays.add({\n type: 'TIMESTAMP_MARKER',\n timestamp: parsedTrace.Meta.traceBounds.min,\n });\n overlays.add({\n type: 'TIMESTAMP_MARKER',\n timestamp: parsedTrace.Meta.traceBounds.max,\n });\n await overlays.update();\n assert.lengthOf(container.children, 1);\n });\n\n it('can render the label for entry label overlay', async function() {\n const {parsedTrace} = await TraceLoader.traceEngine(this, 'web-dev.json.gz');\n const {overlays, container, charts} = setupChartWithDimensionsAndAnnotationOverlayListeners(parsedTrace);\n const event = charts.mainProvider.eventByIndex?.(50);\n assert.isOk(event);\n\n overlays.add({\n type: 'ENTRY_LABEL',\n entry: event,\n label: 'entry label',\n });\n await overlays.update();\n\n const overlayDOM = container.querySelector('.overlay-type-ENTRY_LABEL');\n assert.isOk(overlayDOM);\n const component = overlayDOM?.querySelector('devtools-entry-label-overlay');\n assert.isOk(component?.shadowRoot);\n\n const elementsWrapper = component.shadowRoot.querySelector('.label-parts-wrapper');\n assert.isOk(elementsWrapper);\n\n const inputField = elementsWrapper.querySelector('.input-field');\n assert.isOk(inputField);\n\n assert.strictEqual(inputField?.innerText, 'entry label');\n });\n\n it('Inputting `Enter`into label overlay makes it non-editable', async function() {\n const {parsedTrace} = await TraceLoader.traceEngine(this, 'web-dev.json.gz');\n const {overlays, container, charts} = setupChartWithDimensionsAndAnnotationOverlayListeners(parsedTrace);\n const event = charts.mainProvider.eventByIndex?.(50);\n assert.isOk(event);\n\n // Create an entry label overlay\n overlays.add({\n type: 'ENTRY_LABEL',\n entry: event,\n label: 'label',\n });\n await overlays.update();\n\n // Ensure that the overlay was created.\n const overlayDOM = container.querySelector('.overlay-type-ENTRY_LABEL');\n assert.isOk(overlayDOM);\n\n const component = overlayDOM?.querySelector('devtools-entry-label-overlay');\n assert.isOk(component?.shadowRoot);\n component.connectedCallback();\n const elementsWrapper = component.shadowRoot.querySelector('.label-parts-wrapper');\n assert.isOk(elementsWrapper);\n\n const inputField = elementsWrapper.querySelector('.input-field');\n assert.isOk(inputField);\n\n // Double click on the label box to make it editable and focus on it\n inputField.dispatchEvent(new FocusEvent('dblclick', {bubbles: true}));\n\n // Ensure the label content is editable\n assert.isTrue(inputField.isContentEditable);\n\n // Press `Enter` to make the lable not editable\n inputField.dispatchEvent(new KeyboardEvent('keydown', {key: 'Enter', cancelable: true, bubbles: true}));\n\n // Ensure the label content is not editable\n assert.isFalse(inputField.isContentEditable);\n });\n\n it('Inputting `Enter` into time range label field when the label is empty removes the overlay', async function() {\n const {parsedTrace} = await TraceLoader.traceEngine(this, 'web-dev.json.gz');\n const {overlays, container, charts} = setupChartWithDimensionsAndAnnotationOverlayListeners(parsedTrace);\n const event = charts.mainProvider.eventByIndex?.(50);\n assert.isOk(event);\n\n // Create a time range overlay with an empty label\n overlays.add({\n type: 'TIME_RANGE',\n label: '',\n showDuration: true,\n // Make this overlay the entire span of the trace\n bounds: parsedTrace.Meta.traceBounds,\n });\n await overlays.update();\n\n // Ensure that the overlay was created.\n const overlayDOM = container.querySelector('.overlay-type-TIME_RANGE');\n assert.isOk(overlayDOM);\n\n const component = overlayDOM?.querySelector('devtools-time-range-overlay');\n assert.isOk(component?.shadowRoot);\n component.connectedCallback();\n const rangeContainer = component.shadowRoot.querySelector('.range-container');\n assert.isOk(rangeContainer);\n\n const labelBox = rangeContainer.querySelector('.label-text');\n assert.isOk(labelBox);\n\n // Double click on the label box to make it editable and focus on it\n labelBox.dispatchEvent(new FocusEvent('dblclick', {bubbles: true}));\n\n // Press `Enter` on the label field\n labelBox.dispatchEvent(new KeyboardEvent('keydown', {key: 'Enter', cancelable: true, bubbles: true}));\n\n // Ensure that the entry overlay has been removed because it was saved empty\n assert.lengthOf(overlays.overlaysOfType('TIME_RANGE'), 0);\n });\n\n it('Inputting `Enter` into time range label field when the label is not empty does not remove the overlay',\n async function() {\n const {parsedTrace} = await TraceLoader.traceEngine(this, 'web-dev.json.gz');\n const {overlays, container, charts} = setupChartWithDimensionsAndAnnotationOverlayListeners(parsedTrace);\n const event = charts.mainProvider.eventByIndex?.(50);\n assert.isOk(event);\n\n // Create a time range overlay with a label\n overlays.add({\n type: 'TIME_RANGE',\n label: 'label',\n showDuration: true,\n // Make this overlay the entire span of the trace\n bounds: parsedTrace.Meta.traceBounds,\n });\n await overlays.update();\n\n // Ensure that the overlay was created.\n const overlayDOM = container.querySelector('.overlay-type-TIME_RANGE');\n assert.isOk(overlayDOM);\n\n const component = overlayDOM?.querySelector('devtools-time-range-overlay');\n assert.isOk(component?.shadowRoot);\n component.connectedCallback();\n const rangeContainer = component.shadowRoot.querySelector('.range-container');\n assert.isOk(rangeContainer);\n\n const labelBox = rangeContainer.querySelector('.label-text');\n assert.isOk(labelBox);\n\n // Double click on the label box to make it editable and focus on it\n labelBox.dispatchEvent(new FocusEvent('dblclick', {bubbles: true}));\n\n // Press `Enter` on the label field\n labelBox.dispatchEvent(new KeyboardEvent('keydown', {key: 'Enter', cancelable: true, bubbles: true}));\n\n // Ensure that the entry overlay has not been because it was has a non-empty label\n assert.lengthOf(overlays.overlaysOfType('TIME_RANGE'), 1);\n });\n\n it('Can create multiple Time Range Overlays for Time Range annotations', async function() {\n const {parsedTrace} = await TraceLoader.traceEngine(this, 'web-dev.json.gz');\n const {overlays, charts} = setupChartWithDimensionsAndAnnotationOverlayListeners(parsedTrace);\n const event = charts.mainProvider.eventByIndex?.(50);\n assert.isOk(event);\n\n Timeline.ModificationsManager.ModificationsManager.activeManager()?.createAnnotation({\n type: 'TIME_RANGE',\n label: 'label',\n bounds: parsedTrace.Meta.traceBounds,\n });\n\n Timeline.ModificationsManager.ModificationsManager.activeManager()?.createAnnotation({\n type: 'TIME_RANGE',\n label: 'label2',\n bounds: parsedTrace.Meta.traceBounds,\n });\n await overlays.update();\n\n assert.lengthOf(overlays.overlaysOfType('TIME_RANGE'), 2);\n });\n\n it('Removes empty label if it is empty when navigated away from (removed focused from)', async function() {\n const {parsedTrace} = await TraceLoader.traceEngine(this, 'web-dev.json.gz');\n const {overlays, container, charts} = setupChartWithDimensionsAndAnnotationOverlayListeners(parsedTrace);\n const event = charts.mainProvider.eventByIndex?.(50);\n assert.isOk(event);\n\n // Create an entry label overlay\n Timeline.ModificationsManager.ModificationsManager.activeManager()?.createAnnotation({\n type: 'ENTRY_LABEL',\n entry: event as Trace.Types.Events.Event,\n label: '',\n });\n await overlays.update();\n\n // Ensure that the overlay was created.\n const overlayDOM = container.querySelector('.overlay-type-ENTRY_LABEL');\n assert.isOk(overlayDOM);\n const component = overlayDOM?.querySelector('devtools-entry-label-overlay');\n assert.isOk(component?.shadowRoot);\n\n component.connectedCallback();\n const elementsWrapper = component.shadowRoot.querySelector('.label-parts-wrapper');\n assert.isOk(elementsWrapper);\n\n const inputField = elementsWrapper.querySelector('.input-field');\n assert.isOk(inputField);\n\n // Double click on the label box to make it editable and focus on it\n inputField.dispatchEvent(new FocusEvent('dblclick', {bubbles: true}));\n\n // Ensure that the entry has 1 overlay\n assert.lengthOf(overlays.overlaysForEntry(event), 1);\n\n // Change the content to not editable by changing the element blur like when clicking outside of it.\n // The label is empty since no initial value was passed into it and no characters were entered.\n inputField.dispatchEvent(new FocusEvent('blur', {bubbles: true}));\n\n // Ensure that the entry overlay has been removed because it was saved empty\n assert.lengthOf(overlays.overlaysForEntry(event), 0);\n });\n\n it('Update label overlay when the label changes', async function() {\n const {parsedTrace} = await TraceLoader.traceEngine(this, 'web-dev.json.gz');\n const {overlays, container, charts} = setupChartWithDimensionsAndAnnotationOverlayListeners(parsedTrace);\n const event = charts.mainProvider.eventByIndex?.(50);\n assert.isOk(event);\n\n // Create an entry label overlay\n Timeline.ModificationsManager.ModificationsManager.activeManager()?.createAnnotation({\n type: 'ENTRY_LABEL',\n entry: event as Trace.Types.Events.Event,\n label: '',\n });\n await overlays.update();\n\n // Ensure that the overlay was created.\n const overlayDOM = container.querySelector('.overlay-type-ENTRY_LABEL');\n assert.isOk(overlayDOM);\n const component = overlayDOM?.querySelector('devtools-entry-label-overlay');\n assert.isOk(component?.shadowRoot);\n\n component.connectedCallback();\n component.dispatchEvent(new Components.EntryLabelOverlay.EntryLabelChangeEvent('new label'));\n\n const updatedOverlay = overlays.overlaysForEntry(event)[0] as Overlays.Overlays.EntryLabel;\n assert.isOk(updatedOverlay);\n // Make sure the label was updated in the Overlay Object\n assert.strictEqual(updatedOverlay.label, 'new label');\n });\n\n it('creates an overlay for a time range when an time range annotation is created', async function() {\n const {parsedTrace} = await TraceLoader.traceEngine(this, 'web-dev.json.gz');\n const {overlays, container} = setupChartWithDimensionsAndAnnotationOverlayListeners(parsedTrace);\n\n // Since TIME_RANGE is AnnotationOverlay, create it through ModificationsManager\n Timeline.ModificationsManager.ModificationsManager.activeManager()?.createAnnotation({\n type: 'TIME_RANGE',\n label: '',\n // Make this overlay the entire span of the trace\n bounds: parsedTrace.Meta.traceBounds,\n });\n await overlays.update();\n const overlayDOM = container.querySelector('.overlay-type-TIME_RANGE');\n assert.isOk(overlayDOM);\n });\n\n it('can render an overlay for a time range', async function() {\n const {parsedTrace} = await TraceLoader.traceEngine(this, 'web-dev.json.gz');\n const {overlays, container} = setupChartWithDimensionsAndAnnotationOverlayListeners(parsedTrace);\n overlays.add({\n type: 'TIME_RANGE',\n label: '',\n showDuration: true,\n // Make this overlay the entire span of the trace\n bounds: parsedTrace.Meta.traceBounds,\n });\n await overlays.update();\n const overlayDOM = container.querySelector('.overlay-type-TIME_RANGE');\n assert.isOk(overlayDOM);\n });\n\n it('can update a time range overlay with new bounds', async function() {\n const {parsedTrace} = await TraceLoader.traceEngine(this, 'web-dev.json.gz');\n const {overlays, container} = setupChartWithDimensionsAndAnnotationOverlayListeners(parsedTrace);\n const rangeOverlay = overlays.add({\n type: 'TIME_RANGE',\n label: '',\n showDuration: true,\n // Make this overlay the entire span of the trace\n bounds: parsedTrace.Meta.traceBounds,\n });\n await overlays.update();\n const overlayDOM = container.querySelector('.overlay-type-TIME_RANGE');\n assert.isOk(overlayDOM);\n const firstWidth = window.parseInt(overlayDOM.style.width);\n\n // change the bounds so the new min is +1second of time.\n const newBounds = Trace.Helpers.Timing.traceWindowFromMicroSeconds(\n Trace.Types.Timing.MicroSeconds(rangeOverlay.bounds.min + (1_000 * 1_000)),\n rangeOverlay.bounds.max,\n );\n overlays.updateExisting(rangeOverlay, {bounds: newBounds});\n await overlays.update();\n const secondWidth = window.parseInt(overlayDOM.style.width);\n // The new time range is smaller so the DOM element should have less width\n assert.isTrue(secondWidth < firstWidth);\n });\n\n it('renders the overlay for a selected layout shift entry correctly', async function() {\n const {parsedTrace} = await TraceLoader.traceEngine(this, 'cls-single-frame.json.gz');\n const {overlays, container} = setupChartWithDimensionsAndAnnotationOverlayListeners(parsedTrace);\n const layoutShiftEvent = parsedTrace.LayoutShifts.clusters.at(0)?.events.at(0);\n if (!layoutShiftEvent) {\n throw new Error('layoutShiftEvent was unexpectedly undefined');\n }\n overlays.add({\n type: 'ENTRY_SELECTED',\n entry: layoutShiftEvent,\n });\n const boundsRange = Trace.Types.Timing.MicroSeconds(20_000);\n const boundsMax = Trace.Types.Timing.MicroSeconds(layoutShiftEvent.ts + boundsRange);\n overlays.updateVisibleWindow({min: layoutShiftEvent.ts, max: boundsMax, range: boundsRange});\n await overlays.update();\n const overlayDOM = container.querySelector('.overlay-type-ENTRY_SELECTED');\n assert.isOk(overlayDOM);\n assert.strictEqual(window.parseInt(overlayDOM.style.width), 17);\n });\n\n it('renders the duration and label for a time range overlay', async function() {\n const {parsedTrace} = await TraceLoader.traceEngine(this, 'web-dev.json.gz');\n const {overlays, container} = setupChartWithDimensionsAndAnnotationOverlayListeners(parsedTrace);\n overlays.add({\n type: 'TIME_RANGE',\n label: '',\n showDuration: true,\n // Make this overlay the entire span of the trace\n bounds: parsedTrace.Meta.traceBounds,\n });\n await overlays.update();\n await RenderCoordinator.done();\n const overlayDOM = container.querySelector('.overlay-type-TIME_RANGE');\n const component = overlayDOM?.querySelector('devtools-time-range-overlay');\n assert.isOk(component?.shadowRoot);\n const rangeContainer = component.shadowRoot.querySelector('.range-container');\n assert.isOk(rangeContainer);\n const duration = rangeContainer.querySelector('.duration');\n assert.isOk(duration);\n assert.strictEqual(duration?.innerText, '1.26\\xA0s');\n });\n\n it('can remove an overlay', async function() {\n const {parsedTrace} = await TraceLoader.traceEngine(this, 'web-dev.json.gz');\n const {overlays, container, charts} = setupChartWithDimensionsAndAnnotationOverlayListeners(parsedTrace);\n const event = charts.mainProvider.eventByIndex?.(50);\n assert.isOk(event);\n\n const selectedOverlay = overlays.add({\n type: 'ENTRY_SELECTED',\n entry: event,\n });\n await overlays.update();\n assert.lengthOf(container.children, 1);\n\n overlays.remove(selectedOverlay);\n await overlays.update();\n assert.lengthOf(container.children, 0);\n });\n\n it('can render an entry selected overlay for a frame', async function() {\n const {parsedTrace} = await TraceLoader.traceEngine(this, 'web-dev-with-commit.json.gz');\n const {overlays, container, charts} = setupChartWithDimensionsAndAnnotationOverlayListeners(parsedTrace);\n const timelineFrame = charts.mainProvider.eventByIndex?.(5);\n assert.isOk(timelineFrame);\n\n overlays.add({\n type: 'ENTRY_SELECTED',\n entry: timelineFrame,\n });\n await overlays.update();\n\n // Ensure that the overlay was created.\n const overlayDOM = container.querySelector('.overlay-type-ENTRY_SELECTED');\n assert.isOk(overlayDOM);\n });\n\n it('can return a list of overlays for an entry', async function() {\n const {parsedTrace} = await TraceLoader.traceEngine(this, 'web-dev.json.gz');\n const {overlays, charts} = setupChartWithDimensionsAndAnnotationOverlayListeners(parsedTrace);\n const event = charts.mainProvider.eventByIndex?.(50);\n assert.isOk(event);\n\n overlays.add({\n type: 'ENTRY_SELECTED',\n entry: event,\n });\n\n const existingOverlays = overlays.overlaysForEntry(event);\n assert.deepEqual(existingOverlays, [{\n type: 'ENTRY_SELECTED',\n entry: event,\n }]);\n });\n\n it('can delete overlays and remove them from the DOM', async function() {\n const {parsedTrace} = await TraceLoader.traceEngine(this, 'web-dev.json.gz');\n const {container, overlays, charts} = setupChartWithDimensionsAndAnnotationOverlayListeners(parsedTrace);\n const event = charts.mainProvider.eventByIndex?.(50);\n assert.isOk(event);\n\n overlays.add({\n type: 'ENTRY_SELECTED',\n entry: event,\n });\n await overlays.update();\n\n assert.lengthOf(container.children, 1);\n const removedCount = overlays.removeOverlaysOfType('ENTRY_SELECTED');\n assert.strictEqual(removedCount, 1);\n assert.lengthOf(container.children, 0);\n });\n\n it('the label entry field is editable when created', async function() {\n const {parsedTrace} = await TraceLoader.traceEngine(this, 'web-dev.json.gz');\n const {overlays, container} = setupChartWithDimensionsAndAnnotationOverlayListeners(parsedTrace);\n const charts = createCharts(parsedTrace);\n const event = charts.mainProvider.eventByIndex?.(50);\n assert.isOk(event);\n\n // Since ENTRY_LABEL is AnnotationOverlay, create it through ModificationsManager\n Timeline.ModificationsManager.ModificationsManager.activeManager()?.createAnnotation({\n type: 'ENTRY_LABEL',\n label: '',\n entry: event as Trace.Types.Events.Event,\n });\n\n await overlays.update();\n const overlayDOM = container.querySelector('.overlay-type-ENTRY_LABEL');\n assert.isOk(overlayDOM);\n const component = overlayDOM?.querySelector('devtools-entry-label-overlay');\n assert.isOk(component?.shadowRoot);\n\n const elementsWrapper = component.shadowRoot.querySelector('.label-parts-wrapper');\n const inputField = elementsWrapper?.querySelector('.input-field') as HTMLSpanElement;\n assert.isOk(inputField);\n // The label input box should be editable after it is created and before anything else happened\n assert.isTrue(inputField.isContentEditable);\n });\n\n it('the label entry field is in focus after being double clicked on', async function() {\n const {parsedTrace} = await TraceLoader.traceEngine(this, 'web-dev.json.gz');\n const {overlays, container} = setupChartWithDimensionsAndAnnotationOverlayListeners(parsedTrace);\n const charts = createCharts(parsedTrace);\n const event = charts.mainProvider.eventByIndex?.(50);\n assert.isOk(event);\n\n // Since ENTRY_LABEL is AnnotationOverlay, create it through ModificationsManager\n Timeline.ModificationsManager.ModificationsManager.activeManager()?.createAnnotation({\n type: 'ENTRY_LABEL',\n label: '',\n entry: event as Trace.Types.Events.Event,\n });\n\n await overlays.update();\n const overlayDOM = container.querySelector('.overlay-type-ENTRY_LABEL');\n assert.isOk(overlayDOM);\n const component = overlayDOM?.querySelector('devtools-entry-label-overlay');\n assert.isOk(component?.shadowRoot);\n\n const elementsWrapper = component.shadowRoot.querySelector('.label-parts-wrapper');\n assert.isOk(elementsWrapper);\n const labelBox = elementsWrapper.querySelector('.input-field') as HTMLSpanElement;\n\n assert.isOk(labelBox);\n\n // The label input box should be editable after it is created and before anything else happened\n assert.isTrue(labelBox.isContentEditable);\n\n // Make the content to editable by changing the element blur like when clicking outside of it.\n // When that happens, the content should be set to not editable.\n labelBox.dispatchEvent(new FocusEvent('blur', {bubbles: true}));\n assert.isFalse(labelBox.isContentEditable);\n\n // Double click on the label to make it editable again\n labelBox.dispatchEvent(new FocusEvent('dblclick', {bubbles: true}));\n assert.isTrue(labelBox.isContentEditable);\n });\n });\n\n describe('traceWindowContainingOverlays', () => {\n it('calculates the smallest window that fits the overlay inside', () => {\n const FAKE_EVENT_1 = {\n ts: 0,\n dur: 10,\n } as Trace.Types.Events.Event;\n const FAKE_EVENT_2 = {\n ts: 5,\n dur: 100,\n } as Trace.Types.Events.Event;\n\n const overlay1: Overlays.Overlays.EntryOutline = {\n entry: FAKE_EVENT_1,\n type: 'ENTRY_OUTLINE',\n outlineReason: 'INFO',\n };\n const overlay2: Overlays.Overlays.EntryOutline = {\n entry: FAKE_EVENT_2,\n type: 'ENTRY_OUTLINE',\n outlineReason: 'INFO',\n };\n const traceWindow = Overlays.Overlays.traceWindowContainingOverlays([overlay1, overlay2]);\n if (!traceWindow) {\n throw new Error('No trace window for overlays');\n }\n\n assert.strictEqual(traceWindow.min, 0);\n assert.strictEqual(traceWindow.max, 105);\n });\n\n it('returns null for no overlays', () => {\n const traceWindow = Overlays.Overlays.traceWindowContainingOverlays([]);\n assert.isNull(traceWindow);\n });\n });\n\n describe('jslogcontext for overlays', () => {\n const FAKE_EVENT = {\n ts: 0,\n dur: 10,\n } as Trace.Types.Events.Event;\n\n it('does not define a log for an entry_selected overlay', () => {\n const overlay: Overlays.Overlays.EntrySelected = {\n type: 'ENTRY_SELECTED',\n entry: FAKE_EVENT,\n };\n const context = Overlays.Overlays.jsLogContext(overlay);\n assert.isNull(context);\n });\n\n it('defines a log for an entry outline based on its type', () => {\n const overlayInfo: Overlays.Overlays.EntryOutline = {\n type: 'ENTRY_OUTLINE',\n outlineReason: 'INFO',\n entry: FAKE_EVENT,\n };\n const overlayError: Overlays.Overlays.EntryOutline = {\n type: 'ENTRY_OUTLINE',\n outlineReason: 'ERROR',\n entry: FAKE_EVENT,\n };\n const infoContext = Overlays.Overlays.jsLogContext(overlayInfo);\n assert.strictEqual(infoContext, 'timeline.overlays.entry-outline-info');\n const errorContext = Overlays.Overlays.jsLogContext(overlayError);\n assert.strictEqual(errorContext, 'timeline.overlays.entry-outline-error');\n });\n\n it('defines a log for entry labels', () => {\n const overlay: Overlays.Overlays.EntryLabel = {\n type: 'ENTRY_LABEL',\n entry: FAKE_EVENT,\n label: 'hello world',\n };\n const context = Overlays.Overlays.jsLogContext(overlay);\n assert.strictEqual(context, 'timeline.overlays.entry-label');\n });\n\n it('defines a log for time ranges', () => {\n const overlay: Overlays.Overlays.TimeRangeLabel = {\n showDuration: true,\n type: 'TIME_RANGE',\n bounds: microsecondsTraceWindow(1_000, 10_000),\n label: 'hello world',\n };\n const context = Overlays.Overlays.jsLogContext(overlay);\n assert.strictEqual(context, 'timeline.overlays.time-range');\n });\n\n it('defines a log for timespan breakdowns', () => {\n const overlay: Overlays.Overlays.TimespanBreakdown = {\n type: 'TIMESPAN_BREAKDOWN',\n sections: [],\n };\n const context = Overlays.Overlays.jsLogContext(overlay);\n assert.strictEqual(context, 'timeline.overlays.timespan-breakdown');\n });\n\n it('defines a log for cursor timestamp marker', () => {\n const overlay: Overlays.Overlays.TimestampMarker = {\n type: 'TIMESTAMP_MARKER',\n timestamp: 1_000 as Trace.Types.Timing.MicroSeconds,\n };\n const context = Overlays.Overlays.jsLogContext(overlay);\n assert.strictEqual(context, 'timeline.overlays.cursor-timestamp-marker');\n });\n\n it('defines a log for candy striped time ranges', () => {\n const overlay: Overlays.Overlays.CandyStripedTimeRange = {\n type: 'CANDY_STRIPED_TIME_RANGE',\n bounds: microsecondsTraceWindow(1_000, 10_000),\n entry: FAKE_EVENT,\n };\n const context = Overlays.Overlays.jsLogContext(overlay);\n assert.strictEqual(context, 'timeline.overlays.candy-striped-time-range');\n });\n\n it('defines a log for entries links but only if they are connected', () => {\n const overlayConnected: Overlays.Overlays.EntriesLink = {\n type: 'ENTRIES_LINK',\n entryFrom: FAKE_EVENT,\n entryTo: FAKE_EVENT,\n state: Trace.Types.File.EntriesLinkState.CONNECTED,\n };\n const overlayPending: Overlays.Overlays.EntriesLink = {\n type: 'ENTRIES_LINK',\n entryFrom: FAKE_EVENT,\n entryTo: undefined,\n state: Trace.Types.File.EntriesLinkState.PENDING_TO_EVENT,\n };\n const connectedContext = Overlays.Overlays.jsLogContext(overlayConnected);\n assert.strictEqual(connectedContext, 'timeline.overlays.entries-link');\n\n const pendingContext = Overlays.Overlays.jsLogContext(overlayPending);\n assert.isNull(pendingContext);\n });\n });\n});\n"]} \ No newline at end of file diff --git a/public/panels/timeline/overlays/components/EntriesLinkOverlay.js b/public/panels/timeline/overlays/components/EntriesLinkOverlay.js index efc4af73a..3b6c96bde 100644 --- a/public/panels/timeline/overlays/components/EntriesLinkOverlay.js +++ b/public/panels/timeline/overlays/components/EntriesLinkOverlay.js @@ -158,13 +158,12 @@ export class EntriesLinkOverlay extends HTMLElement { widthOfToEntry >= minWidthToDrawConnectorCircles && !this.#arrowHidden; this.#entryFromConnector.setAttribute('visibility', drawFromEntryConnectorCircle ? 'visible' : 'hidden'); this.#entryToConnector.setAttribute('visibility', drawToEntryConnectorCircle ? 'visible' : 'hidden'); - // If the entry is visible, the entry arrow starts from the end on the X axis and middle of the Y axis. - // If not, draw it to the same y point without the entry height offset and the box around the entry. - // This way it will be attached to the track edge. + // If the entry is visible, the entry arrow starts from the middle of the right edge of the entry (end on the X axis and middle of the Y axis). + // If not, draw it to the y coordinate of the entry and the edge of the timeline so it is pointing in the direction of the entry. + const halfFromEntryHeight = this.#fromEntryDimentions.height / 2; if (this.#entryFromVisible) { - const halfEntryHeight = this.#fromEntryDimentions.height / 2; const endConnectionPointX = String(this.#coordinateFrom.x + this.#fromEntryDimentions.width); - const endConnectionPointY = String(this.#coordinateFrom.y + halfEntryHeight); + const endConnectionPointY = String(this.#coordinateFrom.y + halfFromEntryHeight); this.#connector.setAttribute('x1', endConnectionPointX); this.#connector.setAttribute('y1', endConnectionPointY); this.#entryFromConnector.setAttribute('cx', endConnectionPointX); @@ -173,10 +172,11 @@ export class EntriesLinkOverlay extends HTMLElement { } else { this.#connector.setAttribute('x1', (this.#coordinateFrom.x + this.#fromEntryDimentions.width).toString()); - this.#connector.setAttribute('y1', this.#coordinateFrom.y.toString()); + this.#connector.setAttribute('y1', String(this.#coordinateFrom.y + halfFromEntryHeight)); this.#entryFromWrapper.style.visibility = 'hidden'; } - // If the arrow is pointing to the entry, point it to the middle of the entry. + // If the arrow is pointing to the entry and that entry is visible, point it to the middle of the entry. + // If the entry is not visible, point the arrow to the edge of the screen towards the entry. // Otherwise, the arrow is following the mouse so we assign it to the provided coordinates. if (this.#toEntryDimentions && this.#entryToVisible) { const connectionPointX = String(this.#coordinateTo.x); @@ -190,7 +190,15 @@ export class EntriesLinkOverlay extends HTMLElement { else { this.#entryToWrapper.style.visibility = 'hidden'; this.#connector.setAttribute('x2', this.#coordinateTo.x.toString()); - this.#connector.setAttribute('y2', this.#coordinateTo.y.toString()); + // If `toEntryDimentions` exist, the arrow points to the entry and we need to take its height into account. + // Otherwise, it is following the mouse. + if (this.#toEntryDimentions) { + const halfToEntryHeight = this.#toEntryDimentions.height / 2; + this.#connector.setAttribute('y2', String(this.#coordinateTo.y + halfToEntryHeight)); + } + else { + this.#connector.setAttribute('y2', (this.#coordinateTo.y).toString()); + } } this.#connector.setAttribute('stroke-width', '2'); if (this.#toEntryDimentions && this.#entryFromVisible && !this.#entryToVisible) { diff --git a/public/panels/timeline/overlays/components/EntriesLinkOverlay.js.map b/public/panels/timeline/overlays/components/EntriesLinkOverlay.js.map index 39c3f1748..d9faf2ff1 100644 --- a/public/panels/timeline/overlays/components/EntriesLinkOverlay.js.map +++ b/public/panels/timeline/overlays/components/EntriesLinkOverlay.js.map @@ -1 +1 @@ -{"version":3,"file":"EntriesLinkOverlay.js","sourceRoot":"","sources":["../../../../../../../../front_end/panels/timeline/overlays/components/EntriesLinkOverlay.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAC7B,OAAO,sDAAsD,CAAC;AAE9D,OAAO,KAAK,IAAI,MAAM,+BAA+B,CAAC;AACtD,OAAO,KAAK,KAAK,MAAM,mCAAmC,CAAC;AAC3D,OAAO,KAAK,YAAY,MAAM,sDAAsD,CAAC;AACrF,OAAO,KAAK,OAAO,MAAM,qCAAqC,CAAC;AAC/D,OAAO,KAAK,aAAa,MA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,IAAI,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,QAAQ;gDACpD,UAAU;;;;;iCAKzB,CAAC,IAAI,CAAC,kBAAkB,IAAI,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC,CAAC,oBAAoB,CAAC,CAAC,CAAC,MAAM;2BACxF,CAAC,IAAI,CAAC,iBAAiB,IAAI,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS;;oEAE9B,UAAU,iBAAiB,6BAA6B,MAAM,uBAAuB;kEACvF,UAAU,iBAAiB,6BAA6B,MAAM,uBAAuB;;6DAE1F,IAAI,CAAC,kBAAkB,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,qBAAqB;2DACtD,IAAI,CAAC,gBAAgB,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,qBAAqB;wCACrE,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,QAAQ;;;sBAGxD,aAAa,CAAC,MAAM,CAAC,wCAAwC,CAAC,CAAC,KAAK,CAAC,EAAC,KAAK,EAAE,IAAI,EAAC,CAAC;uBAClF,IAAI,CAAC,wBAAwB;;;;SAI3C,EACD,IAAI,CAAC,OAAO,EAAE,EAAC,IAAI,EAAE,IAAI,EAAC,CAAC,CAAC;QAChC,kBAAkB;IACpB,CAAC;CACF;AAED,MAAM,uBAAuB,GAAG,CAAC,CAAC;AAClC,MAAM,6BAA6B,GAAG,CAAC,CAAC;AAExC,sEAAsE;AACtE,8EAA8E;AAC9E,MAAM,oBAAoB,GAAG,CAAC,CAAC;AAE/B,cAAc,CAAC,MAAM,CAAC,+BAA+B,EAAE,kBAAkB,CAAC,CAAC","sourcesContent":["// Copyright 2024 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\nimport '../../../../ui/components/icon_button/icon_button.js';\n\nimport * as i18n from '../../../../core/i18n/i18n.js';\nimport * as Trace from '../../../../models/trace/trace.js';\nimport * as ThemeSupport from '../../../../ui/legacy/theme_support/theme_support.js';\nimport * as LitHtml from '../../../../ui/lit-html/lit-html.js';\nimport * as VisualLogging from '../../../../ui/visual_logging/visual_logging.js';\n\nconst UIStrings = {\n /**\n *@description Accessible label used to explain to a user that they are viewing an arrow representing a link between two entries.\n */\n diagram: 'Links bteween entries',\n};\nconst str_ = i18n.i18n.registerUIStrings('panels/timeline/overlays/components/EntriesLinkOverlay.ts', UIStrings);\nconst i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);\n\nimport styles from './entriesLinkOverlay.css.js';\n\nconst {html} = LitHtml;\n\nexport class EntryLinkStartCreating extends Event {\n static readonly eventName = 'entrylinkstartcreating';\n\n constructor() {\n super(EntryLinkStartCreating.eventName, {bubbles: true, composed: true});\n }\n}\n\nexport class EntriesLinkOverlay extends HTMLElement {\n readonly #shadow = this.attachShadow({mode: 'open'});\n #coordinateFrom: {x: number, y: number};\n #fromEntryDimentions: {width: number, height: number};\n #coordinateTo: {x: number, y: number};\n #toEntryDimentions: {width: number, height: number}|null = null;\n #connectorLineContainer: SVGAElement|null = null;\n #connector: SVGLineElement|null = null;\n #entryFromWrapper: HTMLElement|null = null;\n #entryToWrapper: HTMLElement|null = null;\n #entryFromConnector: SVGCircleElement|null = null;\n #entryToConnector: SVGCircleElement|null = null;\n #entryFromVisible: boolean = true;\n #entryToVisible: boolean = true;\n #canvasRect: DOMRect|null = null;\n\n // These flags let us know if the entry we are drawing from/to are the\n // originals, or if they are the parent, which can happen if an entry is\n // collapsed. We care about this because if the entry is not the source, we\n // draw the border as dashed, not solid.\n #fromEntryIsSource: boolean = true;\n #toEntryIsSource: boolean = true;\n #arrowHidden: boolean = false;\n #linkState: Trace.Types.File.EntriesLinkState;\n\n constructor(\n initialFromEntryCoordinateAndDimentions: {x: number, y: number, width: number, height: number},\n linkCreationNotStartedState: Trace.Types.File.EntriesLinkState) {\n super();\n this.#render();\n this.#coordinateFrom = {x: initialFromEntryCoordinateAndDimentions.x, y: initialFromEntryCoordinateAndDimentions.y};\n this.#fromEntryDimentions = {\n width: initialFromEntryCoordinateAndDimentions.width,\n height: initialFromEntryCoordinateAndDimentions.height,\n };\n this.#coordinateTo = {x: initialFromEntryCoordinateAndDimentions.x, y: initialFromEntryCoordinateAndDimentions.y};\n this.#connectorLineContainer = this.#shadow.querySelector('.connectorContainer') ?? null;\n this.#connector = this.#connectorLineContainer?.querySelector('line') ?? null;\n this.#entryFromWrapper = this.#shadow.querySelector('.from-highlight-wrapper') ?? null;\n this.#entryToWrapper = this.#shadow.querySelector('.to-highlight-wrapper') ?? null;\n this.#entryFromConnector = this.#connectorLineContainer?.querySelector('.entryFromConnector') ?? null;\n this.#entryToConnector = this.#connectorLineContainer?.querySelector('.entryToConnector') ?? null;\n this.#linkState = linkCreationNotStartedState;\n this.#render();\n }\n\n set canvasRect(rect: DOMRect|null) {\n if (rect === null) {\n return;\n }\n if (this.#canvasRect && this.#canvasRect.width === rect.width && this.#canvasRect.height === rect.height) {\n return;\n }\n this.#canvasRect = rect;\n this.#render();\n }\n\n entryFromWrapper(): HTMLElement|null {\n return this.#entryFromWrapper;\n }\n\n entryToWrapper(): HTMLElement|null {\n return this.#entryToWrapper;\n }\n\n connectedCallback(): void {\n this.#shadow.adoptedStyleSheets = [styles];\n }\n\n /**\n * If one entry that is linked is in a collapsed track, we show the outlines\n * but hide only the arrow.\n */\n set hideArrow(shouldHide: boolean) {\n this.#arrowHidden = shouldHide;\n if (this.#connector) {\n this.#connector.style.display = shouldHide ? 'none' : 'block';\n }\n }\n\n set fromEntryCoordinateAndDimentions(fromEntryParams: {x: number, y: number, length: number, height: number}) {\n this.#coordinateFrom = {x: fromEntryParams.x, y: fromEntryParams.y};\n this.#fromEntryDimentions = {width: fromEntryParams.length, height: fromEntryParams.height};\n this.#updateCreateLinkBox();\n this.#redrawConnectionArrow();\n }\n\n set entriesVisibility(entriesVisibility: {fromEntryVisibility: boolean, toEntryVisibility: boolean}) {\n this.#entryFromVisible = entriesVisibility.fromEntryVisibility;\n this.#entryToVisible = entriesVisibility.toEntryVisibility;\n this.#redrawConnectionArrow();\n }\n\n // The arrow might be pointing either to an entry or an empty space.\n // If the dimensions are not passed, it is pointing at an empty space.\n set toEntryCoordinateAndDimentions(toEntryParams: {x: number, y: number, length?: number, height?: number}) {\n this.#coordinateTo = {x: toEntryParams.x, y: toEntryParams.y};\n if (toEntryParams.length && toEntryParams.height) {\n this.#toEntryDimentions = {width: toEntryParams.length, height: toEntryParams.height};\n } else {\n this.#toEntryDimentions = null;\n }\n\n this.#updateCreateLinkBox();\n this.#redrawConnectionArrow();\n }\n\n set fromEntryIsSource(x: boolean) {\n if (x === this.#fromEntryIsSource) {\n return;\n }\n this.#fromEntryIsSource = x;\n this.#render();\n }\n\n set toEntryIsSource(x: boolean) {\n if (x === this.#toEntryIsSource) {\n return;\n }\n this.#toEntryIsSource = x;\n this.#render();\n }\n\n #redrawConnectionArrow(): void {\n if (!this.#connector || !this.#entryFromWrapper || !this.#entryToWrapper || !this.#entryFromConnector ||\n !this.#entryToConnector) {\n console.error('`connector` element is missing.');\n return;\n }\n\n if (this.#linkState === Trace.Types.File.EntriesLinkState.CREATION_NOT_STARTED) {\n this.#entryFromConnector.setAttribute('visibility', 'hidden');\n this.#entryToConnector.setAttribute('visibility', 'hidden');\n return;\n }\n\n // If the user is zoomed out, the connector circles can be as large as the\n // event itself. So if the rectangle for this entry is too small, we\n // don't draw the circles.\n const minWidthToDrawConnectorCircles = 8;\n\n // We do not draw the connectors if the entry is not visible, or if the\n // entry we are connecting to isn't the actual source entry.\n // We also don't draw them if an entry is completely hidden, in which case\n // we aren't drawing the arrows, so it doesn't make sense to draw the\n // connectors.\n const drawFromEntryConnectorCircle = this.#entryFromVisible && !this.#arrowHidden && this.#fromEntryIsSource &&\n this.#fromEntryDimentions.width >= minWidthToDrawConnectorCircles;\n\n const widthOfToEntry = this.#toEntryDimentions?.width ?? 0;\n const drawToEntryConnectorCircle = !this.#arrowHidden && this.#entryToVisible && this.#toEntryIsSource &&\n widthOfToEntry >= minWidthToDrawConnectorCircles && !this.#arrowHidden;\n\n this.#entryFromConnector.setAttribute('visibility', drawFromEntryConnectorCircle ? 'visible' : 'hidden');\n this.#entryToConnector.setAttribute('visibility', drawToEntryConnectorCircle ? 'visible' : 'hidden');\n\n // If the entry is visible, the entry arrow starts from the end on the X axis and middle of the Y axis.\n // If not, draw it to the same y point without the entry height offset and the box around the entry.\n // This way it will be attached to the track edge.\n if (this.#entryFromVisible) {\n const halfEntryHeight = this.#fromEntryDimentions.height / 2;\n const endConnectionPointX = String(this.#coordinateFrom.x + this.#fromEntryDimentions.width);\n const endConnectionPointY = String(this.#coordinateFrom.y + halfEntryHeight);\n\n this.#connector.setAttribute('x1', endConnectionPointX);\n this.#connector.setAttribute('y1', endConnectionPointY);\n\n this.#entryFromConnector.setAttribute('cx', endConnectionPointX);\n this.#entryFromConnector.setAttribute('cy', endConnectionPointY);\n this.#entryFromWrapper.style.visibility = 'visible';\n } else {\n this.#connector.setAttribute('x1', (this.#coordinateFrom.x + this.#fromEntryDimentions.width).toString());\n this.#connector.setAttribute('y1', this.#coordinateFrom.y.toString());\n this.#entryFromWrapper.style.visibility = 'hidden';\n }\n\n // If the arrow is pointing to the entry, point it to the middle of the entry.\n // Otherwise, the arrow is following the mouse so we assign it to the provided coordinates.\n if (this.#toEntryDimentions && this.#entryToVisible) {\n const connectionPointX = String(this.#coordinateTo.x);\n const connectionPointY = String(this.#coordinateTo.y + this.#toEntryDimentions.height / 2);\n\n this.#connector.setAttribute('x2', connectionPointX);\n this.#connector.setAttribute('y2', connectionPointY);\n\n this.#entryToConnector.setAttribute('cx', connectionPointX);\n this.#entryToConnector.setAttribute('cy', connectionPointY);\n\n this.#entryToWrapper.style.visibility = 'visible';\n } else {\n this.#entryToWrapper.style.visibility = 'hidden';\n this.#connector.setAttribute('x2', this.#coordinateTo.x.toString());\n this.#connector.setAttribute('y2', this.#coordinateTo.y.toString());\n }\n\n this.#connector.setAttribute('stroke-width', '2');\n\n if (this.#toEntryDimentions && this.#entryFromVisible && !this.#entryToVisible) {\n this.#connector.setAttribute('stroke', 'url(#fromVisibleLineGradient)');\n } else if (this.#toEntryDimentions && this.#entryToVisible && !this.#entryFromVisible) {\n this.#connector.setAttribute('stroke', 'url(#toVisibleLineGradient)');\n } else {\n const arrowColor = ThemeSupport.ThemeSupport.instance().getComputedValue('--color-text-primary');\n this.#connector.setAttribute('stroke', arrowColor);\n }\n\n this.#render();\n }\n\n /*\n * When only one entry from the connection is visible, the connection\n * line becomes a gradient from the visible entry to the edge of\n * the screen towards the entry that is not visible.\n *\n * To achieve this, we need to calculate what percentage of the\n * visible screen the connection is currently occupying and apply\n * that gradient to the visible connection part.\n */\n #partlyVisibleConnectionLinePercentage(): number {\n if (!this.#canvasRect) {\n return 100;\n }\n\n const lineLength = this.#coordinateTo.x - (this.#coordinateFrom.x + this.#fromEntryDimentions.width);\n let visibleLineLength = 0;\n\n // If the visible entry is the 'From' entry, find the length of the visible arrow by\n // substracting the point where the arrow starts from the whole canvas length.\n // If the 'to' entry is visible, the coordinate of the entry will be equal to\n // the visible arrow length.\n if (this.#entryFromVisible && !this.#entryToVisible) {\n visibleLineLength = this.#canvasRect.width - (this.#coordinateFrom.x + this.#fromEntryDimentions.width);\n } else if (!this.#entryFromVisible && this.#entryToVisible) {\n visibleLineLength = this.#coordinateTo.x;\n }\n\n const visibleLineFromTotalPercentage = (visibleLineLength * 100) / lineLength;\n\n return (visibleLineFromTotalPercentage < 100) ? visibleLineFromTotalPercentage : 100;\n }\n\n #updateCreateLinkBox(): void {\n const createLinkBox = this.#shadow.querySelector('.create-link-box');\n const createLinkIcon = createLinkBox?.querySelector('.create-link-icon') ?? null;\n\n if (!createLinkBox || !createLinkIcon) {\n console.error('creating element is missing.');\n return;\n }\n\n if (this.#linkState !== Trace.Types.File.EntriesLinkState.CREATION_NOT_STARTED) {\n createLinkIcon.style.display = 'none';\n return;\n }\n\n createLinkIcon.style.left = `${this.#coordinateFrom.x + this.#fromEntryDimentions.width}px`;\n createLinkIcon.style.top = `${this.#coordinateFrom.y}px`;\n }\n\n #startCreatingConnection(): void {\n this.#linkState = Trace.Types.File.EntriesLinkState.PENDING_TO_EVENT;\n this.dispatchEvent(new EntryLinkStartCreating());\n }\n\n /*\n The entries link overlay is an arrow connecting 2 entries.\n The Entries are drawn by Flamechart and this Overlay is only drawing the arrow between them.\n _________\n |__entry__|\\\n \\\n \\ <-- arrow connecting the sides of entries drawn by this overlay\n \\ ________________\n ➘ |_____entry______|\n */\n #render(): void {\n const arrowColor = ThemeSupport.ThemeSupport.instance().getComputedValue('--color-text-primary');\n // clang-format off\n LitHtml.render(\n html`\n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n
\n
\n \n `,\n this.#shadow, {host: this});\n // clang-format on\n }\n}\n\nconst CONNECTOR_CIRCLE_RADIUS = 2;\nconst CONNECTOR_CIRCLE_STROKE_WIDTH = 1;\n\n// Defines the gap in the border when we are drawing a dashed outline.\n// https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/stroke-dasharray\nconst DASHED_STROKE_AMOUNT = 4;\n\ncustomElements.define('devtools-entries-link-overlay', EntriesLinkOverlay);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'devtools-entries-link-overlay': EntriesLinkOverlay;\n }\n}\n"]} \ No newline at end of file +{"version":3,"file":"EntriesLinkOverlay.js","sourceRoot":"","sources":["../../../../../../../../front_end/panels/timeline/overlays/components/EntriesLinkOverlay.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAC7B,OAAO,sDAAsD,CAAC;AAE9D,OAAO,KAAK,IAAI,MAAM,+BAA+B,CAAC;AACtD,OAAO,KAAK,KAAK,MAAM,mCAAmC,CAAC;AAC3D,OAAO,KAAK,YAAY,MAAM,sDAAsD,CAAC;AACrF,OAAO,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,EAAE,EAAC,IAAI,EAAE,IAAI,EAAC,CAAC,CAAC;QAChC,kBAAkB;IACpB,CAAC;CACF;AAED,MAAM,uBAAuB,GAAG,CAAC,CAAC;AAClC,MAAM,6BAA6B,GAAG,CAAC,CAAC;AAExC,sEAAsE;AACtE,8EAA8E;AAC9E,MAAM,oBAAoB,GAAG,CAAC,CAAC;AAE/B,cAAc,CAAC,MAAM,CAAC,+BAA+B,EAAE,kBAAkB,CAAC,CAAC","sourcesContent":["// Copyright 2024 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\nimport '../../../../ui/components/icon_button/icon_button.js';\n\nimport * as i18n from '../../../../core/i18n/i18n.js';\nimport * as Trace from '../../../../models/trace/trace.js';\nimport * as ThemeSupport from '../../../../ui/legacy/theme_support/theme_support.js';\nimport * as LitHtml from '../../../../ui/lit-html/lit-html.js';\nimport * as VisualLogging from '../../../../ui/visual_logging/visual_logging.js';\n\nconst UIStrings = {\n /**\n *@description Accessible label used to explain to a user that they are viewing an arrow representing a link between two entries.\n */\n diagram: 'Links bteween entries',\n};\nconst str_ = i18n.i18n.registerUIStrings('panels/timeline/overlays/components/EntriesLinkOverlay.ts', UIStrings);\nconst i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);\n\nimport styles from './entriesLinkOverlay.css.js';\n\nconst {html} = LitHtml;\n\nexport class EntryLinkStartCreating extends Event {\n static readonly eventName = 'entrylinkstartcreating';\n\n constructor() {\n super(EntryLinkStartCreating.eventName, {bubbles: true, composed: true});\n }\n}\n\nexport class EntriesLinkOverlay extends HTMLElement {\n readonly #shadow = this.attachShadow({mode: 'open'});\n #coordinateFrom: {x: number, y: number};\n #fromEntryDimentions: {width: number, height: number};\n #coordinateTo: {x: number, y: number};\n #toEntryDimentions: {width: number, height: number}|null = null;\n #connectorLineContainer: SVGAElement|null = null;\n #connector: SVGLineElement|null = null;\n #entryFromWrapper: HTMLElement|null = null;\n #entryToWrapper: HTMLElement|null = null;\n #entryFromConnector: SVGCircleElement|null = null;\n #entryToConnector: SVGCircleElement|null = null;\n #entryFromVisible: boolean = true;\n #entryToVisible: boolean = true;\n #canvasRect: DOMRect|null = null;\n\n // These flags let us know if the entry we are drawing from/to are the\n // originals, or if they are the parent, which can happen if an entry is\n // collapsed. We care about this because if the entry is not the source, we\n // draw the border as dashed, not solid.\n #fromEntryIsSource: boolean = true;\n #toEntryIsSource: boolean = true;\n #arrowHidden: boolean = false;\n #linkState: Trace.Types.File.EntriesLinkState;\n\n constructor(\n initialFromEntryCoordinateAndDimentions: {x: number, y: number, width: number, height: number},\n linkCreationNotStartedState: Trace.Types.File.EntriesLinkState) {\n super();\n this.#render();\n this.#coordinateFrom = {x: initialFromEntryCoordinateAndDimentions.x, y: initialFromEntryCoordinateAndDimentions.y};\n this.#fromEntryDimentions = {\n width: initialFromEntryCoordinateAndDimentions.width,\n height: initialFromEntryCoordinateAndDimentions.height,\n };\n this.#coordinateTo = {x: initialFromEntryCoordinateAndDimentions.x, y: initialFromEntryCoordinateAndDimentions.y};\n this.#connectorLineContainer = this.#shadow.querySelector('.connectorContainer') ?? null;\n this.#connector = this.#connectorLineContainer?.querySelector('line') ?? null;\n this.#entryFromWrapper = this.#shadow.querySelector('.from-highlight-wrapper') ?? null;\n this.#entryToWrapper = this.#shadow.querySelector('.to-highlight-wrapper') ?? null;\n this.#entryFromConnector = this.#connectorLineContainer?.querySelector('.entryFromConnector') ?? null;\n this.#entryToConnector = this.#connectorLineContainer?.querySelector('.entryToConnector') ?? null;\n this.#linkState = linkCreationNotStartedState;\n this.#render();\n }\n\n set canvasRect(rect: DOMRect|null) {\n if (rect === null) {\n return;\n }\n if (this.#canvasRect && this.#canvasRect.width === rect.width && this.#canvasRect.height === rect.height) {\n return;\n }\n this.#canvasRect = rect;\n this.#render();\n }\n\n entryFromWrapper(): HTMLElement|null {\n return this.#entryFromWrapper;\n }\n\n entryToWrapper(): HTMLElement|null {\n return this.#entryToWrapper;\n }\n\n connectedCallback(): void {\n this.#shadow.adoptedStyleSheets = [styles];\n }\n\n /**\n * If one entry that is linked is in a collapsed track, we show the outlines\n * but hide only the arrow.\n */\n set hideArrow(shouldHide: boolean) {\n this.#arrowHidden = shouldHide;\n if (this.#connector) {\n this.#connector.style.display = shouldHide ? 'none' : 'block';\n }\n }\n\n set fromEntryCoordinateAndDimentions(fromEntryParams: {x: number, y: number, length: number, height: number}) {\n this.#coordinateFrom = {x: fromEntryParams.x, y: fromEntryParams.y};\n this.#fromEntryDimentions = {width: fromEntryParams.length, height: fromEntryParams.height};\n this.#updateCreateLinkBox();\n this.#redrawConnectionArrow();\n }\n\n set entriesVisibility(entriesVisibility: {fromEntryVisibility: boolean, toEntryVisibility: boolean}) {\n this.#entryFromVisible = entriesVisibility.fromEntryVisibility;\n this.#entryToVisible = entriesVisibility.toEntryVisibility;\n this.#redrawConnectionArrow();\n }\n\n // The arrow might be pointing either to an entry or an empty space.\n // If the dimensions are not passed, it is pointing at an empty space.\n set toEntryCoordinateAndDimentions(toEntryParams: {x: number, y: number, length?: number, height?: number}) {\n this.#coordinateTo = {x: toEntryParams.x, y: toEntryParams.y};\n if (toEntryParams.length && toEntryParams.height) {\n this.#toEntryDimentions = {width: toEntryParams.length, height: toEntryParams.height};\n } else {\n this.#toEntryDimentions = null;\n }\n\n this.#updateCreateLinkBox();\n this.#redrawConnectionArrow();\n }\n\n set fromEntryIsSource(x: boolean) {\n if (x === this.#fromEntryIsSource) {\n return;\n }\n this.#fromEntryIsSource = x;\n this.#render();\n }\n\n set toEntryIsSource(x: boolean) {\n if (x === this.#toEntryIsSource) {\n return;\n }\n this.#toEntryIsSource = x;\n this.#render();\n }\n\n #redrawConnectionArrow(): void {\n if (!this.#connector || !this.#entryFromWrapper || !this.#entryToWrapper || !this.#entryFromConnector ||\n !this.#entryToConnector) {\n console.error('`connector` element is missing.');\n return;\n }\n\n if (this.#linkState === Trace.Types.File.EntriesLinkState.CREATION_NOT_STARTED) {\n this.#entryFromConnector.setAttribute('visibility', 'hidden');\n this.#entryToConnector.setAttribute('visibility', 'hidden');\n return;\n }\n\n // If the user is zoomed out, the connector circles can be as large as the\n // event itself. So if the rectangle for this entry is too small, we\n // don't draw the circles.\n const minWidthToDrawConnectorCircles = 8;\n\n // We do not draw the connectors if the entry is not visible, or if the\n // entry we are connecting to isn't the actual source entry.\n // We also don't draw them if an entry is completely hidden, in which case\n // we aren't drawing the arrows, so it doesn't make sense to draw the\n // connectors.\n const drawFromEntryConnectorCircle = this.#entryFromVisible && !this.#arrowHidden && this.#fromEntryIsSource &&\n this.#fromEntryDimentions.width >= minWidthToDrawConnectorCircles;\n\n const widthOfToEntry = this.#toEntryDimentions?.width ?? 0;\n const drawToEntryConnectorCircle = !this.#arrowHidden && this.#entryToVisible && this.#toEntryIsSource &&\n widthOfToEntry >= minWidthToDrawConnectorCircles && !this.#arrowHidden;\n\n this.#entryFromConnector.setAttribute('visibility', drawFromEntryConnectorCircle ? 'visible' : 'hidden');\n this.#entryToConnector.setAttribute('visibility', drawToEntryConnectorCircle ? 'visible' : 'hidden');\n\n // If the entry is visible, the entry arrow starts from the middle of the right edge of the entry (end on the X axis and middle of the Y axis).\n // If not, draw it to the y coordinate of the entry and the edge of the timeline so it is pointing in the direction of the entry.\n const halfFromEntryHeight = this.#fromEntryDimentions.height / 2;\n if (this.#entryFromVisible) {\n const endConnectionPointX = String(this.#coordinateFrom.x + this.#fromEntryDimentions.width);\n const endConnectionPointY = String(this.#coordinateFrom.y + halfFromEntryHeight);\n\n this.#connector.setAttribute('x1', endConnectionPointX);\n this.#connector.setAttribute('y1', endConnectionPointY);\n\n this.#entryFromConnector.setAttribute('cx', endConnectionPointX);\n this.#entryFromConnector.setAttribute('cy', endConnectionPointY);\n this.#entryFromWrapper.style.visibility = 'visible';\n } else {\n this.#connector.setAttribute('x1', (this.#coordinateFrom.x + this.#fromEntryDimentions.width).toString());\n this.#connector.setAttribute('y1', String(this.#coordinateFrom.y + halfFromEntryHeight));\n this.#entryFromWrapper.style.visibility = 'hidden';\n }\n\n // If the arrow is pointing to the entry and that entry is visible, point it to the middle of the entry.\n // If the entry is not visible, point the arrow to the edge of the screen towards the entry.\n // Otherwise, the arrow is following the mouse so we assign it to the provided coordinates.\n if (this.#toEntryDimentions && this.#entryToVisible) {\n const connectionPointX = String(this.#coordinateTo.x);\n const connectionPointY = String(this.#coordinateTo.y + this.#toEntryDimentions.height / 2);\n\n this.#connector.setAttribute('x2', connectionPointX);\n this.#connector.setAttribute('y2', connectionPointY);\n\n this.#entryToConnector.setAttribute('cx', connectionPointX);\n this.#entryToConnector.setAttribute('cy', connectionPointY);\n\n this.#entryToWrapper.style.visibility = 'visible';\n } else {\n this.#entryToWrapper.style.visibility = 'hidden';\n this.#connector.setAttribute('x2', this.#coordinateTo.x.toString());\n // If `toEntryDimentions` exist, the arrow points to the entry and we need to take its height into account.\n // Otherwise, it is following the mouse.\n if (this.#toEntryDimentions) {\n const halfToEntryHeight = this.#toEntryDimentions.height / 2;\n this.#connector.setAttribute('y2', String(this.#coordinateTo.y + halfToEntryHeight));\n } else {\n this.#connector.setAttribute('y2', (this.#coordinateTo.y).toString());\n }\n }\n\n this.#connector.setAttribute('stroke-width', '2');\n\n if (this.#toEntryDimentions && this.#entryFromVisible && !this.#entryToVisible) {\n this.#connector.setAttribute('stroke', 'url(#fromVisibleLineGradient)');\n } else if (this.#toEntryDimentions && this.#entryToVisible && !this.#entryFromVisible) {\n this.#connector.setAttribute('stroke', 'url(#toVisibleLineGradient)');\n } else {\n const arrowColor = ThemeSupport.ThemeSupport.instance().getComputedValue('--color-text-primary');\n this.#connector.setAttribute('stroke', arrowColor);\n }\n\n this.#render();\n }\n\n /*\n * When only one entry from the connection is visible, the connection\n * line becomes a gradient from the visible entry to the edge of\n * the screen towards the entry that is not visible.\n *\n * To achieve this, we need to calculate what percentage of the\n * visible screen the connection is currently occupying and apply\n * that gradient to the visible connection part.\n */\n #partlyVisibleConnectionLinePercentage(): number {\n if (!this.#canvasRect) {\n return 100;\n }\n\n const lineLength = this.#coordinateTo.x - (this.#coordinateFrom.x + this.#fromEntryDimentions.width);\n let visibleLineLength = 0;\n\n // If the visible entry is the 'From' entry, find the length of the visible arrow by\n // substracting the point where the arrow starts from the whole canvas length.\n // If the 'to' entry is visible, the coordinate of the entry will be equal to\n // the visible arrow length.\n if (this.#entryFromVisible && !this.#entryToVisible) {\n visibleLineLength = this.#canvasRect.width - (this.#coordinateFrom.x + this.#fromEntryDimentions.width);\n } else if (!this.#entryFromVisible && this.#entryToVisible) {\n visibleLineLength = this.#coordinateTo.x;\n }\n\n const visibleLineFromTotalPercentage = (visibleLineLength * 100) / lineLength;\n\n return (visibleLineFromTotalPercentage < 100) ? visibleLineFromTotalPercentage : 100;\n }\n\n #updateCreateLinkBox(): void {\n const createLinkBox = this.#shadow.querySelector('.create-link-box');\n const createLinkIcon = createLinkBox?.querySelector('.create-link-icon') ?? null;\n\n if (!createLinkBox || !createLinkIcon) {\n console.error('creating element is missing.');\n return;\n }\n\n if (this.#linkState !== Trace.Types.File.EntriesLinkState.CREATION_NOT_STARTED) {\n createLinkIcon.style.display = 'none';\n return;\n }\n\n createLinkIcon.style.left = `${this.#coordinateFrom.x + this.#fromEntryDimentions.width}px`;\n createLinkIcon.style.top = `${this.#coordinateFrom.y}px`;\n }\n\n #startCreatingConnection(): void {\n this.#linkState = Trace.Types.File.EntriesLinkState.PENDING_TO_EVENT;\n this.dispatchEvent(new EntryLinkStartCreating());\n }\n\n /*\n The entries link overlay is an arrow connecting 2 entries.\n The Entries are drawn by Flamechart and this Overlay is only drawing the arrow between them.\n _________\n |__entry__|\\\n \\\n \\ <-- arrow connecting the sides of entries drawn by this overlay\n \\ ________________\n ➘ |_____entry______|\n */\n #render(): void {\n const arrowColor = ThemeSupport.ThemeSupport.instance().getComputedValue('--color-text-primary');\n // clang-format off\n LitHtml.render(\n html`\n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n
\n
\n \n `,\n this.#shadow, {host: this});\n // clang-format on\n }\n}\n\nconst CONNECTOR_CIRCLE_RADIUS = 2;\nconst CONNECTOR_CIRCLE_STROKE_WIDTH = 1;\n\n// Defines the gap in the border when we are drawing a dashed outline.\n// https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/stroke-dasharray\nconst DASHED_STROKE_AMOUNT = 4;\n\ncustomElements.define('devtools-entries-link-overlay', EntriesLinkOverlay);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'devtools-entries-link-overlay': EntriesLinkOverlay;\n }\n}\n"]} \ No newline at end of file diff --git a/public/panels/timeline/overlays/components/TimespanBreakdownOverlay.test.js b/public/panels/timeline/overlays/components/TimespanBreakdownOverlay.test.js index 463e24691..1064c0b34 100644 --- a/public/panels/timeline/overlays/components/TimespanBreakdownOverlay.test.js +++ b/public/panels/timeline/overlays/components/TimespanBreakdownOverlay.test.js @@ -6,7 +6,6 @@ import { describeWithEnvironment } from '../../../../testing/EnvironmentHelpers. import { microsecondsTraceWindow, } from '../../../../testing/TraceHelpers.js'; import * as RenderCoordinator from '../../../../ui/components/render_coordinator/render_coordinator.js'; import * as Components from './components.js'; -const coordinator = RenderCoordinator.RenderCoordinator.RenderCoordinator.instance(); describeWithEnvironment('TimespanBreakdownOverlay', () => { it('renders the sections with the labels and time', async () => { const component = new Components.TimespanBreakdownOverlay.TimespanBreakdownOverlay(); @@ -23,7 +22,7 @@ describeWithEnvironment('TimespanBreakdownOverlay', () => { }, ]; component.sections = sections; - await coordinator.done(); + await RenderCoordinator.done(); assert.isOk(component.shadowRoot); const sectionElems = Array.from(component.shadowRoot.querySelectorAll('.timespan-breakdown-overlay-section')); const labels = sectionElems.flatMap(elem => { diff --git a/public/panels/timeline/overlays/components/TimespanBreakdownOverlay.test.js.map b/public/panels/timeline/overlays/components/TimespanBreakdownOverlay.test.js.map index b7f6387f4..f870e1de7 100644 --- a/public/panels/timeline/overlays/components/TimespanBreakdownOverlay.test.js.map +++ b/public/panels/timeline/overlays/components/TimespanBreakdownOverlay.test.js.map @@ -1 +1 @@ -{"version":3,"file":"TimespanBreakdownOverlay.test.js","sourceRoot":"","sources":["../../../../../../../../front_end/panels/timeline/overlays/components/TimespanBreakdownOverlay.test.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,EAAC,+BAA+B,EAAC,MAAM,mCAAmC,CAAC;AAClF,OAAO,EAAC,uBAAuB,EAAC,MAAM,2CAA2C,CAAC;AAClF,OAAO,EACL,uBAAuB,GACxB,MAAM,qCAAqC,CAAC;AAC7C,OAAO,KAAK,iBAAiB,MAAM,oEAAoE,CAAC;AAExG,OAAO,KAAK,UAAU,MAAM,iBAAiB,CAAC;AAC9C,MAAM,WAAW,GAAG,iBAAiB,CAAC,iBAAiB,CAAC,iBAAiB,CAAC,QAAQ,EAAE,CAAC;AAErF,uBAAuB,CAAC,0BAA0B,EAAE,GAAG,EAAE;IACvD,EAAE,CAAC,+CAA+C,EAAE,KAAK,IAAI,EAAE;QAC7D,MAAM,SAAS,GAAG,IAAI,UAAU,CAAC,wBAAwB,CAAC,wBAAwB,EAAE,CAAC;QACrF,MAAM,QAAQ,GAAyD;YACrE;gBACE,MAAM,EAAE,uBAAuB,CAAC,CAAC,EAAE,KAAK,CAAC;gBACzC,KAAK,EAAE,aAAa;gBACpB,YAAY,EAAE,IAAI;aACnB;YACD;gBACE,MAAM,EAAE,uBAAuB,CAAC,KAAK,EAAE,MAAM,CAAC;gBAC9C,KAAK,EAAE,aAAa;gBACpB,YAAY,EAAE,IAAI;aAEnB;SACF,CAAC;QACF,SAAS,CAAC,QAAQ,GAAG,QAAQ,CAAC;QAC9B,MAAM,WAAW,CAAC,IAAI,EAAE,CAAC;QACzB,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC;QAElC,MAAM,YAAY,GACd,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,gBAAgB,CAAc,qCAAqC,CAAC,CAAC,CAAC;QAC1G,MAAM,MAAM,GAAG,YAAY,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE;YACzC,OAAO,+BAA+B,CAAC,IAAI,EAAE,mCAAmC,CAAC,CAAC;QACpF,CAAC,CAAC,CAAC;QACH,MAAM,CAAC,SAAS,CAAC,MAAM,EAAE,CAAC,kBAAkB,EAAE,mBAAmB,CAAC,CAAC,CAAC;IACtE,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["// Copyright 2024 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport {getCleanTextContentFromElements} from '../../../../testing/DOMHelpers.js';\nimport {describeWithEnvironment} from '../../../../testing/EnvironmentHelpers.js';\nimport {\n microsecondsTraceWindow,\n} from '../../../../testing/TraceHelpers.js';\nimport * as RenderCoordinator from '../../../../ui/components/render_coordinator/render_coordinator.js';\n\nimport * as Components from './components.js';\nconst coordinator = RenderCoordinator.RenderCoordinator.RenderCoordinator.instance();\n\ndescribeWithEnvironment('TimespanBreakdownOverlay', () => {\n it('renders the sections with the labels and time', async () => {\n const component = new Components.TimespanBreakdownOverlay.TimespanBreakdownOverlay();\n const sections: Components.TimespanBreakdownOverlay.EntryBreakdown[] = [\n {\n bounds: microsecondsTraceWindow(0, 1_000),\n label: 'section one',\n showDuration: true,\n },\n {\n bounds: microsecondsTraceWindow(1_000, 20_055),\n label: 'section two',\n showDuration: true,\n\n },\n ];\n component.sections = sections;\n await coordinator.done();\n assert.isOk(component.shadowRoot);\n\n const sectionElems =\n Array.from(component.shadowRoot.querySelectorAll('.timespan-breakdown-overlay-section'));\n const labels = sectionElems.flatMap(elem => {\n return getCleanTextContentFromElements(elem, '.timespan-breakdown-overlay-label');\n });\n assert.deepEqual(labels, ['1 ms section one', '19 ms section two']);\n });\n});\n"]} \ No newline at end of file +{"version":3,"file":"TimespanBreakdownOverlay.test.js","sourceRoot":"","sources":["../../../../../../../../front_end/panels/timeline/overlays/components/Timesp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AAE,CAAC,kBAAkB,EAAE,mBAAmB,CAAC,CAAC,CAAC;IACtE,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["// Copyright 2024 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport {getCleanTextContentFromElements} from '../../../../testing/DOMHelpers.js';\nimport {describeWithEnvironment} from '../../../../testing/EnvironmentHelpers.js';\nimport {\n microsecondsTraceWindow,\n} from '../../../../testing/TraceHelpers.js';\nimport * as RenderCoordinator from '../../../../ui/components/render_coordinator/render_coordinator.js';\n\nimport * as Components from './components.js';\n\ndescribeWithEnvironment('TimespanBreakdownOverlay', () => {\n it('renders the sections with the labels and time', async () => {\n const component = new Components.TimespanBreakdownOverlay.TimespanBreakdownOverlay();\n const sections: Components.TimespanBreakdownOverlay.EntryBreakdown[] = [\n {\n bounds: microsecondsTraceWindow(0, 1_000),\n label: 'section one',\n showDuration: true,\n },\n {\n bounds: microsecondsTraceWindow(1_000, 20_055),\n label: 'section two',\n showDuration: true,\n\n },\n ];\n component.sections = sections;\n await RenderCoordinator.done();\n assert.isOk(component.shadowRoot);\n\n const sectionElems =\n Array.from(component.shadowRoot.querySelectorAll('.timespan-breakdown-overlay-section'));\n const labels = sectionElems.flatMap(elem => {\n return getCleanTextContentFromElements(elem, '.timespan-breakdown-overlay-label');\n });\n assert.deepEqual(labels, ['1 ms section one', '19 ms section two']);\n });\n});\n"]} \ No newline at end of file diff --git a/public/panels/timeline/timelineFlameChartView.css.js b/public/panels/timeline/timelineFlameChartView.css.js index f2836d9bf..7396c2dbb 100644 --- a/public/panels/timeline/timelineFlameChartView.css.js +++ b/public/panels/timeline/timelineFlameChartView.css.js @@ -13,10 +13,7 @@ styles.replaceSync( .timeline-overlays-container { position: absolute; - top: 0; - left: 0; - right: 0; - bottom: 0; + inset: 0; /* Ensure it appears on top of everything */ z-index: 200; pointer-events: none; diff --git a/public/panels/timeline/timelineFlamechartPopover.css.js b/public/panels/timeline/timelineFlamechartPopover.css.js index e8f596322..0798cd224 100644 --- a/public/panels/timeline/timelineFlamechartPopover.css.js +++ b/public/panels/timeline/timelineFlamechartPopover.css.js @@ -56,8 +56,8 @@ styles.replaceSync( } .layout-shift-viz-rect { - outline: 1px solid color-mix(in sRGB, var(--color-background-inverted) 20%, var(--app-color-rendering)); - background-color: color-mix(in sRGB, var(--color-background-inverted-opacity-0) 50%, var(--app-color-rendering-children)); + outline: 1px solid color-mix(in srgb, var(--color-background-inverted) 20%, var(--app-color-rendering)); + background-color: color-mix(in srgb, var(--color-background-inverted-opacity-0) 50%, var(--app-color-rendering-children)); position: absolute; z-index: 100; } diff --git a/public/panels/timeline/timelinePanel.css.js b/public/panels/timeline/timelinePanel.css.js index 5dd3fae36..75c2dfc13 100644 --- a/public/panels/timeline/timelinePanel.css.js +++ b/public/panels/timeline/timelinePanel.css.js @@ -144,6 +144,7 @@ styles.replaceSync( #memory-graphs-container .timeline-memory-header::after { content: ""; + /* stylelint-disable-next-line custom-property-pattern */ background-image: var(--image-file-toolbarResizerVertical); background-repeat: no-repeat; background-position: right center, center; @@ -325,6 +326,7 @@ styles.replaceSync( 100% { opacity: 0%; + /* stylelint-disable-next-line custom-property-pattern */ transform: translateY(var(--to-Y)) translateX(var(--to-X)) rotate(var(--rotation)); } } @@ -554,8 +556,7 @@ styles.replaceSync( } .timeline-details-view-body > div { - overflow-y: hidden; - overflow-x: hidden; + overflow: hidden; } .timeline-details-chip-title > div { diff --git a/public/panels/timeline/track_appenders/AnimationsTrackAppender.test.js b/public/panels/timeline/track_appenders/AnimationsTrackAppender.test.js index 8b61e3c2d..fd0becc1d 100644 --- a/public/panels/timeline/track_appenders/AnimationsTrackAppender.test.js +++ b/public/panels/timeline/track_appenders/AnimationsTrackAppender.test.js @@ -29,7 +29,7 @@ describeWithEnvironment('AnimationsTrackAppender', function () { }); describe('appendTrackAtLevel', function () { it('creates a flamechart group for the Animations track', function () { - assert.strictEqual(flameChartData.groups.length, 1); + assert.lengthOf(flameChartData.groups, 1); assert.strictEqual(flameChartData.groups[0].name, 'Animations'); }); it('adds start times correctly', function () { diff --git a/public/panels/timeline/track_appenders/AnimationsTrackAppender.test.js.map b/public/panels/timeline/track_appenders/AnimationsTrackAppender.test.js.map index 3bc249f56..2f18d0f62 100644 --- a/public/panels/timeline/track_appenders/AnimationsTrackAppender.test.js.map +++ b/public/panels/timeline/track_appenders/AnimationsTrackAppender.test.js.map @@ -1 +1 @@ -{"version":3,"file":"AnimationsTrackAppender.test.js","sourceRoot":"","sources":["../../../../../../../front_end/panels/timeline/track_appenders/AnimationsTrackAppender.test.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,KAAK,KAAK,MAAM,gCAAgC,CAAC;AACxD,OAAO,EAAC,uBAAuB,EAAC,MAAM,wCAAwC,CAAC;AAC/E,OAAO,EAAC,WAAW,EAAC,MAAM,iCAAiC,CAAC;AAC5D,OAAO,KAAK,MAAM,MAAM,kDAAkD,CAAC;AAC3E,OAAO,KAAK,YAAY,MAAM,mDAAmD,CAAC;AAClF,OAAO,KAAK,QAAQ,MAAM,gBAAgB,CAAC;AAE3C,SAAS,iBAAiB,CACtB,cAAwD,EAAE,WAA6C,EACvG,SAAqC,EAAE,gBAAqE;IAE9G,MAAM,2BAA2B,GAAG,IAAI,QAAQ,CAAC,2BAA2B,CAAC,2BAA2B,CACpG,cAAc,EAAE,WAAW,EAAE,SAAS,EAAE,gBAAgB,CAAC,CAAC;IAC9D,OAAO,2BAA2B,CAAC,uBAAuB,EAAE,CAAC;AAC/D,CAAC;AAED,uBAAuB,CAAC,yBAAyB,EAAE;IACjD,IAAI,WAA6C,CAAC;IAClD,IAAI,uBAAiF,CAAC;IACtF,IAAI,SAAS,GAA+B,EAAE,CAAC;IAC/C,IAAI,cAAc,GAAG,MAAM,CAAC,UAAU,CAAC,sBAAsB,CAAC,WAAW,EAAE,CAAC;IAC5E,IAAI,gBA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,CAAC,CAAC,CAAC;QAEH,KAAK,CAAC,GAAG,EAAE;YACT,MAAM,oBAAoB,GAAG,QAAQ,CAAC,eAAe,CAAC,aAAa,CAAC,yBAAyB,CAAC,CAAC;YAC/F,IAAI,oBAAoB,EAAE,CAAC;gBACzB,QAAQ,CAAC,eAAe,CAAC,WAAW,CAAC,oBAAoB,CAAC,CAAC;YAC7D,CAAC;YACD,YAAY,CAAC,YAAY,CAAC,eAAe,EAAE,CAAC;QAC9C,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,qCAAqC,EAAE;YACxC,MAAM,CAAC,WAAW,CAAC,uBAAuB,CAAC,aAAa,EAAE,EAAE,YAAY,CAAC,CAAC;QAC5E,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["// Copyright 2023 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport * as Trace from '../../../models/trace/trace.js';\nimport {describeWithEnvironment} from '../../../testing/EnvironmentHelpers.js';\nimport {TraceLoader} from '../../../testing/TraceLoader.js';\nimport * as PerfUI from '../../../ui/legacy/components/perf_ui/perf_ui.js';\nimport * as ThemeSupport from '../../../ui/legacy/theme_support/theme_support.js';\nimport * as Timeline from '../timeline.js';\n\nfunction initTrackAppender(\n flameChartData: PerfUI.FlameChart.FlameChartTimelineData, parsedTrace: Trace.Handlers.Types.ParsedTrace,\n entryData: Trace.Types.Events.Event[], entryTypeByLevel: Timeline.TimelineFlameChartDataProvider.EntryType[]):\n Timeline.AnimationsTrackAppender.AnimationsTrackAppender {\n const compatibilityTracksAppender = new Timeline.CompatibilityTracksAppender.CompatibilityTracksAppender(\n flameChartData, parsedTrace, entryData, entryTypeByLevel);\n return compatibilityTracksAppender.animationsTrackAppender();\n}\n\ndescribeWithEnvironment('AnimationsTrackAppender', function() {\n let parsedTrace: Trace.Handlers.Types.ParsedTrace;\n let animationsTrackAppender: Timeline.AnimationsTrackAppender.AnimationsTrackAppender;\n let entryData: Trace.Types.Events.Event[] = [];\n let flameChartData = PerfUI.FlameChart.FlameChartTimelineData.createEmpty();\n let entryTypeByLevel: Timeline.TimelineFlameChartDataProvider.EntryType[] = [];\n\n beforeEach(async function() {\n ({parsedTrace} = await TraceLoader.traceEngine(this, 'animation.json.gz'));\n animationsTrackAppender = initTrackAppender(flameChartData, parsedTrace, entryData, entryTypeByLevel);\n animationsTrackAppender.appendTrackAtLevel(0);\n });\n\n afterEach(() => {\n entryData = [];\n flameChartData = PerfUI.FlameChart.FlameChartTimelineData.createEmpty();\n entryTypeByLevel = [];\n });\n\n describe('appendTrackAtLevel', function() {\n it('creates a flamechart group for the Animations track', function() {\n assert.strictEqual(flameChartData.groups.length, 1);\n assert.strictEqual(flameChartData.groups[0].name, 'Animations');\n });\n\n it('adds start times correctly', function() {\n const animationsRequests = parsedTrace.Animations.animations;\n for (let i = 0; i < animationsRequests.length; ++i) {\n const event = animationsRequests[i];\n assert.strictEqual(\n flameChartData.entryStartTimes[i], Trace.Helpers.Timing.microSecondsToMilliseconds(event.ts));\n }\n });\n\n it('adds total times correctly', function() {\n const animationsRequests = parsedTrace.Animations.animations;\n for (let i = 0; i < animationsRequests.length; i++) {\n const event = animationsRequests[i];\n if (Trace.Types.Events.isMarkerEvent(event)) {\n assert.isNaN(flameChartData.entryTotalTimes[i]);\n continue;\n }\n const expectedTotalTimeForEvent = event.dur ?\n Trace.Helpers.Timing.microSecondsToMilliseconds(event.dur) :\n Timeline.TimelineFlameChartDataProvider.InstantEventVisibleDurationMs;\n assert.strictEqual(flameChartData.entryTotalTimes[i], expectedTotalTimeForEvent);\n }\n });\n });\n\n describe('colorForEvent and titleForEvent', function() {\n before(() => {\n // Rather than use the real colours here and burden the test with having to\n // inject loads of CSS, we fake out the colours. this is fine for our tests as\n // the exact value of the colours is not important; we just make sure that it\n // parses them out correctly. Each variable is given a different rgb() value to\n // ensure we know the code is working and using the right one.\n const styleElement = document.createElement('style');\n styleElement.id = 'fake-perf-panel-colors';\n styleElement.textContent = `\n :root {\n --app-color-rendering: rgb(4 4 4);\n }\n `;\n document.documentElement.appendChild(styleElement);\n ThemeSupport.ThemeSupport.clearThemeCache();\n });\n\n after(() => {\n const styleElementToRemove = document.documentElement.querySelector('#fake-perf-panel-colors');\n if (styleElementToRemove) {\n document.documentElement.removeChild(styleElementToRemove);\n }\n ThemeSupport.ThemeSupport.clearThemeCache();\n });\n\n it('returns the correct color GPU tasks', function() {\n assert.strictEqual(animationsTrackAppender.colorForEvent(), 'rgb(4 4 4)');\n });\n });\n});\n"]} \ No newline at end of file +{"version":3,"file":"AnimationsTrackAppender.test.js","sourceRoot":"","sources":["../../../../../../../front_end/panels/timeline/track_appenders/AnimationsTrackAppender.test.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,KAAK,KAAK,MAAM,gCAAgC,CAAC;AACxD,OAAO,EAAC,uBAAuB,EAAC,MAAM,wCAAwC,CAAC;AAC/E,OAAO,EAAC,WAAW,EAAC,MAAM,iCAAiC,CAAC;AAC5D,OAAO,KAAK,MAAM,MAAM,kDAAkD,CAAC;AAC3E,OAAO,KAAK,YAAY,MAAM,mDAAmD,CAAC;AAClF,OAAO,KAAK,QAAQ,MAAM,gBAAgB,CAAC;AAE3C,SAAS,iBAAiB,CACtB,cAAwD,EAAE,WAA6C,EACvG,SAAqC,EAAE,gBAAqE;IAE9G,MAAM,2BAA2B,GAAG,IAAI,QAAQ,CAAC,2BAA2B,CAAC,2BAA2B,CACpG,cAAc,EAAE,WAAW,EAAE,SAAS,EAAE,gBAAgB,CAAC,CAAC;IAC9D,OAAO,2BAA2B,CAAC,uBAAuB,EAAE,CAAC;AAC/D,CAAC;AAED,uBAAuB,CAAC,yBAAyB,EAAE;IACjD,IAAI,WAA6C,CAAC;IAClD,IAAI,uBAAiF,CAAC;IACtF,IAAI,SAAS,GAA+B,EAAE,CAAC;IAC/C,IAAI,cAAc,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AY,CAAC,CAAC;YACnD,YAAY,CAAC,YAAY,CAAC,eAAe,EAAE,CAAC;QAC9C,CAAC,CAAC,CAAC;QAEH,KAAK,CAAC,GAAG,EAAE;YACT,MAAM,oBAAoB,GAAG,QAAQ,CAAC,eAAe,CAAC,aAAa,CAAC,yBAAyB,CAAC,CAAC;YAC/F,IAAI,oBAAoB,EAAE,CAAC;gBACzB,QAAQ,CAAC,eAAe,CAAC,WAAW,CAAC,oBAAoB,CAAC,CAAC;YAC7D,CAAC;YACD,YAAY,CAAC,YAAY,CAAC,eAAe,EAAE,CAAC;QAC9C,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,qCAAqC,EAAE;YACxC,MAAM,CAAC,WAAW,CAAC,uBAAuB,CAAC,aAAa,EAAE,EAAE,YAAY,CAAC,CAAC;QAC5E,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["// Copyright 2023 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport * as Trace from '../../../models/trace/trace.js';\nimport {describeWithEnvironment} from '../../../testing/EnvironmentHelpers.js';\nimport {TraceLoader} from '../../../testing/TraceLoader.js';\nimport * as PerfUI from '../../../ui/legacy/components/perf_ui/perf_ui.js';\nimport * as ThemeSupport from '../../../ui/legacy/theme_support/theme_support.js';\nimport * as Timeline from '../timeline.js';\n\nfunction initTrackAppender(\n flameChartData: PerfUI.FlameChart.FlameChartTimelineData, parsedTrace: Trace.Handlers.Types.ParsedTrace,\n entryData: Trace.Types.Events.Event[], entryTypeByLevel: Timeline.TimelineFlameChartDataProvider.EntryType[]):\n Timeline.AnimationsTrackAppender.AnimationsTrackAppender {\n const compatibilityTracksAppender = new Timeline.CompatibilityTracksAppender.CompatibilityTracksAppender(\n flameChartData, parsedTrace, entryData, entryTypeByLevel);\n return compatibilityTracksAppender.animationsTrackAppender();\n}\n\ndescribeWithEnvironment('AnimationsTrackAppender', function() {\n let parsedTrace: Trace.Handlers.Types.ParsedTrace;\n let animationsTrackAppender: Timeline.AnimationsTrackAppender.AnimationsTrackAppender;\n let entryData: Trace.Types.Events.Event[] = [];\n let flameChartData = PerfUI.FlameChart.FlameChartTimelineData.createEmpty();\n let entryTypeByLevel: Timeline.TimelineFlameChartDataProvider.EntryType[] = [];\n\n beforeEach(async function() {\n ({parsedTrace} = await TraceLoader.traceEngine(this, 'animation.json.gz'));\n animationsTrackAppender = initTrackAppender(flameChartData, parsedTrace, entryData, entryTypeByLevel);\n animationsTrackAppender.appendTrackAtLevel(0);\n });\n\n afterEach(() => {\n entryData = [];\n flameChartData = PerfUI.FlameChart.FlameChartTimelineData.createEmpty();\n entryTypeByLevel = [];\n });\n\n describe('appendTrackAtLevel', function() {\n it('creates a flamechart group for the Animations track', function() {\n assert.lengthOf(flameChartData.groups, 1);\n assert.strictEqual(flameChartData.groups[0].name, 'Animations');\n });\n\n it('adds start times correctly', function() {\n const animationsRequests = parsedTrace.Animations.animations;\n for (let i = 0; i < animationsRequests.length; ++i) {\n const event = animationsRequests[i];\n assert.strictEqual(\n flameChartData.entryStartTimes[i], Trace.Helpers.Timing.microSecondsToMilliseconds(event.ts));\n }\n });\n\n it('adds total times correctly', function() {\n const animationsRequests = parsedTrace.Animations.animations;\n for (let i = 0; i < animationsRequests.length; i++) {\n const event = animationsRequests[i];\n if (Trace.Types.Events.isMarkerEvent(event)) {\n assert.isNaN(flameChartData.entryTotalTimes[i]);\n continue;\n }\n const expectedTotalTimeForEvent = event.dur ?\n Trace.Helpers.Timing.microSecondsToMilliseconds(event.dur) :\n Timeline.TimelineFlameChartDataProvider.InstantEventVisibleDurationMs;\n assert.strictEqual(flameChartData.entryTotalTimes[i], expectedTotalTimeForEvent);\n }\n });\n });\n\n describe('colorForEvent and titleForEvent', function() {\n before(() => {\n // Rather than use the real colours here and burden the test with having to\n // inject loads of CSS, we fake out the colours. this is fine for our tests as\n // the exact value of the colours is not important; we just make sure that it\n // parses them out correctly. Each variable is given a different rgb() value to\n // ensure we know the code is working and using the right one.\n const styleElement = document.createElement('style');\n styleElement.id = 'fake-perf-panel-colors';\n styleElement.textContent = `\n :root {\n --app-color-rendering: rgb(4 4 4);\n }\n `;\n document.documentElement.appendChild(styleElement);\n ThemeSupport.ThemeSupport.clearThemeCache();\n });\n\n after(() => {\n const styleElementToRemove = document.documentElement.querySelector('#fake-perf-panel-colors');\n if (styleElementToRemove) {\n document.documentElement.removeChild(styleElementToRemove);\n }\n ThemeSupport.ThemeSupport.clearThemeCache();\n });\n\n it('returns the correct color GPU tasks', function() {\n assert.strictEqual(animationsTrackAppender.colorForEvent(), 'rgb(4 4 4)');\n });\n });\n});\n"]} \ No newline at end of file diff --git a/public/panels/timeline/track_appenders/CompatibilityTracksAppender.test.js b/public/panels/timeline/track_appenders/CompatibilityTracksAppender.test.js index dbc450107..c3bc15d46 100644 --- a/public/panels/timeline/track_appenders/CompatibilityTracksAppender.test.js +++ b/public/panels/timeline/track_appenders/CompatibilityTracksAppender.test.js @@ -74,14 +74,14 @@ describeWithEnvironment('CompatibilityTracksAppender', function () { // nested inside the same header. await initTrackAppender(this, 'lcp-images-rasterizer.json.gz'); const rasterTracks = tracksAppender.threadAppenders().filter(threadAppender => threadAppender.threadType === "RASTERIZER" /* Trace.Handlers.Threads.ThreadType.RASTERIZER */); - assert.strictEqual(rasterTracks.length, 2); + assert.lengthOf(rasterTracks, 2); const raster1Events = tracksAppender.eventsInTrack(rasterTracks[0]); - assert.strictEqual(raster1Events.length, 6); + assert.lengthOf(raster1Events, 6); assert.isTrue(Trace.Helpers.TreeHelpers.canBuildTreesFromEvents(raster1Events)); const raster1TreeEvents = tracksAppender.eventsForTreeView(rasterTracks[0]); assert.deepEqual(raster1TreeEvents, raster1Events); const raster2Events = tracksAppender.eventsInTrack(rasterTracks[1]); - assert.strictEqual(raster2Events.length, 1); + assert.lengthOf(raster2Events, 1); assert.isTrue(Trace.Helpers.TreeHelpers.canBuildTreesFromEvents(raster2Events)); const raster2TreeEvents = tracksAppender.eventsForTreeView(rasterTracks[1]); assert.deepEqual(raster2TreeEvents, raster2Events); diff --git a/public/panels/timeline/track_appenders/CompatibilityTracksAppender.test.js.map b/public/panels/timeline/track_appenders/CompatibilityTracksAppender.test.js.map index 4964178a6..e4fe92830 100644 --- a/public/panels/timeline/track_appenders/CompatibilityTracksAppender.test.js.map +++ b/public/panels/timeline/track_appenders/CompatibilityTracksAppender.test.js.map @@ -1 +1 @@ -{"version":3,"file":"CompatibilityTracksAppender.test.js","sourceRoot":"","sources":["../../../../../../../front_end/panels/timeline/track_appenders/CompatibilityTracksAppender.test.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,KAAK,KAAK,MAAM,gCAAgC,CAAC;AACxD,OAAO,EAAC,uBAAuB,EAAC,MAAM,wCAAwC,CAAC;AAC/E,OAAO,EAAC,iCAAiC,EAAC,MAAM,kCAAkC,CAAC;AACnF,OAAO,EAAC,WAAW,EAAC,MAAM,iCAAiC,CAAC;AAC5D,OAAO,KAAK,MAAM,MAAM,kDAAkD,CAAC;AAC3E,OAAO,KAAK,QAAQ,MAAM,gBAAgB,CAAC;AAE3C,uBAAuB,CAAC,6BAA6B,EAAE;IACrD,IAAI,WAA6C,CAAC;IAClD,IAAI,cAAgF,CAAC;IACrF,IAAI,SAAS,GAA+B,EAAE,CAAC;IAC/C,IAAI,cAAc,GAAG,MAAM,CAAC,UAAU,CAAC,sBAAsB,CAAC,WAAW,EAAE,CAAC;IAC5E,IAAI,gBAAgB,GAAwD,EAAE,CAAC;IAE/E,KAAK,UAAU,iBAAiB,CAC5B,OAAkC,EAAE,OAAO,GAAG,uBAAuB;QACvE,SAAS,GAAG,EAAE,CAAC;QACf,cAAc,GAAG,MAAM,CAAC,UAAU,CAAC,sBAAsB,CAAC,WAAW,EAAE,CAAC;QACxE,gBAAgB,GAAG,EAAE,CAAC;QACtB,CAAC,EAAC,WAAW,EAAC,G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AAC,cAAc,EAAE,IAAI,EAAE,yBAAyB,CAAC,CAAC;IACtE,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["// Copyright 2023 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport * as Trace from '../../../models/trace/trace.js';\nimport {describeWithEnvironment} from '../../../testing/EnvironmentHelpers.js';\nimport {setupIgnoreListManagerEnvironment} from '../../../testing/TraceHelpers.js';\nimport {TraceLoader} from '../../../testing/TraceLoader.js';\nimport * as PerfUI from '../../../ui/legacy/components/perf_ui/perf_ui.js';\nimport * as Timeline from '../timeline.js';\n\ndescribeWithEnvironment('CompatibilityTracksAppender', function() {\n let parsedTrace: Trace.Handlers.Types.ParsedTrace;\n let tracksAppender: Timeline.CompatibilityTracksAppender.CompatibilityTracksAppender;\n let entryData: Trace.Types.Events.Event[] = [];\n let flameChartData = PerfUI.FlameChart.FlameChartTimelineData.createEmpty();\n let entryTypeByLevel: Timeline.TimelineFlameChartDataProvider.EntryType[] = [];\n\n async function initTrackAppender(\n context: Mocha.Suite|Mocha.Context, fixture = 'timings-track.json.gz'): Promise {\n entryData = [];\n flameChartData = PerfUI.FlameChart.FlameChartTimelineData.createEmpty();\n entryTypeByLevel = [];\n ({parsedTrace} = await TraceLoader.traceEngine(context, fixture));\n tracksAppender = new Timeline.CompatibilityTracksAppender.CompatibilityTracksAppender(\n flameChartData, parsedTrace, entryData, entryTypeByLevel);\n const timingsTrack = tracksAppender.timingsTrackAppender();\n const gpuTrack = tracksAppender.gpuTrackAppender();\n const threadAppenders = tracksAppender.threadAppenders();\n let currentLevel = timingsTrack.appendTrackAtLevel(0);\n currentLevel = gpuTrack.appendTrackAtLevel(currentLevel);\n for (const threadAppender of threadAppenders) {\n currentLevel = threadAppender.appendTrackAtLevel(currentLevel);\n }\n }\n\n beforeEach(async () => {\n setupIgnoreListManagerEnvironment();\n await initTrackAppender(this);\n });\n\n describe('Tree view data', () => {\n describe('eventsInTrack', () => {\n it('returns all the events appended by a track with multiple levels', () => {\n const timingsTrack = tracksAppender.timingsTrackAppender();\n const timingsTrackEvents = tracksAppender.eventsInTrack(timingsTrack);\n const allTimingEvents = [\n ...parsedTrace.UserTimings.consoleTimings,\n ...parsedTrace.UserTimings.timestampEvents,\n ...parsedTrace.UserTimings.performanceMarks,\n ...parsedTrace.UserTimings.performanceMeasures,\n ].sort((a, b) => a.ts - b.ts);\n assert.deepEqual(timingsTrackEvents, allTimingEvents);\n });\n\n it('returns all the events appended by a track with one level', () => {\n const gpuTrack = tracksAppender.gpuTrackAppender();\n const gpuTrackEvents = tracksAppender.eventsInTrack(gpuTrack) as readonly Trace.Types.Events.Event[];\n assert.deepEqual(gpuTrackEvents, parsedTrace.GPU.mainGPUThreadTasks);\n });\n });\n describe('eventsForTreeView', () => {\n it('returns only sync events if using async events means a tree cannot be built', () => {\n const timingsTrack = tracksAppender.timingsTrackAppender();\n const timingsEvents = tracksAppender.eventsInTrack(timingsTrack);\n assert.isFalse(Trace.Helpers.TreeHelpers.canBuildTreesFromEvents(timingsEvents));\n const treeEvents = tracksAppender.eventsForTreeView(timingsTrack);\n const allEventsAreSync = treeEvents.every(event => !Trace.Types.Events.isPhaseAsync(event.ph));\n assert.isTrue(allEventsAreSync);\n });\n it('returns both sync and async events if a tree can be built with them', async () => {\n // This file contains events in the timings track that can be assembled as a tree\n await initTrackAppender(this, 'sync-like-timings.json.gz');\n const timingsTrack = tracksAppender.timingsTrackAppender();\n const timingsEvents = tracksAppender.eventsInTrack(timingsTrack);\n assert.isTrue(Trace.Helpers.TreeHelpers.canBuildTreesFromEvents(timingsEvents));\n const treeEvents = tracksAppender.eventsForTreeView(timingsTrack);\n assert.deepEqual(treeEvents, timingsEvents);\n });\n\n it('returns events for tree view for nested tracks', async () => {\n // This file contains two rasterizer threads which should be\n // nested inside the same header.\n await initTrackAppender(this, 'lcp-images-rasterizer.json.gz');\n const rasterTracks = tracksAppender.threadAppenders().filter(\n threadAppender => threadAppender.threadType === Trace.Handlers.Threads.ThreadType.RASTERIZER);\n assert.strictEqual(rasterTracks.length, 2);\n\n const raster1Events = tracksAppender.eventsInTrack(rasterTracks[0]);\n assert.strictEqual(raster1Events.length, 6);\n assert.isTrue(Trace.Helpers.TreeHelpers.canBuildTreesFromEvents(raster1Events));\n const raster1TreeEvents = tracksAppender.eventsForTreeView(rasterTracks[0]);\n assert.deepEqual(raster1TreeEvents, raster1Events);\n\n const raster2Events = tracksAppender.eventsInTrack(rasterTracks[1]);\n assert.strictEqual(raster2Events.length, 1);\n assert.isTrue(Trace.Helpers.TreeHelpers.canBuildTreesFromEvents(raster2Events));\n const raster2TreeEvents = tracksAppender.eventsForTreeView(rasterTracks[1]);\n assert.deepEqual(raster2TreeEvents, raster2Events);\n });\n });\n describe('groupEventsForTreeView', () => {\n it('returns all the events of a flame chart group with multiple levels', async () => {\n // This file contains events in the timings track that can be assembled as a tree\n await initTrackAppender(this, 'sync-like-timings.json.gz');\n const timingsGroupEvents = tracksAppender.groupEventsForTreeView(flameChartData.groups[0]);\n if (!timingsGroupEvents) {\n assert.fail('Could not find events for group');\n }\n const allTimingEvents = [\n ...parsedTrace.UserTimings.consoleTimings,\n ...parsedTrace.UserTimings.timestampEvents,\n ...parsedTrace.UserTimings.performanceMarks,\n ...parsedTrace.UserTimings.performanceMeasures,\n ].sort((a, b) => a.ts - b.ts);\n assert.deepEqual(timingsGroupEvents, allTimingEvents);\n });\n it('returns all the events of a flame chart group with one level', () => {\n const gpuGroupEvents =\n tracksAppender.groupEventsForTreeView(flameChartData.groups[1]) as readonly Trace.Types.Events.Event[];\n if (!gpuGroupEvents) {\n assert.fail('Could not find events for group');\n }\n assert.deepEqual(gpuGroupEvents, parsedTrace.GPU.mainGPUThreadTasks);\n });\n });\n });\n\n describe('popoverInfo', () => {\n it('shows the correct warning for a long task when hovered', async function() {\n await initTrackAppender(this, 'simple-js-program.json.gz');\n const events = parsedTrace.Renderer?.allTraceEntries;\n if (!events) {\n throw new Error('Could not find renderer events');\n }\n const longTask = events.find(e => (e.dur || 0) > 1_000_000);\n if (!longTask) {\n throw new Error('Could not find long task');\n }\n const info = tracksAppender.popoverInfo(longTask, 2);\n assert.strictEqual(info.warningElements?.length, 1);\n const warning = info.warningElements?.[0];\n if (!(warning instanceof HTMLSpanElement)) {\n throw new Error('Found unexpected warning');\n }\n assert.strictEqual(warning?.innerText, 'Long task took 1.30\\u00A0s.');\n });\n\n it('shows the correct warning for a forced recalc styles when hovered', async function() {\n await initTrackAppender(this, 'large-layout-small-recalc.json.gz');\n const events = parsedTrace.Warnings.perWarning.get('FORCED_REFLOW') || [];\n\n if (!events) {\n throw new Error('Could not find forced reflows events');\n }\n const recalcStyles = events[0];\n if (!recalcStyles) {\n throw new Error('Could not find recalc styles');\n }\n const info = tracksAppender.popoverInfo(recalcStyles, 2);\n assert.strictEqual(info.warningElements?.length, 1);\n const warning = info.warningElements?.[0];\n if (!(warning instanceof HTMLSpanElement)) {\n throw new Error('Found unexpected warning');\n }\n assert.strictEqual(warning?.innerText, 'Forced reflow is a likely performance bottleneck.');\n });\n\n it('shows the correct warning for a forced layout when hovered', async function() {\n await initTrackAppender(this, 'large-layout-small-recalc.json.gz');\n const events = parsedTrace.Warnings.perWarning.get('FORCED_REFLOW') || [];\n\n if (!events) {\n throw new Error('Could not find forced reflows events');\n }\n const layout = events[1];\n if (!layout) {\n throw new Error('Could not find layout');\n }\n const info = tracksAppender.popoverInfo(layout, 2);\n assert.strictEqual(info.warningElements?.length, 1);\n const warning = info.warningElements?.[0];\n if (!(warning instanceof HTMLSpanElement)) {\n throw new Error('Found unexpected warning');\n }\n assert.strictEqual(warning?.innerText, 'Forced reflow is a likely performance bottleneck.');\n });\n\n it('shows the correct warning for slow idle callbacks', async function() {\n await initTrackAppender(this, 'idle-callback.json.gz');\n const events = parsedTrace.Renderer?.allTraceEntries;\n if (!events) {\n throw new Error('Could not find renderer events');\n }\n const idleCallback = events.find(event => {\n const {duration} = Trace.Helpers.Timing.eventTimingsMilliSeconds(event);\n if (!Trace.Types.Events.isFireIdleCallback(event)) {\n return false;\n }\n if (duration <= event.args.data.allottedMilliseconds) {\n false;\n }\n return true;\n });\n if (!idleCallback) {\n throw new Error('Could not find idle callback');\n }\n const info = tracksAppender.popoverInfo(idleCallback, 2);\n assert.strictEqual(info.warningElements?.length, 1);\n const warning = info.warningElements?.[0];\n if (!(warning instanceof HTMLSpanElement)) {\n throw new Error('Found unexpected warning');\n }\n assert.strictEqual(warning?.innerText, 'Idle callback execution extended beyond deadline by 79.56\\u00A0ms');\n });\n });\n\n it('can return the group for a given level', async () => {\n await initTrackAppender(this, 'web-dev-with-commit.json.gz');\n // The order of these groups might seem odd, but it's based on the setup in\n // the initTrackAppender function which does GPU and then threads.\n const groupForLevel0 = tracksAppender.groupForLevel(0);\n assert.strictEqual(groupForLevel0?.name, 'GPU');\n const groupForLevel1 = tracksAppender.groupForLevel(1);\n assert.strictEqual(groupForLevel1?.name, 'Main — https://web.dev/');\n });\n});\n"]} \ No newline at end of file +{"version":3,"file":"CompatibilityTracksAppender.test.js","sourceRoot":"","sources":["../../../../../../../front_end/panels/timeline/track_appenders/CompatibilityTracksAppender.test.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,KAAK,KAAK,MAAM,gCAAgC,CAAC;AACxD,OAAO,EAAC,uBAAuB,EAAC,MAAM,wCAAwC,CAAC;AAC/E,OAAO,EAAC,iCAAiC,EAAC,MAAM,kCAAkC,CAAC;AACnF,OAAO,EAAC,WAAW,EAAC,MAAM,iCAAiC,CAAC;AAC5D,OAAO,KAAK,MAAM,MAAM,kDAAkD,CAAC;AAC3E,OAAO,KAAK,QAAQ,MAAM,gBAAgB,CAAC;AAE3C,uBAAuB,CAAC,6BAA6B,EAAE;IACrD,IAAI,WAA6C,CAAC;IAClD,IAAI,cAAgF,CAAC;IACrF,IAAI,SAAS,GAA+B,EAAE,CAAC;IAC/C,IA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MAAM,iBAAiB,CAAC,IAAI,EAAE,6BAA6B,CAAC,CAAC;QAC7D,2EAA2E;QAC3E,kEAAkE;QAClE,MAAM,cAAc,GAAG,cAAc,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC;QACvD,MAAM,CAAC,WAAW,CAAC,cAAc,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC;QAChD,MAAM,cAAc,GAAG,cAAc,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC;QACvD,MAAM,CAAC,WAAW,CAAC,cAAc,EAAE,IAAI,EAAE,yBAAyB,CAAC,CAAC;IACtE,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["// Copyright 2023 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport * as Trace from '../../../models/trace/trace.js';\nimport {describeWithEnvironment} from '../../../testing/EnvironmentHelpers.js';\nimport {setupIgnoreListManagerEnvironment} from '../../../testing/TraceHelpers.js';\nimport {TraceLoader} from '../../../testing/TraceLoader.js';\nimport * as PerfUI from '../../../ui/legacy/components/perf_ui/perf_ui.js';\nimport * as Timeline from '../timeline.js';\n\ndescribeWithEnvironment('CompatibilityTracksAppender', function() {\n let parsedTrace: Trace.Handlers.Types.ParsedTrace;\n let tracksAppender: Timeline.CompatibilityTracksAppender.CompatibilityTracksAppender;\n let entryData: Trace.Types.Events.Event[] = [];\n let flameChartData = PerfUI.FlameChart.FlameChartTimelineData.createEmpty();\n let entryTypeByLevel: Timeline.TimelineFlameChartDataProvider.EntryType[] = [];\n\n async function initTrackAppender(\n context: Mocha.Suite|Mocha.Context, fixture = 'timings-track.json.gz'): Promise {\n entryData = [];\n flameChartData = PerfUI.FlameChart.FlameChartTimelineData.createEmpty();\n entryTypeByLevel = [];\n ({parsedTrace} = await TraceLoader.traceEngine(context, fixture));\n tracksAppender = new Timeline.CompatibilityTracksAppender.CompatibilityTracksAppender(\n flameChartData, parsedTrace, entryData, entryTypeByLevel);\n const timingsTrack = tracksAppender.timingsTrackAppender();\n const gpuTrack = tracksAppender.gpuTrackAppender();\n const threadAppenders = tracksAppender.threadAppenders();\n let currentLevel = timingsTrack.appendTrackAtLevel(0);\n currentLevel = gpuTrack.appendTrackAtLevel(currentLevel);\n for (const threadAppender of threadAppenders) {\n currentLevel = threadAppender.appendTrackAtLevel(currentLevel);\n }\n }\n\n beforeEach(async () => {\n setupIgnoreListManagerEnvironment();\n await initTrackAppender(this);\n });\n\n describe('Tree view data', () => {\n describe('eventsInTrack', () => {\n it('returns all the events appended by a track with multiple levels', () => {\n const timingsTrack = tracksAppender.timingsTrackAppender();\n const timingsTrackEvents = tracksAppender.eventsInTrack(timingsTrack);\n const allTimingEvents = [\n ...parsedTrace.UserTimings.consoleTimings,\n ...parsedTrace.UserTimings.timestampEvents,\n ...parsedTrace.UserTimings.performanceMarks,\n ...parsedTrace.UserTimings.performanceMeasures,\n ].sort((a, b) => a.ts - b.ts);\n assert.deepEqual(timingsTrackEvents, allTimingEvents);\n });\n\n it('returns all the events appended by a track with one level', () => {\n const gpuTrack = tracksAppender.gpuTrackAppender();\n const gpuTrackEvents = tracksAppender.eventsInTrack(gpuTrack) as readonly Trace.Types.Events.Event[];\n assert.deepEqual(gpuTrackEvents, parsedTrace.GPU.mainGPUThreadTasks);\n });\n });\n describe('eventsForTreeView', () => {\n it('returns only sync events if using async events means a tree cannot be built', () => {\n const timingsTrack = tracksAppender.timingsTrackAppender();\n const timingsEvents = tracksAppender.eventsInTrack(timingsTrack);\n assert.isFalse(Trace.Helpers.TreeHelpers.canBuildTreesFromEvents(timingsEvents));\n const treeEvents = tracksAppender.eventsForTreeView(timingsTrack);\n const allEventsAreSync = treeEvents.every(event => !Trace.Types.Events.isPhaseAsync(event.ph));\n assert.isTrue(allEventsAreSync);\n });\n it('returns both sync and async events if a tree can be built with them', async () => {\n // This file contains events in the timings track that can be assembled as a tree\n await initTrackAppender(this, 'sync-like-timings.json.gz');\n const timingsTrack = tracksAppender.timingsTrackAppender();\n const timingsEvents = tracksAppender.eventsInTrack(timingsTrack);\n assert.isTrue(Trace.Helpers.TreeHelpers.canBuildTreesFromEvents(timingsEvents));\n const treeEvents = tracksAppender.eventsForTreeView(timingsTrack);\n assert.deepEqual(treeEvents, timingsEvents);\n });\n\n it('returns events for tree view for nested tracks', async () => {\n // This file contains two rasterizer threads which should be\n // nested inside the same header.\n await initTrackAppender(this, 'lcp-images-rasterizer.json.gz');\n const rasterTracks = tracksAppender.threadAppenders().filter(\n threadAppender => threadAppender.threadType === Trace.Handlers.Threads.ThreadType.RASTERIZER);\n assert.lengthOf(rasterTracks, 2);\n\n const raster1Events = tracksAppender.eventsInTrack(rasterTracks[0]);\n assert.lengthOf(raster1Events, 6);\n assert.isTrue(Trace.Helpers.TreeHelpers.canBuildTreesFromEvents(raster1Events));\n const raster1TreeEvents = tracksAppender.eventsForTreeView(rasterTracks[0]);\n assert.deepEqual(raster1TreeEvents, raster1Events);\n\n const raster2Events = tracksAppender.eventsInTrack(rasterTracks[1]);\n assert.lengthOf(raster2Events, 1);\n assert.isTrue(Trace.Helpers.TreeHelpers.canBuildTreesFromEvents(raster2Events));\n const raster2TreeEvents = tracksAppender.eventsForTreeView(rasterTracks[1]);\n assert.deepEqual(raster2TreeEvents, raster2Events);\n });\n });\n describe('groupEventsForTreeView', () => {\n it('returns all the events of a flame chart group with multiple levels', async () => {\n // This file contains events in the timings track that can be assembled as a tree\n await initTrackAppender(this, 'sync-like-timings.json.gz');\n const timingsGroupEvents = tracksAppender.groupEventsForTreeView(flameChartData.groups[0]);\n if (!timingsGroupEvents) {\n assert.fail('Could not find events for group');\n }\n const allTimingEvents = [\n ...parsedTrace.UserTimings.consoleTimings,\n ...parsedTrace.UserTimings.timestampEvents,\n ...parsedTrace.UserTimings.performanceMarks,\n ...parsedTrace.UserTimings.performanceMeasures,\n ].sort((a, b) => a.ts - b.ts);\n assert.deepEqual(timingsGroupEvents, allTimingEvents);\n });\n it('returns all the events of a flame chart group with one level', () => {\n const gpuGroupEvents =\n tracksAppender.groupEventsForTreeView(flameChartData.groups[1]) as readonly Trace.Types.Events.Event[];\n if (!gpuGroupEvents) {\n assert.fail('Could not find events for group');\n }\n assert.deepEqual(gpuGroupEvents, parsedTrace.GPU.mainGPUThreadTasks);\n });\n });\n });\n\n describe('popoverInfo', () => {\n it('shows the correct warning for a long task when hovered', async function() {\n await initTrackAppender(this, 'simple-js-program.json.gz');\n const events = parsedTrace.Renderer?.allTraceEntries;\n if (!events) {\n throw new Error('Could not find renderer events');\n }\n const longTask = events.find(e => (e.dur || 0) > 1_000_000);\n if (!longTask) {\n throw new Error('Could not find long task');\n }\n const info = tracksAppender.popoverInfo(longTask, 2);\n assert.strictEqual(info.warningElements?.length, 1);\n const warning = info.warningElements?.[0];\n if (!(warning instanceof HTMLSpanElement)) {\n throw new Error('Found unexpected warning');\n }\n assert.strictEqual(warning?.innerText, 'Long task took 1.30\\u00A0s.');\n });\n\n it('shows the correct warning for a forced recalc styles when hovered', async function() {\n await initTrackAppender(this, 'large-layout-small-recalc.json.gz');\n const events = parsedTrace.Warnings.perWarning.get('FORCED_REFLOW') || [];\n\n if (!events) {\n throw new Error('Could not find forced reflows events');\n }\n const recalcStyles = events[0];\n if (!recalcStyles) {\n throw new Error('Could not find recalc styles');\n }\n const info = tracksAppender.popoverInfo(recalcStyles, 2);\n assert.strictEqual(info.warningElements?.length, 1);\n const warning = info.warningElements?.[0];\n if (!(warning instanceof HTMLSpanElement)) {\n throw new Error('Found unexpected warning');\n }\n assert.strictEqual(warning?.innerText, 'Forced reflow is a likely performance bottleneck.');\n });\n\n it('shows the correct warning for a forced layout when hovered', async function() {\n await initTrackAppender(this, 'large-layout-small-recalc.json.gz');\n const events = parsedTrace.Warnings.perWarning.get('FORCED_REFLOW') || [];\n\n if (!events) {\n throw new Error('Could not find forced reflows events');\n }\n const layout = events[1];\n if (!layout) {\n throw new Error('Could not find layout');\n }\n const info = tracksAppender.popoverInfo(layout, 2);\n assert.strictEqual(info.warningElements?.length, 1);\n const warning = info.warningElements?.[0];\n if (!(warning instanceof HTMLSpanElement)) {\n throw new Error('Found unexpected warning');\n }\n assert.strictEqual(warning?.innerText, 'Forced reflow is a likely performance bottleneck.');\n });\n\n it('shows the correct warning for slow idle callbacks', async function() {\n await initTrackAppender(this, 'idle-callback.json.gz');\n const events = parsedTrace.Renderer?.allTraceEntries;\n if (!events) {\n throw new Error('Could not find renderer events');\n }\n const idleCallback = events.find(event => {\n const {duration} = Trace.Helpers.Timing.eventTimingsMilliSeconds(event);\n if (!Trace.Types.Events.isFireIdleCallback(event)) {\n return false;\n }\n if (duration <= event.args.data.allottedMilliseconds) {\n false;\n }\n return true;\n });\n if (!idleCallback) {\n throw new Error('Could not find idle callback');\n }\n const info = tracksAppender.popoverInfo(idleCallback, 2);\n assert.strictEqual(info.warningElements?.length, 1);\n const warning = info.warningElements?.[0];\n if (!(warning instanceof HTMLSpanElement)) {\n throw new Error('Found unexpected warning');\n }\n assert.strictEqual(warning?.innerText, 'Idle callback execution extended beyond deadline by 79.56\\u00A0ms');\n });\n });\n\n it('can return the group for a given level', async () => {\n await initTrackAppender(this, 'web-dev-with-commit.json.gz');\n // The order of these groups might seem odd, but it's based on the setup in\n // the initTrackAppender function which does GPU and then threads.\n const groupForLevel0 = tracksAppender.groupForLevel(0);\n assert.strictEqual(groupForLevel0?.name, 'GPU');\n const groupForLevel1 = tracksAppender.groupForLevel(1);\n assert.strictEqual(groupForLevel1?.name, 'Main — https://web.dev/');\n });\n});\n"]} \ No newline at end of file diff --git a/public/panels/timeline/track_appenders/ExtensionTrackAppender.test.js b/public/panels/timeline/track_appenders/ExtensionTrackAppender.test.js index dc7427efd..698a970fb 100644 --- a/public/panels/timeline/track_appenders/ExtensionTrackAppender.test.js +++ b/public/panels/timeline/track_appenders/ExtensionTrackAppender.test.js @@ -35,7 +35,7 @@ describeWithEnvironment('ExtensionTrackAppender', function () { }); describe('appendTrackAtLevel', function () { it('creates flamechart groups for the Extension tracks properly', function () { - assert.strictEqual(flameChartData.groups.length, 3); + assert.lengthOf(flameChartData.groups, 3); assert.strictEqual(flameChartData.groups[0].name, 'A track group — Custom track'); assert.strictEqual(flameChartData.groups[0].startLevel, 0); assert.strictEqual(flameChartData.groups[0].style.nestingLevel, 0); @@ -186,7 +186,7 @@ describeWithEnvironment('ExtensionTrackAppender', function () { extensionTrackAppenders.forEach(appender => { level = appender.appendTrackAtLevel(level); }); - assert.strictEqual(flameChartData.groups.length, 0); + assert.lengthOf(flameChartData.groups, 0); Timeline.TimelinePanel.TimelinePanel.extensionDataVisibilitySetting().set(true); }); }); @@ -211,7 +211,7 @@ describeWithEnvironment('ExtensionTrackAppender', function () { assert.strictEqual(info.title, 'A hint if needed'); // The i18n encodes spaces using the u00A0 unicode character. assert.strictEqual(info.formattedTime, '1.00\u00A0s'); - assert.strictEqual(info.additionalElements?.at(0)?.nodeName, undefined); + assert.isUndefined(info.additionalElements?.at(0)?.nodeName); }); }); }); diff --git a/public/panels/timeline/track_appenders/ExtensionTrackAppender.test.js.map b/public/panels/timeline/track_appenders/ExtensionTrackAppender.test.js.map index 8aff6fe65..cf777ec48 100644 --- a/public/panels/timeline/track_appenders/ExtensionTrackAppender.test.js.map +++ b/public/panels/timeline/track_appenders/ExtensionTrackAppender.test.js.map @@ -1 +1 @@ -{"version":3,"file":"ExtensionTrackAppender.test.js","sourceRoot":"","sources":["../../../../../../../front_end/panels/timeline/track_appenders/ExtensionTrackAppender.test.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,EAAE,iDAAiD;AACxD,qCAAqC,GAEtC,MAAM,kEAAkE,CAAC;AAC1E,OAAO,KAAK,KAAK,MAAM,gCAAgC,CAAC;AACxD,OAAO,EAAC,uBAAuB,EAAC,MAAM,wCAAwC,CAAC;AAC/E,OAAO,EAAC,0BAA0B,EAAC,MAAM,kCAAkC,CAAC;AAC5E,OAAO,EAAC,WAAW,EAAC,MAAM,iC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KAAK,CAAC,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;YAChH,uBAAuB,CAAC,CAAC,CAAC,CAAC,cAAc,CAAC,wBAAwB,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC;YAC7E,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,KAAK,EAAE,kBAAkB,CAAC,CAAC;YACnD,6DAA6D;YAC7D,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,aAAa,EAAE,aAAa,CAAC,CAAC;YACtD,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,kBAAkB,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,SAAS,CAAC,CAAC;QAC1E,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["// Copyright 2024 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport { // eslint-disable-line rulesdir/es-modules-import\n createTraceExtensionDataFromTestInput,\n type ExtensionTestData,\n} from '../../../models/trace/handlers/ExtensionTraceDataHandler.test.js';\nimport * as Trace from '../../../models/trace/trace.js';\nimport {describeWithEnvironment} from '../../../testing/EnvironmentHelpers.js';\nimport {getBaseTraceParseModelData} from '../../../testing/TraceHelpers.js';\nimport {TraceLoader} from '../../../testing/TraceLoader.js';\nimport * as PerfUI from '../../../ui/legacy/components/perf_ui/perf_ui.js';\nimport * as ThemeSupport from '../../../ui/legacy/theme_support/theme_support.js';\nimport * as Timeline from '../timeline.js';\n\nfunction initTrackAppender(\n flameChartData: PerfUI.FlameChart.FlameChartTimelineData, parsedTrace: Trace.Handlers.Types.ParsedTrace,\n entryData: Trace.Types.Events.Event[], entryTypeByLevel: Timeline.TimelineFlameChartDataProvider.EntryType[]):\n Timeline.ExtensionTrackAppender.ExtensionTrackAppender[] {\n const compatibilityTracksAppender = new Timeline.CompatibilityTracksAppender.CompatibilityTracksAppender(\n flameChartData, parsedTrace, entryData, entryTypeByLevel);\n\n return compatibilityTracksAppender.allVisibleTrackAppenders().filter(track => track.appenderName === 'Extension') as\n Timeline.ExtensionTrackAppender.ExtensionTrackAppender[];\n}\n\ndescribeWithEnvironment('ExtensionTrackAppender', function() {\n let parsedTrace: Trace.Handlers.Types.ParsedTrace;\n let extensionTrackAppenders: Timeline.ExtensionTrackAppender.ExtensionTrackAppender[];\n let entryData: Trace.Types.Events.Event[] = [];\n let flameChartData = PerfUI.FlameChart.FlameChartTimelineData.createEmpty();\n let entryTypeByLevel: Timeline.TimelineFlameChartDataProvider.EntryType[] = [];\n\n beforeEach(async function() {\n ({parsedTrace} = await TraceLoader.traceEngine(this, 'extension-tracks-and-marks.json.gz'));\n extensionTrackAppenders = initTrackAppender(flameChartData, parsedTrace, entryData, entryTypeByLevel);\n let level = 0;\n extensionTrackAppenders.forEach(appender => {\n level = appender.appendTrackAtLevel(level);\n });\n });\n\n afterEach(() => {\n entryData = [];\n flameChartData = PerfUI.FlameChart.FlameChartTimelineData.createEmpty();\n entryTypeByLevel = [];\n });\n\n describe('appendTrackAtLevel', function() {\n it('creates flamechart groups for the Extension tracks properly', function() {\n assert.strictEqual(flameChartData.groups.length, 3);\n assert.strictEqual(flameChartData.groups[0].name, 'A track group — Custom track');\n assert.strictEqual(flameChartData.groups[0].startLevel, 0);\n assert.strictEqual(flameChartData.groups[0].style.nestingLevel, 0);\n assert.strictEqual(flameChartData.groups[1].name, 'Another Extension Track');\n assert.strictEqual(flameChartData.groups[1].startLevel, 0);\n assert.strictEqual(flameChartData.groups[1].style.nestingLevel, 1);\n assert.strictEqual(flameChartData.groups[2].name, 'An Extension Track — Custom track');\n assert.strictEqual(flameChartData.groups[2].startLevel, 1);\n assert.strictEqual(flameChartData.groups[2].style.nestingLevel, 0);\n });\n\n it('adds start times correctly', function() {\n const allExtensionTrackEntries =\n parsedTrace.ExtensionTraceData.extensionTrackData.map(track => Object.values(track.entriesByTrack)).flat(2);\n for (let i = 0; i < allExtensionTrackEntries.length; ++i) {\n const event = allExtensionTrackEntries[i];\n assert.strictEqual(\n flameChartData.entryStartTimes[i], Trace.Helpers.Timing.microSecondsToMilliseconds(event.ts));\n }\n });\n\n it('adds total times correctly', function() {\n const allExtensionTrackEntries =\n parsedTrace.ExtensionTraceData.extensionTrackData.map(track => Object.values(track.entriesByTrack)).flat(2);\n for (let i = 0; i < allExtensionTrackEntries.length; i++) {\n const event = allExtensionTrackEntries[i];\n if (Trace.Types.Events.isMarkerEvent(event)) {\n assert.isNaN(flameChartData.entryTotalTimes[i]);\n continue;\n }\n const expectedTotalTimeForEvent = event.dur ?\n Trace.Helpers.Timing.microSecondsToMilliseconds(event.dur) :\n Timeline.TimelineFlameChartDataProvider.InstantEventVisibleDurationMs;\n assert.strictEqual(flameChartData.entryTotalTimes[i], expectedTotalTimeForEvent);\n }\n });\n\n it('Assigns a lower level (closer to the top) to an event buffered later when start and end times are equal',\n async function() {\n // Three extension entries with same start and end time.\n // Test they are appended in inverse order.\n const extensionData = [\n {\n detail: {\n devtools: {dataType: 'track-entry', track: 'track'},\n },\n name: 'First measurement',\n ts: 100,\n dur: 100,\n },\n {\n detail: {devtools: {track: 'track'}},\n name: 'Second measurement',\n ts: 100,\n dur: 100,\n },\n {\n detail: {devtools: {track: 'track'}},\n name: 'Third measurement',\n ts: 100,\n dur: 100,\n },\n ] as ExtensionTestData[];\n const traceExtensionData = await createTraceExtensionDataFromTestInput(extensionData);\n const testParsedTrace = getBaseTraceParseModelData({ExtensionTraceData: traceExtensionData});\n entryData = [];\n flameChartData = PerfUI.FlameChart.FlameChartTimelineData.createEmpty();\n entryTypeByLevel = [];\n extensionTrackAppenders = initTrackAppender(flameChartData, testParsedTrace, entryData, entryTypeByLevel);\n let level = 0;\n extensionTrackAppenders.forEach(appender => {\n level = appender.appendTrackAtLevel(level);\n });\n const indexForFirst = entryData.findIndex(e => e.name === 'First measurement');\n const indexForSecond = entryData.findIndex(e => e.name === 'Second measurement');\n const indexForThird = entryData.findIndex(e => e.name === 'Third measurement');\n assert.strictEqual(flameChartData.entryLevels[indexForThird], 0);\n assert.strictEqual(flameChartData.entryLevels[indexForSecond], 1);\n assert.strictEqual(flameChartData.entryLevels[indexForFirst], 2);\n });\n });\n\n describe('colorForEvent and titleForEvent', function() {\n before(() => {\n // Rather than use the real colours here and burden the test with having to\n // inject loads of CSS, we fake out the colours. this is fine for our tests as\n // the exact value of the colours is not important; we just make sure that it\n // parses them out correctly. Each variable is given a different rgb() value to\n // ensure we know the code is working and using the right one.\n const styleElement = document.createElement('style');\n styleElement.id = 'fake-perf-panel-colors';\n styleElement.textContent = `\n :root {\n --ref-palette-blue70: rgb(4 4 4);\n --ref-palette-green70: rgb(10 10 10);\n }\n `;\n document.documentElement.appendChild(styleElement);\n ThemeSupport.ThemeSupport.clearThemeCache();\n });\n\n after(() => {\n const styleElementToRemove = document.documentElement.querySelector('#fake-perf-panel-colors');\n if (styleElementToRemove) {\n document.documentElement.removeChild(styleElementToRemove);\n }\n ThemeSupport.ThemeSupport.clearThemeCache();\n });\n it('returns the correct color and title for extension entries', function() {\n const allExtensionTrackEntries =\n parsedTrace.ExtensionTraceData.extensionTrackData.map(track => Object.values(track.entriesByTrack)).flat(2);\n for (const event of allExtensionTrackEntries) {\n assert.strictEqual(extensionTrackAppenders[0].titleForEvent(event), event.name);\n if (event.args.color === 'tertiary') {\n // \"tertiary\" color category is mapped to --ref-palette-green70\n // which is faked out to 10, 10, 10\n assert.strictEqual(extensionTrackAppenders[0].colorForEvent(event), 'rgb(10 10 10)');\n } else {\n // Unknown colors are mapped to \"primary\" by default, and\n // \"primary\" color category is mapped to --ref-palette-blue70\n // which is faked out to 4, 4, 4\n assert.strictEqual(extensionTrackAppenders[0].colorForEvent(event), 'rgb(4 4 4)');\n }\n }\n });\n\n it('sets a default value when a color is not set or is set an unknown value', function() {\n const mockExtensionEntryNoColor = {\n args: {\n metadata: {dataType: 'track-entry', extensionName: 'Extension'},\n track: 'A track',\n },\n cat: 'devtools.extension',\n } as unknown as Trace.Types.Events.Event;\n\n const mockExtensionEntryUnknownColor = {\n args: {\n metadata: {dataType: 'track-entry', extensionName: 'Extension'},\n track: 'A track',\n color: 'anUnknownColor',\n },\n cat: 'devtools.extension',\n } as unknown as Trace.Types.Events.Event;\n // \"primary\" color category is mapped to --ref-palette-blue70\n // which is faked out to 4, 4, 4\n assert.strictEqual(extensionTrackAppenders[0].colorForEvent(mockExtensionEntryNoColor), 'rgb(4 4 4)');\n assert.strictEqual(extensionTrackAppenders[0].colorForEvent(mockExtensionEntryUnknownColor), 'rgb(4 4 4)');\n });\n });\n\n describe('toggling', function() {\n it('Does not append extension data when the configuration is set to disabled', async function() {\n entryData = [];\n flameChartData = PerfUI.FlameChart.FlameChartTimelineData.createEmpty();\n entryTypeByLevel = [];\n Timeline.TimelinePanel.TimelinePanel.extensionDataVisibilitySetting().set(false);\n parsedTrace = (await TraceLoader.traceEngine(this, 'extension-tracks-and-marks.json.gz')).parsedTrace;\n extensionTrackAppenders = initTrackAppender(flameChartData, parsedTrace, entryData, entryTypeByLevel);\n let level = 0;\n extensionTrackAppenders.forEach(appender => {\n level = appender.appendTrackAtLevel(level);\n });\n assert.strictEqual(flameChartData.groups.length, 0);\n Timeline.TimelinePanel.TimelinePanel.extensionDataVisibilitySetting().set(true);\n });\n });\n\n describe('titleForEvent', function() {\n it('returns the title for an entry correctly', function() {\n const allExtensionTrackEntries =\n parsedTrace.ExtensionTraceData.extensionTrackData.map(track => Object.values(track.entriesByTrack)).flat(2);\n const title = extensionTrackAppenders[0].titleForEvent(allExtensionTrackEntries[0]);\n assert.strictEqual(title, 'An extension measurement');\n });\n });\n\n describe('setPopoverInfo', function() {\n it('build the tooltip content for an entry correctly', function() {\n const info: Timeline.CompatibilityTracksAppender.PopoverInfo = {\n title: 'title',\n formattedTime: 'time',\n warningElements: [],\n additionalElements: [],\n url: null,\n };\n const allExtensionTrackEntries =\n parsedTrace.ExtensionTraceData.extensionTrackData.map(track => Object.values(track.entriesByTrack)).flat(2);\n extensionTrackAppenders[0].setPopoverInfo(allExtensionTrackEntries[0], info);\n assert.strictEqual(info.title, 'A hint if needed');\n // The i18n encodes spaces using the u00A0 unicode character.\n assert.strictEqual(info.formattedTime, '1.00\\u00A0s');\n assert.strictEqual(info.additionalElements?.at(0)?.nodeName, undefined);\n });\n });\n});\n"]} \ No newline at end of file +{"version":3,"file":"ExtensionTrackAppender.test.js","sourceRoot":"","sources":["../../../../../../../front_end/panels/timeline/track_appenders/ExtensionTrackAppender.test.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,EAAE,iDAAiD;AACxD,qCAAqC,GAEtC,MAAM,kEAAkE,CAAC;AAC1E,OAAO,KAAK,KAAK,MAAM,gCAAgC,CAAC;AACxD,OAAO,EAAC,uBAAuB,EAAC,MAAM,wCAAwC,CAAC;AAC/E,OAAO,EAAC,0BAA0B,EAAC,MAAM,kCAAkC,CAAC;AAC5E,OAAO,EAAC,WAAW,EAAC,MAAM,iCAAiC,CAAC;AAC5D,OAAO,KAAK,MAAM,MAAM,kDAAkD,CAAC;AAC3E,OAAO,KAAK,YAAY,MAAM,mDAAmD,CAAC;AAClF,OAAO,KAAK,QAAQ,MAAM,gBAAgB,CAAC;AAE3C,SAAS,iBAAiB,CACtB,cAAwD,EAAE,WAA6C,EACvG,SAAqC,EAAE,gBAAqE;IAE9G,MAAM,2BAA2B,GAAG,IAAI,QAAQ,CAAC,2BAA2B,CAAC,2BAA2B,CACpG,cAAc,EAAE,WAAW,EAAE,SAAS,EAAE,gBAAgB,CAAC,CAAC;IAE9D,OAAO,2BAA2B,CAAC,wBAAwB,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,YAAY,KAAK,WAAW,CACpD,CAAC;AAC/D,CAAC;AAED,uBAAuB,CAAC,wBAAwB,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CAAC,CAAC","sourcesContent":["// Copyright 2024 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport { // eslint-disable-line rulesdir/es-modules-import\n createTraceExtensionDataFromTestInput,\n type ExtensionTestData,\n} from '../../../models/trace/handlers/ExtensionTraceDataHandler.test.js';\nimport * as Trace from '../../../models/trace/trace.js';\nimport {describeWithEnvironment} from '../../../testing/EnvironmentHelpers.js';\nimport {getBaseTraceParseModelData} from '../../../testing/TraceHelpers.js';\nimport {TraceLoader} from '../../../testing/TraceLoader.js';\nimport * as PerfUI from '../../../ui/legacy/components/perf_ui/perf_ui.js';\nimport * as ThemeSupport from '../../../ui/legacy/theme_support/theme_support.js';\nimport * as Timeline from '../timeline.js';\n\nfunction initTrackAppender(\n flameChartData: PerfUI.FlameChart.FlameChartTimelineData, parsedTrace: Trace.Handlers.Types.ParsedTrace,\n entryData: Trace.Types.Events.Event[], entryTypeByLevel: Timeline.TimelineFlameChartDataProvider.EntryType[]):\n Timeline.ExtensionTrackAppender.ExtensionTrackAppender[] {\n const compatibilityTracksAppender = new Timeline.CompatibilityTracksAppender.CompatibilityTracksAppender(\n flameChartData, parsedTrace, entryData, entryTypeByLevel);\n\n return compatibilityTracksAppender.allVisibleTrackAppenders().filter(track => track.appenderName === 'Extension') as\n Timeline.ExtensionTrackAppender.ExtensionTrackAppender[];\n}\n\ndescribeWithEnvironment('ExtensionTrackAppender', function() {\n let parsedTrace: Trace.Handlers.Types.ParsedTrace;\n let extensionTrackAppenders: Timeline.ExtensionTrackAppender.ExtensionTrackAppender[];\n let entryData: Trace.Types.Events.Event[] = [];\n let flameChartData = PerfUI.FlameChart.FlameChartTimelineData.createEmpty();\n let entryTypeByLevel: Timeline.TimelineFlameChartDataProvider.EntryType[] = [];\n\n beforeEach(async function() {\n ({parsedTrace} = await TraceLoader.traceEngine(this, 'extension-tracks-and-marks.json.gz'));\n extensionTrackAppenders = initTrackAppender(flameChartData, parsedTrace, entryData, entryTypeByLevel);\n let level = 0;\n extensionTrackAppenders.forEach(appender => {\n level = appender.appendTrackAtLevel(level);\n });\n });\n\n afterEach(() => {\n entryData = [];\n flameChartData = PerfUI.FlameChart.FlameChartTimelineData.createEmpty();\n entryTypeByLevel = [];\n });\n\n describe('appendTrackAtLevel', function() {\n it('creates flamechart groups for the Extension tracks properly', function() {\n assert.lengthOf(flameChartData.groups, 3);\n assert.strictEqual(flameChartData.groups[0].name, 'A track group — Custom track');\n assert.strictEqual(flameChartData.groups[0].startLevel, 0);\n assert.strictEqual(flameChartData.groups[0].style.nestingLevel, 0);\n assert.strictEqual(flameChartData.groups[1].name, 'Another Extension Track');\n assert.strictEqual(flameChartData.groups[1].startLevel, 0);\n assert.strictEqual(flameChartData.groups[1].style.nestingLevel, 1);\n assert.strictEqual(flameChartData.groups[2].name, 'An Extension Track — Custom track');\n assert.strictEqual(flameChartData.groups[2].startLevel, 1);\n assert.strictEqual(flameChartData.groups[2].style.nestingLevel, 0);\n });\n\n it('adds start times correctly', function() {\n const allExtensionTrackEntries =\n parsedTrace.ExtensionTraceData.extensionTrackData.map(track => Object.values(track.entriesByTrack)).flat(2);\n for (let i = 0; i < allExtensionTrackEntries.length; ++i) {\n const event = allExtensionTrackEntries[i];\n assert.strictEqual(\n flameChartData.entryStartTimes[i], Trace.Helpers.Timing.microSecondsToMilliseconds(event.ts));\n }\n });\n\n it('adds total times correctly', function() {\n const allExtensionTrackEntries =\n parsedTrace.ExtensionTraceData.extensionTrackData.map(track => Object.values(track.entriesByTrack)).flat(2);\n for (let i = 0; i < allExtensionTrackEntries.length; i++) {\n const event = allExtensionTrackEntries[i];\n if (Trace.Types.Events.isMarkerEvent(event)) {\n assert.isNaN(flameChartData.entryTotalTimes[i]);\n continue;\n }\n const expectedTotalTimeForEvent = event.dur ?\n Trace.Helpers.Timing.microSecondsToMilliseconds(event.dur) :\n Timeline.TimelineFlameChartDataProvider.InstantEventVisibleDurationMs;\n assert.strictEqual(flameChartData.entryTotalTimes[i], expectedTotalTimeForEvent);\n }\n });\n\n it('Assigns a lower level (closer to the top) to an event buffered later when start and end times are equal',\n async function() {\n // Three extension entries with same start and end time.\n // Test they are appended in inverse order.\n const extensionData = [\n {\n detail: {\n devtools: {dataType: 'track-entry', track: 'track'},\n },\n name: 'First measurement',\n ts: 100,\n dur: 100,\n },\n {\n detail: {devtools: {track: 'track'}},\n name: 'Second measurement',\n ts: 100,\n dur: 100,\n },\n {\n detail: {devtools: {track: 'track'}},\n name: 'Third measurement',\n ts: 100,\n dur: 100,\n },\n ] as ExtensionTestData[];\n const traceExtensionData = await createTraceExtensionDataFromTestInput(extensionData);\n const testParsedTrace = getBaseTraceParseModelData({ExtensionTraceData: traceExtensionData});\n entryData = [];\n flameChartData = PerfUI.FlameChart.FlameChartTimelineData.createEmpty();\n entryTypeByLevel = [];\n extensionTrackAppenders = initTrackAppender(flameChartData, testParsedTrace, entryData, entryTypeByLevel);\n let level = 0;\n extensionTrackAppenders.forEach(appender => {\n level = appender.appendTrackAtLevel(level);\n });\n const indexForFirst = entryData.findIndex(e => e.name === 'First measurement');\n const indexForSecond = entryData.findIndex(e => e.name === 'Second measurement');\n const indexForThird = entryData.findIndex(e => e.name === 'Third measurement');\n assert.strictEqual(flameChartData.entryLevels[indexForThird], 0);\n assert.strictEqual(flameChartData.entryLevels[indexForSecond], 1);\n assert.strictEqual(flameChartData.entryLevels[indexForFirst], 2);\n });\n });\n\n describe('colorForEvent and titleForEvent', function() {\n before(() => {\n // Rather than use the real colours here and burden the test with having to\n // inject loads of CSS, we fake out the colours. this is fine for our tests as\n // the exact value of the colours is not important; we just make sure that it\n // parses them out correctly. Each variable is given a different rgb() value to\n // ensure we know the code is working and using the right one.\n const styleElement = document.createElement('style');\n styleElement.id = 'fake-perf-panel-colors';\n styleElement.textContent = `\n :root {\n --ref-palette-blue70: rgb(4 4 4);\n --ref-palette-green70: rgb(10 10 10);\n }\n `;\n document.documentElement.appendChild(styleElement);\n ThemeSupport.ThemeSupport.clearThemeCache();\n });\n\n after(() => {\n const styleElementToRemove = document.documentElement.querySelector('#fake-perf-panel-colors');\n if (styleElementToRemove) {\n document.documentElement.removeChild(styleElementToRemove);\n }\n ThemeSupport.ThemeSupport.clearThemeCache();\n });\n it('returns the correct color and title for extension entries', function() {\n const allExtensionTrackEntries =\n parsedTrace.ExtensionTraceData.extensionTrackData.map(track => Object.values(track.entriesByTrack)).flat(2);\n for (const event of allExtensionTrackEntries) {\n assert.strictEqual(extensionTrackAppenders[0].titleForEvent(event), event.name);\n if (event.args.color === 'tertiary') {\n // \"tertiary\" color category is mapped to --ref-palette-green70\n // which is faked out to 10, 10, 10\n assert.strictEqual(extensionTrackAppenders[0].colorForEvent(event), 'rgb(10 10 10)');\n } else {\n // Unknown colors are mapped to \"primary\" by default, and\n // \"primary\" color category is mapped to --ref-palette-blue70\n // which is faked out to 4, 4, 4\n assert.strictEqual(extensionTrackAppenders[0].colorForEvent(event), 'rgb(4 4 4)');\n }\n }\n });\n\n it('sets a default value when a color is not set or is set an unknown value', function() {\n const mockExtensionEntryNoColor = {\n args: {\n metadata: {dataType: 'track-entry', extensionName: 'Extension'},\n track: 'A track',\n },\n cat: 'devtools.extension',\n } as unknown as Trace.Types.Events.Event;\n\n const mockExtensionEntryUnknownColor = {\n args: {\n metadata: {dataType: 'track-entry', extensionName: 'Extension'},\n track: 'A track',\n color: 'anUnknownColor',\n },\n cat: 'devtools.extension',\n } as unknown as Trace.Types.Events.Event;\n // \"primary\" color category is mapped to --ref-palette-blue70\n // which is faked out to 4, 4, 4\n assert.strictEqual(extensionTrackAppenders[0].colorForEvent(mockExtensionEntryNoColor), 'rgb(4 4 4)');\n assert.strictEqual(extensionTrackAppenders[0].colorForEvent(mockExtensionEntryUnknownColor), 'rgb(4 4 4)');\n });\n });\n\n describe('toggling', function() {\n it('Does not append extension data when the configuration is set to disabled', async function() {\n entryData = [];\n flameChartData = PerfUI.FlameChart.FlameChartTimelineData.createEmpty();\n entryTypeByLevel = [];\n Timeline.TimelinePanel.TimelinePanel.extensionDataVisibilitySetting().set(false);\n parsedTrace = (await TraceLoader.traceEngine(this, 'extension-tracks-and-marks.json.gz')).parsedTrace;\n extensionTrackAppenders = initTrackAppender(flameChartData, parsedTrace, entryData, entryTypeByLevel);\n let level = 0;\n extensionTrackAppenders.forEach(appender => {\n level = appender.appendTrackAtLevel(level);\n });\n assert.lengthOf(flameChartData.groups, 0);\n Timeline.TimelinePanel.TimelinePanel.extensionDataVisibilitySetting().set(true);\n });\n });\n\n describe('titleForEvent', function() {\n it('returns the title for an entry correctly', function() {\n const allExtensionTrackEntries =\n parsedTrace.ExtensionTraceData.extensionTrackData.map(track => Object.values(track.entriesByTrack)).flat(2);\n const title = extensionTrackAppenders[0].titleForEvent(allExtensionTrackEntries[0]);\n assert.strictEqual(title, 'An extension measurement');\n });\n });\n\n describe('setPopoverInfo', function() {\n it('build the tooltip content for an entry correctly', function() {\n const info: Timeline.CompatibilityTracksAppender.PopoverInfo = {\n title: 'title',\n formattedTime: 'time',\n warningElements: [],\n additionalElements: [],\n url: null,\n };\n const allExtensionTrackEntries =\n parsedTrace.ExtensionTraceData.extensionTrackData.map(track => Object.values(track.entriesByTrack)).flat(2);\n extensionTrackAppenders[0].setPopoverInfo(allExtensionTrackEntries[0], info);\n assert.strictEqual(info.title, 'A hint if needed');\n // The i18n encodes spaces using the u00A0 unicode character.\n assert.strictEqual(info.formattedTime, '1.00\\u00A0s');\n assert.isUndefined(info.additionalElements?.at(0)?.nodeName);\n });\n });\n});\n"]} \ No newline at end of file diff --git a/public/panels/timeline/track_appenders/GPUTrackAppender.test.js b/public/panels/timeline/track_appenders/GPUTrackAppender.test.js index 1efd7019e..196e3af2f 100644 --- a/public/panels/timeline/track_appenders/GPUTrackAppender.test.js +++ b/public/panels/timeline/track_appenders/GPUTrackAppender.test.js @@ -36,7 +36,7 @@ describeWithEnvironment('GPUTrackAppender', function () { assert.isTrue(allEntriesAreTrackAppender); }); it('creates a flamechart group for the GPU track', () => { - assert.strictEqual(flameChartData.groups.length, 1); + assert.lengthOf(flameChartData.groups, 1); assert.strictEqual(flameChartData.groups[0].name, 'GPU'); }); it('adds start times correctly', () => { diff --git a/public/panels/timeline/track_appenders/GPUTrackAppender.test.js.map b/public/panels/timeline/track_appenders/GPUTrackAppender.test.js.map index 21e9f94f8..e7797546c 100644 --- a/public/panels/timeline/track_appenders/GPUTrackAppender.test.js.map +++ b/public/panels/timeline/track_appenders/GPUTrackAppender.test.js.map @@ -1 +1 @@ -{"version":3,"file":"GPUTrackAppender.test.js","sourceRoot":"","sources":["../../../../../../../front_end/panels/timeline/track_appenders/GPUTrackAppender.test.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,KAAK,KAAK,MAAM,gCAAgC,CAAC;AACxD,OAAO,EAAC,uBAAuB,EAAC,MAAM,wCAAwC,CAAC;AAC/E,OAAO,EAAC,WAAW,EAAC,MAAM,iCAAiC,CAAC;AAC5D,OAAO,KAAK,MAAM,MAAM,kDAAkD,CAAC;AAC3E,OAAO,KAAK,YAAY,MAAM,mDAAmD,CAAC;AAClF,OAAO,KAAK,QAAQ,MAAM,gBAAgB,CAAC;AAE3C,SAAS,iBAAiB,CACtB,cAAwD,EACxD,WAA6C,EAC7C,SAAqC,EACrC,gBAAqE;IAEvE,MAAM,2BAA2B,GAAG,IAAI,QAAQ,CAAC,2BAA2B,CAAC,2BAA2B,CACpG,cAAc,EAAE,WAAW,EAAE,SAAS,EAAE,gBAAgB,CAAC,CAAC;IAC9D,OAAO,2BAA2B,CAAC,gBAAgB,EAAE,CAAC;AACxD,CAAC;AAED,uBAAuB,CAAC,kBAAkB,EAAE;IAC1C,IAAI,WAA6C,CAAC;IAClD,IAAI,gBAA4D,CAAC;IACjE,IAAI,SAAS,GAA+B,EAAE,CAAC;IAC/C,IAAI,cAAc,GAAG,MAAM,CAAC,UAAU,CAAC,sBAAsB,CAAC,WAAW,EAAE,CAAC;IAC5E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AEH,QAAQ,CAAC,iCAAiC,EAAE,GAAG,EAAE;QAC/C,MAAM,CAAC,GAAG,EAAE;YACV,2EAA2E;YAC3E,8EAA8E;YAC9E,6EAA6E;YAC7E,+EAA+E;YAC/E,8DAA8D;YAC9D,MAAM,YAAY,GAAG,QAAQ,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;YACrD,YAAY,CAAC,EAAE,GAAG,wBAAwB,CAAC;YAC3C,YAAY,CAAC,WAAW,GAAG;;;;OAI1B,CAAC;YACF,QAAQ,CAAC,eAAe,CAAC,WAAW,CAAC,YAAY,CAAC,CAAC;YACnD,YAAY,CAAC,YAAY,CAAC,eAAe,EAAE,CAAC;QAC9C,CAAC,CAAC,CAAC;QAEH,KAAK,CAAC,GAAG,EAAE;YACT,MAAM,oBAAoB,GAAG,QAAQ,CAAC,eAAe,CAAC,aAAa,CAAC,yBAAyB,CAAC,CAAC;YAC/F,IAAI,oBAAoB,EAAE,CAAC;gBACzB,QAAQ,CAAC,eAAe,CAAC,WAAW,CAAC,oBAAoB,CAAC,CAAC;YAC7D,CAAC;YACD,YAAY,CAAC,YAAY,CAAC,eAAe,EAAE,CAAC;QAC9C,CAAC,CAAC,CAAC;QACH,EAAE,CAAC,mDAAmD,EAAE,GAAG,EAAE;YAC3D,MAAM,SAAS,GAAG,WAAW,CAAC,GAAG,CAAC,kBAAkB,CAAC;YACrD,KAAK,MAAM,KAAK,IAAI,SAAS,EAAE,CAAC;gBAC9B,MAAM,CAAC,WAAW,CAAC,gBAAgB,CAAC,aAAa,CAAC,KAAK,CAAC,EAAE,YAAY,CAAC,CAAC;YAC1E,CAAC;QACH,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["// Copyright 2023 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport * as Trace from '../../../models/trace/trace.js';\nimport {describeWithEnvironment} from '../../../testing/EnvironmentHelpers.js';\nimport {TraceLoader} from '../../../testing/TraceLoader.js';\nimport * as PerfUI from '../../../ui/legacy/components/perf_ui/perf_ui.js';\nimport * as ThemeSupport from '../../../ui/legacy/theme_support/theme_support.js';\nimport * as Timeline from '../timeline.js';\n\nfunction initTrackAppender(\n flameChartData: PerfUI.FlameChart.FlameChartTimelineData,\n parsedTrace: Trace.Handlers.Types.ParsedTrace,\n entryData: Trace.Types.Events.Event[],\n entryTypeByLevel: Timeline.TimelineFlameChartDataProvider.EntryType[],\n ): Timeline.GPUTrackAppender.GPUTrackAppender {\n const compatibilityTracksAppender = new Timeline.CompatibilityTracksAppender.CompatibilityTracksAppender(\n flameChartData, parsedTrace, entryData, entryTypeByLevel);\n return compatibilityTracksAppender.gpuTrackAppender();\n}\n\ndescribeWithEnvironment('GPUTrackAppender', function() {\n let parsedTrace: Trace.Handlers.Types.ParsedTrace;\n let gpuTrackAppender: Timeline.GPUTrackAppender.GPUTrackAppender;\n let entryData: Trace.Types.Events.Event[] = [];\n let flameChartData = PerfUI.FlameChart.FlameChartTimelineData.createEmpty();\n let entryTypeByLevel: Timeline.TimelineFlameChartDataProvider.EntryType[] = [];\n\n beforeEach(async function() {\n ({parsedTrace} = await TraceLoader.traceEngine(this, 'threejs-gpu.json.gz'));\n gpuTrackAppender = initTrackAppender(flameChartData, parsedTrace, entryData, entryTypeByLevel);\n gpuTrackAppender.appendTrackAtLevel(0);\n });\n\n afterEach(() => {\n entryData = [];\n flameChartData = PerfUI.FlameChart.FlameChartTimelineData.createEmpty();\n entryTypeByLevel = [];\n });\n\n describe('appendTrackAtLevel', () => {\n it('marks all levels used by the track with the `TrackAppender` type', () => {\n // One levels should be taken: 1 for the GPU tasks.\n const levelCount = 1;\n assert.strictEqual(entryTypeByLevel.length, levelCount);\n const allEntriesAreTrackAppender =\n entryTypeByLevel.every(type => type === Timeline.TimelineFlameChartDataProvider.EntryType.TRACK_APPENDER);\n assert.isTrue(allEntriesAreTrackAppender);\n });\n\n it('creates a flamechart group for the GPU track', () => {\n assert.strictEqual(flameChartData.groups.length, 1);\n assert.strictEqual(flameChartData.groups[0].name, 'GPU');\n });\n\n it('adds start times correctly', () => {\n const gpuEvents = parsedTrace.GPU.mainGPUThreadTasks;\n for (const event of gpuEvents) {\n const index = entryData.indexOf(event);\n assert.exists(index);\n assert.strictEqual(\n flameChartData.entryStartTimes[index], Trace.Helpers.Timing.microSecondsToMilliseconds(event.ts));\n }\n });\n\n it('adds total times correctly', () => {\n const gpuEvents = parsedTrace.GPU.mainGPUThreadTasks;\n for (const event of gpuEvents) {\n const index = entryData.indexOf(event);\n assert.exists(index);\n if (Trace.Types.Events.isMarkerEvent(event)) {\n assert.isNaN(flameChartData.entryTotalTimes[index]);\n continue;\n }\n const expectedTotalTimeForEvent = event.dur ?\n Trace.Helpers.Timing.microSecondsToMilliseconds(event.dur) :\n Timeline.TimelineFlameChartDataProvider.InstantEventVisibleDurationMs;\n assert.strictEqual(flameChartData.entryTotalTimes[index], expectedTotalTimeForEvent);\n }\n });\n });\n\n describe('colorForEvent and titleForEvent', () => {\n before(() => {\n // Rather than use the real colours here and burden the test with having to\n // inject loads of CSS, we fake out the colours. this is fine for our tests as\n // the exact value of the colours is not important; we just make sure that it\n // parses them out correctly. Each variable is given a different rgb() value to\n // ensure we know the code is working and using the right one.\n const styleElement = document.createElement('style');\n styleElement.id = 'fake-perf-panel-colors';\n styleElement.textContent = `\n :root {\n --app-color-painting: rgb(6 6 6);\n }\n `;\n document.documentElement.appendChild(styleElement);\n ThemeSupport.ThemeSupport.clearThemeCache();\n });\n\n after(() => {\n const styleElementToRemove = document.documentElement.querySelector('#fake-perf-panel-colors');\n if (styleElementToRemove) {\n document.documentElement.removeChild(styleElementToRemove);\n }\n ThemeSupport.ThemeSupport.clearThemeCache();\n });\n it('returns the correct color and title for GPU tasks', () => {\n const gpuEvents = parsedTrace.GPU.mainGPUThreadTasks;\n for (const event of gpuEvents) {\n assert.strictEqual(gpuTrackAppender.colorForEvent(event), 'rgb(6 6 6)');\n }\n });\n });\n});\n"]} \ No newline at end of file +{"version":3,"file":"GPUTrackAppender.test.js","sourceRoot":"","sources":["../../../../../../../front_end/panels/timeline/track_appenders/GPUTrackAppender.test.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,KAAK,KAAK,MAAM,gCAAgC,CAAC;AACxD,OAAO,EAAC,uBAAuB,EAAC,MAAM,wCAAwC,CAAC;AAC/E,OAAO,EAAC,WAAW,EAAC,MAAM,iCAAiC,CAAC;AAC5D,OAAO,KAAK,MAAM,MAAM,kDAAkD,CAAC;AAC3E,OAAO,KAAK,YAAY,MAAM,mDAAmD,CAAC;AAClF,OAAO,KAAK,QAAQ,MAAM,gBAAgB,CAAC;AAE3C,SAAS,iBAAiB,CACtB,cAAwD,EACxD,WAA6C,EAC7C,SAAqC,EACrC,gBAAqE;IAEvE,MAAM,2BAA2B,GAAG,IAAI,QAAQ,CAAC,2BAA2B,CAAC,2BAA2B,CACpG,cAAc,EAAE,WAAW,EAAE,SAAS,EAAE,gBAAgB,CAAC,CAAC;IAC9D,OAAO,2BAA2B,CAAC,gBAAgB,EAAE,CAAC;AACxD,CAAC;AAED,uBAAuB,CAAC,kBAAkB,EAAE;IAC1C,IAAI,WAA6C,CAAC;IAClD,IAAI,gBAA4D,CAAC;IACjE,IAAI,SAAS,GAA+B,EAAE,CAAC;IAC/C,IAAI,cAAc,GAAG,MAAM,CAAC,UAAU,CAAC,sBAAsB,CAAC,WAAW,EAAE,CAAC;IAC5E,IAAI,gBAAgB,GAAwD,EAAE,CAAC;IAE/E,UAAU,CAAC,KAAK;QACd,CAAC,EAAC,WAAW,EAAC,GAAG,MAAM,WAAW,CAAC,WAAW,CAAC,IAAI,EAAE,qBAAqB,CAAC,CAAC,CAAC;QAC7E,gBAAgB,GAAG,iBAAiB,CAAC,cAAc,EAAE,WAAW,EAAE,SAAS,EAAE,gBAAgB,CAAC,CAAC;QAC/F,gBAAgB,CAA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AAW,GAAG;;;;OAI1B,CAAC;YACF,QAAQ,CAAC,eAAe,CAAC,WAAW,CAAC,YAAY,CAAC,CAAC;YACnD,YAAY,CAAC,YAAY,CAAC,eAAe,EAAE,CAAC;QAC9C,CAAC,CAAC,CAAC;QAEH,KAAK,CAAC,GAAG,EAAE;YACT,MAAM,oBAAoB,GAAG,QAAQ,CAAC,eAAe,CAAC,aAAa,CAAC,yBAAyB,CAAC,CAAC;YAC/F,IAAI,oBAAoB,EAAE,CAAC;gBACzB,QAAQ,CAAC,eAAe,CAAC,WAAW,CAAC,oBAAoB,CAAC,CAAC;YAC7D,CAAC;YACD,YAAY,CAAC,YAAY,CAAC,eAAe,EAAE,CAAC;QAC9C,CAAC,CAAC,CAAC;QACH,EAAE,CAAC,mDAAmD,EAAE,GAAG,EAAE;YAC3D,MAAM,SAAS,GAAG,WAAW,CAAC,GAAG,CAAC,kBAAkB,CAAC;YACrD,KAAK,MAAM,KAAK,IAAI,SAAS,EAAE,CAAC;gBAC9B,MAAM,CAAC,WAAW,CAAC,gBAAgB,CAAC,aAAa,CAAC,KAAK,CAAC,EAAE,YAAY,CAAC,CAAC;YAC1E,CAAC;QACH,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["// Copyright 2023 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport * as Trace from '../../../models/trace/trace.js';\nimport {describeWithEnvironment} from '../../../testing/EnvironmentHelpers.js';\nimport {TraceLoader} from '../../../testing/TraceLoader.js';\nimport * as PerfUI from '../../../ui/legacy/components/perf_ui/perf_ui.js';\nimport * as ThemeSupport from '../../../ui/legacy/theme_support/theme_support.js';\nimport * as Timeline from '../timeline.js';\n\nfunction initTrackAppender(\n flameChartData: PerfUI.FlameChart.FlameChartTimelineData,\n parsedTrace: Trace.Handlers.Types.ParsedTrace,\n entryData: Trace.Types.Events.Event[],\n entryTypeByLevel: Timeline.TimelineFlameChartDataProvider.EntryType[],\n ): Timeline.GPUTrackAppender.GPUTrackAppender {\n const compatibilityTracksAppender = new Timeline.CompatibilityTracksAppender.CompatibilityTracksAppender(\n flameChartData, parsedTrace, entryData, entryTypeByLevel);\n return compatibilityTracksAppender.gpuTrackAppender();\n}\n\ndescribeWithEnvironment('GPUTrackAppender', function() {\n let parsedTrace: Trace.Handlers.Types.ParsedTrace;\n let gpuTrackAppender: Timeline.GPUTrackAppender.GPUTrackAppender;\n let entryData: Trace.Types.Events.Event[] = [];\n let flameChartData = PerfUI.FlameChart.FlameChartTimelineData.createEmpty();\n let entryTypeByLevel: Timeline.TimelineFlameChartDataProvider.EntryType[] = [];\n\n beforeEach(async function() {\n ({parsedTrace} = await TraceLoader.traceEngine(this, 'threejs-gpu.json.gz'));\n gpuTrackAppender = initTrackAppender(flameChartData, parsedTrace, entryData, entryTypeByLevel);\n gpuTrackAppender.appendTrackAtLevel(0);\n });\n\n afterEach(() => {\n entryData = [];\n flameChartData = PerfUI.FlameChart.FlameChartTimelineData.createEmpty();\n entryTypeByLevel = [];\n });\n\n describe('appendTrackAtLevel', () => {\n it('marks all levels used by the track with the `TrackAppender` type', () => {\n // One levels should be taken: 1 for the GPU tasks.\n const levelCount = 1;\n assert.strictEqual(entryTypeByLevel.length, levelCount);\n const allEntriesAreTrackAppender =\n entryTypeByLevel.every(type => type === Timeline.TimelineFlameChartDataProvider.EntryType.TRACK_APPENDER);\n assert.isTrue(allEntriesAreTrackAppender);\n });\n\n it('creates a flamechart group for the GPU track', () => {\n assert.lengthOf(flameChartData.groups, 1);\n assert.strictEqual(flameChartData.groups[0].name, 'GPU');\n });\n\n it('adds start times correctly', () => {\n const gpuEvents = parsedTrace.GPU.mainGPUThreadTasks;\n for (const event of gpuEvents) {\n const index = entryData.indexOf(event);\n assert.exists(index);\n assert.strictEqual(\n flameChartData.entryStartTimes[index], Trace.Helpers.Timing.microSecondsToMilliseconds(event.ts));\n }\n });\n\n it('adds total times correctly', () => {\n const gpuEvents = parsedTrace.GPU.mainGPUThreadTasks;\n for (const event of gpuEvents) {\n const index = entryData.indexOf(event);\n assert.exists(index);\n if (Trace.Types.Events.isMarkerEvent(event)) {\n assert.isNaN(flameChartData.entryTotalTimes[index]);\n continue;\n }\n const expectedTotalTimeForEvent = event.dur ?\n Trace.Helpers.Timing.microSecondsToMilliseconds(event.dur) :\n Timeline.TimelineFlameChartDataProvider.InstantEventVisibleDurationMs;\n assert.strictEqual(flameChartData.entryTotalTimes[index], expectedTotalTimeForEvent);\n }\n });\n });\n\n describe('colorForEvent and titleForEvent', () => {\n before(() => {\n // Rather than use the real colours here and burden the test with having to\n // inject loads of CSS, we fake out the colours. this is fine for our tests as\n // the exact value of the colours is not important; we just make sure that it\n // parses them out correctly. Each variable is given a different rgb() value to\n // ensure we know the code is working and using the right one.\n const styleElement = document.createElement('style');\n styleElement.id = 'fake-perf-panel-colors';\n styleElement.textContent = `\n :root {\n --app-color-painting: rgb(6 6 6);\n }\n `;\n document.documentElement.appendChild(styleElement);\n ThemeSupport.ThemeSupport.clearThemeCache();\n });\n\n after(() => {\n const styleElementToRemove = document.documentElement.querySelector('#fake-perf-panel-colors');\n if (styleElementToRemove) {\n document.documentElement.removeChild(styleElementToRemove);\n }\n ThemeSupport.ThemeSupport.clearThemeCache();\n });\n it('returns the correct color and title for GPU tasks', () => {\n const gpuEvents = parsedTrace.GPU.mainGPUThreadTasks;\n for (const event of gpuEvents) {\n assert.strictEqual(gpuTrackAppender.colorForEvent(event), 'rgb(6 6 6)');\n }\n });\n });\n});\n"]} \ No newline at end of file diff --git a/public/panels/timeline/track_appenders/InteractionsTrackAppender.test.js b/public/panels/timeline/track_appenders/InteractionsTrackAppender.test.js index 8de88e77e..59b6f45d6 100644 --- a/public/panels/timeline/track_appenders/InteractionsTrackAppender.test.js +++ b/public/panels/timeline/track_appenders/InteractionsTrackAppender.test.js @@ -30,7 +30,7 @@ describeWithEnvironment('InteractionsTrackAppender', function () { it('marks all levels used by the track with the `TrackAppender` type', async function () { const { entryTypeByLevel } = await renderTrackAppender(this, 'slow-interaction-button-click.json.gz'); // All events fit on the top level - assert.strictEqual(entryTypeByLevel.length, 1); + assert.lengthOf(entryTypeByLevel, 1); assert.deepEqual(entryTypeByLevel, [ "TrackAppender" /* Timeline.TimelineFlameChartDataProvider.EntryType.TRACK_APPENDER */, ]); @@ -38,7 +38,7 @@ describeWithEnvironment('InteractionsTrackAppender', function () { it('takes over no levels if there are no interactions', async function () { // animation trace has no interactions in it. const { entryTypeByLevel } = await renderTrackAppender(this, 'animation.json.gz'); - assert.strictEqual(entryTypeByLevel.length, 0); + assert.lengthOf(entryTypeByLevel, 0); }); it('only shows the top level interactions', async function () { const { entryData, parsedTrace } = await renderTrackAppender(this, 'nested-interactions.json.gz'); @@ -46,7 +46,7 @@ describeWithEnvironment('InteractionsTrackAppender', function () { }); it('creates a flamechart group', async function () { const { flameChartData } = await renderTrackAppender(this, 'slow-interaction-button-click.json.gz'); - assert.strictEqual(flameChartData.groups.length, 1); + assert.lengthOf(flameChartData.groups, 1); assert.strictEqual(flameChartData.groups[0].name, 'Interactions'); }); it('adds all interactions with the correct start times', async function () { diff --git a/public/panels/timeline/track_appenders/InteractionsTrackAppender.test.js.map b/public/panels/timeline/track_appenders/InteractionsTrackAppender.test.js.map index 334fa08d2..e183920aa 100644 --- a/public/panels/timeline/track_appenders/InteractionsTrackAppender.test.js.map +++ b/public/panels/timeline/track_appenders/InteractionsTrackAppender.test.js.map @@ -1 +1 @@ -{"version":3,"file":"InteractionsTrackAppender.test.js","sourceRoot":"","sources":["../../../../../../../front_end/panels/timeline/track_appenders/InteractionsTrackAppender.test.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,KAAK,KAAK,MAAM,gCAAgC,CAAC;AACxD,OAAO,EAAC,uBAAuB,EAAC,MAAM,wCAAwC,CAAC;AAC/E,OAAO,EAAC,WAAW,EAAC,MAAM,iCAAiC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,KAAK,CAAC,oCAAoC,CAAC,CAAC;QACxD,CAAC;QACD,MAAM,UAAU,GAAG,SAAS,CAAC,OAAO,CAAC,eAAe,CAAC,CAAC;QACtD,MAAM,mBAAmB,GAAG,cAAc,CAAC,gBAAgB,CAAC,UAAU,CAAC,CAAC;QACxE,MAAM,CAAC,SAAS,CAAC,mBAAmB,EAAE;YACpC;gBACE,IAAI,gEAAkD;gBACtD,WAAW,EAAE,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,YAAY,CAAC,OAAO,CAAC;gBACrD,SAAS,EAAE,eAAe,CAAC,aAAa;aACzC;YACD;gBACE,IAAI,sFAA6D;gBACjE,aAAa,EAAE,eAAe,CAAC,aAAa;aAC7C;SACF,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,oDAAoD,EAAE,KAAK;QAC5D,MAAM,EAAC,cAAc,EAAC,GAAG,MAAM,mBAAmB,CAAC,IAAI,EAAE,uCAAuC,CAAC,CAAC;QAClG,sFAAsF;QACtF,MAAM,CAAC,QAAQ,CAAC,cAAc,CAAC,gBAAgB,EAAE,CAAC,CAAC,CAAC;IACtD,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["// Copyright 2023 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport * as Trace from '../../../models/trace/trace.js';\nimport {describeWithEnvironment} from '../../../testing/EnvironmentHelpers.js';\nimport {TraceLoader} from '../../../testing/TraceLoader.js';\nimport * as PerfUI from '../../../ui/legacy/components/perf_ui/perf_ui.js';\nimport * as Timeline from '../timeline.js';\n\nfunction initTrackAppender(\n flameChartData: PerfUI.FlameChart.FlameChartTimelineData,\n parsedTrace: Trace.Handlers.Types.ParsedTrace,\n entryData: Trace.Types.Events.Event[],\n entryTypeByLevel: Timeline.TimelineFlameChartDataProvider.EntryType[],\n ): Timeline.InteractionsTrackAppender.InteractionsTrackAppender {\n const compatibilityTracksAppender = new Timeline.CompatibilityTracksAppender.CompatibilityTracksAppender(\n flameChartData, parsedTrace, entryData, entryTypeByLevel);\n return compatibilityTracksAppender.interactionsTrackAppender();\n}\n\ndescribeWithEnvironment('InteractionsTrackAppender', function() {\n async function renderTrackAppender(context: Mocha.Suite|Mocha.Context, trace: string): Promise<{\n entryTypeByLevel: Timeline.TimelineFlameChartDataProvider.EntryType[],\n flameChartData: PerfUI.FlameChart.FlameChartTimelineData,\n interactionsTrackAppender: Timeline.InteractionsTrackAppender.InteractionsTrackAppender,\n entryData: Trace.Types.Events.Event[],\n parsedTrace: Readonly,\n }> {\n const entryTypeByLevel: Timeline.TimelineFlameChartDataProvider.EntryType[] = [];\n const entryData: Trace.Types.Events.Event[] = [];\n const flameChartData = PerfUI.FlameChart.FlameChartTimelineData.createEmpty();\n const {parsedTrace} = await TraceLoader.traceEngine(context, trace);\n const interactionsTrackAppender = initTrackAppender(flameChartData, parsedTrace, entryData, entryTypeByLevel);\n interactionsTrackAppender.appendTrackAtLevel(0);\n\n return {\n entryTypeByLevel,\n parsedTrace,\n flameChartData,\n interactionsTrackAppender,\n entryData,\n };\n }\n\n describe('appendTrackAtLevel', function() {\n it('marks all levels used by the track with the `TrackAppender` type', async function() {\n const {entryTypeByLevel} = await renderTrackAppender(this, 'slow-interaction-button-click.json.gz');\n // All events fit on the top level\n assert.strictEqual(entryTypeByLevel.length, 1);\n assert.deepEqual(entryTypeByLevel, [\n Timeline.TimelineFlameChartDataProvider.EntryType.TRACK_APPENDER,\n ]);\n });\n\n it('takes over no levels if there are no interactions', async function() {\n // animation trace has no interactions in it.\n const {entryTypeByLevel} = await renderTrackAppender(this, 'animation.json.gz');\n assert.strictEqual(entryTypeByLevel.length, 0);\n });\n\n it('only shows the top level interactions', async function() {\n const {entryData, parsedTrace} = await renderTrackAppender(this, 'nested-interactions.json.gz');\n assert.strictEqual(entryData.length, parsedTrace.UserInteractions.interactionEventsWithNoNesting.length);\n });\n\n it('creates a flamechart group', async function() {\n const {flameChartData} = await renderTrackAppender(this, 'slow-interaction-button-click.json.gz');\n assert.strictEqual(flameChartData.groups.length, 1);\n assert.strictEqual(flameChartData.groups[0].name, 'Interactions');\n });\n\n it('adds all interactions with the correct start times', async function() {\n const {flameChartData, parsedTrace, entryData} =\n await renderTrackAppender(this, 'slow-interaction-button-click.json.gz');\n const events = parsedTrace.UserInteractions.interactionEventsWithNoNesting;\n for (const event of events) {\n const markerIndex = entryData.indexOf(event);\n assert.exists(markerIndex);\n assert.strictEqual(\n flameChartData.entryStartTimes[markerIndex], Trace.Helpers.Timing.microSecondsToMilliseconds(event.ts));\n }\n });\n\n it('adds total times correctly', async function() {\n const {flameChartData, parsedTrace, entryData} =\n await renderTrackAppender(this, 'slow-interaction-button-click.json.gz');\n const events = parsedTrace.UserInteractions.interactionEventsWithNoNesting;\n for (const event of events) {\n const markerIndex = entryData.indexOf(event);\n assert.exists(markerIndex);\n const expectedTotalTimeForEvent =\n Trace.Helpers.Timing.microSecondsToMilliseconds((event.dur || 0) as Trace.Types.Timing.MicroSeconds);\n assert.strictEqual(flameChartData.entryTotalTimes[markerIndex], expectedTotalTimeForEvent);\n }\n });\n });\n\n it('candy-stripes and adds warning triangles to long interactions', async function() {\n const {parsedTrace, flameChartData, entryData} = await renderTrackAppender(this, 'one-second-interaction.json.gz');\n const longInteraction = parsedTrace.UserInteractions.longestInteractionEvent;\n if (!longInteraction) {\n throw new Error('Could not find longest interaction');\n }\n const entryIndex = entryData.indexOf(longInteraction);\n const decorationsForEntry = flameChartData.entryDecorations[entryIndex];\n assert.deepEqual(decorationsForEntry, [\n {\n type: PerfUI.FlameChart.FlameChartDecorationType.CANDY,\n startAtTime: Trace.Types.Timing.MicroSeconds(200_000),\n endAtTime: longInteraction.processingEnd,\n },\n {\n type: PerfUI.FlameChart.FlameChartDecorationType.WARNING_TRIANGLE,\n customEndTime: longInteraction.processingEnd,\n },\n ]);\n });\n\n it('does not candy-stripe interactions less than 200ms', async function() {\n const {flameChartData} = await renderTrackAppender(this, 'slow-interaction-button-click.json.gz');\n // None of the interactions are over 200ms, so we do not expect to see any decorations\n assert.lengthOf(flameChartData.entryDecorations, 0);\n });\n});\n"]} \ No newline at end of file +{"version":3,"file":"InteractionsTrackAppender.test.js","sourceRoot":"","sources":["../../../../../../../front_end/panels/timeline/track_appenders/InteractionsTrackAppender.test.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,KAAK,KAAK,MAAM,gCAAgC,CAAC;AACxD,OAAO,EAAC,uBAAuB,EAAC,MAAM,wCAAwC,CAAC;AAC/E,OAAO,EAAC,WAAW,EAAC,MAAM,iCAAiC,CAAC;AAC5D,OAAO,KAAK,MAAM,MAAM,kDAAkD,CAAC;AAC3E,OAAO,KAAK,QAAQ,MAAM,gBAAgB,CAAC;AAE3C,SAAS,iBAAiB,CACtB,cAAwD,EACxD,WAA6C,EAC7C,SAAqC,EACrC,gBAAqE;IAEvE,MAAM,2BAA2B,GAAG,IAAI,QAAQ,CAAC,2BAA2B,CAAC,2BAA2B,CACpG,cAAc,EAAE,WAAW,EAAE,SAAS,EAAE,gBAAgB,CAAC,CAAC;IAC9D,OAAO,2BAA2B,CAAC,yBAAyB,EAAE,CAAC;AACjE,CAAC;AAED,uBAAuB,CAAC,2BAA2B,EAAE;IACnD,KAAK,UAAU,mBAAmB,CAAC,OAAkC,EAAE,KAAa;QAOlF,MAAM,gBAAgB,GAAwD,EAAE,CAAC;QACjF,MAAM,SAAS,GAA+B,EAAE,CAAC;QACjD,MAAM,cAAc,GAAG,MAAM,CAAC,UAAU,CAAC,sBAAsB,CAAC,WAAW,EAAE,CAAC;QAC9E,MAAM,EAAC,WAAW,EAAC,GAAG,MAAM,WAAW,CAAC,WAAW,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;QACpE,MAAM,yBAAyB,GAAG,iBAAiB,CAAC,cAAc,EAAE,WAAW,EAAE,SAAS,EAAE,gBAAgB,CAAC,CAAC;QAC9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CAAC,eAAe,CAAC,WAAW,CAAC,EAAE,yBAAyB,CAAC,CAAC;YAC7F,CAAC;QACH,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,+DAA+D,EAAE,KAAK;QACvE,MAAM,EAAC,WAAW,EAAE,cAAc,EAAE,SAAS,EAAC,GAAG,MAAM,mBAAmB,CAAC,IAAI,EAAE,gCAAgC,CAAC,CAAC;QACnH,MAAM,eAAe,GAAG,WAAW,CAAC,gBAAgB,CAAC,uBAAuB,CAAC;QAC7E,IAAI,CAAC,eAAe,EAAE,CAAC;YACrB,MAAM,IAAI,KAAK,CAAC,oCAAoC,CAAC,CAAC;QACxD,CAAC;QACD,MAAM,UAAU,GAAG,SAAS,CAAC,OAAO,CAAC,eAAe,CAAC,CAAC;QACtD,MAAM,mBAAmB,GAAG,cAAc,CAAC,gBAAgB,CAAC,UAAU,CAAC,CAAC;QACxE,MAAM,CAAC,SAAS,CAAC,mBAAmB,EAAE;YACpC;gBACE,IAAI,gEAAkD;gBACtD,WAAW,EAAE,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,YAAY,CAAC,OAAO,CAAC;gBACrD,SAAS,EAAE,eAAe,CAAC,aAAa;aACzC;YACD;gBACE,IAAI,sFAA6D;gBACjE,aAAa,EAAE,eAAe,CAAC,aAAa;aAC7C;SACF,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,oDAAoD,EAAE,KAAK;QAC5D,MAAM,EAAC,cAAc,EAAC,GAAG,MAAM,mBAAmB,CAAC,IAAI,EAAE,uCAAuC,CAAC,CAAC;QAClG,sFAAsF;QACtF,MAAM,CAAC,QAAQ,CAAC,cAAc,CAAC,gBAAgB,EAAE,CAAC,CAAC,CAAC;IACtD,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["// Copyright 2023 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport * as Trace from '../../../models/trace/trace.js';\nimport {describeWithEnvironment} from '../../../testing/EnvironmentHelpers.js';\nimport {TraceLoader} from '../../../testing/TraceLoader.js';\nimport * as PerfUI from '../../../ui/legacy/components/perf_ui/perf_ui.js';\nimport * as Timeline from '../timeline.js';\n\nfunction initTrackAppender(\n flameChartData: PerfUI.FlameChart.FlameChartTimelineData,\n parsedTrace: Trace.Handlers.Types.ParsedTrace,\n entryData: Trace.Types.Events.Event[],\n entryTypeByLevel: Timeline.TimelineFlameChartDataProvider.EntryType[],\n ): Timeline.InteractionsTrackAppender.InteractionsTrackAppender {\n const compatibilityTracksAppender = new Timeline.CompatibilityTracksAppender.CompatibilityTracksAppender(\n flameChartData, parsedTrace, entryData, entryTypeByLevel);\n return compatibilityTracksAppender.interactionsTrackAppender();\n}\n\ndescribeWithEnvironment('InteractionsTrackAppender', function() {\n async function renderTrackAppender(context: Mocha.Suite|Mocha.Context, trace: string): Promise<{\n entryTypeByLevel: Timeline.TimelineFlameChartDataProvider.EntryType[],\n flameChartData: PerfUI.FlameChart.FlameChartTimelineData,\n interactionsTrackAppender: Timeline.InteractionsTrackAppender.InteractionsTrackAppender,\n entryData: Trace.Types.Events.Event[],\n parsedTrace: Readonly,\n }> {\n const entryTypeByLevel: Timeline.TimelineFlameChartDataProvider.EntryType[] = [];\n const entryData: Trace.Types.Events.Event[] = [];\n const flameChartData = PerfUI.FlameChart.FlameChartTimelineData.createEmpty();\n const {parsedTrace} = await TraceLoader.traceEngine(context, trace);\n const interactionsTrackAppender = initTrackAppender(flameChartData, parsedTrace, entryData, entryTypeByLevel);\n interactionsTrackAppender.appendTrackAtLevel(0);\n\n return {\n entryTypeByLevel,\n parsedTrace,\n flameChartData,\n interactionsTrackAppender,\n entryData,\n };\n }\n\n describe('appendTrackAtLevel', function() {\n it('marks all levels used by the track with the `TrackAppender` type', async function() {\n const {entryTypeByLevel} = await renderTrackAppender(this, 'slow-interaction-button-click.json.gz');\n // All events fit on the top level\n assert.lengthOf(entryTypeByLevel, 1);\n assert.deepEqual(entryTypeByLevel, [\n Timeline.TimelineFlameChartDataProvider.EntryType.TRACK_APPENDER,\n ]);\n });\n\n it('takes over no levels if there are no interactions', async function() {\n // animation trace has no interactions in it.\n const {entryTypeByLevel} = await renderTrackAppender(this, 'animation.json.gz');\n assert.lengthOf(entryTypeByLevel, 0);\n });\n\n it('only shows the top level interactions', async function() {\n const {entryData, parsedTrace} = await renderTrackAppender(this, 'nested-interactions.json.gz');\n assert.strictEqual(entryData.length, parsedTrace.UserInteractions.interactionEventsWithNoNesting.length);\n });\n\n it('creates a flamechart group', async function() {\n const {flameChartData} = await renderTrackAppender(this, 'slow-interaction-button-click.json.gz');\n assert.lengthOf(flameChartData.groups, 1);\n assert.strictEqual(flameChartData.groups[0].name, 'Interactions');\n });\n\n it('adds all interactions with the correct start times', async function() {\n const {flameChartData, parsedTrace, entryData} =\n await renderTrackAppender(this, 'slow-interaction-button-click.json.gz');\n const events = parsedTrace.UserInteractions.interactionEventsWithNoNesting;\n for (const event of events) {\n const markerIndex = entryData.indexOf(event);\n assert.exists(markerIndex);\n assert.strictEqual(\n flameChartData.entryStartTimes[markerIndex], Trace.Helpers.Timing.microSecondsToMilliseconds(event.ts));\n }\n });\n\n it('adds total times correctly', async function() {\n const {flameChartData, parsedTrace, entryData} =\n await renderTrackAppender(this, 'slow-interaction-button-click.json.gz');\n const events = parsedTrace.UserInteractions.interactionEventsWithNoNesting;\n for (const event of events) {\n const markerIndex = entryData.indexOf(event);\n assert.exists(markerIndex);\n const expectedTotalTimeForEvent =\n Trace.Helpers.Timing.microSecondsToMilliseconds((event.dur || 0) as Trace.Types.Timing.MicroSeconds);\n assert.strictEqual(flameChartData.entryTotalTimes[markerIndex], expectedTotalTimeForEvent);\n }\n });\n });\n\n it('candy-stripes and adds warning triangles to long interactions', async function() {\n const {parsedTrace, flameChartData, entryData} = await renderTrackAppender(this, 'one-second-interaction.json.gz');\n const longInteraction = parsedTrace.UserInteractions.longestInteractionEvent;\n if (!longInteraction) {\n throw new Error('Could not find longest interaction');\n }\n const entryIndex = entryData.indexOf(longInteraction);\n const decorationsForEntry = flameChartData.entryDecorations[entryIndex];\n assert.deepEqual(decorationsForEntry, [\n {\n type: PerfUI.FlameChart.FlameChartDecorationType.CANDY,\n startAtTime: Trace.Types.Timing.MicroSeconds(200_000),\n endAtTime: longInteraction.processingEnd,\n },\n {\n type: PerfUI.FlameChart.FlameChartDecorationType.WARNING_TRIANGLE,\n customEndTime: longInteraction.processingEnd,\n },\n ]);\n });\n\n it('does not candy-stripe interactions less than 200ms', async function() {\n const {flameChartData} = await renderTrackAppender(this, 'slow-interaction-button-click.json.gz');\n // None of the interactions are over 200ms, so we do not expect to see any decorations\n assert.lengthOf(flameChartData.entryDecorations, 0);\n });\n});\n"]} \ No newline at end of file diff --git a/public/panels/timeline/track_appenders/LayoutShiftsTrackAppender.test.js b/public/panels/timeline/track_appenders/LayoutShiftsTrackAppender.test.js index f05e90f82..310f7cba3 100644 --- a/public/panels/timeline/track_appenders/LayoutShiftsTrackAppender.test.js +++ b/public/panels/timeline/track_appenders/LayoutShiftsTrackAppender.test.js @@ -29,7 +29,7 @@ describeWithEnvironment('LayoutShiftsTrackAppender', function () { it('marks all levels used by the track with the TrackAppender type', async function () { const { entryTypeByLevel } = await renderTrackAppender(this, 'cls-single-frame.json.gz'); // Only one row of layout shifts. - assert.strictEqual(entryTypeByLevel.length, 1); + assert.lengthOf(entryTypeByLevel, 1); assert.deepEqual(entryTypeByLevel, [ "TrackAppender" /* Timeline.TimelineFlameChartDataProvider.EntryType.TRACK_APPENDER */, ]); @@ -41,7 +41,7 @@ describeWithEnvironment('LayoutShiftsTrackAppender', function () { }); it('creates a flamechart group', async function () { const { flameChartData } = await renderTrackAppender(this, 'cls-single-frame.json.gz'); - assert.strictEqual(flameChartData.groups.length, 1); + assert.lengthOf(flameChartData.groups, 1); assert.strictEqual(flameChartData.groups[0].name, 'Layout shifts'); }); it('adds all layout shifts with the correct start times', async function () { diff --git a/public/panels/timeline/track_appenders/LayoutShiftsTrackAppender.test.js.map b/public/panels/timeline/track_appenders/LayoutShiftsTrackAppender.test.js.map index 6da4733e7..63e86e877 100644 --- a/public/panels/timeline/track_appenders/LayoutShiftsTrackAppender.test.js.map +++ b/public/panels/timeline/track_appenders/LayoutShiftsTrackAppender.test.js.map @@ -1 +1 @@ -{"version":3,"file":"LayoutShiftsTrackAppender.test.js","sourceRoot":"","sources":["../../../../../../../front_end/panels/timeline/track_appenders/LayoutShiftsTrackAppender.test.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,KAAK,KAAK,MAAM,gCAAgC,CAAC;AACxD,OAAO,EAAC,uBAAuB,EAAC,MAAM,wCAAwC,CAAC;AAC/E,OAAO,EAAC,WAAW,EAAC,MAAM,iCAAiC,CAAC;AAC5D,OAAO,KAAK,MAAM,MAAM,kDAAkD,CAAC;AAC3E,OAAO,KAAK,QAAQ,MAAM,gBAAgB,CAAC;AAE3C,SAAS,iBAAiB,CACtB,cAAwD,EAAE,WAA6C,EACvG,SAAqC,EAAE,gBAAqE;IAE9G,MAAM,2BAA2B,GAAG,IAAI,QAAQ,CAAC,2BAA2B,CAAC,2BAA2B,CACpG,cAAc,EAAE,WAAW,EAAE,SAAS,EAAE,gBAAgB,CAAC,CAAC;IAC9D,OAAO,2BAA2B,CAAC,yBAAyB,EAAE,CAAC;AACjE,CAAC;AAED,uBAAuB,CAAC,2BAA2B,EAAE;IACnD,KAAK,UAAU,mBAAmB,CAAC,OAAkC,EAAE,KAAa;QAOlF,MAAM,gBAAgB,GAAwD,EAAE,CAAC;QACjF,MAAM,SAAS,GAA+B,EAAE,CAAC;QACjD,MAAM,cAAc,GAAG,MAAM,CAAC,UAAU,CAAC,sBAAsB,CAAC,WAAW,EAAE,CAAC;QAC9E,MAAM,EAAC,WAAW,EAAC,GAAG,MAAM,WAAW,CAAC,WAAW,CAAC,OAAO,EAAE,KAAK,CAAC,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AC,MAAM,CAAC,CAAC;QACxE,MAAM,yBAAyB,CAAC,kBAAkB,CAAC,MAAM,CAAC,CAAC;QAE3D,MAAM,IAAI,GAAqD;YAC7D,KAAK,EAAE,OAAO;YACd,aAAa,EAAE,MAAM;YACrB,eAAe,EAAE,EAAE;YACnB,kBAAkB,EAAE,EAAE;YACtB,GAAG,EAAE,IAAI;SACV,CAAC;QAEF,yBAAyB,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC;QAC1D,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,KAAK,EAAE,cAAc,CAAC,CAAC;QAC/C,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,aAAa,EAAE,QAAQ,CAAC,CAAC;QACjD,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,kBAAkB,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,KAAK,CAAC,CAAC;IACtE,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["// Copyright 2023 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport * as Trace from '../../../models/trace/trace.js';\nimport {describeWithEnvironment} from '../../../testing/EnvironmentHelpers.js';\nimport {TraceLoader} from '../../../testing/TraceLoader.js';\nimport * as PerfUI from '../../../ui/legacy/components/perf_ui/perf_ui.js';\nimport * as Timeline from '../timeline.js';\n\nfunction initTrackAppender(\n flameChartData: PerfUI.FlameChart.FlameChartTimelineData, parsedTrace: Trace.Handlers.Types.ParsedTrace,\n entryData: Trace.Types.Events.Event[], entryTypeByLevel: Timeline.TimelineFlameChartDataProvider.EntryType[]):\n Timeline.LayoutShiftsTrackAppender.LayoutShiftsTrackAppender {\n const compatibilityTracksAppender = new Timeline.CompatibilityTracksAppender.CompatibilityTracksAppender(\n flameChartData, parsedTrace, entryData, entryTypeByLevel);\n return compatibilityTracksAppender.layoutShiftsTrackAppender();\n}\n\ndescribeWithEnvironment('LayoutShiftsTrackAppender', function() {\n async function renderTrackAppender(context: Mocha.Context|Mocha.Suite, trace: string): Promise<{\n entryTypeByLevel: Timeline.TimelineFlameChartDataProvider.EntryType[],\n flameChartData: PerfUI.FlameChart.FlameChartTimelineData,\n layoutShiftsTrackAppender: Timeline.LayoutShiftsTrackAppender.LayoutShiftsTrackAppender,\n entryData: Trace.Types.Events.Event[],\n parsedTrace: Readonly,\n }> {\n const entryTypeByLevel: Timeline.TimelineFlameChartDataProvider.EntryType[] = [];\n const entryData: Trace.Types.Events.Event[] = [];\n const flameChartData = PerfUI.FlameChart.FlameChartTimelineData.createEmpty();\n const {parsedTrace} = await TraceLoader.traceEngine(context, trace);\n const layoutShiftsTrackAppender = initTrackAppender(flameChartData, parsedTrace, entryData, entryTypeByLevel);\n layoutShiftsTrackAppender.appendTrackAtLevel(0);\n\n return {\n entryTypeByLevel,\n parsedTrace,\n flameChartData,\n layoutShiftsTrackAppender,\n entryData,\n };\n }\n\n it('marks all levels used by the track with the TrackAppender type', async function() {\n const {entryTypeByLevel} = await renderTrackAppender(this, 'cls-single-frame.json.gz');\n // Only one row of layout shifts.\n assert.strictEqual(entryTypeByLevel.length, 1);\n assert.deepEqual(entryTypeByLevel, [\n Timeline.TimelineFlameChartDataProvider.EntryType.TRACK_APPENDER,\n ]);\n });\n\n it('does not append anything if there are no layout shifts', async function() {\n // No layout shifts.\n const {entryTypeByLevel} = await renderTrackAppender(this, 'animation.json.gz');\n assert.lengthOf(entryTypeByLevel, 0);\n });\n\n it('creates a flamechart group', async function() {\n const {flameChartData} = await renderTrackAppender(this, 'cls-single-frame.json.gz');\n assert.strictEqual(flameChartData.groups.length, 1);\n assert.strictEqual(flameChartData.groups[0].name, 'Layout shifts');\n });\n\n it('adds all layout shifts with the correct start times', async function() {\n const {flameChartData, parsedTrace, entryData} = await renderTrackAppender(this, 'cls-single-frame.json.gz');\n const events = parsedTrace.LayoutShifts.clusters.flatMap(c => c.events);\n for (const event of events) {\n const markerIndex = entryData.indexOf(event);\n assert.exists(markerIndex);\n assert.strictEqual(\n flameChartData.entryStartTimes[markerIndex], Trace.Helpers.Timing.microSecondsToMilliseconds(event.ts));\n }\n });\n\n it('returns the correct title for a layout shift', async function() {\n const {layoutShiftsTrackAppender, parsedTrace} = await renderTrackAppender(this, 'cls-single-frame.json.gz');\n const shifts = parsedTrace.LayoutShifts.clusters.flatMap(c => c.events);\n const title = layoutShiftsTrackAppender.titleForEvent(shifts[0]);\n assert.strictEqual(title, 'Layout shift');\n });\n\n it('shows \"Layout shift\" tooltip on hover', async function() {\n const {layoutShiftsTrackAppender, parsedTrace} = await renderTrackAppender(this, 'cls-no-nav.json.gz');\n const shifts = parsedTrace.LayoutShifts.clusters.flatMap(c => c.events);\n await layoutShiftsTrackAppender.preloadScreenshots(shifts);\n\n const info: Timeline.CompatibilityTracksAppender.PopoverInfo = {\n title: 'title',\n formattedTime: 'time',\n warningElements: [],\n additionalElements: [],\n url: null,\n };\n\n layoutShiftsTrackAppender.setPopoverInfo(shifts[3], info);\n assert.strictEqual(info.title, 'Layout shift');\n assert.strictEqual(info.formattedTime, '0.0197');\n assert.strictEqual(info.additionalElements?.at(0)?.nodeName, 'DIV');\n });\n});\n"]} \ No newline at end of file +{"version":3,"file":"LayoutShiftsTrackAppender.test.js","sourceRoot":"","sources":["../../../../../../../front_end/panels/timeline/track_appenders/LayoutShiftsTrackAppender.test.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,KAAK,KAAK,MAAM,gCAAgC,CAAC;AACxD,OAAO,EAAC,uBAAuB,EAAC,MAAM,wCAAwC,CAAC;AAC/E,OAAO,EAAC,WAAW,EAAC,MAAM,iCAAiC,CAAC;AAC5D,OAAO,KAAK,MAAM,MAAM,kDAAkD,CAAC;AAC3E,OAAO,KAAK,QAAQ,MAAM,gBAAgB,CAAC;AAE3C,SAAS,iBAAiB,CACtB,cAAwD,EAAE,WAA6C,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that can be\n// found in the LICENSE file.\n\nimport * as Trace from '../../../models/trace/trace.js';\nimport {describeWithEnvironment} from '../../../testing/EnvironmentHelpers.js';\nimport {TraceLoader} from '../../../testing/TraceLoader.js';\nimport * as PerfUI from '../../../ui/legacy/components/perf_ui/perf_ui.js';\nimport * as Timeline from '../timeline.js';\n\nfunction initTrackAppender(\n flameChartData: PerfUI.FlameChart.FlameChartTimelineData, parsedTrace: Trace.Handlers.Types.ParsedTrace,\n entryData: Trace.Types.Events.Event[], entryTypeByLevel: Timeline.TimelineFlameChartDataProvider.EntryType[]):\n Timeline.LayoutShiftsTrackAppender.LayoutShiftsTrackAppender {\n const compatibilityTracksAppender = new Timeline.CompatibilityTracksAppender.CompatibilityTracksAppender(\n flameChartData, parsedTrace, entryData, entryTypeByLevel);\n return compatibilityTracksAppender.layoutShiftsTrackAppender();\n}\n\ndescribeWithEnvironment('LayoutShiftsTrackAppender', function() {\n async function renderTrackAppender(context: Mocha.Context|Mocha.Suite, trace: string): Promise<{\n entryTypeByLevel: Timeline.TimelineFlameChartDataProvider.EntryType[],\n flameChartData: PerfUI.FlameChart.FlameChartTimelineData,\n layoutShiftsTrackAppender: Timeline.LayoutShiftsTrackAppender.LayoutShiftsTrackAppender,\n entryData: Trace.Types.Events.Event[],\n parsedTrace: Readonly,\n }> {\n const entryTypeByLevel: Timeline.TimelineFlameChartDataProvider.EntryType[] = [];\n const entryData: Trace.Types.Events.Event[] = [];\n const flameChartData = PerfUI.FlameChart.FlameChartTimelineData.createEmpty();\n const {parsedTrace} = await TraceLoader.traceEngine(context, trace);\n const layoutShiftsTrackAppender = initTrackAppender(flameChartData, parsedTrace, entryData, entryTypeByLevel);\n layoutShiftsTrackAppender.appendTrackAtLevel(0);\n\n return {\n entryTypeByLevel,\n parsedTrace,\n flameChartData,\n layoutShiftsTrackAppender,\n entryData,\n };\n }\n\n it('marks all levels used by the track with the TrackAppender type', async function() {\n const {entryTypeByLevel} = await renderTrackAppender(this, 'cls-single-frame.json.gz');\n // Only one row of layout shifts.\n assert.lengthOf(entryTypeByLevel, 1);\n assert.deepEqual(entryTypeByLevel, [\n Timeline.TimelineFlameChartDataProvider.EntryType.TRACK_APPENDER,\n ]);\n });\n\n it('does not append anything if there are no layout shifts', async function() {\n // No layout shifts.\n const {entryTypeByLevel} = await renderTrackAppender(this, 'animation.json.gz');\n assert.lengthOf(entryTypeByLevel, 0);\n });\n\n it('creates a flamechart group', async function() {\n const {flameChartData} = await renderTrackAppender(this, 'cls-single-frame.json.gz');\n assert.lengthOf(flameChartData.groups, 1);\n assert.strictEqual(flameChartData.groups[0].name, 'Layout shifts');\n });\n\n it('adds all layout shifts with the correct start times', async function() {\n const {flameChartData, parsedTrace, entryData} = await renderTrackAppender(this, 'cls-single-frame.json.gz');\n const events = parsedTrace.LayoutShifts.clusters.flatMap(c => c.events);\n for (const event of events) {\n const markerIndex = entryData.indexOf(event);\n assert.exists(markerIndex);\n assert.strictEqual(\n flameChartData.entryStartTimes[markerIndex], Trace.Helpers.Timing.microSecondsToMilliseconds(event.ts));\n }\n });\n\n it('returns the correct title for a layout shift', async function() {\n const {layoutShiftsTrackAppender, parsedTrace} = await renderTrackAppender(this, 'cls-single-frame.json.gz');\n const shifts = parsedTrace.LayoutShifts.clusters.flatMap(c => c.events);\n const title = layoutShiftsTrackAppender.titleForEvent(shifts[0]);\n assert.strictEqual(title, 'Layout shift');\n });\n\n it('shows \"Layout shift\" tooltip on hover', async function() {\n const {layoutShiftsTrackAppender, parsedTrace} = await renderTrackAppender(this, 'cls-no-nav.json.gz');\n const shifts = parsedTrace.LayoutShifts.clusters.flatMap(c => c.events);\n await layoutShiftsTrackAppender.preloadScreenshots(shifts);\n\n const info: Timeline.CompatibilityTracksAppender.PopoverInfo = {\n title: 'title',\n formattedTime: 'time',\n warningElements: [],\n additionalElements: [],\n url: null,\n };\n\n layoutShiftsTrackAppender.setPopoverInfo(shifts[3], info);\n assert.strictEqual(info.title, 'Layout shift');\n assert.strictEqual(info.formattedTime, '0.0197');\n assert.strictEqual(info.additionalElements?.at(0)?.nodeName, 'DIV');\n });\n});\n"]} \ No newline at end of file diff --git a/public/panels/timeline/track_appenders/NetworkTrackAppender.test.js b/public/panels/timeline/track_appenders/NetworkTrackAppender.test.js index df09363a3..2093af82c 100644 --- a/public/panels/timeline/track_appenders/NetworkTrackAppender.test.js +++ b/public/panels/timeline/track_appenders/NetworkTrackAppender.test.js @@ -22,7 +22,7 @@ describeWithEnvironment('NetworkTrackAppender', function () { }); describe('appendTrackAtLevel', function () { it('creates a flamechart group for the Network track', function () { - assert.strictEqual(flameChartData.groups.length, 1); + assert.lengthOf(flameChartData.groups, 1); assert.strictEqual(flameChartData.groups[0].name, 'Network'); }); it('adds start times correctly', function () { diff --git a/public/panels/timeline/track_appenders/NetworkTrackAppender.test.js.map b/public/panels/timeline/track_appenders/NetworkTrackAppender.test.js.map index 41f902f55..25d1d3ff6 100644 --- a/public/panels/timeline/track_appenders/NetworkTrackAppender.test.js.map +++ b/public/panels/timeline/track_appenders/NetworkTrackAppender.test.js.map @@ -1 +1 @@ -{"version":3,"file":"NetworkTrackAppender.test.js","sourceRoot":"","sources":["../../../../../../../front_end/panels/timeline/track_appenders/NetworkTrackAppender.test.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,KAAK,KAAK,MAAM,gCAAgC,CAAC;AACxD,OAAO,EAAC,uBAAuB,EAAC,MAAM,wCAAwC,CAAC;AAC/E,OAAO,EAAC,WAAW,EAAC,MAAM,iCAAiC,CAAC;AAC5D,OAAO,KAAK,MAAM,MAAM,kDAAkD,CAAC;AAC3E,OAAO,KAAK,kBAAkB,MAAM,6BAA6B,CAAC;AAClE,OAAO,KAAK,QAAQ,MAAM,gBAAgB,CAAC;AAE3C,uBAAuB,CAAC,sBAAsB,EAAE;IAC9C,IAAI,WAA6C,CAAC;IAClD,IAAI,oBAAwE,CAAC;IAC7E,IAAI,cAAc,GAAG,MAAM,CAAC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-style license that can be\n// found in the LICENSE file.\n\nimport * as Trace from '../../../models/trace/trace.js';\nimport {describeWithEnvironment} from '../../../testing/EnvironmentHelpers.js';\nimport {TraceLoader} from '../../../testing/TraceLoader.js';\nimport * as PerfUI from '../../../ui/legacy/components/perf_ui/perf_ui.js';\nimport * as TimelineComponents from '../components/components.js';\nimport * as Timeline from '../timeline.js';\n\ndescribeWithEnvironment('NetworkTrackAppender', function() {\n let parsedTrace: Trace.Handlers.Types.ParsedTrace;\n let networkTrackAppender: Timeline.NetworkTrackAppender.NetworkTrackAppender;\n let flameChartData = PerfUI.FlameChart.FlameChartTimelineData.createEmpty();\n\n beforeEach(async function() {\n ({parsedTrace} = await TraceLoader.traceEngine(this, 'cls-cluster-max-timeout.json.gz'));\n networkTrackAppender =\n new Timeline.NetworkTrackAppender.NetworkTrackAppender(flameChartData, parsedTrace.NetworkRequests.byTime);\n networkTrackAppender.appendTrackAtLevel(0);\n });\n\n afterEach(() => {\n flameChartData = PerfUI.FlameChart.FlameChartTimelineData.createEmpty();\n });\n\n describe('appendTrackAtLevel', function() {\n it('creates a flamechart group for the Network track', function() {\n assert.strictEqual(flameChartData.groups.length, 1);\n assert.strictEqual(flameChartData.groups[0].name, 'Network');\n });\n\n it('adds start times correctly', function() {\n const networkRequests = parsedTrace.NetworkRequests.byTime;\n for (let i = 0; i < networkRequests.length; ++i) {\n const event = networkRequests[i];\n assert.strictEqual(\n flameChartData.entryStartTimes[i], Trace.Helpers.Timing.microSecondsToMilliseconds(event.ts));\n }\n });\n\n it('adds total times correctly', function() {\n const networkRequests = parsedTrace.NetworkRequests.byTime;\n for (let i = 0; i < networkRequests.length; i++) {\n const event = networkRequests[i];\n if (Trace.Types.Events.isMarkerEvent(event)) {\n assert.isNaN(flameChartData.entryTotalTimes[i]);\n continue;\n }\n const expectedTotalTimeForEvent = event.dur ?\n Trace.Helpers.Timing.microSecondsToMilliseconds(event.dur) :\n Timeline.TimelineFlameChartDataProvider.InstantEventVisibleDurationMs;\n assert.strictEqual(flameChartData.entryTotalTimes[i], expectedTotalTimeForEvent);\n }\n });\n });\n\n it('returns the correct color for network events', function() {\n const networkRequests = parsedTrace.NetworkRequests.byTime;\n for (const event of networkRequests) {\n const color = TimelineComponents.Utils.colorForNetworkRequest(event);\n assert.strictEqual(networkTrackAppender.colorForEvent(event), color);\n }\n });\n});\n"]} \ No newline at end of file +{"version":3,"file":"NetworkTrackAppender.test.js","sourceRoot":"","sources":["../../../../../../../front_end/panels/timeline/track_appenders/NetworkTrackAppender.test.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,KAAK,KAAK,MAAM,gCAAgC,CAAC;AACxD,OAAO,EAAC,uBAAuB,EAAC,MAAM,wCAAwC,CAAC;AAC/E,OAAO,EAAC,WAAW,EAAC,MAAM,iCAAiC,CAAC;AAC5D,OAAO,KAAK,MAAM,MAAM,kDAAkD,CAAC;AAC3E,OAAO,KAAK,kBAAkB,MAAM,6BAA6B,CAAC;AAClE,OAAO,KAAK,QAAQ,MAAM,gBAAgB,CAAC;AAE3C,uBAAuB,CAAC,sBAAsB,EAAE;IAC9C,IAAI,WAA6C,CAAC;IAClD,IAAI,oBAAwE,CAAC;IAC7E,IAAI,cAAc,GAAG,MAAM,CAAC,UAAU,CAAC,sBAAsB,CAAC,WAAW,EAAE,CAAC;IAE5E,UAAU,CAAC,KAAK;QACd,CAAC,EAAC,WAAW,EAAC,GAAG,MAAM,WAAW,CAAC,WAAW,CAAC,IAAI,EAAE,iCAAiC,CAAC,CAAC,CAAC;QACzF,oBAAoB;YAChB,IAAI,QAAQ,CAAC,oBAAoB,CAAC,oBAAoB,CAAC,cAAc,EAAE,WAAW,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC;QAC/G,oBAAoB,CAAC,kBAAkB,CAAC,CAAC,CAAC,CAAC;IAC7C,CAAC,CAAC,CAAC;IAEH,SAAS,CAAC,GAAG,EAAE;QACb,cAAc,GAAG,MAAM,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AC;gBACD,MAAM,yBAAyB,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC;oBACzC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,0BAA0B,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC;oBAC5D,QAAQ,CAAC,8BAA8B,CAAC,6BAA6B,CAAC;gBAC1E,MAAM,CAAC,WAAW,CAAC,cAAc,CAAC,eAAe,CAAC,CAAC,CAAC,EAAE,yBAAyB,CAAC,CAAC;YACnF,CAAC;QACH,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,8CAA8C,EAAE;QACjD,MAAM,eAAe,GAAG,WAAW,CAAC,eAAe,CAAC,MAAM,CAAC;QAC3D,KAAK,MAAM,KAAK,IAAI,eAAe,EAAE,CAAC;YACpC,MAAM,KAAK,GAAG,kBAAkB,CAAC,KAAK,CAAC,sBAAsB,CAAC,KAAK,CAAC,CAAC;YACrE,MAAM,CAAC,WAAW,CAAC,oBAAoB,CAAC,aAAa,CAAC,KAAK,CAAC,EAAE,KAAK,CAAC,CAAC;QACvE,CAAC;IACH,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["// Copyright 2023 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport * as Trace from '../../../models/trace/trace.js';\nimport {describeWithEnvironment} from '../../../testing/EnvironmentHelpers.js';\nimport {TraceLoader} from '../../../testing/TraceLoader.js';\nimport * as PerfUI from '../../../ui/legacy/components/perf_ui/perf_ui.js';\nimport * as TimelineComponents from '../components/components.js';\nimport * as Timeline from '../timeline.js';\n\ndescribeWithEnvironment('NetworkTrackAppender', function() {\n let parsedTrace: Trace.Handlers.Types.ParsedTrace;\n let networkTrackAppender: Timeline.NetworkTrackAppender.NetworkTrackAppender;\n let flameChartData = PerfUI.FlameChart.FlameChartTimelineData.createEmpty();\n\n beforeEach(async function() {\n ({parsedTrace} = await TraceLoader.traceEngine(this, 'cls-cluster-max-timeout.json.gz'));\n networkTrackAppender =\n new Timeline.NetworkTrackAppender.NetworkTrackAppender(flameChartData, parsedTrace.NetworkRequests.byTime);\n networkTrackAppender.appendTrackAtLevel(0);\n });\n\n afterEach(() => {\n flameChartData = PerfUI.FlameChart.FlameChartTimelineData.createEmpty();\n });\n\n describe('appendTrackAtLevel', function() {\n it('creates a flamechart group for the Network track', function() {\n assert.lengthOf(flameChartData.groups, 1);\n assert.strictEqual(flameChartData.groups[0].name, 'Network');\n });\n\n it('adds start times correctly', function() {\n const networkRequests = parsedTrace.NetworkRequests.byTime;\n for (let i = 0; i < networkRequests.length; ++i) {\n const event = networkRequests[i];\n assert.strictEqual(\n flameChartData.entryStartTimes[i], Trace.Helpers.Timing.microSecondsToMilliseconds(event.ts));\n }\n });\n\n it('adds total times correctly', function() {\n const networkRequests = parsedTrace.NetworkRequests.byTime;\n for (let i = 0; i < networkRequests.length; i++) {\n const event = networkRequests[i];\n if (Trace.Types.Events.isMarkerEvent(event)) {\n assert.isNaN(flameChartData.entryTotalTimes[i]);\n continue;\n }\n const expectedTotalTimeForEvent = event.dur ?\n Trace.Helpers.Timing.microSecondsToMilliseconds(event.dur) :\n Timeline.TimelineFlameChartDataProvider.InstantEventVisibleDurationMs;\n assert.strictEqual(flameChartData.entryTotalTimes[i], expectedTotalTimeForEvent);\n }\n });\n });\n\n it('returns the correct color for network events', function() {\n const networkRequests = parsedTrace.NetworkRequests.byTime;\n for (const event of networkRequests) {\n const color = TimelineComponents.Utils.colorForNetworkRequest(event);\n assert.strictEqual(networkTrackAppender.colorForEvent(event), color);\n }\n });\n});\n"]} \ No newline at end of file diff --git a/public/panels/timeline/track_appenders/ServerTimingsTrackAppender.test.js b/public/panels/timeline/track_appenders/ServerTimingsTrackAppender.test.js index 0a02bbaa2..f4da80945 100644 --- a/public/panels/timeline/track_appenders/ServerTimingsTrackAppender.test.js +++ b/public/panels/timeline/track_appenders/ServerTimingsTrackAppender.test.js @@ -32,11 +32,11 @@ describeWithEnvironment('ServerTimingsTrackAppender', function () { }); describe('appendTrackAtLevel', function () { it('creates a flamechart group for the Server timings track', function () { - assert.strictEqual(flameChartData.groups.length, 1); + assert.lengthOf(flameChartData.groups, 1); assert.strictEqual(flameChartData.groups[0].name, 'Server Timings — https://node-server-tan.vercel.app'); }); it('Adds a description to server timings tracks', function () { - assert.strictEqual(flameChartData.groups.length, 1); + assert.lengthOf(flameChartData.groups, 1); assert.strictEqual(flameChartData.groups[0].description, 'This track contains timings taken from Server-Timing network response headers. Their respective start times are only estimated and may not be accurate.'); }); it('adds start times correctly', function () { diff --git a/public/panels/timeline/track_appenders/ServerTimingsTrackAppender.test.js.map b/public/panels/timeline/track_appenders/ServerTimingsTrackAppender.test.js.map index 38b728555..65361da0f 100644 --- a/public/panels/timeline/track_appenders/ServerTimingsTrackAppender.test.js.map +++ b/public/panels/timeline/track_appenders/ServerTimingsTrackAppender.test.js.map @@ -1 +1 @@ -{"version":3,"file":"ServerTimingsTrackAppender.test.js","sourceRoot":"","sources":["../../../../../../../front_end/panels/timeline/track_appenders/ServerTimingsTrackAppender.test.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,KAAK,IAAI,MAAM,4BAA4B,CAAC;AACnD,OAAO,KAAK,KAAK,MAAM,gCAAgC,CAAC;AACxD,OAAO,EAAC,uBAAuB,EAAC,MAAM,wCAAwC,CAAC;AAC/E,OAAO,EAAC,WAAW,EAAC,MAAM,iCAAiC,CAAC;AAC5D,OAAO,KAAK,MAAM,MAAM,kDAAkD,CAAC;AAC3E,OAAO,KAAK,YAAY,MAAM,mDAAmD,CAAC;AAClF,OAAO,KAAK,QAAQ,MAAM,gBAAgB,CAAC;AAE3C,SAAS,iBAAiB,CACtB,cAAwD,EAAE,WAA6C,EACvG,SAAqC,EAAE,gBAAqE;IAE9G,MAAM,2BAA2B,GAAG,IAAI,QAAQ,CAAC,2BAA2B,CAAC,2BAA2B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CAAC,KAAK,CAAC,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC;gBAChF,MAAM,CAAC,WAAW,CAAC,0BAA0B,CAAC,aAAa,EAAE,EAAE,YAAY,CAAC,CAAC;YAC/E,CAAC;QACH,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["// Copyright 2024 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport * as Root from '../../../core/root/root.js';\nimport * as Trace from '../../../models/trace/trace.js';\nimport {describeWithEnvironment} from '../../../testing/EnvironmentHelpers.js';\nimport {TraceLoader} from '../../../testing/TraceLoader.js';\nimport * as PerfUI from '../../../ui/legacy/components/perf_ui/perf_ui.js';\nimport * as ThemeSupport from '../../../ui/legacy/theme_support/theme_support.js';\nimport * as Timeline from '../timeline.js';\n\nfunction initTrackAppender(\n flameChartData: PerfUI.FlameChart.FlameChartTimelineData, parsedTrace: Trace.Handlers.Types.ParsedTrace,\n entryData: Trace.Types.Events.Event[], entryTypeByLevel: Timeline.TimelineFlameChartDataProvider.EntryType[]):\n Timeline.ServerTimingsTrackAppender.ServerTimingsTrackAppender {\n const compatibilityTracksAppender = new Timeline.CompatibilityTracksAppender.CompatibilityTracksAppender(\n flameChartData, parsedTrace, entryData, entryTypeByLevel);\n return compatibilityTracksAppender.serverTimingsTrackAppender();\n}\n\ndescribeWithEnvironment('ServerTimingsTrackAppender', function() {\n let parsedTrace: Trace.Handlers.Types.ParsedTrace;\n let serverTimingsTrackAppender: Timeline.ServerTimingsTrackAppender.ServerTimingsTrackAppender;\n let entryData: Trace.Types.Events.Event[] = [];\n let flameChartData = PerfUI.FlameChart.FlameChartTimelineData.createEmpty();\n let entryTypeByLevel: Timeline.TimelineFlameChartDataProvider.EntryType[] = [];\n\n beforeEach(async function() {\n Root.Runtime.experiments.enableForTest(Root.Runtime.ExperimentName.TIMELINE_SERVER_TIMINGS);\n\n ({parsedTrace} = await TraceLoader.traceEngine(this, 'server-timings.json.gz'));\n serverTimingsTrackAppender = initTrackAppender(flameChartData, parsedTrace, entryData, entryTypeByLevel);\n serverTimingsTrackAppender.appendTrackAtLevel(0);\n });\n\n afterEach(() => {\n Root.Runtime.experiments.disableForTest(Root.Runtime.ExperimentName.TIMELINE_SERVER_TIMINGS);\n\n entryData = [];\n flameChartData = PerfUI.FlameChart.FlameChartTimelineData.createEmpty();\n entryTypeByLevel = [];\n });\n\n describe('appendTrackAtLevel', function() {\n it('creates a flamechart group for the Server timings track', function() {\n assert.strictEqual(flameChartData.groups.length, 1);\n assert.strictEqual(flameChartData.groups[0].name, 'Server Timings — https://node-server-tan.vercel.app');\n });\n\n it('Adds a description to server timings tracks', function() {\n assert.strictEqual(flameChartData.groups.length, 1);\n assert.strictEqual(\n flameChartData.groups[0].description,\n 'This track contains timings taken from Server-Timing network response headers. Their respective start times are only estimated and may not be accurate.');\n });\n\n it('adds start times correctly', function() {\n const animationsRequests = parsedTrace.Animations.animations;\n for (let i = 0; i < animationsRequests.length; ++i) {\n const event = animationsRequests[i];\n assert.strictEqual(\n flameChartData.entryStartTimes[i], Trace.Helpers.Timing.microSecondsToMilliseconds(event.ts));\n }\n });\n\n it('adds total times correctly', function() {\n const animationsRequests = parsedTrace.Animations.animations;\n for (let i = 0; i < animationsRequests.length; i++) {\n const event = animationsRequests[i];\n if (Trace.Types.Events.isMarkerEvent(event)) {\n assert.isNaN(flameChartData.entryTotalTimes[i]);\n continue;\n }\n const expectedTotalTimeForEvent = event.dur ?\n Trace.Helpers.Timing.microSecondsToMilliseconds(event.dur) :\n Timeline.TimelineFlameChartDataProvider.InstantEventVisibleDurationMs;\n assert.strictEqual(flameChartData.entryTotalTimes[i], expectedTotalTimeForEvent);\n }\n });\n });\n\n describe('colorForEvent and titleForEvent', function() {\n before(() => {\n // Rather than use the real colours here and burden the test with having to\n // inject loads of CSS, we fake out the colours. this is fine for our tests as\n // the exact value of the colours is not important; we just make sure that it\n // parses them out correctly. Each variable is given a different rgb() value to\n // ensure we know the code is working and using the right one.\n const styleElement = document.createElement('style');\n styleElement.id = 'fake-perf-panel-colors';\n styleElement.textContent = `\n :root {\n --ref-palette-primary70: rgb(4 4 4);\n }\n `;\n document.documentElement.appendChild(styleElement);\n ThemeSupport.ThemeSupport.clearThemeCache();\n });\n\n after(() => {\n const styleElementToRemove = document.documentElement.querySelector('#fake-perf-panel-colors');\n if (styleElementToRemove) {\n document.documentElement.removeChild(styleElementToRemove);\n }\n ThemeSupport.ThemeSupport.clearThemeCache();\n });\n it('returns the correct color and title for server timing events', function() {\n const serverTimings = parsedTrace.ServerTimings.serverTimings;\n for (const event of serverTimings) {\n assert.strictEqual(serverTimingsTrackAppender.titleForEvent(event), event.name);\n assert.strictEqual(serverTimingsTrackAppender.colorForEvent(), 'rgb(4 4 4)');\n }\n });\n });\n});\n"]} \ No newline at end of file +{"version":3,"file":"ServerTimingsTrackAppender.test.js","sourceRoot":"","sources":["../../../../../../../front_end/panels/timeline/track_appenders/ServerTimingsTrackAppender.test.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,KAAK,IAAI,MAAM,4BAA4B,CAAC;AACnD,OAAO,KAAK,KAAK,MAAM,gCAAgC,CAAC;AACxD,OAAO,EAAC,uBAAuB,EAAC,MAAM,wCAAwC,CAAC;AAC/E,OAAO,EAAC,WAAW,EAAC,MAAM,iCAAiC,CAAC;AAC5D,OAAO,KAAK,MAAM,MAAM,kDAAkD,CAAC;AAC3E,OAAO,KAAK,YAAY,MAAM,mDAAmD,CAAC;AAClF,OAAO,KAAK,QAAQ,MAAM,gBAAgB,CAAC;AAE3C,SAAS,iBAAiB,CACtB,cAAwD,EAAE,WAA6C,EACvG,SAAqC,EAAE,gBAAqE;IAE9G,MAAM,2BAA2B,GAAG,IAAI,QAAQ,CAAC,2BAA2B,CAAC,2BAA2B,CACpG,cAAc,EAAE,WAAW,EAAE,SAAS,EAA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,MAAM,CAAC,WAAW,CAAC,0BAA0B,CAAC,aAAa,EAAE,EAAE,YAAY,CAAC,CAAC;YAC/E,CAAC;QACH,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["// Copyright 2024 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport * as Root from '../../../core/root/root.js';\nimport * as Trace from '../../../models/trace/trace.js';\nimport {describeWithEnvironment} from '../../../testing/EnvironmentHelpers.js';\nimport {TraceLoader} from '../../../testing/TraceLoader.js';\nimport * as PerfUI from '../../../ui/legacy/components/perf_ui/perf_ui.js';\nimport * as ThemeSupport from '../../../ui/legacy/theme_support/theme_support.js';\nimport * as Timeline from '../timeline.js';\n\nfunction initTrackAppender(\n flameChartData: PerfUI.FlameChart.FlameChartTimelineData, parsedTrace: Trace.Handlers.Types.ParsedTrace,\n entryData: Trace.Types.Events.Event[], entryTypeByLevel: Timeline.TimelineFlameChartDataProvider.EntryType[]):\n Timeline.ServerTimingsTrackAppender.ServerTimingsTrackAppender {\n const compatibilityTracksAppender = new Timeline.CompatibilityTracksAppender.CompatibilityTracksAppender(\n flameChartData, parsedTrace, entryData, entryTypeByLevel);\n return compatibilityTracksAppender.serverTimingsTrackAppender();\n}\n\ndescribeWithEnvironment('ServerTimingsTrackAppender', function() {\n let parsedTrace: Trace.Handlers.Types.ParsedTrace;\n let serverTimingsTrackAppender: Timeline.ServerTimingsTrackAppender.ServerTimingsTrackAppender;\n let entryData: Trace.Types.Events.Event[] = [];\n let flameChartData = PerfUI.FlameChart.FlameChartTimelineData.createEmpty();\n let entryTypeByLevel: Timeline.TimelineFlameChartDataProvider.EntryType[] = [];\n\n beforeEach(async function() {\n Root.Runtime.experiments.enableForTest(Root.Runtime.ExperimentName.TIMELINE_SERVER_TIMINGS);\n\n ({parsedTrace} = await TraceLoader.traceEngine(this, 'server-timings.json.gz'));\n serverTimingsTrackAppender = initTrackAppender(flameChartData, parsedTrace, entryData, entryTypeByLevel);\n serverTimingsTrackAppender.appendTrackAtLevel(0);\n });\n\n afterEach(() => {\n Root.Runtime.experiments.disableForTest(Root.Runtime.ExperimentName.TIMELINE_SERVER_TIMINGS);\n\n entryData = [];\n flameChartData = PerfUI.FlameChart.FlameChartTimelineData.createEmpty();\n entryTypeByLevel = [];\n });\n\n describe('appendTrackAtLevel', function() {\n it('creates a flamechart group for the Server timings track', function() {\n assert.lengthOf(flameChartData.groups, 1);\n assert.strictEqual(flameChartData.groups[0].name, 'Server Timings — https://node-server-tan.vercel.app');\n });\n\n it('Adds a description to server timings tracks', function() {\n assert.lengthOf(flameChartData.groups, 1);\n assert.strictEqual(\n flameChartData.groups[0].description,\n 'This track contains timings taken from Server-Timing network response headers. Their respective start times are only estimated and may not be accurate.');\n });\n\n it('adds start times correctly', function() {\n const animationsRequests = parsedTrace.Animations.animations;\n for (let i = 0; i < animationsRequests.length; ++i) {\n const event = animationsRequests[i];\n assert.strictEqual(\n flameChartData.entryStartTimes[i], Trace.Helpers.Timing.microSecondsToMilliseconds(event.ts));\n }\n });\n\n it('adds total times correctly', function() {\n const animationsRequests = parsedTrace.Animations.animations;\n for (let i = 0; i < animationsRequests.length; i++) {\n const event = animationsRequests[i];\n if (Trace.Types.Events.isMarkerEvent(event)) {\n assert.isNaN(flameChartData.entryTotalTimes[i]);\n continue;\n }\n const expectedTotalTimeForEvent = event.dur ?\n Trace.Helpers.Timing.microSecondsToMilliseconds(event.dur) :\n Timeline.TimelineFlameChartDataProvider.InstantEventVisibleDurationMs;\n assert.strictEqual(flameChartData.entryTotalTimes[i], expectedTotalTimeForEvent);\n }\n });\n });\n\n describe('colorForEvent and titleForEvent', function() {\n before(() => {\n // Rather than use the real colours here and burden the test with having to\n // inject loads of CSS, we fake out the colours. this is fine for our tests as\n // the exact value of the colours is not important; we just make sure that it\n // parses them out correctly. Each variable is given a different rgb() value to\n // ensure we know the code is working and using the right one.\n const styleElement = document.createElement('style');\n styleElement.id = 'fake-perf-panel-colors';\n styleElement.textContent = `\n :root {\n --ref-palette-primary70: rgb(4 4 4);\n }\n `;\n document.documentElement.appendChild(styleElement);\n ThemeSupport.ThemeSupport.clearThemeCache();\n });\n\n after(() => {\n const styleElementToRemove = document.documentElement.querySelector('#fake-perf-panel-colors');\n if (styleElementToRemove) {\n document.documentElement.removeChild(styleElementToRemove);\n }\n ThemeSupport.ThemeSupport.clearThemeCache();\n });\n it('returns the correct color and title for server timing events', function() {\n const serverTimings = parsedTrace.ServerTimings.serverTimings;\n for (const event of serverTimings) {\n assert.strictEqual(serverTimingsTrackAppender.titleForEvent(event), event.name);\n assert.strictEqual(serverTimingsTrackAppender.colorForEvent(), 'rgb(4 4 4)');\n }\n });\n });\n});\n"]} \ No newline at end of file diff --git a/public/panels/timeline/track_appenders/ThreadAppender.test.js b/public/panels/timeline/track_appenders/ThreadAppender.test.js index 34a41000e..ef3556d5d 100644 --- a/public/panels/timeline/track_appenders/ThreadAppender.test.js +++ b/public/panels/timeline/track_appenders/ThreadAppender.test.js @@ -96,16 +96,16 @@ describeWithEnvironment('ThreadAppender', function () { // This group corresponds to the header that wraps the raster tracks // together. It isn't selectable and isn't nested assert.strictEqual(flameChartData.groups[1].name, 'Raster'); - assert.strictEqual(flameChartData.groups[1].selectable, false); + assert.isFalse(flameChartData.groups[1].selectable); assert.strictEqual(flameChartData.groups[1].style.nestingLevel, 0); // These groups correspond to the raster tracks titles, or the // individual raster tracks themselves. They are selectable and // nested assert.strictEqual(flameChartData.groups[2].name, 'Rasterizer thread 1'); - assert.strictEqual(flameChartData.groups[2].selectable, true); + assert.isTrue(flameChartData.groups[2].selectable); assert.strictEqual(flameChartData.groups[2].style.nestingLevel, 1); assert.strictEqual(flameChartData.groups[3].name, 'Rasterizer thread 2'); - assert.strictEqual(flameChartData.groups[3].selectable, true); + assert.isTrue(flameChartData.groups[3].selectable); assert.strictEqual(flameChartData.groups[3].style.nestingLevel, 1); }); it('assigns correct names to multiple types of threads', async function () { @@ -414,7 +414,7 @@ describeWithEnvironment('ThreadAppender', function () { assert.deepEqual(flameChartData.entryLevels, [0, 1, 2, 1]); assert.deepEqual(flameChartData.entryStartTimes, [0.1, 0.1, 0.1, 0.2]); assert.deepEqual(flameChartData.entryTotalTimes, [0.2, 0.1, 0.025, 0.1]); - assert.strictEqual(threadAppenders.length, 1); + assert.lengthOf(threadAppenders, 1); assert.strictEqual(threadAppenders[0].titleForEvent(callFrameB), 'On ignore list (\\\/bundled\\.js$)'); }); }); diff --git a/public/panels/timeline/track_appenders/ThreadAppender.test.js.map b/public/panels/timeline/track_appenders/ThreadAppender.test.js.map index f5569b0ed..0ee601dc2 100644 --- a/public/panels/timeline/track_appenders/ThreadAppender.test.js.map +++ b/public/panels/timeline/track_appenders/ThreadAppender.test.js.map @@ -1 +1 @@ -{"version":3,"file":"ThreadAppender.test.js","sourceRoot":"","sources":["../../../../../../../front_end/panels/timeline/track_appenders/ThreadAppender.test.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAG7B,OAAO,KAAK,IAAI,MAAM,4BAA4B,CAAC;AACnD,OAAO,KAAK,GAAG,MAAM,0BAA0B,CAAC;AAChD,OAAO,KAAK,QAAQ,MAAM,sCAAsC,CAAC;AACjE,OAAO,KAAK,KAAK,MAAM,gCAAgC,CAAC;AACxD,OAAO,KAAK,SAAS,MAAM,wCAAwC,CAAC;AACpE,OAAO,EAAC,uBAAuB,EAAC,MAAM,wCAAwC,CAAC;AAC/E,OAAO,EACL,2BAA2B,IAAI,uBAAuB,EACtD,eAAe,EACf,iCAAiC,GAClC,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAAC,WAAW,EAAC,MAAM,iCAAiC,CAAC;AAC5D,OAAO,KAAK,MAAM,MAAM,kDAAkD,CAAC;AAC3E,OAAO,KAAK,QAAQ,MAAM,gBAAgB,CAAC;AAE3C,SAAS,iBAAiB,CACtB,cAAwD,EACxD,WAA6C,EAC7C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cAAc,CAAC,SAAS,EAAE,KAAK,iBAAiB,IAAI,cAAc,CAAC,QAAQ,EAAE,KAAK,iBAAiB,CAAC;YAC7G,CAAC,CAAC,CAAC;YACH,IAAI,CAAC,QAAQ,EAAE,CAAC;gBACd,MAAM,IAAI,KAAK,CAAC,yCAAyC,CAAC,CAAC;YAC7D,CAAC;YACD,MAAM,CAAC,WAAW,CAAC,QAAQ,CAAC,SAAS,EAAE,EAAE,oDAAoD,CAAC,CAAC;QACjG,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["// Copyright 2023 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport type * as Platform from '../../../core/platform/platform.js';\nimport * as Root from '../../../core/root/root.js';\nimport * as SDK from '../../../core/sdk/sdk.js';\nimport * as Bindings from '../../../models/bindings/bindings.js';\nimport * as Trace from '../../../models/trace/trace.js';\nimport * as Workspace from '../../../models/workspace/workspace.js';\nimport {describeWithEnvironment} from '../../../testing/EnvironmentHelpers.js';\nimport {\n makeMockRendererHandlerData as makeRendererHandlerData,\n makeProfileCall,\n setupIgnoreListManagerEnvironment,\n} from '../../../testing/TraceHelpers.js';\nimport {TraceLoader} from '../../../testing/TraceLoader.js';\nimport * as PerfUI from '../../../ui/legacy/components/perf_ui/perf_ui.js';\nimport * as Timeline from '../timeline.js';\n\nfunction initTrackAppender(\n flameChartData: PerfUI.FlameChart.FlameChartTimelineData,\n parsedTrace: Trace.Handlers.Types.ParsedTrace,\n entryData: Trace.Types.Events.Event[],\n entryTypeByLevel: Timeline.TimelineFlameChartDataProvider.EntryType[],\n ): {\n threadAppenders: Timeline.ThreadAppender.ThreadAppender[],\n compatibilityTracksAppender: Timeline.CompatibilityTracksAppender.CompatibilityTracksAppender,\n} {\n setupIgnoreListManagerEnvironment();\n const compatibilityTracksAppender = new Timeline.CompatibilityTracksAppender.CompatibilityTracksAppender(\n flameChartData, parsedTrace, entryData, entryTypeByLevel);\n return {threadAppenders: compatibilityTracksAppender.threadAppenders(), compatibilityTracksAppender};\n}\n\nasync function renderThreadAppendersFromTrace(context: Mocha.Context|Mocha.Suite, trace: string):\n Promise> {\n const {parsedTrace} = await TraceLoader.traceEngine(context, trace);\n return renderThreadAppendersFromParsedData(parsedTrace);\n}\n\nfunction renderThreadAppendersFromParsedData(parsedTrace: Trace.Handlers.Types.ParsedTrace): {\n entryTypeByLevel: Timeline.TimelineFlameChartDataProvider.EntryType[],\n flameChartData: PerfUI.FlameChart.FlameChartTimelineData,\n threadAppenders: Timeline.ThreadAppender.ThreadAppender[],\n entryData: Trace.Types.Events.Event[],\n parsedTrace: Readonly,\n compatibilityTracksAppender: Timeline.CompatibilityTracksAppender.CompatibilityTracksAppender,\n} {\n const entryTypeByLevel: Timeline.TimelineFlameChartDataProvider.EntryType[] = [];\n const entryData: Trace.Types.Events.Event[] = [];\n const flameChartData = PerfUI.FlameChart.FlameChartTimelineData.createEmpty();\n const {threadAppenders, compatibilityTracksAppender} =\n initTrackAppender(flameChartData, parsedTrace, entryData, entryTypeByLevel);\n let level = 0;\n for (const appender of threadAppenders) {\n level = appender.appendTrackAtLevel(level);\n }\n\n return {\n entryTypeByLevel,\n flameChartData,\n compatibilityTracksAppender,\n parsedTrace,\n threadAppenders,\n entryData,\n };\n}\n\ndescribeWithEnvironment('ThreadAppender', function() {\n it('creates a thread appender for each thread in a trace', async function() {\n const {threadAppenders} = await renderThreadAppendersFromTrace(this, 'simple-js-program.json.gz');\n const expectedAppenderNames = [\n 'Thread',\n 'Thread',\n 'Thread',\n ];\n assert.deepEqual(threadAppenders.map(g => g.appenderName), expectedAppenderNames);\n });\n\n it('renders tracks for threads in correct order', async function() {\n const {flameChartData} = await renderThreadAppendersFromTrace(this, 'multiple-navigations-with-iframes.json.gz');\n assert.strictEqual(flameChartData.groups[0].name, 'Main — http://localhost:5000/');\n assert.strictEqual(flameChartData.groups[1].name, 'Frame — https://www.example.com/');\n });\n\n it('renders tracks for threads in correct order when a process url is about:blank', async function() {\n const {flameChartData} = await renderThreadAppendersFromTrace(this, 'about-blank-first.json.gz');\n const groupNames = flameChartData.groups.map(g => g.name.replace(/(new-tab-page\\/).*/, '$1'));\n assert.deepEqual(groupNames.slice(0, 3), [\n 'Frame — chrome-untrusted://new-tab-page/',\n 'Main — chrome://new-tab-page/',\n 'Main — about:blank',\n ]);\n });\n\n it('marks all levels used by the track with the TrackAppender type', async function() {\n const {entryTypeByLevel} = await renderThreadAppendersFromTrace(this, 'simple-js-program.json.gz');\n // This includes all tracks rendered by the ThreadAppender.\n const execptedLevelTypes = [\n Timeline.TimelineFlameChartDataProvider.EntryType.TRACK_APPENDER,\n Timeline.TimelineFlameChartDataProvider.EntryType.TRACK_APPENDER,\n Timeline.TimelineFlameChartDataProvider.EntryType.TRACK_APPENDER,\n Timeline.TimelineFlameChartDataProvider.EntryType.TRACK_APPENDER,\n Timeline.TimelineFlameChartDataProvider.EntryType.TRACK_APPENDER,\n Timeline.TimelineFlameChartDataProvider.EntryType.TRACK_APPENDER,\n Timeline.TimelineFlameChartDataProvider.EntryType.TRACK_APPENDER,\n Timeline.TimelineFlameChartDataProvider.EntryType.TRACK_APPENDER,\n Timeline.TimelineFlameChartDataProvider.EntryType.TRACK_APPENDER,\n Timeline.TimelineFlameChartDataProvider.EntryType.TRACK_APPENDER,\n ];\n assert.deepEqual(entryTypeByLevel, execptedLevelTypes);\n });\n\n it('creates a flamechart groups for track headers and titles', async function() {\n const {flameChartData} = await renderThreadAppendersFromTrace(this, 'cls-single-frame.json.gz');\n const expectedTrackNames = [\n 'Main — https://output.jsbin.com/zajamil/quiet',\n 'Raster',\n 'Rasterizer thread 1',\n 'Rasterizer thread 2',\n 'Thread pool',\n 'Thread pool worker 1',\n ];\n assert.deepEqual(flameChartData.groups.map(g => g.name), expectedTrackNames);\n });\n\n it('builds flamechart groups for nested tracks correctly', async function() {\n const {flameChartData} = await renderThreadAppendersFromTrace(this, 'cls-single-frame.json.gz');\n // This group corresponds to the header that wraps the raster tracks\n // together. It isn't selectable and isn't nested\n assert.strictEqual(flameChartData.groups[1].name, 'Raster');\n assert.strictEqual(flameChartData.groups[1].selectable, false);\n assert.strictEqual(flameChartData.groups[1].style.nestingLevel, 0);\n\n // These groups correspond to the raster tracks titles, or the\n // individual raster tracks themselves. They are selectable and\n // nested\n assert.strictEqual(flameChartData.groups[2].name, 'Rasterizer thread 1');\n assert.strictEqual(flameChartData.groups[2].selectable, true);\n assert.strictEqual(flameChartData.groups[2].style.nestingLevel, 1);\n\n assert.strictEqual(flameChartData.groups[3].name, 'Rasterizer thread 2');\n assert.strictEqual(flameChartData.groups[3].selectable, true);\n assert.strictEqual(flameChartData.groups[3].style.nestingLevel, 1);\n });\n\n it('assigns correct names to multiple types of threads', async function() {\n const {flameChartData} = await renderThreadAppendersFromTrace(this, 'simple-js-program.json.gz');\n const expectedTrackNames = [\n 'Main — https://www.google.com',\n 'Thread pool',\n 'Thread pool worker 1',\n 'Thread pool worker 2',\n ];\n assert.deepEqual(flameChartData.groups.map(g => g.name), expectedTrackNames);\n });\n\n it('adds thread IDs onto tracks when the trace is generic', async () => {\n const {flameChartData} = await renderThreadAppendersFromTrace(this, 'generic-about-tracing.json.gz');\n // This trace has a lot of tracks, so just test one.\n assert.isTrue(flameChartData.groups.map(g => g.name)\n .includes('CrBrowserMain (1213787)' as Platform.UIString.LocalizedString));\n });\n\n it('assigns the right color for events when the trace is generic', async () => {\n const {threadAppenders, parsedTrace} = await renderThreadAppendersFromTrace(this, 'generic-about-tracing.json.gz');\n const event = parsedTrace.Renderer.allTraceEntries.find(entry => {\n return entry.name === 'ThreadControllerImpl::RunTask';\n });\n if (!event) {\n throw new Error('Could not find event.');\n }\n assert.strictEqual(threadAppenders[0].colorForEvent(event), 'hsl(278, 40%, 70%)');\n });\n\n it('assigns correct names to worker threads', async function() {\n const {flameChartData} = await renderThreadAppendersFromTrace(this, 'two-workers.json.gz');\n const expectedTrackNames = [\n 'Main — https://chromedevtools.github.io/performance-stories/two-workers/index.html',\n 'Worker — https://chromedevtools.github.io/performance-stories/two-workers/fib-worker.js',\n 'Worker — https://chromedevtools.github.io/performance-stories/two-workers/fib-worker.js',\n 'Thread pool',\n 'Thread pool worker 1',\n 'Thread pool worker 2',\n ];\n assert.deepEqual(flameChartData.groups.map(g => g.name), expectedTrackNames);\n });\n\n it('returns the correct title for a renderer event', async function() {\n const {threadAppenders, parsedTrace} = await renderThreadAppendersFromTrace(this, 'simple-js-program.json.gz');\n const events = parsedTrace.Renderer?.allTraceEntries;\n if (!events) {\n throw new Error('Could not find renderer events');\n }\n const title = threadAppenders[0].titleForEvent(events[0]);\n assert.strictEqual(title, 'Task');\n });\n\n it('adds the type for EventDispatch events to the title', async function() {\n const {threadAppenders, parsedTrace} = await renderThreadAppendersFromTrace(this, 'one-second-interaction.json.gz');\n const events = parsedTrace.Renderer?.allTraceEntries;\n if (!events) {\n throw new Error('Could not find renderer events');\n }\n const clickEvent = events.find(event => {\n return Trace.Types.Events.isDispatch(event) && event.args.data.type === 'click';\n });\n if (!clickEvent) {\n throw new Error('Could not find expected click event');\n }\n const title = threadAppenders[0].titleForEvent(clickEvent);\n assert.strictEqual(title, 'Event: click');\n });\n\n it('returns the correct title for a profile call', async function() {\n const {threadAppenders, parsedTrace} = await renderThreadAppendersFromTrace(this, 'simple-js-program.json.gz');\n const rendererHandler = parsedTrace.Renderer;\n if (!rendererHandler) {\n throw new Error('RendererHandler is undefined');\n }\n const [process] = rendererHandler.processes.values();\n const [thread] = process.threads.values();\n const profileCalls = thread.entries.filter(entry => Trace.Types.Events.isProfileCall(entry));\n\n if (!profileCalls) {\n throw new Error('Could not find renderer events');\n }\n const anonymousCall = threadAppenders[0].titleForEvent(profileCalls[0]);\n assert.strictEqual(anonymousCall, '(anonymous)');\n const n = threadAppenders[0].titleForEvent(profileCalls[7]);\n assert.strictEqual(n, 'n');\n });\n\n it('will use the function name from the CPUProfile if it has been set', async function() {\n const {threadAppenders, parsedTrace} = await renderThreadAppendersFromTrace(this, 'simple-js-program.json.gz');\n const {Renderer, Samples} = parsedTrace;\n const [process] = Renderer.processes.values();\n const [thread] = process.threads.values();\n const profileCalls = thread.entries.filter(Trace.Types.Events.isProfileCall);\n\n if (!profileCalls || profileCalls.length === 0) {\n throw new Error('Could not find renderer events');\n }\n const entry = profileCalls[0];\n const cpuProfileNode =\n Samples.profilesInProcess.get(entry.pid)?.get(entry.tid)?.parsedProfile.nodeById(entry.nodeId);\n if (!cpuProfileNode) {\n throw new Error('Could not find CPU Profile Node');\n }\n const anonymousCall = threadAppenders[0].titleForEvent(entry);\n assert.strictEqual(anonymousCall, '(anonymous)');\n const originalName = cpuProfileNode.functionName;\n cpuProfileNode.setFunctionName('new-resolved-function-name');\n assert.strictEqual(threadAppenders[0].titleForEvent(entry), 'new-resolved-function-name');\n // Reset the value for future tests.\n cpuProfileNode.setFunctionName(originalName);\n });\n\n function getDefaultInfo() {\n const defaultInfo: Timeline.CompatibilityTracksAppender.PopoverInfo = {\n title: 'title',\n formattedTime: 'time',\n warningElements: [],\n additionalElements: [],\n url: null,\n };\n return defaultInfo;\n }\n\n it('shows self time only for events with self time above the threshold when hovered', async function() {\n const {threadAppenders, parsedTrace} = await renderThreadAppendersFromTrace(this, 'simple-js-program.json.gz');\n const events = parsedTrace.Renderer?.allTraceEntries;\n if (!events) {\n throw new Error('Could not find renderer events');\n }\n const infoForShortEvent = getDefaultInfo();\n threadAppenders[0].setPopoverInfo(events[0], infoForShortEvent);\n assert.strictEqual(infoForShortEvent.formattedTime, '0.27\\u00A0ms');\n\n const longTask = events.find(e => (e.dur || 0) > 1_000_000);\n if (!longTask) {\n throw new Error('Could not find long task');\n }\n const infoForLongEvent = getDefaultInfo();\n threadAppenders[0].setPopoverInfo(longTask, infoForLongEvent);\n assert.strictEqual(infoForLongEvent.formattedTime, '1.30\\u00A0s (self 47\\u00A0μs)');\n });\n\n it('shows the correct title for a ParseHTML event', async function() {\n const {threadAppenders, parsedTrace} = await renderThreadAppendersFromTrace(this, 'simple-js-program.json.gz');\n const events = parsedTrace.Renderer?.allTraceEntries;\n if (!events) {\n throw new Error('Could not find renderer events');\n }\n const infoForShortEvent = getDefaultInfo();\n threadAppenders[0].setPopoverInfo(events[0], infoForShortEvent);\n assert.strictEqual(infoForShortEvent.formattedTime, '0.27\\u00A0ms');\n\n const longTask = events.find(e => (e.dur || 0) > 1_000_000);\n if (!longTask) {\n throw new Error('Could not find long task');\n }\n const infoForLongEvent = getDefaultInfo();\n threadAppenders[0].setPopoverInfo(longTask, infoForLongEvent);\n assert.strictEqual(infoForLongEvent.formattedTime, '1.30\\u00A0s (self 47\\u00A0μs)');\n });\n\n it('shows the right time for a profile call when hovered', async function() {\n const {threadAppenders, parsedTrace} = await renderThreadAppendersFromTrace(this, 'simple-js-program.json.gz');\n const rendererHandler = parsedTrace.Renderer;\n if (!rendererHandler) {\n throw new Error('RendererHandler is undefined');\n }\n const [process] = rendererHandler.processes.values();\n const [thread] = process.threads.values();\n const profileCalls = thread.entries.filter(entry => Trace.Types.Events.isProfileCall(entry));\n\n if (!profileCalls) {\n throw new Error('Could not find renderer events');\n }\n\n const info = getDefaultInfo();\n threadAppenders[0].setPopoverInfo(profileCalls[0], info);\n assert.strictEqual(info.formattedTime, '15\\u00A0μs');\n });\n it('candy-stripes long tasks', async function() {\n const {parsedTrace, flameChartData, entryData} =\n await renderThreadAppendersFromTrace(this, 'simple-js-program.json.gz');\n const events = parsedTrace.Renderer?.allTraceEntries;\n if (!events) {\n throw new Error('Could not find renderer events');\n }\n const longTask = events.find(e => (e.dur || 0) > 1_000_000);\n if (!longTask) {\n throw new Error('Could not find long task');\n }\n const entryIndex = entryData.indexOf(longTask);\n const decorationsForEntry = flameChartData.entryDecorations[entryIndex];\n assert.deepEqual(decorationsForEntry, [\n {type: PerfUI.FlameChart.FlameChartDecorationType.WARNING_TRIANGLE},\n {\n type: PerfUI.FlameChart.FlameChartDecorationType.CANDY,\n startAtTime: Trace.Types.Timing.MicroSeconds(50_000),\n },\n ]);\n });\n\n it('does not candy-stripe tasks below the long task threshold', async function() {\n const {parsedTrace, flameChartData, entryData} =\n await renderThreadAppendersFromTrace(this, 'simple-js-program.json.gz');\n const events = parsedTrace.Renderer?.allTraceEntries;\n if (!events) {\n throw new Error('Could not find renderer events');\n }\n const entryIndex = entryData.indexOf(events[0]);\n const decorationsForEntry = flameChartData.entryDecorations[entryIndex];\n assert.isUndefined(decorationsForEntry);\n });\n\n it('does not append a track if there are no visible events on it', async function() {\n const {flameChartData} = await renderThreadAppendersFromTrace(this, 'one-second-interaction.json.gz');\n const expectedTrackNames = [\n 'Main — https://chromedevtools.github.io/performance-stories/long-interaction/index.html?x=40',\n 'Thread pool',\n // There are multiple ThreadPoolForegroundWorker threads present in\n // the trace, but only one of these has trace events we deem as\n // \"visible\".\n 'Thread pool worker 1',\n // This second \"worker\" is the ThreadPoolServiceThread. TODO: perhaps hide ThreadPoolServiceThread completely?\n 'Thread pool worker 2',\n ];\n assert.deepEqual(flameChartData.groups.map(g => g.name), expectedTrackNames);\n });\n\n describe('ignore listing', () => {\n let ignoreListManager: Bindings.IgnoreListManager.IgnoreListManager;\n beforeEach(() => {\n const targetManager = SDK.TargetManager.TargetManager.instance({forceNew: true});\n const workspace = Workspace.Workspace.WorkspaceImpl.instance({forceNew: true});\n const resourceMapping = new Bindings.ResourceMapping.ResourceMapping(targetManager, workspace);\n const debuggerWorkspaceBinding = Bindings.DebuggerWorkspaceBinding.DebuggerWorkspaceBinding.instance({\n forceNew: true,\n resourceMapping,\n targetManager,\n });\n ignoreListManager = Bindings.IgnoreListManager.IgnoreListManager.instance({\n forceNew: true,\n debuggerWorkspaceBinding,\n });\n });\n afterEach(() => {\n SDK.TargetManager.TargetManager.removeInstance();\n Workspace.Workspace.WorkspaceImpl.removeInstance();\n Bindings.DebuggerWorkspaceBinding.DebuggerWorkspaceBinding.removeInstance();\n Bindings.IgnoreListManager.IgnoreListManager.removeInstance();\n });\n it('removes entries from the data that match the ignored URL', async function() {\n const initialTimelineData = await renderThreadAppendersFromTrace(this, 'react-hello-world.json.gz');\n const initialFlamechartData = initialTimelineData.flameChartData;\n const eventCountBeforeIgnoreList = initialFlamechartData.entryStartTimes.length;\n const SCRIPT_TO_IGNORE =\n 'https://unpkg.com/react@18.2.0/umd/react.development.js' as Platform.DevToolsPath.UrlString;\n // Clear the data provider cache and add the React script to the ignore list.\n ignoreListManager.ignoreListURL(SCRIPT_TO_IGNORE);\n const finalTimelineData = await renderThreadAppendersFromTrace(this, 'react-hello-world.json.gz');\n const finalFlamechartData = finalTimelineData.flameChartData;\n const eventCountAfterIgnoreList = finalFlamechartData.entryStartTimes.length;\n // Ensure that the amount of events we show on the flame chart is less\n // than before, now we have added the React URL to the ignore list.\n assert.isBelow(eventCountAfterIgnoreList, eventCountBeforeIgnoreList);\n\n // // Clear the data provider cache and unignore the script again\n ignoreListManager.unIgnoreListURL(SCRIPT_TO_IGNORE);\n const finalTimelineData2 = await renderThreadAppendersFromTrace(this, 'react-hello-world.json.gz');\n const finalFlamechartData2 = finalTimelineData2.flameChartData;\n const eventCountAfterIgnoreList2 = finalFlamechartData2.entryStartTimes.length;\n // // Ensure that now we have un-ignored the URL that we get the full set of events again.\n assert.strictEqual(eventCountAfterIgnoreList2, eventCountBeforeIgnoreList);\n });\n\n it('appends a tree that contains ignore listed entries correctly', async function() {\n const SCRIPT_TO_IGNORE = 'https://some-framework/bundled.js' as Platform.DevToolsPath.UrlString;\n\n // Create the following hierarchy with profile calls. Events marked\n // with \\\\\\\\ represent ignored listed events.\n // |----------A-----------|\n // |\\\\\\\\\\B\\\\\\\\\\||----F----|\n // |\\\\C\\\\||\\D\\|\n // |--E--|\n //\n // Applying ignore listing in the appender, should yield the\n // following flame chart:\n // |----------A-----------|\n // |\\\\\\\\\\B\\\\\\\\||----F----|\n // |--E--|\n const callFrameA = makeProfileCall('A', 100, 200);\n const callFrameB = makeProfileCall('IgnoreListedB', 100, 100);\n callFrameB.callFrame.url = SCRIPT_TO_IGNORE;\n const callFrameC = makeProfileCall('IgnoreListedC', 100, 50);\n callFrameC.callFrame.url = SCRIPT_TO_IGNORE;\n const callFrameD = makeProfileCall('IgnoreListedD', 151, 49);\n callFrameD.callFrame.url = SCRIPT_TO_IGNORE;\n const callFrameE = makeProfileCall('E', 100, 25);\n const callFrameF = makeProfileCall('F', 200, 100);\n\n const allEntries = [callFrameA, callFrameB, callFrameC, callFrameE, callFrameD, callFrameF];\n const rendererData = makeRendererHandlerData(allEntries);\n const workersData: Trace.Handlers.ModelHandlers.Workers.WorkersData = {\n workerSessionIdEvents: [],\n workerIdByThread: new Map(),\n workerURLById: new Map(),\n };\n const warningsData: Trace.Handlers.ModelHandlers.Warnings.WarningsData = {\n perWarning: new Map(),\n perEvent: new Map(),\n };\n // This only includes data used in the thread appender\n const mockParsedTrace = {\n Renderer: rendererData,\n Workers: workersData,\n Warnings: warningsData,\n AuctionWorklets: {worklets: new Map()},\n Meta: {\n traceIsGeneric: false,\n },\n ExtensionTraceData: {entryToNode: new Map(), extensionMarkers: [], extensionTrackData: []},\n } as unknown as Trace.Handlers.Types.ParsedTrace;\n\n // Add the script to ignore list and then append the flamechart data\n ignoreListManager.ignoreListURL(SCRIPT_TO_IGNORE);\n const {entryData, flameChartData, threadAppenders} = renderThreadAppendersFromParsedData(mockParsedTrace);\n const entryDataNames = entryData.map(entry => {\n if (Trace.Types.Events.isProfileCall(entry)) {\n return entry.callFrame.functionName;\n }\n return entry.name;\n });\n\n assert.deepEqual(entryDataNames, ['A', 'IgnoreListedB', 'E', 'F']);\n assert.deepEqual(flameChartData.entryLevels, [0, 1, 2, 1]);\n assert.deepEqual(flameChartData.entryStartTimes, [0.1, 0.1, 0.1, 0.2]);\n assert.deepEqual(flameChartData.entryTotalTimes, [0.2, 0.1, 0.025, 0.1]);\n assert.strictEqual(threadAppenders.length, 1);\n assert.strictEqual(threadAppenders[0].titleForEvent(callFrameB), 'On ignore list (\\\\\\/bundled\\\\.js$)');\n });\n });\n describe('showAllEvents', () => {\n beforeEach(() => {\n const targetManager = SDK.TargetManager.TargetManager.instance({forceNew: true});\n const workspace = Workspace.Workspace.WorkspaceImpl.instance({forceNew: true});\n const resourceMapping = new Bindings.ResourceMapping.ResourceMapping(targetManager, workspace);\n const debuggerWorkspaceBinding = Bindings.DebuggerWorkspaceBinding.DebuggerWorkspaceBinding.instance({\n forceNew: true,\n resourceMapping,\n targetManager,\n });\n Bindings.IgnoreListManager.IgnoreListManager.instance({\n forceNew: true,\n debuggerWorkspaceBinding,\n });\n });\n afterEach(() => {\n SDK.TargetManager.TargetManager.removeInstance();\n Workspace.Workspace.WorkspaceImpl.removeInstance();\n Bindings.DebuggerWorkspaceBinding.DebuggerWorkspaceBinding.removeInstance();\n Bindings.IgnoreListManager.IgnoreListManager.removeInstance();\n });\n it('appends unknown events to the flame chart data only when the experiment is enabled', async function() {\n const fileName = 'react-hello-world.json.gz';\n const bizarreName = 'BackForwardCacheBufferLimitTracker::DidRemoveFrameOrWorkerFromBackForwardCache';\n // Look up a trace event with an name we are not tracking anywhere and make sure it's not\n // appended to the timeline data.\n const initialTimelineData = await renderThreadAppendersFromTrace(this, fileName);\n let unknownEventIndex = initialTimelineData.entryData.findIndex(entry => {\n const event = entry as Trace.Types.Events.Event;\n return event.name === bizarreName;\n });\n assert.strictEqual(unknownEventIndex, -1);\n\n // Now enable the experiment and make sure the event is appended to the timeline data this time\n Root.Runtime.experiments.enableForTest('timeline-show-all-events');\n const finalTimelineData = await renderThreadAppendersFromTrace(this, fileName);\n const finalFlamechartData = finalTimelineData.flameChartData;\n unknownEventIndex = finalTimelineData.entryData.findIndex(entry => {\n const event = entry as Trace.Types.Events.Event;\n return event.name === bizarreName;\n });\n assert.isAbove(unknownEventIndex, -1);\n assert.exists(finalFlamechartData.entryStartTimes);\n assert.exists(finalFlamechartData.entryTotalTimes);\n Root.Runtime.experiments.disableForTest('timeline-show-all-events');\n });\n });\n describe('AuctionWorklet threads', () => {\n // We have to set these up because the ThreadAppender includes logic for\n // ignoring events that relies on the IgnoreListManager.\n beforeEach(() => {\n const targetManager = SDK.TargetManager.TargetManager.instance({forceNew: true});\n const workspace = Workspace.Workspace.WorkspaceImpl.instance({forceNew: true});\n const resourceMapping = new Bindings.ResourceMapping.ResourceMapping(targetManager, workspace);\n const debuggerWorkspaceBinding = Bindings.DebuggerWorkspaceBinding.DebuggerWorkspaceBinding.instance({\n forceNew: true,\n resourceMapping,\n targetManager,\n });\n Bindings.IgnoreListManager.IgnoreListManager.instance({\n forceNew: true,\n debuggerWorkspaceBinding,\n });\n });\n\n afterEach(() => {\n SDK.TargetManager.TargetManager.removeInstance();\n Workspace.Workspace.WorkspaceImpl.removeInstance();\n Bindings.DebuggerWorkspaceBinding.DebuggerWorkspaceBinding.removeInstance();\n Bindings.IgnoreListManager.IgnoreListManager.removeInstance();\n });\n\n it('finds all the worklet threads', async function() {\n const {threadAppenders} = await renderThreadAppendersFromTrace(this, 'fenced-frame-fledge.json.gz');\n const workletAppenders = threadAppenders.filter(threadAppender => {\n return threadAppender.trackName().includes('Worklet');\n });\n assert.lengthOf(workletAppenders, 6);\n });\n\n it('sets the title correctly for an Auction Worklet service', async function() {\n const UTILITY_THREAD_PID = 776435 as Trace.Types.Events.ProcessID;\n const UTILITY_THREAD_TID = 1 as Trace.Types.Events.ThreadID;\n const {threadAppenders} = await renderThreadAppendersFromTrace(this, 'fenced-frame-fledge.json.gz');\n const appender = threadAppenders.find(threadAppender => {\n return threadAppender.processId() === UTILITY_THREAD_PID && threadAppender.threadId() === UTILITY_THREAD_TID;\n });\n if (!appender) {\n throw new Error('Could not find expected thread appender');\n }\n assert.strictEqual(appender.trackName(), 'Auction Worklet service — https://ssp-fledge-demo.glitch.me');\n });\n\n it('sets the title correctly for an Auction Worklet seller service', async function() {\n const SELLER_THREAD_PID = 776435 as Trace.Types.Events.ProcessID;\n const SELLER_THREAD_TID = 6 as Trace.Types.Events.ThreadID;\n const {threadAppenders} = await renderThreadAppendersFromTrace(this, 'fenced-frame-fledge.json.gz');\n const appender = threadAppenders.find(threadAppender => {\n return threadAppender.processId() === SELLER_THREAD_PID && threadAppender.threadId() === SELLER_THREAD_TID;\n });\n if (!appender) {\n throw new Error('Could not find expected thread appender');\n }\n assert.strictEqual(appender.trackName(), 'Seller Worklet — https://ssp-fledge-demo.glitch.me');\n });\n\n it('sets the title correctly for an Auction Worklet bidder service', async function() {\n const BIDDER_THREAD_PID = 776436 as Trace.Types.Events.ProcessID;\n const BIDDER_THREAD_TID = 6 as Trace.Types.Events.ThreadID;\n const {threadAppenders} = await renderThreadAppendersFromTrace(this, 'fenced-frame-fledge.json.gz');\n const appender = threadAppenders.find(threadAppender => {\n return threadAppender.processId() === BIDDER_THREAD_PID && threadAppender.threadId() === BIDDER_THREAD_TID;\n });\n if (!appender) {\n throw new Error('Could not find expected thread appender');\n }\n assert.strictEqual(appender.trackName(), 'Bidder Worklet — https://dsp-fledge-demo.glitch.me');\n });\n });\n});\n"]} \ No newline at end of file +{"version":3,"file":"ThreadAppender.test.js","sourceRoot":"","sources":["../../../../../../../front_end/panels/timeline/track_appenders/ThreadAppender.test.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAG7B,OAAO,KAAK,IAAI,MAAM,4BAA4B,CAAC;AACnD,OAAO,KAAK,GAAG,MAAM,0BAA0B,CAAC;AAChD,OAAO,KAAK,QAAQ,MAAM,sCAAsC,CAAC;AACjE,OAAO,KAAK,KAAK,MAAM,gCAAgC,CAAC;AACxD,OAAO,KAAK,SAAS,MAAM,wCAAwC,CAAC;AACpE,OAAO,EAAC,uBAAuB,EAAC,MAAM,wCAAwC,CAAC;AAC/E,OAAO,EACL,2BAA2B,IAAI,uBAAuB,EACtD,eAAe,EACf,iCAAiC,GAClC,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAAC,WAAW,EAAC,MAAM,iCAAiC,CAAC;AAC5D,OAAO,KAAK,MAAM,MAAM,kDAAkD,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eAAe,CAAC,IAAI,CAAC,cAAc,CAAC,EAAE;gBACrD,OAAO,cAAc,CAAC,SAAS,EAAE,KAAK,iBAAiB,IAAI,cAAc,CAAC,QAAQ,EAAE,KAAK,iBAAiB,CAAC;YAC7G,CAAC,CAAC,CAAC;YACH,IAAI,CAAC,QAAQ,EAAE,CAAC;gBACd,MAAM,IAAI,KAAK,CAAC,yCAAyC,CAAC,CAAC;YAC7D,CAAC;YACD,MAAM,CAAC,WAAW,CAAC,QAAQ,CAAC,SAAS,EAAE,EAAE,oDAAoD,CAAC,CAAC;QACjG,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["// Copyright 2023 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport type * as Platform from '../../../core/platform/platform.js';\nimport * as Root from '../../../core/root/root.js';\nimport * as SDK from '../../../core/sdk/sdk.js';\nimport * as Bindings from '../../../models/bindings/bindings.js';\nimport * as Trace from '../../../models/trace/trace.js';\nimport * as Workspace from '../../../models/workspace/workspace.js';\nimport {describeWithEnvironment} from '../../../testing/EnvironmentHelpers.js';\nimport {\n makeMockRendererHandlerData as makeRendererHandlerData,\n makeProfileCall,\n setupIgnoreListManagerEnvironment,\n} from '../../../testing/TraceHelpers.js';\nimport {TraceLoader} from '../../../testing/TraceLoader.js';\nimport * as PerfUI from '../../../ui/legacy/components/perf_ui/perf_ui.js';\nimport * as Timeline from '../timeline.js';\n\nfunction initTrackAppender(\n flameChartData: PerfUI.FlameChart.FlameChartTimelineData,\n parsedTrace: Trace.Handlers.Types.ParsedTrace,\n entryData: Trace.Types.Events.Event[],\n entryTypeByLevel: Timeline.TimelineFlameChartDataProvider.EntryType[],\n ): {\n threadAppenders: Timeline.ThreadAppender.ThreadAppender[],\n compatibilityTracksAppender: Timeline.CompatibilityTracksAppender.CompatibilityTracksAppender,\n} {\n setupIgnoreListManagerEnvironment();\n const compatibilityTracksAppender = new Timeline.CompatibilityTracksAppender.CompatibilityTracksAppender(\n flameChartData, parsedTrace, entryData, entryTypeByLevel);\n return {threadAppenders: compatibilityTracksAppender.threadAppenders(), compatibilityTracksAppender};\n}\n\nasync function renderThreadAppendersFromTrace(context: Mocha.Context|Mocha.Suite, trace: string):\n Promise> {\n const {parsedTrace} = await TraceLoader.traceEngine(context, trace);\n return renderThreadAppendersFromParsedData(parsedTrace);\n}\n\nfunction renderThreadAppendersFromParsedData(parsedTrace: Trace.Handlers.Types.ParsedTrace): {\n entryTypeByLevel: Timeline.TimelineFlameChartDataProvider.EntryType[],\n flameChartData: PerfUI.FlameChart.FlameChartTimelineData,\n threadAppenders: Timeline.ThreadAppender.ThreadAppender[],\n entryData: Trace.Types.Events.Event[],\n parsedTrace: Readonly,\n compatibilityTracksAppender: Timeline.CompatibilityTracksAppender.CompatibilityTracksAppender,\n} {\n const entryTypeByLevel: Timeline.TimelineFlameChartDataProvider.EntryType[] = [];\n const entryData: Trace.Types.Events.Event[] = [];\n const flameChartData = PerfUI.FlameChart.FlameChartTimelineData.createEmpty();\n const {threadAppenders, compatibilityTracksAppender} =\n initTrackAppender(flameChartData, parsedTrace, entryData, entryTypeByLevel);\n let level = 0;\n for (const appender of threadAppenders) {\n level = appender.appendTrackAtLevel(level);\n }\n\n return {\n entryTypeByLevel,\n flameChartData,\n compatibilityTracksAppender,\n parsedTrace,\n threadAppenders,\n entryData,\n };\n}\n\ndescribeWithEnvironment('ThreadAppender', function() {\n it('creates a thread appender for each thread in a trace', async function() {\n const {threadAppenders} = await renderThreadAppendersFromTrace(this, 'simple-js-program.json.gz');\n const expectedAppenderNames = [\n 'Thread',\n 'Thread',\n 'Thread',\n ];\n assert.deepEqual(threadAppenders.map(g => g.appenderName), expectedAppenderNames);\n });\n\n it('renders tracks for threads in correct order', async function() {\n const {flameChartData} = await renderThreadAppendersFromTrace(this, 'multiple-navigations-with-iframes.json.gz');\n assert.strictEqual(flameChartData.groups[0].name, 'Main — http://localhost:5000/');\n assert.strictEqual(flameChartData.groups[1].name, 'Frame — https://www.example.com/');\n });\n\n it('renders tracks for threads in correct order when a process url is about:blank', async function() {\n const {flameChartData} = await renderThreadAppendersFromTrace(this, 'about-blank-first.json.gz');\n const groupNames = flameChartData.groups.map(g => g.name.replace(/(new-tab-page\\/).*/, '$1'));\n assert.deepEqual(groupNames.slice(0, 3), [\n 'Frame — chrome-untrusted://new-tab-page/',\n 'Main — chrome://new-tab-page/',\n 'Main — about:blank',\n ]);\n });\n\n it('marks all levels used by the track with the TrackAppender type', async function() {\n const {entryTypeByLevel} = await renderThreadAppendersFromTrace(this, 'simple-js-program.json.gz');\n // This includes all tracks rendered by the ThreadAppender.\n const execptedLevelTypes = [\n Timeline.TimelineFlameChartDataProvider.EntryType.TRACK_APPENDER,\n Timeline.TimelineFlameChartDataProvider.EntryType.TRACK_APPENDER,\n Timeline.TimelineFlameChartDataProvider.EntryType.TRACK_APPENDER,\n Timeline.TimelineFlameChartDataProvider.EntryType.TRACK_APPENDER,\n Timeline.TimelineFlameChartDataProvider.EntryType.TRACK_APPENDER,\n Timeline.TimelineFlameChartDataProvider.EntryType.TRACK_APPENDER,\n Timeline.TimelineFlameChartDataProvider.EntryType.TRACK_APPENDER,\n Timeline.TimelineFlameChartDataProvider.EntryType.TRACK_APPENDER,\n Timeline.TimelineFlameChartDataProvider.EntryType.TRACK_APPENDER,\n Timeline.TimelineFlameChartDataProvider.EntryType.TRACK_APPENDER,\n ];\n assert.deepEqual(entryTypeByLevel, execptedLevelTypes);\n });\n\n it('creates a flamechart groups for track headers and titles', async function() {\n const {flameChartData} = await renderThreadAppendersFromTrace(this, 'cls-single-frame.json.gz');\n const expectedTrackNames = [\n 'Main — https://output.jsbin.com/zajamil/quiet',\n 'Raster',\n 'Rasterizer thread 1',\n 'Rasterizer thread 2',\n 'Thread pool',\n 'Thread pool worker 1',\n ];\n assert.deepEqual(flameChartData.groups.map(g => g.name), expectedTrackNames);\n });\n\n it('builds flamechart groups for nested tracks correctly', async function() {\n const {flameChartData} = await renderThreadAppendersFromTrace(this, 'cls-single-frame.json.gz');\n // This group corresponds to the header that wraps the raster tracks\n // together. It isn't selectable and isn't nested\n assert.strictEqual(flameChartData.groups[1].name, 'Raster');\n assert.isFalse(flameChartData.groups[1].selectable);\n assert.strictEqual(flameChartData.groups[1].style.nestingLevel, 0);\n\n // These groups correspond to the raster tracks titles, or the\n // individual raster tracks themselves. They are selectable and\n // nested\n assert.strictEqual(flameChartData.groups[2].name, 'Rasterizer thread 1');\n assert.isTrue(flameChartData.groups[2].selectable);\n assert.strictEqual(flameChartData.groups[2].style.nestingLevel, 1);\n\n assert.strictEqual(flameChartData.groups[3].name, 'Rasterizer thread 2');\n assert.isTrue(flameChartData.groups[3].selectable);\n assert.strictEqual(flameChartData.groups[3].style.nestingLevel, 1);\n });\n\n it('assigns correct names to multiple types of threads', async function() {\n const {flameChartData} = await renderThreadAppendersFromTrace(this, 'simple-js-program.json.gz');\n const expectedTrackNames = [\n 'Main — https://www.google.com',\n 'Thread pool',\n 'Thread pool worker 1',\n 'Thread pool worker 2',\n ];\n assert.deepEqual(flameChartData.groups.map(g => g.name), expectedTrackNames);\n });\n\n it('adds thread IDs onto tracks when the trace is generic', async () => {\n const {flameChartData} = await renderThreadAppendersFromTrace(this, 'generic-about-tracing.json.gz');\n // This trace has a lot of tracks, so just test one.\n assert.isTrue(flameChartData.groups.map(g => g.name)\n .includes('CrBrowserMain (1213787)' as Platform.UIString.LocalizedString));\n });\n\n it('assigns the right color for events when the trace is generic', async () => {\n const {threadAppenders, parsedTrace} = await renderThreadAppendersFromTrace(this, 'generic-about-tracing.json.gz');\n const event = parsedTrace.Renderer.allTraceEntries.find(entry => {\n return entry.name === 'ThreadControllerImpl::RunTask';\n });\n if (!event) {\n throw new Error('Could not find event.');\n }\n assert.strictEqual(threadAppenders[0].colorForEvent(event), 'hsl(278, 40%, 70%)');\n });\n\n it('assigns correct names to worker threads', async function() {\n const {flameChartData} = await renderThreadAppendersFromTrace(this, 'two-workers.json.gz');\n const expectedTrackNames = [\n 'Main — https://chromedevtools.github.io/performance-stories/two-workers/index.html',\n 'Worker — https://chromedevtools.github.io/performance-stories/two-workers/fib-worker.js',\n 'Worker — https://chromedevtools.github.io/performance-stories/two-workers/fib-worker.js',\n 'Thread pool',\n 'Thread pool worker 1',\n 'Thread pool worker 2',\n ];\n assert.deepEqual(flameChartData.groups.map(g => g.name), expectedTrackNames);\n });\n\n it('returns the correct title for a renderer event', async function() {\n const {threadAppenders, parsedTrace} = await renderThreadAppendersFromTrace(this, 'simple-js-program.json.gz');\n const events = parsedTrace.Renderer?.allTraceEntries;\n if (!events) {\n throw new Error('Could not find renderer events');\n }\n const title = threadAppenders[0].titleForEvent(events[0]);\n assert.strictEqual(title, 'Task');\n });\n\n it('adds the type for EventDispatch events to the title', async function() {\n const {threadAppenders, parsedTrace} = await renderThreadAppendersFromTrace(this, 'one-second-interaction.json.gz');\n const events = parsedTrace.Renderer?.allTraceEntries;\n if (!events) {\n throw new Error('Could not find renderer events');\n }\n const clickEvent = events.find(event => {\n return Trace.Types.Events.isDispatch(event) && event.args.data.type === 'click';\n });\n if (!clickEvent) {\n throw new Error('Could not find expected click event');\n }\n const title = threadAppenders[0].titleForEvent(clickEvent);\n assert.strictEqual(title, 'Event: click');\n });\n\n it('returns the correct title for a profile call', async function() {\n const {threadAppenders, parsedTrace} = await renderThreadAppendersFromTrace(this, 'simple-js-program.json.gz');\n const rendererHandler = parsedTrace.Renderer;\n if (!rendererHandler) {\n throw new Error('RendererHandler is undefined');\n }\n const [process] = rendererHandler.processes.values();\n const [thread] = process.threads.values();\n const profileCalls = thread.entries.filter(entry => Trace.Types.Events.isProfileCall(entry));\n\n if (!profileCalls) {\n throw new Error('Could not find renderer events');\n }\n const anonymousCall = threadAppenders[0].titleForEvent(profileCalls[0]);\n assert.strictEqual(anonymousCall, '(anonymous)');\n const n = threadAppenders[0].titleForEvent(profileCalls[7]);\n assert.strictEqual(n, 'n');\n });\n\n it('will use the function name from the CPUProfile if it has been set', async function() {\n const {threadAppenders, parsedTrace} = await renderThreadAppendersFromTrace(this, 'simple-js-program.json.gz');\n const {Renderer, Samples} = parsedTrace;\n const [process] = Renderer.processes.values();\n const [thread] = process.threads.values();\n const profileCalls = thread.entries.filter(Trace.Types.Events.isProfileCall);\n\n if (!profileCalls || profileCalls.length === 0) {\n throw new Error('Could not find renderer events');\n }\n const entry = profileCalls[0];\n const cpuProfileNode =\n Samples.profilesInProcess.get(entry.pid)?.get(entry.tid)?.parsedProfile.nodeById(entry.nodeId);\n if (!cpuProfileNode) {\n throw new Error('Could not find CPU Profile Node');\n }\n const anonymousCall = threadAppenders[0].titleForEvent(entry);\n assert.strictEqual(anonymousCall, '(anonymous)');\n const originalName = cpuProfileNode.functionName;\n cpuProfileNode.setFunctionName('new-resolved-function-name');\n assert.strictEqual(threadAppenders[0].titleForEvent(entry), 'new-resolved-function-name');\n // Reset the value for future tests.\n cpuProfileNode.setFunctionName(originalName);\n });\n\n function getDefaultInfo() {\n const defaultInfo: Timeline.CompatibilityTracksAppender.PopoverInfo = {\n title: 'title',\n formattedTime: 'time',\n warningElements: [],\n additionalElements: [],\n url: null,\n };\n return defaultInfo;\n }\n\n it('shows self time only for events with self time above the threshold when hovered', async function() {\n const {threadAppenders, parsedTrace} = await renderThreadAppendersFromTrace(this, 'simple-js-program.json.gz');\n const events = parsedTrace.Renderer?.allTraceEntries;\n if (!events) {\n throw new Error('Could not find renderer events');\n }\n const infoForShortEvent = getDefaultInfo();\n threadAppenders[0].setPopoverInfo(events[0], infoForShortEvent);\n assert.strictEqual(infoForShortEvent.formattedTime, '0.27\\u00A0ms');\n\n const longTask = events.find(e => (e.dur || 0) > 1_000_000);\n if (!longTask) {\n throw new Error('Could not find long task');\n }\n const infoForLongEvent = getDefaultInfo();\n threadAppenders[0].setPopoverInfo(longTask, infoForLongEvent);\n assert.strictEqual(infoForLongEvent.formattedTime, '1.30\\u00A0s (self 47\\u00A0μs)');\n });\n\n it('shows the correct title for a ParseHTML event', async function() {\n const {threadAppenders, parsedTrace} = await renderThreadAppendersFromTrace(this, 'simple-js-program.json.gz');\n const events = parsedTrace.Renderer?.allTraceEntries;\n if (!events) {\n throw new Error('Could not find renderer events');\n }\n const infoForShortEvent = getDefaultInfo();\n threadAppenders[0].setPopoverInfo(events[0], infoForShortEvent);\n assert.strictEqual(infoForShortEvent.formattedTime, '0.27\\u00A0ms');\n\n const longTask = events.find(e => (e.dur || 0) > 1_000_000);\n if (!longTask) {\n throw new Error('Could not find long task');\n }\n const infoForLongEvent = getDefaultInfo();\n threadAppenders[0].setPopoverInfo(longTask, infoForLongEvent);\n assert.strictEqual(infoForLongEvent.formattedTime, '1.30\\u00A0s (self 47\\u00A0μs)');\n });\n\n it('shows the right time for a profile call when hovered', async function() {\n const {threadAppenders, parsedTrace} = await renderThreadAppendersFromTrace(this, 'simple-js-program.json.gz');\n const rendererHandler = parsedTrace.Renderer;\n if (!rendererHandler) {\n throw new Error('RendererHandler is undefined');\n }\n const [process] = rendererHandler.processes.values();\n const [thread] = process.threads.values();\n const profileCalls = thread.entries.filter(entry => Trace.Types.Events.isProfileCall(entry));\n\n if (!profileCalls) {\n throw new Error('Could not find renderer events');\n }\n\n const info = getDefaultInfo();\n threadAppenders[0].setPopoverInfo(profileCalls[0], info);\n assert.strictEqual(info.formattedTime, '15\\u00A0μs');\n });\n it('candy-stripes long tasks', async function() {\n const {parsedTrace, flameChartData, entryData} =\n await renderThreadAppendersFromTrace(this, 'simple-js-program.json.gz');\n const events = parsedTrace.Renderer?.allTraceEntries;\n if (!events) {\n throw new Error('Could not find renderer events');\n }\n const longTask = events.find(e => (e.dur || 0) > 1_000_000);\n if (!longTask) {\n throw new Error('Could not find long task');\n }\n const entryIndex = entryData.indexOf(longTask);\n const decorationsForEntry = flameChartData.entryDecorations[entryIndex];\n assert.deepEqual(decorationsForEntry, [\n {type: PerfUI.FlameChart.FlameChartDecorationType.WARNING_TRIANGLE},\n {\n type: PerfUI.FlameChart.FlameChartDecorationType.CANDY,\n startAtTime: Trace.Types.Timing.MicroSeconds(50_000),\n },\n ]);\n });\n\n it('does not candy-stripe tasks below the long task threshold', async function() {\n const {parsedTrace, flameChartData, entryData} =\n await renderThreadAppendersFromTrace(this, 'simple-js-program.json.gz');\n const events = parsedTrace.Renderer?.allTraceEntries;\n if (!events) {\n throw new Error('Could not find renderer events');\n }\n const entryIndex = entryData.indexOf(events[0]);\n const decorationsForEntry = flameChartData.entryDecorations[entryIndex];\n assert.isUndefined(decorationsForEntry);\n });\n\n it('does not append a track if there are no visible events on it', async function() {\n const {flameChartData} = await renderThreadAppendersFromTrace(this, 'one-second-interaction.json.gz');\n const expectedTrackNames = [\n 'Main — https://chromedevtools.github.io/performance-stories/long-interaction/index.html?x=40',\n 'Thread pool',\n // There are multiple ThreadPoolForegroundWorker threads present in\n // the trace, but only one of these has trace events we deem as\n // \"visible\".\n 'Thread pool worker 1',\n // This second \"worker\" is the ThreadPoolServiceThread. TODO: perhaps hide ThreadPoolServiceThread completely?\n 'Thread pool worker 2',\n ];\n assert.deepEqual(flameChartData.groups.map(g => g.name), expectedTrackNames);\n });\n\n describe('ignore listing', () => {\n let ignoreListManager: Bindings.IgnoreListManager.IgnoreListManager;\n beforeEach(() => {\n const targetManager = SDK.TargetManager.TargetManager.instance({forceNew: true});\n const workspace = Workspace.Workspace.WorkspaceImpl.instance({forceNew: true});\n const resourceMapping = new Bindings.ResourceMapping.ResourceMapping(targetManager, workspace);\n const debuggerWorkspaceBinding = Bindings.DebuggerWorkspaceBinding.DebuggerWorkspaceBinding.instance({\n forceNew: true,\n resourceMapping,\n targetManager,\n });\n ignoreListManager = Bindings.IgnoreListManager.IgnoreListManager.instance({\n forceNew: true,\n debuggerWorkspaceBinding,\n });\n });\n afterEach(() => {\n SDK.TargetManager.TargetManager.removeInstance();\n Workspace.Workspace.WorkspaceImpl.removeInstance();\n Bindings.DebuggerWorkspaceBinding.DebuggerWorkspaceBinding.removeInstance();\n Bindings.IgnoreListManager.IgnoreListManager.removeInstance();\n });\n it('removes entries from the data that match the ignored URL', async function() {\n const initialTimelineData = await renderThreadAppendersFromTrace(this, 'react-hello-world.json.gz');\n const initialFlamechartData = initialTimelineData.flameChartData;\n const eventCountBeforeIgnoreList = initialFlamechartData.entryStartTimes.length;\n const SCRIPT_TO_IGNORE =\n 'https://unpkg.com/react@18.2.0/umd/react.development.js' as Platform.DevToolsPath.UrlString;\n // Clear the data provider cache and add the React script to the ignore list.\n ignoreListManager.ignoreListURL(SCRIPT_TO_IGNORE);\n const finalTimelineData = await renderThreadAppendersFromTrace(this, 'react-hello-world.json.gz');\n const finalFlamechartData = finalTimelineData.flameChartData;\n const eventCountAfterIgnoreList = finalFlamechartData.entryStartTimes.length;\n // Ensure that the amount of events we show on the flame chart is less\n // than before, now we have added the React URL to the ignore list.\n assert.isBelow(eventCountAfterIgnoreList, eventCountBeforeIgnoreList);\n\n // // Clear the data provider cache and unignore the script again\n ignoreListManager.unIgnoreListURL(SCRIPT_TO_IGNORE);\n const finalTimelineData2 = await renderThreadAppendersFromTrace(this, 'react-hello-world.json.gz');\n const finalFlamechartData2 = finalTimelineData2.flameChartData;\n const eventCountAfterIgnoreList2 = finalFlamechartData2.entryStartTimes.length;\n // // Ensure that now we have un-ignored the URL that we get the full set of events again.\n assert.strictEqual(eventCountAfterIgnoreList2, eventCountBeforeIgnoreList);\n });\n\n it('appends a tree that contains ignore listed entries correctly', async function() {\n const SCRIPT_TO_IGNORE = 'https://some-framework/bundled.js' as Platform.DevToolsPath.UrlString;\n\n // Create the following hierarchy with profile calls. Events marked\n // with \\\\\\\\ represent ignored listed events.\n // |----------A-----------|\n // |\\\\\\\\\\B\\\\\\\\\\||----F----|\n // |\\\\C\\\\||\\D\\|\n // |--E--|\n //\n // Applying ignore listing in the appender, should yield the\n // following flame chart:\n // |----------A-----------|\n // |\\\\\\\\\\B\\\\\\\\||----F----|\n // |--E--|\n const callFrameA = makeProfileCall('A', 100, 200);\n const callFrameB = makeProfileCall('IgnoreListedB', 100, 100);\n callFrameB.callFrame.url = SCRIPT_TO_IGNORE;\n const callFrameC = makeProfileCall('IgnoreListedC', 100, 50);\n callFrameC.callFrame.url = SCRIPT_TO_IGNORE;\n const callFrameD = makeProfileCall('IgnoreListedD', 151, 49);\n callFrameD.callFrame.url = SCRIPT_TO_IGNORE;\n const callFrameE = makeProfileCall('E', 100, 25);\n const callFrameF = makeProfileCall('F', 200, 100);\n\n const allEntries = [callFrameA, callFrameB, callFrameC, callFrameE, callFrameD, callFrameF];\n const rendererData = makeRendererHandlerData(allEntries);\n const workersData: Trace.Handlers.ModelHandlers.Workers.WorkersData = {\n workerSessionIdEvents: [],\n workerIdByThread: new Map(),\n workerURLById: new Map(),\n };\n const warningsData: Trace.Handlers.ModelHandlers.Warnings.WarningsData = {\n perWarning: new Map(),\n perEvent: new Map(),\n };\n // This only includes data used in the thread appender\n const mockParsedTrace = {\n Renderer: rendererData,\n Workers: workersData,\n Warnings: warningsData,\n AuctionWorklets: {worklets: new Map()},\n Meta: {\n traceIsGeneric: false,\n },\n ExtensionTraceData: {entryToNode: new Map(), extensionMarkers: [], extensionTrackData: []},\n } as unknown as Trace.Handlers.Types.ParsedTrace;\n\n // Add the script to ignore list and then append the flamechart data\n ignoreListManager.ignoreListURL(SCRIPT_TO_IGNORE);\n const {entryData, flameChartData, threadAppenders} = renderThreadAppendersFromParsedData(mockParsedTrace);\n const entryDataNames = entryData.map(entry => {\n if (Trace.Types.Events.isProfileCall(entry)) {\n return entry.callFrame.functionName;\n }\n return entry.name;\n });\n\n assert.deepEqual(entryDataNames, ['A', 'IgnoreListedB', 'E', 'F']);\n assert.deepEqual(flameChartData.entryLevels, [0, 1, 2, 1]);\n assert.deepEqual(flameChartData.entryStartTimes, [0.1, 0.1, 0.1, 0.2]);\n assert.deepEqual(flameChartData.entryTotalTimes, [0.2, 0.1, 0.025, 0.1]);\n assert.lengthOf(threadAppenders, 1);\n assert.strictEqual(threadAppenders[0].titleForEvent(callFrameB), 'On ignore list (\\\\\\/bundled\\\\.js$)');\n });\n });\n describe('showAllEvents', () => {\n beforeEach(() => {\n const targetManager = SDK.TargetManager.TargetManager.instance({forceNew: true});\n const workspace = Workspace.Workspace.WorkspaceImpl.instance({forceNew: true});\n const resourceMapping = new Bindings.ResourceMapping.ResourceMapping(targetManager, workspace);\n const debuggerWorkspaceBinding = Bindings.DebuggerWorkspaceBinding.DebuggerWorkspaceBinding.instance({\n forceNew: true,\n resourceMapping,\n targetManager,\n });\n Bindings.IgnoreListManager.IgnoreListManager.instance({\n forceNew: true,\n debuggerWorkspaceBinding,\n });\n });\n afterEach(() => {\n SDK.TargetManager.TargetManager.removeInstance();\n Workspace.Workspace.WorkspaceImpl.removeInstance();\n Bindings.DebuggerWorkspaceBinding.DebuggerWorkspaceBinding.removeInstance();\n Bindings.IgnoreListManager.IgnoreListManager.removeInstance();\n });\n it('appends unknown events to the flame chart data only when the experiment is enabled', async function() {\n const fileName = 'react-hello-world.json.gz';\n const bizarreName = 'BackForwardCacheBufferLimitTracker::DidRemoveFrameOrWorkerFromBackForwardCache';\n // Look up a trace event with an name we are not tracking anywhere and make sure it's not\n // appended to the timeline data.\n const initialTimelineData = await renderThreadAppendersFromTrace(this, fileName);\n let unknownEventIndex = initialTimelineData.entryData.findIndex(entry => {\n const event = entry as Trace.Types.Events.Event;\n return event.name === bizarreName;\n });\n assert.strictEqual(unknownEventIndex, -1);\n\n // Now enable the experiment and make sure the event is appended to the timeline data this time\n Root.Runtime.experiments.enableForTest('timeline-show-all-events');\n const finalTimelineData = await renderThreadAppendersFromTrace(this, fileName);\n const finalFlamechartData = finalTimelineData.flameChartData;\n unknownEventIndex = finalTimelineData.entryData.findIndex(entry => {\n const event = entry as Trace.Types.Events.Event;\n return event.name === bizarreName;\n });\n assert.isAbove(unknownEventIndex, -1);\n assert.exists(finalFlamechartData.entryStartTimes);\n assert.exists(finalFlamechartData.entryTotalTimes);\n Root.Runtime.experiments.disableForTest('timeline-show-all-events');\n });\n });\n describe('AuctionWorklet threads', () => {\n // We have to set these up because the ThreadAppender includes logic for\n // ignoring events that relies on the IgnoreListManager.\n beforeEach(() => {\n const targetManager = SDK.TargetManager.TargetManager.instance({forceNew: true});\n const workspace = Workspace.Workspace.WorkspaceImpl.instance({forceNew: true});\n const resourceMapping = new Bindings.ResourceMapping.ResourceMapping(targetManager, workspace);\n const debuggerWorkspaceBinding = Bindings.DebuggerWorkspaceBinding.DebuggerWorkspaceBinding.instance({\n forceNew: true,\n resourceMapping,\n targetManager,\n });\n Bindings.IgnoreListManager.IgnoreListManager.instance({\n forceNew: true,\n debuggerWorkspaceBinding,\n });\n });\n\n afterEach(() => {\n SDK.TargetManager.TargetManager.removeInstance();\n Workspace.Workspace.WorkspaceImpl.removeInstance();\n Bindings.DebuggerWorkspaceBinding.DebuggerWorkspaceBinding.removeInstance();\n Bindings.IgnoreListManager.IgnoreListManager.removeInstance();\n });\n\n it('finds all the worklet threads', async function() {\n const {threadAppenders} = await renderThreadAppendersFromTrace(this, 'fenced-frame-fledge.json.gz');\n const workletAppenders = threadAppenders.filter(threadAppender => {\n return threadAppender.trackName().includes('Worklet');\n });\n assert.lengthOf(workletAppenders, 6);\n });\n\n it('sets the title correctly for an Auction Worklet service', async function() {\n const UTILITY_THREAD_PID = 776435 as Trace.Types.Events.ProcessID;\n const UTILITY_THREAD_TID = 1 as Trace.Types.Events.ThreadID;\n const {threadAppenders} = await renderThreadAppendersFromTrace(this, 'fenced-frame-fledge.json.gz');\n const appender = threadAppenders.find(threadAppender => {\n return threadAppender.processId() === UTILITY_THREAD_PID && threadAppender.threadId() === UTILITY_THREAD_TID;\n });\n if (!appender) {\n throw new Error('Could not find expected thread appender');\n }\n assert.strictEqual(appender.trackName(), 'Auction Worklet service — https://ssp-fledge-demo.glitch.me');\n });\n\n it('sets the title correctly for an Auction Worklet seller service', async function() {\n const SELLER_THREAD_PID = 776435 as Trace.Types.Events.ProcessID;\n const SELLER_THREAD_TID = 6 as Trace.Types.Events.ThreadID;\n const {threadAppenders} = await renderThreadAppendersFromTrace(this, 'fenced-frame-fledge.json.gz');\n const appender = threadAppenders.find(threadAppender => {\n return threadAppender.processId() === SELLER_THREAD_PID && threadAppender.threadId() === SELLER_THREAD_TID;\n });\n if (!appender) {\n throw new Error('Could not find expected thread appender');\n }\n assert.strictEqual(appender.trackName(), 'Seller Worklet — https://ssp-fledge-demo.glitch.me');\n });\n\n it('sets the title correctly for an Auction Worklet bidder service', async function() {\n const BIDDER_THREAD_PID = 776436 as Trace.Types.Events.ProcessID;\n const BIDDER_THREAD_TID = 6 as Trace.Types.Events.ThreadID;\n const {threadAppenders} = await renderThreadAppendersFromTrace(this, 'fenced-frame-fledge.json.gz');\n const appender = threadAppenders.find(threadAppender => {\n return threadAppender.processId() === BIDDER_THREAD_PID && threadAppender.threadId() === BIDDER_THREAD_TID;\n });\n if (!appender) {\n throw new Error('Could not find expected thread appender');\n }\n assert.strictEqual(appender.trackName(), 'Bidder Worklet — https://dsp-fledge-demo.glitch.me');\n });\n });\n});\n"]} \ No newline at end of file diff --git a/public/panels/timeline/utils/AICallTree.test.js b/public/panels/timeline/utils/AICallTree.test.js index f4e0f01f3..bc7fb6649 100644 --- a/public/panels/timeline/utils/AICallTree.test.js +++ b/public/panels/timeline/utils/AICallTree.test.js @@ -132,34 +132,34 @@ describe('AITreeFilter', () => { it('always includes the selected event', () => { const selectedEvent = makeEvent('selected', 0, 100); const filter = new Utils.AICallTree.AITreeFilter(selectedEvent); - assert.strictEqual(filter.accept(selectedEvent), true); + assert.isTrue(filter.accept(selectedEvent)); }); it('includes events that are long enough', () => { const selectedEvent = makeEvent('selected', 0, 100); const filter = new Utils.AICallTree.AITreeFilter(selectedEvent); - assert.strictEqual(filter.accept(makeEvent('short', 0, 1)), true); - assert.strictEqual(filter.accept(makeEvent('short', 0, 0.6)), true); - assert.strictEqual(filter.accept(makeEvent('long', 0, 101)), true); - assert.strictEqual(filter.accept(makeEvent('long', 0, 200)), true); - assert.strictEqual(filter.accept(makeEvent('long', 0, 1000)), true); + assert.isTrue(filter.accept(makeEvent('short', 0, 1))); + assert.isTrue(filter.accept(makeEvent('short', 0, 0.6))); + assert.isTrue(filter.accept(makeEvent('long', 0, 101))); + assert.isTrue(filter.accept(makeEvent('long', 0, 200))); + assert.isTrue(filter.accept(makeEvent('long', 0, 1000))); }); it('excludes events that are too short', () => { const selectedEvent = makeEvent('selected', 0, 100); const filter = new Utils.AICallTree.AITreeFilter(selectedEvent); - assert.strictEqual(filter.accept(makeEvent('short', 0, 0)), false); - assert.strictEqual(filter.accept(makeEvent('short', 0, 0.1)), false); - assert.strictEqual(filter.accept(makeEvent('short', 0, 0.4)), false); + assert.isFalse(filter.accept(makeEvent('short', 0, 0))); + assert.isFalse(filter.accept(makeEvent('short', 0, 0.1))); + assert.isFalse(filter.accept(makeEvent('short', 0, 0.4))); }); it('excludes COMPILE_CODE nodes if non-selected', () => { const selectedEvent = makeEvent('selected', 0, 100); const compileCodeEvent = makeEvent("V8.CompileCode" /* Trace.Types.Events.Name.COMPILE_CODE */, 0, 100); const filter = new Utils.AICallTree.AITreeFilter(selectedEvent); - assert.strictEqual(filter.accept(compileCodeEvent), false); + assert.isFalse(filter.accept(compileCodeEvent)); }); it('includes COMPILE_CODE nodes if selected', () => { const selectedEvent = makeEvent("V8.CompileCode" /* Trace.Types.Events.Name.COMPILE_CODE */, 0, 100); const filter = new Utils.AICallTree.AITreeFilter(selectedEvent); - assert.strictEqual(filter.accept(selectedEvent), true); + assert.isTrue(filter.accept(selectedEvent)); }); }); //# sourceMappingURL=AICallTree.test.js.map \ No newline at end of file diff --git a/public/panels/timeline/utils/AICallTree.test.js.map b/public/panels/timeline/utils/AICallTree.test.js.map index 55ece51f9..2e5dd6a94 100644 --- a/public/panels/timeline/utils/AICallTree.test.js.map +++ b/public/panels/timeline/utils/AICallTree.test.js.map @@ -1 +1 @@ -{"version":3,"file":"AICallTree.test.js","sourceRoot":"","sources":["../../../../../../../front_end/panels/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AC,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,OAAO,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC;QACnE,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,OAAO,EAAE,CAAC,EAAE,GAAG,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC;QACrE,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,OAAO,EAAE,CAAC,EAAE,GAAG,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC;IACvE,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,6CAA6C,EAAE,GAAG,EAAE;QACrD,MAAM,aAAa,GAAG,SAAS,CAAC,UAAU,EAAE,CAAC,EAAE,GAAG,CAAC,CAAC;QACpD,MAAM,gBAAgB,GAAG,SAAS,8DAAuC,CAAC,EAAE,GAAG,CAAC,CAAC;QACjF,MAAM,MAAM,GAAG,IAAI,KAAK,CAAC,UAAU,CAAC,YAAY,CAAC,aAAa,CAAC,CAAC;QAChE,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,MAAM,CAAC,gBAAgB,CAAC,EAAE,KAAK,CAAC,CAAC;IAC7D,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,yCAAyC,EAAE,GAAG,EAAE;QACjD,MAAM,aAAa,GAAG,SAAS,8DAAuC,CAAC,EAAE,GAAG,CAAC,CAAC;QAC9E,MAAM,MAAM,GAAG,IAAI,KAAK,CAAC,UAAU,CAAC,YAAY,CAAC,aAAa,CAAC,CAAC;QAChE,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,MAAM,CAAC,aAAa,CAAC,EAAE,IAAI,CAAC,CAAC;IACzD,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["// Copyright 2024 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport * as Trace from '../../../models/trace/trace.js';\nimport {describeWithEnvironment} from '../../../testing/EnvironmentHelpers.js';\nimport {TraceLoader} from '../../../testing/TraceLoader.js';\n\nimport * as Utils from './utils.js';\n\ndescribeWithEnvironment('AICallTree', () => {\n it('serializes a simple tree', async function() {\n const {parsedTrace} = await TraceLoader.traceEngine(this, 'web-dev-outermost-frames.json.gz');\n const mainEvents = parsedTrace.Renderer.allTraceEntries;\n // A function '_ds.q.ns'. Has a very small tree by default.\n const selectedEvent = mainEvents.find(event => event.ts === 465457308823);\n if (!selectedEvent) {\n throw new Error('Could not find expected event.');\n }\n const callTree = Utils.AICallTree.AICallTree.from(selectedEvent, mainEvents, parsedTrace);\n const expectedData = '\\n' +\n `\n\n# All URL #s:\n\n * 0: https://www.gstatic.com/devrel-devsite/prod/vafe2e13ca17bb026e70df42a2ead1c8192750e86a12923a88eda839025dabf95/js/devsite_app_module.js\n\n# Call tree:\n\nNode: 1 – Task\ndur: 0.2\nChildren:\n * 2 – Timer fired\n\nNode: 2 – Timer fired\ndur: 0.2\nChildren:\n * 3 – Function call\n\nNode: 3 – Function call\ndur: 0.2\nURL #: 0\nChildren:\n * 4 – _ds.q.ns\n\nNode: 4 – _ds.q.ns\nSelected: true\ndur: 0.2\nURL #: 0\nChildren:\n * 5 – clearTimeout\n\nNode: 5 – clearTimeout\ndur: 0.2\nself: 0\nChildren:\n * 6 – Recalculate style\n\nNode: 6 – Recalculate style\ndur: 0.2\nself: 0.2\n`.trim();\n assert.strictEqual(callTree.serialize(), expectedData);\n });\n\n it('serializes a tree with lots of recursion', async function() {\n const {parsedTrace} = await TraceLoader.traceEngine(this, 'one-second-interaction.json.gz');\n const mainEvents = parsedTrace.Renderer.allTraceEntries;\n const selectedEvent = mainEvents.find(event => event.ts === 141251951589);\n if (!selectedEvent) {\n throw new Error('Could not find expected event.');\n }\n const callTree = Utils.AICallTree.AICallTree.from(selectedEvent, mainEvents, parsedTrace);\n\n // We don't need to validate the whole tree, just that it has recursion\n const treeStr = callTree.serialize();\n const lines = treeStr.split('\\n');\n const fibCallCount = lines.filter(line => line.includes('fibonacci')).length;\n assert.isTrue(fibCallCount > 10);\n });\n\n it('AITreeFilter includes the right items in the tree', async function() {\n const {parsedTrace} = await TraceLoader.traceEngine(this, 'two-workers.json.gz');\n const mainEvents = parsedTrace.Renderer.allTraceEntries;\n\n // A very small 'get storage' event. It's 6µs long\n const tinyEvent = mainEvents.find(event => event.ts === 107350149168);\n if (!tinyEvent) {\n throw new Error('Could not find expected event.');\n }\n const tinyStr = Utils.AICallTree.AICallTree.from(tinyEvent, mainEvents, parsedTrace).serialize();\n assert.strictEqual(tinyStr.split('\\n').filter(l => l.startsWith('Node:')).join('\\n'), `\nNode: 1 – Task\nNode: 2 – Parse HTML\nNode: 3 – Evaluate script\nNode: 4 – (anonymous)\nNode: 5 – get storage`.trim());\n assert.include(tinyStr, 'get storage');\n\n // An evaluateScript that has 3 'Compile code' children\n const evaluateEvent = mainEvents.find(event => event.ts === 107350147808);\n if (!evaluateEvent) {\n throw new Error('Could not find expected event.');\n }\n const treeStr = Utils.AICallTree.AICallTree.from(evaluateEvent, mainEvents, parsedTrace).serialize();\n assert.strictEqual(treeStr.split('\\n').filter(l => l.startsWith('Node:')).join('\\n'), `\nNode: 1 – Task\nNode: 2 – Parse HTML\nNode: 3 – Evaluate script\nNode: 4 – Compile script\nNode: 5 – (anonymous)\nNode: 6 – H.la`.trim());\n assert.notInclude(treeStr, 'Compile code');\n\n // An Compile code event within the evaluateEvent call tree\n const compileEvent = mainEvents.find(event => event.ts === 107350148218);\n if (!compileEvent) {\n throw new Error('Could not find expected event.');\n }\n const compileStr = Utils.AICallTree.AICallTree.from(compileEvent, mainEvents, parsedTrace).serialize();\n assert.strictEqual(compileStr.split('\\n').filter(l => l.startsWith('Node:')).join('\\n'), `\nNode: 1 – Task\nNode: 2 – Parse HTML\nNode: 3 – Evaluate script\nNode: 4 – (anonymous)\nNode: 5 – Compile code`.trim());\n assert.include(compileStr, 'Compile code');\n });\n});\n\ndescribe('AITreeFilter', () => {\n const makeEvent = (\n name: string,\n ts: number,\n dur: number,\n ): Trace.Types.Events.Event => ({\n name,\n cat: 'disabled-by-default-devtools.timeline',\n ph: Trace.Types.Events.Phase.COMPLETE,\n ts: Trace.Types.Timing.MicroSeconds(ts),\n dur: Trace.Types.Timing.MicroSeconds(dur),\n pid: Trace.Types.Events.ProcessID(1),\n tid: Trace.Types.Events.ThreadID(4),\n args: {},\n });\n\n it('always includes the selected event', () => {\n const selectedEvent = makeEvent('selected', 0, 100);\n const filter = new Utils.AICallTree.AITreeFilter(selectedEvent);\n assert.strictEqual(filter.accept(selectedEvent), true);\n });\n\n it('includes events that are long enough', () => {\n const selectedEvent = makeEvent('selected', 0, 100);\n const filter = new Utils.AICallTree.AITreeFilter(selectedEvent);\n\n assert.strictEqual(filter.accept(makeEvent('short', 0, 1)), true);\n assert.strictEqual(filter.accept(makeEvent('short', 0, 0.6)), true);\n assert.strictEqual(filter.accept(makeEvent('long', 0, 101)), true);\n assert.strictEqual(filter.accept(makeEvent('long', 0, 200)), true);\n assert.strictEqual(filter.accept(makeEvent('long', 0, 1000)), true);\n });\n\n it('excludes events that are too short', () => {\n const selectedEvent = makeEvent('selected', 0, 100);\n const filter = new Utils.AICallTree.AITreeFilter(selectedEvent);\n\n assert.strictEqual(filter.accept(makeEvent('short', 0, 0)), false);\n assert.strictEqual(filter.accept(makeEvent('short', 0, 0.1)), false);\n assert.strictEqual(filter.accept(makeEvent('short', 0, 0.4)), false);\n });\n\n it('excludes COMPILE_CODE nodes if non-selected', () => {\n const selectedEvent = makeEvent('selected', 0, 100);\n const compileCodeEvent = makeEvent(Trace.Types.Events.Name.COMPILE_CODE, 0, 100);\n const filter = new Utils.AICallTree.AITreeFilter(selectedEvent);\n assert.strictEqual(filter.accept(compileCodeEvent), false);\n });\n\n it('includes COMPILE_CODE nodes if selected', () => {\n const selectedEvent = makeEvent(Trace.Types.Events.Name.COMPILE_CODE, 0, 100);\n const filter = new Utils.AICallTree.AITreeFilter(selectedEvent);\n assert.strictEqual(filter.accept(selectedEvent), true);\n });\n});\n"]} \ No newline at end of file +{"version":3,"file":"AICallTree.test.js","sourceRoot":"","sources":["../../../../../../../front_end/panels/timeline/utils/AICallTree.test.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,KAAK,KAAK,MAAM,gCAAgC,CAAC;AACxD,OAAO,EAAC,uBAAuB,EAAC,MAAM,wCAAwC,CAAC;AAC/E,OAAO,EAAC,WAAW,EAAC,MAAM,iCAAiC,CAAC;AAE5D,OAAO,KAAK,KAAK,MAAM,YAAY,CAAC;AAEpC,uBAAuB,CAAC,YAAY,EAAE,GAAG,EAAE;IACzC,EAAE,CAAC,0BAA0B,EAAE,KAAK;QAClC,MAAM,EAAC,WAAW,EAAC,GAAG,MAAM,WAAW,CAAC,WAAW,CAAC,IAAI,EAAE,kCAAkC,CAAC,CAAC;QAC9F,MAAM,UAAU,GAAG,WAAW,CAAC,QAAQ,CAAC,eAAe,CAAC;QACxD,2DAA2D;QAC3D,MAAM,aAAa,GAAG,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,EAAE,KAAK,YAAY,CAAC,CAAC;QAC1E,IAAI,CAAC,aAAa,EAAE,CAAC;YACnB,MAAM,IAAI,KAAK,CAAC,gCAAgC,CAAC,CAAC;QACpD,CAAC;QACD,MAAM,QAAQ,GAAG,KAAK,CAAC,UAAU,CAAC,UAAU,CAAC,IAAI,CAAC,aAAa,EAAE,UAAU,EAAE,WAAW,CAAC,CAAC;QAC1F,MAAM,YAAY,GAAG,IAAI;YACrB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwCP,CAAC,IAAI,EAAE,CAAC;QACL,MAAM,CAAC,WAAW,CAAC,QAAQ,CAAC,SAAS,EAAE,EAAE,YAAY,CAAC,CAAC;IACzD,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,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AAC,YAAY,CAAC,aAAa,CAAC,CAAC;QAEhE,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,OAAO,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;QACxD,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,OAAO,EAAE,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC;QAC1D,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,OAAO,EAAE,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC;IAC5D,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,6CAA6C,EAAE,GAAG,EAAE;QACrD,MAAM,aAAa,GAAG,SAAS,CAAC,UAAU,EAAE,CAAC,EAAE,GAAG,CAAC,CAAC;QACpD,MAAM,gBAAgB,GAAG,SAAS,8DAAuC,CAAC,EAAE,GAAG,CAAC,CAAC;QACjF,MAAM,MAAM,GAAG,IAAI,KAAK,CAAC,UAAU,CAAC,YAAY,CAAC,aAAa,CAAC,CAAC;QAChE,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,gBAAgB,CAAC,CAAC,CAAC;IAClD,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,yCAAyC,EAAE,GAAG,EAAE;QACjD,MAAM,aAAa,GAAG,SAAS,8DAAuC,CAAC,EAAE,GAAG,CAAC,CAAC;QAC9E,MAAM,MAAM,GAAG,IAAI,KAAK,CAAC,UAAU,CAAC,YAAY,CAAC,aAAa,CAAC,CAAC;QAChE,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC,CAAC;IAC9C,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["// Copyright 2024 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport * as Trace from '../../../models/trace/trace.js';\nimport {describeWithEnvironment} from '../../../testing/EnvironmentHelpers.js';\nimport {TraceLoader} from '../../../testing/TraceLoader.js';\n\nimport * as Utils from './utils.js';\n\ndescribeWithEnvironment('AICallTree', () => {\n it('serializes a simple tree', async function() {\n const {parsedTrace} = await TraceLoader.traceEngine(this, 'web-dev-outermost-frames.json.gz');\n const mainEvents = parsedTrace.Renderer.allTraceEntries;\n // A function '_ds.q.ns'. Has a very small tree by default.\n const selectedEvent = mainEvents.find(event => event.ts === 465457308823);\n if (!selectedEvent) {\n throw new Error('Could not find expected event.');\n }\n const callTree = Utils.AICallTree.AICallTree.from(selectedEvent, mainEvents, parsedTrace);\n const expectedData = '\\n' +\n `\n\n# All URL #s:\n\n * 0: https://www.gstatic.com/devrel-devsite/prod/vafe2e13ca17bb026e70df42a2ead1c8192750e86a12923a88eda839025dabf95/js/devsite_app_module.js\n\n# Call tree:\n\nNode: 1 – Task\ndur: 0.2\nChildren:\n * 2 – Timer fired\n\nNode: 2 – Timer fired\ndur: 0.2\nChildren:\n * 3 – Function call\n\nNode: 3 – Function call\ndur: 0.2\nURL #: 0\nChildren:\n * 4 – _ds.q.ns\n\nNode: 4 – _ds.q.ns\nSelected: true\ndur: 0.2\nURL #: 0\nChildren:\n * 5 – clearTimeout\n\nNode: 5 – clearTimeout\ndur: 0.2\nself: 0\nChildren:\n * 6 – Recalculate style\n\nNode: 6 – Recalculate style\ndur: 0.2\nself: 0.2\n`.trim();\n assert.strictEqual(callTree.serialize(), expectedData);\n });\n\n it('serializes a tree with lots of recursion', async function() {\n const {parsedTrace} = await TraceLoader.traceEngine(this, 'one-second-interaction.json.gz');\n const mainEvents = parsedTrace.Renderer.allTraceEntries;\n const selectedEvent = mainEvents.find(event => event.ts === 141251951589);\n if (!selectedEvent) {\n throw new Error('Could not find expected event.');\n }\n const callTree = Utils.AICallTree.AICallTree.from(selectedEvent, mainEvents, parsedTrace);\n\n // We don't need to validate the whole tree, just that it has recursion\n const treeStr = callTree.serialize();\n const lines = treeStr.split('\\n');\n const fibCallCount = lines.filter(line => line.includes('fibonacci')).length;\n assert.isTrue(fibCallCount > 10);\n });\n\n it('AITreeFilter includes the right items in the tree', async function() {\n const {parsedTrace} = await TraceLoader.traceEngine(this, 'two-workers.json.gz');\n const mainEvents = parsedTrace.Renderer.allTraceEntries;\n\n // A very small 'get storage' event. It's 6µs long\n const tinyEvent = mainEvents.find(event => event.ts === 107350149168);\n if (!tinyEvent) {\n throw new Error('Could not find expected event.');\n }\n const tinyStr = Utils.AICallTree.AICallTree.from(tinyEvent, mainEvents, parsedTrace).serialize();\n assert.strictEqual(tinyStr.split('\\n').filter(l => l.startsWith('Node:')).join('\\n'), `\nNode: 1 – Task\nNode: 2 – Parse HTML\nNode: 3 – Evaluate script\nNode: 4 – (anonymous)\nNode: 5 – get storage`.trim());\n assert.include(tinyStr, 'get storage');\n\n // An evaluateScript that has 3 'Compile code' children\n const evaluateEvent = mainEvents.find(event => event.ts === 107350147808);\n if (!evaluateEvent) {\n throw new Error('Could not find expected event.');\n }\n const treeStr = Utils.AICallTree.AICallTree.from(evaluateEvent, mainEvents, parsedTrace).serialize();\n assert.strictEqual(treeStr.split('\\n').filter(l => l.startsWith('Node:')).join('\\n'), `\nNode: 1 – Task\nNode: 2 – Parse HTML\nNode: 3 – Evaluate script\nNode: 4 – Compile script\nNode: 5 – (anonymous)\nNode: 6 – H.la`.trim());\n assert.notInclude(treeStr, 'Compile code');\n\n // An Compile code event within the evaluateEvent call tree\n const compileEvent = mainEvents.find(event => event.ts === 107350148218);\n if (!compileEvent) {\n throw new Error('Could not find expected event.');\n }\n const compileStr = Utils.AICallTree.AICallTree.from(compileEvent, mainEvents, parsedTrace).serialize();\n assert.strictEqual(compileStr.split('\\n').filter(l => l.startsWith('Node:')).join('\\n'), `\nNode: 1 – Task\nNode: 2 – Parse HTML\nNode: 3 – Evaluate script\nNode: 4 – (anonymous)\nNode: 5 – Compile code`.trim());\n assert.include(compileStr, 'Compile code');\n });\n});\n\ndescribe('AITreeFilter', () => {\n const makeEvent = (\n name: string,\n ts: number,\n dur: number,\n ): Trace.Types.Events.Event => ({\n name,\n cat: 'disabled-by-default-devtools.timeline',\n ph: Trace.Types.Events.Phase.COMPLETE,\n ts: Trace.Types.Timing.MicroSeconds(ts),\n dur: Trace.Types.Timing.MicroSeconds(dur),\n pid: Trace.Types.Events.ProcessID(1),\n tid: Trace.Types.Events.ThreadID(4),\n args: {},\n });\n\n it('always includes the selected event', () => {\n const selectedEvent = makeEvent('selected', 0, 100);\n const filter = new Utils.AICallTree.AITreeFilter(selectedEvent);\n assert.isTrue(filter.accept(selectedEvent));\n });\n\n it('includes events that are long enough', () => {\n const selectedEvent = makeEvent('selected', 0, 100);\n const filter = new Utils.AICallTree.AITreeFilter(selectedEvent);\n\n assert.isTrue(filter.accept(makeEvent('short', 0, 1)));\n assert.isTrue(filter.accept(makeEvent('short', 0, 0.6)));\n assert.isTrue(filter.accept(makeEvent('long', 0, 101)));\n assert.isTrue(filter.accept(makeEvent('long', 0, 200)));\n assert.isTrue(filter.accept(makeEvent('long', 0, 1000)));\n });\n\n it('excludes events that are too short', () => {\n const selectedEvent = makeEvent('selected', 0, 100);\n const filter = new Utils.AICallTree.AITreeFilter(selectedEvent);\n\n assert.isFalse(filter.accept(makeEvent('short', 0, 0)));\n assert.isFalse(filter.accept(makeEvent('short', 0, 0.1)));\n assert.isFalse(filter.accept(makeEvent('short', 0, 0.4)));\n });\n\n it('excludes COMPILE_CODE nodes if non-selected', () => {\n const selectedEvent = makeEvent('selected', 0, 100);\n const compileCodeEvent = makeEvent(Trace.Types.Events.Name.COMPILE_CODE, 0, 100);\n const filter = new Utils.AICallTree.AITreeFilter(selectedEvent);\n assert.isFalse(filter.accept(compileCodeEvent));\n });\n\n it('includes COMPILE_CODE nodes if selected', () => {\n const selectedEvent = makeEvent(Trace.Types.Events.Name.COMPILE_CODE, 0, 100);\n const filter = new Utils.AICallTree.AITreeFilter(selectedEvent);\n assert.isTrue(filter.accept(selectedEvent));\n });\n});\n"]} \ No newline at end of file diff --git a/public/panels/timeline/utils/ImageCache.test.js b/public/panels/timeline/utils/ImageCache.test.js index 709743620..d8ab3e999 100644 --- a/public/panels/timeline/utils/ImageCache.test.js +++ b/public/panels/timeline/utils/ImageCache.test.js @@ -38,10 +38,10 @@ describe('ImageCache', () => { it('loadImage resolves invalid images to null', async () => { const datauri = 'data:image/jpg;base64,INVALIDDATA'; const res = await loadImage(datauri); - assert.strictEqual(res, null); + assert.isNull(res); }); it('getOrQueue should return null for a new screenshot', () => { - assert.strictEqual(getOrQueue(syntheticScreenshot1), null); + assert.isNull(getOrQueue(syntheticScreenshot1)); }); it('getOrQueue should return the same image for the same screenshot', async () => { // Preload to ensure image is loaded for both reads. diff --git a/public/panels/timeline/utils/ImageCache.test.js.map b/public/panels/timeline/utils/ImageCache.test.js.map index 538223896..3ae704f75 100644 --- a/public/panels/timeline/utils/ImageCache.test.js.map +++ b/public/panels/timeline/utils/ImageCache.test.js.map @@ -1 +1 @@ -{"version":3,"file":"ImageCache.test.js","sourceRoot":"","sources":["../../../../../../../front_end/panels/timeline/utils/ImageCache.test.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,KAAK,KAAK,MAAM,gCAAgC,CAAC;AACxD,OAAO,EAAC,iBAAiB,EAAC,MAAM,kCAAkC,CAAC;AAEnE,OAAO,KAAK,KAAK,MAAM,YAAY,CAAC;AAEpC,MAAM,EAAC,eAAe,EAAE,OAAO,EAAE,UAAU,EAAE,mBAAmB,EAAE,SAAS,EAAE,OAAO,EAAC,GAAG,KAAK,CAAC,UAAU,CAAC;AAEzG,QAAQ,CAAC,YAAY,EAAE,GAAG,EAAE;IAC1B,uFAAuF;IACvF,MAAM,aAAa,GACf,sGAAsG,CAAC;IAE3G,MAAM,cAAc,GAAkC;QACpD,GAAG,iBAAiB;QACpB,EAAE,EAAE,KAAK;QACT,IAAI,EAAE,EAAC,QA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CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["// Copyright 2024 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport * as Trace from '../../../models/trace/trace.js';\nimport {defaultTraceEvent} from '../../../testing/TraceHelpers.js';\n\nimport * as Utils from './utils.js';\n\nconst {cacheForTesting, emitter, getOrQueue, loadImageForTesting: loadImage, preload} = Utils.ImageCache;\n\ndescribe('ImageCache', () => {\n // Generate at https://yulvil.github.io/gopherjs/02/ with 1,1,1,jpeg in the form fields\n const validJpegData =\n 'iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAAEElEQVR4nGISWfUPEAAA//8CmgG/YtkszwAAAABJRU5ErkJggg==';\n\n const rawSourceEvent: Trace.Types.Events.Screenshot = {\n ...defaultTraceEvent,\n id: '0x1',\n args: {snapshot: validJpegData},\n name: Trace.Types.Events.Name.SCREENSHOT,\n cat: 'disabled-by-default-devtools.screenshot',\n ph: Trace.Types.Events.Phase.OBJECT_SNAPSHOT,\n };\n\n Trace.Handlers.ModelHandlers.Screenshots.reset();\n Trace.Handlers.ModelHandlers.Screenshots.handleEvent(rawSourceEvent);\n void Trace.Handlers.ModelHandlers.Screenshots.finalize();\n\n const syntheticScreenshot1 = Trace.Handlers.ModelHandlers.Screenshots.data().all[0];\n const syntheticScreenshot2 = structuredClone(syntheticScreenshot1);\n syntheticScreenshot2.rawSourceEvent.id = '0x2';\n const badDataUriScreenshot = structuredClone(syntheticScreenshot1);\n badDataUriScreenshot.args.dataUri = 'INVALIDDATA';\n\n beforeEach(() => {\n const cache = cacheForTesting;\n cache.delete(syntheticScreenshot1);\n cache.delete(syntheticScreenshot2);\n cache.delete(badDataUriScreenshot);\n });\n\n it('loadImage resolves valid images', async () => {\n const datauri = `data:image/jpg;base64,${validJpegData}`;\n const res = await loadImage(datauri);\n assert.instanceOf(res, HTMLImageElement);\n });\n it('loadImage resolves invalid images to null', async () => {\n const datauri = 'data:image/jpg;base64,INVALIDDATA';\n const res = await loadImage(datauri);\n assert.strictEqual(res, null);\n });\n\n it('getOrQueue should return null for a new screenshot', () => {\n assert.strictEqual(getOrQueue(syntheticScreenshot1), null);\n });\n\n it('getOrQueue should return the same image for the same screenshot', async () => {\n // Preload to ensure image is loaded for both reads.\n await preload([syntheticScreenshot1]);\n\n const image1 = getOrQueue(syntheticScreenshot1);\n const image2 = getOrQueue(syntheticScreenshot1);\n assert.strictEqual(image2, image1);\n assert.instanceOf(image1, HTMLImageElement);\n });\n\n it('emitter should emit an event when a screenshot is updated', async () => {\n const {promise, resolve} = Promise.withResolvers();\n emitter.addEventListener('screenshot-loaded', ev => {\n const event = ev as CustomEvent;\n assert.strictEqual(event.detail.screenshot, syntheticScreenshot1);\n assert.instanceOf(event.detail.image, HTMLImageElement);\n // Cache is updated too.\n assert.instanceOf(getOrQueue(syntheticScreenshot1), HTMLImageElement);\n resolve(null);\n }, {once: true});\n\n assert.isNull(getOrQueue(syntheticScreenshot1));\n return promise;\n });\n\n it('getOrQueue should return null (immediately and eventually) for an invalid image', async () => {\n // First attempt is null because empty cache.\n assert.isNull(getOrQueue(badDataUriScreenshot));\n\n const {promise, resolve} = Promise.withResolvers();\n emitter.addEventListener('screenshot-loaded', ev => {\n const event = ev as CustomEvent;\n assert.strictEqual(event.detail.screenshot, badDataUriScreenshot);\n // Loaded but invalid, so null.\n assert.isNull(event.detail.image);\n // Null stored in the cache\n assert.isNull(getOrQueue(badDataUriScreenshot));\n\n resolve(null);\n }, {once: true});\n return promise;\n });\n\n it('preload should load all screenshots', async () => {\n await preload([syntheticScreenshot1, syntheticScreenshot2]);\n assert.instanceOf(getOrQueue(syntheticScreenshot1), HTMLImageElement);\n assert.instanceOf(getOrQueue(syntheticScreenshot2), HTMLImageElement);\n });\n});\n"]} \ No newline at end of file +{"version":3,"file":"ImageCache.test.js","sourceRoot":"","sources":["../../../../../../../front_end/panels/timeline/utils/ImageCache.test.ts"],"names":[],"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CAAC,UAAU,CAAC,oBAAoB,CAAC,CAAC,CAAC;YAEhD,OAAO,CAAC,IAAI,CAAC,CAAC;QAChB,CAAC,EAAE,EAAC,IAAI,EAAE,IAAI,EAAC,CAAC,CAAC;QACjB,OAAO,OAAO,CAAC;IACjB,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,qCAAqC,EAAE,KAAK,IAAI,EAAE;QACnD,MAAM,OAAO,CAAC,CAAC,oBAAoB,EAAE,oBAAoB,CAAC,CAAC,CAAC;QAC5D,MAAM,CAAC,UAAU,CAAC,UAAU,CAAC,oBAAoB,CAAC,EAAE,gBAAgB,CAAC,CAAC;QACtE,MAAM,CAAC,UAAU,CAAC,UAAU,CAAC,oBAAoB,CAAC,EAAE,gBAAgB,CAAC,CAAC;IACxE,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["// Copyright 2024 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport * as Trace from '../../../models/trace/trace.js';\nimport {defaultTraceEvent} from '../../../testing/TraceHelpers.js';\n\nimport * as Utils from './utils.js';\n\nconst {cacheForTesting, emitter, getOrQueue, loadImageForTesting: loadImage, preload} = Utils.ImageCache;\n\ndescribe('ImageCache', () => {\n // Generate at https://yulvil.github.io/gopherjs/02/ with 1,1,1,jpeg in the form fields\n const validJpegData =\n 'iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAAEElEQVR4nGISWfUPEAAA//8CmgG/YtkszwAAAABJRU5ErkJggg==';\n\n const rawSourceEvent: Trace.Types.Events.Screenshot = {\n ...defaultTraceEvent,\n id: '0x1',\n args: {snapshot: validJpegData},\n name: Trace.Types.Events.Name.SCREENSHOT,\n cat: 'disabled-by-default-devtools.screenshot',\n ph: Trace.Types.Events.Phase.OBJECT_SNAPSHOT,\n };\n\n Trace.Handlers.ModelHandlers.Screenshots.reset();\n Trace.Handlers.ModelHandlers.Screenshots.handleEvent(rawSourceEvent);\n void Trace.Handlers.ModelHandlers.Screenshots.finalize();\n\n const syntheticScreenshot1 = Trace.Handlers.ModelHandlers.Screenshots.data().all[0];\n const syntheticScreenshot2 = structuredClone(syntheticScreenshot1);\n syntheticScreenshot2.rawSourceEvent.id = '0x2';\n const badDataUriScreenshot = structuredClone(syntheticScreenshot1);\n badDataUriScreenshot.args.dataUri = 'INVALIDDATA';\n\n beforeEach(() => {\n const cache = cacheForTesting;\n cache.delete(syntheticScreenshot1);\n cache.delete(syntheticScreenshot2);\n cache.delete(badDataUriScreenshot);\n });\n\n it('loadImage resolves valid images', async () => {\n const datauri = `data:image/jpg;base64,${validJpegData}`;\n const res = await loadImage(datauri);\n assert.instanceOf(res, HTMLImageElement);\n });\n it('loadImage resolves invalid images to null', async () => {\n const datauri = 'data:image/jpg;base64,INVALIDDATA';\n const res = await loadImage(datauri);\n assert.isNull(res);\n });\n\n it('getOrQueue should return null for a new screenshot', () => {\n assert.isNull(getOrQueue(syntheticScreenshot1));\n });\n\n it('getOrQueue should return the same image for the same screenshot', async () => {\n // Preload to ensure image is loaded for both reads.\n await preload([syntheticScreenshot1]);\n\n const image1 = getOrQueue(syntheticScreenshot1);\n const image2 = getOrQueue(syntheticScreenshot1);\n assert.strictEqual(image2, image1);\n assert.instanceOf(image1, HTMLImageElement);\n });\n\n it('emitter should emit an event when a screenshot is updated', async () => {\n const {promise, resolve} = Promise.withResolvers();\n emitter.addEventListener('screenshot-loaded', ev => {\n const event = ev as CustomEvent;\n assert.strictEqual(event.detail.screenshot, syntheticScreenshot1);\n assert.instanceOf(event.detail.image, HTMLImageElement);\n // Cache is updated too.\n assert.instanceOf(getOrQueue(syntheticScreenshot1), HTMLImageElement);\n resolve(null);\n }, {once: true});\n\n assert.isNull(getOrQueue(syntheticScreenshot1));\n return promise;\n });\n\n it('getOrQueue should return null (immediately and eventually) for an invalid image', async () => {\n // First attempt is null because empty cache.\n assert.isNull(getOrQueue(badDataUriScreenshot));\n\n const {promise, resolve} = Promise.withResolvers();\n emitter.addEventListener('screenshot-loaded', ev => {\n const event = ev as CustomEvent;\n assert.strictEqual(event.detail.screenshot, badDataUriScreenshot);\n // Loaded but invalid, so null.\n assert.isNull(event.detail.image);\n // Null stored in the cache\n assert.isNull(getOrQueue(badDataUriScreenshot));\n\n resolve(null);\n }, {once: true});\n return promise;\n });\n\n it('preload should load all screenshots', async () => {\n await preload([syntheticScreenshot1, syntheticScreenshot2]);\n assert.instanceOf(getOrQueue(syntheticScreenshot1), HTMLImageElement);\n assert.instanceOf(getOrQueue(syntheticScreenshot2), HTMLImageElement);\n });\n});\n"]} \ No newline at end of file diff --git a/public/panels/utils/utils.test.js b/public/panels/utils/utils.test.js index 03e36a119..3ffe4c361 100644 --- a/public/panels/utils/utils.test.js +++ b/public/panels/utils/utils.test.js @@ -144,8 +144,8 @@ describeWithEnvironment('panels/utils', () => { request.mimeType = 'image/svg+xml'; const iconElement = PanelUtils.PanelUtils.getIconForNetworkRequest(request); const imagePreview = iconElement.querySelector('.image-network-icon-preview'); - assert.isTrue(iconElement instanceof HTMLDivElement); - assert.isTrue(imagePreview instanceof HTMLImageElement); + assert.instanceOf(iconElement, HTMLDivElement); + assert.instanceOf(imagePreview, HTMLImageElement); }); it('mime win: show document icon for fetch-html', async () => { const request = SDK.NetworkRequest.NetworkRequest.create('requestId', 'https://www.example.com/page', '', null, null, null); diff --git a/public/panels/utils/utils.test.js.map b/public/panels/utils/utils.test.js.map index b7b046729..a2dfe189f 100644 --- a/public/panels/utils/utils.test.js.map +++ b/public/panels/utils/utils.test.js.map @@ -1 +1 @@ -{"version":3,"file":"utils.test.js","sourceRoot":"","sources":["../../../../../../front_end/panels/utils/utils.test.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,KAAK,MAAM,MAAM,6BAA6B,CAAC;AAEtD,OAAO,KAAK,GAAG,MAAM,uBAAuB,CAAC;AAE7C,OAAO,EAAC,uBAAuB,EAAC,M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e,CAAC,OAAO,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;YAC1E,MAAM,SAAS,GAAG,SAAS,CAAC,eAAe,CAAC,SAAS,CAAC,gBAAgB,CAAC,CAAC;YAExE,MAAM,CAAC,WAAW,CAAC,mBAAmB,EAAE,SAAS,CAAC,CAAC;QACrD,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,0CAA0C,EAAE,KAAK,IAAI,EAAE;YACxD,MAAM,OAAO,GAAG,GAAG,CAAC,cAAc,CAAC,cAAc,CAAC,MAAM,CACpD,WAAyC,EACzC,kCAAqE,EAAE,EAAqC,EAC5G,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;YACtB,OAAO,CAAC,eAAe,CAAC,MAAM,CAAC,YAAY,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;YACjE,OAAO,CAAC,QAAQ,GAAG,kBAAkB,CAAC;YAEtC,MAAM,WAAW,GAAG,UAAU,CAAC,UAAU,CAAC,wBAAwB,CAAC,OAAO,CAAC,CAAC;YAE5E,MAAM,SAAS,GAAG,WAAW,CAAC,KAAK,CAAC;YACpC,MAAM,gBAAgB,GAAG,SAAS,CAAC,eAAe,CAAC,OAAO,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;YAC1E,MAAM,SAAS,GAAG,SAAS,CAAC,eAAe,CAAC,SAAS,CAAC,gBAAgB,CAAC,CAAC;YAExE,MAAM,CAAC,WAAW,CAAC,iBAAiB,EAAE,SAAS,CAAC,CAAC;QACnD,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["// Copyright 2022 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport * as Common from '../../core/common/common.js';\nimport type * as Platform from '../../core/platform/platform.js';\nimport * as SDK from '../../core/sdk/sdk.js';\nimport type * as Protocol from '../../generated/protocol.js';\nimport {describeWithEnvironment} from '../../testing/EnvironmentHelpers.js';\nimport * as Diff from '../../third_party/diff/diff.js';\n\nimport * as PanelUtils from './utils.js';\n\ndescribeWithEnvironment('panels/utils', () => {\n it('formats CSS changes from diff arrays', async () => {\n const original = `\n .container {\n width: 10px;\n height: 10px;\n }\n\n .child {\n display: grid;\n --child-theme-color: 100, 200, 0;\n }\n\n @supports (display: grid) {\n .container {\n display: grid;\n }\n }`;\n const current = `\n .container {\n width: 15px;\n margin: 0;\n }\n\n .child2 {\n display: grid;\n --child-theme-color: 5, 10, 15;\n padding: 10px;\n }\n\n @supports (display: flex) {\n .container {\n display: flex;\n }\n }`;\n const diff = Diff.Diff.DiffWrapper.lineDiff(original.split('\\n'), current.split('\\n'));\n const changes = await PanelUtils.PanelUtils.formatCSSChangesFromDiff(diff);\n assert.strictEqual(\n changes, `.container {\n /* width: 10px; */\n /* height: 10px; */\n width: 15px;\n margin: 0;\n}\n\n/* .child { */\n.child2 {\n /* --child-theme-color: 100, 200, 0; */\n --child-theme-color: 5, 10, 15;\n padding: 10px;\n}\n\n/* @supports (display: grid) { */\n@supports (display: flex) {\n.container {\n /* display: grid; */\n display: flex;\n}`,\n 'formatted CSS changes are not correct');\n });\n\n describe('getIconForNetworkRequest', () => {\n it('creates an error red icon for request with status code 404', async () => {\n const request = SDK.NetworkRequest.NetworkRequest.create(\n 'requestId' as Protocol.Network.RequestId, 'https://www.example.com' as Platform.DevToolsPath.UrlString,\n '' as Platform.DevToolsPath.UrlString, null, null, null);\n request.statusCode = 404;\n\n const iconElement = PanelUtils.PanelUtils.getIconForNetworkRequest(request);\n\n const iconStyle = iconElement.style;\n const indexOfIconImage = iconStyle.webkitMaskImage.indexOf('Images/') + 7;\n const iconImage = iconStyle.webkitMaskImage.substring(indexOfIconImage);\n\n assert.strictEqual('cross-circle-filled.svg\")', iconImage);\n\n const backgroundColorOfIcon = iconStyle.backgroundColor.toString();\n assert.strictEqual(backgroundColorOfIcon, 'var(--icon-error)');\n });\n\n it('show document icon', async () => {\n const request = SDK.NetworkRequest.NetworkRequest.create(\n 'requestId' as Protocol.Network.RequestId, 'https://www.example.com/' as Platform.DevToolsPath.UrlString,\n '' as Platform.DevToolsPath.UrlString, null, null, null);\n request.setResourceType(Common.ResourceType.resourceTypes.Document);\n request.mimeType = 'text/html';\n\n const iconElement = PanelUtils.PanelUtils.getIconForNetworkRequest(request);\n\n const iconStyle = iconElement.style;\n const indexOfIconImage = iconStyle.webkitMaskImage.indexOf('Images/') + 7;\n const iconImage = iconStyle.webkitMaskImage.substring(indexOfIconImage);\n\n assert.strictEqual('file-document.svg\")', iconImage);\n\n const backgroundColorOfIcon = iconStyle.backgroundColor.toString();\n assert.strictEqual(backgroundColorOfIcon, 'var(--icon-file-document)');\n });\n\n it('show media icon', async () => {\n const request = SDK.NetworkRequest.NetworkRequest.create(\n 'requestId' as Protocol.Network.RequestId,\n 'https://www.example.com/test.mp3' as Platform.DevToolsPath.UrlString, '' as Platform.DevToolsPath.UrlString,\n null, null, null);\n request.setResourceType(Common.ResourceType.resourceTypes.Media);\n request.mimeType = 'audio/mpeg';\n\n const iconElement = PanelUtils.PanelUtils.getIconForNetworkRequest(request);\n\n const iconStyle = iconElement.style;\n const indexOfIconImage = iconStyle.webkitMaskImage.indexOf('Images/') + 7;\n const iconImage = iconStyle.webkitMaskImage.substring(indexOfIconImage);\n\n assert.strictEqual('file-media.svg\")', iconImage);\n });\n\n it('show wasm icon', async () => {\n const request = SDK.NetworkRequest.NetworkRequest.create(\n 'requestId' as Protocol.Network.RequestId,\n 'https://www.example.com/test.wasm' as Platform.DevToolsPath.UrlString, '' as Platform.DevToolsPath.UrlString,\n null, null, null);\n request.setResourceType(Common.ResourceType.resourceTypes.Wasm);\n request.mimeType = 'application/wasm';\n\n const iconElement = PanelUtils.PanelUtils.getIconForNetworkRequest(request);\n\n const iconStyle = iconElement.style;\n const indexOfIconImage = iconStyle.webkitMaskImage.indexOf('Images/') + 7;\n const iconImage = iconStyle.webkitMaskImage.substring(indexOfIconImage);\n\n assert.strictEqual('file-wasm.svg\")', iconImage);\n });\n\n it('show websocket icon', async () => {\n const request = SDK.NetworkRequest.NetworkRequest.create(\n 'requestId' as Protocol.Network.RequestId, 'https://www.example.com/ws' as Platform.DevToolsPath.UrlString,\n '' as Platform.DevToolsPath.UrlString, null, null, null);\n request.setResourceType(Common.ResourceType.resourceTypes.WebSocket);\n request.mimeType = '';\n\n const iconElement = PanelUtils.PanelUtils.getIconForNetworkRequest(request);\n\n const iconStyle = iconElement.style;\n const indexOfIconImage = iconStyle.webkitMaskImage.indexOf('Images/') + 7;\n const iconImage = iconStyle.webkitMaskImage.substring(indexOfIconImage);\n\n assert.strictEqual('file-websocket.svg\")', iconImage);\n });\n\n it('shows fetch icon', async () => {\n const request = SDK.NetworkRequest.NetworkRequest.create(\n 'requestId' as Protocol.Network.RequestId,\n 'https://www.example.com/test.json?keepalive=false' as Platform.DevToolsPath.UrlString,\n '' as Platform.DevToolsPath.UrlString, null, null, null);\n request.setResourceType(Common.ResourceType.resourceTypes.Fetch);\n request.mimeType = '';\n\n const iconElement = PanelUtils.PanelUtils.getIconForNetworkRequest(request);\n\n const iconStyle = iconElement.style;\n const indexOfIconImage = iconStyle.webkitMaskImage.indexOf('Images/') + 7;\n const iconImage = iconStyle.webkitMaskImage.substring(indexOfIconImage);\n\n assert.strictEqual('file-fetch-xhr.svg\")', iconImage);\n });\n\n it('shows xhr icon', async () => {\n const request = SDK.NetworkRequest.NetworkRequest.create(\n 'requestId' as Protocol.Network.RequestId,\n 'https://www.example.com/test.json?keepalive=false' as Platform.DevToolsPath.UrlString,\n '' as Platform.DevToolsPath.UrlString, null, null, null);\n request.setResourceType(Common.ResourceType.resourceTypes.XHR);\n request.mimeType = 'application/octet-stream';\n\n const iconElement = PanelUtils.PanelUtils.getIconForNetworkRequest(request);\n\n const iconStyle = iconElement.style;\n const indexOfIconImage = iconStyle.webkitMaskImage.indexOf('Images/') + 7;\n const iconImage = iconStyle.webkitMaskImage.substring(indexOfIconImage);\n\n assert.strictEqual('file-fetch-xhr.svg\")', iconImage);\n });\n\n it('mime win: show image preview icon for xhr-image', async () => {\n const request = SDK.NetworkRequest.NetworkRequest.create(\n 'requestId' as Protocol.Network.RequestId,\n 'https://www.example.com/test.svg' as Platform.DevToolsPath.UrlString, '' as Platform.DevToolsPath.UrlString,\n null, null, null);\n request.setResourceType(Common.ResourceType.resourceTypes.XHR);\n request.mimeType = 'image/svg+xml';\n\n const iconElement = PanelUtils.PanelUtils.getIconForNetworkRequest(request);\n const imagePreview = iconElement.querySelector('.image-network-icon-preview') as HTMLImageElement;\n\n assert.isTrue(iconElement instanceof HTMLDivElement);\n assert.isTrue(imagePreview instanceof HTMLImageElement);\n });\n\n it('mime win: show document icon for fetch-html', async () => {\n const request = SDK.NetworkRequest.NetworkRequest.create(\n 'requestId' as Protocol.Network.RequestId, 'https://www.example.com/page' as Platform.DevToolsPath.UrlString,\n '' as Platform.DevToolsPath.UrlString, null, null, null);\n request.setResourceType(Common.ResourceType.resourceTypes.Fetch);\n request.mimeType = 'text/html';\n\n const iconElement = PanelUtils.PanelUtils.getIconForNetworkRequest(request);\n\n const iconStyle = iconElement.style;\n const indexOfIconImage = iconStyle.webkitMaskImage.indexOf('Images/') + 7;\n const iconImage = iconStyle.webkitMaskImage.substring(indexOfIconImage);\n\n assert.strictEqual('file-document.svg\")', iconImage);\n });\n\n it('mime win: show generic icon for preflight-text', async () => {\n const request = SDK.NetworkRequest.NetworkRequest.create(\n 'requestId' as Protocol.Network.RequestId,\n 'https://www.example.com/api/test' as Platform.DevToolsPath.UrlString, '' as Platform.DevToolsPath.UrlString,\n null, null, null);\n request.setResourceType(Common.ResourceType.resourceTypes.Preflight);\n request.mimeType = 'text/plain';\n\n const iconElement = PanelUtils.PanelUtils.getIconForNetworkRequest(request);\n\n const iconStyle = iconElement.style;\n const indexOfIconImage = iconStyle.webkitMaskImage.indexOf('Images/') + 7;\n const iconImage = iconStyle.webkitMaskImage.substring(indexOfIconImage);\n\n assert.strictEqual('file-generic.svg\")', iconImage);\n });\n\n it('mime win: show script icon for other-javascript)', async () => {\n const request = SDK.NetworkRequest.NetworkRequest.create(\n 'requestId' as Protocol.Network.RequestId, 'https://www.example.com/ping' as Platform.DevToolsPath.UrlString,\n '' as Platform.DevToolsPath.UrlString, null, null, null);\n request.setResourceType(Common.ResourceType.resourceTypes.Other);\n request.mimeType = 'application/javascript';\n\n const iconElement = PanelUtils.PanelUtils.getIconForNetworkRequest(request);\n\n const iconStyle = iconElement.style;\n const indexOfIconImage = iconStyle.webkitMaskImage.indexOf('Images/') + 7;\n const iconImage = iconStyle.webkitMaskImage.substring(indexOfIconImage);\n\n assert.strictEqual('file-script.svg\")', iconImage);\n });\n\n it('mime win: shows json icon for fetch-json', async () => {\n const request = SDK.NetworkRequest.NetworkRequest.create(\n 'requestId' as Protocol.Network.RequestId,\n 'https://www.example.com/api/list' as Platform.DevToolsPath.UrlString, '' as Platform.DevToolsPath.UrlString,\n null, null, null);\n request.setResourceType(Common.ResourceType.resourceTypes.Fetch);\n request.mimeType = 'application/json';\n\n const iconElement = PanelUtils.PanelUtils.getIconForNetworkRequest(request);\n\n const iconStyle = iconElement.style;\n const indexOfIconImage = iconStyle.webkitMaskImage.indexOf('Images/') + 7;\n const iconImage = iconStyle.webkitMaskImage.substring(indexOfIconImage);\n\n assert.strictEqual('file-json.svg\")', iconImage);\n });\n });\n});\n"]} \ No newline at end of file +{"version":3,"file":"utils.test.js","sourceRoot":"","sources":["../../../../../../front_end/panels/utils/utils.test.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,KAAK,MAAM,MAAM,6BAA6B,CAAC;AAEtD,OAAO,KAAK,GAAG,MAAM,uBAAuB,CAAC;AAE7C,OAAO,EAAC,uBAAuB,EAAC,MAAM,qCAAqC,CAAC;AAC5E,OAAO,KAAK,IAAI,MAAM,gCAAgC,CAAC;AAEvD,OAAO,KAAK,UAAU,MAAM,YAAY,CAAC;AAEzC,uBAAuB,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C,CAAC;YAExE,MAAM,CAAC,WAAW,CAAC,mBAAmB,EAAE,SAAS,CAAC,CAAC;QACrD,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,0CAA0C,EAAE,KAAK,IAAI,EAAE;YACxD,MAAM,OAAO,GAAG,GAAG,CAAC,cAAc,CAAC,cAAc,CAAC,MAAM,CACpD,WAAyC,EACzC,kCAAqE,EAAE,EAAqC,EAC5G,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;YACtB,OAAO,CAAC,eAAe,CAAC,MAAM,CAAC,YAAY,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;YACjE,OAAO,CAAC,QAAQ,GAAG,kBAAkB,CAAC;YAEtC,MAAM,WAAW,GAAG,UAAU,CAAC,UAAU,CAAC,wBAAwB,CAAC,OAAO,CAAC,CAAC;YAE5E,MAAM,SAAS,GAAG,WAAW,CAAC,KAAK,CAAC;YACpC,MAAM,gBAAgB,GAAG,SAAS,CAAC,eAAe,CAAC,OAAO,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;YAC1E,MAAM,SAAS,GAAG,SAAS,CAAC,eAAe,CAAC,SAAS,CAAC,gBAAgB,CAAC,CAAC;YAExE,MAAM,CAAC,WAAW,CAAC,iBAAiB,EAAE,SAAS,CAAC,CAAC;QACnD,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["// Copyright 2022 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport * as Common from '../../core/common/common.js';\nimport type * as Platform from '../../core/platform/platform.js';\nimport * as SDK from '../../core/sdk/sdk.js';\nimport type * as Protocol from '../../generated/protocol.js';\nimport {describeWithEnvironment} from '../../testing/EnvironmentHelpers.js';\nimport * as Diff from '../../third_party/diff/diff.js';\n\nimport * as PanelUtils from './utils.js';\n\ndescribeWithEnvironment('panels/utils', () => {\n it('formats CSS changes from diff arrays', async () => {\n const original = `\n .container {\n width: 10px;\n height: 10px;\n }\n\n .child {\n display: grid;\n --child-theme-color: 100, 200, 0;\n }\n\n @supports (display: grid) {\n .container {\n display: grid;\n }\n }`;\n const current = `\n .container {\n width: 15px;\n margin: 0;\n }\n\n .child2 {\n display: grid;\n --child-theme-color: 5, 10, 15;\n padding: 10px;\n }\n\n @supports (display: flex) {\n .container {\n display: flex;\n }\n }`;\n const diff = Diff.Diff.DiffWrapper.lineDiff(original.split('\\n'), current.split('\\n'));\n const changes = await PanelUtils.PanelUtils.formatCSSChangesFromDiff(diff);\n assert.strictEqual(\n changes, `.container {\n /* width: 10px; */\n /* height: 10px; */\n width: 15px;\n margin: 0;\n}\n\n/* .child { */\n.child2 {\n /* --child-theme-color: 100, 200, 0; */\n --child-theme-color: 5, 10, 15;\n padding: 10px;\n}\n\n/* @supports (display: grid) { */\n@supports (display: flex) {\n.container {\n /* display: grid; */\n display: flex;\n}`,\n 'formatted CSS changes are not correct');\n });\n\n describe('getIconForNetworkRequest', () => {\n it('creates an error red icon for request with status code 404', async () => {\n const request = SDK.NetworkRequest.NetworkRequest.create(\n 'requestId' as Protocol.Network.RequestId, 'https://www.example.com' as Platform.DevToolsPath.UrlString,\n '' as Platform.DevToolsPath.UrlString, null, null, null);\n request.statusCode = 404;\n\n const iconElement = PanelUtils.PanelUtils.getIconForNetworkRequest(request);\n\n const iconStyle = iconElement.style;\n const indexOfIconImage = iconStyle.webkitMaskImage.indexOf('Images/') + 7;\n const iconImage = iconStyle.webkitMaskImage.substring(indexOfIconImage);\n\n assert.strictEqual('cross-circle-filled.svg\")', iconImage);\n\n const backgroundColorOfIcon = iconStyle.backgroundColor.toString();\n assert.strictEqual(backgroundColorOfIcon, 'var(--icon-error)');\n });\n\n it('show document icon', async () => {\n const request = SDK.NetworkRequest.NetworkRequest.create(\n 'requestId' as Protocol.Network.RequestId, 'https://www.example.com/' as Platform.DevToolsPath.UrlString,\n '' as Platform.DevToolsPath.UrlString, null, null, null);\n request.setResourceType(Common.ResourceType.resourceTypes.Document);\n request.mimeType = 'text/html';\n\n const iconElement = PanelUtils.PanelUtils.getIconForNetworkRequest(request);\n\n const iconStyle = iconElement.style;\n const indexOfIconImage = iconStyle.webkitMaskImage.indexOf('Images/') + 7;\n const iconImage = iconStyle.webkitMaskImage.substring(indexOfIconImage);\n\n assert.strictEqual('file-document.svg\")', iconImage);\n\n const backgroundColorOfIcon = iconStyle.backgroundColor.toString();\n assert.strictEqual(backgroundColorOfIcon, 'var(--icon-file-document)');\n });\n\n it('show media icon', async () => {\n const request = SDK.NetworkRequest.NetworkRequest.create(\n 'requestId' as Protocol.Network.RequestId,\n 'https://www.example.com/test.mp3' as Platform.DevToolsPath.UrlString, '' as Platform.DevToolsPath.UrlString,\n null, null, null);\n request.setResourceType(Common.ResourceType.resourceTypes.Media);\n request.mimeType = 'audio/mpeg';\n\n const iconElement = PanelUtils.PanelUtils.getIconForNetworkRequest(request);\n\n const iconStyle = iconElement.style;\n const indexOfIconImage = iconStyle.webkitMaskImage.indexOf('Images/') + 7;\n const iconImage = iconStyle.webkitMaskImage.substring(indexOfIconImage);\n\n assert.strictEqual('file-media.svg\")', iconImage);\n });\n\n it('show wasm icon', async () => {\n const request = SDK.NetworkRequest.NetworkRequest.create(\n 'requestId' as Protocol.Network.RequestId,\n 'https://www.example.com/test.wasm' as Platform.DevToolsPath.UrlString, '' as Platform.DevToolsPath.UrlString,\n null, null, null);\n request.setResourceType(Common.ResourceType.resourceTypes.Wasm);\n request.mimeType = 'application/wasm';\n\n const iconElement = PanelUtils.PanelUtils.getIconForNetworkRequest(request);\n\n const iconStyle = iconElement.style;\n const indexOfIconImage = iconStyle.webkitMaskImage.indexOf('Images/') + 7;\n const iconImage = iconStyle.webkitMaskImage.substring(indexOfIconImage);\n\n assert.strictEqual('file-wasm.svg\")', iconImage);\n });\n\n it('show websocket icon', async () => {\n const request = SDK.NetworkRequest.NetworkRequest.create(\n 'requestId' as Protocol.Network.RequestId, 'https://www.example.com/ws' as Platform.DevToolsPath.UrlString,\n '' as Platform.DevToolsPath.UrlString, null, null, null);\n request.setResourceType(Common.ResourceType.resourceTypes.WebSocket);\n request.mimeType = '';\n\n const iconElement = PanelUtils.PanelUtils.getIconForNetworkRequest(request);\n\n const iconStyle = iconElement.style;\n const indexOfIconImage = iconStyle.webkitMaskImage.indexOf('Images/') + 7;\n const iconImage = iconStyle.webkitMaskImage.substring(indexOfIconImage);\n\n assert.strictEqual('file-websocket.svg\")', iconImage);\n });\n\n it('shows fetch icon', async () => {\n const request = SDK.NetworkRequest.NetworkRequest.create(\n 'requestId' as Protocol.Network.RequestId,\n 'https://www.example.com/test.json?keepalive=false' as Platform.DevToolsPath.UrlString,\n '' as Platform.DevToolsPath.UrlString, null, null, null);\n request.setResourceType(Common.ResourceType.resourceTypes.Fetch);\n request.mimeType = '';\n\n const iconElement = PanelUtils.PanelUtils.getIconForNetworkRequest(request);\n\n const iconStyle = iconElement.style;\n const indexOfIconImage = iconStyle.webkitMaskImage.indexOf('Images/') + 7;\n const iconImage = iconStyle.webkitMaskImage.substring(indexOfIconImage);\n\n assert.strictEqual('file-fetch-xhr.svg\")', iconImage);\n });\n\n it('shows xhr icon', async () => {\n const request = SDK.NetworkRequest.NetworkRequest.create(\n 'requestId' as Protocol.Network.RequestId,\n 'https://www.example.com/test.json?keepalive=false' as Platform.DevToolsPath.UrlString,\n '' as Platform.DevToolsPath.UrlString, null, null, null);\n request.setResourceType(Common.ResourceType.resourceTypes.XHR);\n request.mimeType = 'application/octet-stream';\n\n const iconElement = PanelUtils.PanelUtils.getIconForNetworkRequest(request);\n\n const iconStyle = iconElement.style;\n const indexOfIconImage = iconStyle.webkitMaskImage.indexOf('Images/') + 7;\n const iconImage = iconStyle.webkitMaskImage.substring(indexOfIconImage);\n\n assert.strictEqual('file-fetch-xhr.svg\")', iconImage);\n });\n\n it('mime win: show image preview icon for xhr-image', async () => {\n const request = SDK.NetworkRequest.NetworkRequest.create(\n 'requestId' as Protocol.Network.RequestId,\n 'https://www.example.com/test.svg' as Platform.DevToolsPath.UrlString, '' as Platform.DevToolsPath.UrlString,\n null, null, null);\n request.setResourceType(Common.ResourceType.resourceTypes.XHR);\n request.mimeType = 'image/svg+xml';\n\n const iconElement = PanelUtils.PanelUtils.getIconForNetworkRequest(request);\n const imagePreview = iconElement.querySelector('.image-network-icon-preview') as HTMLImageElement;\n\n assert.instanceOf(iconElement, HTMLDivElement);\n assert.instanceOf(imagePreview, HTMLImageElement);\n });\n\n it('mime win: show document icon for fetch-html', async () => {\n const request = SDK.NetworkRequest.NetworkRequest.create(\n 'requestId' as Protocol.Network.RequestId, 'https://www.example.com/page' as Platform.DevToolsPath.UrlString,\n '' as Platform.DevToolsPath.UrlString, null, null, null);\n request.setResourceType(Common.ResourceType.resourceTypes.Fetch);\n request.mimeType = 'text/html';\n\n const iconElement = PanelUtils.PanelUtils.getIconForNetworkRequest(request);\n\n const iconStyle = iconElement.style;\n const indexOfIconImage = iconStyle.webkitMaskImage.indexOf('Images/') + 7;\n const iconImage = iconStyle.webkitMaskImage.substring(indexOfIconImage);\n\n assert.strictEqual('file-document.svg\")', iconImage);\n });\n\n it('mime win: show generic icon for preflight-text', async () => {\n const request = SDK.NetworkRequest.NetworkRequest.create(\n 'requestId' as Protocol.Network.RequestId,\n 'https://www.example.com/api/test' as Platform.DevToolsPath.UrlString, '' as Platform.DevToolsPath.UrlString,\n null, null, null);\n request.setResourceType(Common.ResourceType.resourceTypes.Preflight);\n request.mimeType = 'text/plain';\n\n const iconElement = PanelUtils.PanelUtils.getIconForNetworkRequest(request);\n\n const iconStyle = iconElement.style;\n const indexOfIconImage = iconStyle.webkitMaskImage.indexOf('Images/') + 7;\n const iconImage = iconStyle.webkitMaskImage.substring(indexOfIconImage);\n\n assert.strictEqual('file-generic.svg\")', iconImage);\n });\n\n it('mime win: show script icon for other-javascript)', async () => {\n const request = SDK.NetworkRequest.NetworkRequest.create(\n 'requestId' as Protocol.Network.RequestId, 'https://www.example.com/ping' as Platform.DevToolsPath.UrlString,\n '' as Platform.DevToolsPath.UrlString, null, null, null);\n request.setResourceType(Common.ResourceType.resourceTypes.Other);\n request.mimeType = 'application/javascript';\n\n const iconElement = PanelUtils.PanelUtils.getIconForNetworkRequest(request);\n\n const iconStyle = iconElement.style;\n const indexOfIconImage = iconStyle.webkitMaskImage.indexOf('Images/') + 7;\n const iconImage = iconStyle.webkitMaskImage.substring(indexOfIconImage);\n\n assert.strictEqual('file-script.svg\")', iconImage);\n });\n\n it('mime win: shows json icon for fetch-json', async () => {\n const request = SDK.NetworkRequest.NetworkRequest.create(\n 'requestId' as Protocol.Network.RequestId,\n 'https://www.example.com/api/list' as Platform.DevToolsPath.UrlString, '' as Platform.DevToolsPath.UrlString,\n null, null, null);\n request.setResourceType(Common.ResourceType.resourceTypes.Fetch);\n request.mimeType = 'application/json';\n\n const iconElement = PanelUtils.PanelUtils.getIconForNetworkRequest(request);\n\n const iconStyle = iconElement.style;\n const indexOfIconImage = iconStyle.webkitMaskImage.indexOf('Images/') + 7;\n const iconImage = iconStyle.webkitMaskImage.substring(indexOfIconImage);\n\n assert.strictEqual('file-json.svg\")', iconImage);\n });\n });\n});\n"]} \ No newline at end of file diff --git a/public/panels/web_audio/AudioContextSelector.js b/public/panels/web_audio/AudioContextSelector.js index 866eb4999..4fe68d1b0 100644 --- a/public/panels/web_audio/AudioContextSelector.js +++ b/public/panels/web_audio/AudioContextSelector.js @@ -71,7 +71,7 @@ export class AudioContextSelector extends Common.ObjectWrapper.ObjectWrapper { } createElementForItem(item) { const element = document.createElement('div'); - const shadowRoot = UI.UIUtils.createShadowRootWithCoreStyles(element, { cssFile: [audioContextSelectorStyles], delegatesFocus: undefined }); + const shadowRoot = UI.UIUtils.createShadowRootWithCoreStyles(element, { cssFile: [audioContextSelectorStyles] }); const title = shadowRoot.createChild('div', 'title'); UI.UIUtils.createTextChild(title, Platform.StringUtilities.trimEndWithMaxLength(this.titleFor(item), 100)); return element; diff --git a/public/panels/web_audio/AudioContextSelector.js.map b/public/panels/web_audio/AudioContextSelector.js.map index 879cab9a2..1101faf4c 100644 --- a/public/panels/web_audio/AudioContextSelector.js.map +++ b/public/panels/web_audio/AudioContextSelector.js.map @@ -1 +1 @@ -{"version":3,"file":"AudioContextSelector.js","sourceRoot":"","sources":["../../../../../../front_end/panels/web_audio/AudioContextSelector.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,KAAK,MAAM,MAAM,6BAA6B,CAAC;AACtD,OAAO,KAAK,IAAI,MAAM,yBAAyB,CAAC;AAChD,OAAO,KAAK,QAAQ,MAAM,iCAAiC,CAAC;AAE5D,OAAO,KAAK,EAAE,MAAM,2BAA2B,CAAC;AAEhD,OAAO,0BAA0B,MAAM,+BAA+B,CAAC;AAEvE,MAAM,SAAS,GAAG;IAChB;;OAEG;IACH,YAAY,EAAE,iBAAiB;IAC/B;;;OAGG;IACH,aAAa,EAAE,sBAAsB;CACtC,CAAC;AACF,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,iBAAiB,CAAC,0CAA0C,EAAE,SAAS,CAAC,CAAC;AAChG,MAAM,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC;AAEtE,MAAM,OAAO,oBAAqB,SAAQ,MAAM,CAAC,aAAa,CAAC,aAAyB;IAErE,eAAe,CAAoC;IACnD,KAAK,CAA6D;IAClE,QAAQ,CAAmE;IAC3E,mBAAmB,CAAyB;IACrD,uBAAuB,CAA0C;IACzE;QACE,KAAK,EAAE,CAAC;QAER,IAAI,CAAC,eAAe,GAAG,UAAU,CAAC,SAAS,CAAC,YAAY,CAAC,CAAC;QAE1D,IAAI,CAAC,KAAK,GAAG,IAAI,EAAE,CAAC,SAAS,CAAC,SAAS,EAAE,CAAC;QAE1C,IAAI,CAAC,QAAQ,GAAG,IAAI,EAAE,CAAC,YAAY,CAAC,YAAY,CAAC,IAAI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,kDAA0B,IAAI,CAAC,CAAC;IAC/D,CAAC;IAED,KAAK;QACH,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC;IAC5B,CAAC;IAED,QAAQ,CAAC,OAA2C;QAClD,OAAO,GAAG,OAAO,CAAC,WAAW,KAAK,OAAO,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC;IACpE,CAAC;IAED,WAAW;QACT,OAAO,IAAI,CAAC,mBAAmB,CAAC;IAClC,CAAC;CACF","sourcesContent":["// Copyright 2019 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport * as Common from '../../core/common/common.js';\nimport * as i18n from '../../core/i18n/i18n.js';\nimport * as Platform from '../../core/platform/platform.js';\nimport type * as Protocol from '../../generated/protocol.js';\nimport * as UI from '../../ui/legacy/legacy.js';\n\nimport audioContextSelectorStyles from './audioContextSelector.css.js';\n\nconst UIStrings = {\n /**\n *@description Text that shows there is no recording\n */\n noRecordings: '(no recordings)',\n /**\n *@description Label prefix for an audio context selection\n *@example {realtime (1e03ec)} PH1\n */\n audioContextS: 'Audio context: {PH1}',\n};\nconst str_ = i18n.i18n.registerUIStrings('panels/web_audio/AudioContextSelector.ts', UIStrings);\nconst i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);\n\nexport class AudioContextSelector extends Common.ObjectWrapper.ObjectWrapper implements\n UI.SoftDropDown.Delegate {\n private readonly placeholderText: Platform.UIString.LocalizedString;\n private readonly items: UI.ListModel.ListModel;\n private readonly dropDown: UI.SoftDropDown.SoftDropDown;\n private readonly toolbarItemInternal: UI.Toolbar.ToolbarItem;\n private selectedContextInternal: Protocol.WebAudio.BaseAudioContext|null;\n constructor() {\n super();\n\n this.placeholderText = i18nString(UIStrings.noRecordings);\n\n this.items = new UI.ListModel.ListModel();\n\n this.dropDown = new UI.SoftDropDown.SoftDropDown(this.items, this, 'audio-context');\n this.dropDown.setPlaceholderText(this.placeholderText);\n\n this.toolbarItemInternal = new UI.Toolbar.ToolbarItem(this.dropDown.element);\n this.toolbarItemInternal.setEnabled(false);\n this.toolbarItemInternal.setTitle(i18nString(UIStrings.audioContextS, {PH1: this.placeholderText}));\n this.items.addEventListener(UI.ListModel.Events.ITEMS_REPLACED, this.onListItemReplaced, this);\n this.toolbarItemInternal.element.classList.add('toolbar-has-dropdown');\n\n this.selectedContextInternal = null;\n }\n\n private onListItemReplaced(): void {\n const hasItems = Boolean(this.items.length);\n this.toolbarItemInternal.setEnabled(hasItems);\n if (!hasItems) {\n this.toolbarItemInternal.setTitle(i18nString(UIStrings.audioContextS, {PH1: this.placeholderText}));\n }\n }\n\n contextCreated({data: context}: Common.EventTarget.EventTargetEvent): void {\n this.items.insert(this.items.length, context);\n\n // Select if this is the first item.\n if (this.items.length === 1) {\n this.dropDown.selectItem(context);\n }\n }\n\n contextDestroyed({data: contextId}: Common.EventTarget.EventTargetEvent): void {\n const contextIndex =\n this.items.findIndex((context: Protocol.WebAudio.BaseAudioContext) => context.contextId === contextId);\n if (contextIndex > -1) {\n this.items.remove(contextIndex);\n }\n }\n\n contextChanged({data: changedContext}: Common.EventTarget.EventTargetEvent):\n void {\n const contextIndex = this.items.findIndex(\n (context: Protocol.WebAudio.BaseAudioContext) => context.contextId === changedContext.contextId);\n if (contextIndex > -1) {\n this.items.replace(contextIndex, changedContext);\n\n // If the changed context is currently selected by user. Re-select it\n // because the actual element is replaced with a new one.\n if (this.selectedContextInternal && this.selectedContextInternal.contextId === changedContext.contextId) {\n this.dropDown.selectItem(changedContext);\n }\n }\n }\n\n createElementForItem(item: Protocol.WebAudio.BaseAudioContext): Element {\n const element = document.createElement('div');\n const shadowRoot = UI.UIUtils.createShadowRootWithCoreStyles(\n element, {cssFile: [audioContextSelectorStyles], delegatesFocus: undefined});\n const title = shadowRoot.createChild('div', 'title');\n UI.UIUtils.createTextChild(title, Platform.StringUtilities.trimEndWithMaxLength(this.titleFor(item), 100));\n return element;\n }\n\n selectedContext(): Protocol.WebAudio.BaseAudioContext|null {\n if (!this.selectedContextInternal) {\n return null;\n }\n\n return this.selectedContextInternal;\n }\n\n highlightedItemChanged(\n from: Protocol.WebAudio.BaseAudioContext|null, to: Protocol.WebAudio.BaseAudioContext|null,\n fromElement: Element|null, toElement: Element|null): void {\n if (fromElement) {\n fromElement.classList.remove('highlighted');\n }\n if (toElement) {\n toElement.classList.add('highlighted');\n }\n }\n\n isItemSelectable(_item: Protocol.WebAudio.BaseAudioContext): boolean {\n return true;\n }\n\n itemSelected(item: Protocol.WebAudio.BaseAudioContext|null): void {\n if (!item) {\n return;\n }\n\n // It's possible that no context is selected yet.\n if (!this.selectedContextInternal || this.selectedContextInternal.contextId !== item.contextId) {\n this.selectedContextInternal = item;\n this.toolbarItemInternal.setTitle(i18nString(UIStrings.audioContextS, {PH1: this.titleFor(item)}));\n }\n\n this.dispatchEventToListeners(Events.CONTEXT_SELECTED, item);\n }\n\n reset(): void {\n this.items.replaceAll([]);\n }\n\n titleFor(context: Protocol.WebAudio.BaseAudioContext): string {\n return `${context.contextType} (${context.contextId.substr(-6)})`;\n }\n\n toolbarItem(): UI.Toolbar.ToolbarItem {\n return this.toolbarItemInternal;\n }\n}\n\nexport const enum Events {\n CONTEXT_SELECTED = 'ContextSelected',\n}\n\nexport type EventTypes = {\n [Events.CONTEXT_SELECTED]: Protocol.WebAudio.BaseAudioContext|null,\n};\n"]} \ No newline at end of file +{"version":3,"file":"AudioContextSelector.js","sourceRoot":"","sources":["../../../../../../front_end/panels/web_audio/AudioContextSelector.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,KAAK,MAAM,MAAM,6BAA6B,CAAC;AACtD,OAAO,KAAK,IAAI,MAAM,yBAAyB,CAAC;AAChD,OAAO,KAAK,QAAQ,MAAM,iCAAiC,CAAC;AAE5D,OAAO,KAAK,EAAE,MAAM,2BAA2B,CAAC;AAEhD,OAAO,0BA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AAyB,EAAE,SAAuB;QACpD,IAAI,WAAW,EAAE,CAAC;YAChB,WAAW,CAAC,SAAS,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC;QAC9C,CAAC;QACD,IAAI,SAAS,EAAE,CAAC;YACd,SAAS,CAAC,SAAS,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;QACzC,CAAC;IACH,CAAC;IAED,gBAAgB,CAAC,KAAyC;QACxD,OAAO,IAAI,CAAC;IACd,CAAC;IAED,YAAY,CAAC,IAA6C;QACxD,IAAI,CAAC,IAAI,EAAE,CAAC;YACV,OAAO;QACT,CAAC;QAED,iDAAiD;QACjD,IAAI,CAAC,IAAI,CAAC,uBAAuB,IAAI,IAAI,CAAC,uBAAuB,CAAC,SAAS,KAAK,IAAI,CAAC,SAAS,EAAE,CAAC;YAC/F,IAAI,CAAC,uBAAuB,GAAG,IAAI,CAAC;YACpC,IAAI,CAAC,mBAAmB,CAAC,QAAQ,CAAC,UAAU,CAAC,SAAS,CAAC,aAAa,EAAE,EAAC,GAAG,EAAE,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAC,CAAC,CAAC,CAAC;QACrG,CAAC;QAED,IAAI,CAAC,wBAAwB,kDAA0B,IAAI,CAAC,CAAC;IAC/D,CAAC;IAED,KAAK;QACH,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC;IAC5B,CAAC;IAED,QAAQ,CAAC,OAA2C;QAClD,OAAO,GAAG,OAAO,CAAC,WAAW,KAAK,OAAO,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC;IACpE,CAAC;IAED,WAAW;QACT,OAAO,IAAI,CAAC,mBAAmB,CAAC;IAClC,CAAC;CACF","sourcesContent":["// Copyright 2019 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport * as Common from '../../core/common/common.js';\nimport * as i18n from '../../core/i18n/i18n.js';\nimport * as Platform from '../../core/platform/platform.js';\nimport type * as Protocol from '../../generated/protocol.js';\nimport * as UI from '../../ui/legacy/legacy.js';\n\nimport audioContextSelectorStyles from './audioContextSelector.css.js';\n\nconst UIStrings = {\n /**\n *@description Text that shows there is no recording\n */\n noRecordings: '(no recordings)',\n /**\n *@description Label prefix for an audio context selection\n *@example {realtime (1e03ec)} PH1\n */\n audioContextS: 'Audio context: {PH1}',\n};\nconst str_ = i18n.i18n.registerUIStrings('panels/web_audio/AudioContextSelector.ts', UIStrings);\nconst i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);\n\nexport class AudioContextSelector extends Common.ObjectWrapper.ObjectWrapper implements\n UI.SoftDropDown.Delegate {\n private readonly placeholderText: Platform.UIString.LocalizedString;\n private readonly items: UI.ListModel.ListModel;\n private readonly dropDown: UI.SoftDropDown.SoftDropDown;\n private readonly toolbarItemInternal: UI.Toolbar.ToolbarItem;\n private selectedContextInternal: Protocol.WebAudio.BaseAudioContext|null;\n constructor() {\n super();\n\n this.placeholderText = i18nString(UIStrings.noRecordings);\n\n this.items = new UI.ListModel.ListModel();\n\n this.dropDown = new UI.SoftDropDown.SoftDropDown(this.items, this, 'audio-context');\n this.dropDown.setPlaceholderText(this.placeholderText);\n\n this.toolbarItemInternal = new UI.Toolbar.ToolbarItem(this.dropDown.element);\n this.toolbarItemInternal.setEnabled(false);\n this.toolbarItemInternal.setTitle(i18nString(UIStrings.audioContextS, {PH1: this.placeholderText}));\n this.items.addEventListener(UI.ListModel.Events.ITEMS_REPLACED, this.onListItemReplaced, this);\n this.toolbarItemInternal.element.classList.add('toolbar-has-dropdown');\n\n this.selectedContextInternal = null;\n }\n\n private onListItemReplaced(): void {\n const hasItems = Boolean(this.items.length);\n this.toolbarItemInternal.setEnabled(hasItems);\n if (!hasItems) {\n this.toolbarItemInternal.setTitle(i18nString(UIStrings.audioContextS, {PH1: this.placeholderText}));\n }\n }\n\n contextCreated({data: context}: Common.EventTarget.EventTargetEvent): void {\n this.items.insert(this.items.length, context);\n\n // Select if this is the first item.\n if (this.items.length === 1) {\n this.dropDown.selectItem(context);\n }\n }\n\n contextDestroyed({data: contextId}: Common.EventTarget.EventTargetEvent): void {\n const contextIndex =\n this.items.findIndex((context: Protocol.WebAudio.BaseAudioContext) => context.contextId === contextId);\n if (contextIndex > -1) {\n this.items.remove(contextIndex);\n }\n }\n\n contextChanged({data: changedContext}: Common.EventTarget.EventTargetEvent):\n void {\n const contextIndex = this.items.findIndex(\n (context: Protocol.WebAudio.BaseAudioContext) => context.contextId === changedContext.contextId);\n if (contextIndex > -1) {\n this.items.replace(contextIndex, changedContext);\n\n // If the changed context is currently selected by user. Re-select it\n // because the actual element is replaced with a new one.\n if (this.selectedContextInternal && this.selectedContextInternal.contextId === changedContext.contextId) {\n this.dropDown.selectItem(changedContext);\n }\n }\n }\n\n createElementForItem(item: Protocol.WebAudio.BaseAudioContext): Element {\n const element = document.createElement('div');\n const shadowRoot = UI.UIUtils.createShadowRootWithCoreStyles(element, {cssFile: [audioContextSelectorStyles]});\n const title = shadowRoot.createChild('div', 'title');\n UI.UIUtils.createTextChild(title, Platform.StringUtilities.trimEndWithMaxLength(this.titleFor(item), 100));\n return element;\n }\n\n selectedContext(): Protocol.WebAudio.BaseAudioContext|null {\n if (!this.selectedContextInternal) {\n return null;\n }\n\n return this.selectedContextInternal;\n }\n\n highlightedItemChanged(\n from: Protocol.WebAudio.BaseAudioContext|null, to: Protocol.WebAudio.BaseAudioContext|null,\n fromElement: Element|null, toElement: Element|null): void {\n if (fromElement) {\n fromElement.classList.remove('highlighted');\n }\n if (toElement) {\n toElement.classList.add('highlighted');\n }\n }\n\n isItemSelectable(_item: Protocol.WebAudio.BaseAudioContext): boolean {\n return true;\n }\n\n itemSelected(item: Protocol.WebAudio.BaseAudioContext|null): void {\n if (!item) {\n return;\n }\n\n // It's possible that no context is selected yet.\n if (!this.selectedContextInternal || this.selectedContextInternal.contextId !== item.contextId) {\n this.selectedContextInternal = item;\n this.toolbarItemInternal.setTitle(i18nString(UIStrings.audioContextS, {PH1: this.titleFor(item)}));\n }\n\n this.dispatchEventToListeners(Events.CONTEXT_SELECTED, item);\n }\n\n reset(): void {\n this.items.replaceAll([]);\n }\n\n titleFor(context: Protocol.WebAudio.BaseAudioContext): string {\n return `${context.contextType} (${context.contextId.substr(-6)})`;\n }\n\n toolbarItem(): UI.Toolbar.ToolbarItem {\n return this.toolbarItemInternal;\n }\n}\n\nexport const enum Events {\n CONTEXT_SELECTED = 'ContextSelected',\n}\n\nexport type EventTypes = {\n [Events.CONTEXT_SELECTED]: Protocol.WebAudio.BaseAudioContext|null,\n};\n"]} \ No newline at end of file diff --git a/public/panels/webauthn/WebauthnPane.js b/public/panels/webauthn/WebauthnPane.js index ce69858b5..fca81c1bf 100644 --- a/public/panels/webauthn/WebauthnPane.js +++ b/public/panels/webauthn/WebauthnPane.js @@ -573,10 +573,10 @@ export class WebauthnPaneImpl extends UI.Widget.VBox { UI.ARIAUtils.markAsHeading(titleElement, 2); await this.#clearActiveAuthenticator(); const activeButtonContainer = headerElement.createChild('div', 'active-button-container'); - const activeLabel = UI.UIUtils.createRadioLabel(`active-authenticator-${authenticatorId}`, i18nString(UIStrings.active)); - activeLabel.radioElement.addEventListener('change', this.#setActiveAuthenticator.bind(this, authenticatorId)); + const { label: activeLabel, radio: activeRadio } = UI.UIUtils.createRadioButton('active-authenticator', i18nString(UIStrings.active), 'webauthn.active-authenticator'); + activeRadio.addEventListener('change', this.#setActiveAuthenticator.bind(this, authenticatorId)); + activeRadio.checked = true; activeButtonContainer.appendChild(activeLabel); - activeLabel.radioElement.checked = true; this.#activeAuthId = authenticatorId; // Newly added authenticator is automatically set as active. const removeButton = headerElement.createChild('button', 'text-button'); removeButton.textContent = i18nString(UIStrings.remove); @@ -691,7 +691,7 @@ export class WebauthnPaneImpl extends UI.Widget.VBox { this.#updateActiveLabelTitle(activeLabel, name); } #updateActiveLabelTitle(activeLabel, authenticatorName) { - UI.Tooltip.Tooltip.install(activeLabel.radioElement, i18nString(UIStrings.setSAsTheActiveAuthenticator, { PH1: authenticatorName })); + UI.Tooltip.Tooltip.install(activeLabel, i18nString(UIStrings.setSAsTheActiveAuthenticator, { PH1: authenticatorName })); } /** * Removes both the authenticator and its respective UI element. @@ -761,7 +761,7 @@ export class WebauthnPaneImpl extends UI.Widget.VBox { #updateActiveButtons() { const authenticators = this.#authenticatorsView.getElementsByClassName('authenticator-section'); Array.from(authenticators).forEach((authenticator) => { - const button = authenticator.querySelector('input.dt-radio-button'); + const button = authenticator.querySelector('input[type="radio"]'); if (!button) { return; } diff --git a/public/panels/webauthn/WebauthnPane.js.map b/public/panels/webauthn/WebauthnPane.js.map index 1b74df7fa..bf23e1707 100644 --- a/public/panels/webauthn/WebauthnPane.js.map +++ b/public/panels/webauthn/WebauthnPane.js.map @@ -1 +1 @@ -{"version":3,"file":"WebauthnPane.js","sourceRoot":"","sources":["../../../../../../front_end/panels/webauthn/WebauthnPane.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,KAAK,MAAM,MAAM,6BAA6B,CAAC;AACtD,OAAO,KAAK,IAAI,MAAM,yBAAyB,CAAC;AAChD,OAAO,KAAK,IAAI,MAAM,yBAAyB,CAAC;AAChD,OAAO,KAAK,GAAG,MAAM,uBAAuB,CAAC;AAG7C,OAAO,KAAK,QAAQ,MAAM,mDAAmD,CAAC;AAC9E,OAAO,KAAK,EAAE,MAAM,2BAA2B,CAAC;AAChD,OAAO,KAAK,aAAa,MAAM,2CAA2C,CAAC;AAE3E,OAAO,kBAAkB,MAAM,uBAAuB,CAAC;AAEvD,MAAM,SAAS,GAAG;IAChB;;OAEG;IACH,MAAM,EAAE,QAAQ;IAChB;;OAEG;IACH,MAAM,EAAE,QAAQ;IAChB;;;OAGG;IACH,gCAAgC,EAAE,sDAAsD;IACxF;;OAEG;IACH,0BAA0B,EAAE,0CAA0C;IACtE;;OAEG;IACH,EAAE,EAAE,IAAI;IACR;;OA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BAA0B,CAAC,CAAC;QAEpE,IAAI,CAAC,oBAAoB,EAAE,CAAC;IAC9B,CAAC;IAED,oBAAoB;QAClB,MAAM,cAAc,GAAG,IAAI,CAAC,mBAAmB,CAAC,sBAAsB,CAAC,uBAAuB,CAAC,CAAC;QAChG,KAAK,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,OAAO,CAAC,CAAC,aAAsB,EAAE,EAAE;YAC5D,MAAM,MAAM,GAAI,aAAa,CAAC,aAAa,CAAC,uBAAuB,CAAsB,CAAC;YAC1F,IAAI,CAAC,MAAM,EAAE,CAAC;gBACZ,OAAO;YACT,CAAC;YACD,MAAM,CAAC,OAAO,GAAI,aAA6B,CAAC,OAAO,CAAC,eAAe,KAAK,IAAI,CAAC,aAAa,CAAC;QACjG,CAAC,CAAC,CAAC;IACL,CAAC;IAED,KAAK,CAAC,yBAAyB;QAC7B,IAAI,IAAI,CAAC,aAAa,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;YACtC,MAAM,IAAI,CAAC,MAAM,CAAC,8BAA8B,CAAC,IAAI,CAAC,aAAa,EAAE,KAAK,CAAC,CAAC;QAC9E,CAAC;QACD,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC;QAC1B,IAAI,CAAC,oBAAoB,EAAE,CAAC;IAC9B,CAAC;IACQ,QAAQ;QACf,KAAK,CAAC,QAAQ,EAAE,CAAC;QACjB,IAAI,CAAC,gBAAgB,CAAC,CAAC,kBAAkB,CAAC,CAAC,CAAC;IAC9C,CAAC;CACF","sourcesContent":["// Copyright 2020 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport * as Common from '../../core/common/common.js';\nimport * as Host from '../../core/host/host.js';\nimport * as i18n from '../../core/i18n/i18n.js';\nimport * as SDK from '../../core/sdk/sdk.js';\nimport * as Protocol from '../../generated/protocol.js';\nimport type * as Buttons from '../../ui/components/buttons/buttons.js';\nimport * as DataGrid from '../../ui/legacy/components/data_grid/data_grid.js';\nimport * as UI from '../../ui/legacy/legacy.js';\nimport * as VisualLogging from '../../ui/visual_logging/visual_logging.js';\n\nimport webauthnPaneStyles from './webauthnPane.css.js';\n\nconst UIStrings = {\n /**\n *@description Label for button that allows user to download the private key related to a credential.\n */\n export: 'Export',\n /**\n *@description Label for an item to remove something\n */\n remove: 'Remove',\n /**\n *@description Label for empty credentials table.\n *@example {navigator.credentials.create()} PH1\n */\n noCredentialsTryCallingSFromYour: 'No credentials. Try calling {PH1} from your website.',\n /**\n *@description Label for checkbox to toggle the virtual authenticator environment allowing user to interact with software-based virtual authenticators.\n */\n enableVirtualAuthenticator: 'Enable virtual authenticator environment',\n /**\n *@description Label for ID field for credentials.\n */\n id: 'ID',\n /**\n *@description Label for field that describes whether a credential is a resident credential.\n */\n isResident: 'Is Resident',\n /**\n *@description Label for credential field that represents the Relying Party ID that the credential is scoped to.\n */\n rpId: 'RP ID',\n /**\n *@description Label for a column in a table. A field/unique ID that represents the user a credential is mapped to.\n */\n userHandle: 'User Handle',\n /**\n *@description Label for signature counter field for credentials which represents the number of successful assertions.\n * See https://w3c.github.io/webauthn/#signature-counter.\n */\n signCount: 'Signature Count',\n /**\n *@description Label for column with actions for credentials.\n */\n actions: 'Actions',\n /**\n *@description Title for the table that holds the credentials that a authenticator has registered.\n */\n credentials: 'Credentials',\n /**\n *@description Label for the learn more link that is shown before the virtual environment is enabled.\n */\n useWebauthnForPhishingresistant: 'Use WebAuthn for phishing-resistant authentication',\n /**\n *@description Text that is usually a hyperlink to more documentation\n */\n learnMore: 'Learn more',\n /**\n *@description Title for section of interface that allows user to add a new virtual authenticator.\n */\n newAuthenticator: 'New authenticator',\n /**\n *@description Text for security or network protocol\n */\n protocol: 'Protocol',\n /**\n *@description Label for input to select which transport option to use on virtual authenticators, e.g. USB or Bluetooth.\n */\n transport: 'Transport',\n /**\n *@description Label for checkbox that toggles resident key support on virtual authenticators.\n */\n supportsResidentKeys: 'Supports resident keys',\n /**\n *@description Label for checkbox that toggles large blob support on virtual authenticators. Large blobs are opaque data associated\n * with a WebAuthn credential that a website can store, like an SSH certificate or a symmetric encryption key.\n * See https://w3c.github.io/webauthn/#sctn-large-blob-extension\n */\n supportsLargeBlob: 'Supports large blob',\n /**\n *@description Text to add something\n */\n add: 'Add',\n /**\n *@description Label for button to add a new virtual authenticator.\n */\n addAuthenticator: 'Add authenticator',\n /**\n *@description Label for radio button that toggles whether an authenticator is active.\n */\n active: 'Active',\n /**\n *@description Title for button that enables user to customize name of authenticator.\n */\n editName: 'Edit name',\n /**\n *@description Placeholder for the input box to customize name of authenticator.\n */\n enterNewName: 'Enter new name',\n /**\n *@description Title for button that enables user to save name of authenticator after editing it.\n */\n saveName: 'Save name',\n /**\n *@description Title for a user-added virtual authenticator which is uniquely identified with its AUTHENTICATORID.\n *@example {8c7873be-0b13-4996-a794-1521331bbd96} PH1\n */\n authenticatorS: 'Authenticator {PH1}',\n /**\n *@description Name for generated file which user can download. A private key is a secret code which enables encoding and decoding of a credential. .pem is the file extension.\n */\n privateKeypem: 'Private key.pem',\n /**\n *@description Label for field that holds an authenticator's universally unique identifier (UUID).\n */\n uuid: 'UUID',\n /**\n *@description Label for checkbox that toggles user verification support on virtual authenticators.\n */\n supportsUserVerification: 'Supports user verification',\n /**\n *@description Text in Timeline indicating that input has happened recently\n */\n yes: 'Yes',\n /**\n *@description Text in Timeline indicating that input has not happened recently\n */\n no: 'No',\n /**\n *@description Title of radio button that sets an authenticator as active.\n *@example {Authenticator ABCDEF} PH1\n */\n setSAsTheActiveAuthenticator: 'Set {PH1} as the active authenticator',\n};\nconst str_ = i18n.i18n.registerUIStrings('panels/webauthn/WebauthnPane.ts', UIStrings);\nconst i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);\n\nconst enum Events {\n EXPORT_CREDENTIAL = 'ExportCredential',\n REMOVE_CREDENTIAL = 'RemoveCredential',\n}\n\ntype EventTypes = {\n [Events.EXPORT_CREDENTIAL]: Protocol.WebAuthn.Credential,\n [Events.REMOVE_CREDENTIAL]: Protocol.WebAuthn.Credential,\n};\n\nclass DataGridNode extends DataGrid.DataGrid.DataGridNode {\n constructor(private readonly credential: Protocol.WebAuthn.Credential) {\n super(credential);\n }\n\n override nodeSelfHeight(): number {\n return 24;\n }\n\n override createCell(columnId: string): HTMLElement {\n const cell = super.createCell(columnId);\n UI.Tooltip.Tooltip.install(cell, cell.textContent || '');\n\n if (columnId !== 'actions') {\n return cell;\n }\n\n const exportButton = UI.UIUtils.createTextButton(i18nString(UIStrings.export), () => {\n if (this.dataGrid) {\n (this.dataGrid as WebauthnDataGrid).dispatchEventToListeners(Events.EXPORT_CREDENTIAL, this.credential);\n }\n }, {jslogContext: 'webauthn.export-credential'});\n\n cell.appendChild(exportButton);\n\n const removeButton = UI.UIUtils.createTextButton(i18nString(UIStrings.remove), () => {\n if (this.dataGrid) {\n (this.dataGrid as WebauthnDataGrid).dispatchEventToListeners(Events.REMOVE_CREDENTIAL, this.credential);\n }\n }, {jslogContext: 'webauthn.remove-credential'});\n\n cell.appendChild(removeButton);\n\n return cell;\n }\n}\n\nclass WebauthnDataGridBase extends DataGrid.DataGrid.DataGridImpl {}\nclass WebauthnDataGrid extends Common.ObjectWrapper.eventMixin(\n WebauthnDataGridBase) {}\n\nclass EmptyDataGridNode extends DataGrid.DataGrid.DataGridNode {\n override createCells(element: Element): void {\n element.removeChildren();\n const td = (this.createTDWithClass(DataGrid.DataGrid.Align.CENTER) as HTMLTableCellElement);\n if (this.dataGrid) {\n td.colSpan = this.dataGrid.visibleColumnsArray.length;\n }\n\n const code = document.createElement('span', {is: 'source-code'});\n code.textContent = 'navigator.credentials.create()';\n code.classList.add('code');\n const message = i18n.i18n.getFormatLocalizedString(str_, UIStrings.noCredentialsTryCallingSFromYour, {PH1: code});\n\n td.appendChild(message);\n element.appendChild(td);\n }\n}\n\ntype AvailableAuthenticatorOptions = Protocol.WebAuthn.VirtualAuthenticatorOptions&{\n active: boolean,\n authenticatorId: Protocol.WebAuthn.AuthenticatorId,\n};\n\n// We extrapolate this variable as otherwise git detects a private key, even though we\n// perform string manipulation. If we extract the name, then the regex doesn't match\n// and we can upload as expected.\nconst PRIVATE_NAME = 'PRIVATE';\nconst PRIVATE_KEY_HEADER = `-----BEGIN ${PRIVATE_NAME} KEY-----\n`;\nconst PRIVATE_KEY_FOOTER = `-----END ${PRIVATE_NAME} KEY-----`;\n\nconst PROTOCOL_AUTHENTICATOR_VALUES: Protocol.EnumerableEnum = {\n Ctap2: Protocol.WebAuthn.AuthenticatorProtocol.Ctap2,\n U2f: Protocol.WebAuthn.AuthenticatorProtocol.U2f,\n};\n\nexport class WebauthnPaneImpl extends UI.Widget.VBox implements\n SDK.TargetManager.SDKModelObserver {\n #activeAuthId: Protocol.WebAuthn.AuthenticatorId|null = null;\n #hasBeenEnabled = false;\n readonly dataGrids = new Map>();\n #enableCheckbox!: UI.Toolbar.ToolbarCheckbox;\n readonly #availableAuthenticatorSetting: Common.Settings.Setting;\n #model?: SDK.WebAuthnModel.WebAuthnModel;\n #authenticatorsView: HTMLElement;\n #topToolbarContainer: HTMLElement|undefined;\n #topToolbar: UI.Toolbar.Toolbar|undefined;\n #learnMoreView: HTMLElement|undefined;\n #newAuthenticatorSection: HTMLElement|undefined;\n #newAuthenticatorForm: HTMLElement|undefined;\n #protocolSelect: HTMLSelectElement|undefined;\n transportSelect: HTMLSelectElement|undefined;\n #residentKeyCheckboxLabel: UI.UIUtils.CheckboxLabel|undefined;\n residentKeyCheckbox: HTMLInputElement|undefined;\n #userVerificationCheckboxLabel: UI.UIUtils.CheckboxLabel|undefined;\n #userVerificationCheckbox: HTMLInputElement|undefined;\n #largeBlobCheckboxLabel: UI.UIUtils.CheckboxLabel|undefined;\n largeBlobCheckbox: HTMLInputElement|undefined;\n addAuthenticatorButton: Buttons.Button.Button|undefined;\n #isEnabling?: Promise;\n\n constructor() {\n super(true);\n\n this.element.setAttribute('jslog', `${VisualLogging.panel('webauthn').track({resize: true})}`);\n\n SDK.TargetManager.TargetManager.instance().observeModels(SDK.WebAuthnModel.WebAuthnModel, this, {scoped: true});\n\n this.contentElement.classList.add('webauthn-pane');\n\n this.#availableAuthenticatorSetting =\n Common.Settings.Settings.instance().createSetting(\n 'webauthn-authenticators', []);\n\n this.#createToolbar();\n this.#authenticatorsView = this.contentElement.createChild('div', 'authenticators-view');\n this.#createNewAuthenticatorSection();\n this.#updateVisibility(false);\n }\n\n modelAdded(model: SDK.WebAuthnModel.WebAuthnModel): void {\n if (model.target() === model.target().outermostTarget()) {\n this.#model = model;\n }\n }\n\n modelRemoved(model: SDK.WebAuthnModel.WebAuthnModel): void {\n if (model.target() === model.target().outermostTarget()) {\n this.#model = undefined;\n }\n }\n\n async #loadInitialAuthenticators(): Promise {\n let activeAuthenticatorId: Protocol.WebAuthn.AuthenticatorId|null = null;\n const availableAuthenticators = this.#availableAuthenticatorSetting.get();\n for (const options of availableAuthenticators) {\n if (!this.#model) {\n continue;\n }\n\n const authenticatorId = await this.#model.addAuthenticator(options);\n void this.#addAuthenticatorSection(authenticatorId, options);\n // Update the authenticatorIds in the options.\n options.authenticatorId = authenticatorId;\n if (options.active) {\n activeAuthenticatorId = authenticatorId;\n }\n }\n\n // Update the settings to reflect the new authenticatorIds.\n this.#availableAuthenticatorSetting.set(availableAuthenticators);\n if (activeAuthenticatorId) {\n void this.#setActiveAuthenticator(activeAuthenticatorId);\n }\n }\n\n override async ownerViewDisposed(): Promise {\n if (this.#enableCheckbox) {\n this.#enableCheckbox.setChecked(false);\n }\n await this.#setVirtualAuthEnvEnabled(false);\n }\n\n #createToolbar(): void {\n this.#topToolbarContainer = this.contentElement.createChild('div', 'webauthn-toolbar-container');\n this.#topToolbarContainer.setAttribute('jslog', `${VisualLogging.toolbar()}`);\n this.#topToolbar = new UI.Toolbar.Toolbar('webauthn-toolbar', this.#topToolbarContainer);\n const enableCheckboxTitle = i18nString(UIStrings.enableVirtualAuthenticator);\n this.#enableCheckbox =\n new UI.Toolbar.ToolbarCheckbox(enableCheckboxTitle, enableCheckboxTitle, this.#handleCheckboxToggle.bind(this));\n this.#enableCheckbox.inputElement.setAttribute(\n 'jslog', `${VisualLogging.toggle('virtual-authenticators').track({click: true})}`);\n this.#topToolbar.appendToolbarItem(this.#enableCheckbox);\n }\n\n #createCredentialsDataGrid(authenticatorId: Protocol.WebAuthn.AuthenticatorId):\n DataGrid.DataGrid.DataGridImpl {\n const columns = ([\n {\n id: 'credentialId',\n title: i18nString(UIStrings.id),\n longText: true,\n weight: 24,\n },\n {\n id: 'isResidentCredential',\n title: i18nString(UIStrings.isResident),\n dataType: DataGrid.DataGrid.DataType.BOOLEAN,\n weight: 10,\n },\n {\n id: 'rpId',\n title: i18nString(UIStrings.rpId),\n },\n {\n id: 'userHandle',\n title: i18nString(UIStrings.userHandle),\n },\n {\n id: 'signCount',\n title: i18nString(UIStrings.signCount),\n },\n {id: 'actions', title: i18nString(UIStrings.actions)},\n ] as DataGrid.DataGrid.ColumnDescriptor[]);\n\n const dataGridConfig = {\n displayName: i18nString(UIStrings.credentials),\n columns,\n editCallback: undefined,\n deleteCallback: undefined,\n refreshCallback: undefined,\n };\n const dataGrid = new WebauthnDataGrid(dataGridConfig);\n dataGrid.renderInline();\n dataGrid.setStriped(true);\n dataGrid.addEventListener(Events.EXPORT_CREDENTIAL, this.#handleExportCredential, this);\n dataGrid.addEventListener(Events.REMOVE_CREDENTIAL, this.#handleRemoveCredential.bind(this, authenticatorId));\n dataGrid.rootNode().appendChild(new EmptyDataGridNode());\n\n this.dataGrids.set(authenticatorId, dataGrid);\n\n return dataGrid;\n }\n\n #handleExportCredential({data: credential}: Common.EventTarget.EventTargetEvent): void {\n this.#exportCredential(credential);\n }\n\n #handleRemoveCredential(authenticatorId: Protocol.WebAuthn.AuthenticatorId, {\n data: credential,\n }: Common.EventTarget.EventTargetEvent): void {\n void this.#removeCredential(authenticatorId, credential.credentialId);\n }\n\n #addCredential(authenticatorId: Protocol.WebAuthn.AuthenticatorId, {\n data: event,\n }: Common.EventTarget.EventTargetEvent): void {\n const dataGrid = this.dataGrids.get(authenticatorId);\n if (!dataGrid) {\n return;\n }\n const emptyNode = dataGrid.rootNode().children.find(node => !Object.keys(node.data).length);\n if (emptyNode) {\n dataGrid.rootNode().removeChild(emptyNode);\n }\n const node = new DataGridNode(event.credential);\n dataGrid.rootNode().appendChild(node);\n }\n\n #updateCredential(\n authenticatorId: Protocol.WebAuthn.AuthenticatorId,\n {\n data: event,\n }: Common.EventTarget\n .EventTargetEvent): void {\n const dataGrid = this.dataGrids.get(authenticatorId);\n if (!dataGrid) {\n return;\n }\n const node = dataGrid.rootNode().children.find(node => node.data?.credentialId === event.credential.credentialId);\n if (!node) {\n return;\n }\n node.data = event.credential;\n }\n\n #deleteCredential(authenticatorId: Protocol.WebAuthn.AuthenticatorId, {\n data: event,\n }: Common.EventTarget.EventTargetEvent): void {\n const dataGrid = this.dataGrids.get(authenticatorId);\n if (!dataGrid) {\n return;\n }\n const node = dataGrid.rootNode().children.find(node => node.data?.credentialId === event.credentialId);\n if (!node) {\n return;\n }\n node.remove();\n }\n\n async #setVirtualAuthEnvEnabled(enable: boolean): Promise {\n await this.#isEnabling;\n this.#isEnabling = new Promise(async (resolve: (value: void) => void) => {\n if (enable && !this.#hasBeenEnabled) {\n // Ensures metric is only tracked once per session.\n Host.userMetrics.actionTaken(Host.UserMetrics.Action.VirtualAuthenticatorEnvironmentEnabled);\n this.#hasBeenEnabled = true;\n }\n if (this.#model) {\n await this.#model.setVirtualAuthEnvEnabled(enable);\n }\n\n if (enable) {\n await this.#loadInitialAuthenticators();\n } else {\n this.#removeAuthenticatorSections();\n }\n\n this.#updateVisibility(enable);\n this.#isEnabling = undefined;\n resolve();\n });\n }\n\n #updateVisibility(enabled: boolean): void {\n this.contentElement.classList.toggle('enabled', enabled);\n }\n\n #removeAuthenticatorSections(): void {\n this.#authenticatorsView.innerHTML = '';\n for (const dataGrid of this.dataGrids.values()) {\n dataGrid.asWidget().detach();\n }\n this.dataGrids.clear();\n }\n\n #handleCheckboxToggle(e: MouseEvent): void {\n void this.#setVirtualAuthEnvEnabled((e.target as HTMLInputElement).checked);\n }\n\n #updateEnabledTransportOptions(enabledOptions: Protocol.WebAuthn.AuthenticatorTransport[]): void {\n if (!this.transportSelect) {\n return;\n }\n\n const prevValue = this.transportSelect.value;\n this.transportSelect.removeChildren();\n\n for (const option of enabledOptions) {\n this.transportSelect.appendChild(UI.UIUtils.createOption(option, option, option));\n }\n\n // Make sure the currently selected value stays the same.\n this.transportSelect.value = prevValue;\n // If the new set does not include the previous value.\n if (!this.transportSelect.value) {\n // Select the first available value.\n this.transportSelect.selectedIndex = 0;\n }\n this.#updateInternalTransportAvailability();\n }\n\n #updateInternalTransportAvailability(): void {\n if (!this.transportSelect?.options) {\n return;\n }\n const hasInternal = Boolean(this.#availableAuthenticatorSetting.get().find(\n authenticator => authenticator.transport === Protocol.WebAuthn.AuthenticatorTransport.Internal));\n for (let i = 0; i < this.transportSelect.options.length; ++i) {\n const option = this.transportSelect.options[i];\n if (option.value === Protocol.WebAuthn.AuthenticatorTransport.Internal) {\n option.disabled = hasInternal;\n // This relies on \"internal\" never being the first or only element.\n if (i === this.transportSelect.selectedIndex) {\n --this.transportSelect.selectedIndex;\n }\n break;\n }\n }\n }\n\n #updateNewAuthenticatorSectionOptions(): void {\n if (!this.#protocolSelect || !this.residentKeyCheckbox || !this.#userVerificationCheckbox ||\n !this.largeBlobCheckbox) {\n return;\n }\n\n if (this.#protocolSelect.value === Protocol.WebAuthn.AuthenticatorProtocol.Ctap2) {\n this.residentKeyCheckbox.disabled = false;\n this.#userVerificationCheckbox.disabled = false;\n this.largeBlobCheckbox.disabled = !this.residentKeyCheckbox.checked;\n if (this.largeBlobCheckbox.disabled) {\n this.largeBlobCheckbox.checked = false;\n }\n this.#updateEnabledTransportOptions([\n Protocol.WebAuthn.AuthenticatorTransport.Usb,\n Protocol.WebAuthn.AuthenticatorTransport.Ble,\n Protocol.WebAuthn.AuthenticatorTransport.Nfc,\n Protocol.WebAuthn.AuthenticatorTransport.Internal,\n ]);\n } else {\n this.residentKeyCheckbox.checked = false;\n this.residentKeyCheckbox.disabled = true;\n this.#userVerificationCheckbox.checked = false;\n this.#userVerificationCheckbox.disabled = true;\n this.largeBlobCheckbox.checked = false;\n this.largeBlobCheckbox.disabled = true;\n this.#updateEnabledTransportOptions([\n Protocol.WebAuthn.AuthenticatorTransport.Usb,\n Protocol.WebAuthn.AuthenticatorTransport.Ble,\n Protocol.WebAuthn.AuthenticatorTransport.Nfc,\n ]);\n }\n }\n\n #createNewAuthenticatorSection(): void {\n const learnMoreLink = UI.XLink.XLink.create(\n 'https://developers.google.com/web/updates/2018/05/webauthn', i18nString(UIStrings.learnMore), undefined,\n undefined, 'learn-more');\n this.#learnMoreView = this.contentElement.createChild('div', 'learn-more');\n this.#learnMoreView.appendChild(UI.Fragment.html`\n
\n ${i18nString(UIStrings.useWebauthnForPhishingresistant)}

\n ${learnMoreLink}\n
\n `);\n\n this.#newAuthenticatorSection = this.contentElement.createChild('div', 'new-authenticator-container');\n const newAuthenticatorTitle =\n UI.UIUtils.createLabel(i18nString(UIStrings.newAuthenticator), 'new-authenticator-title');\n this.#newAuthenticatorSection.appendChild(newAuthenticatorTitle);\n this.#newAuthenticatorForm = this.#newAuthenticatorSection.createChild('div', 'new-authenticator-form');\n this.#newAuthenticatorForm.setAttribute('jslog', `${VisualLogging.section('new-authenticator')}`);\n\n const protocolGroup = this.#newAuthenticatorForm.createChild('div', 'authenticator-option');\n const transportGroup = this.#newAuthenticatorForm.createChild('div', 'authenticator-option');\n const residentKeyGroup = this.#newAuthenticatorForm.createChild('div', 'authenticator-option');\n const userVerificationGroup = this.#newAuthenticatorForm.createChild('div', 'authenticator-option');\n const largeBlobGroup = this.#newAuthenticatorForm.createChild('div', 'authenticator-option');\n const addButtonGroup = this.#newAuthenticatorForm.createChild('div', 'authenticator-option');\n\n const protocolSelectTitle = UI.UIUtils.createLabel(i18nString(UIStrings.protocol), 'authenticator-option-label');\n protocolGroup.appendChild(protocolSelectTitle);\n this.#protocolSelect = (protocolGroup.createChild('select', 'chrome-select') as HTMLSelectElement);\n this.#protocolSelect.setAttribute('jslog', `${VisualLogging.dropDown('protocol').track({change: true})}`);\n UI.ARIAUtils.bindLabelToControl(protocolSelectTitle, (this.#protocolSelect as Element));\n Object.values(PROTOCOL_AUTHENTICATOR_VALUES).sort().forEach((option: Protocol.WebAuthn.AuthenticatorProtocol) => {\n if (this.#protocolSelect) {\n this.#protocolSelect.appendChild(UI.UIUtils.createOption(option, option, option));\n }\n });\n\n if (this.#protocolSelect) {\n this.#protocolSelect.value = Protocol.WebAuthn.AuthenticatorProtocol.Ctap2;\n }\n\n const transportSelectTitle = UI.UIUtils.createLabel(i18nString(UIStrings.transport), 'authenticator-option-label');\n transportGroup.appendChild(transportSelectTitle);\n this.transportSelect = (transportGroup.createChild('select', 'chrome-select') as HTMLSelectElement);\n this.transportSelect.setAttribute('jslog', `${VisualLogging.dropDown('transport').track({change: true})}`);\n UI.ARIAUtils.bindLabelToControl(transportSelectTitle, (this.transportSelect as Element));\n // transportSelect will be populated in updateNewAuthenticatorSectionOptions.\n\n this.#residentKeyCheckboxLabel =\n UI.UIUtils.CheckboxLabel.create(i18nString(UIStrings.supportsResidentKeys), false, undefined, 'resident-key');\n this.#residentKeyCheckboxLabel.textElement.classList.add('authenticator-option-label');\n residentKeyGroup.appendChild(this.#residentKeyCheckboxLabel.textElement);\n this.residentKeyCheckbox = this.#residentKeyCheckboxLabel.checkboxElement;\n this.residentKeyCheckbox.checked = false;\n this.residentKeyCheckbox.classList.add('authenticator-option-checkbox');\n residentKeyGroup.appendChild(this.#residentKeyCheckboxLabel);\n\n this.#userVerificationCheckboxLabel = UI.UIUtils.CheckboxLabel.create(\n i18nString(UIStrings.supportsUserVerification), false, undefined, 'user-verification');\n this.#userVerificationCheckboxLabel.textElement.classList.add('authenticator-option-label');\n userVerificationGroup.appendChild(this.#userVerificationCheckboxLabel.textElement);\n this.#userVerificationCheckbox = this.#userVerificationCheckboxLabel.checkboxElement;\n this.#userVerificationCheckbox.checked = false;\n this.#userVerificationCheckbox.classList.add('authenticator-option-checkbox');\n userVerificationGroup.appendChild(this.#userVerificationCheckboxLabel);\n\n this.#largeBlobCheckboxLabel =\n UI.UIUtils.CheckboxLabel.create(i18nString(UIStrings.supportsLargeBlob), false, undefined, 'large-blob');\n this.#largeBlobCheckboxLabel.textElement.classList.add('authenticator-option-label');\n largeBlobGroup.appendChild(this.#largeBlobCheckboxLabel.textElement);\n this.largeBlobCheckbox = this.#largeBlobCheckboxLabel.checkboxElement;\n this.largeBlobCheckbox.checked = false;\n this.largeBlobCheckbox.classList.add('authenticator-option-checkbox');\n this.largeBlobCheckbox.name = 'large-blob-checkbox';\n largeBlobGroup.appendChild(this.#largeBlobCheckboxLabel);\n\n this.addAuthenticatorButton = UI.UIUtils.createTextButton(\n i18nString(UIStrings.add), this.#handleAddAuthenticatorButton.bind(this),\n {jslogContext: 'webauthn.add-authenticator'});\n addButtonGroup.createChild('div', 'authenticator-option-label');\n addButtonGroup.appendChild(this.addAuthenticatorButton);\n const addAuthenticatorTitle = UI.UIUtils.createLabel(i18nString(UIStrings.addAuthenticator), '');\n UI.ARIAUtils.bindLabelToControl(addAuthenticatorTitle, this.addAuthenticatorButton);\n\n this.#updateNewAuthenticatorSectionOptions();\n if (this.#protocolSelect) {\n this.#protocolSelect.addEventListener('change', this.#updateNewAuthenticatorSectionOptions.bind(this));\n }\n if (this.residentKeyCheckbox) {\n this.residentKeyCheckbox.addEventListener('change', this.#updateNewAuthenticatorSectionOptions.bind(this));\n }\n }\n\n async #handleAddAuthenticatorButton(): Promise {\n const options = this.#createOptionsFromCurrentInputs();\n if (this.#model) {\n const authenticatorId = await this.#model.addAuthenticator(options);\n const availableAuthenticators = this.#availableAuthenticatorSetting.get();\n availableAuthenticators.push({authenticatorId, active: true, ...options});\n this.#availableAuthenticatorSetting.set(\n availableAuthenticators.map(a => ({...a, active: a.authenticatorId === authenticatorId})));\n const section = await this.#addAuthenticatorSection(authenticatorId, options);\n const mediaQueryList = window.matchMedia('(prefers-reduced-motion: reduce)');\n const prefersReducedMotion = mediaQueryList.matches;\n section.scrollIntoView({block: 'start', behavior: prefersReducedMotion ? 'auto' : 'smooth'});\n this.#updateInternalTransportAvailability();\n }\n }\n\n async #addAuthenticatorSection(\n authenticatorId: Protocol.WebAuthn.AuthenticatorId,\n options: Protocol.WebAuthn.VirtualAuthenticatorOptions): Promise {\n const section = document.createElement('div');\n section.classList.add('authenticator-section');\n section.setAttribute('data-authenticator-id', authenticatorId);\n section.setAttribute('jslog', `${VisualLogging.section('authenticator')}`);\n this.#authenticatorsView.appendChild(section);\n\n const headerElement = section.createChild('div', 'authenticator-section-header');\n const titleElement = headerElement.createChild('div', 'authenticator-section-title');\n UI.ARIAUtils.markAsHeading(titleElement, 2);\n\n await this.#clearActiveAuthenticator();\n const activeButtonContainer = headerElement.createChild('div', 'active-button-container');\n const activeLabel =\n UI.UIUtils.createRadioLabel(`active-authenticator-${authenticatorId}`, i18nString(UIStrings.active));\n activeLabel.radioElement.addEventListener('change', this.#setActiveAuthenticator.bind(this, authenticatorId));\n activeButtonContainer.appendChild(activeLabel);\n (activeLabel.radioElement as HTMLInputElement).checked = true;\n this.#activeAuthId = authenticatorId; // Newly added authenticator is automatically set as active.\n\n const removeButton = headerElement.createChild('button', 'text-button');\n removeButton.textContent = i18nString(UIStrings.remove);\n removeButton.addEventListener('click', this.removeAuthenticator.bind(this, authenticatorId));\n removeButton.setAttribute('jslog', `${VisualLogging.action('webauthn.remove-authenticator').track({click: true})}`);\n\n const toolbar = new UI.Toolbar.Toolbar('edit-name-toolbar', titleElement);\n const editName = new UI.Toolbar.ToolbarButton(i18nString(UIStrings.editName), 'edit', undefined, 'edit-name');\n const saveName = new UI.Toolbar.ToolbarButton(i18nString(UIStrings.saveName), 'checkmark', undefined, 'save-name');\n saveName.setVisible(false);\n\n const nameField = (titleElement.createChild('input', 'authenticator-name-field') as HTMLInputElement);\n nameField.placeholder = i18nString(UIStrings.enterNewName);\n nameField.disabled = true;\n nameField.setAttribute('jslog', `${VisualLogging.textField('name').track({keydown: 'Enter', change: true})}`);\n const userFriendlyName = authenticatorId.slice(-5); // User friendly name defaults to last 5 chars of UUID.\n nameField.value = i18nString(UIStrings.authenticatorS, {PH1: userFriendlyName});\n this.#updateActiveLabelTitle(activeLabel, nameField.value);\n\n editName.addEventListener(\n UI.Toolbar.ToolbarButton.Events.CLICK,\n () => this.#handleEditNameButton(titleElement, nameField, editName, saveName));\n saveName.addEventListener(\n UI.Toolbar.ToolbarButton.Events.CLICK,\n () => this.#handleSaveNameButton(titleElement, nameField, editName, saveName, activeLabel));\n\n nameField.addEventListener(\n 'focusout', () => this.#handleSaveNameButton(titleElement, nameField, editName, saveName, activeLabel));\n nameField.addEventListener('keydown', (event: KeyboardEvent) => {\n if (event.key === 'Enter') {\n this.#handleSaveNameButton(titleElement, nameField, editName, saveName, activeLabel);\n }\n });\n\n toolbar.appendToolbarItem(editName);\n toolbar.appendToolbarItem(saveName);\n\n this.#createAuthenticatorFields(section, authenticatorId, options);\n\n const label = document.createElement('div');\n label.classList.add('credentials-title');\n label.textContent = i18nString(UIStrings.credentials);\n section.appendChild(label);\n\n const dataGrid = this.#createCredentialsDataGrid(authenticatorId);\n dataGrid.asWidget().show(section);\n if (this.#model) {\n this.#model.addEventListener(\n SDK.WebAuthnModel.Events.CREDENTIAL_ADDED, this.#addCredential.bind(this, authenticatorId));\n this.#model.addEventListener(\n SDK.WebAuthnModel.Events.CREDENTIAL_ASSERTED, this.#updateCredential.bind(this, authenticatorId));\n this.#model.addEventListener(\n SDK.WebAuthnModel.Events.CREDENTIAL_UPDATED, this.#updateCredential.bind(this, authenticatorId));\n this.#model.addEventListener(\n SDK.WebAuthnModel.Events.CREDENTIAL_DELETED, this.#deleteCredential.bind(this, authenticatorId));\n }\n\n return section;\n }\n\n #exportCredential(credential: Protocol.WebAuthn.Credential): void {\n let pem = PRIVATE_KEY_HEADER;\n for (let i = 0; i < credential.privateKey.length; i += 64) {\n pem += credential.privateKey.substring(i, i + 64) + '\\n';\n }\n pem += PRIVATE_KEY_FOOTER;\n\n const link = document.createElement('a');\n link.download = i18nString(UIStrings.privateKeypem);\n link.href = 'data:application/x-pem-file,' + encodeURIComponent(pem);\n link.click();\n }\n\n async #removeCredential(authenticatorId: Protocol.WebAuthn.AuthenticatorId, credentialId: string): Promise {\n const dataGrid = this.dataGrids.get(authenticatorId);\n if (!dataGrid) {\n return;\n }\n\n // @ts-ignore dataGrid node type is indeterminate.\n dataGrid.rootNode()\n .children.find((n: DataGrid.DataGrid.DataGridNode) => n.data.credentialId === credentialId)\n .remove();\n\n if (!dataGrid.rootNode().children.length) {\n dataGrid.rootNode().appendChild(new EmptyDataGridNode());\n }\n\n if (this.#model) {\n await this.#model.removeCredential(authenticatorId, credentialId);\n }\n }\n\n /**\n * Creates the fields describing the authenticator in the front end.\n */\n #createAuthenticatorFields(\n section: Element, authenticatorId: string, options: Protocol.WebAuthn.VirtualAuthenticatorOptions): void {\n const sectionFields = section.createChild('div', 'authenticator-fields');\n const uuidField = sectionFields.createChild('div', 'authenticator-field');\n const protocolField = sectionFields.createChild('div', 'authenticator-field');\n const transportField = sectionFields.createChild('div', 'authenticator-field');\n const srkField = sectionFields.createChild('div', 'authenticator-field');\n const slbField = sectionFields.createChild('div', 'authenticator-field');\n const suvField = sectionFields.createChild('div', 'authenticator-field');\n\n uuidField.appendChild(UI.UIUtils.createLabel(i18nString(UIStrings.uuid), 'authenticator-option-label'));\n protocolField.appendChild(UI.UIUtils.createLabel(i18nString(UIStrings.protocol), 'authenticator-option-label'));\n transportField.appendChild(UI.UIUtils.createLabel(i18nString(UIStrings.transport), 'authenticator-option-label'));\n srkField.appendChild(\n UI.UIUtils.createLabel(i18nString(UIStrings.supportsResidentKeys), 'authenticator-option-label'));\n slbField.appendChild(UI.UIUtils.createLabel(i18nString(UIStrings.supportsLargeBlob), 'authenticator-option-label'));\n suvField.appendChild(\n UI.UIUtils.createLabel(i18nString(UIStrings.supportsUserVerification), 'authenticator-option-label'));\n\n uuidField.createChild('div', 'authenticator-field-value').textContent = authenticatorId;\n protocolField.createChild('div', 'authenticator-field-value').textContent = options.protocol;\n transportField.createChild('div', 'authenticator-field-value').textContent = options.transport;\n srkField.createChild('div', 'authenticator-field-value').textContent =\n options.hasResidentKey ? i18nString(UIStrings.yes) : i18nString(UIStrings.no);\n slbField.createChild('div', 'authenticator-field-value').textContent =\n options.hasLargeBlob ? i18nString(UIStrings.yes) : i18nString(UIStrings.no);\n suvField.createChild('div', 'authenticator-field-value').textContent =\n options.hasUserVerification ? i18nString(UIStrings.yes) : i18nString(UIStrings.no);\n }\n\n #handleEditNameButton(\n titleElement: Element, nameField: HTMLInputElement, editName: UI.Toolbar.ToolbarButton,\n saveName: UI.Toolbar.ToolbarButton): void {\n nameField.disabled = false;\n titleElement.classList.add('editing-name');\n nameField.focus();\n saveName.setVisible(true);\n editName.setVisible(false);\n }\n\n #handleSaveNameButton(\n titleElement: Element, nameField: HTMLInputElement, editName: UI.Toolbar.ToolbarItem,\n saveName: UI.Toolbar.ToolbarItem, activeLabel: UI.UIUtils.DevToolsRadioButton): void {\n const name = nameField.value;\n if (!name) {\n return;\n }\n nameField.disabled = true;\n titleElement.classList.remove('editing-name');\n editName.setVisible(true);\n saveName.setVisible(false);\n this.#updateActiveLabelTitle(activeLabel, name);\n }\n\n #updateActiveLabelTitle(activeLabel: UI.UIUtils.DevToolsRadioButton, authenticatorName: string): void {\n UI.Tooltip.Tooltip.install(\n activeLabel.radioElement, i18nString(UIStrings.setSAsTheActiveAuthenticator, {PH1: authenticatorName}));\n }\n\n /**\n * Removes both the authenticator and its respective UI element.\n */\n removeAuthenticator(authenticatorId: Protocol.WebAuthn.AuthenticatorId): void {\n if (this.#authenticatorsView) {\n const child = this.#authenticatorsView.querySelector(`[data-authenticator-id=${CSS.escape(authenticatorId)}]`);\n if (child) {\n child.remove();\n }\n }\n const dataGrid = this.dataGrids.get(authenticatorId);\n if (dataGrid) {\n dataGrid.asWidget().detach();\n this.dataGrids.delete(authenticatorId);\n }\n\n if (this.#model) {\n void this.#model.removeAuthenticator(authenticatorId);\n }\n\n // Update available authenticator setting.\n const prevAvailableAuthenticators = this.#availableAuthenticatorSetting.get();\n const newAvailableAuthenticators = prevAvailableAuthenticators.filter(a => a.authenticatorId !== authenticatorId);\n this.#availableAuthenticatorSetting.set(newAvailableAuthenticators);\n\n if (this.#activeAuthId === authenticatorId) {\n const availableAuthenticatorIds = Array.from(this.dataGrids.keys());\n if (availableAuthenticatorIds.length) {\n void this.#setActiveAuthenticator(availableAuthenticatorIds[0]);\n } else {\n this.#activeAuthId = null;\n }\n }\n this.#updateInternalTransportAvailability();\n }\n\n #createOptionsFromCurrentInputs(): Protocol.WebAuthn.VirtualAuthenticatorOptions {\n // TODO(crbug.com/1034663): Add optionality for isUserVerified param.\n if (!this.#protocolSelect || !this.transportSelect || !this.residentKeyCheckbox ||\n !this.#userVerificationCheckbox || !this.largeBlobCheckbox) {\n throw new Error('Unable to create options from current inputs');\n }\n\n return {\n protocol: this.#protocolSelect.options[this.#protocolSelect.selectedIndex].value as\n Protocol.WebAuthn.AuthenticatorProtocol,\n ctap2Version: Protocol.WebAuthn.Ctap2Version.Ctap2_1,\n transport: this.transportSelect.options[this.transportSelect.selectedIndex].value as\n Protocol.WebAuthn.AuthenticatorTransport,\n hasResidentKey: this.residentKeyCheckbox.checked,\n hasUserVerification: this.#userVerificationCheckbox.checked,\n hasLargeBlob: this.largeBlobCheckbox.checked,\n automaticPresenceSimulation: true,\n isUserVerified: true,\n };\n }\n\n /**\n * Sets the given authenticator as active.\n * Note that a newly added authenticator will automatically be set as active.\n */\n async #setActiveAuthenticator(authenticatorId: Protocol.WebAuthn.AuthenticatorId): Promise {\n await this.#clearActiveAuthenticator();\n if (this.#model) {\n await this.#model.setAutomaticPresenceSimulation(authenticatorId, true);\n }\n this.#activeAuthId = authenticatorId;\n\n const prevAvailableAuthenticators = this.#availableAuthenticatorSetting.get();\n const newAvailableAuthenticators =\n prevAvailableAuthenticators.map(a => ({...a, active: a.authenticatorId === authenticatorId}));\n this.#availableAuthenticatorSetting.set(newAvailableAuthenticators);\n\n this.#updateActiveButtons();\n }\n\n #updateActiveButtons(): void {\n const authenticators = this.#authenticatorsView.getElementsByClassName('authenticator-section');\n Array.from(authenticators).forEach((authenticator: Element) => {\n const button = (authenticator.querySelector('input.dt-radio-button') as HTMLInputElement);\n if (!button) {\n return;\n }\n button.checked = (authenticator as HTMLElement).dataset.authenticatorId === this.#activeAuthId;\n });\n }\n\n async #clearActiveAuthenticator(): Promise {\n if (this.#activeAuthId && this.#model) {\n await this.#model.setAutomaticPresenceSimulation(this.#activeAuthId, false);\n }\n this.#activeAuthId = null;\n this.#updateActiveButtons();\n }\n override wasShown(): void {\n super.wasShown();\n this.registerCSSFiles([webauthnPaneStyles]);\n }\n}\n"]} \ No newline at end of file +{"version":3,"file":"WebauthnPane.js","sourceRoot":"","sources":["../../../../../../front_end/panels/webauthn/WebauthnPane.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,KAAK,MAAM,MAAM,6BAA6B,CAAC;AACtD,OAAO,KAAK,IAAI,MAAM,yBAAyB,CAAC;AAChD,OAAO,KAAK,IAAI,MAAM,yBAAyB,CAAC;AAChD,OAAO,KAAK,GAAG,MAAM,uBAAuB,CAAC;AAG7C,OAAO,KAAK,QAAQ,MAAM,mDAAmD,CAAC;AAC9E,OAAO,KAAK,EAAE,MAAM,2BAA2B,CAAC;AAChD,OAAO,KAAK,aAAa,MAAM,2CAA2C,CAAC;AAE3E,OAAO,kBAAkB,MAAM,uBAAuB,CAAC;AAEvD,MAAM,SAAS,GAAG;IAChB;;OAEG;IACH,MAAM,EAAE,QAAQ;IAChB;;OAEG;IACH,MAAM,EAAE,QAAQ;IAChB;;;OAGG;IACH,gCAAgC,EAAE,sDAAsD;IACxF;;OAEG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e,KAAK,eAAe,EAAC,CAAC,CAAC,CAAC;QAClG,IAAI,CAAC,8BAA8B,CAAC,GAAG,CAAC,0BAA0B,CAAC,CAAC;QAEpE,IAAI,CAAC,oBAAoB,EAAE,CAAC;IAC9B,CAAC;IAED,oBAAoB;QAClB,MAAM,cAAc,GAAG,IAAI,CAAC,mBAAmB,CAAC,sBAAsB,CAAC,uBAAuB,CAAC,CAAC;QAChG,KAAK,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,OAAO,CAAC,CAAC,aAAsB,EAAE,EAAE;YAC5D,MAAM,MAAM,GAAI,aAAa,CAAC,aAAa,CAAC,qBAAqB,CAAsB,CAAC;YACxF,IAAI,CAAC,MAAM,EAAE,CAAC;gBACZ,OAAO;YACT,CAAC;YACD,MAAM,CAAC,OAAO,GAAI,aAA6B,CAAC,OAAO,CAAC,eAAe,KAAK,IAAI,CAAC,aAAa,CAAC;QACjG,CAAC,CAAC,CAAC;IACL,CAAC;IAED,KAAK,CAAC,yBAAyB;QAC7B,IAAI,IAAI,CAAC,aAAa,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;YACtC,MAAM,IAAI,CAAC,MAAM,CAAC,8BAA8B,CAAC,IAAI,CAAC,aAAa,EAAE,KAAK,CAAC,CAAC;QAC9E,CAAC;QACD,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC;QAC1B,IAAI,CAAC,oBAAoB,EAAE,CAAC;IAC9B,CAAC;IACQ,QAAQ;QACf,KAAK,CAAC,QAAQ,EAAE,CAAC;QACjB,IAAI,CAAC,gBAAgB,CAAC,CAAC,kBAAkB,CAAC,CAAC,CAAC;IAC9C,CAAC;CACF","sourcesContent":["// Copyright 2020 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport * as Common from '../../core/common/common.js';\nimport * as Host from '../../core/host/host.js';\nimport * as i18n from '../../core/i18n/i18n.js';\nimport * as SDK from '../../core/sdk/sdk.js';\nimport * as Protocol from '../../generated/protocol.js';\nimport type * as Buttons from '../../ui/components/buttons/buttons.js';\nimport * as DataGrid from '../../ui/legacy/components/data_grid/data_grid.js';\nimport * as UI from '../../ui/legacy/legacy.js';\nimport * as VisualLogging from '../../ui/visual_logging/visual_logging.js';\n\nimport webauthnPaneStyles from './webauthnPane.css.js';\n\nconst UIStrings = {\n /**\n *@description Label for button that allows user to download the private key related to a credential.\n */\n export: 'Export',\n /**\n *@description Label for an item to remove something\n */\n remove: 'Remove',\n /**\n *@description Label for empty credentials table.\n *@example {navigator.credentials.create()} PH1\n */\n noCredentialsTryCallingSFromYour: 'No credentials. Try calling {PH1} from your website.',\n /**\n *@description Label for checkbox to toggle the virtual authenticator environment allowing user to interact with software-based virtual authenticators.\n */\n enableVirtualAuthenticator: 'Enable virtual authenticator environment',\n /**\n *@description Label for ID field for credentials.\n */\n id: 'ID',\n /**\n *@description Label for field that describes whether a credential is a resident credential.\n */\n isResident: 'Is Resident',\n /**\n *@description Label for credential field that represents the Relying Party ID that the credential is scoped to.\n */\n rpId: 'RP ID',\n /**\n *@description Label for a column in a table. A field/unique ID that represents the user a credential is mapped to.\n */\n userHandle: 'User Handle',\n /**\n *@description Label for signature counter field for credentials which represents the number of successful assertions.\n * See https://w3c.github.io/webauthn/#signature-counter.\n */\n signCount: 'Signature Count',\n /**\n *@description Label for column with actions for credentials.\n */\n actions: 'Actions',\n /**\n *@description Title for the table that holds the credentials that a authenticator has registered.\n */\n credentials: 'Credentials',\n /**\n *@description Label for the learn more link that is shown before the virtual environment is enabled.\n */\n useWebauthnForPhishingresistant: 'Use WebAuthn for phishing-resistant authentication',\n /**\n *@description Text that is usually a hyperlink to more documentation\n */\n learnMore: 'Learn more',\n /**\n *@description Title for section of interface that allows user to add a new virtual authenticator.\n */\n newAuthenticator: 'New authenticator',\n /**\n *@description Text for security or network protocol\n */\n protocol: 'Protocol',\n /**\n *@description Label for input to select which transport option to use on virtual authenticators, e.g. USB or Bluetooth.\n */\n transport: 'Transport',\n /**\n *@description Label for checkbox that toggles resident key support on virtual authenticators.\n */\n supportsResidentKeys: 'Supports resident keys',\n /**\n *@description Label for checkbox that toggles large blob support on virtual authenticators. Large blobs are opaque data associated\n * with a WebAuthn credential that a website can store, like an SSH certificate or a symmetric encryption key.\n * See https://w3c.github.io/webauthn/#sctn-large-blob-extension\n */\n supportsLargeBlob: 'Supports large blob',\n /**\n *@description Text to add something\n */\n add: 'Add',\n /**\n *@description Label for button to add a new virtual authenticator.\n */\n addAuthenticator: 'Add authenticator',\n /**\n *@description Label for radio button that toggles whether an authenticator is active.\n */\n active: 'Active',\n /**\n *@description Title for button that enables user to customize name of authenticator.\n */\n editName: 'Edit name',\n /**\n *@description Placeholder for the input box to customize name of authenticator.\n */\n enterNewName: 'Enter new name',\n /**\n *@description Title for button that enables user to save name of authenticator after editing it.\n */\n saveName: 'Save name',\n /**\n *@description Title for a user-added virtual authenticator which is uniquely identified with its AUTHENTICATORID.\n *@example {8c7873be-0b13-4996-a794-1521331bbd96} PH1\n */\n authenticatorS: 'Authenticator {PH1}',\n /**\n *@description Name for generated file which user can download. A private key is a secret code which enables encoding and decoding of a credential. .pem is the file extension.\n */\n privateKeypem: 'Private key.pem',\n /**\n *@description Label for field that holds an authenticator's universally unique identifier (UUID).\n */\n uuid: 'UUID',\n /**\n *@description Label for checkbox that toggles user verification support on virtual authenticators.\n */\n supportsUserVerification: 'Supports user verification',\n /**\n *@description Text in Timeline indicating that input has happened recently\n */\n yes: 'Yes',\n /**\n *@description Text in Timeline indicating that input has not happened recently\n */\n no: 'No',\n /**\n *@description Title of radio button that sets an authenticator as active.\n *@example {Authenticator ABCDEF} PH1\n */\n setSAsTheActiveAuthenticator: 'Set {PH1} as the active authenticator',\n};\nconst str_ = i18n.i18n.registerUIStrings('panels/webauthn/WebauthnPane.ts', UIStrings);\nconst i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);\n\nconst enum Events {\n EXPORT_CREDENTIAL = 'ExportCredential',\n REMOVE_CREDENTIAL = 'RemoveCredential',\n}\n\ntype EventTypes = {\n [Events.EXPORT_CREDENTIAL]: Protocol.WebAuthn.Credential,\n [Events.REMOVE_CREDENTIAL]: Protocol.WebAuthn.Credential,\n};\n\nclass DataGridNode extends DataGrid.DataGrid.DataGridNode {\n constructor(private readonly credential: Protocol.WebAuthn.Credential) {\n super(credential);\n }\n\n override nodeSelfHeight(): number {\n return 24;\n }\n\n override createCell(columnId: string): HTMLElement {\n const cell = super.createCell(columnId);\n UI.Tooltip.Tooltip.install(cell, cell.textContent || '');\n\n if (columnId !== 'actions') {\n return cell;\n }\n\n const exportButton = UI.UIUtils.createTextButton(i18nString(UIStrings.export), () => {\n if (this.dataGrid) {\n (this.dataGrid as WebauthnDataGrid).dispatchEventToListeners(Events.EXPORT_CREDENTIAL, this.credential);\n }\n }, {jslogContext: 'webauthn.export-credential'});\n\n cell.appendChild(exportButton);\n\n const removeButton = UI.UIUtils.createTextButton(i18nString(UIStrings.remove), () => {\n if (this.dataGrid) {\n (this.dataGrid as WebauthnDataGrid).dispatchEventToListeners(Events.REMOVE_CREDENTIAL, this.credential);\n }\n }, {jslogContext: 'webauthn.remove-credential'});\n\n cell.appendChild(removeButton);\n\n return cell;\n }\n}\n\nclass WebauthnDataGridBase extends DataGrid.DataGrid.DataGridImpl {}\nclass WebauthnDataGrid extends Common.ObjectWrapper.eventMixin(\n WebauthnDataGridBase) {}\n\nclass EmptyDataGridNode extends DataGrid.DataGrid.DataGridNode {\n override createCells(element: Element): void {\n element.removeChildren();\n const td = (this.createTDWithClass(DataGrid.DataGrid.Align.CENTER) as HTMLTableCellElement);\n if (this.dataGrid) {\n td.colSpan = this.dataGrid.visibleColumnsArray.length;\n }\n\n const code = document.createElement('span', {is: 'source-code'});\n code.textContent = 'navigator.credentials.create()';\n code.classList.add('code');\n const message = i18n.i18n.getFormatLocalizedString(str_, UIStrings.noCredentialsTryCallingSFromYour, {PH1: code});\n\n td.appendChild(message);\n element.appendChild(td);\n }\n}\n\ntype AvailableAuthenticatorOptions = Protocol.WebAuthn.VirtualAuthenticatorOptions&{\n active: boolean,\n authenticatorId: Protocol.WebAuthn.AuthenticatorId,\n};\n\n// We extrapolate this variable as otherwise git detects a private key, even though we\n// perform string manipulation. If we extract the name, then the regex doesn't match\n// and we can upload as expected.\nconst PRIVATE_NAME = 'PRIVATE';\nconst PRIVATE_KEY_HEADER = `-----BEGIN ${PRIVATE_NAME} KEY-----\n`;\nconst PRIVATE_KEY_FOOTER = `-----END ${PRIVATE_NAME} KEY-----`;\n\nconst PROTOCOL_AUTHENTICATOR_VALUES: Protocol.EnumerableEnum = {\n Ctap2: Protocol.WebAuthn.AuthenticatorProtocol.Ctap2,\n U2f: Protocol.WebAuthn.AuthenticatorProtocol.U2f,\n};\n\nexport class WebauthnPaneImpl extends UI.Widget.VBox implements\n SDK.TargetManager.SDKModelObserver {\n #activeAuthId: Protocol.WebAuthn.AuthenticatorId|null = null;\n #hasBeenEnabled = false;\n readonly dataGrids = new Map>();\n #enableCheckbox!: UI.Toolbar.ToolbarCheckbox;\n readonly #availableAuthenticatorSetting: Common.Settings.Setting;\n #model?: SDK.WebAuthnModel.WebAuthnModel;\n #authenticatorsView: HTMLElement;\n #topToolbarContainer: HTMLElement|undefined;\n #topToolbar: UI.Toolbar.Toolbar|undefined;\n #learnMoreView: HTMLElement|undefined;\n #newAuthenticatorSection: HTMLElement|undefined;\n #newAuthenticatorForm: HTMLElement|undefined;\n #protocolSelect: HTMLSelectElement|undefined;\n transportSelect: HTMLSelectElement|undefined;\n #residentKeyCheckboxLabel: UI.UIUtils.CheckboxLabel|undefined;\n residentKeyCheckbox: HTMLInputElement|undefined;\n #userVerificationCheckboxLabel: UI.UIUtils.CheckboxLabel|undefined;\n #userVerificationCheckbox: HTMLInputElement|undefined;\n #largeBlobCheckboxLabel: UI.UIUtils.CheckboxLabel|undefined;\n largeBlobCheckbox: HTMLInputElement|undefined;\n addAuthenticatorButton: Buttons.Button.Button|undefined;\n #isEnabling?: Promise;\n\n constructor() {\n super(true);\n\n this.element.setAttribute('jslog', `${VisualLogging.panel('webauthn').track({resize: true})}`);\n\n SDK.TargetManager.TargetManager.instance().observeModels(SDK.WebAuthnModel.WebAuthnModel, this, {scoped: true});\n\n this.contentElement.classList.add('webauthn-pane');\n\n this.#availableAuthenticatorSetting =\n Common.Settings.Settings.instance().createSetting(\n 'webauthn-authenticators', []);\n\n this.#createToolbar();\n this.#authenticatorsView = this.contentElement.createChild('div', 'authenticators-view');\n this.#createNewAuthenticatorSection();\n this.#updateVisibility(false);\n }\n\n modelAdded(model: SDK.WebAuthnModel.WebAuthnModel): void {\n if (model.target() === model.target().outermostTarget()) {\n this.#model = model;\n }\n }\n\n modelRemoved(model: SDK.WebAuthnModel.WebAuthnModel): void {\n if (model.target() === model.target().outermostTarget()) {\n this.#model = undefined;\n }\n }\n\n async #loadInitialAuthenticators(): Promise {\n let activeAuthenticatorId: Protocol.WebAuthn.AuthenticatorId|null = null;\n const availableAuthenticators = this.#availableAuthenticatorSetting.get();\n for (const options of availableAuthenticators) {\n if (!this.#model) {\n continue;\n }\n\n const authenticatorId = await this.#model.addAuthenticator(options);\n void this.#addAuthenticatorSection(authenticatorId, options);\n // Update the authenticatorIds in the options.\n options.authenticatorId = authenticatorId;\n if (options.active) {\n activeAuthenticatorId = authenticatorId;\n }\n }\n\n // Update the settings to reflect the new authenticatorIds.\n this.#availableAuthenticatorSetting.set(availableAuthenticators);\n if (activeAuthenticatorId) {\n void this.#setActiveAuthenticator(activeAuthenticatorId);\n }\n }\n\n override async ownerViewDisposed(): Promise {\n if (this.#enableCheckbox) {\n this.#enableCheckbox.setChecked(false);\n }\n await this.#setVirtualAuthEnvEnabled(false);\n }\n\n #createToolbar(): void {\n this.#topToolbarContainer = this.contentElement.createChild('div', 'webauthn-toolbar-container');\n this.#topToolbarContainer.setAttribute('jslog', `${VisualLogging.toolbar()}`);\n this.#topToolbar = new UI.Toolbar.Toolbar('webauthn-toolbar', this.#topToolbarContainer);\n const enableCheckboxTitle = i18nString(UIStrings.enableVirtualAuthenticator);\n this.#enableCheckbox =\n new UI.Toolbar.ToolbarCheckbox(enableCheckboxTitle, enableCheckboxTitle, this.#handleCheckboxToggle.bind(this));\n this.#enableCheckbox.inputElement.setAttribute(\n 'jslog', `${VisualLogging.toggle('virtual-authenticators').track({click: true})}`);\n this.#topToolbar.appendToolbarItem(this.#enableCheckbox);\n }\n\n #createCredentialsDataGrid(authenticatorId: Protocol.WebAuthn.AuthenticatorId):\n DataGrid.DataGrid.DataGridImpl {\n const columns = ([\n {\n id: 'credentialId',\n title: i18nString(UIStrings.id),\n longText: true,\n weight: 24,\n },\n {\n id: 'isResidentCredential',\n title: i18nString(UIStrings.isResident),\n dataType: DataGrid.DataGrid.DataType.BOOLEAN,\n weight: 10,\n },\n {\n id: 'rpId',\n title: i18nString(UIStrings.rpId),\n },\n {\n id: 'userHandle',\n title: i18nString(UIStrings.userHandle),\n },\n {\n id: 'signCount',\n title: i18nString(UIStrings.signCount),\n },\n {id: 'actions', title: i18nString(UIStrings.actions)},\n ] as DataGrid.DataGrid.ColumnDescriptor[]);\n\n const dataGridConfig = {\n displayName: i18nString(UIStrings.credentials),\n columns,\n editCallback: undefined,\n deleteCallback: undefined,\n refreshCallback: undefined,\n };\n const dataGrid = new WebauthnDataGrid(dataGridConfig);\n dataGrid.renderInline();\n dataGrid.setStriped(true);\n dataGrid.addEventListener(Events.EXPORT_CREDENTIAL, this.#handleExportCredential, this);\n dataGrid.addEventListener(Events.REMOVE_CREDENTIAL, this.#handleRemoveCredential.bind(this, authenticatorId));\n dataGrid.rootNode().appendChild(new EmptyDataGridNode());\n\n this.dataGrids.set(authenticatorId, dataGrid);\n\n return dataGrid;\n }\n\n #handleExportCredential({data: credential}: Common.EventTarget.EventTargetEvent): void {\n this.#exportCredential(credential);\n }\n\n #handleRemoveCredential(authenticatorId: Protocol.WebAuthn.AuthenticatorId, {\n data: credential,\n }: Common.EventTarget.EventTargetEvent): void {\n void this.#removeCredential(authenticatorId, credential.credentialId);\n }\n\n #addCredential(authenticatorId: Protocol.WebAuthn.AuthenticatorId, {\n data: event,\n }: Common.EventTarget.EventTargetEvent): void {\n const dataGrid = this.dataGrids.get(authenticatorId);\n if (!dataGrid) {\n return;\n }\n const emptyNode = dataGrid.rootNode().children.find(node => !Object.keys(node.data).length);\n if (emptyNode) {\n dataGrid.rootNode().removeChild(emptyNode);\n }\n const node = new DataGridNode(event.credential);\n dataGrid.rootNode().appendChild(node);\n }\n\n #updateCredential(\n authenticatorId: Protocol.WebAuthn.AuthenticatorId,\n {\n data: event,\n }: Common.EventTarget\n .EventTargetEvent): void {\n const dataGrid = this.dataGrids.get(authenticatorId);\n if (!dataGrid) {\n return;\n }\n const node = dataGrid.rootNode().children.find(node => node.data?.credentialId === event.credential.credentialId);\n if (!node) {\n return;\n }\n node.data = event.credential;\n }\n\n #deleteCredential(authenticatorId: Protocol.WebAuthn.AuthenticatorId, {\n data: event,\n }: Common.EventTarget.EventTargetEvent): void {\n const dataGrid = this.dataGrids.get(authenticatorId);\n if (!dataGrid) {\n return;\n }\n const node = dataGrid.rootNode().children.find(node => node.data?.credentialId === event.credentialId);\n if (!node) {\n return;\n }\n node.remove();\n }\n\n async #setVirtualAuthEnvEnabled(enable: boolean): Promise {\n await this.#isEnabling;\n this.#isEnabling = new Promise(async (resolve: (value: void) => void) => {\n if (enable && !this.#hasBeenEnabled) {\n // Ensures metric is only tracked once per session.\n Host.userMetrics.actionTaken(Host.UserMetrics.Action.VirtualAuthenticatorEnvironmentEnabled);\n this.#hasBeenEnabled = true;\n }\n if (this.#model) {\n await this.#model.setVirtualAuthEnvEnabled(enable);\n }\n\n if (enable) {\n await this.#loadInitialAuthenticators();\n } else {\n this.#removeAuthenticatorSections();\n }\n\n this.#updateVisibility(enable);\n this.#isEnabling = undefined;\n resolve();\n });\n }\n\n #updateVisibility(enabled: boolean): void {\n this.contentElement.classList.toggle('enabled', enabled);\n }\n\n #removeAuthenticatorSections(): void {\n this.#authenticatorsView.innerHTML = '';\n for (const dataGrid of this.dataGrids.values()) {\n dataGrid.asWidget().detach();\n }\n this.dataGrids.clear();\n }\n\n #handleCheckboxToggle(e: MouseEvent): void {\n void this.#setVirtualAuthEnvEnabled((e.target as HTMLInputElement).checked);\n }\n\n #updateEnabledTransportOptions(enabledOptions: Protocol.WebAuthn.AuthenticatorTransport[]): void {\n if (!this.transportSelect) {\n return;\n }\n\n const prevValue = this.transportSelect.value;\n this.transportSelect.removeChildren();\n\n for (const option of enabledOptions) {\n this.transportSelect.appendChild(UI.UIUtils.createOption(option, option, option));\n }\n\n // Make sure the currently selected value stays the same.\n this.transportSelect.value = prevValue;\n // If the new set does not include the previous value.\n if (!this.transportSelect.value) {\n // Select the first available value.\n this.transportSelect.selectedIndex = 0;\n }\n this.#updateInternalTransportAvailability();\n }\n\n #updateInternalTransportAvailability(): void {\n if (!this.transportSelect?.options) {\n return;\n }\n const hasInternal = Boolean(this.#availableAuthenticatorSetting.get().find(\n authenticator => authenticator.transport === Protocol.WebAuthn.AuthenticatorTransport.Internal));\n for (let i = 0; i < this.transportSelect.options.length; ++i) {\n const option = this.transportSelect.options[i];\n if (option.value === Protocol.WebAuthn.AuthenticatorTransport.Internal) {\n option.disabled = hasInternal;\n // This relies on \"internal\" never being the first or only element.\n if (i === this.transportSelect.selectedIndex) {\n --this.transportSelect.selectedIndex;\n }\n break;\n }\n }\n }\n\n #updateNewAuthenticatorSectionOptions(): void {\n if (!this.#protocolSelect || !this.residentKeyCheckbox || !this.#userVerificationCheckbox ||\n !this.largeBlobCheckbox) {\n return;\n }\n\n if (this.#protocolSelect.value === Protocol.WebAuthn.AuthenticatorProtocol.Ctap2) {\n this.residentKeyCheckbox.disabled = false;\n this.#userVerificationCheckbox.disabled = false;\n this.largeBlobCheckbox.disabled = !this.residentKeyCheckbox.checked;\n if (this.largeBlobCheckbox.disabled) {\n this.largeBlobCheckbox.checked = false;\n }\n this.#updateEnabledTransportOptions([\n Protocol.WebAuthn.AuthenticatorTransport.Usb,\n Protocol.WebAuthn.AuthenticatorTransport.Ble,\n Protocol.WebAuthn.AuthenticatorTransport.Nfc,\n Protocol.WebAuthn.AuthenticatorTransport.Internal,\n ]);\n } else {\n this.residentKeyCheckbox.checked = false;\n this.residentKeyCheckbox.disabled = true;\n this.#userVerificationCheckbox.checked = false;\n this.#userVerificationCheckbox.disabled = true;\n this.largeBlobCheckbox.checked = false;\n this.largeBlobCheckbox.disabled = true;\n this.#updateEnabledTransportOptions([\n Protocol.WebAuthn.AuthenticatorTransport.Usb,\n Protocol.WebAuthn.AuthenticatorTransport.Ble,\n Protocol.WebAuthn.AuthenticatorTransport.Nfc,\n ]);\n }\n }\n\n #createNewAuthenticatorSection(): void {\n const learnMoreLink = UI.XLink.XLink.create(\n 'https://developers.google.com/web/updates/2018/05/webauthn', i18nString(UIStrings.learnMore), undefined,\n undefined, 'learn-more');\n this.#learnMoreView = this.contentElement.createChild('div', 'learn-more');\n this.#learnMoreView.appendChild(UI.Fragment.html`\n
\n ${i18nString(UIStrings.useWebauthnForPhishingresistant)}

\n ${learnMoreLink}\n
\n `);\n\n this.#newAuthenticatorSection = this.contentElement.createChild('div', 'new-authenticator-container');\n const newAuthenticatorTitle =\n UI.UIUtils.createLabel(i18nString(UIStrings.newAuthenticator), 'new-authenticator-title');\n this.#newAuthenticatorSection.appendChild(newAuthenticatorTitle);\n this.#newAuthenticatorForm = this.#newAuthenticatorSection.createChild('div', 'new-authenticator-form');\n this.#newAuthenticatorForm.setAttribute('jslog', `${VisualLogging.section('new-authenticator')}`);\n\n const protocolGroup = this.#newAuthenticatorForm.createChild('div', 'authenticator-option');\n const transportGroup = this.#newAuthenticatorForm.createChild('div', 'authenticator-option');\n const residentKeyGroup = this.#newAuthenticatorForm.createChild('div', 'authenticator-option');\n const userVerificationGroup = this.#newAuthenticatorForm.createChild('div', 'authenticator-option');\n const largeBlobGroup = this.#newAuthenticatorForm.createChild('div', 'authenticator-option');\n const addButtonGroup = this.#newAuthenticatorForm.createChild('div', 'authenticator-option');\n\n const protocolSelectTitle = UI.UIUtils.createLabel(i18nString(UIStrings.protocol), 'authenticator-option-label');\n protocolGroup.appendChild(protocolSelectTitle);\n this.#protocolSelect = protocolGroup.createChild('select', 'chrome-select');\n this.#protocolSelect.setAttribute('jslog', `${VisualLogging.dropDown('protocol').track({change: true})}`);\n UI.ARIAUtils.bindLabelToControl(protocolSelectTitle, (this.#protocolSelect as Element));\n Object.values(PROTOCOL_AUTHENTICATOR_VALUES).sort().forEach((option: Protocol.WebAuthn.AuthenticatorProtocol) => {\n if (this.#protocolSelect) {\n this.#protocolSelect.appendChild(UI.UIUtils.createOption(option, option, option));\n }\n });\n\n if (this.#protocolSelect) {\n this.#protocolSelect.value = Protocol.WebAuthn.AuthenticatorProtocol.Ctap2;\n }\n\n const transportSelectTitle = UI.UIUtils.createLabel(i18nString(UIStrings.transport), 'authenticator-option-label');\n transportGroup.appendChild(transportSelectTitle);\n this.transportSelect = transportGroup.createChild('select', 'chrome-select');\n this.transportSelect.setAttribute('jslog', `${VisualLogging.dropDown('transport').track({change: true})}`);\n UI.ARIAUtils.bindLabelToControl(transportSelectTitle, (this.transportSelect as Element));\n // transportSelect will be populated in updateNewAuthenticatorSectionOptions.\n\n this.#residentKeyCheckboxLabel =\n UI.UIUtils.CheckboxLabel.create(i18nString(UIStrings.supportsResidentKeys), false, undefined, 'resident-key');\n this.#residentKeyCheckboxLabel.textElement.classList.add('authenticator-option-label');\n residentKeyGroup.appendChild(this.#residentKeyCheckboxLabel.textElement);\n this.residentKeyCheckbox = this.#residentKeyCheckboxLabel.checkboxElement;\n this.residentKeyCheckbox.checked = false;\n this.residentKeyCheckbox.classList.add('authenticator-option-checkbox');\n residentKeyGroup.appendChild(this.#residentKeyCheckboxLabel);\n\n this.#userVerificationCheckboxLabel = UI.UIUtils.CheckboxLabel.create(\n i18nString(UIStrings.supportsUserVerification), false, undefined, 'user-verification');\n this.#userVerificationCheckboxLabel.textElement.classList.add('authenticator-option-label');\n userVerificationGroup.appendChild(this.#userVerificationCheckboxLabel.textElement);\n this.#userVerificationCheckbox = this.#userVerificationCheckboxLabel.checkboxElement;\n this.#userVerificationCheckbox.checked = false;\n this.#userVerificationCheckbox.classList.add('authenticator-option-checkbox');\n userVerificationGroup.appendChild(this.#userVerificationCheckboxLabel);\n\n this.#largeBlobCheckboxLabel =\n UI.UIUtils.CheckboxLabel.create(i18nString(UIStrings.supportsLargeBlob), false, undefined, 'large-blob');\n this.#largeBlobCheckboxLabel.textElement.classList.add('authenticator-option-label');\n largeBlobGroup.appendChild(this.#largeBlobCheckboxLabel.textElement);\n this.largeBlobCheckbox = this.#largeBlobCheckboxLabel.checkboxElement;\n this.largeBlobCheckbox.checked = false;\n this.largeBlobCheckbox.classList.add('authenticator-option-checkbox');\n this.largeBlobCheckbox.name = 'large-blob-checkbox';\n largeBlobGroup.appendChild(this.#largeBlobCheckboxLabel);\n\n this.addAuthenticatorButton = UI.UIUtils.createTextButton(\n i18nString(UIStrings.add), this.#handleAddAuthenticatorButton.bind(this),\n {jslogContext: 'webauthn.add-authenticator'});\n addButtonGroup.createChild('div', 'authenticator-option-label');\n addButtonGroup.appendChild(this.addAuthenticatorButton);\n const addAuthenticatorTitle = UI.UIUtils.createLabel(i18nString(UIStrings.addAuthenticator), '');\n UI.ARIAUtils.bindLabelToControl(addAuthenticatorTitle, this.addAuthenticatorButton);\n\n this.#updateNewAuthenticatorSectionOptions();\n if (this.#protocolSelect) {\n this.#protocolSelect.addEventListener('change', this.#updateNewAuthenticatorSectionOptions.bind(this));\n }\n if (this.residentKeyCheckbox) {\n this.residentKeyCheckbox.addEventListener('change', this.#updateNewAuthenticatorSectionOptions.bind(this));\n }\n }\n\n async #handleAddAuthenticatorButton(): Promise {\n const options = this.#createOptionsFromCurrentInputs();\n if (this.#model) {\n const authenticatorId = await this.#model.addAuthenticator(options);\n const availableAuthenticators = this.#availableAuthenticatorSetting.get();\n availableAuthenticators.push({authenticatorId, active: true, ...options});\n this.#availableAuthenticatorSetting.set(\n availableAuthenticators.map(a => ({...a, active: a.authenticatorId === authenticatorId})));\n const section = await this.#addAuthenticatorSection(authenticatorId, options);\n const mediaQueryList = window.matchMedia('(prefers-reduced-motion: reduce)');\n const prefersReducedMotion = mediaQueryList.matches;\n section.scrollIntoView({block: 'start', behavior: prefersReducedMotion ? 'auto' : 'smooth'});\n this.#updateInternalTransportAvailability();\n }\n }\n\n async #addAuthenticatorSection(\n authenticatorId: Protocol.WebAuthn.AuthenticatorId,\n options: Protocol.WebAuthn.VirtualAuthenticatorOptions): Promise {\n const section = document.createElement('div');\n section.classList.add('authenticator-section');\n section.setAttribute('data-authenticator-id', authenticatorId);\n section.setAttribute('jslog', `${VisualLogging.section('authenticator')}`);\n this.#authenticatorsView.appendChild(section);\n\n const headerElement = section.createChild('div', 'authenticator-section-header');\n const titleElement = headerElement.createChild('div', 'authenticator-section-title');\n UI.ARIAUtils.markAsHeading(titleElement, 2);\n\n await this.#clearActiveAuthenticator();\n const activeButtonContainer = headerElement.createChild('div', 'active-button-container');\n const {label: activeLabel, radio: activeRadio} = UI.UIUtils.createRadioButton(\n 'active-authenticator', i18nString(UIStrings.active), 'webauthn.active-authenticator');\n activeRadio.addEventListener('change', this.#setActiveAuthenticator.bind(this, authenticatorId));\n activeRadio.checked = true;\n activeButtonContainer.appendChild(activeLabel);\n this.#activeAuthId = authenticatorId; // Newly added authenticator is automatically set as active.\n\n const removeButton = headerElement.createChild('button', 'text-button');\n removeButton.textContent = i18nString(UIStrings.remove);\n removeButton.addEventListener('click', this.removeAuthenticator.bind(this, authenticatorId));\n removeButton.setAttribute('jslog', `${VisualLogging.action('webauthn.remove-authenticator').track({click: true})}`);\n\n const toolbar = new UI.Toolbar.Toolbar('edit-name-toolbar', titleElement);\n const editName = new UI.Toolbar.ToolbarButton(i18nString(UIStrings.editName), 'edit', undefined, 'edit-name');\n const saveName = new UI.Toolbar.ToolbarButton(i18nString(UIStrings.saveName), 'checkmark', undefined, 'save-name');\n saveName.setVisible(false);\n\n const nameField = titleElement.createChild('input', 'authenticator-name-field');\n nameField.placeholder = i18nString(UIStrings.enterNewName);\n nameField.disabled = true;\n nameField.setAttribute('jslog', `${VisualLogging.textField('name').track({keydown: 'Enter', change: true})}`);\n const userFriendlyName = authenticatorId.slice(-5); // User friendly name defaults to last 5 chars of UUID.\n nameField.value = i18nString(UIStrings.authenticatorS, {PH1: userFriendlyName});\n this.#updateActiveLabelTitle(activeLabel, nameField.value);\n\n editName.addEventListener(\n UI.Toolbar.ToolbarButton.Events.CLICK,\n () => this.#handleEditNameButton(titleElement, nameField, editName, saveName));\n saveName.addEventListener(\n UI.Toolbar.ToolbarButton.Events.CLICK,\n () => this.#handleSaveNameButton(titleElement, nameField, editName, saveName, activeLabel));\n\n nameField.addEventListener(\n 'focusout', () => this.#handleSaveNameButton(titleElement, nameField, editName, saveName, activeLabel));\n nameField.addEventListener('keydown', (event: KeyboardEvent) => {\n if (event.key === 'Enter') {\n this.#handleSaveNameButton(titleElement, nameField, editName, saveName, activeLabel);\n }\n });\n\n toolbar.appendToolbarItem(editName);\n toolbar.appendToolbarItem(saveName);\n\n this.#createAuthenticatorFields(section, authenticatorId, options);\n\n const label = document.createElement('div');\n label.classList.add('credentials-title');\n label.textContent = i18nString(UIStrings.credentials);\n section.appendChild(label);\n\n const dataGrid = this.#createCredentialsDataGrid(authenticatorId);\n dataGrid.asWidget().show(section);\n if (this.#model) {\n this.#model.addEventListener(\n SDK.WebAuthnModel.Events.CREDENTIAL_ADDED, this.#addCredential.bind(this, authenticatorId));\n this.#model.addEventListener(\n SDK.WebAuthnModel.Events.CREDENTIAL_ASSERTED, this.#updateCredential.bind(this, authenticatorId));\n this.#model.addEventListener(\n SDK.WebAuthnModel.Events.CREDENTIAL_UPDATED, this.#updateCredential.bind(this, authenticatorId));\n this.#model.addEventListener(\n SDK.WebAuthnModel.Events.CREDENTIAL_DELETED, this.#deleteCredential.bind(this, authenticatorId));\n }\n\n return section;\n }\n\n #exportCredential(credential: Protocol.WebAuthn.Credential): void {\n let pem = PRIVATE_KEY_HEADER;\n for (let i = 0; i < credential.privateKey.length; i += 64) {\n pem += credential.privateKey.substring(i, i + 64) + '\\n';\n }\n pem += PRIVATE_KEY_FOOTER;\n\n const link = document.createElement('a');\n link.download = i18nString(UIStrings.privateKeypem);\n link.href = 'data:application/x-pem-file,' + encodeURIComponent(pem);\n link.click();\n }\n\n async #removeCredential(authenticatorId: Protocol.WebAuthn.AuthenticatorId, credentialId: string): Promise {\n const dataGrid = this.dataGrids.get(authenticatorId);\n if (!dataGrid) {\n return;\n }\n\n // @ts-ignore dataGrid node type is indeterminate.\n dataGrid.rootNode()\n .children.find((n: DataGrid.DataGrid.DataGridNode) => n.data.credentialId === credentialId)\n .remove();\n\n if (!dataGrid.rootNode().children.length) {\n dataGrid.rootNode().appendChild(new EmptyDataGridNode());\n }\n\n if (this.#model) {\n await this.#model.removeCredential(authenticatorId, credentialId);\n }\n }\n\n /**\n * Creates the fields describing the authenticator in the front end.\n */\n #createAuthenticatorFields(\n section: Element, authenticatorId: string, options: Protocol.WebAuthn.VirtualAuthenticatorOptions): void {\n const sectionFields = section.createChild('div', 'authenticator-fields');\n const uuidField = sectionFields.createChild('div', 'authenticator-field');\n const protocolField = sectionFields.createChild('div', 'authenticator-field');\n const transportField = sectionFields.createChild('div', 'authenticator-field');\n const srkField = sectionFields.createChild('div', 'authenticator-field');\n const slbField = sectionFields.createChild('div', 'authenticator-field');\n const suvField = sectionFields.createChild('div', 'authenticator-field');\n\n uuidField.appendChild(UI.UIUtils.createLabel(i18nString(UIStrings.uuid), 'authenticator-option-label'));\n protocolField.appendChild(UI.UIUtils.createLabel(i18nString(UIStrings.protocol), 'authenticator-option-label'));\n transportField.appendChild(UI.UIUtils.createLabel(i18nString(UIStrings.transport), 'authenticator-option-label'));\n srkField.appendChild(\n UI.UIUtils.createLabel(i18nString(UIStrings.supportsResidentKeys), 'authenticator-option-label'));\n slbField.appendChild(UI.UIUtils.createLabel(i18nString(UIStrings.supportsLargeBlob), 'authenticator-option-label'));\n suvField.appendChild(\n UI.UIUtils.createLabel(i18nString(UIStrings.supportsUserVerification), 'authenticator-option-label'));\n\n uuidField.createChild('div', 'authenticator-field-value').textContent = authenticatorId;\n protocolField.createChild('div', 'authenticator-field-value').textContent = options.protocol;\n transportField.createChild('div', 'authenticator-field-value').textContent = options.transport;\n srkField.createChild('div', 'authenticator-field-value').textContent =\n options.hasResidentKey ? i18nString(UIStrings.yes) : i18nString(UIStrings.no);\n slbField.createChild('div', 'authenticator-field-value').textContent =\n options.hasLargeBlob ? i18nString(UIStrings.yes) : i18nString(UIStrings.no);\n suvField.createChild('div', 'authenticator-field-value').textContent =\n options.hasUserVerification ? i18nString(UIStrings.yes) : i18nString(UIStrings.no);\n }\n\n #handleEditNameButton(\n titleElement: Element, nameField: HTMLInputElement, editName: UI.Toolbar.ToolbarButton,\n saveName: UI.Toolbar.ToolbarButton): void {\n nameField.disabled = false;\n titleElement.classList.add('editing-name');\n nameField.focus();\n saveName.setVisible(true);\n editName.setVisible(false);\n }\n\n #handleSaveNameButton(\n titleElement: Element, nameField: HTMLInputElement, editName: UI.Toolbar.ToolbarItem,\n saveName: UI.Toolbar.ToolbarItem, activeLabel: HTMLLabelElement): void {\n const name = nameField.value;\n if (!name) {\n return;\n }\n nameField.disabled = true;\n titleElement.classList.remove('editing-name');\n editName.setVisible(true);\n saveName.setVisible(false);\n this.#updateActiveLabelTitle(activeLabel, name);\n }\n\n #updateActiveLabelTitle(activeLabel: HTMLLabelElement, authenticatorName: string): void {\n UI.Tooltip.Tooltip.install(\n activeLabel, i18nString(UIStrings.setSAsTheActiveAuthenticator, {PH1: authenticatorName}));\n }\n\n /**\n * Removes both the authenticator and its respective UI element.\n */\n removeAuthenticator(authenticatorId: Protocol.WebAuthn.AuthenticatorId): void {\n if (this.#authenticatorsView) {\n const child = this.#authenticatorsView.querySelector(`[data-authenticator-id=${CSS.escape(authenticatorId)}]`);\n if (child) {\n child.remove();\n }\n }\n const dataGrid = this.dataGrids.get(authenticatorId);\n if (dataGrid) {\n dataGrid.asWidget().detach();\n this.dataGrids.delete(authenticatorId);\n }\n\n if (this.#model) {\n void this.#model.removeAuthenticator(authenticatorId);\n }\n\n // Update available authenticator setting.\n const prevAvailableAuthenticators = this.#availableAuthenticatorSetting.get();\n const newAvailableAuthenticators = prevAvailableAuthenticators.filter(a => a.authenticatorId !== authenticatorId);\n this.#availableAuthenticatorSetting.set(newAvailableAuthenticators);\n\n if (this.#activeAuthId === authenticatorId) {\n const availableAuthenticatorIds = Array.from(this.dataGrids.keys());\n if (availableAuthenticatorIds.length) {\n void this.#setActiveAuthenticator(availableAuthenticatorIds[0]);\n } else {\n this.#activeAuthId = null;\n }\n }\n this.#updateInternalTransportAvailability();\n }\n\n #createOptionsFromCurrentInputs(): Protocol.WebAuthn.VirtualAuthenticatorOptions {\n // TODO(crbug.com/1034663): Add optionality for isUserVerified param.\n if (!this.#protocolSelect || !this.transportSelect || !this.residentKeyCheckbox ||\n !this.#userVerificationCheckbox || !this.largeBlobCheckbox) {\n throw new Error('Unable to create options from current inputs');\n }\n\n return {\n protocol: this.#protocolSelect.options[this.#protocolSelect.selectedIndex].value as\n Protocol.WebAuthn.AuthenticatorProtocol,\n ctap2Version: Protocol.WebAuthn.Ctap2Version.Ctap2_1,\n transport: this.transportSelect.options[this.transportSelect.selectedIndex].value as\n Protocol.WebAuthn.AuthenticatorTransport,\n hasResidentKey: this.residentKeyCheckbox.checked,\n hasUserVerification: this.#userVerificationCheckbox.checked,\n hasLargeBlob: this.largeBlobCheckbox.checked,\n automaticPresenceSimulation: true,\n isUserVerified: true,\n };\n }\n\n /**\n * Sets the given authenticator as active.\n * Note that a newly added authenticator will automatically be set as active.\n */\n async #setActiveAuthenticator(authenticatorId: Protocol.WebAuthn.AuthenticatorId): Promise {\n await this.#clearActiveAuthenticator();\n if (this.#model) {\n await this.#model.setAutomaticPresenceSimulation(authenticatorId, true);\n }\n this.#activeAuthId = authenticatorId;\n\n const prevAvailableAuthenticators = this.#availableAuthenticatorSetting.get();\n const newAvailableAuthenticators =\n prevAvailableAuthenticators.map(a => ({...a, active: a.authenticatorId === authenticatorId}));\n this.#availableAuthenticatorSetting.set(newAvailableAuthenticators);\n\n this.#updateActiveButtons();\n }\n\n #updateActiveButtons(): void {\n const authenticators = this.#authenticatorsView.getElementsByClassName('authenticator-section');\n Array.from(authenticators).forEach((authenticator: Element) => {\n const button = (authenticator.querySelector('input[type=\"radio\"]') as HTMLInputElement);\n if (!button) {\n return;\n }\n button.checked = (authenticator as HTMLElement).dataset.authenticatorId === this.#activeAuthId;\n });\n }\n\n async #clearActiveAuthenticator(): Promise {\n if (this.#activeAuthId && this.#model) {\n await this.#model.setAutomaticPresenceSimulation(this.#activeAuthId, false);\n }\n this.#activeAuthId = null;\n this.#updateActiveButtons();\n }\n override wasShown(): void {\n super.wasShown();\n this.registerCSSFiles([webauthnPaneStyles]);\n }\n}\n"]} \ No newline at end of file diff --git a/public/panels/webauthn/WebauthnPane.test.js b/public/panels/webauthn/WebauthnPane.test.js index 80ac01d2c..42519d383 100644 --- a/public/panels/webauthn/WebauthnPane.test.js +++ b/public/panels/webauthn/WebauthnPane.test.js @@ -107,7 +107,7 @@ describeWithMockConnection('WebAuthn pane', () => { assert.fail('Expected dataGrid to be truthy'); return; } - assert.strictEqual(dataGrid.rootNode().children.length, 1); + assert.lengthOf(dataGrid.rootNode().children, 1); let emptyNode = dataGrid.rootNode().children[0]; assert.isOk(emptyNode); assert.deepEqual(emptyNode.data, {}); @@ -125,14 +125,14 @@ describeWithMockConnection('WebAuthn pane', () => { credential, }); // Verify the credential appeared and the empty row was removed. - assert.strictEqual(dataGrid.rootNode().children.length, 1); + assert.lengthOf(dataGrid.rootNode().children, 1); const credentialNode = dataGrid.rootNode().children[0]; assert.isOk(credentialNode); assert.strictEqual(credentialNode.data, credential); // Remove the credential. const removeCredential = sinon.stub(model, 'removeCredential').resolves(); dataGrid.element.querySelectorAll('devtools-button')[1].click(); - assert.strictEqual(dataGrid.rootNode().children.length, 1); + assert.lengthOf(dataGrid.rootNode().children, 1); emptyNode = dataGrid.rootNode().children[0]; assert.isOk(emptyNode); assert.deepEqual(emptyNode.data, {}); @@ -170,7 +170,7 @@ describeWithMockConnection('WebAuthn pane', () => { assert.fail('Expected dataGrid to be truthy'); return; } - assert.strictEqual(dataGrid.rootNode().children.length, 1); + assert.lengthOf(dataGrid.rootNode().children, 1); const credentialNode = dataGrid.rootNode().children[0]; assert.isOk(credentialNode); assert.strictEqual(credentialNode.data, credential); @@ -188,7 +188,7 @@ describeWithMockConnection('WebAuthn pane', () => { credential: updatedCredential1, }); // Verify the credential was updated. - assert.strictEqual(dataGrid.rootNode().children.length, 1); + assert.lengthOf(dataGrid.rootNode().children, 1); assert.strictEqual(credentialNode.data, updatedCredential1); // The credential can also be updated through the CREDENTIAL_UPDATED // event. @@ -205,7 +205,7 @@ describeWithMockConnection('WebAuthn pane', () => { credential: updatedCredential2, }); // Verify the credential was updated. - assert.strictEqual(dataGrid.rootNode().children.length, 1); + assert.lengthOf(dataGrid.rootNode().children, 1); assert.strictEqual(credentialNode.data, updatedCredential2); // Updating a different credential should not affect the existing one. const anotherCredential = { @@ -221,7 +221,7 @@ describeWithMockConnection('WebAuthn pane', () => { credential: anotherCredential, }); // Verify the credential was unchanged. - assert.strictEqual(dataGrid.rootNode().children.length, 1); + assert.lengthOf(dataGrid.rootNode().children, 1); assert.strictEqual(credentialNode.data, updatedCredential2); }); it('removes credentials that were deleted', async () => { @@ -253,7 +253,7 @@ describeWithMockConnection('WebAuthn pane', () => { assert.fail('Expected dataGrid to be truthy'); return; } - assert.strictEqual(dataGrid.rootNode().children.length, 1); + assert.lengthOf(dataGrid.rootNode().children, 1); const credentialNode = dataGrid.rootNode().children[0]; assert.isOk(credentialNode); assert.strictEqual(credentialNode.data, credential); @@ -262,13 +262,13 @@ describeWithMockConnection('WebAuthn pane', () => { authenticatorId, credentialId: 'another credential', }); - assert.strictEqual(dataGrid.rootNode().children.length, 1); + assert.lengthOf(dataGrid.rootNode().children, 1); // Delete the credential. It should be removed from the list. model.dispatchEventToListeners("CredentialDeleted" /* SDK.WebAuthnModel.Events.CREDENTIAL_DELETED */, { authenticatorId, credentialId: credential.credentialId, }); - assert.strictEqual(dataGrid.rootNode().children.length, 0); + assert.lengthOf(dataGrid.rootNode().children, 0); }); it('disables "internal" if an internal authenticator exists', async () => { const authenticatorId = 'authenticator-1'; diff --git a/public/panels/webauthn/WebauthnPane.test.js.map b/public/panels/webauthn/WebauthnPane.test.js.map index 06fd1e983..06223b3fb 100644 --- a/public/panels/webauthn/WebauthnPane.test.js.map +++ b/public/panels/webauthn/WebauthnPane.test.js.map @@ -1 +1 @@ -{"version":3,"file":"WebauthnPane.test.js","sourceRoot":"","sources":["../../../../../../front_end/panels/webauthn/WebauthnPane.test.ts"],"names":[],"mappings":"AAAA,gEAAgE;AAChE,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,KAAK,GAAG,MAAM,uBAAuB,CAAC;AAE7C,OAAO,EAAC,YAAY,EAAC,MAAM,qCAAqC,CAAC;AACjE,OAAO,EACL,0BAA0B,GAC3B,MAAM,iCAAiC,CAAC;AAIzC,0BAA0B,CAAC,eAAe,EAAE,GAAG,EAAE;IAC/C,gEAAgE;IAChE,IAAI,QAA+B,CAAC;IAEpC,MAAM,CAAC,KAAK,IAAI,EAAE;QAChB,QAAQ,GAAG,MAAM,MAAM,CAAC,eAAe,CAAC,CAAC;IAC3C,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,8DAA8D,EAAE,GAAG,EAAE;QACtE,MAAM,KAAK,GAAG,IAAI,QAAQ,CAAC,YAAY,CAAC,gBAAgB,EAAE,CAAC;QAC3D,MAAM,SAAS,GAAG,KAAK,CAAC,iBAAiB,CAAC;QAC1C,MAAM,YAAY,GAAG,KAAK,CAAC,mBAAmB,CAAC;QAE/C,IAAI,CAAC,SAAS,IAAI,CAAC,YAAY,EAAE,CAAC;YAChC,MAAM,CAAC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gBAAgB,EAAE,CAAC;YACrD,SAAS,GAAG,KAAK,CAAC,eAAe,CAAC;YAClC,IAAI,CAAC,SAAS,EAAE,CAAC;gBACf,MAAM,CAAC,IAAI,CAAC,iCAAiC,CAAC,CAAC;YACjD,CAAC;YACD,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,OAAO,CAAC,sBAAsB,CAAC,CAAC,QAAQ,CAAC,CAAC;YAElE,mEAAmE;YACnE,KAAK,CAAC,mBAAmB,CAAC,eAAe,CAAC,CAAC;YAC3C,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,OAAO,CAAC,sBAAsB,CAAC,CAAC,QAAQ,CAAC,CAAC;QACrE,CAAC,CAAC,CAAC;IACL,CAAC,CAAC;IAEF,QAAQ,CAAC,UAAU,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC;IACxC,QAAQ,CAAC,cAAc,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC;AAC/C,CAAC,CAAC,CAAC","sourcesContent":["// Copyright (c) 2022 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport * as SDK from '../../core/sdk/sdk.js';\nimport * as Protocol from '../../generated/protocol.js';\nimport {createTarget} from '../../testing/EnvironmentHelpers.js';\nimport {\n describeWithMockConnection,\n} from '../../testing/MockConnection.js';\n\nimport type * as WebauthnModule from './webauthn.js';\n\ndescribeWithMockConnection('WebAuthn pane', () => {\n // eslint-disable-next-line @typescript-eslint/naming-convention\n let Webauthn: typeof WebauthnModule;\n\n before(async () => {\n Webauthn = await import('./webauthn.js');\n });\n\n it('disables the large blob checkbox if resident key is disabled', () => {\n const panel = new Webauthn.WebauthnPane.WebauthnPaneImpl();\n const largeBlob = panel.largeBlobCheckbox;\n const residentKeys = panel.residentKeyCheckbox;\n\n if (!largeBlob || !residentKeys) {\n assert.fail('Required checkbox not found');\n return;\n }\n\n // Make sure resident keys is disabled. Large blob should be disabled and\n // unchecked.\n residentKeys.checked = false;\n residentKeys.dispatchEvent(new Event('change'));\n assert.isTrue(largeBlob.disabled);\n assert.isFalse(largeBlob.checked);\n\n // Enable resident keys. Large blob should be enabled but still not\n // checked.\n residentKeys.checked = true;\n residentKeys.dispatchEvent(new Event('change'));\n assert.isFalse(largeBlob.disabled);\n assert.isFalse(largeBlob.checked);\n\n // Manually check large blob.\n largeBlob.checked = true;\n assert.isTrue(largeBlob.checked);\n\n // Disabling resident keys should reset large blob to disabled and\n // unchecked.\n residentKeys.checked = false;\n residentKeys.dispatchEvent(new Event('change'));\n assert.isTrue(largeBlob.disabled);\n assert.isFalse(largeBlob.checked);\n });\n\n const tests = (inScope: boolean) => {\n let target: SDK.Target.Target;\n let model: SDK.WebAuthnModel.WebAuthnModel;\n let panel: WebauthnModule.WebauthnPane.WebauthnPaneImpl;\n beforeEach(() => {\n const tabTarget = createTarget({type: SDK.Target.Type.TAB});\n createTarget({parentTarget: tabTarget, subtype: 'prerender'});\n target = createTarget({parentTarget: tabTarget});\n SDK.TargetManager.TargetManager.instance().setScopeTarget(inScope ? target : null);\n model = target.model(SDK.WebAuthnModel.WebAuthnModel) as SDK.WebAuthnModel.WebAuthnModel;\n assert.exists(model);\n panel = new Webauthn.WebauthnPane.WebauthnPaneImpl();\n });\n\n it('adds an authenticator with large blob option', async () => {\n const largeBlob = panel.largeBlobCheckbox;\n const residentKeys = panel.residentKeyCheckbox;\n\n if (!largeBlob || !residentKeys) {\n assert.fail('Required checkbox not found');\n return;\n }\n residentKeys.checked = true;\n largeBlob.checked = true;\n\n const addAuthenticator = sinon.stub(model, 'addAuthenticator');\n panel.addAuthenticatorButton?.click();\n await new Promise(resolve => setTimeout(resolve, 0));\n assert.strictEqual(addAuthenticator.called, inScope);\n if (inScope) {\n const options = addAuthenticator.firstCall.firstArg;\n assert.isTrue(options.hasLargeBlob);\n assert.isTrue(options.hasResidentKey);\n }\n });\n\n it('adds an authenticator without the large blob option', async () => {\n const largeBlob = panel.largeBlobCheckbox;\n const residentKeys = panel.residentKeyCheckbox;\n\n if (!largeBlob || !residentKeys) {\n assert.fail('Required checkbox not found');\n return;\n }\n residentKeys.checked = true;\n largeBlob.checked = false;\n\n const addAuthenticator = sinon.stub(model, 'addAuthenticator');\n panel.addAuthenticatorButton?.click();\n await new Promise(resolve => setTimeout(resolve, 0));\n assert.strictEqual(addAuthenticator.called, inScope);\n if (inScope) {\n const options = addAuthenticator.firstCall.firstArg;\n assert.isFalse(options.hasLargeBlob);\n assert.isTrue(options.hasResidentKey);\n }\n });\n\n it('lists and removes credentials', async () => {\n const authenticatorId = 'authenticator-1' as Protocol.WebAuthn.AuthenticatorId;\n\n // Add an authenticator.\n const addAuthenticator = sinon.stub(model, 'addAuthenticator').resolves(authenticatorId);\n panel.addAuthenticatorButton?.click();\n await new Promise(resolve => setTimeout(resolve, 0));\n assert.strictEqual(addAuthenticator.called, inScope);\n if (!inScope) {\n return;\n }\n\n // Verify a data grid appeared with a single row to show there is no data.\n const dataGrid = panel.dataGrids.get(authenticatorId);\n if (!dataGrid) {\n assert.fail('Expected dataGrid to be truthy');\n return;\n }\n assert.strictEqual(dataGrid.rootNode().children.length, 1);\n let emptyNode = dataGrid.rootNode().children[0];\n assert.isOk(emptyNode);\n assert.deepEqual(emptyNode.data, {});\n\n // Add a credential.\n const credential = {\n credentialId: 'credential',\n isResidentCredential: false,\n rpId: 'talos1.org',\n userHandle: 'morgan',\n signCount: 1,\n privateKey: '',\n };\n model.dispatchEventToListeners(SDK.WebAuthnModel.Events.CREDENTIAL_ADDED, {\n authenticatorId,\n credential,\n });\n\n // Verify the credential appeared and the empty row was removed.\n assert.strictEqual(dataGrid.rootNode().children.length, 1);\n const credentialNode = dataGrid.rootNode().children[0];\n assert.isOk(credentialNode);\n assert.strictEqual(credentialNode.data, credential);\n\n // Remove the credential.\n const removeCredential = sinon.stub(model, 'removeCredential').resolves();\n dataGrid.element.querySelectorAll('devtools-button')[1].click();\n assert.strictEqual(dataGrid.rootNode().children.length, 1);\n emptyNode = dataGrid.rootNode().children[0];\n assert.isOk(emptyNode);\n assert.deepEqual(emptyNode.data, {});\n await new Promise(resolve => setTimeout(resolve, 0));\n assert.isTrue(removeCredential.called);\n\n assert.strictEqual(removeCredential.firstCall.firstArg, authenticatorId);\n assert.strictEqual(removeCredential.firstCall.lastArg, credential.credentialId);\n });\n\n it('updates credentials', async () => {\n const authenticatorId = 'authenticator-1' as Protocol.WebAuthn.AuthenticatorId;\n\n // Add an authenticator.\n const addAuthenticator = sinon.stub(model, 'addAuthenticator').resolves(authenticatorId);\n panel.addAuthenticatorButton?.click();\n await new Promise(resolve => setTimeout(resolve, 0));\n assert.strictEqual(addAuthenticator.called, inScope);\n if (!inScope) {\n return;\n }\n\n // Add a credential.\n const credential = {\n credentialId: 'credential',\n isResidentCredential: false,\n rpId: 'talos1.org',\n userHandle: 'morgan',\n signCount: 1,\n privateKey: '',\n };\n model.dispatchEventToListeners(SDK.WebAuthnModel.Events.CREDENTIAL_ADDED, {\n authenticatorId,\n credential,\n });\n\n // Verify the credential appeared.\n const dataGrid = panel.dataGrids.get(authenticatorId);\n if (!dataGrid) {\n assert.fail('Expected dataGrid to be truthy');\n return;\n }\n assert.strictEqual(dataGrid.rootNode().children.length, 1);\n const credentialNode = dataGrid.rootNode().children[0];\n assert.isOk(credentialNode);\n assert.strictEqual(credentialNode.data, credential);\n\n // Update the credential.\n const updatedCredential1 = {\n credentialId: 'credential',\n isResidentCredential: false,\n rpId: 'talos1.org',\n userHandle: 'morgan',\n signCount: 2,\n privateKey: '',\n };\n model.dispatchEventToListeners(SDK.WebAuthnModel.Events.CREDENTIAL_ASSERTED, {\n authenticatorId,\n credential: updatedCredential1,\n });\n\n // Verify the credential was updated.\n assert.strictEqual(dataGrid.rootNode().children.length, 1);\n assert.strictEqual(credentialNode.data, updatedCredential1);\n\n // The credential can also be updated through the CREDENTIAL_UPDATED\n // event.\n const updatedCredential2 = {\n credentialId: 'credential',\n isResidentCredential: false,\n rpId: 'talos1.org',\n userHandle: 'danielle',\n signCount: 2,\n privateKey: '',\n };\n model.dispatchEventToListeners(SDK.WebAuthnModel.Events.CREDENTIAL_UPDATED, {\n authenticatorId,\n credential: updatedCredential2,\n });\n\n // Verify the credential was updated.\n assert.strictEqual(dataGrid.rootNode().children.length, 1);\n assert.strictEqual(credentialNode.data, updatedCredential2);\n\n // Updating a different credential should not affect the existing one.\n const anotherCredential = {\n credentialId: 'another-credential',\n isResidentCredential: false,\n rpId: 'talos1.org',\n userHandle: 'alex',\n signCount: 1,\n privateKey: '',\n };\n model.dispatchEventToListeners(SDK.WebAuthnModel.Events.CREDENTIAL_ASSERTED, {\n authenticatorId,\n credential: anotherCredential,\n });\n\n // Verify the credential was unchanged.\n assert.strictEqual(dataGrid.rootNode().children.length, 1);\n assert.strictEqual(credentialNode.data, updatedCredential2);\n });\n\n it('removes credentials that were deleted', async () => {\n const authenticatorId = 'authenticator-1' as Protocol.WebAuthn.AuthenticatorId;\n\n // Add an authenticator.\n const addAuthenticator = sinon.stub(model, 'addAuthenticator').resolves(authenticatorId);\n panel.addAuthenticatorButton?.click();\n await new Promise(resolve => setTimeout(resolve, 0));\n assert.strictEqual(addAuthenticator.called, inScope);\n if (!inScope) {\n return;\n }\n\n // Add a credential.\n const credential = {\n credentialId: 'credential',\n isResidentCredential: false,\n rpId: 'talos1.org',\n userHandle: 'morgan',\n signCount: 1,\n privateKey: '',\n };\n model.dispatchEventToListeners(SDK.WebAuthnModel.Events.CREDENTIAL_ADDED, {\n authenticatorId,\n credential,\n });\n\n // Verify the credential appeared.\n const dataGrid = panel.dataGrids.get(authenticatorId);\n if (!dataGrid) {\n assert.fail('Expected dataGrid to be truthy');\n return;\n }\n assert.strictEqual(dataGrid.rootNode().children.length, 1);\n const credentialNode = dataGrid.rootNode().children[0];\n assert.isOk(credentialNode);\n assert.strictEqual(credentialNode.data, credential);\n\n // Delete a credential with a different ID. This should be ignored.\n model.dispatchEventToListeners(SDK.WebAuthnModel.Events.CREDENTIAL_DELETED, {\n authenticatorId,\n credentialId: 'another credential',\n });\n assert.strictEqual(dataGrid.rootNode().children.length, 1);\n\n // Delete the credential. It should be removed from the list.\n model.dispatchEventToListeners(SDK.WebAuthnModel.Events.CREDENTIAL_DELETED, {\n authenticatorId,\n credentialId: credential.credentialId,\n });\n assert.strictEqual(dataGrid.rootNode().children.length, 0);\n });\n\n it('disables \"internal\" if an internal authenticator exists', async () => {\n const authenticatorId = 'authenticator-1' as Protocol.WebAuthn.AuthenticatorId;\n let panel = new Webauthn.WebauthnPane.WebauthnPaneImpl();\n let transport = panel.transportSelect;\n if (!transport) {\n assert.fail('Transport select is not present');\n }\n let internalTransportIndex = -1;\n for (let i = 0; i < transport.options.length; ++i) {\n if (transport.options[i].value === Protocol.WebAuthn.AuthenticatorTransport.Internal) {\n internalTransportIndex = i;\n break;\n }\n }\n assert.notEqual(internalTransportIndex, -1);\n assert.isFalse(transport.options[internalTransportIndex].disabled);\n\n // Add an internal authenticator.\n transport.selectedIndex = internalTransportIndex;\n const addAuthenticator = sinon.stub(model, 'addAuthenticator').resolves(authenticatorId);\n panel.addAuthenticatorButton?.click();\n await new Promise(resolve => setTimeout(resolve, 0));\n assert.strictEqual(addAuthenticator.called, inScope);\n if (!inScope) {\n return;\n }\n\n // The \"internal\" option should have been disabled, and another option selected.\n assert.notEqual(transport.selectedIndex, internalTransportIndex);\n assert.isTrue(transport.options[internalTransportIndex].disabled);\n\n // Restoring the authenticator when loading the panel again should also cause \"internal\" to be disabled.\n panel = new Webauthn.WebauthnPane.WebauthnPaneImpl();\n transport = panel.transportSelect;\n if (!transport) {\n assert.fail('Transport select is not present');\n }\n assert.isTrue(transport.options[internalTransportIndex].disabled);\n\n // Removing the internal authenticator should re-enable the option.\n panel.removeAuthenticator(authenticatorId);\n assert.isFalse(transport.options[internalTransportIndex].disabled);\n });\n };\n\n describe('in scope', () => tests(true));\n describe('out of scope', () => tests(false));\n});\n"]} \ No newline at end of file +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c,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC;AAC/C,CAAC,CAAC,CAAC","sourcesContent":["// Copyright (c) 2022 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport * as SDK from '../../core/sdk/sdk.js';\nimport * as Protocol from '../../generated/protocol.js';\nimport {createTarget} from '../../testing/EnvironmentHelpers.js';\nimport {\n describeWithMockConnection,\n} from '../../testing/MockConnection.js';\n\nimport type * as WebauthnModule from './webauthn.js';\n\ndescribeWithMockConnection('WebAuthn pane', () => {\n // eslint-disable-next-line @typescript-eslint/naming-convention\n let Webauthn: typeof WebauthnModule;\n\n before(async () => {\n Webauthn = await import('./webauthn.js');\n });\n\n it('disables the large blob checkbox if resident key is disabled', () => {\n const panel = new Webauthn.WebauthnPane.WebauthnPaneImpl();\n const largeBlob = panel.largeBlobCheckbox;\n const residentKeys = panel.residentKeyCheckbox;\n\n if (!largeBlob || !residentKeys) {\n assert.fail('Required checkbox not found');\n return;\n }\n\n // Make sure resident keys is disabled. Large blob should be disabled and\n // unchecked.\n residentKeys.checked = false;\n residentKeys.dispatchEvent(new Event('change'));\n assert.isTrue(largeBlob.disabled);\n assert.isFalse(largeBlob.checked);\n\n // Enable resident keys. Large blob should be enabled but still not\n // checked.\n residentKeys.checked = true;\n residentKeys.dispatchEvent(new Event('change'));\n assert.isFalse(largeBlob.disabled);\n assert.isFalse(largeBlob.checked);\n\n // Manually check large blob.\n largeBlob.checked = true;\n assert.isTrue(largeBlob.checked);\n\n // Disabling resident keys should reset large blob to disabled and\n // unchecked.\n residentKeys.checked = false;\n residentKeys.dispatchEvent(new Event('change'));\n assert.isTrue(largeBlob.disabled);\n assert.isFalse(largeBlob.checked);\n });\n\n const tests = (inScope: boolean) => {\n let target: SDK.Target.Target;\n let model: SDK.WebAuthnModel.WebAuthnModel;\n let panel: WebauthnModule.WebauthnPane.WebauthnPaneImpl;\n beforeEach(() => {\n const tabTarget = createTarget({type: SDK.Target.Type.TAB});\n createTarget({parentTarget: tabTarget, subtype: 'prerender'});\n target = createTarget({parentTarget: tabTarget});\n SDK.TargetManager.TargetManager.instance().setScopeTarget(inScope ? target : null);\n model = target.model(SDK.WebAuthnModel.WebAuthnModel) as SDK.WebAuthnModel.WebAuthnModel;\n assert.exists(model);\n panel = new Webauthn.WebauthnPane.WebauthnPaneImpl();\n });\n\n it('adds an authenticator with large blob option', async () => {\n const largeBlob = panel.largeBlobCheckbox;\n const residentKeys = panel.residentKeyCheckbox;\n\n if (!largeBlob || !residentKeys) {\n assert.fail('Required checkbox not found');\n return;\n }\n residentKeys.checked = true;\n largeBlob.checked = true;\n\n const addAuthenticator = sinon.stub(model, 'addAuthenticator');\n panel.addAuthenticatorButton?.click();\n await new Promise(resolve => setTimeout(resolve, 0));\n assert.strictEqual(addAuthenticator.called, inScope);\n if (inScope) {\n const options = addAuthenticator.firstCall.firstArg;\n assert.isTrue(options.hasLargeBlob);\n assert.isTrue(options.hasResidentKey);\n }\n });\n\n it('adds an authenticator without the large blob option', async () => {\n const largeBlob = panel.largeBlobCheckbox;\n const residentKeys = panel.residentKeyCheckbox;\n\n if (!largeBlob || !residentKeys) {\n assert.fail('Required checkbox not found');\n return;\n }\n residentKeys.checked = true;\n largeBlob.checked = false;\n\n const addAuthenticator = sinon.stub(model, 'addAuthenticator');\n panel.addAuthenticatorButton?.click();\n await new Promise(resolve => setTimeout(resolve, 0));\n assert.strictEqual(addAuthenticator.called, inScope);\n if (inScope) {\n const options = addAuthenticator.firstCall.firstArg;\n assert.isFalse(options.hasLargeBlob);\n assert.isTrue(options.hasResidentKey);\n }\n });\n\n it('lists and removes credentials', async () => {\n const authenticatorId = 'authenticator-1' as Protocol.WebAuthn.AuthenticatorId;\n\n // Add an authenticator.\n const addAuthenticator = sinon.stub(model, 'addAuthenticator').resolves(authenticatorId);\n panel.addAuthenticatorButton?.click();\n await new Promise(resolve => setTimeout(resolve, 0));\n assert.strictEqual(addAuthenticator.called, inScope);\n if (!inScope) {\n return;\n }\n\n // Verify a data grid appeared with a single row to show there is no data.\n const dataGrid = panel.dataGrids.get(authenticatorId);\n if (!dataGrid) {\n assert.fail('Expected dataGrid to be truthy');\n return;\n }\n assert.lengthOf(dataGrid.rootNode().children, 1);\n let emptyNode = dataGrid.rootNode().children[0];\n assert.isOk(emptyNode);\n assert.deepEqual(emptyNode.data, {});\n\n // Add a credential.\n const credential = {\n credentialId: 'credential',\n isResidentCredential: false,\n rpId: 'talos1.org',\n userHandle: 'morgan',\n signCount: 1,\n privateKey: '',\n };\n model.dispatchEventToListeners(SDK.WebAuthnModel.Events.CREDENTIAL_ADDED, {\n authenticatorId,\n credential,\n });\n\n // Verify the credential appeared and the empty row was removed.\n assert.lengthOf(dataGrid.rootNode().children, 1);\n const credentialNode = dataGrid.rootNode().children[0];\n assert.isOk(credentialNode);\n assert.strictEqual(credentialNode.data, credential);\n\n // Remove the credential.\n const removeCredential = sinon.stub(model, 'removeCredential').resolves();\n dataGrid.element.querySelectorAll('devtools-button')[1].click();\n assert.lengthOf(dataGrid.rootNode().children, 1);\n emptyNode = dataGrid.rootNode().children[0];\n assert.isOk(emptyNode);\n assert.deepEqual(emptyNode.data, {});\n await new Promise(resolve => setTimeout(resolve, 0));\n assert.isTrue(removeCredential.called);\n\n assert.strictEqual(removeCredential.firstCall.firstArg, authenticatorId);\n assert.strictEqual(removeCredential.firstCall.lastArg, credential.credentialId);\n });\n\n it('updates credentials', async () => {\n const authenticatorId = 'authenticator-1' as Protocol.WebAuthn.AuthenticatorId;\n\n // Add an authenticator.\n const addAuthenticator = sinon.stub(model, 'addAuthenticator').resolves(authenticatorId);\n panel.addAuthenticatorButton?.click();\n await new Promise(resolve => setTimeout(resolve, 0));\n assert.strictEqual(addAuthenticator.called, inScope);\n if (!inScope) {\n return;\n }\n\n // Add a credential.\n const credential = {\n credentialId: 'credential',\n isResidentCredential: false,\n rpId: 'talos1.org',\n userHandle: 'morgan',\n signCount: 1,\n privateKey: '',\n };\n model.dispatchEventToListeners(SDK.WebAuthnModel.Events.CREDENTIAL_ADDED, {\n authenticatorId,\n credential,\n });\n\n // Verify the credential appeared.\n const dataGrid = panel.dataGrids.get(authenticatorId);\n if (!dataGrid) {\n assert.fail('Expected dataGrid to be truthy');\n return;\n }\n assert.lengthOf(dataGrid.rootNode().children, 1);\n const credentialNode = dataGrid.rootNode().children[0];\n assert.isOk(credentialNode);\n assert.strictEqual(credentialNode.data, credential);\n\n // Update the credential.\n const updatedCredential1 = {\n credentialId: 'credential',\n isResidentCredential: false,\n rpId: 'talos1.org',\n userHandle: 'morgan',\n signCount: 2,\n privateKey: '',\n };\n model.dispatchEventToListeners(SDK.WebAuthnModel.Events.CREDENTIAL_ASSERTED, {\n authenticatorId,\n credential: updatedCredential1,\n });\n\n // Verify the credential was updated.\n assert.lengthOf(dataGrid.rootNode().children, 1);\n assert.strictEqual(credentialNode.data, updatedCredential1);\n\n // The credential can also be updated through the CREDENTIAL_UPDATED\n // event.\n const updatedCredential2 = {\n credentialId: 'credential',\n isResidentCredential: false,\n rpId: 'talos1.org',\n userHandle: 'danielle',\n signCount: 2,\n privateKey: '',\n };\n model.dispatchEventToListeners(SDK.WebAuthnModel.Events.CREDENTIAL_UPDATED, {\n authenticatorId,\n credential: updatedCredential2,\n });\n\n // Verify the credential was updated.\n assert.lengthOf(dataGrid.rootNode().children, 1);\n assert.strictEqual(credentialNode.data, updatedCredential2);\n\n // Updating a different credential should not affect the existing one.\n const anotherCredential = {\n credentialId: 'another-credential',\n isResidentCredential: false,\n rpId: 'talos1.org',\n userHandle: 'alex',\n signCount: 1,\n privateKey: '',\n };\n model.dispatchEventToListeners(SDK.WebAuthnModel.Events.CREDENTIAL_ASSERTED, {\n authenticatorId,\n credential: anotherCredential,\n });\n\n // Verify the credential was unchanged.\n assert.lengthOf(dataGrid.rootNode().children, 1);\n assert.strictEqual(credentialNode.data, updatedCredential2);\n });\n\n it('removes credentials that were deleted', async () => {\n const authenticatorId = 'authenticator-1' as Protocol.WebAuthn.AuthenticatorId;\n\n // Add an authenticator.\n const addAuthenticator = sinon.stub(model, 'addAuthenticator').resolves(authenticatorId);\n panel.addAuthenticatorButton?.click();\n await new Promise(resolve => setTimeout(resolve, 0));\n assert.strictEqual(addAuthenticator.called, inScope);\n if (!inScope) {\n return;\n }\n\n // Add a credential.\n const credential = {\n credentialId: 'credential',\n isResidentCredential: false,\n rpId: 'talos1.org',\n userHandle: 'morgan',\n signCount: 1,\n privateKey: '',\n };\n model.dispatchEventToListeners(SDK.WebAuthnModel.Events.CREDENTIAL_ADDED, {\n authenticatorId,\n credential,\n });\n\n // Verify the credential appeared.\n const dataGrid = panel.dataGrids.get(authenticatorId);\n if (!dataGrid) {\n assert.fail('Expected dataGrid to be truthy');\n return;\n }\n assert.lengthOf(dataGrid.rootNode().children, 1);\n const credentialNode = dataGrid.rootNode().children[0];\n assert.isOk(credentialNode);\n assert.strictEqual(credentialNode.data, credential);\n\n // Delete a credential with a different ID. This should be ignored.\n model.dispatchEventToListeners(SDK.WebAuthnModel.Events.CREDENTIAL_DELETED, {\n authenticatorId,\n credentialId: 'another credential',\n });\n assert.lengthOf(dataGrid.rootNode().children, 1);\n\n // Delete the credential. It should be removed from the list.\n model.dispatchEventToListeners(SDK.WebAuthnModel.Events.CREDENTIAL_DELETED, {\n authenticatorId,\n credentialId: credential.credentialId,\n });\n assert.lengthOf(dataGrid.rootNode().children, 0);\n });\n\n it('disables \"internal\" if an internal authenticator exists', async () => {\n const authenticatorId = 'authenticator-1' as Protocol.WebAuthn.AuthenticatorId;\n let panel = new Webauthn.WebauthnPane.WebauthnPaneImpl();\n let transport = panel.transportSelect;\n if (!transport) {\n assert.fail('Transport select is not present');\n }\n let internalTransportIndex = -1;\n for (let i = 0; i < transport.options.length; ++i) {\n if (transport.options[i].value === Protocol.WebAuthn.AuthenticatorTransport.Internal) {\n internalTransportIndex = i;\n break;\n }\n }\n assert.notEqual(internalTransportIndex, -1);\n assert.isFalse(transport.options[internalTransportIndex].disabled);\n\n // Add an internal authenticator.\n transport.selectedIndex = internalTransportIndex;\n const addAuthenticator = sinon.stub(model, 'addAuthenticator').resolves(authenticatorId);\n panel.addAuthenticatorButton?.click();\n await new Promise(resolve => setTimeout(resolve, 0));\n assert.strictEqual(addAuthenticator.called, inScope);\n if (!inScope) {\n return;\n }\n\n // The \"internal\" option should have been disabled, and another option selected.\n assert.notEqual(transport.selectedIndex, internalTransportIndex);\n assert.isTrue(transport.options[internalTransportIndex].disabled);\n\n // Restoring the authenticator when loading the panel again should also cause \"internal\" to be disabled.\n panel = new Webauthn.WebauthnPane.WebauthnPaneImpl();\n transport = panel.transportSelect;\n if (!transport) {\n assert.fail('Transport select is not present');\n }\n assert.isTrue(transport.options[internalTransportIndex].disabled);\n\n // Removing the internal authenticator should re-enable the option.\n panel.removeAuthenticator(authenticatorId);\n assert.isFalse(transport.options[internalTransportIndex].disabled);\n });\n };\n\n describe('in scope', () => tests(true));\n describe('out of scope', () => tests(false));\n});\n"]} \ No newline at end of file diff --git a/public/panels/webauthn/webauthnPane.css.js b/public/panels/webauthn/webauthnPane.css.js index 17c265977..79cba69f4 100644 --- a/public/panels/webauthn/webauthnPane.css.js +++ b/public/panels/webauthn/webauthnPane.css.js @@ -76,11 +76,6 @@ styles.replaceSync( margin: 0; } -.authenticator-field { - display: flex; - margin: auto; -} - .authenticator-section-header { display: flex; justify-content: space-between; @@ -107,8 +102,6 @@ styles.replaceSync( } .authenticator-field-value { - padding: 5px 0; - display: inline-block; font-family: monospace; } @@ -117,6 +110,7 @@ styles.replaceSync( top: 2px; } +.authenticator-field, .authenticator-option { display: flex; padding-bottom: 10px; @@ -131,8 +125,7 @@ styles.replaceSync( .authenticator-option-label { text-align: right; width: 200px; - display: inline-block; - padding: 0 10px 0 0; + padding-right: 10px; } td .text-button { diff --git a/public/panels/whats_new/ReleaseNoteView.test.js b/public/panels/whats_new/ReleaseNoteView.test.js index 7d1dc34bd..acb1c2fdb 100644 --- a/public/panels/whats_new/ReleaseNoteView.test.js +++ b/public/panels/whats_new/ReleaseNoteView.test.js @@ -82,14 +82,14 @@ describeWithEnvironment('Release Note View', () => { it('renders markdown content', async () => { sinon.stub(WhatsNew.ReleaseNoteView.ReleaseNoteView, 'getFileContent').returns(Promise.resolve(CONTENT1)); const releaseNoteView = new WhatsNew.ReleaseNoteView.ReleaseNoteView(); - await releaseNoteView.pendingUpdate(); + await releaseNoteView.updateComplete; const markdown = releaseNoteView.contentElement.querySelector('devtools-markdown-view'); assert.isNotNull(markdown); }); it('renders button that links to blogpost', async () => { sinon.stub(WhatsNew.ReleaseNoteView.ReleaseNoteView, 'getFileContent').returns(Promise.resolve('')); const releaseNoteView = new WhatsNew.ReleaseNoteView.ReleaseNoteView(); - await releaseNoteView.pendingUpdate(); + await releaseNoteView.updateComplete; const button = releaseNoteView.contentElement.querySelector('devtools-button'); assert.isNotNull(button); const openInNewTabStub = sinon.stub(Host.InspectorFrontendHost.InspectorFrontendHostInstance, 'openInNewTab'); @@ -100,7 +100,7 @@ describeWithEnvironment('Release Note View', () => { it('renders video links with description text', async () => { sinon.stub(WhatsNew.ReleaseNoteView.ReleaseNoteView, 'getFileContent').returns(Promise.resolve('')); const releaseNoteView = new WhatsNew.ReleaseNoteView.ReleaseNoteView(); - await releaseNoteView.pendingUpdate(); + await releaseNoteView.updateComplete; const videos = releaseNoteView.contentElement.querySelectorAll('.video-container > x-link'); assert.lengthOf(videos, 3); const releaseNotes = WhatsNew.ReleaseNoteText.getReleaseNote(); @@ -111,7 +111,7 @@ describeWithEnvironment('Release Note View', () => { it('renders expected thumbnails', async () => { sinon.stub(WhatsNew.ReleaseNoteView.ReleaseNoteView, 'getFileContent').returns(Promise.resolve('')); const releaseNoteView = new WhatsNew.ReleaseNoteView.ReleaseNoteView(); - await releaseNoteView.pendingUpdate(); + await releaseNoteView.updateComplete; const thumbnails = releaseNoteView.contentElement.querySelectorAll('.thumbnail'); assert.lengthOf(thumbnails, 3); const thumbnailFilepaths = Array.from(thumbnails).map(n => n.src); diff --git a/public/panels/whats_new/ReleaseNoteView.test.js.map b/public/panels/whats_new/ReleaseNoteView.test.js.map index e0bb8527a..fa8816754 100644 --- a/public/panels/whats_new/ReleaseNoteView.test.js.map +++ b/public/panels/whats_new/ReleaseNoteView.test.js.map @@ -1 +1 @@ -{"version":3,"file":"ReleaseNoteView.test.js","sourceRoot":"","sources":["../../../../../../front_end/panels/whats_new/ReleaseNoteView.test.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,KAAK,IAAI,MAAM,yBAAyB,CAAC;AAEhD,OAAO,EACL,uBAAuB,GACxB,MAAM,qCAAqC,CAAC;AAI7C,OAAO,KAAK,QAAQ,MAAM,gBAAgB,CAAC;AAE3C,MAAM,QAAQ,GAAG,gCAAgC,CAAC;AAClD,MAAM,QAAQ,GAAG,gCAAgC,CAAC;AAElD,uBAAuB,CAAC,mBAAmB,EAAE,GAAG,EAAE;IAChD,MAAM,CAAC,GAAG,EAAE;QACV,QAAQ,CAAC,eAAe,CAAC,qBAAqB,CAC1C;YACE,OAAO,EAAE,EAAE;YACX,MAAM,EAAE,6BAA6B;YACrC,aAAa,EAAE;gBACb;oBACE,GAAG,EAAE,SAAS;oBACd,IAAI,EAAE,iCAAiC;iBACxC;aACF;YACD,UAAU,EAAE;gBACV;oBACE,WAAW,EAAE,sCAAsC;oBACnD,IAAI,EAAE,wDAA2F;oBACjG,IAAI,+DAA8C;iBACnD;gBACD;oBACE,WAAW,EAAE,eAAe;oBAC5B,IAAI,EAAE,oDAAuF;oBAC7F,IAAI,uEAAkD;iBACvD;gBACD;oBACE,WAAW,EAAE,OAAO;oBACpB,IAAI,EAAE,+BAAkE;oBACxE,IAAI,wDAA0C;iBAC/C;aACF;YACD,IAAI,EAAE,oBAAoB;SAC3B,CACJ,CAAC;IACJ,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,wDAAwD,EAAE,KAAK,IAAI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3C,CAAC;QACF,MAAM,iBAAiB,GAAG,kBAAkB,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,GAAG,CAAC,GAAG,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC;QAElG,MAAM,CAAC,SAAS,CAAC,kBAAkB,EAAE,iBAAiB,CAAC,CAAC;IAC1D,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["// Copyright 2024 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport * as Host from '../../core/host/host.js';\nimport type * as Platform from '../../core/platform/platform.js';\nimport {\n describeWithEnvironment,\n} from '../../testing/EnvironmentHelpers.js';\nimport type * as Buttons from '../../ui/components/buttons/buttons.js';\nimport type * as UI from '../../ui/legacy/legacy.js';\n\nimport * as WhatsNew from './whats_new.js';\n\nconst CONTENT1 = 'Something something topic-1.\\n';\nconst CONTENT2 = 'Something something topic-2.\\n';\n\ndescribeWithEnvironment('Release Note View', () => {\n before(() => {\n WhatsNew.ReleaseNoteText.setReleaseNoteForTest(\n {\n version: 99,\n header: 'What\\'s new in DevTools 100',\n markdownLinks: [\n {\n key: 'topic-1',\n link: 'https://google.com.com/#topic-1',\n },\n ],\n videoLinks: [\n {\n description: 'Highlight from the Chrome 132 update',\n link: 'https://developer.chrome.com/blog/new-in-devtools-132/' as Platform.DevToolsPath.UrlString,\n type: WhatsNew.ReleaseNoteText.VideoType.WHATS_NEW,\n },\n {\n description: 'DevTools tips',\n link: 'https://developer.chrome.com/blog/devtools-tips-39' as Platform.DevToolsPath.UrlString,\n type: WhatsNew.ReleaseNoteText.VideoType.DEVTOOLS_TIPS,\n },\n {\n description: 'Other',\n link: 'https://developer.chrome.com/' as Platform.DevToolsPath.UrlString,\n type: WhatsNew.ReleaseNoteText.VideoType.OTHER,\n },\n ],\n link: 'https://google.com',\n },\n );\n });\n\n it('splits up markdown file content into separate sections', async () => {\n const h1 = '### [Topic 1](topic-1)\\n';\n const h2 = '### [Topic 2](topic-2)\\n';\n\n const content = [h1, CONTENT1, h2, CONTENT2];\n const notes = content.join('');\n\n sinon.stub(WhatsNew.ReleaseNoteView.ReleaseNoteView, 'getFileContent').returns(Promise.resolve(notes));\n const splitContent = await WhatsNew.ReleaseNoteView.getMarkdownContent();\n assert.lengthOf(splitContent, 2);\n\n for (let i = 0; i < 2; ++i) {\n assert.lengthOf(splitContent[i], 2);\n assert.deepEqual(splitContent[i][0].type, 'heading');\n assert.deepEqual(splitContent[i][1].type, 'paragraph');\n assert.deepEqual(splitContent[i][0].raw, content[i * 2]);\n assert.deepEqual(splitContent[i][1].raw, content[i * 2 + 1]);\n }\n });\n\n it('groups nested markdown headers into one', async () => {\n const h1 = '### [Topic 1](topic-1)\\n';\n const h2 = '#### [Topic 2](topic-2)\\n';\n\n const content = [h1, CONTENT1, h2, CONTENT2];\n const notes = content.join('');\n\n sinon.stub(WhatsNew.ReleaseNoteView.ReleaseNoteView, 'getFileContent').returns(Promise.resolve(notes));\n const splitContent = await WhatsNew.ReleaseNoteView.getMarkdownContent();\n assert.lengthOf(splitContent, 1);\n assert.lengthOf(splitContent[0], 4);\n\n assert.deepEqual(splitContent[0][0].raw, h1);\n assert.deepEqual(splitContent[0][1].raw, CONTENT1);\n assert.deepEqual(splitContent[0][2].raw, h2);\n assert.deepEqual(splitContent[0][3].raw, CONTENT2);\n });\n\n it('splits headerless paragraphs into its own section', async () => {\n const h1 = '### [Topic 1](topic-1)\\n';\n const content = [CONTENT1, h1];\n const notes = content.join('');\n\n sinon.stub(WhatsNew.ReleaseNoteView.ReleaseNoteView, 'getFileContent').returns(Promise.resolve(notes));\n const splitContent = await WhatsNew.ReleaseNoteView.getMarkdownContent();\n assert.lengthOf(splitContent, 2);\n assert.lengthOf(splitContent[0], 1);\n assert.lengthOf(splitContent[1], 1);\n\n assert.deepEqual(splitContent[0][0].raw, CONTENT1);\n assert.deepEqual(splitContent[1][0].raw, h1);\n });\n\n it('renders markdown content', async () => {\n sinon.stub(WhatsNew.ReleaseNoteView.ReleaseNoteView, 'getFileContent').returns(Promise.resolve(CONTENT1));\n const releaseNoteView = new WhatsNew.ReleaseNoteView.ReleaseNoteView();\n await releaseNoteView.pendingUpdate();\n\n const markdown = releaseNoteView.contentElement.querySelector('devtools-markdown-view');\n assert.isNotNull(markdown);\n });\n\n it('renders button that links to blogpost', async () => {\n sinon.stub(WhatsNew.ReleaseNoteView.ReleaseNoteView, 'getFileContent').returns(Promise.resolve(''));\n const releaseNoteView = new WhatsNew.ReleaseNoteView.ReleaseNoteView();\n await releaseNoteView.pendingUpdate();\n const button = releaseNoteView.contentElement.querySelector('devtools-button');\n assert.isNotNull(button);\n const openInNewTabStub = sinon.stub(Host.InspectorFrontendHost.InspectorFrontendHostInstance, 'openInNewTab');\n\n button.click();\n assert.strictEqual(openInNewTabStub.callCount, 1);\n assert.isTrue(\n openInNewTabStub.firstCall.calledWith('https://google.com' as Platform.DevToolsPath.UrlString),\n 'openInNewTab was not called with the expected URL.');\n });\n\n it('renders video links with description text', async () => {\n sinon.stub(WhatsNew.ReleaseNoteView.ReleaseNoteView, 'getFileContent').returns(Promise.resolve(''));\n const releaseNoteView = new WhatsNew.ReleaseNoteView.ReleaseNoteView();\n await releaseNoteView.pendingUpdate();\n const videos = releaseNoteView.contentElement.querySelectorAll('.video-container > x-link');\n assert.lengthOf(videos, 3);\n\n const releaseNotes = WhatsNew.ReleaseNoteText.getReleaseNote();\n const descriptions = Array.from(videos).map(n => n.innerText.trim());\n const expectedDescriptions = releaseNotes.videoLinks.map(video => video.description);\n assert.deepEqual(descriptions, expectedDescriptions);\n });\n\n it('renders expected thumbnails', async () => {\n sinon.stub(WhatsNew.ReleaseNoteView.ReleaseNoteView, 'getFileContent').returns(Promise.resolve(''));\n const releaseNoteView = new WhatsNew.ReleaseNoteView.ReleaseNoteView();\n await releaseNoteView.pendingUpdate();\n const thumbnails = releaseNoteView.contentElement.querySelectorAll('.thumbnail');\n assert.lengthOf(thumbnails, 3);\n\n const thumbnailFilepaths = Array.from(thumbnails).map(n => n.src);\n const expectedThumbnails = [\n WhatsNew.ReleaseNoteView.WHATS_NEW_THUMBNAIL,\n WhatsNew.ReleaseNoteView.DEVTOOLS_TIPS_THUMBNAIL,\n WhatsNew.ReleaseNoteView.GENERAL_THUMBNAIL,\n ];\n const expectedFilepaths = expectedThumbnails.map(src => new URL(src, import.meta.url).toString());\n\n assert.deepEqual(thumbnailFilepaths, expectedFilepaths);\n });\n});\n"]} \ No newline at end of file +{"version":3,"file":"ReleaseNoteView.test.js","sourceRoot":"","sources":["../../../../../../front_end/panels/whats_new/ReleaseNoteView.test.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,KAAK,IAAI,MAAM,yBAAyB,CAAC;AAEhD,OAAO,EACL,uBAAuB,GACxB,MAAM,qCAAqC,CAAC;AAI7C,OAAO,KAAK,QAAQ,MAAM,gBAAgB,CAAC;AAE3C,MAAM,QAAQ,GAAG,gCAAgC,CAAC;AAClD,MAAM,QAAQ,GAAG,gCAAgC,CAAC;AAElD,uBAAuB,CAAC,mBAAmB,EAAE,GAAG,EAAE;IAChD,MAAM,CAAC,GAAG,EAAE;QACV,QAAQ,CAAC,eAAe,CAAC,qBAAqB,CAC1C;YACE,OAAO,EAAE,EAAE;YACX,MAAM,EAAE,6BAA6B;YACrC,aAAa,EAAE;gBACb;oBACE,GAAG,EAAE,SAAS;oBACd,IAAI,EAAE,iCAAiC;iBACxC;aACF;YACD,UAAU,EAAE;gBACV;oBACE,WAAW,EAAE,sCAAsC;oBACnD,IAAI,EAAE,wDAA2F;oBACjG,IAAI,+DAA8C;iBACnD;gBACD;oBACE,WAAW,EAAE,eAAe;oBAC5B,IAAI,EAAE,oDAAuF;oBAC7F,IAAI,uEAAkD;iBACvD;gBACD;oBACE,WAAW,EAAE,OAAO;oBACpB,IAAI,EAAE,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GAAG;YACzB,QAAQ,CAAC,eAAe,CAAC,mBAAmB;YAC5C,QAAQ,CAAC,eAAe,CAAC,uBAAuB;YAChD,QAAQ,CAAC,eAAe,CAAC,iBAAiB;SAC3C,CAAC;QACF,MAAM,iBAAiB,GAAG,kBAAkB,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,GAAG,CAAC,GAAG,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC;QAElG,MAAM,CAAC,SAAS,CAAC,kBAAkB,EAAE,iBAAiB,CAAC,CAAC;IAC1D,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["// Copyright 2024 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport * as Host from '../../core/host/host.js';\nimport type * as Platform from '../../core/platform/platform.js';\nimport {\n describeWithEnvironment,\n} from '../../testing/EnvironmentHelpers.js';\nimport type * as Buttons from '../../ui/components/buttons/buttons.js';\nimport type * as UI from '../../ui/legacy/legacy.js';\n\nimport * as WhatsNew from './whats_new.js';\n\nconst CONTENT1 = 'Something something topic-1.\\n';\nconst CONTENT2 = 'Something something topic-2.\\n';\n\ndescribeWithEnvironment('Release Note View', () => {\n before(() => {\n WhatsNew.ReleaseNoteText.setReleaseNoteForTest(\n {\n version: 99,\n header: 'What\\'s new in DevTools 100',\n markdownLinks: [\n {\n key: 'topic-1',\n link: 'https://google.com.com/#topic-1',\n },\n ],\n videoLinks: [\n {\n description: 'Highlight from the Chrome 132 update',\n link: 'https://developer.chrome.com/blog/new-in-devtools-132/' as Platform.DevToolsPath.UrlString,\n type: WhatsNew.ReleaseNoteText.VideoType.WHATS_NEW,\n },\n {\n description: 'DevTools tips',\n link: 'https://developer.chrome.com/blog/devtools-tips-39' as Platform.DevToolsPath.UrlString,\n type: WhatsNew.ReleaseNoteText.VideoType.DEVTOOLS_TIPS,\n },\n {\n description: 'Other',\n link: 'https://developer.chrome.com/' as Platform.DevToolsPath.UrlString,\n type: WhatsNew.ReleaseNoteText.VideoType.OTHER,\n },\n ],\n link: 'https://google.com',\n },\n );\n });\n\n it('splits up markdown file content into separate sections', async () => {\n const h1 = '### [Topic 1](topic-1)\\n';\n const h2 = '### [Topic 2](topic-2)\\n';\n\n const content = [h1, CONTENT1, h2, CONTENT2];\n const notes = content.join('');\n\n sinon.stub(WhatsNew.ReleaseNoteView.ReleaseNoteView, 'getFileContent').returns(Promise.resolve(notes));\n const splitContent = await WhatsNew.ReleaseNoteView.getMarkdownContent();\n assert.lengthOf(splitContent, 2);\n\n for (let i = 0; i < 2; ++i) {\n assert.lengthOf(splitContent[i], 2);\n assert.deepEqual(splitContent[i][0].type, 'heading');\n assert.deepEqual(splitContent[i][1].type, 'paragraph');\n assert.deepEqual(splitContent[i][0].raw, content[i * 2]);\n assert.deepEqual(splitContent[i][1].raw, content[i * 2 + 1]);\n }\n });\n\n it('groups nested markdown headers into one', async () => {\n const h1 = '### [Topic 1](topic-1)\\n';\n const h2 = '#### [Topic 2](topic-2)\\n';\n\n const content = [h1, CONTENT1, h2, CONTENT2];\n const notes = content.join('');\n\n sinon.stub(WhatsNew.ReleaseNoteView.ReleaseNoteView, 'getFileContent').returns(Promise.resolve(notes));\n const splitContent = await WhatsNew.ReleaseNoteView.getMarkdownContent();\n assert.lengthOf(splitContent, 1);\n assert.lengthOf(splitContent[0], 4);\n\n assert.deepEqual(splitContent[0][0].raw, h1);\n assert.deepEqual(splitContent[0][1].raw, CONTENT1);\n assert.deepEqual(splitContent[0][2].raw, h2);\n assert.deepEqual(splitContent[0][3].raw, CONTENT2);\n });\n\n it('splits headerless paragraphs into its own section', async () => {\n const h1 = '### [Topic 1](topic-1)\\n';\n const content = [CONTENT1, h1];\n const notes = content.join('');\n\n sinon.stub(WhatsNew.ReleaseNoteView.ReleaseNoteView, 'getFileContent').returns(Promise.resolve(notes));\n const splitContent = await WhatsNew.ReleaseNoteView.getMarkdownContent();\n assert.lengthOf(splitContent, 2);\n assert.lengthOf(splitContent[0], 1);\n assert.lengthOf(splitContent[1], 1);\n\n assert.deepEqual(splitContent[0][0].raw, CONTENT1);\n assert.deepEqual(splitContent[1][0].raw, h1);\n });\n\n it('renders markdown content', async () => {\n sinon.stub(WhatsNew.ReleaseNoteView.ReleaseNoteView, 'getFileContent').returns(Promise.resolve(CONTENT1));\n const releaseNoteView = new WhatsNew.ReleaseNoteView.ReleaseNoteView();\n await releaseNoteView.updateComplete;\n\n const markdown = releaseNoteView.contentElement.querySelector('devtools-markdown-view');\n assert.isNotNull(markdown);\n });\n\n it('renders button that links to blogpost', async () => {\n sinon.stub(WhatsNew.ReleaseNoteView.ReleaseNoteView, 'getFileContent').returns(Promise.resolve(''));\n const releaseNoteView = new WhatsNew.ReleaseNoteView.ReleaseNoteView();\n await releaseNoteView.updateComplete;\n const button = releaseNoteView.contentElement.querySelector('devtools-button');\n assert.isNotNull(button);\n const openInNewTabStub = sinon.stub(Host.InspectorFrontendHost.InspectorFrontendHostInstance, 'openInNewTab');\n\n button.click();\n assert.strictEqual(openInNewTabStub.callCount, 1);\n assert.isTrue(\n openInNewTabStub.firstCall.calledWith('https://google.com' as Platform.DevToolsPath.UrlString),\n 'openInNewTab was not called with the expected URL.');\n });\n\n it('renders video links with description text', async () => {\n sinon.stub(WhatsNew.ReleaseNoteView.ReleaseNoteView, 'getFileContent').returns(Promise.resolve(''));\n const releaseNoteView = new WhatsNew.ReleaseNoteView.ReleaseNoteView();\n await releaseNoteView.updateComplete;\n const videos = releaseNoteView.contentElement.querySelectorAll('.video-container > x-link');\n assert.lengthOf(videos, 3);\n\n const releaseNotes = WhatsNew.ReleaseNoteText.getReleaseNote();\n const descriptions = Array.from(videos).map(n => n.innerText.trim());\n const expectedDescriptions = releaseNotes.videoLinks.map(video => video.description);\n assert.deepEqual(descriptions, expectedDescriptions);\n });\n\n it('renders expected thumbnails', async () => {\n sinon.stub(WhatsNew.ReleaseNoteView.ReleaseNoteView, 'getFileContent').returns(Promise.resolve(''));\n const releaseNoteView = new WhatsNew.ReleaseNoteView.ReleaseNoteView();\n await releaseNoteView.updateComplete;\n const thumbnails = releaseNoteView.contentElement.querySelectorAll('.thumbnail');\n assert.lengthOf(thumbnails, 3);\n\n const thumbnailFilepaths = Array.from(thumbnails).map(n => n.src);\n const expectedThumbnails = [\n WhatsNew.ReleaseNoteView.WHATS_NEW_THUMBNAIL,\n WhatsNew.ReleaseNoteView.DEVTOOLS_TIPS_THUMBNAIL,\n WhatsNew.ReleaseNoteView.GENERAL_THUMBNAIL,\n ];\n const expectedFilepaths = expectedThumbnails.map(src => new URL(src, import.meta.url).toString());\n\n assert.deepEqual(thumbnailFilepaths, expectedFilepaths);\n });\n});\n"]} \ No newline at end of file diff --git a/public/testing/DataGridHelpers.js b/public/testing/DataGridHelpers.js index 3dd7407a5..b20dd0b84 100644 --- a/public/testing/DataGridHelpers.js +++ b/public/testing/DataGridHelpers.js @@ -2,9 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. import * as DataGrid from '../ui/components/data_grid/data_grid.js'; -import * as Coordinator from '../ui/components/render_coordinator/render_coordinator.js'; +import * as RenderCoordinator from '../ui/components/render_coordinator/render_coordinator.js'; import { assertElements, dispatchFocusEvent, dispatchKeyDownEvent, getElementWithinComponent, } from './DOMHelpers.js'; -const coordinator = Coordinator.RenderCoordinator.RenderCoordinator.instance(); export const getFocusableCell = (shadowRoot) => { // We only expect one here, but we qSA so we can assert on only one. // Can't use td as it may be a th if the user has focused a column header. @@ -85,7 +84,7 @@ export const emulateUserKeyboardNavigation = (shadowRoot, key) => { export const emulateUserFocusingCellAt = async (shadowRoot, position) => { const cellToFocus = getCellByIndexes(shadowRoot, position); dispatchFocusEvent(cellToFocus); - await coordinator.done(); + await RenderCoordinator.done(); assertCurrentFocusedCellIs(shadowRoot, position); }; export const getValuesOfAllBodyRows = (shadowRoot, options = { diff --git a/public/testing/DataGridHelpers.js.map b/public/testing/DataGridHelpers.js.map index 92b5e966c..57fdc710e 100644 --- a/public/testing/DataGridHelpers.js.map +++ b/public/testing/DataGridHelpers.js.map @@ -1 +1 @@ -{"version":3,"file":"DataGridHelpers.js","sourceRoot":"","sources":["../../../../../front_end/testing/DataGridHelpers.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,KAAK,QAAQ,MAAM,yCAAyC,CAAC;AACpE,OAAO,KAAK,WAAW,MAAM,2DAA2D,CAAC;AAEzF,OAAO,EACL,cAAc,EACd,kBAAkB,EAClB,oBAAoB,EACpB,yBAAyB,GAC1B,MAAM,iBAAiB,CAAC;AAEzB,MAAM,WAAW,GAAG,WAAW,CAAC,iBAAiB,CAAC,iBAAiB,CAAC,QAAQ,EAAE,CAAC;AAC/E,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,UAAsB,EAAE,EAAE;IACzD,oEAAoE;IACpE,0EAA0E;IAC1E,MAAM,aAAa,GAAG,UAAU,CAAC,gBAAgB,CAAC,sBAAsB,CAAC,CAAC;IAC1E,MAAM,CAAC,QAAQ,CAAC,aAAa,EAAE,CAAC,CAAC,CAAC;IAClC,MAAM,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC,CAAC,EAAE,oBAAoB,CAAC,CAAC;IAC1D,OAAO,aAAa,CAAC,CAAC,CAAC,CAAC;AAC1B,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,UAAsB,EAAE,OAAsC,EAAE,EAAE;IACjG,MAAM,IAAI,GAAG,UAAU,CAAC,aAAa,CACjC,oBAAoB,OAAO,CAAC,GAAG,sBAAsB,OAAO,CAAC,MAAM,IAAI,CAAC,CAAC;IAC7E,MAAM,CAAC,UAAU,CAAC,IAAI,EAAE,oBAAoB,CAAC,CAAC;IAC9C,OAAO,IAAI,CAAC;AACd,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,UAAsB,EAAE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AC;AACb,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,UAAsB,EAAE,QAAgB,EAAE,EAAE;IACnF,MAAM,IAAI,GAAG,UAAU,CAAC,aAAa,CAAC,2BAA2B,QAAQ,EAAE,CAAC,CAAC;IAC7E,MAAM,CAAC,UAAU,CAAC,IAAI,EAAE,oBAAoB,CAAC,CAAC;IAC9C,OAAO,IAAI,CAAC;AACd,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,UAAsB,EAAE,QAAgB,EAAE,EAAE;IAC7E,MAAM,KAAK,GAAG,UAAU,CAAC,gBAAgB,CAAC,oCAAoC,QAAQ,GAAG,CAAC,CAAC;IAC3F,cAAc,CAAC,KAAK,EAAE,oBAAoB,CAAC,CAAC;IAC5C,OAAO,KAAK,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;AACnD,CAAC,CAAC","sourcesContent":["// Copyright 2020 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport * as DataGrid from '../ui/components/data_grid/data_grid.js';\nimport * as Coordinator from '../ui/components/render_coordinator/render_coordinator.js';\n\nimport {\n assertElements,\n dispatchFocusEvent,\n dispatchKeyDownEvent,\n getElementWithinComponent,\n} from './DOMHelpers.js';\n\nconst coordinator = Coordinator.RenderCoordinator.RenderCoordinator.instance();\nexport const getFocusableCell = (shadowRoot: ShadowRoot) => {\n // We only expect one here, but we qSA so we can assert on only one.\n // Can't use td as it may be a th if the user has focused a column header.\n const tabIndexCells = shadowRoot.querySelectorAll('table [tabindex=\"0\"]');\n assert.lengthOf(tabIndexCells, 1);\n assert.instanceOf(tabIndexCells[0], HTMLTableCellElement);\n return tabIndexCells[0];\n};\n\nexport const getCellByIndexes = (shadowRoot: ShadowRoot, indexes: {column: number, row: number}) => {\n const cell = shadowRoot.querySelector(\n `[data-row-index=\"${indexes.row}\"][data-col-index=\"${indexes.column}\"]`);\n assert.instanceOf(cell, HTMLTableCellElement);\n return cell;\n};\n\nexport const getHeaderCells = (shadowRoot: ShadowRoot, options: {onlyVisible: boolean} = {\n onlyVisible: false,\n}) => {\n const cells = shadowRoot.querySelectorAll('[data-grid-header-cell]');\n assertElements(cells, HTMLTableCellElement);\n return Array.from(cells).filter(cell => {\n if (!options.onlyVisible) {\n return true;\n }\n\n return cell.classList.contains('hidden') === false;\n });\n};\n\nexport const getValuesOfBodyRowByAriaIndex =\n (shadowRoot: ShadowRoot, ariaIndex: number, options: {onlyVisible: boolean} = {\n onlyVisible: false,\n }) => {\n const row = getBodyRowByAriaIndex(shadowRoot, ariaIndex);\n const cells = row.querySelectorAll('[data-grid-value-cell-for-column]');\n assertElements(cells, HTMLTableCellElement);\n return Array.from(cells)\n .filter(cell => {\n return !options.onlyVisible || cell.classList.contains('hidden') === false;\n })\n .map(cell => {\n return cell.innerText;\n });\n };\n\nexport const getAllRows = (shadowRoot: ShadowRoot) => {\n const rows = shadowRoot.querySelectorAll('[aria-rowindex]');\n assertElements(rows, HTMLTableRowElement);\n return Array.from(rows);\n};\n\nexport const assertCurrentFocusedCellIs = (shadowRoot: ShadowRoot, {column, row}: {column: number, row: number}) => {\n const cell = getFocusableCell(shadowRoot);\n // Convert to strings as attributes are always strings.\n assert.strictEqual(cell.getAttribute('data-row-index'), String(row), 'The row index was not as expected.');\n assert.strictEqual(cell.getAttribute('data-col-index'), String(column), 'The column index was not as expected.');\n};\n\nexport const assertSelectedRowIs = (shadowRoot: ShadowRoot, row: number) => {\n const selectedRow = shadowRoot.querySelector('tr.selected');\n assert.instanceOf(selectedRow, HTMLTableRowElement);\n assert.strictEqual(selectedRow.getAttribute('aria-rowindex'), String(row), 'The row index was not as expected.');\n};\n\nexport const getDataGrid = (gridComponent: HTMLElement) => {\n const controller = getElementWithinComponent(\n gridComponent, 'devtools-data-grid-controller', DataGrid.DataGridController.DataGridController);\n return getElementWithinComponent(controller, 'devtools-data-grid', DataGrid.DataGrid.DataGrid);\n};\n\nexport const assertGridContents = (gridComponent: HTMLElement, headerExpected: string[], rowsExpected: string[][]) => {\n const grid = getDataGrid(gridComponent);\n assert.isNotNull(grid.shadowRoot);\n\n const headerActual = getHeaderCells(grid.shadowRoot).map(({textContent}) => textContent!.trim());\n assert.deepEqual(headerActual, headerExpected);\n\n const rowsActual = getValuesOfAllBodyRows(grid.shadowRoot).map(row => row.map(cell => cell.trim()));\n assert.deepEqual(rowsActual, rowsExpected);\n\n return grid;\n};\n\nexport const focusCurrentlyFocusableCell = (shadowRoot: ShadowRoot) => {\n const cell = getFocusableCell(shadowRoot);\n dispatchFocusEvent(cell);\n};\n\nexport const emulateUserKeyboardNavigation =\n (shadowRoot: ShadowRoot, key: 'ArrowLeft'|'ArrowRight'|'ArrowUp'|'ArrowDown') => {\n const table = shadowRoot.querySelector('table');\n assert.instanceOf(table, HTMLTableElement);\n dispatchKeyDownEvent(table, {key});\n };\n\nexport const emulateUserFocusingCellAt = async (shadowRoot: ShadowRoot, position: {column: number, row: number}) => {\n const cellToFocus = getCellByIndexes(shadowRoot, position);\n dispatchFocusEvent(cellToFocus);\n await coordinator.done();\n assertCurrentFocusedCellIs(shadowRoot, position);\n};\n\nexport const getValuesOfAllBodyRows = (shadowRoot: ShadowRoot, options: {onlyVisible: boolean} = {\n onlyVisible: false,\n}) => {\n const rows = getAllRows(shadowRoot);\n return rows\n .map(row => {\n // now decide if the row should be included or not\n const rowIsHidden = row.classList.contains('hidden');\n const rowIndex = window.parseInt(row.getAttribute('aria-rowindex') || '-1', 10);\n return {\n rowValues: getValuesOfBodyRowByAriaIndex(shadowRoot, rowIndex, options),\n hidden: options.onlyVisible && rowIsHidden,\n };\n })\n .filter(row => row.hidden === false)\n .map(r => r.rowValues);\n};\n\nexport const getBodyRowByAriaIndex = (shadowRoot: ShadowRoot, rowIndex: number) => {\n const row = shadowRoot.querySelector(`[aria-rowindex=\"${rowIndex}\"]`);\n assert.instanceOf(row, HTMLTableRowElement);\n return row;\n};\n\nexport const getHeaderCellForColumnId = (shadowRoot: ShadowRoot, columnId: string) => {\n const cell = shadowRoot.querySelector(`[data-grid-header-cell=\"${columnId}`);\n assert.instanceOf(cell, HTMLTableCellElement);\n return cell;\n};\n\nexport const getValuesForColumn = (shadowRoot: ShadowRoot, columnId: string) => {\n const cells = shadowRoot.querySelectorAll(`[data-grid-value-cell-for-column=${columnId}]`);\n assertElements(cells, HTMLTableCellElement);\n return Array.from(cells, cell => cell.innerText);\n};\n"]} \ No newline at end of file +{"version":3,"file":"DataGridHelpers.js","sourceRoot":"","sources":["../../../../../front_end/testing/DataGridHelpers.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,KAAK,QAAQ,MAAM,yCAAyC,CAAC;AACpE,OAAO,KAAK,iBAAiB,MAAM,2DAA2D,CAAC;AAE/F,OAAO,EACL,cAAc,EACd,kBAAkB,EAClB,oBAAoB,EACpB,yBAAyB,GAC1B,MAAM,iBAAiB,CAAC;AAEzB,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,UAAsB,EAAE,EAAE;IACzD,oEAAoE;IACpE,0EAA0E;IAC1E,MAAM,aAAa,GAAG,UAAU,CAAC,gBAAgB,CAAC,sBAAsB,CAAC,CAAC;IAC1E,MAAM,CAAC,QAAQ,CAAC,aAAa,EAAE,CAAC,CAAC,CAAC;IAClC,MAAM,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC,CAAC,EAAE,oBAAoB,CAAC,CAAC;IAC1D,OAAO,aAAa,CAAC,CAAC,CAAC,CAAC;AAC1B,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,UAAsB,EAAE,OAAsC,EAAE,EAAE;IACjG,MAAM,IAAI,GAAG,UAAU,CAAC,aAAa,CACjC,oBAAoB,OAAO,CAAC,GAAG,sBAAsB,OAAO,CAAC,MAAM,IAAI,CAAC,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AE;IAChF,MAAM,GAAG,GAAG,UAAU,CAAC,aAAa,CAAC,mBAAmB,QAAQ,IAAI,CAAC,CAAC;IACtE,MAAM,CAAC,UAAU,CAAC,GAAG,EAAE,mBAAmB,CAAC,CAAC;IAC5C,OAAO,GAAG,CAAC;AACb,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,UAAsB,EAAE,QAAgB,EAAE,EAAE;IACnF,MAAM,IAAI,GAAG,UAAU,CAAC,aAAa,CAAC,2BAA2B,QAAQ,EAAE,CAAC,CAAC;IAC7E,MAAM,CAAC,UAAU,CAAC,IAAI,EAAE,oBAAoB,CAAC,CAAC;IAC9C,OAAO,IAAI,CAAC;AACd,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,UAAsB,EAAE,QAAgB,EAAE,EAAE;IAC7E,MAAM,KAAK,GAAG,UAAU,CAAC,gBAAgB,CAAC,oCAAoC,QAAQ,GAAG,CAAC,CAAC;IAC3F,cAAc,CAAC,KAAK,EAAE,oBAAoB,CAAC,CAAC;IAC5C,OAAO,KAAK,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;AACnD,CAAC,CAAC","sourcesContent":["// Copyright 2020 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport * as DataGrid from '../ui/components/data_grid/data_grid.js';\nimport * as RenderCoordinator from '../ui/components/render_coordinator/render_coordinator.js';\n\nimport {\n assertElements,\n dispatchFocusEvent,\n dispatchKeyDownEvent,\n getElementWithinComponent,\n} from './DOMHelpers.js';\n\nexport const getFocusableCell = (shadowRoot: ShadowRoot) => {\n // We only expect one here, but we qSA so we can assert on only one.\n // Can't use td as it may be a th if the user has focused a column header.\n const tabIndexCells = shadowRoot.querySelectorAll('table [tabindex=\"0\"]');\n assert.lengthOf(tabIndexCells, 1);\n assert.instanceOf(tabIndexCells[0], HTMLTableCellElement);\n return tabIndexCells[0];\n};\n\nexport const getCellByIndexes = (shadowRoot: ShadowRoot, indexes: {column: number, row: number}) => {\n const cell = shadowRoot.querySelector(\n `[data-row-index=\"${indexes.row}\"][data-col-index=\"${indexes.column}\"]`);\n assert.instanceOf(cell, HTMLTableCellElement);\n return cell;\n};\n\nexport const getHeaderCells = (shadowRoot: ShadowRoot, options: {onlyVisible: boolean} = {\n onlyVisible: false,\n}) => {\n const cells = shadowRoot.querySelectorAll('[data-grid-header-cell]');\n assertElements(cells, HTMLTableCellElement);\n return Array.from(cells).filter(cell => {\n if (!options.onlyVisible) {\n return true;\n }\n\n return cell.classList.contains('hidden') === false;\n });\n};\n\nexport const getValuesOfBodyRowByAriaIndex =\n (shadowRoot: ShadowRoot, ariaIndex: number, options: {onlyVisible: boolean} = {\n onlyVisible: false,\n }) => {\n const row = getBodyRowByAriaIndex(shadowRoot, ariaIndex);\n const cells = row.querySelectorAll('[data-grid-value-cell-for-column]');\n assertElements(cells, HTMLTableCellElement);\n return Array.from(cells)\n .filter(cell => {\n return !options.onlyVisible || cell.classList.contains('hidden') === false;\n })\n .map(cell => {\n return cell.innerText;\n });\n };\n\nexport const getAllRows = (shadowRoot: ShadowRoot) => {\n const rows = shadowRoot.querySelectorAll('[aria-rowindex]');\n assertElements(rows, HTMLTableRowElement);\n return Array.from(rows);\n};\n\nexport const assertCurrentFocusedCellIs = (shadowRoot: ShadowRoot, {column, row}: {column: number, row: number}) => {\n const cell = getFocusableCell(shadowRoot);\n // Convert to strings as attributes are always strings.\n assert.strictEqual(cell.getAttribute('data-row-index'), String(row), 'The row index was not as expected.');\n assert.strictEqual(cell.getAttribute('data-col-index'), String(column), 'The column index was not as expected.');\n};\n\nexport const assertSelectedRowIs = (shadowRoot: ShadowRoot, row: number) => {\n const selectedRow = shadowRoot.querySelector('tr.selected');\n assert.instanceOf(selectedRow, HTMLTableRowElement);\n assert.strictEqual(selectedRow.getAttribute('aria-rowindex'), String(row), 'The row index was not as expected.');\n};\n\nexport const getDataGrid = (gridComponent: HTMLElement) => {\n const controller = getElementWithinComponent(\n gridComponent, 'devtools-data-grid-controller', DataGrid.DataGridController.DataGridController);\n return getElementWithinComponent(controller, 'devtools-data-grid', DataGrid.DataGrid.DataGrid);\n};\n\nexport const assertGridContents = (gridComponent: HTMLElement, headerExpected: string[], rowsExpected: string[][]) => {\n const grid = getDataGrid(gridComponent);\n assert.isNotNull(grid.shadowRoot);\n\n const headerActual = getHeaderCells(grid.shadowRoot).map(({textContent}) => textContent!.trim());\n assert.deepEqual(headerActual, headerExpected);\n\n const rowsActual = getValuesOfAllBodyRows(grid.shadowRoot).map(row => row.map(cell => cell.trim()));\n assert.deepEqual(rowsActual, rowsExpected);\n\n return grid;\n};\n\nexport const focusCurrentlyFocusableCell = (shadowRoot: ShadowRoot) => {\n const cell = getFocusableCell(shadowRoot);\n dispatchFocusEvent(cell);\n};\n\nexport const emulateUserKeyboardNavigation =\n (shadowRoot: ShadowRoot, key: 'ArrowLeft'|'ArrowRight'|'ArrowUp'|'ArrowDown') => {\n const table = shadowRoot.querySelector('table');\n assert.instanceOf(table, HTMLTableElement);\n dispatchKeyDownEvent(table, {key});\n };\n\nexport const emulateUserFocusingCellAt = async (shadowRoot: ShadowRoot, position: {column: number, row: number}) => {\n const cellToFocus = getCellByIndexes(shadowRoot, position);\n dispatchFocusEvent(cellToFocus);\n await RenderCoordinator.done();\n assertCurrentFocusedCellIs(shadowRoot, position);\n};\n\nexport const getValuesOfAllBodyRows = (shadowRoot: ShadowRoot, options: {onlyVisible: boolean} = {\n onlyVisible: false,\n}) => {\n const rows = getAllRows(shadowRoot);\n return rows\n .map(row => {\n // now decide if the row should be included or not\n const rowIsHidden = row.classList.contains('hidden');\n const rowIndex = window.parseInt(row.getAttribute('aria-rowindex') || '-1', 10);\n return {\n rowValues: getValuesOfBodyRowByAriaIndex(shadowRoot, rowIndex, options),\n hidden: options.onlyVisible && rowIsHidden,\n };\n })\n .filter(row => row.hidden === false)\n .map(r => r.rowValues);\n};\n\nexport const getBodyRowByAriaIndex = (shadowRoot: ShadowRoot, rowIndex: number) => {\n const row = shadowRoot.querySelector(`[aria-rowindex=\"${rowIndex}\"]`);\n assert.instanceOf(row, HTMLTableRowElement);\n return row;\n};\n\nexport const getHeaderCellForColumnId = (shadowRoot: ShadowRoot, columnId: string) => {\n const cell = shadowRoot.querySelector(`[data-grid-header-cell=\"${columnId}`);\n assert.instanceOf(cell, HTMLTableCellElement);\n return cell;\n};\n\nexport const getValuesForColumn = (shadowRoot: ShadowRoot, columnId: string) => {\n const cells = shadowRoot.querySelectorAll(`[data-grid-value-cell-for-column=${columnId}]`);\n assertElements(cells, HTMLTableCellElement);\n return Array.from(cells, cell => cell.innerText);\n};\n"]} \ No newline at end of file diff --git a/public/testing/NetworkHelpers.js b/public/testing/NetworkHelpers.js index 8fc48eab3..cbe58d297 100644 --- a/public/testing/NetworkHelpers.js +++ b/public/testing/NetworkHelpers.js @@ -3,9 +3,8 @@ // found in the LICENSE file. import * as Common from '../core/common/common.js'; import * as Network from '../panels/network/network.js'; -import * as Coordinator from '../ui/components/render_coordinator/render_coordinator.js'; +import * as RenderCoordinator from '../ui/components/render_coordinator/render_coordinator.js'; import { registerNoopActions, } from './EnvironmentHelpers.js'; -const coordinator = Coordinator.RenderCoordinator.RenderCoordinator.instance(); export async function createNetworkPanelForMockConnection() { registerNoopActions(['network.toggle-recording', 'network.clear']); const dummyStorage = new Common.Settings.SettingsStorage({}); @@ -25,7 +24,7 @@ export async function createNetworkPanelForMockConnection() { const networkPanel = Network.NetworkPanel.NetworkPanel.instance({ forceNew: true, displayScreenshotDelay: 0 }); networkPanel.markAsRoot(); networkPanel.show(document.body); - await coordinator.done(); + await RenderCoordinator.done(); return networkPanel; } //# sourceMappingURL=NetworkHelpers.js.map \ No newline at end of file diff --git a/public/testing/NetworkHelpers.js.map b/public/testing/NetworkHelpers.js.map index f779f7f04..cd212c564 100644 --- a/public/testing/NetworkHelpers.js.map +++ b/public/testing/NetworkHelpers.js.map @@ -1 +1 @@ -{"version":3,"file":"NetworkHelpers.js","sourceRoot":"","sources":["../../../../../front_end/testing/NetworkHelpers.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,KAAK,MAAM,MAAM,0BAA0B,CAAC;AACnD,OAAO,KAAK,OAAO,MAAM,8BAA8B,CAAC;AACxD,OAAO,KAAK,WAAW,MAAM,2DAA2D,CAAC;AAEzF,OAAO,EACL,mBAAmB,GACpB,MAAM,yBAAyB,CAAC;AAEjC,MAAM,WAAW,GAAG,WAAW,CAAC,iBAAiB,CAAC,iBAAiB,CAAC,QAAQ,EAAE,CAAC;AAE/E,MAAM,CAAC,KAAK,UAAU,mCAAmC;IACvD,mBAAmB,CAAC,CAAC,0BAA0B,EAAE,eAAe,CAAC,CAAC,CAAC;IAEnE,MAAM,YAAY,GAAG,IAAI,MAAM,CAAC,QAAQ,CAAC,eAAe,CAAC,EAAE,CAAC,CAAC;IAC7D,KAAK,MAAM,WAAW,IACV,CAAC,mCAAmC,EAAE,wBAAwB,EAAE,mCAAmC,CAAC,EAAE,CAAC;QACjH,MAAM,CAAC,QAAQ,CAAC,wBAAwB,CAAC;YACvC,WAAW;YACX,WAAW,qDAAqC;YAChD,YAAY,EAAE,KAAK;SACpB,CAAC,CAAC;IACL,CAAC;IACD,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,QAAQ,CAAC;QAChC,QAAQ,EAAE,IAAI;QACd,aAAa,EAAE,YAAY;QAC3B,aAAa,EAAE,YAAY;QAC3B,YAAY,EAAE,YAAY;KAC3B,CAAC,CAAC;IACH,MAAM,YAAY,GAAG,OAAO,CAAC,YAAY,CAAC,YAAY,CAAC,QAAQ,CAAC,EAAC,QAAQ,EAAE,IAAI,EAAE,sBAAsB,EAAE,CAAC,EAAC,CAAC,CAAC;IAC7G,YAAY,CAAC,UAAU,EAAE,CAAC;IAC1B,YAAY,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;IACjC,MAAM,WAAW,CAAC,IAAI,EAAE,CAAC;IACzB,OAAO,YAAY,CAAC;AACtB,CAAC","sourcesContent":["// Copyright 2024 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport * as Common from '../core/common/common.js';\nimport * as Network from '../panels/network/network.js';\nimport * as Coordinator from '../ui/components/render_coordinator/render_coordinator.js';\n\nimport {\n registerNoopActions,\n} from './EnvironmentHelpers.js';\n\nconst coordinator = Coordinator.RenderCoordinator.RenderCoordinator.instance();\n\nexport async function createNetworkPanelForMockConnection(): Promise {\n registerNoopActions(['network.toggle-recording', 'network.clear']);\n\n const dummyStorage = new Common.Settings.SettingsStorage({});\n for (const settingName\n of ['network-color-code-resource-types', 'network.group-by-frame', 'network-record-film-strip-setting']) {\n Common.Settings.registerSettingExtension({\n settingName,\n settingType: Common.Settings.SettingType.BOOLEAN,\n defaultValue: false,\n });\n }\n Common.Settings.Settings.instance({\n forceNew: true,\n syncedStorage: dummyStorage,\n globalStorage: dummyStorage,\n localStorage: dummyStorage,\n });\n const networkPanel = Network.NetworkPanel.NetworkPanel.instance({forceNew: true, displayScreenshotDelay: 0});\n networkPanel.markAsRoot();\n networkPanel.show(document.body);\n await coordinator.done();\n return networkPanel;\n}\n"]} \ No newline at end of file +{"version":3,"file":"NetworkHelpers.js","sourceRoot":"","sources":["../../../../../front_end/testing/NetworkHelpers.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,KAAK,MAAM,MAAM,0BAA0B,CAAC;AACnD,OAAO,KAAK,OAAO,MAAM,8BAA8B,CAAC;AACxD,OAAO,KAAK,iBAAiB,MAAM,2DAA2D,CAAC;AAE/F,OAAO,EACL,mBAAmB,GACpB,MAAM,yBAAyB,CAAC;AAEjC,MAAM,CAAC,KAAK,UAAU,mCAAmC;IACvD,mBAAmB,CAAC,CAAC,0BAA0B,EAAE,eAAe,CAAC,CAAC,CAAC;IAEnE,MAAM,YAAY,GAAG,IAAI,MAAM,CAAC,QAAQ,CAAC,eAAe,CAAC,EAAE,CAAC,CAAC;IAC7D,KAAK,MAAM,WAAW,IACV,CAAC,mCAAmC,EAAE,wBAAwB,EAAE,mCAAmC,CAAC,EAAE,CAAC;QACjH,MAAM,CAAC,QAAQ,CAAC,wBAAwB,CAAC;YACvC,WAAW;YACX,WAAW,qDAAqC;YAChD,YAAY,EAAE,KAAK;SACpB,CAAC,CAAC;IACL,CAAC;IACD,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,QAAQ,CAAC;QAChC,QAAQ,EAAE,IAAI;QACd,aAAa,EAAE,YAAY;QAC3B,aAAa,EAAE,YAAY;QAC3B,YAAY,EAAE,YAAY;KAC3B,CAAC,CAAC;IACH,MAAM,YAAY,GAAG,OAAO,CAAC,YAAY,CAAC,YAAY,CAAC,QAAQ,CAAC,EAAC,QAAQ,EAAE,IAAI,EAAE,sBAAsB,EAAE,CAAC,EAAC,CAAC,CAAC;IAC7G,YAAY,CAAC,UAAU,EAAE,CAAC;IAC1B,YAAY,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;IACjC,MAAM,iBAAiB,CAAC,IAAI,EAAE,CAAC;IAC/B,OAAO,YAAY,CAAC;AACtB,CAAC","sourcesContent":["// Copyright 2024 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport * as Common from '../core/common/common.js';\nimport * as Network from '../panels/network/network.js';\nimport * as RenderCoordinator from '../ui/components/render_coordinator/render_coordinator.js';\n\nimport {\n registerNoopActions,\n} from './EnvironmentHelpers.js';\n\nexport async function createNetworkPanelForMockConnection(): Promise {\n registerNoopActions(['network.toggle-recording', 'network.clear']);\n\n const dummyStorage = new Common.Settings.SettingsStorage({});\n for (const settingName\n of ['network-color-code-resource-types', 'network.group-by-frame', 'network-record-film-strip-setting']) {\n Common.Settings.registerSettingExtension({\n settingName,\n settingType: Common.Settings.SettingType.BOOLEAN,\n defaultValue: false,\n });\n }\n Common.Settings.Settings.instance({\n forceNew: true,\n syncedStorage: dummyStorage,\n globalStorage: dummyStorage,\n localStorage: dummyStorage,\n });\n const networkPanel = Network.NetworkPanel.NetworkPanel.instance({forceNew: true, displayScreenshotDelay: 0});\n networkPanel.markAsRoot();\n networkPanel.show(document.body);\n await RenderCoordinator.done();\n return networkPanel;\n}\n"]} \ No newline at end of file diff --git a/public/tests.txt b/public/tests.txt index 029485f75..e7270182c 100644 --- a/public/tests.txt +++ b/public/tests.txt @@ -613,7 +613,7 @@ ui/legacy/components/source_frame/StreamingContentHexView.test.js ui/legacy/components/utils/JSPresentationUtils.test.js ui/legacy/components/utils/Linkifier.test.js ui/legacy/theme_support/ThemeSupport.test.js -ui/lit-html/static.test.js +ui/lit-html/i18n-template.test.js ui/visual_logging/Debugging.test.js ui/visual_logging/DomState.test.js ui/visual_logging/LoggingConfig.test.js diff --git a/public/third_party/lit/lib/decorators.d.ts b/public/third_party/lit/lib/decorators.d.ts index 05be5d87c..2384808c4 100644 --- a/public/third_party/lit/lib/decorators.d.ts +++ b/public/third_party/lit/lib/decorators.d.ts @@ -110,6 +110,11 @@ interface ReactiveController { * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause */ +/** + * Use this module if you want to create your own base class extending + * {@link ReactiveElement}. + * @packageDocumentation + */ /** * Converts property values to and from attribute values. @@ -658,8 +663,6 @@ declare abstract class ReactiveElement extends HTMLElement implements ReactiveCo * @param oldValue old value of requesting property * @param options property options to use instead of the previously * configured options - * @param initial whether this call is for the initial value of the property. - * Initial values do not reflect to an attribute. * @category updates */ requestUpdate(name?: PropertyKey, oldValue?: unknown, options?: PropertyDeclaration): void; diff --git a/public/third_party/lit/lib/decorators.js b/public/third_party/lit/lib/decorators.js index 124412c6a..001d691b3 100644 --- a/public/third_party/lit/lib/decorators.js +++ b/public/third_party/lit/lib/decorators.js @@ -3,26 +3,26 @@ * Copyright 2019 Google LLC * SPDX-License-Identifier: BSD-3-Clause */ -const t=globalThis,e=t.ShadowRoot&&(void 0===t.ShadyCSS||t.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,s=Symbol(),i=new WeakMap;class r{constructor(t,e,i){if(this._$cssResult$=!0,i!==s)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const s=this.t;if(e&&void 0===t){const e=void 0!==s&&1===s.length;e&&(t=i.get(s)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),e&&i.set(s,t))}return t}toString(){return this.cssText}}const o=e?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const s of t.cssRules)e+=s.cssText;return(t=>new r("string"==typeof t?t:t+"",void 0,s))(e)})(t):t +const t=globalThis,e=t.ShadowRoot&&(void 0===t.ShadyCSS||t.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,s=Symbol(),i=new WeakMap;let r=class{constructor(t,e,i){if(this._$cssResult$=!0,i!==s)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const s=this.t;if(e&&void 0===t){const e=void 0!==s&&1===s.length;e&&(t=i.get(s)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),e&&i.set(s,t))}return t}toString(){return this.cssText}};const o=e?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const s of t.cssRules)e+=s.cssText;return(t=>new r("string"==typeof t?t:t+"",void 0,s))(e)})(t):t /** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause - */,{is:n,defineProperty:a,getOwnPropertyDescriptor:h,getOwnPropertyNames:c,getOwnPropertySymbols:l,getPrototypeOf:p}=Object,d=globalThis,u=d.trustedTypes,f=u?u.emptyScript:"",y=d.reactiveElementPolyfillSupport,E=(t,e)=>t,m={toAttribute(t,e){switch(e){case Boolean:t=t?f:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){let s=t;switch(e){case Boolean:s=null!==t;break;case Number:s=null===t?null:Number(t);break;case Object:case Array:try{s=JSON.parse(t)}catch(t){s=null}}return s}},S=(t,e)=>!n(t,e),_={attribute:!0,type:String,converter:m,reflect:!1,hasChanged:S};Symbol.metadata??=Symbol("metadata"),d.litPropertyMetadata??=new WeakMap;class $ extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=_){if(e.state&&(e.attribute=!1),this._$Ei(),this.elementProperties.set(t,e),!e.noAccessor){const s=Symbol(),i=this.getPropertyDescriptor(t,s,e);void 0!==i&&a(this.prototype,t,i)}}static getPropertyDescriptor(t,e,s){const{get:i,set:r}=h(this.prototype,t)??{get(){return this[e]},set(t){this[e]=t}};return{get(){return i?.call(this)},set(e){const o=i?.call(this);r.call(this,e),this.requestUpdate(t,o,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??_}static _$Ei(){if(this.hasOwnProperty(E("elementProperties")))return;const t=p(this);t.finalize(),void 0!==t.l&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(E("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(E("properties"))){const t=this.properties,e=[...c(t),...l(t)];for(const s of e)this.createProperty(s,t[s])}const t=this[Symbol.metadata];if(null!==t){const e=litPropertyMetadata.get(t);if(void 0!==e)for(const[t,s]of e)this.elementProperties.set(t,s)}this._$Eh=new Map;for(const[t,e]of this.elementProperties){const s=this._$Eu(t,e);void 0!==s&&this._$Eh.set(s,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const s=new Set(t.flat(1/0).reverse());for(const t of s)e.unshift(o(t))}else void 0!==t&&e.push(o(t));return e}static _$Eu(t,e){const s=e.attribute;return!1===s?void 0:"string"==typeof s?s:"string"==typeof t?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$Eg=new Promise((t=>this.enableUpdating=t)),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach((t=>t(this)))}addController(t){(this._$ES??=[]).push(t),void 0!==this.renderRoot&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$ES?.splice(this._$ES.indexOf(t)>>>0,1)}_$E_(){const t=new Map,e=this.constructor.elementProperties;for(const s of e.keys())this.hasOwnProperty(s)&&(t.set(s,this[s]),delete this[s]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const s=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return((s,i)=>{if(e)s.adoptedStyleSheets=i.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet));else for(const e of i){const i=document.createElement("style"),r=t.litNonce;void 0!==r&&i.setAttribute("nonce",r),i.textContent=e.cssText,s.appendChild(i)}})(s,this.constructor.elementStyles),s}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$ES?.forEach((t=>t.hostConnected?.()))}enableUpdating(t){}disconnectedCallback(){this._$ES?.forEach((t=>t.hostDisconnected?.()))}attributeChangedCallback(t,e,s){this._$AK(t,s)}_$EO(t,e){const s=this.constructor.elementProperties.get(t),i=this.constructor._$Eu(t,s);if(void 0!==i&&!0===s.reflect){const r=(void 0!==s.converter?.toAttribute?s.converter:m).toAttribute(e,s.type);this._$Em=t,null==r?this.removeAttribute(i):this.setAttribute(i,r),this._$Em=null}}_$AK(t,e){const s=this.constructor,i=s._$Eh.get(t);if(void 0!==i&&this._$Em!==i){const t=s.getPropertyOptions(i),r="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==t.converter?.fromAttribute?t.converter:m;this._$Em=i,this[i]=r.fromAttribute(e,t.type),this._$Em=null}}requestUpdate(t,e,s,i=!1,r){if(void 0!==t){if(s??=this.constructor.getPropertyOptions(t),!(s.hasChanged??S)(i?r:this[t],e))return;this.C(t,e,s)}!1===this.isUpdatePending&&(this._$Eg=this._$EP())}C(t,e,s){this._$AL.has(t)||this._$AL.set(t,e),!0===s.reflect&&this._$Em!==t&&(this._$Ej??=new Set).add(t)}async _$EP(){this.isUpdatePending=!0;try{await this._$Eg}catch(t){Promise.reject(t)}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this._$Ep){for(const[t,e]of this._$Ep)this[t]=e;this._$Ep=void 0}const t=this.constructor.elementProperties;if(t.size>0)for(const[e,s]of t)!0!==s.wrapped||this._$AL.has(e)||void 0===this[e]||this.C(e,this[e],s)}let t=!1;const e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),this._$ES?.forEach((t=>t.hostUpdate?.())),this.update(e)):this._$ET()}catch(e){throw t=!1,this._$ET(),e}t&&this._$AE(e)}willUpdate(t){}_$AE(t){this._$ES?.forEach((t=>t.hostUpdated?.())),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$ET(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$Eg}shouldUpdate(t){return!0}update(t){this._$Ej&&=this._$Ej.forEach((t=>this._$EO(t,this[t]))),this._$ET()}updated(t){}firstUpdated(t){}}$.elementStyles=[],$.shadowRootOptions={mode:"open"},$[E("elementProperties")]=new Map,$[E("finalized")]=new Map,y?.({ReactiveElement:$}),(d.reactiveElementVersions??=[]).push("2.0.1"); + */,{is:n,defineProperty:a,getOwnPropertyDescriptor:h,getOwnPropertyNames:c,getOwnPropertySymbols:l,getPrototypeOf:d}=Object,p=globalThis,u=p.trustedTypes,f=u?u.emptyScript:"",y=p.reactiveElementPolyfillSupport,m=(t,e)=>t,E={toAttribute(t,e){switch(e){case Boolean:t=t?f:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){let s=t;switch(e){case Boolean:s=null!==t;break;case Number:s=null===t?null:Number(t);break;case Object:case Array:try{s=JSON.parse(t)}catch(t){s=null}}return s}},_=(t,e)=>!n(t,e),S={attribute:!0,type:String,converter:E,reflect:!1,hasChanged:_};Symbol.metadata??=Symbol("metadata"),p.litPropertyMetadata??=new WeakMap;class $ extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=S){if(e.state&&(e.attribute=!1),this._$Ei(),this.elementProperties.set(t,e),!e.noAccessor){const s=Symbol(),i=this.getPropertyDescriptor(t,s,e);void 0!==i&&a(this.prototype,t,i)}}static getPropertyDescriptor(t,e,s){const{get:i,set:r}=h(this.prototype,t)??{get(){return this[e]},set(t){this[e]=t}};return{get(){return i?.call(this)},set(e){const o=i?.call(this);r.call(this,e),this.requestUpdate(t,o,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??S}static _$Ei(){if(this.hasOwnProperty(m("elementProperties")))return;const t=d(this);t.finalize(),void 0!==t.l&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(m("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(m("properties"))){const t=this.properties,e=[...c(t),...l(t)];for(const s of e)this.createProperty(s,t[s])}const t=this[Symbol.metadata];if(null!==t){const e=litPropertyMetadata.get(t);if(void 0!==e)for(const[t,s]of e)this.elementProperties.set(t,s)}this._$Eh=new Map;for(const[t,e]of this.elementProperties){const s=this._$Eu(t,e);void 0!==s&&this._$Eh.set(s,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const s=new Set(t.flat(1/0).reverse());for(const t of s)e.unshift(o(t))}else void 0!==t&&e.push(o(t));return e}static _$Eu(t,e){const s=e.attribute;return!1===s?void 0:"string"==typeof s?s:"string"==typeof t?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise((t=>this.enableUpdating=t)),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach((t=>t(this)))}addController(t){(this._$EO??=new Set).add(t),void 0!==this.renderRoot&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){const t=new Map,e=this.constructor.elementProperties;for(const s of e.keys())this.hasOwnProperty(s)&&(t.set(s,this[s]),delete this[s]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const s=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return((s,i)=>{if(e)s.adoptedStyleSheets=i.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet));else for(const e of i){const i=document.createElement("style"),r=t.litNonce;void 0!==r&&i.setAttribute("nonce",r),i.textContent=e.cssText,s.appendChild(i)}})(s,this.constructor.elementStyles),s}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach((t=>t.hostConnected?.()))}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach((t=>t.hostDisconnected?.()))}attributeChangedCallback(t,e,s){this._$AK(t,s)}_$EC(t,e){const s=this.constructor.elementProperties.get(t),i=this.constructor._$Eu(t,s);if(void 0!==i&&!0===s.reflect){const r=(void 0!==s.converter?.toAttribute?s.converter:E).toAttribute(e,s.type);this._$Em=t,null==r?this.removeAttribute(i):this.setAttribute(i,r),this._$Em=null}}_$AK(t,e){const s=this.constructor,i=s._$Eh.get(t);if(void 0!==i&&this._$Em!==i){const t=s.getPropertyOptions(i),r="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==t.converter?.fromAttribute?t.converter:E;this._$Em=i,this[i]=r.fromAttribute(e,t.type),this._$Em=null}}requestUpdate(t,e,s){if(void 0!==t){if(s??=this.constructor.getPropertyOptions(t),!(s.hasChanged??_)(this[t],e))return;this.P(t,e,s)}!1===this.isUpdatePending&&(this._$ES=this._$ET())}P(t,e,s){this._$AL.has(t)||this._$AL.set(t,e),!0===s.reflect&&this._$Em!==t&&(this._$Ej??=new Set).add(t)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[t,e]of this._$Ep)this[t]=e;this._$Ep=void 0}const t=this.constructor.elementProperties;if(t.size>0)for(const[e,s]of t)!0!==s.wrapped||this._$AL.has(e)||void 0===this[e]||this.P(e,this[e],s)}let t=!1;const e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),this._$EO?.forEach((t=>t.hostUpdate?.())),this.update(e)):this._$EU()}catch(e){throw t=!1,this._$EU(),e}t&&this._$AE(e)}willUpdate(t){}_$AE(t){this._$EO?.forEach((t=>t.hostUpdated?.())),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Ej&&=this._$Ej.forEach((t=>this._$EC(t,this[t]))),this._$EU()}updated(t){}firstUpdated(t){}}$.elementStyles=[],$.shadowRootOptions={mode:"open"},$[m("elementProperties")]=new Map,$[m("finalized")]=new Map,y?.({ReactiveElement:$}),(p.reactiveElementVersions??=[]).push("2.0.4"); /** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause */ -const g={attribute:!0,type:String,converter:m,reflect:!1,hasChanged:S},b=(t=g,e,s)=>{const{kind:i,metadata:r}=s;let o=globalThis.litPropertyMetadata.get(r);if(void 0===o&&globalThis.litPropertyMetadata.set(r,o=new Map),o.set(s.name,t),"accessor"===i){const{name:i}=s;return{set(s){const r=e.get.call(this);e.set.call(this,s),this.requestUpdate(i,r,t)},init(e){return void 0!==e&&this.C(i,void 0,t),e}}}if("setter"===i){const{name:i}=s;return function(s){const r=this[i];e.call(this,s),this.requestUpdate(i,r,t)}}throw Error("Unsupported decorator location: "+i)};function P(t){return(e,s)=>"object"==typeof s?b(t,e,s):((t,e,s)=>{const i=e.hasOwnProperty(s);return e.constructor.createProperty(s,i?{...t,wrapped:!0}:t),i?Object.getOwnPropertyDescriptor(e,s):void 0})(t,e,s) +const g={attribute:!0,type:String,converter:E,reflect:!1,hasChanged:_},P=(t=g,e,s)=>{const{kind:i,metadata:r}=s;let o=globalThis.litPropertyMetadata.get(r);if(void 0===o&&globalThis.litPropertyMetadata.set(r,o=new Map),o.set(s.name,t),"accessor"===i){const{name:i}=s;return{set(s){const r=e.get.call(this);e.set.call(this,s),this.requestUpdate(i,r,t)},init(e){return void 0!==e&&this.P(i,void 0,t),e}}}if("setter"===i){const{name:i}=s;return function(s){const r=this[i];e.call(this,s),this.requestUpdate(i,r,t)}}throw Error("Unsupported decorator location: "+i)};function b(t){return(e,s)=>"object"==typeof s?P(t,e,s):((t,e,s)=>{const i=e.hasOwnProperty(s);return e.constructor.createProperty(s,i?{...t,wrapped:!0}:t),i?Object.getOwnPropertyDescriptor(e,s):void 0})(t,e,s) /** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause - */}function v(t){return P({...t,state:!0,attribute:!1})} + */}function v(t){return b({...t,state:!0,attribute:!1})} /** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause - */const w=t=>(e,s)=>{void 0!==s?s.addInitializer((()=>{customElements.define(t,e)})):customElements.define(t,e)};export{w as customElement,P as property,b as standardProperty,v as state}; + */const w=t=>(e,s)=>{void 0!==s?s.addInitializer((()=>{customElements.define(t,e)})):customElements.define(t,e)};export{w as customElement,b as property,P as standardProperty,v as state}; //# sourceMappingURL=decorators.js.map diff --git a/public/third_party/lit/lib/decorators.js.map b/public/third_party/lit/lib/decorators.js.map index 29c139303..ac01a110c 100644 --- a/public/third_party/lit/lib/decorators.js.map +++ b/public/third_party/lit/lib/decorators.js.map @@ -1 +1 @@ -{"version":3,"file":"decorators.js","sources":["../node_modules/@lit/reactive-element/css-tag.js","../node_modules/@lit/reactive-element/reactive-element.js","../node_modules/@lit/reactive-element/decorators/property.js","../node_modules/@lit/reactive-element/decorators/state.js","../node_modules/@lit/reactive-element/decorators/custom-element.js"],"sourcesContent":["/**\n * @license\n * Copyright 2019 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\nconst t=globalThis,e=t.ShadowRoot&&(void 0===t.ShadyCSS||t.ShadyCSS.nativeShadow)&&\"adoptedStyleSheets\"in Document.prototype&&\"replace\"in CSSStyleSheet.prototype,s=Symbol(),o=new WeakMap;class n{constructor(t,e,o){if(this._$cssResult$=!0,o!==s)throw Error(\"CSSResult is not constructable. Use `unsafeCSS` or `css` instead.\");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const s=this.t;if(e&&void 0===t){const e=void 0!==s&&1===s.length;e&&(t=o.get(s)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),e&&o.set(s,t))}return t}toString(){return this.cssText}}const r=t=>new n(\"string\"==typeof t?t:t+\"\",void 0,s),i=(t,...e)=>{const o=1===t.length?t[0]:e.reduce(((e,s,o)=>e+(t=>{if(!0===t._$cssResult$)return t.cssText;if(\"number\"==typeof t)return t;throw Error(\"Value passed to 'css' function must be a 'css' function result: \"+t+\". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.\")})(s)+t[o+1]),t[0]);return new n(o,t,s)},S=(s,o)=>{if(e)s.adoptedStyleSheets=o.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet));else for(const e of o){const o=document.createElement(\"style\"),n=t.litNonce;void 0!==n&&o.setAttribute(\"nonce\",n),o.textContent=e.cssText,s.appendChild(o)}},c=e?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e=\"\";for(const s of t.cssRules)e+=s.cssText;return r(e)})(t):t;export{n as CSSResult,S as adoptStyles,i as css,c as getCompatibleStyle,e as supportsAdoptingStyleSheets,r as unsafeCSS};\n//# sourceMappingURL=css-tag.js.map\n","import{getCompatibleStyle as t,adoptStyles as s}from\"./css-tag.js\";export{CSSResult,adoptStyles,css,getCompatibleStyle,supportsAdoptingStyleSheets,unsafeCSS}from\"./css-tag.js\";\n/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */const{is:i,defineProperty:e,getOwnPropertyDescriptor:r,getOwnPropertyNames:h,getOwnPropertySymbols:o,getPrototypeOf:n}=Object,a=globalThis,c=a.trustedTypes,l=c?c.emptyScript:\"\",p=a.reactiveElementPolyfillSupport,d=(t,s)=>t,u={toAttribute(t,s){switch(s){case Boolean:t=t?l:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,s){let i=t;switch(s){case Boolean:i=null!==t;break;case Number:i=null===t?null:Number(t);break;case Object:case Array:try{i=JSON.parse(t)}catch(t){i=null}}return i}},f=(t,s)=>!i(t,s),y={attribute:!0,type:String,converter:u,reflect:!1,hasChanged:f};Symbol.metadata??=Symbol(\"metadata\"),a.litPropertyMetadata??=new WeakMap;class b extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,s=y){if(s.state&&(s.attribute=!1),this._$Ei(),this.elementProperties.set(t,s),!s.noAccessor){const i=Symbol(),r=this.getPropertyDescriptor(t,i,s);void 0!==r&&e(this.prototype,t,r)}}static getPropertyDescriptor(t,s,i){const{get:e,set:h}=r(this.prototype,t)??{get(){return this[s]},set(t){this[s]=t}};return{get(){return e?.call(this)},set(s){const r=e?.call(this);h.call(this,s),this.requestUpdate(t,r,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??y}static _$Ei(){if(this.hasOwnProperty(d(\"elementProperties\")))return;const t=n(this);t.finalize(),void 0!==t.l&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(d(\"finalized\")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(d(\"properties\"))){const t=this.properties,s=[...h(t),...o(t)];for(const i of s)this.createProperty(i,t[i])}const t=this[Symbol.metadata];if(null!==t){const s=litPropertyMetadata.get(t);if(void 0!==s)for(const[t,i]of s)this.elementProperties.set(t,i)}this._$Eh=new Map;for(const[t,s]of this.elementProperties){const i=this._$Eu(t,s);void 0!==i&&this._$Eh.set(i,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(s){const i=[];if(Array.isArray(s)){const e=new Set(s.flat(1/0).reverse());for(const s of e)i.unshift(t(s))}else void 0!==s&&i.push(t(s));return i}static _$Eu(t,s){const i=s.attribute;return!1===i?void 0:\"string\"==typeof i?i:\"string\"==typeof t?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$Eg=new Promise((t=>this.enableUpdating=t)),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach((t=>t(this)))}addController(t){(this._$ES??=[]).push(t),void 0!==this.renderRoot&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$ES?.splice(this._$ES.indexOf(t)>>>0,1)}_$E_(){const t=new Map,s=this.constructor.elementProperties;for(const i of s.keys())this.hasOwnProperty(i)&&(t.set(i,this[i]),delete this[i]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return s(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$ES?.forEach((t=>t.hostConnected?.()))}enableUpdating(t){}disconnectedCallback(){this._$ES?.forEach((t=>t.hostDisconnected?.()))}attributeChangedCallback(t,s,i){this._$AK(t,i)}_$EO(t,s){const i=this.constructor.elementProperties.get(t),e=this.constructor._$Eu(t,i);if(void 0!==e&&!0===i.reflect){const r=(void 0!==i.converter?.toAttribute?i.converter:u).toAttribute(s,i.type);this._$Em=t,null==r?this.removeAttribute(e):this.setAttribute(e,r),this._$Em=null}}_$AK(t,s){const i=this.constructor,e=i._$Eh.get(t);if(void 0!==e&&this._$Em!==e){const t=i.getPropertyOptions(e),r=\"function\"==typeof t.converter?{fromAttribute:t.converter}:void 0!==t.converter?.fromAttribute?t.converter:u;this._$Em=e,this[e]=r.fromAttribute(s,t.type),this._$Em=null}}requestUpdate(t,s,i,e=!1,r){if(void 0!==t){if(i??=this.constructor.getPropertyOptions(t),!(i.hasChanged??f)(e?r:this[t],s))return;this.C(t,s,i)}!1===this.isUpdatePending&&(this._$Eg=this._$EP())}C(t,s,i){this._$AL.has(t)||this._$AL.set(t,s),!0===i.reflect&&this._$Em!==t&&(this._$Ej??=new Set).add(t)}async _$EP(){this.isUpdatePending=!0;try{await this._$Eg}catch(t){Promise.reject(t)}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this._$Ep){for(const[t,s]of this._$Ep)this[t]=s;this._$Ep=void 0}const t=this.constructor.elementProperties;if(t.size>0)for(const[s,i]of t)!0!==i.wrapped||this._$AL.has(s)||void 0===this[s]||this.C(s,this[s],i)}let t=!1;const s=this._$AL;try{t=this.shouldUpdate(s),t?(this.willUpdate(s),this._$ES?.forEach((t=>t.hostUpdate?.())),this.update(s)):this._$ET()}catch(s){throw t=!1,this._$ET(),s}t&&this._$AE(s)}willUpdate(t){}_$AE(t){this._$ES?.forEach((t=>t.hostUpdated?.())),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$ET(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$Eg}shouldUpdate(t){return!0}update(t){this._$Ej&&=this._$Ej.forEach((t=>this._$EO(t,this[t]))),this._$ET()}updated(t){}firstUpdated(t){}}b.elementStyles=[],b.shadowRootOptions={mode:\"open\"},b[d(\"elementProperties\")]=new Map,b[d(\"finalized\")]=new Map,p?.({ReactiveElement:b}),(a.reactiveElementVersions??=[]).push(\"2.0.1\");export{b as ReactiveElement,u as defaultConverter,f as notEqual};\n//# sourceMappingURL=reactive-element.js.map\n","import{defaultConverter as t,notEqual as e}from\"../reactive-element.js\";\n/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */const o={attribute:!0,type:String,converter:t,reflect:!1,hasChanged:e},r=(t=o,e,r)=>{const{kind:n,metadata:i}=r;let s=globalThis.litPropertyMetadata.get(i);if(void 0===s&&globalThis.litPropertyMetadata.set(i,s=new Map),s.set(r.name,t),\"accessor\"===n){const{name:o}=r;return{set(r){const n=e.get.call(this);e.set.call(this,r),this.requestUpdate(o,n,t)},init(e){return void 0!==e&&this.C(o,void 0,t),e}}}if(\"setter\"===n){const{name:o}=r;return function(r){const n=this[o];e.call(this,r),this.requestUpdate(o,n,t)}}throw Error(\"Unsupported decorator location: \"+n)};function n(t){return(e,o)=>\"object\"==typeof o?r(t,e,o):((t,e,o)=>{const r=e.hasOwnProperty(o);return e.constructor.createProperty(o,r?{...t,wrapped:!0}:t),r?Object.getOwnPropertyDescriptor(e,o):void 0})(t,e,o)}export{n as property,r as standardProperty};\n//# sourceMappingURL=property.js.map\n","import{property as t}from\"./property.js\";\n/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */function r(r){return t({...r,state:!0,attribute:!1})}export{r as state};\n//# sourceMappingURL=state.js.map\n","/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\nconst t=t=>(e,o)=>{void 0!==o?o.addInitializer((()=>{customElements.define(t,e)})):customElements.define(t,e)};export{t as customElement};\n//# sourceMappingURL=custom-element.js.map\n"],"names":["t","globalThis","e","ShadowRoot","ShadyCSS","nativeShadow","Document","prototype","CSSStyleSheet","s","Symbol","o","WeakMap","n","constructor","this","_$cssResult$","Error","cssText","styleSheet","length","get","replaceSync","set","toString","c","cssRules","r","is","i","defineProperty","getOwnPropertyDescriptor","getOwnPropertyNames","h","getOwnPropertySymbols","getPrototypeOf","Object","a","trustedTypes","l","emptyScript","p","reactiveElementPolyfillSupport","d","u","toAttribute","Boolean","Array","JSON","stringify","fromAttribute","Number","parse","f","y","attribute","type","String","converter","reflect","hasChanged","metadata","litPropertyMetadata","b","HTMLElement","addInitializer","_$Ei","push","observedAttributes","finalize","_$Eh","keys","createProperty","state","elementProperties","noAccessor","getPropertyDescriptor","call","requestUpdate","configurable","enumerable","getPropertyOptions","hasOwnProperty","Map","finalized","properties","_$Eu","elementStyles","finalizeStyles","styles","isArray","Set","flat","reverse","unshift","toLowerCase","super","_$Ep","isUpdatePending","hasUpdated","_$Em","_$Ev","_$Eg","Promise","enableUpdating","_$AL","_$E_","forEach","addController","_$ES","renderRoot","isConnected","hostConnected","removeController","splice","indexOf","size","createRenderRoot","shadowRoot","attachShadow","shadowRootOptions","adoptedStyleSheets","map","document","createElement","litNonce","setAttribute","textContent","appendChild","connectedCallback","disconnectedCallback","hostDisconnected","attributeChangedCallback","_$AK","_$EO","removeAttribute","C","_$EP","has","_$Ej","add","reject","scheduleUpdate","performUpdate","wrapped","shouldUpdate","willUpdate","hostUpdate","update","_$ET","_$AE","hostUpdated","firstUpdated","updated","updateComplete","getUpdateComplete","mode","ReactiveElement","reactiveElementVersions","kind","name","init","customElements","define"],"mappings":";;;;;AAKA,MAAMA,EAAEC,WAAWC,EAAEF,EAAEG,kBAAa,IAASH,EAAEI,UAAUJ,EAAEI,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,CAACE,EAAES,IAAI,iBAAiBA,EAAEgB,EAAE3B,EAAEE,EAAES,GAAG,EAAEX,EAAEE,EAAES,KAAK,MAAMgB,EAAEzB,EAAEgF,eAAevE,GAAG,OAAOT,EAAEY,YAAY0D,eAAe7D,EAAEgB,EAAE,IAAI3B,EAAEgJ,SAAQ,GAAIhJ,GAAG2B,EAAES,OAAOL,yBAAyB7B,EAAES,QAAG,CAAO,EAAlJ,CAAoJX,EAAEE,EAAES;;;;;GAAE,CCApwB,SAASgB,EAAEA,GAAG,OAAO3B,EAAE,IAAI2B,EAAE8C,OAAM,EAAGlB,WAAU,GAAI;;;;;GCAlD,MAACvD,EAAEA,GAAG,CAACE,EAAES,UAAK,IAASA,EAAEA,EAAEsD,qBAAqBiG,eAAeC,OAAOnK,EAAEE,EAAG,IAAGgK,eAAeC,OAAOnK,EAAEE"} \ No newline at end of file +{"version":3,"file":"decorators.js","sources":["../node_modules/@lit/reactive-element/css-tag.js","../node_modules/@lit/reactive-element/reactive-element.js","../node_modules/@lit/reactive-element/decorators/property.js","../node_modules/@lit/reactive-element/decorators/state.js","../node_modules/@lit/reactive-element/decorators/custom-element.js"],"sourcesContent":["/**\n * @license\n * Copyright 2019 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\nconst t=globalThis,e=t.ShadowRoot&&(void 0===t.ShadyCSS||t.ShadyCSS.nativeShadow)&&\"adoptedStyleSheets\"in Document.prototype&&\"replace\"in CSSStyleSheet.prototype,s=Symbol(),o=new WeakMap;class n{constructor(t,e,o){if(this._$cssResult$=!0,o!==s)throw Error(\"CSSResult is not constructable. Use `unsafeCSS` or `css` instead.\");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const s=this.t;if(e&&void 0===t){const e=void 0!==s&&1===s.length;e&&(t=o.get(s)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),e&&o.set(s,t))}return t}toString(){return this.cssText}}const r=t=>new n(\"string\"==typeof t?t:t+\"\",void 0,s),i=(t,...e)=>{const o=1===t.length?t[0]:e.reduce(((e,s,o)=>e+(t=>{if(!0===t._$cssResult$)return t.cssText;if(\"number\"==typeof t)return t;throw Error(\"Value passed to 'css' function must be a 'css' function result: \"+t+\". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.\")})(s)+t[o+1]),t[0]);return new n(o,t,s)},S=(s,o)=>{if(e)s.adoptedStyleSheets=o.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet));else for(const e of o){const o=document.createElement(\"style\"),n=t.litNonce;void 0!==n&&o.setAttribute(\"nonce\",n),o.textContent=e.cssText,s.appendChild(o)}},c=e?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e=\"\";for(const s of t.cssRules)e+=s.cssText;return r(e)})(t):t;export{n as CSSResult,S as adoptStyles,i as css,c as getCompatibleStyle,e as supportsAdoptingStyleSheets,r as unsafeCSS};\n//# sourceMappingURL=css-tag.js.map\n","import{getCompatibleStyle as t,adoptStyles as s}from\"./css-tag.js\";export{CSSResult,adoptStyles,css,getCompatibleStyle,supportsAdoptingStyleSheets,unsafeCSS}from\"./css-tag.js\";\n/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */const{is:i,defineProperty:e,getOwnPropertyDescriptor:r,getOwnPropertyNames:h,getOwnPropertySymbols:o,getPrototypeOf:n}=Object,a=globalThis,c=a.trustedTypes,l=c?c.emptyScript:\"\",p=a.reactiveElementPolyfillSupport,d=(t,s)=>t,u={toAttribute(t,s){switch(s){case Boolean:t=t?l:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,s){let i=t;switch(s){case Boolean:i=null!==t;break;case Number:i=null===t?null:Number(t);break;case Object:case Array:try{i=JSON.parse(t)}catch(t){i=null}}return i}},f=(t,s)=>!i(t,s),y={attribute:!0,type:String,converter:u,reflect:!1,hasChanged:f};Symbol.metadata??=Symbol(\"metadata\"),a.litPropertyMetadata??=new WeakMap;class b extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,s=y){if(s.state&&(s.attribute=!1),this._$Ei(),this.elementProperties.set(t,s),!s.noAccessor){const i=Symbol(),r=this.getPropertyDescriptor(t,i,s);void 0!==r&&e(this.prototype,t,r)}}static getPropertyDescriptor(t,s,i){const{get:e,set:h}=r(this.prototype,t)??{get(){return this[s]},set(t){this[s]=t}};return{get(){return e?.call(this)},set(s){const r=e?.call(this);h.call(this,s),this.requestUpdate(t,r,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??y}static _$Ei(){if(this.hasOwnProperty(d(\"elementProperties\")))return;const t=n(this);t.finalize(),void 0!==t.l&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(d(\"finalized\")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(d(\"properties\"))){const t=this.properties,s=[...h(t),...o(t)];for(const i of s)this.createProperty(i,t[i])}const t=this[Symbol.metadata];if(null!==t){const s=litPropertyMetadata.get(t);if(void 0!==s)for(const[t,i]of s)this.elementProperties.set(t,i)}this._$Eh=new Map;for(const[t,s]of this.elementProperties){const i=this._$Eu(t,s);void 0!==i&&this._$Eh.set(i,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(s){const i=[];if(Array.isArray(s)){const e=new Set(s.flat(1/0).reverse());for(const s of e)i.unshift(t(s))}else void 0!==s&&i.push(t(s));return i}static _$Eu(t,s){const i=s.attribute;return!1===i?void 0:\"string\"==typeof i?i:\"string\"==typeof t?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise((t=>this.enableUpdating=t)),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach((t=>t(this)))}addController(t){(this._$EO??=new Set).add(t),void 0!==this.renderRoot&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){const t=new Map,s=this.constructor.elementProperties;for(const i of s.keys())this.hasOwnProperty(i)&&(t.set(i,this[i]),delete this[i]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return s(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach((t=>t.hostConnected?.()))}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach((t=>t.hostDisconnected?.()))}attributeChangedCallback(t,s,i){this._$AK(t,i)}_$EC(t,s){const i=this.constructor.elementProperties.get(t),e=this.constructor._$Eu(t,i);if(void 0!==e&&!0===i.reflect){const r=(void 0!==i.converter?.toAttribute?i.converter:u).toAttribute(s,i.type);this._$Em=t,null==r?this.removeAttribute(e):this.setAttribute(e,r),this._$Em=null}}_$AK(t,s){const i=this.constructor,e=i._$Eh.get(t);if(void 0!==e&&this._$Em!==e){const t=i.getPropertyOptions(e),r=\"function\"==typeof t.converter?{fromAttribute:t.converter}:void 0!==t.converter?.fromAttribute?t.converter:u;this._$Em=e,this[e]=r.fromAttribute(s,t.type),this._$Em=null}}requestUpdate(t,s,i){if(void 0!==t){if(i??=this.constructor.getPropertyOptions(t),!(i.hasChanged??f)(this[t],s))return;this.P(t,s,i)}!1===this.isUpdatePending&&(this._$ES=this._$ET())}P(t,s,i){this._$AL.has(t)||this._$AL.set(t,s),!0===i.reflect&&this._$Em!==t&&(this._$Ej??=new Set).add(t)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[t,s]of this._$Ep)this[t]=s;this._$Ep=void 0}const t=this.constructor.elementProperties;if(t.size>0)for(const[s,i]of t)!0!==i.wrapped||this._$AL.has(s)||void 0===this[s]||this.P(s,this[s],i)}let t=!1;const s=this._$AL;try{t=this.shouldUpdate(s),t?(this.willUpdate(s),this._$EO?.forEach((t=>t.hostUpdate?.())),this.update(s)):this._$EU()}catch(s){throw t=!1,this._$EU(),s}t&&this._$AE(s)}willUpdate(t){}_$AE(t){this._$EO?.forEach((t=>t.hostUpdated?.())),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Ej&&=this._$Ej.forEach((t=>this._$EC(t,this[t]))),this._$EU()}updated(t){}firstUpdated(t){}}b.elementStyles=[],b.shadowRootOptions={mode:\"open\"},b[d(\"elementProperties\")]=new Map,b[d(\"finalized\")]=new Map,p?.({ReactiveElement:b}),(a.reactiveElementVersions??=[]).push(\"2.0.4\");export{b as ReactiveElement,u as defaultConverter,f as notEqual};\n//# sourceMappingURL=reactive-element.js.map\n","import{defaultConverter as t,notEqual as e}from\"../reactive-element.js\";\n/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */const o={attribute:!0,type:String,converter:t,reflect:!1,hasChanged:e},r=(t=o,e,r)=>{const{kind:n,metadata:i}=r;let s=globalThis.litPropertyMetadata.get(i);if(void 0===s&&globalThis.litPropertyMetadata.set(i,s=new Map),s.set(r.name,t),\"accessor\"===n){const{name:o}=r;return{set(r){const n=e.get.call(this);e.set.call(this,r),this.requestUpdate(o,n,t)},init(e){return void 0!==e&&this.P(o,void 0,t),e}}}if(\"setter\"===n){const{name:o}=r;return function(r){const n=this[o];e.call(this,r),this.requestUpdate(o,n,t)}}throw Error(\"Unsupported decorator location: \"+n)};function n(t){return(e,o)=>\"object\"==typeof o?r(t,e,o):((t,e,o)=>{const r=e.hasOwnProperty(o);return e.constructor.createProperty(o,r?{...t,wrapped:!0}:t),r?Object.getOwnPropertyDescriptor(e,o):void 0})(t,e,o)}export{n as property,r as standardProperty};\n//# sourceMappingURL=property.js.map\n","import{property as t}from\"./property.js\";\n/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */function r(r){return t({...r,state:!0,attribute:!1})}export{r as state};\n//# sourceMappingURL=state.js.map\n","/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\nconst t=t=>(e,o)=>{void 0!==o?o.addInitializer((()=>{customElements.define(t,e)})):customElements.define(t,e)};export{t as customElement};\n//# sourceMappingURL=custom-element.js.map\n"],"names":["t","globalThis","e","ShadowRoot","ShadyCSS","nativeShadow","Document","prototype","CSSStyleSheet","s","Symbol","o","WeakMap","n$2","constructor","this","_$cssResult$","Error","cssText","styleSheet","length","get","replaceSync","set","toString","c","cssRules","n","r","is","i","defineProperty","getOwnPropertyDescriptor","getOwnPropertyNames","h","getOwnPropertySymbols","getPrototypeOf","Object","a","trustedTypes","l","emptyScript","p","reactiveElementPolyfillSupport","d","u","toAttribute","Boolean","Array","JSON","stringify","fromAttribute","Number","parse","f","y","attribute","type","String","converter","reflect","hasChanged","metadata","litPropertyMetadata","b","HTMLElement","addInitializer","_$Ei","push","observedAttributes","finalize","_$Eh","keys","createProperty","state","elementProperties","noAccessor","getPropertyDescriptor","call","requestUpdate","configurable","enumerable","getPropertyOptions","hasOwnProperty","Map","finalized","properties","_$Eu","elementStyles","finalizeStyles","styles","isArray","Set","flat","reverse","unshift","toLowerCase","super","_$Ep","isUpdatePending","hasUpdated","_$Em","_$Ev","_$ES","Promise","enableUpdating","_$AL","_$E_","forEach","addController","_$EO","add","renderRoot","isConnected","hostConnected","removeController","delete","size","createRenderRoot","shadowRoot","attachShadow","shadowRootOptions","adoptedStyleSheets","map","document","createElement","litNonce","setAttribute","textContent","appendChild","connectedCallback","disconnectedCallback","hostDisconnected","attributeChangedCallback","_$AK","_$EC","removeAttribute","P","_$ET","has","_$Ej","reject","scheduleUpdate","performUpdate","wrapped","shouldUpdate","willUpdate","hostUpdate","update","_$EU","_$AE","hostUpdated","firstUpdated","updated","updateComplete","getUpdateComplete","mode","ReactiveElement","reactiveElementVersions","kind","name","init","customElements","define"],"mappings":";;;;;AAKA,MAAMA,EAAEC,WAAWC,EAAEF,EAAEG,kBAAa,IAASH,EAAEI,UAAUJ,EAAEI,SAASC,eAAe,uBAAuBC,SAASC,WAAW,YAAYC,cAAcD,UAAUE,EAAEC,SAASC,EAAE,IAAIC,QAAO,IAAAC,EAAC,MAAQ,WAAAC,CAAYd,EAAEE,EAAES,GAAG,GAAGI,KAAKC,cAAa,EAAGL,IAAIF,EAAE,MAAMQ,MAAM,qEAAqEF,KAAKG,QAAQlB,EAAEe,KAAKf,EAAEE,CAAC,CAAC,cAAIiB,GAAa,IAAInB,EAAEe,KAAKJ,EAAE,MAAMF,EAAEM,KAAKf,EAAE,GAAGE,QAAG,IAASF,EAAE,CAAC,MAAME,OAAE,IAASO,GAAG,IAAIA,EAAEW,OAAOlB,IAAIF,EAAEW,EAAEU,IAAIZ,SAAI,IAAST,KAAKe,KAAKJ,EAAEX,EAAE,IAAIQ,eAAec,YAAYP,KAAKG,SAAShB,GAAGS,EAAEY,IAAId,EAAET,GAAG,CAAC,OAAOA,CAAC,CAAC,QAAAwB,GAAW,OAAOT,KAAKG,OAAO,GAAO,MAAgoBO,EAAEvB,EAAEF,GAAGA,EAAEA,GAAGA,aAAaQ,cAAc,CAACR,IAAI,IAAIE,EAAE,GAAG,IAAI,MAAMO,KAAKT,EAAE0B,SAASxB,GAAGO,EAAES,QAAQ,MAAztBlB,IAAG,IAAI2B,EAAE,iBAAiB3B,EAAEA,EAAEA,EAAE,QAAG,EAAOS,GAAsrBmB,CAAE1B,EAAG,EAAjE,CAAmEF,GAAGA;;;;;KCAlzC6B,GAAGC,EAAEC,eAAe7B,EAAE8B,yBAAyBJ,EAAEK,oBAAoBC,EAAEC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CAAC,EAAE,CAAC,GAAG,WAAWyB,EAAE,CAAC,MAAMqI,KAAKrJ,GAAGiB,EAAE,OAAO,SAASA,GAAG,MAAMD,EAAEZ,KAAKJ,GAAGT,EAAE4E,KAAK/D,KAAKa,GAAGb,KAAKgE,cAAcpE,EAAEgB,EAAE3B,EAAE,CAAC,CAAC,MAAMiB,MAAM,mCAAmCU,EAAC,EAAG,SAASA,EAAE3B,GAAG,MAAM,CAACE,EAAES,IAAI,iBAAiBA,EAAEiB,EAAE5B,EAAEE,EAAES,GAAG,EAAEX,EAAEE,EAAES,KAAK,MAAMiB,EAAE1B,EAAEiF,eAAexE,GAAG,OAAOT,EAAEY,YAAY2D,eAAe9D,EAAEiB,EAAE,IAAI5B,EAAEgJ,SAAQ,GAAIhJ,GAAG4B,EAAES,OAAOL,yBAAyB9B,EAAES,QAAG,CAAO,EAAlJ,CAAoJX,EAAEE,EAAES;;;;;GAAE,CCApwB,SAASiB,EAAEA,GAAG,OAAO5B,EAAE,IAAI4B,EAAE8C,OAAM,EAAGlB,WAAU,GAAI;;;;;GCAlD,MAACxD,EAAEA,GAAG,CAACE,EAAES,UAAK,IAASA,EAAEA,EAAEuD,gBAAc,KAAOgG,eAAeC,OAAOnK,EAAEE,EAAG,IAAGgK,eAAeC,OAAOnK,EAAEE,EAAE","x_google_ignoreList":[0,1,2,3,4]} \ No newline at end of file diff --git a/public/third_party/lit/lib/directive.d.ts b/public/third_party/lit/lib/directive.d.ts index c5b693606..ac42422a7 100644 --- a/public/third_party/lit/lib/directive.d.ts +++ b/public/third_party/lit/lib/directive.d.ts @@ -1,4 +1,8 @@ -/// +declare class TrustedHTML { + private constructor(); // To prevent instantiting with 'new'. + private brand: true; // To prevent structural typing. +} + /** * @license * Copyright 2017 Google LLC @@ -20,14 +24,18 @@ type ValueSanitizer = (value: unknown) => unknown; /** TemplateResult types */ declare const HTML_RESULT = 1; declare const SVG_RESULT = 2; -type ResultType = typeof HTML_RESULT | typeof SVG_RESULT; +declare const MATHML_RESULT = 3; +type ResultType = typeof HTML_RESULT | typeof SVG_RESULT | typeof MATHML_RESULT; declare const ATTRIBUTE_PART = 1; declare const CHILD_PART = 2; +declare const PROPERTY_PART = 3; +declare const BOOLEAN_ATTRIBUTE_PART = 4; +declare const EVENT_PART = 5; declare const ELEMENT_PART = 6; declare const COMMENT_PART = 7; /** * The return type of the template tag functions, {@linkcode html} and - * {@linkcode svg}. + * {@linkcode svg} when it hasn't been compiled by @lit-labs/compiler. * * A `TemplateResult` object holds all the information about a template * expression required to render it: the template strings, expression values, @@ -38,7 +46,7 @@ declare const COMMENT_PART = 7; * [Rendering](https://lit.dev/docs/components/rendering) for more information. * */ -type TemplateResult = { +type UncompiledTemplateResult = { ['_$litType$']: T; strings: TemplateStringsArray; values: unknown[]; @@ -87,7 +95,7 @@ interface DirectiveParent { } declare class Template { parts: Array; - constructor({ strings, ['_$litType$']: type }: TemplateResult, options?: RenderOptions); + constructor({ strings, ['_$litType$']: type }: UncompiledTemplateResult, options?: RenderOptions); /** @nocollapse */ static createElement(html: TrustedHTML, _options?: RenderOptions): HTMLTemplateElement; } @@ -180,7 +188,7 @@ declare class ChildPart implements Disconnectable { private _commitIterable; } declare class AttributePart implements Disconnectable { - readonly type: 1 | 3 | 4 | 5; + readonly type: typeof ATTRIBUTE_PART | typeof PROPERTY_PART | typeof BOOLEAN_ATTRIBUTE_PART | typeof EVENT_PART; readonly element: HTMLElement; readonly name: string; readonly options: RenderOptions | undefined; @@ -272,7 +280,7 @@ type PartInfo = ChildPartInfo | AttributePartInfo | ElementPartInfo; * Creates a user-facing directive function from a Directive class. This * function has the same parameters as the directive's render() method. */ -declare const directive: (c: C) => (...values: Parameters["render"]>) => DirectiveResult; +declare const directive: (c: C) => (...values: DirectiveParameters>) => DirectiveResult; /** * Base class for creating custom directives. Users should extend this class, * implement `render` and/or `update`, and then pass their subclass to diff --git a/public/third_party/lit/lib/directive.js.map b/public/third_party/lit/lib/directive.js.map index b71208760..bfbb42653 100644 --- a/public/third_party/lit/lib/directive.js.map +++ b/public/third_party/lit/lib/directive.js.map @@ -1 +1 @@ -{"version":3,"file":"directive.js","sources":["../node_modules/lit-html/directive.js"],"sourcesContent":["/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\nconst t={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},e=t=>(...e)=>({_$litDirective$:t,values:e});class i{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,i){this._$Ct=t,this._$AM=e,this._$Ci=i}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}}export{i as Directive,t as PartType,e as directive};\n//# sourceMappingURL=directive.js.map\n"],"names":["t","ATTRIBUTE","CHILD","PROPERTY","BOOLEAN_ATTRIBUTE","EVENT","ELEMENT","e","_$litDirective$","values","i","constructor","_$AU","this","_$AM","_$AT","_$Ct","_$Ci","_$AS","update","render"],"mappings":";;;;;AAKK,MAACA,EAAE,CAACC,UAAU,EAAEC,MAAM,EAAEC,SAAS,EAAEC,kBAAkB,EAAEC,MAAM,EAAEC,QAAQ,GAAGC,EAAEP,GAAG,IAAIO,MAAMC,gBAAgBR,EAAES,OAAOF,IAAI,MAAMG,EAAE,WAAAC,CAAYX,IAAI,QAAIY,GAAO,OAAOC,KAAKC,KAAKF,IAAI,CAAC,IAAAG,CAAKf,EAAEO,EAAEG,GAAGG,KAAKG,KAAKhB,EAAEa,KAAKC,KAAKP,EAAEM,KAAKI,KAAKP,CAAC,CAAC,IAAAQ,CAAKlB,EAAEO,GAAG,OAAOM,KAAKM,OAAOnB,EAAEO,EAAE,CAAC,MAAAY,CAAOnB,EAAEO,GAAG,OAAOM,KAAKO,UAAUb,EAAE"} \ No newline at end of file +{"version":3,"file":"directive.js","sources":["../node_modules/lit-html/directive.js"],"sourcesContent":["/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\nconst t={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},e=t=>(...e)=>({_$litDirective$:t,values:e});class i{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,i){this._$Ct=t,this._$AM=e,this._$Ci=i}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}}export{i as Directive,t as PartType,e as directive};\n//# sourceMappingURL=directive.js.map\n"],"names":["t","ATTRIBUTE","CHILD","PROPERTY","BOOLEAN_ATTRIBUTE","EVENT","ELEMENT","e","_$litDirective$","values","i","constructor","_$AU","this","_$AM","_$AT","_$Ct","_$Ci","_$AS","update","render"],"mappings":";;;;;AAKK,MAACA,EAAE,CAACC,UAAU,EAAEC,MAAM,EAAEC,SAAS,EAAEC,kBAAkB,EAAEC,MAAM,EAAEC,QAAQ,GAAGC,EAAEP,GAAG,IAAIO,KAAC,CAAKC,gBAAgBR,EAAES,OAAOF,IAAI,MAAMG,EAAE,WAAAC,CAAYX,GAAE,CAAE,QAAIY,GAAO,OAAOC,KAAKC,KAAKF,IAAI,CAAC,IAAAG,CAAKf,EAAEO,EAAEG,GAAGG,KAAKG,KAAKhB,EAAEa,KAAKC,KAAKP,EAAEM,KAAKI,KAAKP,CAAC,CAAC,IAAAQ,CAAKlB,EAAEO,GAAG,OAAOM,KAAKM,OAAOnB,EAAEO,EAAE,CAAC,MAAAY,CAAOnB,EAAEO,GAAG,OAAOM,KAAKO,UAAUb,EAAE","x_google_ignoreList":[0]} \ No newline at end of file diff --git a/public/third_party/lit/lib/directives.d.ts b/public/third_party/lit/lib/directives.d.ts index 59a2ec910..a66e9d7f6 100644 --- a/public/third_party/lit/lib/directives.d.ts +++ b/public/third_party/lit/lib/directives.d.ts @@ -1,4 +1,8 @@ -/// +declare class TrustedHTML { + private constructor(); // To prevent instantiting with 'new'. + private brand: true; // To prevent structural typing. +} + /** * @license * Copyright 2017 Google LLC @@ -20,14 +24,18 @@ type ValueSanitizer = (value: unknown) => unknown; /** TemplateResult types */ declare const HTML_RESULT = 1; declare const SVG_RESULT = 2; -type ResultType = typeof HTML_RESULT | typeof SVG_RESULT; +declare const MATHML_RESULT = 3; +type ResultType = typeof HTML_RESULT | typeof SVG_RESULT | typeof MATHML_RESULT; declare const ATTRIBUTE_PART = 1; declare const CHILD_PART = 2; +declare const PROPERTY_PART = 3; +declare const BOOLEAN_ATTRIBUTE_PART = 4; +declare const EVENT_PART = 5; declare const ELEMENT_PART = 6; declare const COMMENT_PART = 7; /** * The return type of the template tag functions, {@linkcode html} and - * {@linkcode svg}. + * {@linkcode svg} when it hasn't been compiled by @lit-labs/compiler. * * A `TemplateResult` object holds all the information about a template * expression required to render it: the template strings, expression values, @@ -38,11 +46,30 @@ declare const COMMENT_PART = 7; * [Rendering](https://lit.dev/docs/components/rendering) for more information. * */ -type TemplateResult = { +type UncompiledTemplateResult = { ['_$litType$']: T; strings: TemplateStringsArray; values: unknown[]; }; +/** + * The return type of the template tag functions, {@linkcode html} and + * {@linkcode svg}. + * + * A `TemplateResult` object holds all the information about a template + * expression required to render it: the template strings, expression values, + * and type of template (html or svg). + * + * `TemplateResult` objects do not create any DOM on their own. To create or + * update DOM you need to render the `TemplateResult`. See + * [Rendering](https://lit.dev/docs/components/rendering) for more information. + * + * In Lit 4, this type will be an alias of + * MaybeCompiledTemplateResult, so that code will get type errors if it assumes + * that Lit templates are not compiled. When deliberately working with only + * one, use either {@linkcode CompiledTemplateResult} or + * {@linkcode UncompiledTemplateResult} explicitly. + */ +type TemplateResult = UncompiledTemplateResult; /** * A sentinel value that signals that a value was handled by a directive and * should not be written to the DOM. @@ -112,7 +139,7 @@ interface DirectiveParent { } declare class Template { parts: Array; - constructor({ strings, ['_$litType$']: type }: TemplateResult, options?: RenderOptions); + constructor({ strings, ['_$litType$']: type }: UncompiledTemplateResult, options?: RenderOptions); /** @nocollapse */ static createElement(html: TrustedHTML, _options?: RenderOptions): HTMLTemplateElement; } @@ -205,7 +232,7 @@ declare class ChildPart implements Disconnectable { private _commitIterable; } declare class AttributePart implements Disconnectable { - readonly type: 1 | 3 | 4 | 5; + readonly type: typeof ATTRIBUTE_PART | typeof PROPERTY_PART | typeof BOOLEAN_ATTRIBUTE_PART | typeof EVENT_PART; readonly element: HTMLElement; readonly name: string; readonly options: RenderOptions | undefined; @@ -328,7 +355,7 @@ declare class ClassMapDirective extends Directive { * This must be used in the `class` attribute and must be the only part used in * the attribute. It takes each property in the `classInfo` argument and adds * the property name to the element's `classList` if the property value is - * truthy; if the property value is falsey, the property name is removed from + * truthy; if the property value is falsy, the property name is removed from * the element's `class`. * * For example `{foo: bar}` applies the class `foo` if the value of `bar` is @@ -504,6 +531,119 @@ declare const unsafeHTML: (value: string | typeof noChange | typeof nothing | nu * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause */ +/** + * Overview: + * + * This module is designed to add support for an async `setValue` API and + * `disconnected` callback to directives with the least impact on the core + * runtime or payload when that feature is not used. + * + * The strategy is to introduce a `AsyncDirective` subclass of + * `Directive` that climbs the "parent" tree in its constructor to note which + * branches of lit-html's "logical tree" of data structures contain such + * directives and thus need to be crawled when a subtree is being cleared (or + * manually disconnected) in order to run the `disconnected` callback. + * + * The "nodes" of the logical tree include Parts, TemplateInstances (for when a + * TemplateResult is committed to a value of a ChildPart), and Directives; these + * all implement a common interface called `DisconnectableChild`. Each has a + * `_$parent` reference which is set during construction in the core code, and a + * `_$disconnectableChildren` field which is initially undefined. + * + * The sparse tree created by means of the `AsyncDirective` constructor + * crawling up the `_$parent` tree and placing a `_$disconnectableChildren` Set + * on each parent that includes each child that contains a + * `AsyncDirective` directly or transitively via its children. In order to + * notify connection state changes and disconnect (or reconnect) a tree, the + * `_$notifyConnectionChanged` API is patched onto ChildParts as a directive + * climbs the parent tree, which is called by the core when clearing a part if + * it exists. When called, that method iterates over the sparse tree of + * Set built up by AsyncDirectives, and calls + * `_$notifyDirectiveConnectionChanged` on any directives that are encountered + * in that tree, running the required callbacks. + * + * A given "logical tree" of lit-html data-structures might look like this: + * + * ChildPart(N1) _$dC=[D2,T3] + * ._directive + * AsyncDirective(D2) + * ._value // user value was TemplateResult + * TemplateInstance(T3) _$dC=[A4,A6,N10,N12] + * ._$parts[] + * AttributePart(A4) _$dC=[D5] + * ._directives[] + * AsyncDirective(D5) + * AttributePart(A6) _$dC=[D7,D8] + * ._directives[] + * AsyncDirective(D7) + * Directive(D8) _$dC=[D9] + * ._directive + * AsyncDirective(D9) + * ChildPart(N10) _$dC=[D11] + * ._directive + * AsyncDirective(D11) + * ._value + * string + * ChildPart(N12) _$dC=[D13,N14,N16] + * ._directive + * AsyncDirective(D13) + * ._value // user value was iterable + * Array + * ChildPart(N14) _$dC=[D15] + * ._value + * string + * ChildPart(N16) _$dC=[D17,T18] + * ._directive + * AsyncDirective(D17) + * ._value // user value was TemplateResult + * TemplateInstance(T18) _$dC=[A19,A21,N25] + * ._$parts[] + * AttributePart(A19) _$dC=[D20] + * ._directives[] + * AsyncDirective(D20) + * AttributePart(A21) _$dC=[22,23] + * ._directives[] + * AsyncDirective(D22) + * Directive(D23) _$dC=[D24] + * ._directive + * AsyncDirective(D24) + * ChildPart(N25) _$dC=[D26] + * ._directive + * AsyncDirective(D26) + * ._value + * string + * + * Example 1: The directive in ChildPart(N12) updates and returns `nothing`. The + * ChildPart will _clear() itself, and so we need to disconnect the "value" of + * the ChildPart (but not its directive). In this case, when `_clear()` calls + * `_$notifyConnectionChanged()`, we don't iterate all of the + * _$disconnectableChildren, rather we do a value-specific disconnection: i.e. + * since the _value was an Array (because an iterable had been + * committed), we iterate the array of ChildParts (N14, N16) and run + * `setConnected` on them (which does recurse down the full tree of + * `_$disconnectableChildren` below it, and also removes N14 and N16 from N12's + * `_$disconnectableChildren`). Once the values have been disconnected, we then + * check whether the ChildPart(N12)'s list of `_$disconnectableChildren` is empty + * (and would remove it from its parent TemplateInstance(T3) if so), but since + * it would still contain its directive D13, it stays in the disconnectable + * tree. + * + * Example 2: In the course of Example 1, `setConnected` will reach + * ChildPart(N16); in this case the entire part is being disconnected, so we + * simply iterate all of N16's `_$disconnectableChildren` (D17,T18) and + * recursively run `setConnected` on them. Note that we only remove children + * from `_$disconnectableChildren` for the top-level values being disconnected + * on a clear; doing this bookkeeping lower in the tree is wasteful since it's + * all being thrown away. + * + * Example 3: If the LitElement containing the entire tree above becomes + * disconnected, it will run `childPart.setConnected()` (which calls + * `childPart._$notifyConnectionChanged()` if it exists); in this case, we + * recursively run `setConnected()` over the entire tree, without removing any + * children from `_$disconnectableChildren`, since this tree is required to + * re-connect the tree, which does the same operation, simply passing + * `isConnected: true` down the tree, signaling which callback to run. + */ /** * An abstract `Directive` base class whose `disconnected` method will be diff --git a/public/third_party/lit/lib/directives.js b/public/third_party/lit/lib/directives.js index f8103f230..e605e7911 100644 --- a/public/third_party/lit/lib/directives.js +++ b/public/third_party/lit/lib/directives.js @@ -3,23 +3,23 @@ * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause */ -const t=globalThis,e=t.trustedTypes,s=e?e.createPolicy("lit-html",{createHTML:t=>t}):void 0,i="$lit$",n=`lit$${(Math.random()+"").slice(9)}$`,r="?"+n,o=`<${r}>`,h=document,l=()=>h.createComment(""),c=t=>null===t||"object"!=typeof t&&"function"!=typeof t,a=Array.isArray,d=t=>a(t)||"function"==typeof t?.[Symbol.iterator],$="[ \t\n\f\r]",u=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,_=/-->/g,A=/>/g,p=RegExp(`>|${$}(?:([^\\s"'>=/]+)(${$}*=${$}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),f=/'/g,v=/"/g,g=/^(?:script|style|textarea|title)$/i,y=Symbol.for("lit-noChange"),m=Symbol.for("lit-nothing"),x=new WeakMap,C=h.createTreeWalker(h,129);function b(t,e){if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==s?s.createHTML(e):e}const w=(t,e)=>{const s=t.length-1,r=[];let h,l=2===e?"":"",c=u;for(let e=0;e"===d[0]?(c=h??u,$=-1):void 0===d[1]?$=-2:($=c.lastIndex-d[2].length,a=d[1],c=void 0===d[3]?p:'"'===d[3]?v:f):c===v||c===f?c=p:c===_||c===A?c=u:(c=p,h=void 0);const m=c===p&&t[e+1].startsWith("/>")?" ":"";l+=c===u?s+o:$>=0?(r.push(a),s.slice(0,$)+i+s.slice($)+n+m):s+n+(-2===$?e:m)}return[b(t,l+(t[s]||"")+(2===e?"":"")),r]};class H{constructor({strings:t,_$litType$:s},o){let h;this.parts=[];let c=0,a=0;const d=t.length-1,$=this.parts,[u,_]=w(t,s);if(this.el=H.createElement(u,o),C.currentNode=this.el.content,2===s){const t=this.el.content.firstChild;t.replaceWith(...t.childNodes)}for(;null!==(h=C.nextNode())&&$.length0){h.textContent=e?e.emptyScript:"";for(let e=0;e2||""!==s[0]||""!==s[1]?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=m}_$AI(t,e=this,s,i){const n=this.strings;let r=!1;if(void 0===n)t=N(this,t,e,0),r=!c(t)||t!==this._$AH&&t!==y,r&&(this._$AH=t);else{const i=t;let o,h;for(t=n[0],o=0;ot}):void 0,i="$lit$",n=`lit$${Math.random().toFixed(9).slice(2)}$`,r="?"+n,o=`<${r}>`,h=document,l=()=>h.createComment(""),c=t=>null===t||"object"!=typeof t&&"function"!=typeof t,a=Array.isArray,d=t=>a(t)||"function"==typeof t?.[Symbol.iterator],$="[ \t\n\f\r]",u=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,_=/-->/g,A=/>/g,f=RegExp(`>|${$}(?:([^\\s"'>=/]+)(${$}*=${$}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),p=/'/g,v=/"/g,g=/^(?:script|style|textarea|title)$/i,y=Symbol.for("lit-noChange"),m=Symbol.for("lit-nothing"),b=new WeakMap,x=h.createTreeWalker(h,129);function C(t,e){if(!a(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==s?s.createHTML(e):e}const w=(t,e)=>{const s=t.length-1,r=[];let h,l=2===e?"":3===e?"":"",c=u;for(let e=0;e"===d[0]?(c=h??u,$=-1):void 0===d[1]?$=-2:($=c.lastIndex-d[2].length,a=d[1],c=void 0===d[3]?f:'"'===d[3]?v:p):c===v||c===p?c=f:c===_||c===A?c=u:(c=f,h=void 0);const m=c===f&&t[e+1].startsWith("/>")?" ":"";l+=c===u?s+o:$>=0?(r.push(a),s.slice(0,$)+i+s.slice($)+n+m):s+n+(-2===$?e:m)}return[C(t,l+(t[s]||"")+(2===e?"":3===e?"":"")),r]};class H{constructor({strings:t,_$litType$:s},o){let h;this.parts=[];let c=0,a=0;const d=t.length-1,$=this.parts,[u,_]=w(t,s);if(this.el=H.createElement(u,o),x.currentNode=this.el.content,2===s||3===s){const t=this.el.content.firstChild;t.replaceWith(...t.childNodes)}for(;null!==(h=x.nextNode())&&$.length0){h.textContent=e?e.emptyScript:"";for(let e=0;e2||""!==s[0]||""!==s[1]?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=m}_$AI(t,e=this,s,i){const n=this.strings;let r=!1;if(void 0===n)t=N(this,t,e,0),r=!c(t)||t!==this._$AH&&t!==y,r&&(this._$AH=t);else{const i=t;let o,h;for(t=n[0],o=0;o(...e)=>({_$litDirective$:t,values:e});class W{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,s){this._$Ct=t,this._$AM=e,this._$Ci=s}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}} +const B=1,O=2,j=3,L=4,D=t=>(...e)=>({_$litDirective$:t,values:e});let R=class{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,s){this._$Ct=t,this._$AM=e,this._$Ci=s}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}}; /** * @license * Copyright 2018 Google LLC * SPDX-License-Identifier: BSD-3-Clause - */const j=R(class extends W{constructor(t){if(super(t),t.type!==B||"class"!==t.name||t.strings?.length>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(t){return" "+Object.keys(t).filter((e=>t[e])).join(" ")+" "}update(t,[e]){if(void 0===this.it){this.it=new Set,void 0!==t.strings&&(this.st=new Set(t.strings.join(" ").split(/\s/).filter((t=>""!==t))));for(const t in e)e[t]&&!this.st?.has(t)&&this.it.add(t);return this.render(e)}const s=t.element.classList;for(const t of this.it)t in e||(s.remove(t),this.it.delete(t));for(const t in e){const i=!!e[t];i===this.it.has(t)||this.st?.has(t)||(i?(s.add(t),this.it.add(t)):(s.remove(t),this.it.delete(t)))}return y}}),V=t=>t??m + */const W=D(class extends R{constructor(t){if(super(t),t.type!==B||"class"!==t.name||t.strings?.length>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(t){return" "+Object.keys(t).filter((e=>t[e])).join(" ")+" "}update(t,[e]){if(void 0===this.st){this.st=new Set,void 0!==t.strings&&(this.nt=new Set(t.strings.join(" ").split(/\s/).filter((t=>""!==t))));for(const t in e)e[t]&&!this.nt?.has(t)&&this.st.add(t);return this.render(e)}const s=t.element.classList;for(const t of this.st)t in e||(s.remove(t),this.st.delete(t));for(const t in e){const i=!!e[t];i===this.st.has(t)||this.nt?.has(t)||(i?(s.add(t),this.st.add(t)):(s.remove(t),this.st.delete(t)))}return y}}),V=t=>t??m /** * @license * Copyright 2020 Google LLC * SPDX-License-Identifier: BSD-3-Clause - */,{D:Z}=I,z=t=>void 0===t.strings,q=()=>document.createComment(""),K=(t,e,s)=>{const i=t._$AA.parentNode,n=void 0===e?t._$AB:e._$AA;if(void 0===s){const e=i.insertBefore(q(),n),r=i.insertBefore(q(),n);s=new Z(e,r,t,t.options)}else{const e=s._$AB.nextSibling,r=s._$AM,o=r!==t;if(o){let e;s._$AQ?.(t),s._$AM=t,void 0!==s._$AP&&(e=t._$AU)!==r._$AU&&s._$AP(e)}if(e!==n||o){let t=s._$AA;for(;t!==e;){const e=t.nextSibling;i.insertBefore(t,n),t=e}}}return s},Y=(t,e,s=t)=>(t._$AI(e,s),t),Q={},F=(t,e=Q)=>t._$AH=e,J=t=>{t._$AP?.(!1,!0);let e=t._$AA;const s=t._$AB.nextSibling;for(;e!==s;){const t=e.nextSibling;e.remove(),e=t}},X=R(class extends W{constructor(t){if(super(t),t.type!==L&&t.type!==B&&t.type!==D)throw Error("The `live` directive is not allowed on child or event bindings");if(!z(t))throw Error("`live` bindings can only contain a single expression")}render(t){return t}update(t,[e]){if(e===y||e===m)return e;const s=t.element,i=t.name;if(t.type===L){if(e===s[i])return y}else if(t.type===D){if(!!e===s.hasAttribute(i))return y}else if(t.type===B&&s.getAttribute(i)===e+"")return y;return F(t),e}}),tt=(t,e,s)=>{const i=new Map;for(let n=e;n<=s;n++)i.set(t[n],n);return i},et=R(class extends W{constructor(t){if(super(t),t.type!==O)throw Error("repeat() can only be used in text expressions")}ht(t,e,s){let i;void 0===s?s=e:void 0!==e&&(i=e);const n=[],r=[];let o=0;for(const e of t)n[o]=i?i(e,o):o,r[o]=s(e,o),o++;return{values:r,keys:n}}render(t,e,s){return this.ht(t,e,s).values}update(t,[e,s,i]){const n=(t=>t._$AH)(t),{values:r,keys:o}=this.ht(e,s,i);if(!Array.isArray(n))return this.dt=o,r;const h=this.dt??=[],l=[];let c,a,d=0,$=n.length-1,u=0,_=r.length-1;for(;d<=$&&u<=_;)if(null===n[d])d++;else if(null===n[$])$--;else if(h[d]===o[u])l[u]=Y(n[d],r[u]),d++,u++;else if(h[$]===o[_])l[_]=Y(n[$],r[_]),$--,_--;else if(h[d]===o[_])l[_]=Y(n[d],r[_]),K(t,l[_+1],n[d]),d++,_--;else if(h[$]===o[u])l[u]=Y(n[$],r[u]),K(t,n[d],n[$]),$--,u++;else if(void 0===c&&(c=tt(o,u,_),a=tt(h,d,$)),c.has(h[d]))if(c.has(h[$])){const e=a.get(o[u]),s=void 0!==e?n[e]:null;if(null===s){const e=K(t,n[d]);Y(e,r[u]),l[u]=e}else l[u]=Y(s,r[u]),K(t,n[d],s),n[e]=null;u++}else J(n[$]),$--;else J(n[d]),d++;for(;u<=_;){const e=K(t,l[_+1]);Y(e,r[u]),l[u++]=e}for(;d<=$;){const t=n[d++];null!==t&&J(t)}return this.dt=o,F(t,l),y}}),st="important",it=" !"+st,nt=R(class extends W{constructor(t){if(super(t),t.type!==B||"style"!==t.name||t.strings?.length>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(t){return Object.keys(t).reduce(((e,s)=>{const i=t[s];return null==i?e:e+`${s=s.includes("-")?s:s.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${i};`}),"")}update(t,[e]){const{style:s}=t.element;if(void 0===this.ut)return this.ut=new Set(Object.keys(e)),this.render(e);for(const t of this.ut)null==e[t]&&(this.ut.delete(t),t.includes("-")?s.removeProperty(t):s[t]=null);for(const t in e){const i=e[t];if(null!=i){this.ut.add(t);const e="string"==typeof i&&i.endsWith(it);t.includes("-")||e?s.setProperty(t,e?i.slice(0,-11):i,e?st:""):s[t]=i}}return y}}); + */,{I:Z}=k,z=t=>void 0===t.strings,q=()=>document.createComment(""),K=(t,e,s)=>{const i=t._$AA.parentNode,n=void 0===e?t._$AB:e._$AA;if(void 0===s){const e=i.insertBefore(q(),n),r=i.insertBefore(q(),n);s=new Z(e,r,t,t.options)}else{const e=s._$AB.nextSibling,r=s._$AM,o=r!==t;if(o){let e;s._$AQ?.(t),s._$AM=t,void 0!==s._$AP&&(e=t._$AU)!==r._$AU&&s._$AP(e)}if(e!==n||o){let t=s._$AA;for(;t!==e;){const e=t.nextSibling;i.insertBefore(t,n),t=e}}}return s},X=(t,e,s=t)=>(t._$AI(e,s),t),F={},Q=(t,e=F)=>t._$AH=e,G=t=>{t._$AP?.(!1,!0);let e=t._$AA;const s=t._$AB.nextSibling;for(;e!==s;){const t=e.nextSibling;e.remove(),e=t}},J=D(class extends R{constructor(t){if(super(t),t.type!==j&&t.type!==B&&t.type!==L)throw Error("The `live` directive is not allowed on child or event bindings");if(!z(t))throw Error("`live` bindings can only contain a single expression")}render(t){return t}update(t,[e]){if(e===y||e===m)return e;const s=t.element,i=t.name;if(t.type===j){if(e===s[i])return y}else if(t.type===L){if(!!e===s.hasAttribute(i))return y}else if(t.type===B&&s.getAttribute(i)===e+"")return y;return Q(t),e}}),tt=(t,e,s)=>{const i=new Map;for(let n=e;n<=s;n++)i.set(t[n],n);return i},et=D(class extends R{constructor(t){if(super(t),t.type!==O)throw Error("repeat() can only be used in text expressions")}dt(t,e,s){let i;void 0===s?s=e:void 0!==e&&(i=e);const n=[],r=[];let o=0;for(const e of t)n[o]=i?i(e,o):o,r[o]=s(e,o),o++;return{values:r,keys:n}}render(t,e,s){return this.dt(t,e,s).values}update(t,[e,s,i]){const n=(t=>t._$AH)(t),{values:r,keys:o}=this.dt(e,s,i);if(!Array.isArray(n))return this.ut=o,r;const h=this.ut??=[],l=[];let c,a,d=0,$=n.length-1,u=0,_=r.length-1;for(;d<=$&&u<=_;)if(null===n[d])d++;else if(null===n[$])$--;else if(h[d]===o[u])l[u]=X(n[d],r[u]),d++,u++;else if(h[$]===o[_])l[_]=X(n[$],r[_]),$--,_--;else if(h[d]===o[_])l[_]=X(n[d],r[_]),K(t,l[_+1],n[d]),d++,_--;else if(h[$]===o[u])l[u]=X(n[$],r[u]),K(t,n[d],n[$]),$--,u++;else if(void 0===c&&(c=tt(o,u,_),a=tt(h,d,$)),c.has(h[d]))if(c.has(h[$])){const e=a.get(o[u]),s=void 0!==e?n[e]:null;if(null===s){const e=K(t,n[d]);X(e,r[u]),l[u]=e}else l[u]=X(s,r[u]),K(t,n[d],s),n[e]=null;u++}else G(n[$]),$--;else G(n[d]),d++;for(;u<=_;){const e=K(t,l[_+1]);X(e,r[u]),l[u++]=e}for(;d<=$;){const t=n[d++];null!==t&&G(t)}return this.ut=o,Q(t,l),y}}),st="important",it=" !"+st,nt=D(class extends R{constructor(t){if(super(t),t.type!==B||"style"!==t.name||t.strings?.length>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(t){return Object.keys(t).reduce(((e,s)=>{const i=t[s];return null==i?e:e+`${s=s.includes("-")?s:s.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${i};`}),"")}update(t,[e]){const{style:s}=t.element;if(void 0===this.ft)return this.ft=new Set(Object.keys(e)),this.render(e);for(const t of this.ft)null==e[t]&&(this.ft.delete(t),t.includes("-")?s.removeProperty(t):s[t]=null);for(const t in e){const i=e[t];if(null!=i){this.ft.add(t);const e="string"==typeof i&&i.endsWith(it);t.includes("-")||e?s.setProperty(t,e?i.slice(0,-11):i,e?st:""):s[t]=i}}return y}}); /** * @license * Copyright 2018 Google LLC @@ -30,25 +30,25 @@ const B=1,O=2,L=3,D=4,R=t=>(...e)=>({_$litDirective$:t,values:e});class W{constr * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause */ -class rt extends W{constructor(t){if(super(t),this.et=m,t.type!==O)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(t){if(t===m||null==t)return this.vt=void 0,this.et=t;if(t===y)return t;if("string"!=typeof t)throw Error(this.constructor.directiveName+"() called with a non-string value");if(t===this.et)return this.vt;this.et=t;const e=[t];return e.raw=e,this.vt={_$litType$:this.constructor.resultType,strings:e,values:[]}}}rt.directiveName="unsafeHTML",rt.resultType=1;const ot=R(rt),ht=(t,e)=>{const s=t._$AN;if(void 0===s)return!1;for(const t of s)t._$AO?.(e,!1),ht(t,e);return!0},lt=t=>{let e,s;do{if(void 0===(e=t._$AM))break;s=e._$AN,s.delete(t),t=e}while(0===s?.size)},ct=t=>{for(let e;e=t._$AM;t=e){let s=e._$AN;if(void 0===s)e._$AN=s=new Set;else if(s.has(t))break;s.add(t),$t(e)}}; +let rt=class extends R{constructor(t){if(super(t),this.it=m,t.type!==O)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(t){if(t===m||null==t)return this._t=void 0,this.it=t;if(t===y)return t;if("string"!=typeof t)throw Error(this.constructor.directiveName+"() called with a non-string value");if(t===this.it)return this._t;this.it=t;const e=[t];return e.raw=e,this._t={_$litType$:this.constructor.resultType,strings:e,values:[]}}};rt.directiveName="unsafeHTML",rt.resultType=1;const ot=D(rt),ht=(t,e)=>{const s=t._$AN;if(void 0===s)return!1;for(const t of s)t._$AO?.(e,!1),ht(t,e);return!0},lt=t=>{let e,s;do{if(void 0===(e=t._$AM))break;s=e._$AN,s.delete(t),t=e}while(0===s?.size)},ct=t=>{for(let e;e=t._$AM;t=e){let s=e._$AN;if(void 0===s)e._$AN=s=new Set;else if(s.has(t))break;s.add(t),$t(e)}}; /** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause - */function at(t){void 0!==this._$AN?(lt(this),this._$AM=t,ct(this)):this._$AM=t}function dt(t,e=!1,s=0){const i=this._$AH,n=this._$AN;if(void 0!==n&&0!==n.size)if(e)if(Array.isArray(i))for(let t=s;t{t.type==O&&(t._$AP??=dt,t._$AQ??=at)};class ut extends W{constructor(){super(...arguments),this._$AN=void 0}_$AT(t,e,s){super._$AT(t,e,s),ct(this),this.isConnected=t._$AU}_$AO(t,e=!0){t!==this.isConnected&&(this.isConnected=t,t?this.reconnected?.():this.disconnected?.()),e&&(ht(this,t),lt(this))}setValue(t){if(z(this._$Ct))this._$Ct._$AI(t,this);else{const e=[...this._$Ct._$AH];e[this._$Ci]=t,this._$Ct._$AI(e,this,0)}}disconnected(){}reconnected(){}} + */function at(t){void 0!==this._$AN?(lt(this),this._$AM=t,ct(this)):this._$AM=t}function dt(t,e=!1,s=0){const i=this._$AH,n=this._$AN;if(void 0!==n&&0!==n.size)if(e)if(Array.isArray(i))for(let t=s;t{t.type==O&&(t._$AP??=dt,t._$AQ??=at)};class ut extends R{constructor(){super(...arguments),this._$AN=void 0}_$AT(t,e,s){super._$AT(t,e,s),ct(this),this.isConnected=t._$AU}_$AO(t,e=!0){t!==this.isConnected&&(this.isConnected=t,t?this.reconnected?.():this.disconnected?.()),e&&(ht(this,t),lt(this))}setValue(t){if(z(this._$Ct))this._$Ct._$AI(t,this);else{const e=[...this._$Ct._$AH];e[this._$Ci]=t,this._$Ct._$AI(e,this,0)}}disconnected(){}reconnected(){}} /** * @license * Copyright 2021 Google LLC * SPDX-License-Identifier: BSD-3-Clause - */class _t{constructor(t){this.G=t}disconnect(){this.G=void 0}reconnect(t){this.G=t}deref(){return this.G}}class At{constructor(){this.Y=void 0,this.Z=void 0}get(){return this.Y}pause(){this.Y??=new Promise((t=>this.Z=t))}resume(){this.Z?.(),this.Y=this.Z=void 0}} + */class _t{constructor(t){this.Y=t}disconnect(){this.Y=void 0}reconnect(t){this.Y=t}deref(){return this.Y}}class At{constructor(){this.Z=void 0,this.q=void 0}get(){return this.Z}pause(){this.Z??=new Promise((t=>this.q=t))}resume(){this.q?.(),this.Z=this.q=void 0}} /** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause - */const pt=t=>!(t=>null===t||"object"!=typeof t&&"function"!=typeof t)(t)&&"function"==typeof t.then,ft=1073741823;class vt extends ut{constructor(){super(...arguments),this._$C_t=ft,this._$Cwt=[],this._$Cq=new _t(this),this._$CK=new At}render(...t){return t.find((t=>!pt(t)))??y}update(t,e){const s=this._$Cwt;let i=s.length;this._$Cwt=e;const n=this._$Cq,r=this._$CK;this.isConnected||this.disconnected();for(let t=0;tthis._$C_t);t++){const o=e[t];if(!pt(o))return this._$C_t=t,o;t{for(;r.get();)await r.get();const e=n.deref();if(void 0!==e){const s=e._$Cwt.indexOf(o);s>-1&&snew mt; + */const ft=t=>!(t=>null===t||"object"!=typeof t&&"function"!=typeof t)(t)&&"function"==typeof t.then,pt=1073741823;class vt extends ut{constructor(){super(...arguments),this._$Cwt=pt,this._$Cbt=[],this._$CK=new _t(this),this._$CX=new At}render(...t){return t.find((t=>!ft(t)))??y}update(t,e){const s=this._$Cbt;let i=s.length;this._$Cbt=e;const n=this._$CK,r=this._$CX;this.isConnected||this.disconnected();for(let t=0;tthis._$Cwt);t++){const o=e[t];if(!ft(o))return this._$Cwt=t,o;t{for(;r.get();)await r.get();const e=n.deref();if(void 0!==e){const s=e._$Cbt.indexOf(o);s>-1&&snew mt; /** * @license * Copyright 2020 Google LLC * SPDX-License-Identifier: BSD-3-Clause - */class mt{}const xt=new WeakMap,Ct=R(class extends ut{render(t){return m}update(t,[e]){const s=e!==this.G;return s&&void 0!==this.G&&this.ot(void 0),(s||this.rt!==this.lt)&&(this.G=e,this.ct=t.options?.host,this.ot(this.lt=t.element)),m}ot(t){if("function"==typeof this.G){const e=this.ct??globalThis;let s=xt.get(e);void 0===s&&(s=new WeakMap,xt.set(e,s)),void 0!==s.get(this.G)&&this.G.call(this.ct,void 0),s.set(this.G,t),void 0!==t&&this.G.call(this.ct,t)}else this.G.value=t}get rt(){return"function"==typeof this.G?xt.get(this.ct??globalThis)?.get(this.G):this.G?.value}disconnected(){this.rt===this.lt&&this.ot(void 0)}reconnected(){this.ot(this.lt)}});export{rt as UnsafeHTMLDirective,vt as UntilDirective,j as classMap,yt as createRef,V as ifDefined,X as live,Ct as ref,et as repeat,nt as styleMap,ot as unsafeHTML,gt as until}; + */class mt{}const bt=new WeakMap,xt=D(class extends ut{render(t){return m}update(t,[e]){const s=e!==this.Y;return s&&void 0!==this.Y&&this.rt(void 0),(s||this.lt!==this.ct)&&(this.Y=e,this.ht=t.options?.host,this.rt(this.ct=t.element)),m}rt(t){if(this.isConnected||(t=void 0),"function"==typeof this.Y){const e=this.ht??globalThis;let s=bt.get(e);void 0===s&&(s=new WeakMap,bt.set(e,s)),void 0!==s.get(this.Y)&&this.Y.call(this.ht,void 0),s.set(this.Y,t),void 0!==t&&this.Y.call(this.ht,t)}else this.Y.value=t}get lt(){return"function"==typeof this.Y?bt.get(this.ht??globalThis)?.get(this.Y):this.Y?.value}disconnected(){this.lt===this.ct&&this.rt(void 0)}reconnected(){this.rt(this.ct)}});export{rt as UnsafeHTMLDirective,vt as UntilDirective,W as classMap,yt as createRef,V as ifDefined,J as live,xt as ref,et as repeat,nt as styleMap,ot as unsafeHTML,gt as until}; //# sourceMappingURL=directives.js.map diff --git a/public/third_party/lit/lib/directives.js.map b/public/third_party/lit/lib/directives.js.map index b978cad29..db3b49665 100644 --- a/public/third_party/lit/lib/directives.js.map +++ b/public/third_party/lit/lib/directives.js.map @@ -1 +1 @@ -{"version":3,"file":"directives.js","sources":["../node_modules/lit-html/lit-html.js","../node_modules/lit-html/directive.js","../node_modules/lit-html/directives/class-map.js","../node_modules/lit-html/directives/if-defined.js","../node_modules/lit-html/directive-helpers.js","../node_modules/lit-html/directives/live.js","../node_modules/lit-html/directives/repeat.js","../node_modules/lit-html/directives/style-map.js","../node_modules/lit-html/directives/unsafe-html.js","../node_modules/lit-html/async-directive.js","../node_modules/lit-html/directives/private-async-helpers.js","../node_modules/lit-html/directives/until.js","../node_modules/lit-html/directives/ref.js"],"sourcesContent":["/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\nconst t=globalThis,i=t.trustedTypes,s=i?i.createPolicy(\"lit-html\",{createHTML:t=>t}):void 0,e=\"$lit$\",h=`lit$${(Math.random()+\"\").slice(9)}$`,o=\"?\"+h,n=`<${o}>`,r=document,l=()=>r.createComment(\"\"),c=t=>null===t||\"object\"!=typeof t&&\"function\"!=typeof t,a=Array.isArray,u=t=>a(t)||\"function\"==typeof t?.[Symbol.iterator],d=\"[ \\t\\n\\f\\r]\",f=/<(?:(!--|\\/[^a-zA-Z])|(\\/?[a-zA-Z][^>\\s]*)|(\\/?$))/g,v=/-->/g,_=/>/g,m=RegExp(`>|${d}(?:([^\\\\s\"'>=/]+)(${d}*=${d}*(?:[^ \\t\\n\\f\\r\"'\\`<>=]|(\"|')|))|$)`,\"g\"),p=/'/g,g=/\"/g,$=/^(?:script|style|textarea|title)$/i,y=t=>(i,...s)=>({_$litType$:t,strings:i,values:s}),x=y(1),b=y(2),w=Symbol.for(\"lit-noChange\"),T=Symbol.for(\"lit-nothing\"),A=new WeakMap,E=r.createTreeWalker(r,129);function C(t,i){if(!Array.isArray(t)||!t.hasOwnProperty(\"raw\"))throw Error(\"invalid template strings array\");return void 0!==s?s.createHTML(i):i}const P=(t,i)=>{const s=t.length-1,o=[];let r,l=2===i?\"\":\"\",c=f;for(let i=0;i\"===u[0]?(c=r??f,d=-1):void 0===u[1]?d=-2:(d=c.lastIndex-u[2].length,a=u[1],c=void 0===u[3]?m:'\"'===u[3]?g:p):c===g||c===p?c=m:c===v||c===_?c=f:(c=m,r=void 0);const x=c===m&&t[i+1].startsWith(\"/>\")?\" \":\"\";l+=c===f?s+n:d>=0?(o.push(a),s.slice(0,d)+e+s.slice(d)+h+x):s+h+(-2===d?i:x)}return[C(t,l+(t[s]||\"\")+(2===i?\"\":\"\")),o]};class V{constructor({strings:t,_$litType$:s},n){let r;this.parts=[];let c=0,a=0;const u=t.length-1,d=this.parts,[f,v]=P(t,s);if(this.el=V.createElement(f,n),E.currentNode=this.el.content,2===s){const t=this.el.content.firstChild;t.replaceWith(...t.childNodes)}for(;null!==(r=E.nextNode())&&d.length0){r.textContent=i?i.emptyScript:\"\";for(let i=0;i2||\"\"!==s[0]||\"\"!==s[1]?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=T}_$AI(t,i=this,s,e){const h=this.strings;let o=!1;if(void 0===h)t=N(this,t,i,0),o=!c(t)||t!==this._$AH&&t!==w,o&&(this._$AH=t);else{const e=t;let n,r;for(t=h[0],n=0;n{const e=s?.renderBefore??i;let h=e._$litPart$;if(void 0===h){const t=s?.renderBefore??null;e._$litPart$=h=new M(i.insertBefore(l(),t),t,void 0,s??{})}return h._$AI(t),h};export{z as _$LH,x as html,w as noChange,T as nothing,j as render,b as svg};\n//# sourceMappingURL=lit-html.js.map\n","/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\nconst t={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},e=t=>(...e)=>({_$litDirective$:t,values:e});class i{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,i){this._$Ct=t,this._$AM=e,this._$Ci=i}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}}export{i as Directive,t as PartType,e as directive};\n//# sourceMappingURL=directive.js.map\n","import{noChange as t}from\"../lit-html.js\";import{directive as s,Directive as i,PartType as r}from\"../directive.js\";\n/**\n * @license\n * Copyright 2018 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */const e=s(class extends i{constructor(t){if(super(t),t.type!==r.ATTRIBUTE||\"class\"!==t.name||t.strings?.length>2)throw Error(\"`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.\")}render(t){return\" \"+Object.keys(t).filter((s=>t[s])).join(\" \")+\" \"}update(s,[i]){if(void 0===this.it){this.it=new Set,void 0!==s.strings&&(this.st=new Set(s.strings.join(\" \").split(/\\s/).filter((t=>\"\"!==t))));for(const t in i)i[t]&&!this.st?.has(t)&&this.it.add(t);return this.render(i)}const r=s.element.classList;for(const t of this.it)t in i||(r.remove(t),this.it.delete(t));for(const t in i){const s=!!i[t];s===this.it.has(t)||this.st?.has(t)||(s?(r.add(t),this.it.add(t)):(r.remove(t),this.it.delete(t)))}return t}});export{e as classMap};\n//# sourceMappingURL=class-map.js.map\n","import{nothing as t}from\"../lit-html.js\";\n/**\n * @license\n * Copyright 2018 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */const o=o=>o??t;export{o as ifDefined};\n//# sourceMappingURL=if-defined.js.map\n","import{_$LH as o}from\"./lit-html.js\";\n/**\n * @license\n * Copyright 2020 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */const{D:t}=o,i=o=>null===o||\"object\"!=typeof o&&\"function\"!=typeof o,n={HTML:1,SVG:2},e=(o,t)=>void 0===t?void 0!==o?._$litType$:o?._$litType$===t,l=o=>null!=o?._$litType$?.h,c=o=>void 0!==o?._$litDirective$,d=o=>o?._$litDirective$,f=o=>void 0===o.strings,s=()=>document.createComment(\"\"),r=(o,i,n)=>{const e=o._$AA.parentNode,l=void 0===i?o._$AB:i._$AA;if(void 0===n){const i=e.insertBefore(s(),l),c=e.insertBefore(s(),l);n=new t(i,c,o,o.options)}else{const t=n._$AB.nextSibling,i=n._$AM,c=i!==o;if(c){let t;n._$AQ?.(o),n._$AM=o,void 0!==n._$AP&&(t=o._$AU)!==i._$AU&&n._$AP(t)}if(t!==l||c){let o=n._$AA;for(;o!==t;){const t=o.nextSibling;e.insertBefore(o,l),o=t}}}return n},v=(o,t,i=o)=>(o._$AI(t,i),o),u={},m=(o,t=u)=>o._$AH=t,p=o=>o._$AH,h=o=>{o._$AP?.(!1,!0);let t=o._$AA;const i=o._$AB.nextSibling;for(;t!==i;){const o=t.nextSibling;t.remove(),t=o}},j=o=>{o._$AR()};export{n as TemplateResultType,j as clearPart,p as getCommittedValue,d as getDirectiveClass,r as insertPart,l as isCompiledTemplateResult,c as isDirectiveResult,i as isPrimitive,f as isSingleExpression,e as isTemplateResult,h as removePart,v as setChildPartValue,m as setCommittedValue};\n//# sourceMappingURL=directive-helpers.js.map\n","import{noChange as r,nothing as e}from\"../lit-html.js\";import{directive as i,Directive as t,PartType as n}from\"../directive.js\";import{isSingleExpression as o,setCommittedValue as s}from\"../directive-helpers.js\";\n/**\n * @license\n * Copyright 2020 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */const l=i(class extends t{constructor(r){if(super(r),r.type!==n.PROPERTY&&r.type!==n.ATTRIBUTE&&r.type!==n.BOOLEAN_ATTRIBUTE)throw Error(\"The `live` directive is not allowed on child or event bindings\");if(!o(r))throw Error(\"`live` bindings can only contain a single expression\")}render(r){return r}update(i,[t]){if(t===r||t===e)return t;const o=i.element,l=i.name;if(i.type===n.PROPERTY){if(t===o[l])return r}else if(i.type===n.BOOLEAN_ATTRIBUTE){if(!!t===o.hasAttribute(l))return r}else if(i.type===n.ATTRIBUTE&&o.getAttribute(l)===t+\"\")return r;return s(i),t}});export{l as live};\n//# sourceMappingURL=live.js.map\n","import{noChange as e}from\"../lit-html.js\";import{directive as s,Directive as t,PartType as r}from\"../directive.js\";import{getCommittedValue as l,setChildPartValue as o,insertPart as i,removePart as n,setCommittedValue as f}from\"../directive-helpers.js\";\n/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\nconst u=(e,s,t)=>{const r=new Map;for(let l=s;l<=t;l++)r.set(e[l],l);return r},c=s(class extends t{constructor(e){if(super(e),e.type!==r.CHILD)throw Error(\"repeat() can only be used in text expressions\")}ht(e,s,t){let r;void 0===t?t=s:void 0!==s&&(r=s);const l=[],o=[];let i=0;for(const s of e)l[i]=r?r(s,i):i,o[i]=t(s,i),i++;return{values:o,keys:l}}render(e,s,t){return this.ht(e,s,t).values}update(s,[t,r,c]){const d=l(s),{values:p,keys:a}=this.ht(t,r,c);if(!Array.isArray(d))return this.dt=a,p;const h=this.dt??=[],v=[];let m,y,x=0,j=d.length-1,k=0,w=p.length-1;for(;x<=j&&k<=w;)if(null===d[x])x++;else if(null===d[j])j--;else if(h[x]===a[k])v[k]=o(d[x],p[k]),x++,k++;else if(h[j]===a[w])v[w]=o(d[j],p[w]),j--,w--;else if(h[x]===a[w])v[w]=o(d[x],p[w]),i(s,v[w+1],d[x]),x++,w--;else if(h[j]===a[k])v[k]=o(d[j],p[k]),i(s,d[x],d[j]),j--,k++;else if(void 0===m&&(m=u(a,k,w),y=u(h,x,j)),m.has(h[x]))if(m.has(h[j])){const e=y.get(a[k]),t=void 0!==e?d[e]:null;if(null===t){const e=i(s,d[x]);o(e,p[k]),v[k]=e}else v[k]=o(t,p[k]),i(s,d[x],t),d[e]=null;k++}else n(d[j]),j--;else n(d[x]),x++;for(;k<=w;){const e=i(s,v[w+1]);o(e,p[k]),v[k++]=e}for(;x<=j;){const e=d[x++];null!==e&&n(e)}return this.dt=a,f(s,v),e}});export{c as repeat};\n//# sourceMappingURL=repeat.js.map\n","import{noChange as t}from\"../lit-html.js\";import{directive as e,Directive as r,PartType as s}from\"../directive.js\";\n/**\n * @license\n * Copyright 2018 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */const n=\"important\",i=\" !\"+n,o=e(class extends r{constructor(t){if(super(t),t.type!==s.ATTRIBUTE||\"style\"!==t.name||t.strings?.length>2)throw Error(\"The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.\")}render(t){return Object.keys(t).reduce(((e,r)=>{const s=t[r];return null==s?e:e+`${r=r.includes(\"-\")?r:r.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,\"-$&\").toLowerCase()}:${s};`}),\"\")}update(e,[r]){const{style:s}=e.element;if(void 0===this.ut)return this.ut=new Set(Object.keys(r)),this.render(r);for(const t of this.ut)null==r[t]&&(this.ut.delete(t),t.includes(\"-\")?s.removeProperty(t):s[t]=null);for(const t in r){const e=r[t];if(null!=e){this.ut.add(t);const r=\"string\"==typeof e&&e.endsWith(i);t.includes(\"-\")||r?s.setProperty(t,r?e.slice(0,-11):e,r?n:\"\"):s[t]=e}}return t}});export{o as styleMap};\n//# sourceMappingURL=style-map.js.map\n","import{nothing as t,noChange as i}from\"../lit-html.js\";import{Directive as r,PartType as s,directive as n}from\"../directive.js\";\n/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */class e extends r{constructor(i){if(super(i),this.et=t,i.type!==s.CHILD)throw Error(this.constructor.directiveName+\"() can only be used in child bindings\")}render(r){if(r===t||null==r)return this.vt=void 0,this.et=r;if(r===i)return r;if(\"string\"!=typeof r)throw Error(this.constructor.directiveName+\"() called with a non-string value\");if(r===this.et)return this.vt;this.et=r;const s=[r];return s.raw=s,this.vt={_$litType$:this.constructor.resultType,strings:s,values:[]}}}e.directiveName=\"unsafeHTML\",e.resultType=1;const o=n(e);export{e as UnsafeHTMLDirective,o as unsafeHTML};\n//# sourceMappingURL=unsafe-html.js.map\n","import{isSingleExpression as i}from\"./directive-helpers.js\";import{Directive as t,PartType as e}from\"./directive.js\";export{Directive,PartType,directive}from\"./directive.js\";\n/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */const s=(i,t)=>{const e=i._$AN;if(void 0===e)return!1;for(const i of e)i._$AO?.(t,!1),s(i,t);return!0},o=i=>{let t,e;do{if(void 0===(t=i._$AM))break;e=t._$AN,e.delete(i),i=t}while(0===e?.size)},r=i=>{for(let t;t=i._$AM;i=t){let e=t._$AN;if(void 0===e)t._$AN=e=new Set;else if(e.has(i))break;e.add(i),c(t)}};function h(i){void 0!==this._$AN?(o(this),this._$AM=i,r(this)):this._$AM=i}function n(i,t=!1,e=0){const r=this._$AH,h=this._$AN;if(void 0!==h&&0!==h.size)if(t)if(Array.isArray(r))for(let i=e;i{i.type==e.CHILD&&(i._$AP??=n,i._$AQ??=h)};class f extends t{constructor(){super(...arguments),this._$AN=void 0}_$AT(i,t,e){super._$AT(i,t,e),r(this),this.isConnected=i._$AU}_$AO(i,t=!0){i!==this.isConnected&&(this.isConnected=i,i?this.reconnected?.():this.disconnected?.()),t&&(s(this,i),o(this))}setValue(t){if(i(this._$Ct))this._$Ct._$AI(t,this);else{const i=[...this._$Ct._$AH];i[this._$Ci]=t,this._$Ct._$AI(i,this,0)}}disconnected(){}reconnected(){}}export{f as AsyncDirective};\n//# sourceMappingURL=async-directive.js.map\n","/**\n * @license\n * Copyright 2021 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\nconst t=async(t,s)=>{for await(const i of t)if(!1===await s(i))return};class s{constructor(t){this.G=t}disconnect(){this.G=void 0}reconnect(t){this.G=t}deref(){return this.G}}class i{constructor(){this.Y=void 0,this.Z=void 0}get(){return this.Y}pause(){this.Y??=new Promise((t=>this.Z=t))}resume(){this.Z?.(),this.Y=this.Z=void 0}}export{i as Pauser,s as PseudoWeakRef,t as forAwaitOf};\n//# sourceMappingURL=private-async-helpers.js.map\n","import{noChange as t}from\"../lit-html.js\";import{isPrimitive as s}from\"../directive-helpers.js\";import{AsyncDirective as i}from\"../async-directive.js\";import{PseudoWeakRef as e,Pauser as r}from\"./private-async-helpers.js\";import{directive as o}from\"../directive.js\";\n/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */const n=t=>!s(t)&&\"function\"==typeof t.then,h=1073741823;class c extends i{constructor(){super(...arguments),this._$C_t=h,this._$Cwt=[],this._$Cq=new e(this),this._$CK=new r}render(...s){return s.find((t=>!n(t)))??t}update(s,i){const e=this._$Cwt;let r=e.length;this._$Cwt=i;const o=this._$Cq,c=this._$CK;this.isConnected||this.disconnected();for(let t=0;tthis._$C_t);t++){const s=i[t];if(!n(s))return this._$C_t=t,s;t{for(;c.get();)await c.get();const i=o.deref();if(void 0!==i){const e=i._$Cwt.indexOf(s);e>-1&&enew h;class h{}const o=new WeakMap,n=s(class extends i{render(i){return t}update(i,[s]){const e=s!==this.G;return e&&void 0!==this.G&&this.ot(void 0),(e||this.rt!==this.lt)&&(this.G=s,this.ct=i.options?.host,this.ot(this.lt=i.element)),t}ot(t){if(\"function\"==typeof this.G){const i=this.ct??globalThis;let s=o.get(i);void 0===s&&(s=new WeakMap,o.set(i,s)),void 0!==s.get(this.G)&&this.G.call(this.ct,void 0),s.set(this.G,t),void 0!==t&&this.G.call(this.ct,t)}else this.G.value=t}get rt(){return\"function\"==typeof this.G?o.get(this.ct??globalThis)?.get(this.G):this.G?.value}disconnected(){this.rt===this.lt&&this.ot(void 0)}reconnected(){this.ot(this.lt)}});export{e as createRef,n as ref};\n//# sourceMappingURL=ref.js.map\n"],"names":["t","globalThis","i","trustedTypes","s","createPolicy","createHTML","e","h","Math","random","slice","o","n","r","document","l","createComment","c","a","Array","isArray","u","Symbol","iterator","d","f","v","_","m","RegExp","p","g","$","w","for","T","A","WeakMap","E","createTreeWalker","C","hasOwnProperty","Error","P","length","y","lastIndex","exec","test","x","startsWith","push","V","constructor","strings","_$litType$","this","parts","el","createElement","currentNode","content","firstChild","replaceWith","childNodes","nextNode","nodeType","hasAttributes","getAttributeNames","endsWith","getAttribute","split","type","index","name","ctor","k","H","I","R","removeAttribute","tagName","textContent","emptyScript","append","data","indexOf","innerHTML","N","_$Co","_$Cl","_$litDirective$","_$AO","_$AT","_$AS","values","S","_$AV","_$AN","_$AD","_$AM","parentNode","_$AU","creationScope","importNode","M","nextSibling","L","_$AI","_$Cv","_$AH","_$AA","_$AB","options","isConnected","startNode","endNode","_$AR","insertBefore","createTextNode","_$AC","get","set","_$AP","remove","setConnected","element","fill","String","O","setAttribute","super","arguments","toggleAttribute","capture","once","passive","removeEventListener","addEventListener","handleEvent","call","host","z","j","D","U","B","Z","litHtmlPolyfillSupport","litHtmlVersions","_$Ct","_$Ci","update","render","Object","keys","filter","join","it","Set","st","has","add","classList","delete","_$AQ","hasAttribute","Map","ht","dt","reduce","includes","replace","toLowerCase","style","ut","removeProperty","setProperty","et","directiveName","vt","raw","resultType","size","reconnected","disconnected","setValue","G","disconnect","reconnect","deref","Y","pause","Promise","resume","then","_$C_t","_$Cwt","_$Cq","_$CK","find","resolve","async","ot","rt","lt","ct","value"],"mappings":";;;;;AAKK,MAACA,EAAEC,WAAWC,EAAEF,EAAEG,aAAaC,EAAEF,EAAEA,EAAEG,aAAa,WAAW,CAACC,WAAWN,GAAGA,SAAI,EAAOO,EAAE,QAAQC,EAAE,QAAQC,KAAKC,SAAS,IAAIC,MAAM,MAAMC,EAAE,IAAIJ,EAAEK,EAAE,IAAID,KAAKE,EAAEC,SAASC,EAAE,IAAIF,EAAEG,cAAc,IAAIC,EAAElB,GAAG,OAAOA,GAAG,iBAAiBA,GAAG,mBAAmBA,EAAEmB,EAAEC,MAAMC,QAAQC,EAAEtB,GAAGmB,EAAEnB,IAAI,mBAAmBA,IAAIuB,OAAOC,UAAUC,EAAE,cAAcC,EAAE,sDAAsDC,EAAE,OAAOC,EAAE,KAA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,GAAGnI,KAAKmJ,QAAG,IAASrM,GAAGkD,KAAKoJ,KAAKpJ,KAAKqJ,MAAMrJ,KAAKmI,EAAExL,EAAEqD,KAAKsJ,GAAG7M,EAAEgH,SAAS4B,KAAKrF,KAAKmJ,GAAGnJ,KAAKqJ,GAAG5M,EAAE6H,UAAU/H,CAAC,CAAC,EAAA4M,CAAG5M,GAAG,GAAG,mBAAmByD,KAAKmI,EAAE,CAAC,MAAM1L,EAAEuD,KAAKsJ,IAAI9M,WAAW,IAAIG,EAAEQ,GAAE8G,IAAIxH,QAAG,IAASE,IAAIA,EAAE,IAAIkC,QAAQ1B,GAAE+G,IAAIzH,EAAEE,SAAI,IAASA,EAAEsH,IAAIjE,KAAKmI,IAAInI,KAAKmI,EAAE/C,KAAKpF,KAAKsJ,QAAG,GAAQ3M,EAAEuH,IAAIlE,KAAKmI,EAAE5L,QAAG,IAASA,GAAGyD,KAAKmI,EAAE/C,KAAKpF,KAAKsJ,GAAG/M,EAAE,MAAMyD,KAAKmI,EAAEoB,MAAMhN,CAAC,CAAC,MAAI6M,GAAK,MAAM,mBAAmBpJ,KAAKmI,EAAEhL,GAAE8G,IAAIjE,KAAKsJ,IAAI9M,aAAayH,IAAIjE,KAAKmI,GAAGnI,KAAKmI,GAAGoB,KAAK,CAAC,YAAAtB,GAAejI,KAAKoJ,KAAKpJ,KAAKqJ,IAAIrJ,KAAKmJ,QAAG,EAAO,CAAC,WAAAnB,GAAchI,KAAKmJ,GAAGnJ,KAAKqJ,GAAG"} \ No newline at end of file +{"version":3,"file":"directives.js","sources":["../node_modules/lit-html/lit-html.js","../node_modules/lit-html/directive.js","../node_modules/lit-html/directives/class-map.js","../node_modules/lit-html/directives/if-defined.js","../node_modules/lit-html/directive-helpers.js","../node_modules/lit-html/directives/live.js","../node_modules/lit-html/directives/repeat.js","../node_modules/lit-html/directives/style-map.js","../node_modules/lit-html/directives/unsafe-html.js","../node_modules/lit-html/async-directive.js","../node_modules/lit-html/directives/private-async-helpers.js","../node_modules/lit-html/directives/until.js","../node_modules/lit-html/directives/ref.js"],"sourcesContent":["/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\nconst t=globalThis,i=t.trustedTypes,s=i?i.createPolicy(\"lit-html\",{createHTML:t=>t}):void 0,e=\"$lit$\",h=`lit$${Math.random().toFixed(9).slice(2)}$`,o=\"?\"+h,n=`<${o}>`,r=document,l=()=>r.createComment(\"\"),c=t=>null===t||\"object\"!=typeof t&&\"function\"!=typeof t,a=Array.isArray,u=t=>a(t)||\"function\"==typeof t?.[Symbol.iterator],d=\"[ \\t\\n\\f\\r]\",f=/<(?:(!--|\\/[^a-zA-Z])|(\\/?[a-zA-Z][^>\\s]*)|(\\/?$))/g,v=/-->/g,_=/>/g,m=RegExp(`>|${d}(?:([^\\\\s\"'>=/]+)(${d}*=${d}*(?:[^ \\t\\n\\f\\r\"'\\`<>=]|(\"|')|))|$)`,\"g\"),p=/'/g,g=/\"/g,$=/^(?:script|style|textarea|title)$/i,y=t=>(i,...s)=>({_$litType$:t,strings:i,values:s}),x=y(1),b=y(2),w=y(3),T=Symbol.for(\"lit-noChange\"),E=Symbol.for(\"lit-nothing\"),A=new WeakMap,C=r.createTreeWalker(r,129);function P(t,i){if(!a(t)||!t.hasOwnProperty(\"raw\"))throw Error(\"invalid template strings array\");return void 0!==s?s.createHTML(i):i}const V=(t,i)=>{const s=t.length-1,o=[];let r,l=2===i?\"\":3===i?\"\":\"\",c=f;for(let i=0;i\"===u[0]?(c=r??f,d=-1):void 0===u[1]?d=-2:(d=c.lastIndex-u[2].length,a=u[1],c=void 0===u[3]?m:'\"'===u[3]?g:p):c===g||c===p?c=m:c===v||c===_?c=f:(c=m,r=void 0);const x=c===m&&t[i+1].startsWith(\"/>\")?\" \":\"\";l+=c===f?s+n:d>=0?(o.push(a),s.slice(0,d)+e+s.slice(d)+h+x):s+h+(-2===d?i:x)}return[P(t,l+(t[s]||\"\")+(2===i?\"\":3===i?\"\":\"\")),o]};class N{constructor({strings:t,_$litType$:s},n){let r;this.parts=[];let c=0,a=0;const u=t.length-1,d=this.parts,[f,v]=V(t,s);if(this.el=N.createElement(f,n),C.currentNode=this.el.content,2===s||3===s){const t=this.el.content.firstChild;t.replaceWith(...t.childNodes)}for(;null!==(r=C.nextNode())&&d.length0){r.textContent=i?i.emptyScript:\"\";for(let i=0;i2||\"\"!==s[0]||\"\"!==s[1]?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=E}_$AI(t,i=this,s,e){const h=this.strings;let o=!1;if(void 0===h)t=S(this,t,i,0),o=!c(t)||t!==this._$AH&&t!==T,o&&(this._$AH=t);else{const e=t;let n,r;for(t=h[0],n=0;n{const e=s?.renderBefore??i;let h=e._$litPart$;if(void 0===h){const t=s?.renderBefore??null;e._$litPart$=h=new R(i.insertBefore(l(),t),t,void 0,s??{})}return h._$AI(t),h};export{Z as _$LH,x as html,w as mathml,T as noChange,E as nothing,B as render,b as svg};\n//# sourceMappingURL=lit-html.js.map\n","/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\nconst t={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},e=t=>(...e)=>({_$litDirective$:t,values:e});class i{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,i){this._$Ct=t,this._$AM=e,this._$Ci=i}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}}export{i as Directive,t as PartType,e as directive};\n//# sourceMappingURL=directive.js.map\n","import{noChange as t}from\"../lit-html.js\";import{directive as s,Directive as i,PartType as r}from\"../directive.js\";\n/**\n * @license\n * Copyright 2018 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */const e=s(class extends i{constructor(t){if(super(t),t.type!==r.ATTRIBUTE||\"class\"!==t.name||t.strings?.length>2)throw Error(\"`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.\")}render(t){return\" \"+Object.keys(t).filter((s=>t[s])).join(\" \")+\" \"}update(s,[i]){if(void 0===this.st){this.st=new Set,void 0!==s.strings&&(this.nt=new Set(s.strings.join(\" \").split(/\\s/).filter((t=>\"\"!==t))));for(const t in i)i[t]&&!this.nt?.has(t)&&this.st.add(t);return this.render(i)}const r=s.element.classList;for(const t of this.st)t in i||(r.remove(t),this.st.delete(t));for(const t in i){const s=!!i[t];s===this.st.has(t)||this.nt?.has(t)||(s?(r.add(t),this.st.add(t)):(r.remove(t),this.st.delete(t)))}return t}});export{e as classMap};\n//# sourceMappingURL=class-map.js.map\n","import{nothing as t}from\"../lit-html.js\";\n/**\n * @license\n * Copyright 2018 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */const o=o=>o??t;export{o as ifDefined};\n//# sourceMappingURL=if-defined.js.map\n","import{_$LH as o}from\"./lit-html.js\";\n/**\n * @license\n * Copyright 2020 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */const{I:t}=o,i=o=>null===o||\"object\"!=typeof o&&\"function\"!=typeof o,n={HTML:1,SVG:2,MATHML:3},e=(o,t)=>void 0===t?void 0!==o?._$litType$:o?._$litType$===t,l=o=>null!=o?._$litType$?.h,c=o=>void 0!==o?._$litDirective$,d=o=>o?._$litDirective$,f=o=>void 0===o.strings,s=()=>document.createComment(\"\"),r=(o,i,n)=>{const e=o._$AA.parentNode,l=void 0===i?o._$AB:i._$AA;if(void 0===n){const i=e.insertBefore(s(),l),c=e.insertBefore(s(),l);n=new t(i,c,o,o.options)}else{const t=n._$AB.nextSibling,i=n._$AM,c=i!==o;if(c){let t;n._$AQ?.(o),n._$AM=o,void 0!==n._$AP&&(t=o._$AU)!==i._$AU&&n._$AP(t)}if(t!==l||c){let o=n._$AA;for(;o!==t;){const t=o.nextSibling;e.insertBefore(o,l),o=t}}}return n},v=(o,t,i=o)=>(o._$AI(t,i),o),u={},m=(o,t=u)=>o._$AH=t,p=o=>o._$AH,M=o=>{o._$AP?.(!1,!0);let t=o._$AA;const i=o._$AB.nextSibling;for(;t!==i;){const o=t.nextSibling;t.remove(),t=o}},h=o=>{o._$AR()};export{n as TemplateResultType,h as clearPart,p as getCommittedValue,d as getDirectiveClass,r as insertPart,l as isCompiledTemplateResult,c as isDirectiveResult,i as isPrimitive,f as isSingleExpression,e as isTemplateResult,M as removePart,v as setChildPartValue,m as setCommittedValue};\n//# sourceMappingURL=directive-helpers.js.map\n","import{noChange as r,nothing as e}from\"../lit-html.js\";import{directive as i,Directive as t,PartType as n}from\"../directive.js\";import{isSingleExpression as o,setCommittedValue as s}from\"../directive-helpers.js\";\n/**\n * @license\n * Copyright 2020 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */const l=i(class extends t{constructor(r){if(super(r),r.type!==n.PROPERTY&&r.type!==n.ATTRIBUTE&&r.type!==n.BOOLEAN_ATTRIBUTE)throw Error(\"The `live` directive is not allowed on child or event bindings\");if(!o(r))throw Error(\"`live` bindings can only contain a single expression\")}render(r){return r}update(i,[t]){if(t===r||t===e)return t;const o=i.element,l=i.name;if(i.type===n.PROPERTY){if(t===o[l])return r}else if(i.type===n.BOOLEAN_ATTRIBUTE){if(!!t===o.hasAttribute(l))return r}else if(i.type===n.ATTRIBUTE&&o.getAttribute(l)===t+\"\")return r;return s(i),t}});export{l as live};\n//# sourceMappingURL=live.js.map\n","import{noChange as e}from\"../lit-html.js\";import{directive as s,Directive as t,PartType as r}from\"../directive.js\";import{getCommittedValue as l,setChildPartValue as o,insertPart as i,removePart as n,setCommittedValue as f}from\"../directive-helpers.js\";\n/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\nconst u=(e,s,t)=>{const r=new Map;for(let l=s;l<=t;l++)r.set(e[l],l);return r},c=s(class extends t{constructor(e){if(super(e),e.type!==r.CHILD)throw Error(\"repeat() can only be used in text expressions\")}dt(e,s,t){let r;void 0===t?t=s:void 0!==s&&(r=s);const l=[],o=[];let i=0;for(const s of e)l[i]=r?r(s,i):i,o[i]=t(s,i),i++;return{values:o,keys:l}}render(e,s,t){return this.dt(e,s,t).values}update(s,[t,r,c]){const d=l(s),{values:p,keys:a}=this.dt(t,r,c);if(!Array.isArray(d))return this.ut=a,p;const h=this.ut??=[],v=[];let m,y,x=0,j=d.length-1,k=0,w=p.length-1;for(;x<=j&&k<=w;)if(null===d[x])x++;else if(null===d[j])j--;else if(h[x]===a[k])v[k]=o(d[x],p[k]),x++,k++;else if(h[j]===a[w])v[w]=o(d[j],p[w]),j--,w--;else if(h[x]===a[w])v[w]=o(d[x],p[w]),i(s,v[w+1],d[x]),x++,w--;else if(h[j]===a[k])v[k]=o(d[j],p[k]),i(s,d[x],d[j]),j--,k++;else if(void 0===m&&(m=u(a,k,w),y=u(h,x,j)),m.has(h[x]))if(m.has(h[j])){const e=y.get(a[k]),t=void 0!==e?d[e]:null;if(null===t){const e=i(s,d[x]);o(e,p[k]),v[k]=e}else v[k]=o(t,p[k]),i(s,d[x],t),d[e]=null;k++}else n(d[j]),j--;else n(d[x]),x++;for(;k<=w;){const e=i(s,v[w+1]);o(e,p[k]),v[k++]=e}for(;x<=j;){const e=d[x++];null!==e&&n(e)}return this.ut=a,f(s,v),e}});export{c as repeat};\n//# sourceMappingURL=repeat.js.map\n","import{noChange as t}from\"../lit-html.js\";import{directive as e,Directive as r,PartType as s}from\"../directive.js\";\n/**\n * @license\n * Copyright 2018 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */const n=\"important\",i=\" !\"+n,o=e(class extends r{constructor(t){if(super(t),t.type!==s.ATTRIBUTE||\"style\"!==t.name||t.strings?.length>2)throw Error(\"The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.\")}render(t){return Object.keys(t).reduce(((e,r)=>{const s=t[r];return null==s?e:e+`${r=r.includes(\"-\")?r:r.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,\"-$&\").toLowerCase()}:${s};`}),\"\")}update(e,[r]){const{style:s}=e.element;if(void 0===this.ft)return this.ft=new Set(Object.keys(r)),this.render(r);for(const t of this.ft)null==r[t]&&(this.ft.delete(t),t.includes(\"-\")?s.removeProperty(t):s[t]=null);for(const t in r){const e=r[t];if(null!=e){this.ft.add(t);const r=\"string\"==typeof e&&e.endsWith(i);t.includes(\"-\")||r?s.setProperty(t,r?e.slice(0,-11):e,r?n:\"\"):s[t]=e}}return t}});export{o as styleMap};\n//# sourceMappingURL=style-map.js.map\n","import{nothing as t,noChange as i}from\"../lit-html.js\";import{Directive as r,PartType as s,directive as n}from\"../directive.js\";\n/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */class e extends r{constructor(i){if(super(i),this.it=t,i.type!==s.CHILD)throw Error(this.constructor.directiveName+\"() can only be used in child bindings\")}render(r){if(r===t||null==r)return this._t=void 0,this.it=r;if(r===i)return r;if(\"string\"!=typeof r)throw Error(this.constructor.directiveName+\"() called with a non-string value\");if(r===this.it)return this._t;this.it=r;const s=[r];return s.raw=s,this._t={_$litType$:this.constructor.resultType,strings:s,values:[]}}}e.directiveName=\"unsafeHTML\",e.resultType=1;const o=n(e);export{e as UnsafeHTMLDirective,o as unsafeHTML};\n//# sourceMappingURL=unsafe-html.js.map\n","import{isSingleExpression as i}from\"./directive-helpers.js\";import{Directive as t,PartType as e}from\"./directive.js\";export{directive}from\"./directive.js\";\n/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */const s=(i,t)=>{const e=i._$AN;if(void 0===e)return!1;for(const i of e)i._$AO?.(t,!1),s(i,t);return!0},o=i=>{let t,e;do{if(void 0===(t=i._$AM))break;e=t._$AN,e.delete(i),i=t}while(0===e?.size)},r=i=>{for(let t;t=i._$AM;i=t){let e=t._$AN;if(void 0===e)t._$AN=e=new Set;else if(e.has(i))break;e.add(i),c(t)}};function h(i){void 0!==this._$AN?(o(this),this._$AM=i,r(this)):this._$AM=i}function n(i,t=!1,e=0){const r=this._$AH,h=this._$AN;if(void 0!==h&&0!==h.size)if(t)if(Array.isArray(r))for(let i=e;i{i.type==e.CHILD&&(i._$AP??=n,i._$AQ??=h)};class f extends t{constructor(){super(...arguments),this._$AN=void 0}_$AT(i,t,e){super._$AT(i,t,e),r(this),this.isConnected=i._$AU}_$AO(i,t=!0){i!==this.isConnected&&(this.isConnected=i,i?this.reconnected?.():this.disconnected?.()),t&&(s(this,i),o(this))}setValue(t){if(i(this._$Ct))this._$Ct._$AI(t,this);else{const i=[...this._$Ct._$AH];i[this._$Ci]=t,this._$Ct._$AI(i,this,0)}}disconnected(){}reconnected(){}}export{f as AsyncDirective,t as Directive,e as PartType};\n//# sourceMappingURL=async-directive.js.map\n","/**\n * @license\n * Copyright 2021 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\nconst t=async(t,s)=>{for await(const i of t)if(!1===await s(i))return};class s{constructor(t){this.Y=t}disconnect(){this.Y=void 0}reconnect(t){this.Y=t}deref(){return this.Y}}class i{constructor(){this.Z=void 0,this.q=void 0}get(){return this.Z}pause(){this.Z??=new Promise((t=>this.q=t))}resume(){this.q?.(),this.Z=this.q=void 0}}export{i as Pauser,s as PseudoWeakRef,t as forAwaitOf};\n//# sourceMappingURL=private-async-helpers.js.map\n","import{noChange as t}from\"../lit-html.js\";import{isPrimitive as s}from\"../directive-helpers.js\";import{AsyncDirective as i}from\"../async-directive.js\";import{PseudoWeakRef as e,Pauser as r}from\"./private-async-helpers.js\";import{directive as o}from\"../directive.js\";\n/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */const n=t=>!s(t)&&\"function\"==typeof t.then,h=1073741823;class c extends i{constructor(){super(...arguments),this._$Cwt=h,this._$Cbt=[],this._$CK=new e(this),this._$CX=new r}render(...s){return s.find((t=>!n(t)))??t}update(s,i){const e=this._$Cbt;let r=e.length;this._$Cbt=i;const o=this._$CK,c=this._$CX;this.isConnected||this.disconnected();for(let t=0;tthis._$Cwt);t++){const s=i[t];if(!n(s))return this._$Cwt=t,s;t{for(;c.get();)await c.get();const i=o.deref();if(void 0!==i){const e=i._$Cbt.indexOf(s);e>-1&&enew h;class h{}const o=new WeakMap,n=s(class extends i{render(i){return t}update(i,[s]){const e=s!==this.Y;return e&&void 0!==this.Y&&this.rt(void 0),(e||this.lt!==this.ct)&&(this.Y=s,this.ht=i.options?.host,this.rt(this.ct=i.element)),t}rt(t){if(this.isConnected||(t=void 0),\"function\"==typeof this.Y){const i=this.ht??globalThis;let s=o.get(i);void 0===s&&(s=new WeakMap,o.set(i,s)),void 0!==s.get(this.Y)&&this.Y.call(this.ht,void 0),s.set(this.Y,t),void 0!==t&&this.Y.call(this.ht,t)}else this.Y.value=t}get lt(){return\"function\"==typeof this.Y?o.get(this.ht??globalThis)?.get(this.Y):this.Y?.value}disconnected(){this.lt===this.ct&&this.rt(void 0)}reconnected(){this.rt(this.ct)}});export{e as createRef,n as ref};\n//# sourceMappingURL=ref.js.map\n"],"names":["t","globalThis","i","trustedTypes","s","createPolicy","createHTML","e","h","Math","random","toFixed","slice","o","n","r","document","l","createComment","c","a","Array","isArray","u","Symbol","iterator","d","f","v","_","m","RegExp","p","g","$","T","for","E","A","WeakMap","C","createTreeWalker","P","hasOwnProperty","Error","V","length","y","lastIndex","exec","test","x","startsWith","push","N","constructor","strings","_$litType$","this","parts","el","createElement","currentNode","content","firstChild","replaceWith","childNodes","nextNode","nodeType","hasAttributes","getAttributeNames","endsWith","getAttribute","split","type","index","name","ctor","H","I","L","k","removeAttribute","tagName","textContent","emptyScript","append","data","indexOf","innerHTML","S","_$Co","_$Cl","_$litDirective$","_$AO","_$AT","_$AS","values","M$1","_$AV","_$AN","_$AD","_$AM","parentNode","_$AU","creationScope","importNode","R","nextSibling","z","_$AI","_$Cv","_$AH","_$AA","_$AB","options","isConnected","startNode","endNode","_$AR","O","insertBefore","createTextNode","_$AC","M","get","set","_$AP","remove","setConnected","element","fill","String","j","setAttribute","super","arguments","toggleAttribute","capture","once","passive","removeEventListener","addEventListener","handleEvent","call","host","Z","D","U","B","F","litHtmlPolyfillSupport","litHtmlVersions","i$3","_$Ct","_$Ci","update","render","Object","keys","filter","join","st","Set","nt","has","add","classList","delete","_$AQ","hasAttribute","Map","dt","ut","w","reduce","includes","replace","toLowerCase","style","ft","removeProperty","setProperty","e$1","it","directiveName","_t","raw","resultType","size","reconnected","disconnected","setValue","Y","disconnect","reconnect","deref","q","pause","Promise","resume","then","_$Cwt","_$Cbt","_$CK","_$CX","find","resolve","async","rt","lt","ct","ht","value"],"mappings":";;;;;AAKK,MAACA,EAAEC,WAAWC,EAAEF,EAAEG,aAAaC,EAAEF,EAAEA,EAAEG,aAAa,WAAW,CAACC,WAAWN,GAAGA,SAAI,EAAOO,EAAE,QAAQC,EAAE,OAAOC,KAAKC,SAASC,QAAQ,GAAGC,MAAM,MAAMC,EAAE,IAAIL,EAAEM,EAAE,IAAID,KAAKE,EAAEC,SAASC,EAAE,IAAIF,EAAEG,cAAc,IAAIC,EAAEnB,GAAG,OAAOA,GAAG,iBAAiBA,GAAG,mBAAmBA,EAAEoB,EAAEC,MAAMC,QAAQC,EAAEvB,GAAGoB,EAAEpB,IAAI,mBAAmBA,IAAIwB,OAAOC,UAAUC,EAAE,cAAcC,EAAE,sDAAsDC,EAAE,OAAOC,EAAE,KAAKC,EAAEC,OAAO,KAAKL,sBAAsBA,MAAMA,uCAAuC,KAAKM,EAAE,KAAKC,EAAE,KAAKC,EAAE,qCAA6GC,EAAEX,OAAOY,IAAI,gBAAgBC,EAAEb,OAAOY,IAAI,eAAeE,EAAE,IAAIC,QAAQC,EAAEzB,EAAE0B,iBAAiB1B,EAAE,KAAK,SAAS2B,EAAE1C,EAAEE,GAAG,IAAIkB,EAAEpB,KAAKA,EAAE2C,eAAe,OAAO,MAAMC,MAAM,kCAAkC,YAAO,IAASxC,EAAEA,EAAEE,WAAWJ,GAAGA,CAAC,CAAC,MAAM2C,EAAE,CAAC7C,EAAEE,KAAK,MAAME,EAAEJ,EAAE8C,OAAO,EAAEjC,EAAE,GAAG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AAC,MAAM/L,EAAEwD,KAAK0J,IAAInN,WAAW,IAAIG,EAAES,GAAEgH,IAAI3H,QAAG,IAASE,IAAIA,EAAE,IAAImC,QAAQ1B,GAAEiH,IAAI5H,EAAEE,SAAI,IAASA,EAAEyH,IAAInE,KAAKuI,IAAIvI,KAAKuI,EAAEjD,KAAKtF,KAAK0J,QAAG,GAAQhN,EAAE0H,IAAIpE,KAAKuI,EAAEjM,QAAG,IAASA,GAAG0D,KAAKuI,EAAEjD,KAAKtF,KAAK0J,GAAGpN,EAAE,MAAM0D,KAAKuI,EAAEoB,MAAMrN,CAAC,CAAC,MAAIkN,GAAK,MAAM,mBAAmBxJ,KAAKuI,EAAEpL,GAAEgH,IAAInE,KAAK0J,IAAInN,aAAa4H,IAAInE,KAAKuI,GAAGvI,KAAKuI,GAAGoB,KAAK,CAAC,YAAAtB,GAAerI,KAAKwJ,KAAKxJ,KAAKyJ,IAAIzJ,KAAKuJ,QAAG,EAAO,CAAC,WAAAnB,GAAcpI,KAAKuJ,GAAGvJ,KAAKyJ,GAAG","x_google_ignoreList":[0,1,2,3,4,5,6,7,8,9,10,11,12]} \ No newline at end of file diff --git a/public/third_party/lit/lib/lit.d.ts b/public/third_party/lit/lib/lit.d.ts index 447d64183..bb80d42e8 100644 --- a/public/third_party/lit/lib/lit.d.ts +++ b/public/third_party/lit/lib/lit.d.ts @@ -1,4 +1,3 @@ -/// /** * @license * Copyright 2019 Google LLC @@ -148,6 +147,11 @@ interface ReactiveController { * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause */ +/** + * Use this module if you want to create your own base class extending + * {@link ReactiveElement}. + * @packageDocumentation + */ /** * Contains types that are part of the unstable debug API. @@ -728,8 +732,6 @@ declare abstract class ReactiveElement extends HTMLElement implements ReactiveCo * @param oldValue old value of requesting property * @param options property options to use instead of the previously * configured options - * @param initial whether this call is for the initial value of the property. - * Initial values do not reflect to an attribute. * @category updates */ requestUpdate(name?: PropertyKey, oldValue?: unknown, options?: PropertyDeclaration): void; @@ -925,6 +927,11 @@ declare abstract class Directive implements Disconnectable { update(_part: Part, props: Array): unknown; } +declare class TrustedHTML { + private constructor(); // To prevent instantiting with 'new'. + private brand: true; // To prevent structural typing. +} + /** * @license * Copyright 2017 Google LLC @@ -1103,14 +1110,18 @@ type ValueSanitizer = (value: unknown) => unknown; /** TemplateResult types */ declare const HTML_RESULT = 1; declare const SVG_RESULT = 2; -type ResultType = typeof HTML_RESULT | typeof SVG_RESULT; +declare const MATHML_RESULT = 3; +type ResultType = typeof HTML_RESULT | typeof SVG_RESULT | typeof MATHML_RESULT; declare const ATTRIBUTE_PART = 1; declare const CHILD_PART = 2; +declare const PROPERTY_PART = 3; +declare const BOOLEAN_ATTRIBUTE_PART = 4; +declare const EVENT_PART = 5; declare const ELEMENT_PART = 6; declare const COMMENT_PART = 7; /** * The return type of the template tag functions, {@linkcode html} and - * {@linkcode svg}. + * {@linkcode svg} when it hasn't been compiled by @lit-labs/compiler. * * A `TemplateResult` object holds all the information about a template * expression required to render it: the template strings, expression values, @@ -1121,13 +1132,47 @@ declare const COMMENT_PART = 7; * [Rendering](https://lit.dev/docs/components/rendering) for more information. * */ -type TemplateResult = { +type UncompiledTemplateResult = { ['_$litType$']: T; strings: TemplateStringsArray; values: unknown[]; }; +/** + * This is a template result that may be either uncompiled or compiled. + * + * In the future, TemplateResult will be this type. If you want to explicitly + * note that a template result is potentially compiled, you can reference this + * type and it will continue to behave the same through the next major version + * of Lit. This can be useful for code that wants to prepare for the next + * major version of Lit. + */ +type MaybeCompiledTemplateResult = UncompiledTemplateResult | CompiledTemplateResult; +/** + * The return type of the template tag functions, {@linkcode html} and + * {@linkcode svg}. + * + * A `TemplateResult` object holds all the information about a template + * expression required to render it: the template strings, expression values, + * and type of template (html or svg). + * + * `TemplateResult` objects do not create any DOM on their own. To create or + * update DOM you need to render the `TemplateResult`. See + * [Rendering](https://lit.dev/docs/components/rendering) for more information. + * + * In Lit 4, this type will be an alias of + * MaybeCompiledTemplateResult, so that code will get type errors if it assumes + * that Lit templates are not compiled. When deliberately working with only + * one, use either {@linkcode CompiledTemplateResult} or + * {@linkcode UncompiledTemplateResult} explicitly. + */ +type TemplateResult = UncompiledTemplateResult; type HTMLTemplateResult = TemplateResult; type SVGTemplateResult = TemplateResult; +type MathMLTemplateResult = TemplateResult; +/** + * A TemplateResult that has been compiled by @lit-labs/compiler, skipping the + * prepare step. + */ interface CompiledTemplateResult { ['_$litType$']: CompiledTemplate; values: unknown[]; @@ -1151,8 +1196,8 @@ interface CompiledTemplate extends Omit { */ declare const html: (strings: TemplateStringsArray, ...values: unknown[]) => TemplateResult<1>; /** - * Interprets a template literal as an SVG fragment that can efficiently - * render to and update a container. + * Interprets a template literal as an SVG fragment that can efficiently render + * to and update a container. * * ```ts * const rect = svg``; @@ -1171,9 +1216,35 @@ declare const html: (strings: TemplateStringsArray, ...values: unknown[]) => Tem * * In LitElement usage, it's invalid to return an SVG fragment from the * `render()` method, as the SVG fragment will be contained within the element's - * shadow root and thus cannot be used within an `` HTML element. + * shadow root and thus not be properly contained within an `` HTML + * element. */ declare const svg: (strings: TemplateStringsArray, ...values: unknown[]) => TemplateResult<2>; +/** + * Interprets a template literal as MathML fragment that can efficiently render + * to and update a container. + * + * ```ts + * const num = mathml`1`; + * + * const eq = html` + * + * ${num} + * `; + * ``` + * + * The `mathml` *tag function* should only be used for MathML fragments, or + * elements that would be contained **inside** a `` HTML element. A common + * error is placing a `` *element* in a template tagged with the `mathml` + * tag function. The `` element is an HTML element and should be used + * within a template tagged with the {@linkcode html} tag function. + * + * In LitElement usage, it's invalid to return an MathML fragment from the + * `render()` method, as the MathML fragment will be contained within the + * element's shadow root and thus not be properly contained within a `` + * HTML element. + */ +declare const mathml: (strings: TemplateStringsArray, ...values: unknown[]) => TemplateResult<3>; /** * A sentinel value that signals that a value was handled by a directive and * should not be written to the DOM. @@ -1243,7 +1314,7 @@ interface DirectiveParent { } declare class Template { parts: Array; - constructor({ strings, ['_$litType$']: type }: TemplateResult, options?: RenderOptions); + constructor({ strings, ['_$litType$']: type }: UncompiledTemplateResult, options?: RenderOptions); /** @nocollapse */ static createElement(html: TrustedHTML, _options?: RenderOptions): HTMLTemplateElement; } @@ -1361,7 +1432,7 @@ interface RootPart extends ChildPart { } declare class AttributePart implements Disconnectable { - readonly type: 1 | 3 | 4 | 5; + readonly type: typeof ATTRIBUTE_PART | typeof PROPERTY_PART | typeof BOOLEAN_ATTRIBUTE_PART | typeof EVENT_PART; readonly element: HTMLElement; readonly name: string; readonly options: RenderOptions | undefined; @@ -1407,7 +1478,7 @@ declare class ElementPart implements Disconnectable { * external users. * * We currently do not make a mangled rollup build of the lit-ssr code. In order - * to keep a number of (otherwise private) top-level exports mangled in the + * to keep a number of (otherwise private) top-level exports mangled in the * client side code, we export a _$LH object containing those members (or * helper methods for accessing private fields of those members), and then * re-export them for use in lit-ssr. This keeps lit-ssr agnostic to whether the @@ -1471,6 +1542,48 @@ declare const render: { * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause */ +/** + * The main LitElement module, which defines the {@linkcode LitElement} base + * class and related APIs. + * + * LitElement components can define a template and a set of observed + * properties. Changing an observed property triggers a re-render of the + * element. + * + * Import {@linkcode LitElement} and {@linkcode html} from this module to + * create a component: + * + * ```js + * import {LitElement, html} from 'lit-element'; + * + * class MyElement extends LitElement { + * + * // Declare observed properties + * static get properties() { + * return { + * adjective: {} + * } + * } + * + * constructor() { + * this.adjective = 'awesome'; + * } + * + * // Define the element's template + * render() { + * return html`

your ${adjective} template here

`; + * } + * } + * + * customElements.define('my-element', MyElement); + * ``` + * + * `LitElement` extends {@linkcode ReactiveElement} and adds lit-html + * templating. The `ReactiveElement` class is provided for users that want to + * build their own custom element base classes that don't use lit-html. + * + * @packageDocumentation + */ /** * Contains types that are part of the unstable debug API. @@ -1608,4 +1721,4 @@ declare const _$LE: { */ declare const isServer = false; -export { AttributePart, BooleanAttributePart, CSSResult, CSSResultArray, CSSResultGroup, CSSResultOrNative, ChildPart, CompiledTemplate, CompiledTemplateResult, ComplexAttributeConverter, DirectiveParent, Disconnectable, ElementPart, EventPart, HTMLTemplateResult, HasChanged, Initializer, LitElement, LitUnstable, Part, PropertyDeclaration, PropertyDeclarations, PropertyPart, PropertyValueMap, PropertyValues, ReactiveController, ReactiveControllerHost, ReactiveElement, ReactiveUnstable, RenderOptions, RootPart, SVGTemplateResult, SanitizerFactory, TemplateInstance, TemplateResult, Unstable, ValueSanitizer, WarningKind, _$LE, _$LH, adoptStyles, css, defaultConverter, getCompatibleStyle, html, isServer, noChange, notEqual, nothing, render, supportsAdoptingStyleSheets, svg, unsafeCSS }; +export { AttributePart, BooleanAttributePart, CSSResult, CSSResultArray, CSSResultGroup, CSSResultOrNative, ChildPart, CompiledTemplate, CompiledTemplateResult, ComplexAttributeConverter, DirectiveParent, Disconnectable, ElementPart, EventPart, HTMLTemplateResult, HasChanged, Initializer, LitElement, LitUnstable, MathMLTemplateResult, MaybeCompiledTemplateResult, Part, PropertyDeclaration, PropertyDeclarations, PropertyPart, PropertyValueMap, PropertyValues, ReactiveController, ReactiveControllerHost, ReactiveElement, ReactiveUnstable, RenderOptions, RootPart, SVGTemplateResult, SanitizerFactory, TemplateInstance, TemplateResult, UncompiledTemplateResult, Unstable, ValueSanitizer, WarningKind, _$LE, _$LH, adoptStyles, css, defaultConverter, getCompatibleStyle, html, isServer, mathml, noChange, notEqual, nothing, render, supportsAdoptingStyleSheets, svg, unsafeCSS }; diff --git a/public/third_party/lit/lib/lit.js b/public/third_party/lit/lib/lit.js index 51318ae03..c78cde8e4 100644 --- a/public/third_party/lit/lib/lit.js +++ b/public/third_party/lit/lib/lit.js @@ -3,27 +3,27 @@ * Copyright 2019 Google LLC * SPDX-License-Identifier: BSD-3-Clause */ -const t=globalThis,e=t.ShadowRoot&&(void 0===t.ShadyCSS||t.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,s=Symbol(),i=new WeakMap;class n{constructor(t,e,i){if(this._$cssResult$=!0,i!==s)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const s=this.t;if(e&&void 0===t){const e=void 0!==s&&1===s.length;e&&(t=i.get(s)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),e&&i.set(s,t))}return t}toString(){return this.cssText}}const r=t=>new n("string"==typeof t?t:t+"",void 0,s),o=(t,...e)=>{const i=1===t.length?t[0]:e.reduce(((e,s,i)=>e+(t=>{if(!0===t._$cssResult$)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(s)+t[i+1]),t[0]);return new n(i,t,s)},h=(s,i)=>{if(e)s.adoptedStyleSheets=i.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet));else for(const e of i){const i=document.createElement("style"),n=t.litNonce;void 0!==n&&i.setAttribute("nonce",n),i.textContent=e.cssText,s.appendChild(i)}},a=e?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const s of t.cssRules)e+=s.cssText;return r(e)})(t):t +const t=globalThis,e=t.ShadowRoot&&(void 0===t.ShadyCSS||t.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,s=Symbol(),i=new WeakMap;let n=class{constructor(t,e,i){if(this._$cssResult$=!0,i!==s)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const s=this.t;if(e&&void 0===t){const e=void 0!==s&&1===s.length;e&&(t=i.get(s)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),e&&i.set(s,t))}return t}toString(){return this.cssText}};const r=t=>new n("string"==typeof t?t:t+"",void 0,s),o=(t,...e)=>{const i=1===t.length?t[0]:e.reduce(((e,s,i)=>e+(t=>{if(!0===t._$cssResult$)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(s)+t[i+1]),t[0]);return new n(i,t,s)},h=(s,i)=>{if(e)s.adoptedStyleSheets=i.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet));else for(const e of i){const i=document.createElement("style"),n=t.litNonce;void 0!==n&&i.setAttribute("nonce",n),i.textContent=e.cssText,s.appendChild(i)}},a=e?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const s of t.cssRules)e+=s.cssText;return r(e)})(t):t /** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause - */,{is:l,defineProperty:c,getOwnPropertyDescriptor:d,getOwnPropertyNames:p,getOwnPropertySymbols:u,getPrototypeOf:$}=Object,_=globalThis,A=_.trustedTypes,f=A?A.emptyScript:"",g=_.reactiveElementPolyfillSupport,m=(t,e)=>t,y={toAttribute(t,e){switch(e){case Boolean:t=t?f:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){let s=t;switch(e){case Boolean:s=null!==t;break;case Number:s=null===t?null:Number(t);break;case Object:case Array:try{s=JSON.parse(t)}catch(t){s=null}}return s}},v=(t,e)=>!l(t,e),S={attribute:!0,type:String,converter:y,reflect:!1,hasChanged:v};Symbol.metadata??=Symbol("metadata"),_.litPropertyMetadata??=new WeakMap;class E extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=S){if(e.state&&(e.attribute=!1),this._$Ei(),this.elementProperties.set(t,e),!e.noAccessor){const s=Symbol(),i=this.getPropertyDescriptor(t,s,e);void 0!==i&&c(this.prototype,t,i)}}static getPropertyDescriptor(t,e,s){const{get:i,set:n}=d(this.prototype,t)??{get(){return this[e]},set(t){this[e]=t}};return{get(){return i?.call(this)},set(e){const r=i?.call(this);n.call(this,e),this.requestUpdate(t,r,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??S}static _$Ei(){if(this.hasOwnProperty(m("elementProperties")))return;const t=$(this);t.finalize(),void 0!==t.l&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(m("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(m("properties"))){const t=this.properties,e=[...p(t),...u(t)];for(const s of e)this.createProperty(s,t[s])}const t=this[Symbol.metadata];if(null!==t){const e=litPropertyMetadata.get(t);if(void 0!==e)for(const[t,s]of e)this.elementProperties.set(t,s)}this._$Eh=new Map;for(const[t,e]of this.elementProperties){const s=this._$Eu(t,e);void 0!==s&&this._$Eh.set(s,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const s=new Set(t.flat(1/0).reverse());for(const t of s)e.unshift(a(t))}else void 0!==t&&e.push(a(t));return e}static _$Eu(t,e){const s=e.attribute;return!1===s?void 0:"string"==typeof s?s:"string"==typeof t?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$Eg=new Promise((t=>this.enableUpdating=t)),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach((t=>t(this)))}addController(t){(this._$ES??=[]).push(t),void 0!==this.renderRoot&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$ES?.splice(this._$ES.indexOf(t)>>>0,1)}_$E_(){const t=new Map,e=this.constructor.elementProperties;for(const s of e.keys())this.hasOwnProperty(s)&&(t.set(s,this[s]),delete this[s]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return h(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$ES?.forEach((t=>t.hostConnected?.()))}enableUpdating(t){}disconnectedCallback(){this._$ES?.forEach((t=>t.hostDisconnected?.()))}attributeChangedCallback(t,e,s){this._$AK(t,s)}_$EO(t,e){const s=this.constructor.elementProperties.get(t),i=this.constructor._$Eu(t,s);if(void 0!==i&&!0===s.reflect){const n=(void 0!==s.converter?.toAttribute?s.converter:y).toAttribute(e,s.type);this._$Em=t,null==n?this.removeAttribute(i):this.setAttribute(i,n),this._$Em=null}}_$AK(t,e){const s=this.constructor,i=s._$Eh.get(t);if(void 0!==i&&this._$Em!==i){const t=s.getPropertyOptions(i),n="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==t.converter?.fromAttribute?t.converter:y;this._$Em=i,this[i]=n.fromAttribute(e,t.type),this._$Em=null}}requestUpdate(t,e,s,i=!1,n){if(void 0!==t){if(s??=this.constructor.getPropertyOptions(t),!(s.hasChanged??v)(i?n:this[t],e))return;this.C(t,e,s)}!1===this.isUpdatePending&&(this._$Eg=this._$EP())}C(t,e,s){this._$AL.has(t)||this._$AL.set(t,e),!0===s.reflect&&this._$Em!==t&&(this._$Ej??=new Set).add(t)}async _$EP(){this.isUpdatePending=!0;try{await this._$Eg}catch(t){Promise.reject(t)}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this._$Ep){for(const[t,e]of this._$Ep)this[t]=e;this._$Ep=void 0}const t=this.constructor.elementProperties;if(t.size>0)for(const[e,s]of t)!0!==s.wrapped||this._$AL.has(e)||void 0===this[e]||this.C(e,this[e],s)}let t=!1;const e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),this._$ES?.forEach((t=>t.hostUpdate?.())),this.update(e)):this._$ET()}catch(e){throw t=!1,this._$ET(),e}t&&this._$AE(e)}willUpdate(t){}_$AE(t){this._$ES?.forEach((t=>t.hostUpdated?.())),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$ET(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$Eg}shouldUpdate(t){return!0}update(t){this._$Ej&&=this._$Ej.forEach((t=>this._$EO(t,this[t]))),this._$ET()}updated(t){}firstUpdated(t){}}E.elementStyles=[],E.shadowRootOptions={mode:"open"},E[m("elementProperties")]=new Map,E[m("finalized")]=new Map,g?.({ReactiveElement:E}),(_.reactiveElementVersions??=[]).push("2.0.1"); + */,{is:l,defineProperty:c,getOwnPropertyDescriptor:d,getOwnPropertyNames:p,getOwnPropertySymbols:u,getPrototypeOf:$}=Object,_=globalThis,f=_.trustedTypes,A=f?f.emptyScript:"",m=_.reactiveElementPolyfillSupport,g=(t,e)=>t,y={toAttribute(t,e){switch(e){case Boolean:t=t?A:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){let s=t;switch(e){case Boolean:s=null!==t;break;case Number:s=null===t?null:Number(t);break;case Object:case Array:try{s=JSON.parse(t)}catch(t){s=null}}return s}},v=(t,e)=>!l(t,e),S={attribute:!0,type:String,converter:y,reflect:!1,hasChanged:v};Symbol.metadata??=Symbol("metadata"),_.litPropertyMetadata??=new WeakMap;let E=class extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=S){if(e.state&&(e.attribute=!1),this._$Ei(),this.elementProperties.set(t,e),!e.noAccessor){const s=Symbol(),i=this.getPropertyDescriptor(t,s,e);void 0!==i&&c(this.prototype,t,i)}}static getPropertyDescriptor(t,e,s){const{get:i,set:n}=d(this.prototype,t)??{get(){return this[e]},set(t){this[e]=t}};return{get(){return i?.call(this)},set(e){const r=i?.call(this);n.call(this,e),this.requestUpdate(t,r,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??S}static _$Ei(){if(this.hasOwnProperty(g("elementProperties")))return;const t=$(this);t.finalize(),void 0!==t.l&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(g("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(g("properties"))){const t=this.properties,e=[...p(t),...u(t)];for(const s of e)this.createProperty(s,t[s])}const t=this[Symbol.metadata];if(null!==t){const e=litPropertyMetadata.get(t);if(void 0!==e)for(const[t,s]of e)this.elementProperties.set(t,s)}this._$Eh=new Map;for(const[t,e]of this.elementProperties){const s=this._$Eu(t,e);void 0!==s&&this._$Eh.set(s,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const s=new Set(t.flat(1/0).reverse());for(const t of s)e.unshift(a(t))}else void 0!==t&&e.push(a(t));return e}static _$Eu(t,e){const s=e.attribute;return!1===s?void 0:"string"==typeof s?s:"string"==typeof t?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise((t=>this.enableUpdating=t)),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach((t=>t(this)))}addController(t){(this._$EO??=new Set).add(t),void 0!==this.renderRoot&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){const t=new Map,e=this.constructor.elementProperties;for(const s of e.keys())this.hasOwnProperty(s)&&(t.set(s,this[s]),delete this[s]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return h(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach((t=>t.hostConnected?.()))}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach((t=>t.hostDisconnected?.()))}attributeChangedCallback(t,e,s){this._$AK(t,s)}_$EC(t,e){const s=this.constructor.elementProperties.get(t),i=this.constructor._$Eu(t,s);if(void 0!==i&&!0===s.reflect){const n=(void 0!==s.converter?.toAttribute?s.converter:y).toAttribute(e,s.type);this._$Em=t,null==n?this.removeAttribute(i):this.setAttribute(i,n),this._$Em=null}}_$AK(t,e){const s=this.constructor,i=s._$Eh.get(t);if(void 0!==i&&this._$Em!==i){const t=s.getPropertyOptions(i),n="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==t.converter?.fromAttribute?t.converter:y;this._$Em=i,this[i]=n.fromAttribute(e,t.type),this._$Em=null}}requestUpdate(t,e,s){if(void 0!==t){if(s??=this.constructor.getPropertyOptions(t),!(s.hasChanged??v)(this[t],e))return;this.P(t,e,s)}!1===this.isUpdatePending&&(this._$ES=this._$ET())}P(t,e,s){this._$AL.has(t)||this._$AL.set(t,e),!0===s.reflect&&this._$Em!==t&&(this._$Ej??=new Set).add(t)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[t,e]of this._$Ep)this[t]=e;this._$Ep=void 0}const t=this.constructor.elementProperties;if(t.size>0)for(const[e,s]of t)!0!==s.wrapped||this._$AL.has(e)||void 0===this[e]||this.P(e,this[e],s)}let t=!1;const e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),this._$EO?.forEach((t=>t.hostUpdate?.())),this.update(e)):this._$EU()}catch(e){throw t=!1,this._$EU(),e}t&&this._$AE(e)}willUpdate(t){}_$AE(t){this._$EO?.forEach((t=>t.hostUpdated?.())),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Ej&&=this._$Ej.forEach((t=>this._$EC(t,this[t]))),this._$EU()}updated(t){}firstUpdated(t){}};E.elementStyles=[],E.shadowRootOptions={mode:"open"},E[g("elementProperties")]=new Map,E[g("finalized")]=new Map,m?.({ReactiveElement:E}),(_.reactiveElementVersions??=[]).push("2.0.4"); /** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause */ -const b=globalThis,C=b.trustedTypes,w=C?C.createPolicy("lit-html",{createHTML:t=>t}):void 0,P="$lit$",x=`lit$${(Math.random()+"").slice(9)}$`,U="?"+x,H=`<${U}>`,T=document,N=()=>T.createComment(""),O=t=>null===t||"object"!=typeof t&&"function"!=typeof t,R=Array.isArray,M=t=>R(t)||"function"==typeof t?.[Symbol.iterator],k="[ \t\n\f\r]",L=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,z=/-->/g,D=/>/g,B=RegExp(`>|${k}(?:([^\\s"'>=/]+)(${k}*=${k}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),I=/'/g,j=/"/g,V=/^(?:script|style|textarea|title)$/i,W=t=>(e,...s)=>({_$litType$:t,strings:e,values:s}),q=W(1),K=W(2),J=Symbol.for("lit-noChange"),Z=Symbol.for("lit-nothing"),F=new WeakMap,G=T.createTreeWalker(T,129);function Q(t,e){if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==w?w.createHTML(e):e}const X=(t,e)=>{const s=t.length-1,i=[];let n,r=2===e?"":"",o=L;for(let e=0;e"===a[0]?(o=n??L,l=-1):void 0===a[1]?l=-2:(l=o.lastIndex-a[2].length,h=a[1],o=void 0===a[3]?B:'"'===a[3]?j:I):o===j||o===I?o=B:o===z||o===D?o=L:(o=B,n=void 0);const d=o===B&&t[e+1].startsWith("/>")?" ":"";r+=o===L?s+H:l>=0?(i.push(h),s.slice(0,l)+P+s.slice(l)+x+d):s+x+(-2===l?e:d)}return[Q(t,r+(t[s]||"")+(2===e?"":"")),i]};class Y{constructor({strings:t,_$litType$:e},s){let i;this.parts=[];let n=0,r=0;const o=t.length-1,h=this.parts,[a,l]=X(t,e);if(this.el=Y.createElement(a,s),G.currentNode=this.el.content,2===e){const t=this.el.content.firstChild;t.replaceWith(...t.childNodes)}for(;null!==(i=G.nextNode())&&h.length0){i.textContent=C?C.emptyScript:"";for(let s=0;s2||""!==s[0]||""!==s[1]?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=Z}_$AI(t,e=this,s,i){const n=this.strings;let r=!1;if(void 0===n)t=tt(this,t,e,0),r=!O(t)||t!==this._$AH&&t!==J,r&&(this._$AH=t);else{const i=t;let o,h;for(t=n[0],o=0;o{const i=s?.renderBefore??e;let n=i._$litPart$;if(void 0===n){const t=s?.renderBefore??null;i._$litPart$=n=new st(e.insertBefore(N(),t),t,void 0,s??{})}return n._$AI(t),n +const b=globalThis,C=b.trustedTypes,w=C?C.createPolicy("lit-html",{createHTML:t=>t}):void 0,P="$lit$",U=`lit$${Math.random().toFixed(9).slice(2)}$`,x="?"+U,H=`<${x}>`,O=document,T=()=>O.createComment(""),N=t=>null===t||"object"!=typeof t&&"function"!=typeof t,R=Array.isArray,M=t=>R(t)||"function"==typeof t?.[Symbol.iterator],L="[ \t\n\f\r]",k=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,z=/-->/g,D=/>/g,B=RegExp(`>|${L}(?:([^\\s"'>=/]+)(${L}*=${L}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),I=/'/g,j=/"/g,V=/^(?:script|style|textarea|title)$/i,W=t=>(e,...s)=>({_$litType$:t,strings:e,values:s}),q=W(1),K=W(2),F=W(3),J=Symbol.for("lit-noChange"),Z=Symbol.for("lit-nothing"),G=new WeakMap,Q=O.createTreeWalker(O,129);function X(t,e){if(!R(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==w?w.createHTML(e):e}const Y=(t,e)=>{const s=t.length-1,i=[];let n,r=2===e?"":3===e?"":"",o=k;for(let e=0;e"===a[0]?(o=n??k,l=-1):void 0===a[1]?l=-2:(l=o.lastIndex-a[2].length,h=a[1],o=void 0===a[3]?B:'"'===a[3]?j:I):o===j||o===I?o=B:o===z||o===D?o=k:(o=B,n=void 0);const d=o===B&&t[e+1].startsWith("/>")?" ":"";r+=o===k?s+H:l>=0?(i.push(h),s.slice(0,l)+P+s.slice(l)+U+d):s+U+(-2===l?e:d)}return[X(t,r+(t[s]||"")+(2===e?"":3===e?"":"")),i]};class tt{constructor({strings:t,_$litType$:e},s){let i;this.parts=[];let n=0,r=0;const o=t.length-1,h=this.parts,[a,l]=Y(t,e);if(this.el=tt.createElement(a,s),Q.currentNode=this.el.content,2===e||3===e){const t=this.el.content.firstChild;t.replaceWith(...t.childNodes)}for(;null!==(i=Q.nextNode())&&h.length0){i.textContent=C?C.emptyScript:"";for(let s=0;s2||""!==s[0]||""!==s[1]?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=Z}_$AI(t,e=this,s,i){const n=this.strings;let r=!1;if(void 0===n)t=et(this,t,e,0),r=!N(t)||t!==this._$AH&&t!==J,r&&(this._$AH=t);else{const i=t;let o,h;for(t=n[0],o=0;o{const i=s?.renderBefore??e;let n=i._$litPart$;if(void 0===n){const t=s?.renderBefore??null;i._$litPart$=n=new it(e.insertBefore(T(),t),t,void 0,s??{})}return n._$AI(t),n /** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause - */};class dt extends E{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){const t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=ct(e,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return J}}dt._$litElement$=!0,dt.finalized=!0,globalThis.litElementHydrateSupport?.({LitElement:dt});const pt=globalThis.litElementPolyfillSupport;pt?.({LitElement:dt});const ut={_$AK:(t,e,s)=>{t._$AK(e,s)},_$AL:t=>t._$AL};(globalThis.litElementVersions??=[]).push("4.0.1"); + */};class pt extends E{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){const t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=dt(e,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return J}}pt._$litElement$=!0,pt.finalized=!0,globalThis.litElementHydrateSupport?.({LitElement:pt});const ut=globalThis.litElementPolyfillSupport;ut?.({LitElement:pt});const $t={_$AK:(t,e,s)=>{t._$AK(e,s)},_$AL:t=>t._$AL};(globalThis.litElementVersions??=[]).push("4.1.1"); /** * @license * Copyright 2022 Google LLC * SPDX-License-Identifier: BSD-3-Clause */ -const $t=!1;export{n as CSSResult,dt as LitElement,E as ReactiveElement,ut as _$LE,at as _$LH,h as adoptStyles,o as css,y as defaultConverter,a as getCompatibleStyle,q as html,$t as isServer,J as noChange,v as notEqual,Z as nothing,ct as render,e as supportsAdoptingStyleSheets,K as svg,r as unsafeCSS}; +const _t=!1;export{n as CSSResult,pt as LitElement,E as ReactiveElement,$t as _$LE,lt as _$LH,h as adoptStyles,o as css,y as defaultConverter,a as getCompatibleStyle,q as html,_t as isServer,F as mathml,J as noChange,v as notEqual,Z as nothing,dt as render,e as supportsAdoptingStyleSheets,K as svg,r as unsafeCSS}; //# sourceMappingURL=lit.js.map diff --git a/public/third_party/lit/lib/lit.js.map b/public/third_party/lit/lib/lit.js.map index 78df3a3cd..80c8113c5 100644 --- a/public/third_party/lit/lib/lit.js.map +++ b/public/third_party/lit/lib/lit.js.map @@ -1 +1 @@ -{"version":3,"file":"lit.js","sources":["../node_modules/@lit/reactive-element/css-tag.js","../node_modules/@lit/reactive-element/reactive-element.js","../node_modules/lit-html/lit-html.js","../node_modules/lit-element/lit-element.js","../node_modules/lit-html/is-server.js"],"sourcesContent":["/**\n * @license\n * Copyright 2019 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\nconst t=globalThis,e=t.ShadowRoot&&(void 0===t.ShadyCSS||t.ShadyCSS.nativeShadow)&&\"adoptedStyleSheets\"in Document.prototype&&\"replace\"in CSSStyleSheet.prototype,s=Symbol(),o=new WeakMap;class n{constructor(t,e,o){if(this._$cssResult$=!0,o!==s)throw Error(\"CSSResult is not constructable. Use `unsafeCSS` or `css` instead.\");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const s=this.t;if(e&&void 0===t){const e=void 0!==s&&1===s.length;e&&(t=o.get(s)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),e&&o.set(s,t))}return t}toString(){return this.cssText}}const r=t=>new n(\"string\"==typeof t?t:t+\"\",void 0,s),i=(t,...e)=>{const o=1===t.length?t[0]:e.reduce(((e,s,o)=>e+(t=>{if(!0===t._$cssResult$)return t.cssText;if(\"number\"==typeof t)return t;throw Error(\"Value passed to 'css' function must be a 'css' function result: \"+t+\". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.\")})(s)+t[o+1]),t[0]);return new n(o,t,s)},S=(s,o)=>{if(e)s.adoptedStyleSheets=o.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet));else for(const e of o){const o=document.createElement(\"style\"),n=t.litNonce;void 0!==n&&o.setAttribute(\"nonce\",n),o.textContent=e.cssText,s.appendChild(o)}},c=e?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e=\"\";for(const s of t.cssRules)e+=s.cssText;return r(e)})(t):t;export{n as CSSResult,S as adoptStyles,i as css,c as getCompatibleStyle,e as supportsAdoptingStyleSheets,r as unsafeCSS};\n//# sourceMappingURL=css-tag.js.map\n","import{getCompatibleStyle as t,adoptStyles as s}from\"./css-tag.js\";export{CSSResult,adoptStyles,css,getCompatibleStyle,supportsAdoptingStyleSheets,unsafeCSS}from\"./css-tag.js\";\n/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */const{is:i,defineProperty:e,getOwnPropertyDescriptor:r,getOwnPropertyNames:h,getOwnPropertySymbols:o,getPrototypeOf:n}=Object,a=globalThis,c=a.trustedTypes,l=c?c.emptyScript:\"\",p=a.reactiveElementPolyfillSupport,d=(t,s)=>t,u={toAttribute(t,s){switch(s){case Boolean:t=t?l:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,s){let i=t;switch(s){case Boolean:i=null!==t;break;case Number:i=null===t?null:Number(t);break;case Object:case Array:try{i=JSON.parse(t)}catch(t){i=null}}return i}},f=(t,s)=>!i(t,s),y={attribute:!0,type:String,converter:u,reflect:!1,hasChanged:f};Symbol.metadata??=Symbol(\"metadata\"),a.litPropertyMetadata??=new WeakMap;class b extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,s=y){if(s.state&&(s.attribute=!1),this._$Ei(),this.elementProperties.set(t,s),!s.noAccessor){const i=Symbol(),r=this.getPropertyDescriptor(t,i,s);void 0!==r&&e(this.prototype,t,r)}}static getPropertyDescriptor(t,s,i){const{get:e,set:h}=r(this.prototype,t)??{get(){return this[s]},set(t){this[s]=t}};return{get(){return e?.call(this)},set(s){const r=e?.call(this);h.call(this,s),this.requestUpdate(t,r,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??y}static _$Ei(){if(this.hasOwnProperty(d(\"elementProperties\")))return;const t=n(this);t.finalize(),void 0!==t.l&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(d(\"finalized\")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(d(\"properties\"))){const t=this.properties,s=[...h(t),...o(t)];for(const i of s)this.createProperty(i,t[i])}const t=this[Symbol.metadata];if(null!==t){const s=litPropertyMetadata.get(t);if(void 0!==s)for(const[t,i]of s)this.elementProperties.set(t,i)}this._$Eh=new Map;for(const[t,s]of this.elementProperties){const i=this._$Eu(t,s);void 0!==i&&this._$Eh.set(i,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(s){const i=[];if(Array.isArray(s)){const e=new Set(s.flat(1/0).reverse());for(const s of e)i.unshift(t(s))}else void 0!==s&&i.push(t(s));return i}static _$Eu(t,s){const i=s.attribute;return!1===i?void 0:\"string\"==typeof i?i:\"string\"==typeof t?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$Eg=new Promise((t=>this.enableUpdating=t)),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach((t=>t(this)))}addController(t){(this._$ES??=[]).push(t),void 0!==this.renderRoot&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$ES?.splice(this._$ES.indexOf(t)>>>0,1)}_$E_(){const t=new Map,s=this.constructor.elementProperties;for(const i of s.keys())this.hasOwnProperty(i)&&(t.set(i,this[i]),delete this[i]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return s(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$ES?.forEach((t=>t.hostConnected?.()))}enableUpdating(t){}disconnectedCallback(){this._$ES?.forEach((t=>t.hostDisconnected?.()))}attributeChangedCallback(t,s,i){this._$AK(t,i)}_$EO(t,s){const i=this.constructor.elementProperties.get(t),e=this.constructor._$Eu(t,i);if(void 0!==e&&!0===i.reflect){const r=(void 0!==i.converter?.toAttribute?i.converter:u).toAttribute(s,i.type);this._$Em=t,null==r?this.removeAttribute(e):this.setAttribute(e,r),this._$Em=null}}_$AK(t,s){const i=this.constructor,e=i._$Eh.get(t);if(void 0!==e&&this._$Em!==e){const t=i.getPropertyOptions(e),r=\"function\"==typeof t.converter?{fromAttribute:t.converter}:void 0!==t.converter?.fromAttribute?t.converter:u;this._$Em=e,this[e]=r.fromAttribute(s,t.type),this._$Em=null}}requestUpdate(t,s,i,e=!1,r){if(void 0!==t){if(i??=this.constructor.getPropertyOptions(t),!(i.hasChanged??f)(e?r:this[t],s))return;this.C(t,s,i)}!1===this.isUpdatePending&&(this._$Eg=this._$EP())}C(t,s,i){this._$AL.has(t)||this._$AL.set(t,s),!0===i.reflect&&this._$Em!==t&&(this._$Ej??=new Set).add(t)}async _$EP(){this.isUpdatePending=!0;try{await this._$Eg}catch(t){Promise.reject(t)}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this._$Ep){for(const[t,s]of this._$Ep)this[t]=s;this._$Ep=void 0}const t=this.constructor.elementProperties;if(t.size>0)for(const[s,i]of t)!0!==i.wrapped||this._$AL.has(s)||void 0===this[s]||this.C(s,this[s],i)}let t=!1;const s=this._$AL;try{t=this.shouldUpdate(s),t?(this.willUpdate(s),this._$ES?.forEach((t=>t.hostUpdate?.())),this.update(s)):this._$ET()}catch(s){throw t=!1,this._$ET(),s}t&&this._$AE(s)}willUpdate(t){}_$AE(t){this._$ES?.forEach((t=>t.hostUpdated?.())),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$ET(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$Eg}shouldUpdate(t){return!0}update(t){this._$Ej&&=this._$Ej.forEach((t=>this._$EO(t,this[t]))),this._$ET()}updated(t){}firstUpdated(t){}}b.elementStyles=[],b.shadowRootOptions={mode:\"open\"},b[d(\"elementProperties\")]=new Map,b[d(\"finalized\")]=new Map,p?.({ReactiveElement:b}),(a.reactiveElementVersions??=[]).push(\"2.0.1\");export{b as ReactiveElement,u as defaultConverter,f as notEqual};\n//# sourceMappingURL=reactive-element.js.map\n","/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\nconst t=globalThis,i=t.trustedTypes,s=i?i.createPolicy(\"lit-html\",{createHTML:t=>t}):void 0,e=\"$lit$\",h=`lit$${(Math.random()+\"\").slice(9)}$`,o=\"?\"+h,n=`<${o}>`,r=document,l=()=>r.createComment(\"\"),c=t=>null===t||\"object\"!=typeof t&&\"function\"!=typeof t,a=Array.isArray,u=t=>a(t)||\"function\"==typeof t?.[Symbol.iterator],d=\"[ \\t\\n\\f\\r]\",f=/<(?:(!--|\\/[^a-zA-Z])|(\\/?[a-zA-Z][^>\\s]*)|(\\/?$))/g,v=/-->/g,_=/>/g,m=RegExp(`>|${d}(?:([^\\\\s\"'>=/]+)(${d}*=${d}*(?:[^ \\t\\n\\f\\r\"'\\`<>=]|(\"|')|))|$)`,\"g\"),p=/'/g,g=/\"/g,$=/^(?:script|style|textarea|title)$/i,y=t=>(i,...s)=>({_$litType$:t,strings:i,values:s}),x=y(1),b=y(2),w=Symbol.for(\"lit-noChange\"),T=Symbol.for(\"lit-nothing\"),A=new WeakMap,E=r.createTreeWalker(r,129);function C(t,i){if(!Array.isArray(t)||!t.hasOwnProperty(\"raw\"))throw Error(\"invalid template strings array\");return void 0!==s?s.createHTML(i):i}const P=(t,i)=>{const s=t.length-1,o=[];let r,l=2===i?\"\":\"\",c=f;for(let i=0;i\"===u[0]?(c=r??f,d=-1):void 0===u[1]?d=-2:(d=c.lastIndex-u[2].length,a=u[1],c=void 0===u[3]?m:'\"'===u[3]?g:p):c===g||c===p?c=m:c===v||c===_?c=f:(c=m,r=void 0);const x=c===m&&t[i+1].startsWith(\"/>\")?\" \":\"\";l+=c===f?s+n:d>=0?(o.push(a),s.slice(0,d)+e+s.slice(d)+h+x):s+h+(-2===d?i:x)}return[C(t,l+(t[s]||\"\")+(2===i?\"\":\"\")),o]};class V{constructor({strings:t,_$litType$:s},n){let r;this.parts=[];let c=0,a=0;const u=t.length-1,d=this.parts,[f,v]=P(t,s);if(this.el=V.createElement(f,n),E.currentNode=this.el.content,2===s){const t=this.el.content.firstChild;t.replaceWith(...t.childNodes)}for(;null!==(r=E.nextNode())&&d.length0){r.textContent=i?i.emptyScript:\"\";for(let i=0;i2||\"\"!==s[0]||\"\"!==s[1]?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=T}_$AI(t,i=this,s,e){const h=this.strings;let o=!1;if(void 0===h)t=N(this,t,i,0),o=!c(t)||t!==this._$AH&&t!==w,o&&(this._$AH=t);else{const e=t;let n,r;for(t=h[0],n=0;n{const e=s?.renderBefore??i;let h=e._$litPart$;if(void 0===h){const t=s?.renderBefore??null;e._$litPart$=h=new M(i.insertBefore(l(),t),t,void 0,s??{})}return h._$AI(t),h};export{z as _$LH,x as html,w as noChange,T as nothing,j as render,b as svg};\n//# sourceMappingURL=lit-html.js.map\n","import{ReactiveElement as t}from\"@lit/reactive-element\";export*from\"@lit/reactive-element\";import{render as e,noChange as i}from\"lit-html\";export*from\"lit-html\";\n/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */class s extends t{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){const t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){const i=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=e(i,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return i}}s._$litElement$=!0,s[(\"finalized\",\"finalized\")]=!0,globalThis.litElementHydrateSupport?.({LitElement:s});const r=globalThis.litElementPolyfillSupport;r?.({LitElement:s});const o={_$AK:(t,e,i)=>{t._$AK(e,i)},_$AL:t=>t._$AL};(globalThis.litElementVersions??=[]).push(\"4.0.1\");export{s as LitElement,o as _$LE};\n//# sourceMappingURL=lit-element.js.map\n","/**\n * @license\n * Copyright 2022 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\nconst o=!1;export{o as isServer};\n//# sourceMappingURL=is-server.js.map\n"],"names":["t","globalThis","e","ShadowRoot","ShadyCSS","nativeShadow","Document","prototype","CSSStyleSheet","s","Symbol","o","WeakMap","n","constructor","this","_$cssResult$","Error","cssText","styleSheet","length","get","replaceSync","set","toString","r","i","reduce","S","adoptedStyleSheets","map","document","createElement","litNonce","setAttribute","textContent","appendChild","c","cssRules","is","defineProperty","getOwnPropertyDescriptor","getOwnPropertyNames","h","getOwnPropertySymbols","getPrototypeOf","Object","a","trustedTypes","l","emptyScript","p","reactiveElementPolyfillSupport","d","u","toAttribute","Boolean","Array","JSON","stringify","fromAttribute","Number","parse","f","y","attribute","type","String","converter","reflect","hasChanged","metadata","litPropertyMetadata","b","HTMLElement","addInitializer","_$Ei","push","observedAttributes","finalize","_$Eh","keys","createProperty","state","elementProperties","noAccessor","getPropertyDescriptor","call","requestUpdate","configurable","enumerable","getPropertyOptions","hasOwnProperty","Map","finalized","properties","_$Eu","elementStyles","finalizeStyles","styles","isArray","Set","flat","reverse","unshift","toLowerCase","super","_$Ep","isUpdatePending","hasUpdated","_$Em","_$Ev","_$Eg","Promise","enableUpdating","_$AL","_$E_","forEach","addController","_$ES","renderRoot","isConnected","hostConnected","removeController","splice","indexOf","size","createRenderRoot","shadowRoot","attachShadow","shadowRootOptions","connectedCallback","disconnectedCallback","hostDisconnected","attributeChangedCallback","_$AK","_$EO","removeAttribute","C","_$EP","has","_$Ej","add","reject","scheduleUpdate","performUpdate","wrapped","shouldUpdate","willUpdate","hostUpdate","update","_$ET","_$AE","hostUpdated","firstUpdated","updated","updateComplete","getUpdateComplete","mode","ReactiveElement","reactiveElementVersions","createPolicy","createHTML","Math","random","slice","createComment","iterator","v","_","m","RegExp","g","$","_$litType$","strings","values","x","w","for","T","A","E","createTreeWalker","P","lastIndex","exec","test","startsWith","V","parts","el","currentNode","content","firstChild","replaceWith","childNodes","nextNode","nodeType","hasAttributes","getAttributeNames","endsWith","getAttribute","split","index","name","ctor","k","H","I","R","tagName","append","data","innerHTML","N","_$Co","_$Cl","_$litDirective$","_$AO","_$AT","_$AS","_$AV","_$AN","_$AD","_$AM","parentNode","_$AU","creationScope","importNode","M","nextSibling","L","_$AI","_$Cv","_$AH","_$AA","_$AB","options","startNode","endNode","_$AR","insertBefore","createTextNode","_$AC","_$AP","remove","setConnected","element","fill","O","arguments","toggleAttribute","capture","once","passive","removeEventListener","addEventListener","handleEvent","host","z","j","D","U","B","Z","litHtmlPolyfillSupport","litHtmlVersions","renderBefore","_$litPart$","renderOptions","_$Do","render","_$litElement$","litElementHydrateSupport","LitElement","litElementPolyfillSupport","litElementVersions"],"mappings":";;;;;AAKK,MAACA,EAAEC,WAAWC,EAAEF,EAAEG,kBAAa,IAASH,EAAEI,UAAUJ,EAAEI,SAASC,eAAe,uBAAuBC,SAASC,WAAW,YAAYC,cAAcD,UAAUE,EAAEC,SAASC,EAAE,IAAIC,QAAQ,MAAMC,EAAE,WAAAC,CAAYd,EAAEE,EAAES,GAAG,GAAGI,KAAKC,cAAa,EAAGL,IAAIF,EAAE,MAAMQ,MAAM,qEAAqEF,KAAKG,QAAQlB,EAAEe,KAAKf,EAAEE,CAAC,CAAC,cAAIiB,GAAa,IAAInB,EAAEe,KAAKJ,EAAE,MAAMF,EAAEM,KAAKf,EAAE,GAAGE,QAAG,IAASF,EAAE,CAAC,MAAME,OAAE,IAASO,GAAG,IAAIA,EAAEW,OAAOlB,IAAIF,EAAEW,EAAEU,IAAIZ,SAAI,IAAST,KAAKe,KAAKJ,EAAEX,EAAE,IAAIQ,eAAec,YAAYP,KAAKG,SAAShB,GAAGS,EAAEY,IAAId,EAAET,GAAG,CAAC,OAAOA,CAAC,CAAC,QAAAwB,GAAW,OAAOT,KAAKG,OAA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-tag.js","../node_modules/@lit/reactive-element/reactive-element.js","../node_modules/lit-html/lit-html.js","../node_modules/lit-element/lit-element.js","../node_modules/lit-html/is-server.js"],"sourcesContent":["/**\n * @license\n * Copyright 2019 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\nconst t=globalThis,e=t.ShadowRoot&&(void 0===t.ShadyCSS||t.ShadyCSS.nativeShadow)&&\"adoptedStyleSheets\"in Document.prototype&&\"replace\"in CSSStyleSheet.prototype,s=Symbol(),o=new WeakMap;class n{constructor(t,e,o){if(this._$cssResult$=!0,o!==s)throw Error(\"CSSResult is not constructable. Use `unsafeCSS` or `css` instead.\");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const s=this.t;if(e&&void 0===t){const e=void 0!==s&&1===s.length;e&&(t=o.get(s)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),e&&o.set(s,t))}return t}toString(){return this.cssText}}const r=t=>new n(\"string\"==typeof t?t:t+\"\",void 0,s),i=(t,...e)=>{const o=1===t.length?t[0]:e.reduce(((e,s,o)=>e+(t=>{if(!0===t._$cssResult$)return t.cssText;if(\"number\"==typeof t)return t;throw Error(\"Value passed to 'css' function must be a 'css' function result: \"+t+\". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.\")})(s)+t[o+1]),t[0]);return new n(o,t,s)},S=(s,o)=>{if(e)s.adoptedStyleSheets=o.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet));else for(const e of o){const o=document.createElement(\"style\"),n=t.litNonce;void 0!==n&&o.setAttribute(\"nonce\",n),o.textContent=e.cssText,s.appendChild(o)}},c=e?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e=\"\";for(const s of t.cssRules)e+=s.cssText;return r(e)})(t):t;export{n as CSSResult,S as adoptStyles,i as css,c as getCompatibleStyle,e as supportsAdoptingStyleSheets,r as unsafeCSS};\n//# sourceMappingURL=css-tag.js.map\n","import{getCompatibleStyle as t,adoptStyles as s}from\"./css-tag.js\";export{CSSResult,adoptStyles,css,getCompatibleStyle,supportsAdoptingStyleSheets,unsafeCSS}from\"./css-tag.js\";\n/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */const{is:i,defineProperty:e,getOwnPropertyDescriptor:r,getOwnPropertyNames:h,getOwnPropertySymbols:o,getPrototypeOf:n}=Object,a=globalThis,c=a.trustedTypes,l=c?c.emptyScript:\"\",p=a.reactiveElementPolyfillSupport,d=(t,s)=>t,u={toAttribute(t,s){switch(s){case Boolean:t=t?l:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,s){let i=t;switch(s){case Boolean:i=null!==t;break;case Number:i=null===t?null:Number(t);break;case Object:case Array:try{i=JSON.parse(t)}catch(t){i=null}}return i}},f=(t,s)=>!i(t,s),y={attribute:!0,type:String,converter:u,reflect:!1,hasChanged:f};Symbol.metadata??=Symbol(\"metadata\"),a.litPropertyMetadata??=new WeakMap;class b extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,s=y){if(s.state&&(s.attribute=!1),this._$Ei(),this.elementProperties.set(t,s),!s.noAccessor){const i=Symbol(),r=this.getPropertyDescriptor(t,i,s);void 0!==r&&e(this.prototype,t,r)}}static getPropertyDescriptor(t,s,i){const{get:e,set:h}=r(this.prototype,t)??{get(){return this[s]},set(t){this[s]=t}};return{get(){return e?.call(this)},set(s){const r=e?.call(this);h.call(this,s),this.requestUpdate(t,r,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??y}static _$Ei(){if(this.hasOwnProperty(d(\"elementProperties\")))return;const t=n(this);t.finalize(),void 0!==t.l&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(d(\"finalized\")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(d(\"properties\"))){const t=this.properties,s=[...h(t),...o(t)];for(const i of s)this.createProperty(i,t[i])}const t=this[Symbol.metadata];if(null!==t){const s=litPropertyMetadata.get(t);if(void 0!==s)for(const[t,i]of s)this.elementProperties.set(t,i)}this._$Eh=new Map;for(const[t,s]of this.elementProperties){const i=this._$Eu(t,s);void 0!==i&&this._$Eh.set(i,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(s){const i=[];if(Array.isArray(s)){const e=new Set(s.flat(1/0).reverse());for(const s of e)i.unshift(t(s))}else void 0!==s&&i.push(t(s));return i}static _$Eu(t,s){const i=s.attribute;return!1===i?void 0:\"string\"==typeof i?i:\"string\"==typeof t?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise((t=>this.enableUpdating=t)),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach((t=>t(this)))}addController(t){(this._$EO??=new Set).add(t),void 0!==this.renderRoot&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){const t=new Map,s=this.constructor.elementProperties;for(const i of s.keys())this.hasOwnProperty(i)&&(t.set(i,this[i]),delete this[i]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return s(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach((t=>t.hostConnected?.()))}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach((t=>t.hostDisconnected?.()))}attributeChangedCallback(t,s,i){this._$AK(t,i)}_$EC(t,s){const i=this.constructor.elementProperties.get(t),e=this.constructor._$Eu(t,i);if(void 0!==e&&!0===i.reflect){const r=(void 0!==i.converter?.toAttribute?i.converter:u).toAttribute(s,i.type);this._$Em=t,null==r?this.removeAttribute(e):this.setAttribute(e,r),this._$Em=null}}_$AK(t,s){const i=this.constructor,e=i._$Eh.get(t);if(void 0!==e&&this._$Em!==e){const t=i.getPropertyOptions(e),r=\"function\"==typeof t.converter?{fromAttribute:t.converter}:void 0!==t.converter?.fromAttribute?t.converter:u;this._$Em=e,this[e]=r.fromAttribute(s,t.type),this._$Em=null}}requestUpdate(t,s,i){if(void 0!==t){if(i??=this.constructor.getPropertyOptions(t),!(i.hasChanged??f)(this[t],s))return;this.P(t,s,i)}!1===this.isUpdatePending&&(this._$ES=this._$ET())}P(t,s,i){this._$AL.has(t)||this._$AL.set(t,s),!0===i.reflect&&this._$Em!==t&&(this._$Ej??=new Set).add(t)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[t,s]of this._$Ep)this[t]=s;this._$Ep=void 0}const t=this.constructor.elementProperties;if(t.size>0)for(const[s,i]of t)!0!==i.wrapped||this._$AL.has(s)||void 0===this[s]||this.P(s,this[s],i)}let t=!1;const s=this._$AL;try{t=this.shouldUpdate(s),t?(this.willUpdate(s),this._$EO?.forEach((t=>t.hostUpdate?.())),this.update(s)):this._$EU()}catch(s){throw t=!1,this._$EU(),s}t&&this._$AE(s)}willUpdate(t){}_$AE(t){this._$EO?.forEach((t=>t.hostUpdated?.())),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Ej&&=this._$Ej.forEach((t=>this._$EC(t,this[t]))),this._$EU()}updated(t){}firstUpdated(t){}}b.elementStyles=[],b.shadowRootOptions={mode:\"open\"},b[d(\"elementProperties\")]=new Map,b[d(\"finalized\")]=new Map,p?.({ReactiveElement:b}),(a.reactiveElementVersions??=[]).push(\"2.0.4\");export{b as ReactiveElement,u as defaultConverter,f as notEqual};\n//# sourceMappingURL=reactive-element.js.map\n","/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\nconst t=globalThis,i=t.trustedTypes,s=i?i.createPolicy(\"lit-html\",{createHTML:t=>t}):void 0,e=\"$lit$\",h=`lit$${Math.random().toFixed(9).slice(2)}$`,o=\"?\"+h,n=`<${o}>`,r=document,l=()=>r.createComment(\"\"),c=t=>null===t||\"object\"!=typeof t&&\"function\"!=typeof t,a=Array.isArray,u=t=>a(t)||\"function\"==typeof t?.[Symbol.iterator],d=\"[ \\t\\n\\f\\r]\",f=/<(?:(!--|\\/[^a-zA-Z])|(\\/?[a-zA-Z][^>\\s]*)|(\\/?$))/g,v=/-->/g,_=/>/g,m=RegExp(`>|${d}(?:([^\\\\s\"'>=/]+)(${d}*=${d}*(?:[^ \\t\\n\\f\\r\"'\\`<>=]|(\"|')|))|$)`,\"g\"),p=/'/g,g=/\"/g,$=/^(?:script|style|textarea|title)$/i,y=t=>(i,...s)=>({_$litType$:t,strings:i,values:s}),x=y(1),b=y(2),w=y(3),T=Symbol.for(\"lit-noChange\"),E=Symbol.for(\"lit-nothing\"),A=new WeakMap,C=r.createTreeWalker(r,129);function P(t,i){if(!a(t)||!t.hasOwnProperty(\"raw\"))throw Error(\"invalid template strings array\");return void 0!==s?s.createHTML(i):i}const V=(t,i)=>{const s=t.length-1,o=[];let r,l=2===i?\"\":3===i?\"\":\"\",c=f;for(let i=0;i\"===u[0]?(c=r??f,d=-1):void 0===u[1]?d=-2:(d=c.lastIndex-u[2].length,a=u[1],c=void 0===u[3]?m:'\"'===u[3]?g:p):c===g||c===p?c=m:c===v||c===_?c=f:(c=m,r=void 0);const x=c===m&&t[i+1].startsWith(\"/>\")?\" \":\"\";l+=c===f?s+n:d>=0?(o.push(a),s.slice(0,d)+e+s.slice(d)+h+x):s+h+(-2===d?i:x)}return[P(t,l+(t[s]||\"\")+(2===i?\"\":3===i?\"\":\"\")),o]};class N{constructor({strings:t,_$litType$:s},n){let r;this.parts=[];let c=0,a=0;const u=t.length-1,d=this.parts,[f,v]=V(t,s);if(this.el=N.createElement(f,n),C.currentNode=this.el.content,2===s||3===s){const t=this.el.content.firstChild;t.replaceWith(...t.childNodes)}for(;null!==(r=C.nextNode())&&d.length0){r.textContent=i?i.emptyScript:\"\";for(let i=0;i2||\"\"!==s[0]||\"\"!==s[1]?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=E}_$AI(t,i=this,s,e){const h=this.strings;let o=!1;if(void 0===h)t=S(this,t,i,0),o=!c(t)||t!==this._$AH&&t!==T,o&&(this._$AH=t);else{const e=t;let n,r;for(t=h[0],n=0;n{const e=s?.renderBefore??i;let h=e._$litPart$;if(void 0===h){const t=s?.renderBefore??null;e._$litPart$=h=new R(i.insertBefore(l(),t),t,void 0,s??{})}return h._$AI(t),h};export{Z as _$LH,x as html,w as mathml,T as noChange,E as nothing,B as render,b as svg};\n//# sourceMappingURL=lit-html.js.map\n","import{ReactiveElement as t}from\"@lit/reactive-element\";export*from\"@lit/reactive-element\";import{render as e,noChange as s}from\"lit-html\";export*from\"lit-html\";\n/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */class r extends t{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){const t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){const s=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=e(s,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return s}}r._$litElement$=!0,r[\"finalized\"]=!0,globalThis.litElementHydrateSupport?.({LitElement:r});const i=globalThis.litElementPolyfillSupport;i?.({LitElement:r});const o={_$AK:(t,e,s)=>{t._$AK(e,s)},_$AL:t=>t._$AL};(globalThis.litElementVersions??=[]).push(\"4.1.1\");export{r as LitElement,o as _$LE};\n//# sourceMappingURL=lit-element.js.map\n","/**\n * @license\n * Copyright 2022 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\nconst o=!1;export{o as isServer};\n//# sourceMappingURL=is-server.js.map\n"],"names":["t","globalThis","e","ShadowRoot","ShadyCSS","nativeShadow","Document","prototype","CSSStyleSheet","s","Symbol","o","WeakMap","n$2","constructor","this","_$cssResult$","Error","cssText","styleSheet","length","get","replaceSync","set","toString","r","n","i","reduce","S","adoptedStyleSheets","map","document","createElement","litNonce","setAttribute","textContent","appendChild","c","cssRules","is","defineProperty","getOwnPropertyDescriptor","getOwnPropertyNames","h","getOwnPropertySymbols","getPrototypeOf","Object","a","trustedTypes","l","emptyScript","p","reactiveElementPolyfillSupport","d","u","toAttribute","Boolean","Array","JSON","stringify","fromAttribute","Number","parse","f","y","attribute","type","String","converter","reflect","hasChanged","metadata","litPropertyMetadata","b$1","HTMLElement","addInitializer","_$Ei","push","observedAttributes","finalize","_$Eh","keys","createProperty","state","elementProperties","noAccessor","getPropertyDescriptor","call","requestUpdate","configurable","enumerable","getPropertyOptions","hasOwnProperty","Map","finalized","properties","_$Eu","elementStyles","finalizeStyles","styles","isArray","Set","flat","reverse","unshift","toLowerCase","super","_$Ep","isUpdatePending","hasUpdated","_$Em","_$Ev","_$ES","Promise","enableUpdating","_$AL","_$E_","forEach","addController","_$EO","add","renderRoot","isConnected","hostConnected","removeController","delete","size","createRenderRoot","shadowRoot","attachShadow","shadowRootOptions","connectedCallback","disconnectedCallback","hostDisconnected","attributeChangedCallback","_$AK","_$EC","removeAttribute","P","_$ET","has","_$Ej","reject","scheduleUpdate","performUpdate","wrapped","shouldUpdate","willUpdate","hostUpdate","update","_$EU","_$AE","hostUpdated","firstUpdated","updated","updateComplete","getUpdateComplete","b","mode","ReactiveElement","reactiveElementVersions","createPolicy","createHTML","Math","random","toFixed","slice","createComment","iterator","v","_","m","RegExp","g","$","_$litType$","strings","values","x","w","T","for","E","A","C","createTreeWalker","V","lastIndex","exec","test","startsWith","N","parts","el","currentNode","content","firstChild","replaceWith","childNodes","nextNode","nodeType","hasAttributes","getAttributeNames","endsWith","getAttribute","split","index","name","ctor","H","I","L","k","tagName","append","data","indexOf","innerHTML","_$Co","_$Cl","_$litDirective$","_$AO","_$AT","_$AS","M","_$AV","_$AN","_$AD","_$AM","parentNode","_$AU","creationScope","importNode","R","nextSibling","z","_$AI","_$Cv","_$AH","_$AA","_$AB","options","startNode","endNode","_$AR","O","insertBefore","createTextNode","_$AC","_$AP","remove","setConnected","element","fill","j","arguments","toggleAttribute","capture","once","passive","removeEventListener","addEventListener","handleEvent","host","Z","D","U","B","F","litHtmlPolyfillSupport","litHtmlVersions","renderBefore","_$litPart$","renderOptions","_$Do","render","_$litElement$","litElementHydrateSupport","LitElement","litElementPolyfillSupport","litElementVersions"],"mappings":";;;;;AAKK,MAACA,EAAEC,WAAWC,EAAEF,EAAEG,kBAAa,IAASH,EAAEI,UAAUJ,EAAEI,SAASC,eAAe,uBAAuBC,SAASC,WAAW,YAAYC,cAAcD,UAAUE,EAAEC,SAASC,EAAE,IAAIC,QAAA,IAAAC,EAAQ,MAAQ,WAAAC,CAAYd,EAAEE,EAAES,GAAG,GAAGI,KAAKC,cAAa,EAAGL,IAAIF,EAAE,MAAMQ,MAAM,qEAAqEF,KAAKG,QAAQlB,EAAEe,KAAKf,EAAEE,CAAC,CAAC,cAAIiB,GAAa,IAAInB,EAAEe,KAAKJ,EAAE,MAAMF,EAAEM,KAAKf,EAAE,GAAGE,QAAG,IAASF,EAAE,CAAC,MAAME,OAAE,IAASO,GAAG,IAAIA,EAAEW,OAAOlB,IAAIF,EAAEW,EAAEU,IAAIZ,SAAI,IAAST,KAAKe,KAAKJ,EAAEX,EAAE,IAAIQ,eAAec,YAAYP,KAAKG,SAAShB,GAAGS,EAAEY,IAAId,EAAET,GAAG,CAAC,OAAOA,CAAC,CAAC,QAAAwB,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E,EAAE2G,KAAKpH,GAAGA,EAAEoH,OAAOnH,WAAWwR,qBAAqB,IAAI3M,KAAK;;;;;;ACA3xB,MAACnE,IAAE","x_google_ignoreList":[0,1,2,3,4]} \ No newline at end of file diff --git a/public/third_party/lit/lib/static-html.d.ts b/public/third_party/lit/lib/static-html.d.ts new file mode 100644 index 000000000..a437b79bb --- /dev/null +++ b/public/third_party/lit/lib/static-html.d.ts @@ -0,0 +1,202 @@ +/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */ + +/** TemplateResult types */ +declare const HTML_RESULT = 1; +declare const SVG_RESULT = 2; +declare const MATHML_RESULT = 3; +type ResultType = typeof HTML_RESULT | typeof SVG_RESULT | typeof MATHML_RESULT; +/** + * The return type of the template tag functions, {@linkcode html} and + * {@linkcode svg} when it hasn't been compiled by @lit-labs/compiler. + * + * A `TemplateResult` object holds all the information about a template + * expression required to render it: the template strings, expression values, + * and type of template (html or svg). + * + * `TemplateResult` objects do not create any DOM on their own. To create or + * update DOM you need to render the `TemplateResult`. See + * [Rendering](https://lit.dev/docs/components/rendering) for more information. + * + */ +type UncompiledTemplateResult = { + ['_$litType$']: T; + strings: TemplateStringsArray; + values: unknown[]; +}; +/** + * The return type of the template tag functions, {@linkcode html} and + * {@linkcode svg}. + * + * A `TemplateResult` object holds all the information about a template + * expression required to render it: the template strings, expression values, + * and type of template (html or svg). + * + * `TemplateResult` objects do not create any DOM on their own. To create or + * update DOM you need to render the `TemplateResult`. See + * [Rendering](https://lit.dev/docs/components/rendering) for more information. + * + * In Lit 4, this type will be an alias of + * MaybeCompiledTemplateResult, so that code will get type errors if it assumes + * that Lit templates are not compiled. When deliberately working with only + * one, use either {@linkcode CompiledTemplateResult} or + * {@linkcode UncompiledTemplateResult} explicitly. + */ +type TemplateResult = UncompiledTemplateResult; +/** + * Interprets a template literal as an HTML template that can efficiently + * render to and update a container. + * + * ```ts + * const header = (title: string) => html`

${title}

`; + * ``` + * + * The `html` tag returns a description of the DOM to render as a value. It is + * lazy, meaning no work is done until the template is rendered. When rendering, + * if a template comes from the same expression as a previously rendered result, + * it's efficiently updated instead of replaced. + */ +declare const html$1: (strings: TemplateStringsArray, ...values: unknown[]) => TemplateResult<1>; +/** + * Interprets a template literal as an SVG fragment that can efficiently render + * to and update a container. + * + * ```ts + * const rect = svg``; + * + * const myImage = html` + * + * ${rect} + * `; + * ``` + * + * The `svg` *tag function* should only be used for SVG fragments, or elements + * that would be contained **inside** an `` HTML element. A common error is + * placing an `` *element* in a template tagged with the `svg` tag + * function. The `` element is an HTML element and should be used within a + * template tagged with the {@linkcode html} tag function. + * + * In LitElement usage, it's invalid to return an SVG fragment from the + * `render()` method, as the SVG fragment will be contained within the element's + * shadow root and thus not be properly contained within an `` HTML + * element. + */ +declare const svg$1: (strings: TemplateStringsArray, ...values: unknown[]) => TemplateResult<2>; +/** + * Interprets a template literal as MathML fragment that can efficiently render + * to and update a container. + * + * ```ts + * const num = mathml`1`; + * + * const eq = html` + * + * ${num} + * `; + * ``` + * + * The `mathml` *tag function* should only be used for MathML fragments, or + * elements that would be contained **inside** a `` HTML element. A common + * error is placing a `` *element* in a template tagged with the `mathml` + * tag function. The `` element is an HTML element and should be used + * within a template tagged with the {@linkcode html} tag function. + * + * In LitElement usage, it's invalid to return an MathML fragment from the + * `render()` method, as the MathML fragment will be contained within the + * element's shadow root and thus not be properly contained within a `` + * HTML element. + */ +declare const mathml$1: (strings: TemplateStringsArray, ...values: unknown[]) => TemplateResult<3>; + +/** + * @license + * Copyright 2020 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */ + +interface StaticValue { + /** The value to interpolate as-is into the template. */ + _$litStatic$: string; + /** + * A value that can't be decoded from ordinary JSON, make it harder for + * an attacker-controlled data that goes through JSON.parse to produce a valid + * StaticValue. + */ + r: typeof brand; +} +/** + * Prevents JSON injection attacks. + * + * The goals of this brand: + * 1) fast to check + * 2) code is small on the wire + * 3) multiple versions of Lit in a single page will all produce mutually + * interoperable StaticValues + * 4) normal JSON.parse (without an unusual reviver) can not produce a + * StaticValue + * + * Symbols satisfy (1), (2), and (4). We use Symbol.for to satisfy (3), but + * we don't care about the key, so we break ties via (2) and use the empty + * string. + */ +declare const brand: unique symbol; +/** + * Wraps a string so that it behaves like part of the static template + * strings instead of a dynamic value. + * + * Users must take care to ensure that adding the static string to the template + * results in well-formed HTML, or else templates may break unexpectedly. + * + * Note that this function is unsafe to use on untrusted content, as it will be + * directly parsed into HTML. Do not pass user input to this function + * without sanitizing it. + * + * Static values can be changed, but they will cause a complete re-render + * since they effectively create a new template. + */ +declare const unsafeStatic: (value: string) => StaticValue; +/** + * Tags a string literal so that it behaves like part of the static template + * strings instead of a dynamic value. + * + * The only values that may be used in template expressions are other tagged + * `literal` results or `unsafeStatic` values (note that untrusted content + * should never be passed to `unsafeStatic`). + * + * Users must take care to ensure that adding the static string to the template + * results in well-formed HTML, or else templates may break unexpectedly. + * + * Static values can be changed, but they will cause a complete re-render since + * they effectively create a new template. + */ +declare const literal: (strings: TemplateStringsArray, ...values: unknown[]) => StaticValue; +/** + * Wraps a lit-html template tag (`html` or `svg`) to add static value support. + */ +declare const withStatic: (coreTag: typeof html$1 | typeof svg$1 | typeof mathml$1) => (strings: TemplateStringsArray, ...values: unknown[]) => TemplateResult; +/** + * Interprets a template literal as an HTML template that can efficiently + * render to and update a container. + * + * Includes static value support from `lit-html/static.js`. + */ +declare const html: (strings: TemplateStringsArray, ...values: unknown[]) => TemplateResult; +/** + * Interprets a template literal as an SVG template that can efficiently + * render to and update a container. + * + * Includes static value support from `lit-html/static.js`. + */ +declare const svg: (strings: TemplateStringsArray, ...values: unknown[]) => TemplateResult; +/** + * Interprets a template literal as MathML fragment that can efficiently render + * to and update a container. + * + * Includes static value support from `lit-html/static.js`. + */ +declare const mathml: (strings: TemplateStringsArray, ...values: unknown[]) => TemplateResult; + +export { StaticValue, html, literal, mathml, svg, unsafeStatic, withStatic }; diff --git a/public/third_party/lit/lib/static-html.js b/public/third_party/lit/lib/static-html.js new file mode 100644 index 000000000..2fd77bd5a --- /dev/null +++ b/public/third_party/lit/lib/static-html.js @@ -0,0 +1,13 @@ +/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */ +const t=globalThis,e=t.trustedTypes,s=e?e.createPolicy("lit-html",{createHTML:t=>t}):void 0,i="$lit$",n=`lit$${Math.random().toFixed(9).slice(2)}$`,o="?"+n,r=`<${o}>`,h=document,l=()=>h.createComment(""),$=t=>null===t||"object"!=typeof t&&"function"!=typeof t,a=Array.isArray,c="[ \t\n\f\r]",_=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,A=/-->/g,p=/>/g,d=RegExp(`>|${c}(?:([^\\s"'>=/]+)(${c}*=${c}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),u=/'/g,g=/"/g,f=/^(?:script|style|textarea|title)$/i,v=t=>(e,...s)=>({_$litType$:t,strings:e,values:s}),m=v(1),y=v(2),x=v(3),H=Symbol.for("lit-noChange"),N=Symbol.for("lit-nothing"),b=new WeakMap,S=h.createTreeWalker(h,129);function T(t,e){if(!a(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==s?s.createHTML(e):e}const M=(t,e)=>{const s=t.length-1,o=[];let h,l=2===e?"":3===e?"":"",$=_;for(let e=0;e"===c[0]?($=h??_,v=-1):void 0===c[1]?v=-2:(v=$.lastIndex-c[2].length,a=c[1],$=void 0===c[3]?d:'"'===c[3]?g:u):$===g||$===u?$=d:$===A||$===p?$=_:($=d,h=void 0);const y=$===d&&t[e+1].startsWith("/>")?" ":"";l+=$===_?s+r:v>=0?(o.push(a),s.slice(0,v)+i+s.slice(v)+n+y):s+n+(-2===v?e:y)}return[T(t,l+(t[s]||"")+(2===e?"":3===e?"":"")),o]};class w{constructor({strings:t,_$litType$:s},r){let h;this.parts=[];let $=0,a=0;const c=t.length-1,_=this.parts,[A,p]=M(t,s);if(this.el=w.createElement(A,r),S.currentNode=this.el.content,2===s||3===s){const t=this.el.content.firstChild;t.replaceWith(...t.childNodes)}for(;null!==(h=S.nextNode())&&_.length0){h.textContent=e?e.emptyScript:"";for(let e=0;ea(t)||"function"==typeof t?.[Symbol.iterator])(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==N&&$(this._$AH)?this._$AA.nextSibling.data=t:this.T(h.createTextNode(t)),this._$AH=t}$(t){const{values:e,_$litType$:s}=t,i="number"==typeof s?this._$AC(t):(void 0===s.el&&(s.el=w.createElement(T(s.h,s.h[0]),this.options)),s);if(this._$AH?._$AD===i)this._$AH.p(e);else{const t=new E(i,this),s=t.u(this.options);t.p(e),this.T(s),this._$AH=t}}_$AC(t){let e=b.get(t.strings);return void 0===e&&b.set(t.strings,e=new w(t)),e}k(t){a(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let s,i=0;for(const n of t)i===e.length?e.push(s=new I(this.O(l()),this.O(l()),this,this.options)):s=e[i],s._$AI(n),i++;i2||""!==s[0]||""!==s[1]?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=N}_$AI(t,e=this,s,i){const n=this.strings;let o=!1;if(void 0===n)t=C(this,t,e,0),o=!$(t)||t!==this._$AH&&t!==H,o&&(this._$AH=t);else{const i=t;let r,h;for(t=n[0],r=0;r{if(t?.r===k)return t?._$litStatic$},P=t=>({_$litStatic$:t,r:k}),V=(t,...e)=>({_$litStatic$:e.reduce(((e,s,i)=>e+(t=>{if(void 0!==t._$litStatic$)return t._$litStatic$;throw Error(`Value passed to 'literal' function must be a 'literal' result: ${t}. Use 'unsafeStatic' to pass non-literal values, but\n take care to ensure page security.`)})(s)+t[i+1]),t[0]),r:k}),D=new Map,z=t=>(e,...s)=>{const i=s.length;let n,o;const r=[],h=[];let l,$=0,a=!1;for(;$t}):void 0,e=\"$lit$\",h=`lit$${Math.random().toFixed(9).slice(2)}$`,o=\"?\"+h,n=`<${o}>`,r=document,l=()=>r.createComment(\"\"),c=t=>null===t||\"object\"!=typeof t&&\"function\"!=typeof t,a=Array.isArray,u=t=>a(t)||\"function\"==typeof t?.[Symbol.iterator],d=\"[ \\t\\n\\f\\r]\",f=/<(?:(!--|\\/[^a-zA-Z])|(\\/?[a-zA-Z][^>\\s]*)|(\\/?$))/g,v=/-->/g,_=/>/g,m=RegExp(`>|${d}(?:([^\\\\s\"'>=/]+)(${d}*=${d}*(?:[^ \\t\\n\\f\\r\"'\\`<>=]|(\"|')|))|$)`,\"g\"),p=/'/g,g=/\"/g,$=/^(?:script|style|textarea|title)$/i,y=t=>(i,...s)=>({_$litType$:t,strings:i,values:s}),x=y(1),b=y(2),w=y(3),T=Symbol.for(\"lit-noChange\"),E=Symbol.for(\"lit-nothing\"),A=new WeakMap,C=r.createTreeWalker(r,129);function P(t,i){if(!a(t)||!t.hasOwnProperty(\"raw\"))throw Error(\"invalid template strings array\");return void 0!==s?s.createHTML(i):i}const V=(t,i)=>{const s=t.length-1,o=[];let r,l=2===i?\"\":3===i?\"\":\"\",c=f;for(let i=0;i\"===u[0]?(c=r??f,d=-1):void 0===u[1]?d=-2:(d=c.lastIndex-u[2].length,a=u[1],c=void 0===u[3]?m:'\"'===u[3]?g:p):c===g||c===p?c=m:c===v||c===_?c=f:(c=m,r=void 0);const x=c===m&&t[i+1].startsWith(\"/>\")?\" \":\"\";l+=c===f?s+n:d>=0?(o.push(a),s.slice(0,d)+e+s.slice(d)+h+x):s+h+(-2===d?i:x)}return[P(t,l+(t[s]||\"\")+(2===i?\"\":3===i?\"\":\"\")),o]};class N{constructor({strings:t,_$litType$:s},n){let r;this.parts=[];let c=0,a=0;const u=t.length-1,d=this.parts,[f,v]=V(t,s);if(this.el=N.createElement(f,n),C.currentNode=this.el.content,2===s||3===s){const t=this.el.content.firstChild;t.replaceWith(...t.childNodes)}for(;null!==(r=C.nextNode())&&d.length0){r.textContent=i?i.emptyScript:\"\";for(let i=0;i2||\"\"!==s[0]||\"\"!==s[1]?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=E}_$AI(t,i=this,s,e){const h=this.strings;let o=!1;if(void 0===h)t=S(this,t,i,0),o=!c(t)||t!==this._$AH&&t!==T,o&&(this._$AH=t);else{const e=t;let n,r;for(t=h[0],n=0;n{const e=s?.renderBefore??i;let h=e._$litPart$;if(void 0===h){const t=s?.renderBefore??null;e._$litPart$=h=new R(i.insertBefore(l(),t),t,void 0,s??{})}return h._$AI(t),h};export{Z as _$LH,x as html,w as mathml,T as noChange,E as nothing,B as render,b as svg};\n//# sourceMappingURL=lit-html.js.map\n","import{html as t,svg as r,mathml as e}from\"./lit-html.js\";\n/**\n * @license\n * Copyright 2020 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\nconst a=Symbol.for(\"\"),o=t=>{if(t?.r===a)return t?._$litStatic$},s=t=>({_$litStatic$:t,r:a}),i=(t,...r)=>({_$litStatic$:r.reduce(((r,e,a)=>r+(t=>{if(void 0!==t._$litStatic$)return t._$litStatic$;throw Error(`Value passed to 'literal' function must be a 'literal' result: ${t}. Use 'unsafeStatic' to pass non-literal values, but\\n take care to ensure page security.`)})(e)+t[a+1]),t[0]),r:a}),l=new Map,n=t=>(r,...e)=>{const a=e.length;let s,i;const n=[],u=[];let c,$=0,f=!1;for(;$ { function assertIsAdorner(element) { assert.strictEqual(element.tagName, ADORNER_TAG_NAME, `element tag name is not ${ADORNER_TAG_NAME}`); - assert.isTrue(element instanceof Adorners.Adorner.Adorner, 'element is not an instance of Adorner'); + assert.instanceOf(element, Adorners.Adorner.Adorner, 'element is not an instance of Adorner'); assert.strictEqual(Object.getPrototypeOf(element), Adorners.Adorner.Adorner.prototype, 'element is not on Adorner\'s prototype chain'); } it('can be created by document.createElement', () => { @@ -88,7 +88,7 @@ describe('Adorner', () => { name: 'foo', }; const slottedChildren = adorner.querySelectorAll('[slot="content"]'); - assert.strictEqual(slottedChildren.length, 1, 'adorner light dom should only have one child with [slot="content"]'); + assert.lengthOf(slottedChildren, 1, 'adorner light dom should only have one child with [slot="content"]'); assert.strictEqual(slottedChildren[0].textContent, 'content 3', 'adorner content slot should have the most recent content'); }); }); diff --git a/public/ui/components/adorners/Adorner.test.js.map b/public/ui/components/adorners/Adorner.test.js.map index 94e3d6180..1c7992e96 100644 --- a/public/ui/components/adorners/Adorner.test.js.map +++ b/public/ui/components/adorners/Adorner.test.js.map @@ -1 +1 @@ -{"version":3,"file":"Adorner.test.js","sourceRoot":"","sources":["../../../../../../../front_end/ui/components/adorners/Adorner.test.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,KAAK,MAAM,MAAM,gCAAgC,CAAC;AAGzD,OAAO,KAAK,QAAQ,MAAM,eAAe,CAAC;AAE1C,MAAM,gBAAgB,GAAG,kBAAkB,CAAC;AAE5C,QAAQ,CAAC,SAAS,EAAE,GAAG,EAAE;IACvB,SAAS,eAAe,CAAC,OAAoB;QAC3C,MAAM,CAAC,WAAW,CAAC,OAAO,CAAC,OAAO,EAAE,gBAAgB,EAAE,2BAA2B,gBAAgB,EAAE,CAAC,CAAC;QACrG,MAAM,CAAC,MAAM,CAAC,OAAO,YAAY,QAAQ,CAAC,OAAO,CAAC,OAAO,EAAE,uCAAuC,CAAC,CAAC;QACpG,MAAM,CAAC,WAAW,CACd,MAAM,CAAC,cAAc,CAAC,OAAO,CAAC,EAAE,QAAQ,CAAC,OAAO,CAAC,OAAO,CAAC,SAAS,EAClE,8CAA8C,CAAC,CAAC;IACtD,CAAC;IAED,EAAE,CAAC,0CAA0C,EAAE,GAAG,EAAE;QAClD,MAAM,OAAO,GAAG,QAAQ,CAAC,aAAa,CAAC,kBAAkB,CAAC,CAAC;QAC3D,eAAe,CAAC,OAAO,CAAC,CAAC;IAC3B,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,yDAAyD,EAAE,GAAG,EAAE;QACjE,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M,EAAE,CAAC,EAAE,oEAAoE,CAAC,CAAC;QACpH,MAAM,CAAC,WAAW,CACd,eAAe,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,WAAW,EAAE,0DAA0D,CAAC,CAAC;IAC/G,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["// Copyright 2020 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport * as Common from '../../../core/common/common.js';\nimport type * as Platform from '../../../core/platform/platform.js';\n\nimport * as Adorners from './adorners.js';\n\nconst ADORNER_TAG_NAME = 'DEVTOOLS-ADORNER';\n\ndescribe('Adorner', () => {\n function assertIsAdorner(element: HTMLElement) {\n assert.strictEqual(element.tagName, ADORNER_TAG_NAME, `element tag name is not ${ADORNER_TAG_NAME}`);\n assert.isTrue(element instanceof Adorners.Adorner.Adorner, 'element is not an instance of Adorner');\n assert.strictEqual(\n Object.getPrototypeOf(element), Adorners.Adorner.Adorner.prototype,\n 'element is not on Adorner\\'s prototype chain');\n }\n\n it('can be created by document.createElement', () => {\n const adorner = document.createElement('devtools-adorner');\n assertIsAdorner(adorner);\n });\n\n it('can interacts as a toggle button with proper ARIA setup', () => {\n const content = document.createElement('span');\n const adorner = new Adorners.Adorner.Adorner();\n adorner.data = {\n content,\n name: 'foo',\n };\n assert.isNull(adorner.getAttribute('role'), 'non-interactive adorner had wrong aria role value');\n\n let clickCounter = 0;\n const clickListener = () => {\n clickCounter++;\n };\n\n const ariaLabelDefault = 'adorner toggled on' as Platform.UIString.LocalizedString;\n const ariaLabelActive = 'adorner toggled off' as Platform.UIString.LocalizedString;\n adorner.addInteraction(clickListener, {\n isToggle: true,\n shouldPropagateOnKeydown: false,\n ariaLabelActive,\n ariaLabelDefault,\n });\n assert.strictEqual(\n adorner.getAttribute('aria-label'), ariaLabelDefault,\n 'interactive adorner didn\\'t have correct initial aria-label value');\n assert.strictEqual(\n adorner.getAttribute('role'), 'button', 'interactive adorner didn\\'t have correct aria role setup');\n assert.strictEqual(\n adorner.getAttribute('aria-pressed'), 'false',\n 'toggle adorner didn\\'t have correct initial aria-pressed value');\n\n adorner.click();\n assert.strictEqual(clickCounter, 1, 'interactive adorner was not triggered by clicking');\n assert.strictEqual(\n adorner.getAttribute('aria-label'), ariaLabelActive,\n 'interactive adorner didn\\'t have correct active aria-label value');\n assert.strictEqual(\n adorner.getAttribute('aria-pressed'), 'true', 'toggle adorner didn\\'t have correct active aria-pressed value');\n\n adorner.dispatchEvent(new KeyboardEvent('keydown', {code: 'Enter'}));\n assert.strictEqual(clickCounter, 2, 'interactive adorner was not triggered by Enter key');\n assert.strictEqual(\n adorner.getAttribute('aria-label'), ariaLabelDefault,\n 'interactive adorner didn\\'t have correct inactive aria-label value');\n assert.strictEqual(\n adorner.getAttribute('aria-pressed'), 'false',\n 'toggle adorner didn\\'t have correct inactive aria-pressed value');\n\n adorner.dispatchEvent(new KeyboardEvent('keydown', {code: 'Space'}));\n assert.strictEqual(clickCounter, 3, 'interactive adorner was not triggered by Space key');\n assert.strictEqual(\n adorner.getAttribute('aria-label'), ariaLabelActive,\n 'interactive adorner didn\\'t have correct active aria-label value');\n assert.strictEqual(\n adorner.getAttribute('aria-pressed'), 'true', 'toggle adorner didn\\'t have correct active aria-pressed value');\n });\n\n it('can be toggled programmatically', () => {\n const content = document.createElement('span');\n const adorner = new Adorners.Adorner.Adorner();\n adorner.data = {\n content,\n name: 'foo',\n };\n adorner.addInteraction(() => {}, {\n isToggle: true,\n shouldPropagateOnKeydown: false,\n ariaLabelActive: Common.UIString.LocalizedEmptyString,\n ariaLabelDefault: Common.UIString.LocalizedEmptyString,\n });\n assert.strictEqual(\n adorner.getAttribute('aria-pressed'), 'false',\n 'toggle adorner didn\\'t have correct initial aria-pressed value');\n\n adorner.toggle();\n assert.strictEqual(\n adorner.getAttribute('aria-pressed'), 'true', 'toggle adorner didn\\'t have correct active aria-pressed value');\n });\n\n it('only contains the most recently slotted content after multiple data setting calls', () => {\n const content1 = document.createElement('span');\n content1.textContent = 'content 1';\n\n const content2 = document.createElement('div');\n content2.textContent = 'content 2';\n\n const content3 = document.createElement('span');\n content3.textContent = 'content 3';\n\n const adorner = new Adorners.Adorner.Adorner();\n adorner.data = {\n content: content1,\n name: 'foo',\n };\n adorner.data = {\n content: content2,\n name: 'foo',\n };\n adorner.data = {\n content: content3,\n name: 'foo',\n };\n\n const slottedChildren = adorner.querySelectorAll('[slot=\"content\"]');\n assert.strictEqual(slottedChildren.length, 1, 'adorner light dom should only have one child with [slot=\"content\"]');\n assert.strictEqual(\n slottedChildren[0].textContent, 'content 3', 'adorner content slot should have the most recent content');\n });\n});\n"]} \ No newline at end of file +{"version":3,"file":"Adorner.test.js","sourceRoot":"","sources":["../../../../../../../front_end/ui/components/adorners/Adorner.test.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,KAAK,MAAM,MAAM,gCAAgC,CAAC;AAGzD,OAAO,KAAK,QAAQ,MAAM,eAAe,CAAC;AAE1C,MAAM,gBAAgB,GAAG,kBAAkB,CAAC;AAE5C,QAAQ,CAAC,SAAS,EAAE,GAAG,EAAE;IACvB,SAAS,eAAe,CAAC,OAAoB;QAC3C,MAAM,CAAC,WAAW,CAAC,OAAO,CAAC,OAAO,EAAE,gBAAgB,EAAE,2BAA2B,gBAAgB,EAAE,CAAC,CAAC;QACrG,MAAM,CAAC,UAAU,CAAC,OAAO,EAAE,QAAQ,CAAC,OAAO,CAAC,OAAO,EAAE,uCAAuC,CAAC,CAAC;QAC9F,MAAM,CAAC,WAAW,CACd,MAAM,CAAC,cAAc,CAAC,OAAO,CAAC,EAAE,QAAQ,CAAC,OAAO,CAAC,OAAO,CAAC,SAAS,EAClE,8CAA8C,CAAC,CAAC;IACtD,CAAC;IAED,EAAE,CAAC,0CAA0C,EAAE,GAAG,EAAE;QAClD,MAAM,OAAO,GAAG,QAAQ,CAAC,aAAa,CAAC,kBAAkB,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,CAAC;QAEF,MAAM,eAAe,GAAG,OAAO,CAAC,gBAAgB,CAAC,kBAAkB,CAAC,CAAC;QACrE,MAAM,CAAC,QAAQ,CAAC,eAAe,EAAE,CAAC,EAAE,oEAAoE,CAAC,CAAC;QAC1G,MAAM,CAAC,WAAW,CACd,eAAe,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,WAAW,EAAE,0DAA0D,CAAC,CAAC;IAC/G,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["// Copyright 2020 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport * as Common from '../../../core/common/common.js';\nimport type * as Platform from '../../../core/platform/platform.js';\n\nimport * as Adorners from './adorners.js';\n\nconst ADORNER_TAG_NAME = 'DEVTOOLS-ADORNER';\n\ndescribe('Adorner', () => {\n function assertIsAdorner(element: HTMLElement) {\n assert.strictEqual(element.tagName, ADORNER_TAG_NAME, `element tag name is not ${ADORNER_TAG_NAME}`);\n assert.instanceOf(element, Adorners.Adorner.Adorner, 'element is not an instance of Adorner');\n assert.strictEqual(\n Object.getPrototypeOf(element), Adorners.Adorner.Adorner.prototype,\n 'element is not on Adorner\\'s prototype chain');\n }\n\n it('can be created by document.createElement', () => {\n const adorner = document.createElement('devtools-adorner');\n assertIsAdorner(adorner);\n });\n\n it('can interacts as a toggle button with proper ARIA setup', () => {\n const content = document.createElement('span');\n const adorner = new Adorners.Adorner.Adorner();\n adorner.data = {\n content,\n name: 'foo',\n };\n assert.isNull(adorner.getAttribute('role'), 'non-interactive adorner had wrong aria role value');\n\n let clickCounter = 0;\n const clickListener = () => {\n clickCounter++;\n };\n\n const ariaLabelDefault = 'adorner toggled on' as Platform.UIString.LocalizedString;\n const ariaLabelActive = 'adorner toggled off' as Platform.UIString.LocalizedString;\n adorner.addInteraction(clickListener, {\n isToggle: true,\n shouldPropagateOnKeydown: false,\n ariaLabelActive,\n ariaLabelDefault,\n });\n assert.strictEqual(\n adorner.getAttribute('aria-label'), ariaLabelDefault,\n 'interactive adorner didn\\'t have correct initial aria-label value');\n assert.strictEqual(\n adorner.getAttribute('role'), 'button', 'interactive adorner didn\\'t have correct aria role setup');\n assert.strictEqual(\n adorner.getAttribute('aria-pressed'), 'false',\n 'toggle adorner didn\\'t have correct initial aria-pressed value');\n\n adorner.click();\n assert.strictEqual(clickCounter, 1, 'interactive adorner was not triggered by clicking');\n assert.strictEqual(\n adorner.getAttribute('aria-label'), ariaLabelActive,\n 'interactive adorner didn\\'t have correct active aria-label value');\n assert.strictEqual(\n adorner.getAttribute('aria-pressed'), 'true', 'toggle adorner didn\\'t have correct active aria-pressed value');\n\n adorner.dispatchEvent(new KeyboardEvent('keydown', {code: 'Enter'}));\n assert.strictEqual(clickCounter, 2, 'interactive adorner was not triggered by Enter key');\n assert.strictEqual(\n adorner.getAttribute('aria-label'), ariaLabelDefault,\n 'interactive adorner didn\\'t have correct inactive aria-label value');\n assert.strictEqual(\n adorner.getAttribute('aria-pressed'), 'false',\n 'toggle adorner didn\\'t have correct inactive aria-pressed value');\n\n adorner.dispatchEvent(new KeyboardEvent('keydown', {code: 'Space'}));\n assert.strictEqual(clickCounter, 3, 'interactive adorner was not triggered by Space key');\n assert.strictEqual(\n adorner.getAttribute('aria-label'), ariaLabelActive,\n 'interactive adorner didn\\'t have correct active aria-label value');\n assert.strictEqual(\n adorner.getAttribute('aria-pressed'), 'true', 'toggle adorner didn\\'t have correct active aria-pressed value');\n });\n\n it('can be toggled programmatically', () => {\n const content = document.createElement('span');\n const adorner = new Adorners.Adorner.Adorner();\n adorner.data = {\n content,\n name: 'foo',\n };\n adorner.addInteraction(() => {}, {\n isToggle: true,\n shouldPropagateOnKeydown: false,\n ariaLabelActive: Common.UIString.LocalizedEmptyString,\n ariaLabelDefault: Common.UIString.LocalizedEmptyString,\n });\n assert.strictEqual(\n adorner.getAttribute('aria-pressed'), 'false',\n 'toggle adorner didn\\'t have correct initial aria-pressed value');\n\n adorner.toggle();\n assert.strictEqual(\n adorner.getAttribute('aria-pressed'), 'true', 'toggle adorner didn\\'t have correct active aria-pressed value');\n });\n\n it('only contains the most recently slotted content after multiple data setting calls', () => {\n const content1 = document.createElement('span');\n content1.textContent = 'content 1';\n\n const content2 = document.createElement('div');\n content2.textContent = 'content 2';\n\n const content3 = document.createElement('span');\n content3.textContent = 'content 3';\n\n const adorner = new Adorners.Adorner.Adorner();\n adorner.data = {\n content: content1,\n name: 'foo',\n };\n adorner.data = {\n content: content2,\n name: 'foo',\n };\n adorner.data = {\n content: content3,\n name: 'foo',\n };\n\n const slottedChildren = adorner.querySelectorAll('[slot=\"content\"]');\n assert.lengthOf(slottedChildren, 1, 'adorner light dom should only have one child with [slot=\"content\"]');\n assert.strictEqual(\n slottedChildren[0].textContent, 'content 3', 'adorner content slot should have the most recent content');\n });\n});\n"]} \ No newline at end of file diff --git a/public/ui/components/buttons/button.css.legacy.js b/public/ui/components/buttons/button.css.legacy.js index 6ca91b1d5..8a97ced33 100644 --- a/public/ui/components/buttons/button.css.legacy.js +++ b/public/ui/components/buttons/button.css.legacy.js @@ -222,7 +222,7 @@ button { } } - &:not(.icon):not(.toolbar).only-icon { + &:not(.icon, .toolbar).only-icon { width: 100%; padding: 0; @@ -258,11 +258,11 @@ button { background-color: var(--hover-layer-color); /* stylelint-disable-line plugin/use_theme_colors */ &.primary { - border: var(--button-border-size) solid color-mix(in sRGB, var(--sys-color-primary), var(--sys-color-state-hover-on-prominent) 6%); + border: var(--button-border-size) solid color-mix(in srgb, var(--sys-color-primary), var(--sys-color-state-hover-on-prominent) 6%); } &.tonal { - background: color-mix(in sRGB, var(--sys-color-tonal-container), var(--sys-color-state-hover-on-subtle)); + background: color-mix(in srgb, var(--sys-color-tonal-container), var(--sys-color-state-hover-on-subtle)); } &.toobar { @@ -284,11 +284,11 @@ button { background-color: var(--active-layer-color); /* stylelint-disable-line plugin/use_theme_colors */ &.primary { - border: var(--button-border-size) solid color-mix(in sRGB, var(--sys-color-primary), var(--sys-color-state-ripple-primary) 32%); + border: var(--button-border-size) solid color-mix(in srgb, var(--sys-color-primary), var(--sys-color-state-ripple-primary) 32%); } &.tonal { - background: color-mix(in sRGB, var(--sys-color-tonal-container), var(--sys-color-state-ripple-primary) 50%); + background: color-mix(in srgb, var(--sys-color-tonal-container), var(--sys-color-state-ripple-primary) 50%); } &.toolbar { diff --git a/public/ui/components/chrome_link/ChromeLink.test.js b/public/ui/components/chrome_link/ChromeLink.test.js index 3050e56d7..781fdc9b7 100644 --- a/public/ui/components/chrome_link/ChromeLink.test.js +++ b/public/ui/components/chrome_link/ChromeLink.test.js @@ -5,10 +5,9 @@ import { renderElementIntoDOM } from '../../../testing/DOMHelpers.js'; import { createTarget } from '../../../testing/EnvironmentHelpers.js'; import { describeWithMockConnection } from '../../../testing/MockConnection.js'; import * as LitHtml from '../../lit-html/lit-html.js'; -import * as Coordinator from '../render_coordinator/render_coordinator.js'; +import * as RenderCoordinator from '../render_coordinator/render_coordinator.js'; import * as ChromeLink from './chrome_link.js'; const { html } = LitHtml; -const coordinator = Coordinator.RenderCoordinator.RenderCoordinator.instance(); describeWithMockConnection('ChromeLink', () => { it('renders a link when given a \'chrome://\' URL', async () => { const target = createTarget(); @@ -22,7 +21,7 @@ describeWithMockConnection('ChromeLink', () => { `, container, { host: this }); // clang-format on renderElementIntoDOM(container); - await coordinator.done(); + await RenderCoordinator.done(); const chromeLink = container.querySelector('devtools-chrome-link'); assert.instanceOf(chromeLink, ChromeLink.ChromeLink.ChromeLink); assert.isNotNull(chromeLink.shadowRoot); diff --git a/public/ui/components/chrome_link/ChromeLink.test.js.map b/public/ui/components/chrome_link/ChromeLink.test.js.map index 95fba8fcb..c368943fa 100644 --- a/public/ui/components/chrome_link/ChromeLink.test.js.map +++ b/public/ui/components/chrome_link/ChromeLink.test.js.map @@ -1 +1 @@ -{"version":3,"file":"ChromeLink.test.js","sourceRoot":"","sources":["../../../../../../../front_end/ui/components/chrome_link/ChromeLink.test.ts"],"names":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AC,CAAC;QACxC,MAAM,CAAC,WAAW,CAAC,UAAU,CAAC,SAAS,CAAC,IAAI,EAAE,EAAE,WAAW,CAAC,CAAC;QAE7D,MAAM,IAAI,GAAG,UAAU,CAAC,UAAU,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC;QACtD,MAAM,CAAC,UAAU,CAAC,IAAI,EAAE,iBAAiB,CAAC,CAAC;QAC3C,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;QAC7B,IAAI,CAAC,KAAK,EAAE,CAAC;QAEb,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;QAC9B,MAAM,CAAC,SAAS,CAAC,GAAG,CAAC,SAAS,CAAC,QAAQ,EAAE,EAAC,GAAG,EAAE,mBAAmB,EAAC,CAAC,CAAC;IACvE,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC;AAEH,QAAQ,CAAC,YAAY,EAAE,GAAG,EAAE;IAC1B,EAAE,CAAC,oDAAoD,EAAE,KAAK,IAAI,EAAE;QAClE,MAAM,SAAS,GAAG,IAAI,UAAU,CAAC,UAAU,CAAC,UAAU,EAAE,CAAC;QACzD,MAAM,CAAC,MAAM,CAAC,GAAG,EAAE;YACjB,SAAS,CAAC,IAAI,GAAG,yBAA4D,CAAC;QAChF,CAAC,EAAE,mDAAmD,CAAC,CAAC;IAC1D,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["// Copyright 2022 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport type * as Platform from '../../../core/platform/platform.js';\nimport {renderElementIntoDOM} from '../../../testing/DOMHelpers.js';\nimport {createTarget} from '../../../testing/EnvironmentHelpers.js';\nimport {describeWithMockConnection} from '../../../testing/MockConnection.js';\nimport * as LitHtml from '../../lit-html/lit-html.js';\nimport * as Coordinator from '../render_coordinator/render_coordinator.js';\n\nimport * as ChromeLink from './chrome_link.js';\n\nconst {html} = LitHtml;\n\nconst coordinator = Coordinator.RenderCoordinator.RenderCoordinator.instance();\n\ndescribeWithMockConnection('ChromeLink', () => {\n it('renders a link when given a \\'chrome://\\' URL', async () => {\n const target = createTarget();\n const spy = sinon.spy(target.targetAgent(), 'invoke_createTarget');\n\n const container = document.createElement('div');\n // clang-format off\n LitHtml.render(\n html`\n \n link text\n \n `,\n container, {host: this},\n );\n // clang-format on\n renderElementIntoDOM(container);\n await coordinator.done();\n\n const chromeLink = container.querySelector('devtools-chrome-link');\n assert.instanceOf(chromeLink, ChromeLink.ChromeLink.ChromeLink);\n assert.isNotNull(chromeLink.shadowRoot);\n assert.strictEqual(chromeLink.innerHTML.trim(), 'link text');\n\n const link = chromeLink.shadowRoot.querySelector('a');\n assert.instanceOf(link, HTMLAnchorElement);\n assert.isTrue(spy.notCalled);\n link.click();\n\n assert.isTrue(spy.calledOnce);\n assert.deepEqual(spy.firstCall.firstArg, {url: 'chrome://settings'});\n });\n});\n\ndescribe('ChromeLink', () => {\n it('throws an error when given a non-\\'chrome://\\' URL', async () => {\n const component = new ChromeLink.ChromeLink.ChromeLink();\n assert.throws(() => {\n component.href = 'https://www.example.com' as Platform.DevToolsPath.UrlString;\n }, 'ChromeLink href needs to start with \\'chrome://\\'');\n });\n});\n"]} \ No newline at end of file +{"version":3,"file":"ChromeLink.test.js","sourceRoot":"","sources":["../../../../../../../front_end/ui/components/chrome_link/ChromeLink.test.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAG7B,OAAO,EAAC,oBAAoB,EAAC,MAAM,gCAAgC,CAAC;AACpE,OAAO,EAAC,YAAY,EAAC,MAAM,wCAAwC,CAAC;AACpE,OAAO,EAAC,0BAA0B,EAAC,MAAM,oCAAoC,CAAC;AAC9E,OAAO,KAAK,OAAO,MAAM,4BAA4B,CAAC;AACtD,OAAO,KAAK,iBAAiB,MAAM,6CAA6C,CAAC;AAEjF,OAAO,KAAK,UAAU,MAA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CAAC,SAAS,CAAC,GAAG,CAAC,SAAS,CAAC,QAAQ,EAAE,EAAC,GAAG,EAAE,mBAAmB,EAAC,CAAC,CAAC;IACvE,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC;AAEH,QAAQ,CAAC,YAAY,EAAE,GAAG,EAAE;IAC1B,EAAE,CAAC,oDAAoD,EAAE,KAAK,IAAI,EAAE;QAClE,MAAM,SAAS,GAAG,IAAI,UAAU,CAAC,UAAU,CAAC,UAAU,EAAE,CAAC;QACzD,MAAM,CAAC,MAAM,CAAC,GAAG,EAAE;YACjB,SAAS,CAAC,IAAI,GAAG,yBAA4D,CAAC;QAChF,CAAC,EAAE,mDAAmD,CAAC,CAAC;IAC1D,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["// Copyright 2022 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport type * as Platform from '../../../core/platform/platform.js';\nimport {renderElementIntoDOM} from '../../../testing/DOMHelpers.js';\nimport {createTarget} from '../../../testing/EnvironmentHelpers.js';\nimport {describeWithMockConnection} from '../../../testing/MockConnection.js';\nimport * as LitHtml from '../../lit-html/lit-html.js';\nimport * as RenderCoordinator from '../render_coordinator/render_coordinator.js';\n\nimport * as ChromeLink from './chrome_link.js';\n\nconst {html} = LitHtml;\n\ndescribeWithMockConnection('ChromeLink', () => {\n it('renders a link when given a \\'chrome://\\' URL', async () => {\n const target = createTarget();\n const spy = sinon.spy(target.targetAgent(), 'invoke_createTarget');\n\n const container = document.createElement('div');\n // clang-format off\n LitHtml.render(\n html`\n \n link text\n \n `,\n container, {host: this},\n );\n // clang-format on\n renderElementIntoDOM(container);\n await RenderCoordinator.done();\n\n const chromeLink = container.querySelector('devtools-chrome-link');\n assert.instanceOf(chromeLink, ChromeLink.ChromeLink.ChromeLink);\n assert.isNotNull(chromeLink.shadowRoot);\n assert.strictEqual(chromeLink.innerHTML.trim(), 'link text');\n\n const link = chromeLink.shadowRoot.querySelector('a');\n assert.instanceOf(link, HTMLAnchorElement);\n assert.isTrue(spy.notCalled);\n link.click();\n\n assert.isTrue(spy.calledOnce);\n assert.deepEqual(spy.firstCall.firstArg, {url: 'chrome://settings'});\n });\n});\n\ndescribe('ChromeLink', () => {\n it('throws an error when given a non-\\'chrome://\\' URL', async () => {\n const component = new ChromeLink.ChromeLink.ChromeLink();\n assert.throws(() => {\n component.href = 'https://www.example.com' as Platform.DevToolsPath.UrlString;\n }, 'ChromeLink href needs to start with \\'chrome://\\'');\n });\n});\n"]} \ No newline at end of file diff --git a/public/ui/components/data_grid/DataGrid.js b/public/ui/components/data_grid/DataGrid.js index 96a263dd6..3ab2204a7 100644 --- a/public/ui/components/data_grid/DataGrid.js +++ b/public/ui/components/data_grid/DataGrid.js @@ -2,17 +2,16 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. import * as Host from '../../../core/host/host.js'; +import * as i18n from '../../../core/i18n/i18n.js'; import * as Platform from '../../../core/platform/platform.js'; import * as UI from '../../legacy/legacy.js'; import * as LitHtml from '../../lit-html/lit-html.js'; import * as VisualLogging from '../../visual_logging/visual_logging.js'; -import * as Coordinator from '../render_coordinator/render_coordinator.js'; +import * as RenderCoordinator from '../render_coordinator/render_coordinator.js'; import dataGridStyles from './dataGrid.css.js'; -import { BodyCellFocusedEvent, ColumnHeaderClickEvent, ContextMenuHeaderResetClickEvent, RowMouseEnterEvent, RowMouseLeaveEvent, } from './DataGridEvents.js'; -const coordinator = Coordinator.RenderCoordinator.RenderCoordinator.instance(); import { addColumnVisibilityCheckboxes, addSortableColumnItems } from './DataGridContextMenuUtils.js'; +import { BodyCellFocusedEvent, ColumnHeaderClickEvent, ContextMenuHeaderResetClickEvent, RowMouseEnterEvent, RowMouseLeaveEvent, } from './DataGridEvents.js'; import { calculateColumnWidthPercentageFromWeighting, calculateFirstFocusableCell, getCellTitleFromCellContent, getRowEntryForColumnId, handleArrowKeyNavigation, renderCellValue, } from './DataGridUtils.js'; -import * as i18n from '../../../core/i18n/i18n.js'; const { html, Directives: { ifDefined, classMap, styleMap, repeat } } = LitHtml; const UIStrings = { /** @@ -195,7 +194,7 @@ export class DataGrid extends HTMLElement { if (!wrapper) { return; } - void coordinator.scroll(() => { + void RenderCoordinator.scroll(() => { const scrollHeight = wrapper.scrollHeight; wrapper.scrollTo(0, scrollHeight); }); @@ -530,7 +529,7 @@ export class DataGrid extends HTMLElement { void this.#render(); } #alignScrollHandlers() { - return coordinator.read(() => { + return RenderCoordinator.read(() => { const columnHeaders = this.#shadow.querySelectorAll('th:not(.hidden)'); const handlers = this.#shadow.querySelectorAll('.cell-resize-handle'); const table = this.#shadow.querySelector('table'); @@ -542,7 +541,7 @@ export class DataGrid extends HTMLElement { const columnLeftOffset = header.offsetLeft; if (handlers[index]) { const handlerWidth = handlers[index].clientWidth; - void coordinator.write(() => { + void RenderCoordinator.write(() => { /** * Render the resizer at the far right of the column; we subtract * its width so it sits on the inner edge of the column. @@ -558,7 +557,7 @@ export class DataGrid extends HTMLElement { * Pads in each direction by PADDING_ROWS_COUNT so we render some rows that are off scren. */ #calculateTopAndBottomRowIndexes() { - return coordinator.read(() => { + return RenderCoordinator.read(() => { const wrapper = this.#shadow.querySelector('.wrapping-container'); // On first render we don't have a wrapper, so we can't get at its // scroll/height values. So we default to the inner height of the window as @@ -632,7 +631,7 @@ export class DataGrid extends HTMLElement { 'show-scrollbar': this.#showScrollbar === true, striped: this.#striped === true, }; - await coordinator.write(() => { + await RenderCoordinator.write(() => { // Disabled until https://crbug.com/1079231 is fixed. // clang-format off LitHtml.render(html ` diff --git a/public/ui/components/data_grid/DataGrid.js.map b/public/ui/components/data_grid/DataGrid.js.map index d605e8572..5de145888 100644 --- a/public/ui/components/data_grid/DataGrid.js.map +++ b/public/ui/components/data_grid/DataGrid.js.map @@ -1 +1 @@ -{"version":3,"file":"DataGrid.js","sourceRoot":"","sources":["../../../../../../../front_end/ui/components/data_grid/DataGrid.ts"],"names":[],"mappings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AG,IAAI,CAAC,aAAa,EAAE,CAAC;QAC1C,MAAM,wBAAwB,GAAG,YAAY,CAAC,CAAC,CAAC,CAAC;QACjD,MAAM,mBAAmB,GAAG,IAAI,CAAC,qCAAqC,EAAE,CAAC;QACzE,IAAI,IAAI,CAAC,uBAAuB,IAAI,wBAAwB,GAAG,CAAC,IAAI,mBAAmB,EAAE,CAAC;YACxF,IAAI,CAAC,oBAAoB,CAAC,mBAAmB,CAAC,CAAC;QACjD,CAAC;QACD,IAAI,CAAC,yBAAyB,EAAE,CAAC;QACjC,IAAI,CAAC,qBAAqB,EAAE,CAAC;QAC7B,IAAI,IAAI,CAAC,uBAAuB,EAAE,CAAC;YACjC,uEAAuE;YACvE,0EAA0E;YAC1E,iCAAiC;YAEjC,gGAAgG;YAChG,KAAK,IAAI,CAAC,oBAAoB,EAAE,CAAC;QACnC,CAAC;QAED,IAAI,CAAC,YAAY,GAAG,KAAK,CAAC;QAC1B,IAAI,CAAC,uBAAuB,GAAG,IAAI,CAAC;QAEpC,wEAAwE;QACxE,qCAAqC;QACrC,IAAI,IAAI,CAAC,eAAe,EAAE,CAAC;YACzB,IAAI,CAAC,eAAe,GAAG,KAAK,CAAC;YAC7B,KAAK,IAAI,CAAC,OAAO,EAAE,CAAC;QACtB,CAAC;IACH,CAAC;CACF;AAED,cAAc,CAAC,MAAM,CAAC,oBAAoB,EAAE,QAAQ,CAAC,CAAC","sourcesContent":["// Copyright (c) 2020 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport * as Host from '../../../core/host/host.js';\nimport * as Platform from '../../../core/platform/platform.js';\nimport * as UI from '../../legacy/legacy.js';\nimport * as LitHtml from '../../lit-html/lit-html.js';\nimport * as VisualLogging from '../../visual_logging/visual_logging.js';\nimport * as Coordinator from '../render_coordinator/render_coordinator.js';\n\nimport dataGridStyles from './dataGrid.css.js';\nimport {\n BodyCellFocusedEvent,\n ColumnHeaderClickEvent,\n ContextMenuHeaderResetClickEvent,\n RowMouseEnterEvent,\n RowMouseLeaveEvent,\n} from './DataGridEvents.js';\n\nconst coordinator = Coordinator.RenderCoordinator.RenderCoordinator.instance();\n\nimport {addColumnVisibilityCheckboxes, addSortableColumnItems} from './DataGridContextMenuUtils.js';\n\nimport {\n calculateColumnWidthPercentageFromWeighting,\n calculateFirstFocusableCell,\n getCellTitleFromCellContent,\n getRowEntryForColumnId,\n handleArrowKeyNavigation,\n renderCellValue,\n SortDirection,\n type CellPosition,\n type Column,\n type Row,\n type SortState,\n} from './DataGridUtils.js';\n\nimport * as i18n from '../../../core/i18n/i18n.js';\n\nconst {html, Directives: {ifDefined, classMap, styleMap, repeat}} = LitHtml;\nconst UIStrings = {\n /**\n *@description A context menu item in the Data Grid of a data grid\n */\n sortBy: 'Sort By',\n /**\n *@description A context menu item in data grids to reset the columns to their default weight\n */\n resetColumns: 'Reset Columns',\n /**\n *@description A context menu item in data grids to list header options.\n */\n headerOptions: 'Header Options',\n /**\n *@description Text for screen reader to announce when focusing on a sortable column in data grid.\n *@example {ascending} PH1\n */\n enterToSort: 'Column sort state: {PH1}. Press enter to apply sorting filter',\n /**\n *@description The current sort state of a column in data grid\n */\n sortAsc: 'ascending',\n /**\n *@description The current sort state of a column in data grid\n */\n sortDesc: 'descending',\n /**\n *@description The current sort state of a column in data grid\n */\n sortNone: 'none',\n};\nconst str_ = i18n.i18n.registerUIStrings('ui/components/data_grid/DataGrid.ts', UIStrings);\nconst i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);\nexport interface DataGridContextMenusConfiguration {\n headerRow?: (menu: UI.ContextMenu.ContextMenu, columns: readonly Column[]) => void;\n bodyRow?:\n (menu: UI.ContextMenu.ContextMenu, columns: readonly Column[], row: Readonly, rows: readonly Row[]) => void;\n}\n\nexport interface DataGridData {\n columns: Column[];\n rows: Row[];\n activeSort: SortState|null;\n contextMenus?: DataGridContextMenusConfiguration;\n label?: string;\n paddingRowsCount?: number;\n showScrollbar?: boolean;\n striped?: boolean;\n /**\n * Disable the auto-scroll on new data feature. This is enabled by default.\n */\n autoScrollToBottom?: boolean;\n}\n\nconst enum UserScrollState {\n NOT_SCROLLED = 'NOT_SCROLLED',\n MANUAL_SCROLL_NOT_BOTTOM = 'MANUAL_SCROLL_NOT_BOTTOM',\n SCROLLED_TO_BOTTOM = 'SCROLLED_TO_BOTTOM',\n}\n\nconst KEYS_TREATED_AS_CLICKS = new Set([' ', 'Enter']);\n\nconst ROW_HEIGHT_PIXELS = 20;\n\nexport class DataGrid extends HTMLElement {\n\n readonly #shadow = this.attachShadow({mode: 'open'});\n #columns: readonly Column[] = [];\n #rows: readonly Row[] = [];\n #sortState: Readonly|null = null;\n #isRendering = false;\n #userScrollState: UserScrollState = UserScrollState.NOT_SCROLLED;\n #contextMenus?: DataGridContextMenusConfiguration = undefined;\n #label?: string = undefined;\n #paddingRowsCount = 10;\n #showScrollbar?: boolean = false;\n #striped?: boolean = false;\n #autoScrollToBottom: boolean = true;\n\n #currentResize: {\n rightCellCol: HTMLTableColElement,\n leftCellCol: HTMLTableColElement,\n leftCellColInitialPercentageWidth: number,\n rightCellColInitialPercentageWidth: number,\n initialLeftCellWidth: number,\n initialRightCellWidth: number,\n initialMouseX: number,\n documentForCursorChange: Document,\n cursorToRestore: string,\n }|null = null;\n // Because we only render a subset of rows, we need a way to look up the\n // actual row index from the original dataset. We could use this.rows[index]\n // but that's O(n) and will slow as the dataset grows. A weakmap makes the\n // lookup constant.\n readonly #rowIndexMap = new WeakMap();\n readonly #resizeObserver = new ResizeObserver(() => {\n void this.#alignScrollHandlers();\n });\n\n // Thie have to be bound as they are put onto the global document, not onto\n // this element, so LitHtml does not bind them for us.\n #boundOnResizePointerMove = this.#onResizePointerMove.bind(this);\n\n /**\n * Following guidance from\n * https://www.w3.org/TR/wai-aria-practices/examples/grid/dataGrids.html, we\n * allow a single cell inside the table to be focusable, such that when a user\n * tabs in they select that cell. IMPORTANT: if the data-grid has sortable\n * columns, the user has to be able to navigate to the headers to toggle the\n * sort. [0,0] is considered the first cell INCLUDING the column header\n * Therefore if a user is on the first header cell, the position is considered [0, 0],\n * and if a user is on the first body cell, the position is considered [0, 1].\n *\n * We set the selectable cell to the first tbody value by default, but then on the\n * first render if any of the columns are sortable we'll set the active cell\n * to [0, 0].\n */\n #cellToFocusIfUserTabsIn: CellPosition = [0, 1];\n #cellUserHasFocused: CellPosition|null = null;\n\n #hasRenderedAtLeastOnce = false;\n #userHasFocusInDataGrid = false;\n #scheduleRender = false;\n\n connectedCallback(): void {\n this.#shadow.adoptedStyleSheets = [dataGridStyles];\n this.style.setProperty('--table-row-height', `${ROW_HEIGHT_PIXELS}px`);\n void this.#render();\n }\n\n get data(): DataGridData {\n return {\n columns: this.#columns as Column[],\n rows: this.#rows as Row[],\n activeSort: this.#sortState,\n contextMenus: this.#contextMenus,\n autoScrollToBottom: this.#autoScrollToBottom,\n label: this.#label,\n paddingRowsCount: this.#paddingRowsCount,\n showScrollbar: this.#showScrollbar,\n striped: this.#striped,\n };\n }\n\n set data(data: DataGridData) {\n this.#columns = data.columns;\n this.#rows = data.rows;\n this.#rows.forEach((row, index) => {\n this.#rowIndexMap.set(row, index);\n });\n this.#sortState = data.activeSort;\n this.#contextMenus = data.contextMenus;\n this.#label = data.label;\n this.#showScrollbar = data.showScrollbar;\n this.#striped = data.striped;\n if (typeof data.autoScrollToBottom === 'boolean') {\n this.#autoScrollToBottom = data.autoScrollToBottom;\n }\n\n /**\n * On first render, now we have data, we can figure out which cell is the\n * focusable cell for the table.\n *\n * If any columns are sortable, we pick [0, 0], which is the first cell of\n * the columns row. However, if any columns are hidden, we adjust\n * accordingly. e.g., if the first column is hidden, we'll set the starting\n * index as [1, 0].\n *\n * If the columns aren't sortable, we pick the first visible body row as the\n * index.\n *\n * We only do this on the first render; otherwise if we re-render and the\n * user has focused a cell, this logic will reset it.\n */\n if (!this.#hasRenderedAtLeastOnce) {\n this.#cellToFocusIfUserTabsIn = calculateFirstFocusableCell({columns: this.#columns, rows: this.#rows});\n }\n\n if (data.paddingRowsCount !== undefined) {\n this.#paddingRowsCount = data.paddingRowsCount;\n }\n\n if (this.#hasRenderedAtLeastOnce && this.#userHasCellFocused()) {\n const [selectedColIndex, selectedRowIndex] = this.#tabbableCell();\n const columnOutOfBounds = selectedColIndex > this.#columns.length;\n const rowOutOfBounds = selectedRowIndex > this.#rows.length;\n\n /** If the row or column was removed, so the user is out of bounds, we\n * move them to the last focusable cell, which should be close to where\n * they were. */\n if (columnOutOfBounds || rowOutOfBounds) {\n this.#cellUserHasFocused = [\n columnOutOfBounds ? this.#columns.length : selectedColIndex,\n rowOutOfBounds ? this.#rows.length : selectedRowIndex,\n ];\n }\n }\n\n void this.#render();\n }\n\n #shouldAutoScrollToBottom(): boolean {\n if (!this.#autoScrollToBottom) {\n return false;\n }\n\n /**\n * If the user's last scroll took them to the bottom, then we assume they\n * want to automatically scroll.\n */\n if (this.#userScrollState === UserScrollState.SCROLLED_TO_BOTTOM) {\n return true;\n }\n\n /**\n * If the user does not have focus in the data grid (e.g. they haven't\n * selected a cell), we automatically scroll, as long as the user hasn't\n * manually scrolled the data-grid to somewhere that isn't the bottom.\n */\n if (!this.#userHasFocusInDataGrid && this.#userScrollState !== UserScrollState.MANUAL_SCROLL_NOT_BOTTOM) {\n return true;\n }\n\n /**\n * Else, the user has focused a cell, or their last scroll action took them\n * not to the bottom, so we assume that they don't want to be auto-scrolled.\n */\n return false;\n }\n\n #scrollToBottomIfRequired(): void {\n if (this.#hasRenderedAtLeastOnce === false || !this.#shouldAutoScrollToBottom()) {\n return;\n }\n\n const wrapper = this.#shadow.querySelector('.wrapping-container');\n if (!wrapper) {\n return;\n }\n\n void coordinator.scroll(() => {\n const scrollHeight = wrapper.scrollHeight;\n wrapper.scrollTo(0, scrollHeight);\n });\n }\n\n #engageResizeObserver(): void {\n if (!this.#hasRenderedAtLeastOnce) {\n this.#resizeObserver.observe(this.#shadow.host);\n }\n }\n\n #userHasCellFocused(): boolean {\n return this.#cellUserHasFocused !== null;\n }\n\n #getTableElementForCellUserHasFocused(): HTMLTableCellElement|null {\n if (!this.#cellUserHasFocused) {\n return null;\n }\n const [columnIndex, rowIndex] = this.#cellUserHasFocused;\n const cell = this.#shadow.querySelector(\n `[data-row-index=\"${rowIndex}\"][data-col-index=\"${columnIndex}\"]`);\n return cell;\n }\n\n #focusTableCellInDOM(cell: HTMLTableCellElement): void {\n cell.focus();\n }\n\n #focusCellIfRequired([newColumnIndex, newRowIndex]: CellPosition): void {\n this.#userHasFocusInDataGrid = true;\n\n if (this.#cellUserHasFocused && this.#cellUserHasFocused[0] === newColumnIndex &&\n this.#cellUserHasFocused[1] === newRowIndex) {\n // The cell is already active and focused so we don't need to do anything.\n return;\n }\n\n this.#cellUserHasFocused = [newColumnIndex, newRowIndex];\n void this.#render();\n const tableCell = this.#getTableElementForCellUserHasFocused();\n if (!tableCell) {\n // Return in case the cell is out of bounds and we do nothing\n return;\n }\n /* The cell may already be focused if the user clicked into it, but we also\n * add arrow key support, so in the case where we're programatically moving the\n * focus, ensure we actually focus the cell.\n */\n this.#focusTableCellInDOM(tableCell);\n // If it's a sortable column header, screen reader announce the information for sorting\n if (newRowIndex === 0 && this.#columns[newColumnIndex].sortable) {\n const localizedSortState = this.#getLocalizedSortState(this.#columns[newColumnIndex]);\n UI.ARIAUtils.alert(i18nString(UIStrings.enterToSort, {PH1: localizedSortState || ''}));\n }\n }\n\n #getLocalizedSortState(col: Column): string|undefined {\n const currentSortLabel = this.#ariaSortForHeader(col);\n switch (currentSortLabel) {\n case 'ascending':\n return UIStrings.sortAsc;\n case 'descending':\n return UIStrings.sortDesc;\n case 'none':\n return UIStrings.sortNone;\n }\n return undefined;\n }\n\n #onTableKeyDown(event: KeyboardEvent): void {\n const key = event.key;\n\n if (!this.#cellUserHasFocused) {\n return;\n }\n\n if (KEYS_TREATED_AS_CLICKS.has(key)) {\n const [focusedColumnIndex, focusedRowIndex] = this.#cellUserHasFocused;\n const activeColumn = this.#columns[focusedColumnIndex];\n if (focusedRowIndex === 0 && activeColumn && activeColumn.sortable) {\n this.#onColumnHeaderClick(activeColumn, focusedColumnIndex);\n }\n }\n\n if (!Platform.KeyboardUtilities.keyIsArrowKey(key)) {\n return;\n }\n\n const nextFocusedCell = handleArrowKeyNavigation({\n key,\n currentFocusedCell: this.#cellUserHasFocused,\n columns: this.#columns,\n rows: this.#rows,\n });\n event.preventDefault();\n this.#focusCellIfRequired(nextFocusedCell);\n }\n\n #onColumnHeaderClick(col: Column, index: number): void {\n this.dispatchEvent(new ColumnHeaderClickEvent(col, index));\n }\n\n /**\n * Applies the aria-sort label to a column's th.\n * Guidance on values of attribute taken from\n * https://www.w3.org/TR/wai-aria-practices/examples/grid/dataGrids.html.\n */\n #ariaSortForHeader(col: Column): 'none'|'ascending'|'descending'|undefined {\n if (col.sortable && (!this.#sortState || this.#sortState.columnId !== col.id)) {\n // Column is sortable but is not currently sorted\n return 'none';\n }\n\n if (this.#sortState && this.#sortState.columnId === col.id) {\n return this.#sortState.direction === SortDirection.ASC ? 'ascending' : 'descending';\n }\n\n // Column is not sortable, so don't apply any label\n return undefined;\n }\n\n #renderEmptyFillerRow(numberOfVisibleRows: number): LitHtml.TemplateResult {\n const emptyCells = this.#columns.map((col, colIndex) => {\n if (!col.visible) {\n return LitHtml.nothing;\n }\n const emptyCellClasses = LitHtml.Directives.classMap({\n firstVisibleColumn: colIndex === 0,\n });\n return html``;\n });\n const emptyRowClasses = LitHtml.Directives.classMap({\n 'filler-row': true,\n 'padding-row': true,\n 'empty-table': numberOfVisibleRows === 0,\n });\n return html`
${emptyCells}
`;\n }\n\n #cleanUpAfterResizeColumnComplete(): void {\n if (!this.#currentResize) {\n return;\n }\n this.#currentResize.documentForCursorChange.body.style.cursor = this.#currentResize.cursorToRestore;\n this.#currentResize = null;\n // Realign the scroll handlers now the table columns have been resized.\n void this.#alignScrollHandlers();\n }\n\n #onResizePointerDown(event: PointerEvent): void {\n if (event.buttons !== 1 || (Host.Platform.isMac() && event.ctrlKey)) {\n // Ensure we only react to a left click drag mouse down event.\n // On Mac we ignore Ctrl-click which can be used to bring up context menus, etc.\n return;\n }\n event.preventDefault();\n const resizerElement = event.target as HTMLElement;\n if (!resizerElement) {\n return;\n }\n const leftColumnIndex = resizerElement.dataset.columnIndex;\n if (!leftColumnIndex) {\n return;\n }\n const leftColumnIndexAsNumber = globalThis.parseInt(leftColumnIndex, 10);\n /* To find the cell to the right we can't just go +1 as it might be hidden,\n * so find the next index that is visible.\n */\n const rightColumnIndexAsNumber = this.#columns.findIndex((column, index) => {\n return index > leftColumnIndexAsNumber && column.visible === true;\n });\n\n const leftCell = this.#shadow.querySelector(`td[data-filler-row-column-index=\"${leftColumnIndexAsNumber}\"]`);\n const rightCell = this.#shadow.querySelector(`td[data-filler-row-column-index=\"${rightColumnIndexAsNumber}\"]`);\n if (!leftCell || !rightCell) {\n return;\n }\n // We query for the elements as they are the elements that we put the actual width on.\n const leftCellCol =\n this.#shadow.querySelector(`col[data-col-column-index=\"${leftColumnIndexAsNumber}\"]`);\n const rightCellCol =\n this.#shadow.querySelector(`col[data-col-column-index=\"${rightColumnIndexAsNumber}\"]`);\n if (!leftCellCol || !rightCellCol) {\n return;\n }\n\n const targetDocumentForCursorChange = (event.target as Node).ownerDocument;\n if (!targetDocumentForCursorChange) {\n return;\n }\n // We now store values that we'll make use of in the mousemouse event to calculate how much to resize the table by.\n this.#currentResize = {\n leftCellCol,\n rightCellCol,\n leftCellColInitialPercentageWidth: globalThis.parseInt(leftCellCol.style.width, 10),\n rightCellColInitialPercentageWidth: globalThis.parseInt(rightCellCol.style.width, 10),\n initialLeftCellWidth: leftCell.clientWidth,\n initialRightCellWidth: rightCell.clientWidth,\n initialMouseX: event.x,\n documentForCursorChange: targetDocumentForCursorChange,\n cursorToRestore: resizerElement.style.cursor,\n };\n\n targetDocumentForCursorChange.body.style.cursor = 'col-resize';\n resizerElement.setPointerCapture(event.pointerId);\n resizerElement.addEventListener('pointermove', this.#boundOnResizePointerMove);\n }\n\n #onResizePointerMove(event: PointerEvent): void {\n event.preventDefault();\n if (!this.#currentResize) {\n return;\n }\n\n const MIN_CELL_WIDTH_PERCENTAGE = 10;\n const MAX_CELL_WIDTH_PERCENTAGE = (this.#currentResize.leftCellColInitialPercentageWidth +\n this.#currentResize.rightCellColInitialPercentageWidth) -\n MIN_CELL_WIDTH_PERCENTAGE;\n const deltaOfMouseMove = event.x - this.#currentResize.initialMouseX;\n const absoluteDelta = Math.abs(deltaOfMouseMove);\n const percentageDelta =\n (absoluteDelta / (this.#currentResize.initialLeftCellWidth + this.#currentResize.initialRightCellWidth)) * 100;\n\n let newLeftColumnPercentage;\n let newRightColumnPercentage;\n if (deltaOfMouseMove > 0) {\n /**\n * A positive delta means the user moved their mouse to the right, so we\n * want to make the right column smaller, and the left column larger.\n */\n newLeftColumnPercentage = Platform.NumberUtilities.clamp(\n this.#currentResize.leftCellColInitialPercentageWidth + percentageDelta, MIN_CELL_WIDTH_PERCENTAGE,\n MAX_CELL_WIDTH_PERCENTAGE);\n newRightColumnPercentage = Platform.NumberUtilities.clamp(\n this.#currentResize.rightCellColInitialPercentageWidth - percentageDelta, MIN_CELL_WIDTH_PERCENTAGE,\n MAX_CELL_WIDTH_PERCENTAGE);\n } else if (deltaOfMouseMove < 0) {\n /**\n * Negative delta means the user moved their mouse to the left, which\n * means we want to make the right column larger, and the left column\n * smaller.\n */\n newLeftColumnPercentage = Platform.NumberUtilities.clamp(\n this.#currentResize.leftCellColInitialPercentageWidth - percentageDelta, MIN_CELL_WIDTH_PERCENTAGE,\n MAX_CELL_WIDTH_PERCENTAGE);\n newRightColumnPercentage = Platform.NumberUtilities.clamp(\n this.#currentResize.rightCellColInitialPercentageWidth + percentageDelta, MIN_CELL_WIDTH_PERCENTAGE,\n MAX_CELL_WIDTH_PERCENTAGE);\n }\n\n if (!newLeftColumnPercentage || !newRightColumnPercentage) {\n // The delta was 0, so nothing to do.\n return;\n }\n\n // We limit the values to two decimal places to not work with huge decimals.\n // It also prevents stuttering if the user barely moves the mouse, as the\n // browser won't try to move the column by 0.0000001% or similar.\n this.#currentResize.leftCellCol.style.width = newLeftColumnPercentage.toFixed(2) + '%';\n this.#currentResize.rightCellCol.style.width = newRightColumnPercentage.toFixed(2) + '%';\n }\n\n #onResizePointerUp(event: PointerEvent): void {\n event.preventDefault();\n const resizer = event.target as HTMLElement;\n if (!resizer) {\n return;\n }\n resizer.releasePointerCapture(event.pointerId);\n resizer.removeEventListener('pointermove', this.#boundOnResizePointerMove);\n this.#cleanUpAfterResizeColumnComplete();\n }\n\n #renderResizeForCell(column: Column, position: CellPosition): LitHtml.LitTemplate {\n /**\n * A resizer for a column is placed at the far right of the _previous column\n * cell_. So when we get called with [1, 0] that means this dragger is\n * resizing column 1, but the dragger itself is located within column 0. We\n * need the column to the left because when you resize a column you're not\n * only resizing it but also the column to its left.\n */\n const [columnIndex] = position;\n const lastVisibleColumnIndex = this.#getIndexOfLastVisibleColumn();\n // If we are in the very last column, there is no column to the right to resize, so don't render a resizer.\n if (columnIndex === lastVisibleColumnIndex || !column.visible) {\n return LitHtml.nothing;\n }\n\n return html`
`;\n }\n\n #getIndexOfLastVisibleColumn(): number {\n let index = this.#columns.length - 1;\n for (; index > -1; index--) {\n const col = this.#columns[index];\n if (col.visible) {\n break;\n }\n }\n return index;\n }\n\n /**\n * This function is called when the user right clicks on the header row of the\n * data grid.\n */\n #onHeaderContextMenu(event: MouseEvent): void {\n if (event.button !== 2 && event.button !== -1) {\n // -1 = right click invoked by keyboard, for example 'Shift + F10'.\n // 2 = secondary button = right click. We only show context menus if the\n // user has right clicked.\n return;\n }\n\n const menu = new UI.ContextMenu.ContextMenu(event);\n addColumnVisibilityCheckboxes(this, menu);\n const sortMenu = menu.defaultSection().appendSubMenuItem(i18nString(UIStrings.sortBy), false, 'sort-by');\n addSortableColumnItems(this, sortMenu);\n\n menu.defaultSection().appendItem(i18nString(UIStrings.resetColumns), () => {\n this.dispatchEvent(new ContextMenuHeaderResetClickEvent());\n }, {jslogContext: 'reset-columns'});\n\n if (this.#contextMenus && this.#contextMenus.headerRow) {\n // Let the user append things to the menu\n this.#contextMenus.headerRow(menu, this.#columns);\n }\n void menu.show();\n }\n\n #onBodyRowContextMenu(event: MouseEvent): void {\n if (event.button !== 2 && event.button !== -1) {\n // -1 = right click invoked by keyboard, for example 'Shift + F10'.\n // 2 = secondary button = right click. We only show context menus if the\n // user has right clicked.\n return;\n }\n /**\n * We now make sure that the event came from an HTML element with a\n * data-row-index attribute, else we bail.\n */\n if (!event.target || !(event.target instanceof HTMLElement)) {\n return;\n }\n const rowIndexAttribute = event.target.dataset.rowIndex;\n if (!rowIndexAttribute) {\n return;\n }\n\n const rowIndex = parseInt(rowIndexAttribute, 10);\n // rowIndex - 1 here because in the UI the 0th row is the column headers.\n const rowThatWasClicked = this.#rows[rowIndex - 1];\n\n const menu = new UI.ContextMenu.ContextMenu(event);\n const sortMenu = menu.defaultSection().appendSubMenuItem(i18nString(UIStrings.sortBy), false, 'sort-by');\n addSortableColumnItems(this, sortMenu);\n\n const headerOptionsMenu =\n menu.defaultSection().appendSubMenuItem(i18nString(UIStrings.headerOptions), false, 'header-options');\n addColumnVisibilityCheckboxes(this, headerOptionsMenu);\n headerOptionsMenu.defaultSection().appendItem(i18nString(UIStrings.resetColumns), () => {\n this.dispatchEvent(new ContextMenuHeaderResetClickEvent());\n }, {jslogContext: 'reset-columns'});\n\n if (this.#contextMenus && this.#contextMenus.bodyRow) {\n this.#contextMenus.bodyRow(menu, this.#columns, rowThatWasClicked, this.#rows);\n }\n void menu.show();\n }\n\n #onScroll(event: Event): void {\n const wrapper = event.target as HTMLElement;\n if (!wrapper) {\n return;\n }\n\n // Need to Math.round because on high res screens we can end up with decimal\n // point numbers for scroll positions.\n const userIsAtBottom = Math.round(wrapper.scrollTop + wrapper.clientHeight) === Math.round(wrapper.scrollHeight);\n this.#userScrollState =\n userIsAtBottom ? UserScrollState.SCROLLED_TO_BOTTOM : UserScrollState.MANUAL_SCROLL_NOT_BOTTOM;\n\n void this.#render();\n }\n\n #alignScrollHandlers(): Promise {\n return coordinator.read(() => {\n const columnHeaders = this.#shadow.querySelectorAll('th:not(.hidden)');\n const handlers = this.#shadow.querySelectorAll('.cell-resize-handle');\n const table = this.#shadow.querySelector('table');\n if (!table) {\n return;\n }\n\n columnHeaders.forEach(async (header, index) => {\n const columnWidth = header.clientWidth;\n const columnLeftOffset = header.offsetLeft;\n if (handlers[index]) {\n const handlerWidth = handlers[index].clientWidth;\n void coordinator.write(() => {\n /**\n * Render the resizer at the far right of the column; we subtract\n * its width so it sits on the inner edge of the column.\n */\n handlers[index].style.left = `${columnLeftOffset + columnWidth - handlerWidth}px`;\n });\n }\n });\n });\n }\n\n /**\n * Calculates the index of the first row we want to render, and the last row we want to render.\n * Pads in each direction by PADDING_ROWS_COUNT so we render some rows that are off scren.\n */\n #calculateTopAndBottomRowIndexes(): Promise<{topVisibleRow: number, bottomVisibleRow: number}> {\n return coordinator.read(() => {\n const wrapper = this.#shadow.querySelector('.wrapping-container');\n\n // On first render we don't have a wrapper, so we can't get at its\n // scroll/height values. So we default to the inner height of the window as\n // the limit for rendering. This means we may over-render by a few rows, but\n // better that than either render everything, or rendering too few rows.\n let scrollTop = 0;\n let clientHeight = window.innerHeight;\n if (wrapper) {\n scrollTop = wrapper.scrollTop;\n clientHeight = wrapper.clientHeight;\n }\n const padding = ROW_HEIGHT_PIXELS * this.#paddingRowsCount;\n let topVisibleRow = Math.floor((scrollTop - padding) / ROW_HEIGHT_PIXELS);\n let bottomVisibleRow = Math.ceil((scrollTop + clientHeight + padding) / ROW_HEIGHT_PIXELS);\n\n topVisibleRow = Math.max(0, topVisibleRow);\n bottomVisibleRow = Math.min(this.#rows.filter(r => !r.hidden).length, bottomVisibleRow);\n\n return {\n topVisibleRow,\n bottomVisibleRow,\n };\n });\n }\n\n #onFocusOut(): void {\n /**\n * When any element in the data-grid loses focus, we set this to false. If\n * the user then focuses another cell, that code will set the focus to true.\n * We need to know if the user is focused because if they are and they've\n * scrolled their focused cell out of rendering view and back in, we want to\n * refocus it. But if they aren't focused and that happens, we don't, else\n * we can steal focus away from the user if they are typing into an input\n * box to filter the data-grid, for example.\n */\n this.#userHasFocusInDataGrid = false;\n }\n\n #tabbableCell(): CellPosition {\n /**\n * If the user has selected a cell, this is the cell that should be\n * \"tabbable\" if the user tabs out and into the data-grid. If the user\n * hasn't selected a cell, we fallback to the default cell that we set as\n * tabbable when we render.\n */\n return this.#cellUserHasFocused || this.#cellToFocusIfUserTabsIn;\n }\n\n /**\n * Renders the data-grid table. Note that we do not render all rows; the\n * performance cost are too high once you have a large enough table. Instead\n * we calculate the size of the container we are rendering into, and then\n * render only the rows required to fill that table (plus a bit extra for\n * padding).\n */\n async #render(): Promise {\n if (!this.isConnected) {\n return;\n }\n if (this.#isRendering) {\n // If we receive a request to render during a previous render call, we block\n // the newly requested render (since we could receive a lot of them in quick\n // succession), but we do ensure that at the end of the current render we\n // go again with the latest data.\n this.#scheduleRender = true;\n return;\n }\n this.#isRendering = true;\n\n const {topVisibleRow, bottomVisibleRow} = await this.#calculateTopAndBottomRowIndexes();\n const nonHiddenRows = this.#rows.filter(row => !row.hidden);\n const renderableRows = nonHiddenRows.filter((_, idx) => idx >= topVisibleRow && idx <= bottomVisibleRow);\n const indexOfFirstVisibleColumn = this.#columns.findIndex(col => col.visible);\n const anyColumnsSortable = this.#columns.some(col => col.sortable === true);\n const containerClassMap = {\n 'wrapping-container': true,\n 'show-scrollbar': this.#showScrollbar === true,\n striped: this.#striped === true,\n };\n\n await coordinator.write(() => {\n // Disabled until https://crbug.com/1079231 is fixed.\n // clang-format off\n LitHtml.render(html`\n ${this.#columns.map((col, columnIndex) => {\n /**\n * We render the resizers outside of the table. One is rendered for each\n * column, and they are positioned absolutely at the right position. They\n * have 100% height so they sit over the entire table and can be grabbed\n * by the user.\n */\n return this.#renderResizeForCell(col, [columnIndex, 0]);\n })}\n
\n \n \n \n ${this.#columns.map((col, colIndex) => {\n const width = calculateColumnWidthPercentageFromWeighting(this.#columns, col.id);\n const style = `width: ${width}%`;\n if (!col.visible) {\n return LitHtml.nothing;\n }\n return html``;\n })}\n \n \n \n ${this.#columns.map((col, columnIndex) => {\n const thClasses = classMap({\n hidden: !col.visible,\n firstVisibleColumn: columnIndex === indexOfFirstVisibleColumn,\n sortable: anyColumnsSortable,\n });\n const tabbableCell = this.#tabbableCell();\n const cellIsFocusableCell = anyColumnsSortable && columnIndex === tabbableCell[0] && tabbableCell[1] === 0;\n\n return html` {\n this.#focusCellIfRequired([columnIndex, 0]);\n }}\n @click=${() => {\n /**\n * We use click here rather than focus because if you've\n * clicked on the header to sort, you've also focused it. If\n * you then click it again to change the sorting, this\n * doesn't emit a focus event as the cell is already\n * focused.\n */\n this.#onColumnHeaderClick(col, columnIndex);\n }}\n title=${col.title}\n aria-sort=${ifDefined(this.#ariaSortForHeader(col))}\n aria-colindex=${columnIndex + 1}\n data-row-index='0'\n data-col-index=${columnIndex}\n tabindex=${ifDefined(anyColumnsSortable ? (cellIsFocusableCell ? '0' : '-1') : undefined)}\n >${col.titleElement || col.title}`;\n })}\n \n \n \n \n ${repeat(renderableRows, row => this.#rowIndexMap.get(row), row => {\n const rowIndex = this.#rowIndexMap.get(row);\n if (rowIndex === undefined) {\n throw new Error('Trying to render a row that has no index in the rowIndexMap');\n }\n const tabbableCell = this.#tabbableCell();\n // Remember that row 0 is considered the header row, so the first tbody row is row 1.\n const tableRowIndex = rowIndex + 1;\n\n // Check for cellUserHasFocused instead of tabbableCell so that we\n // don't highlight the active cell before they've even clicked it.\n const rowIsSelected = this.#cellUserHasFocused ? tableRowIndex === this.#cellUserHasFocused[1] : false;\n\n const rowClasses = LitHtml.Directives.classMap({\n selected: rowIsSelected,\n hidden: row.hidden === true,\n });\n return html`\n {\n this.dispatchEvent(new RowMouseEnterEvent(row));\n }}\n @mouseleave=${() => {\n this.dispatchEvent(new RowMouseLeaveEvent(row));\n }}\n >${this.#columns.map((col, columnIndex) => {\n const cell = getRowEntryForColumnId(row, col.id);\n const cellClasses = classMap({\n hidden: !col.visible,\n firstVisibleColumn: columnIndex === indexOfFirstVisibleColumn,\n });\n const cellIsFocusableCell = columnIndex === tabbableCell[0] && tableRowIndex === tabbableCell[1];\n const cellOutput = col.visible ? renderCellValue(cell) : null;\n return html` {\n this.#focusCellIfRequired([columnIndex, tableRowIndex]);\n this.dispatchEvent(new BodyCellFocusedEvent(cell, row));\n }}\n >${cellOutput}`;\n })}\n `;\n })}\n ${this.#renderEmptyFillerRow(renderableRows.length)}\n \n \n \n
\n `, this.#shadow, {\n host: this,\n });\n });\n // clang-format on\n\n // This ensures if the user has a cell focused, but then scrolls so that\n // the focused cell is now not rendered, that when it then gets scrolled\n // back in, that it becomes rendered.\n // However, if the cell is a column header, we don't do this, as that\n // can never be not-rendered.\n const tabbableCell = this.#tabbableCell();\n const currentlyFocusedRowIndex = tabbableCell[1];\n const tabbableCellElement = this.#getTableElementForCellUserHasFocused();\n if (this.#userHasFocusInDataGrid && currentlyFocusedRowIndex > 0 && tabbableCellElement) {\n this.#focusTableCellInDOM(tabbableCellElement);\n }\n this.#scrollToBottomIfRequired();\n this.#engageResizeObserver();\n if (this.#hasRenderedAtLeastOnce) {\n // We may have had a cell's width change on a re-render, or it may have\n // been hidden entirely, so we need to ensure that the resize handlers are\n // re-positioned correctly if so.\n\n // We don't have to do this on first render as it will fire when the resize observer is engaged.\n void this.#alignScrollHandlers();\n }\n\n this.#isRendering = false;\n this.#hasRenderedAtLeastOnce = true;\n\n // If we've received more data mid-render we will do one extra render at\n // the end with the most recent data.\n if (this.#scheduleRender) {\n this.#scheduleRender = false;\n void this.#render();\n }\n }\n}\n\ncustomElements.define('devtools-data-grid', DataGrid);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'devtools-data-grid': DataGrid;\n }\n}\n"]} \ No newline at end of file +{"version":3,"file":"DataGrid.js","sourceRoot":"","sources":["../../../../../../../front_end/ui/components/data_grid/DataGrid.ts"],"names":[],"mappings":"A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C,CAAC;QACjD,MAAM,mBAAmB,GAAG,IAAI,CAAC,qCAAqC,EAAE,CAAC;QACzE,IAAI,IAAI,CAAC,uBAAuB,IAAI,wBAAwB,GAAG,CAAC,IAAI,mBAAmB,EAAE,CAAC;YACxF,IAAI,CAAC,oBAAoB,CAAC,mBAAmB,CAAC,CAAC;QACjD,CAAC;QACD,IAAI,CAAC,yBAAyB,EAAE,CAAC;QACjC,IAAI,CAAC,qBAAqB,EAAE,CAAC;QAC7B,IAAI,IAAI,CAAC,uBAAuB,EAAE,CAAC;YACjC,uEAAuE;YACvE,0EAA0E;YAC1E,iCAAiC;YAEjC,gGAAgG;YAChG,KAAK,IAAI,CAAC,oBAAoB,EAAE,CAAC;QACnC,CAAC;QAED,IAAI,CAAC,YAAY,GAAG,KAAK,CAAC;QAC1B,IAAI,CAAC,uBAAuB,GAAG,IAAI,CAAC;QAEpC,wEAAwE;QACxE,qCAAqC;QACrC,IAAI,IAAI,CAAC,eAAe,EAAE,CAAC;YACzB,IAAI,CAAC,eAAe,GAAG,KAAK,CAAC;YAC7B,KAAK,IAAI,CAAC,OAAO,EAAE,CAAC;QACtB,CAAC;IACH,CAAC;CACF;AAED,cAAc,CAAC,MAAM,CAAC,oBAAoB,EAAE,QAAQ,CAAC,CAAC","sourcesContent":["// Copyright (c) 2020 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport * as Host from '../../../core/host/host.js';\nimport * as i18n from '../../../core/i18n/i18n.js';\nimport * as Platform from '../../../core/platform/platform.js';\nimport * as UI from '../../legacy/legacy.js';\nimport * as LitHtml from '../../lit-html/lit-html.js';\nimport * as VisualLogging from '../../visual_logging/visual_logging.js';\nimport * as RenderCoordinator from '../render_coordinator/render_coordinator.js';\n\nimport dataGridStyles from './dataGrid.css.js';\nimport {addColumnVisibilityCheckboxes, addSortableColumnItems} from './DataGridContextMenuUtils.js';\nimport {\n BodyCellFocusedEvent,\n ColumnHeaderClickEvent,\n ContextMenuHeaderResetClickEvent,\n RowMouseEnterEvent,\n RowMouseLeaveEvent,\n} from './DataGridEvents.js';\nimport {\n calculateColumnWidthPercentageFromWeighting,\n calculateFirstFocusableCell,\n type CellPosition,\n type Column,\n getCellTitleFromCellContent,\n getRowEntryForColumnId,\n handleArrowKeyNavigation,\n renderCellValue,\n type Row,\n SortDirection,\n type SortState,\n} from './DataGridUtils.js';\n\nconst {html, Directives: {ifDefined, classMap, styleMap, repeat}} = LitHtml;\nconst UIStrings = {\n /**\n *@description A context menu item in the Data Grid of a data grid\n */\n sortBy: 'Sort By',\n /**\n *@description A context menu item in data grids to reset the columns to their default weight\n */\n resetColumns: 'Reset Columns',\n /**\n *@description A context menu item in data grids to list header options.\n */\n headerOptions: 'Header Options',\n /**\n *@description Text for screen reader to announce when focusing on a sortable column in data grid.\n *@example {ascending} PH1\n */\n enterToSort: 'Column sort state: {PH1}. Press enter to apply sorting filter',\n /**\n *@description The current sort state of a column in data grid\n */\n sortAsc: 'ascending',\n /**\n *@description The current sort state of a column in data grid\n */\n sortDesc: 'descending',\n /**\n *@description The current sort state of a column in data grid\n */\n sortNone: 'none',\n};\nconst str_ = i18n.i18n.registerUIStrings('ui/components/data_grid/DataGrid.ts', UIStrings);\nconst i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);\nexport interface DataGridContextMenusConfiguration {\n headerRow?: (menu: UI.ContextMenu.ContextMenu, columns: readonly Column[]) => void;\n bodyRow?:\n (menu: UI.ContextMenu.ContextMenu, columns: readonly Column[], row: Readonly, rows: readonly Row[]) => void;\n}\n\nexport interface DataGridData {\n columns: Column[];\n rows: Row[];\n activeSort: SortState|null;\n contextMenus?: DataGridContextMenusConfiguration;\n label?: string;\n paddingRowsCount?: number;\n showScrollbar?: boolean;\n striped?: boolean;\n /**\n * Disable the auto-scroll on new data feature. This is enabled by default.\n */\n autoScrollToBottom?: boolean;\n}\n\nconst enum UserScrollState {\n NOT_SCROLLED = 'NOT_SCROLLED',\n MANUAL_SCROLL_NOT_BOTTOM = 'MANUAL_SCROLL_NOT_BOTTOM',\n SCROLLED_TO_BOTTOM = 'SCROLLED_TO_BOTTOM',\n}\n\nconst KEYS_TREATED_AS_CLICKS = new Set([' ', 'Enter']);\n\nconst ROW_HEIGHT_PIXELS = 20;\n\nexport class DataGrid extends HTMLElement {\n\n readonly #shadow = this.attachShadow({mode: 'open'});\n #columns: readonly Column[] = [];\n #rows: readonly Row[] = [];\n #sortState: Readonly|null = null;\n #isRendering = false;\n #userScrollState: UserScrollState = UserScrollState.NOT_SCROLLED;\n #contextMenus?: DataGridContextMenusConfiguration = undefined;\n #label?: string = undefined;\n #paddingRowsCount = 10;\n #showScrollbar?: boolean = false;\n #striped?: boolean = false;\n #autoScrollToBottom: boolean = true;\n\n #currentResize: {\n rightCellCol: HTMLTableColElement,\n leftCellCol: HTMLTableColElement,\n leftCellColInitialPercentageWidth: number,\n rightCellColInitialPercentageWidth: number,\n initialLeftCellWidth: number,\n initialRightCellWidth: number,\n initialMouseX: number,\n documentForCursorChange: Document,\n cursorToRestore: string,\n }|null = null;\n // Because we only render a subset of rows, we need a way to look up the\n // actual row index from the original dataset. We could use this.rows[index]\n // but that's O(n) and will slow as the dataset grows. A weakmap makes the\n // lookup constant.\n readonly #rowIndexMap = new WeakMap();\n readonly #resizeObserver = new ResizeObserver(() => {\n void this.#alignScrollHandlers();\n });\n\n // Thie have to be bound as they are put onto the global document, not onto\n // this element, so LitHtml does not bind them for us.\n #boundOnResizePointerMove = this.#onResizePointerMove.bind(this);\n\n /**\n * Following guidance from\n * https://www.w3.org/TR/wai-aria-practices/examples/grid/dataGrids.html, we\n * allow a single cell inside the table to be focusable, such that when a user\n * tabs in they select that cell. IMPORTANT: if the data-grid has sortable\n * columns, the user has to be able to navigate to the headers to toggle the\n * sort. [0,0] is considered the first cell INCLUDING the column header\n * Therefore if a user is on the first header cell, the position is considered [0, 0],\n * and if a user is on the first body cell, the position is considered [0, 1].\n *\n * We set the selectable cell to the first tbody value by default, but then on the\n * first render if any of the columns are sortable we'll set the active cell\n * to [0, 0].\n */\n #cellToFocusIfUserTabsIn: CellPosition = [0, 1];\n #cellUserHasFocused: CellPosition|null = null;\n\n #hasRenderedAtLeastOnce = false;\n #userHasFocusInDataGrid = false;\n #scheduleRender = false;\n\n connectedCallback(): void {\n this.#shadow.adoptedStyleSheets = [dataGridStyles];\n this.style.setProperty('--table-row-height', `${ROW_HEIGHT_PIXELS}px`);\n void this.#render();\n }\n\n get data(): DataGridData {\n return {\n columns: this.#columns as Column[],\n rows: this.#rows as Row[],\n activeSort: this.#sortState,\n contextMenus: this.#contextMenus,\n autoScrollToBottom: this.#autoScrollToBottom,\n label: this.#label,\n paddingRowsCount: this.#paddingRowsCount,\n showScrollbar: this.#showScrollbar,\n striped: this.#striped,\n };\n }\n\n set data(data: DataGridData) {\n this.#columns = data.columns;\n this.#rows = data.rows;\n this.#rows.forEach((row, index) => {\n this.#rowIndexMap.set(row, index);\n });\n this.#sortState = data.activeSort;\n this.#contextMenus = data.contextMenus;\n this.#label = data.label;\n this.#showScrollbar = data.showScrollbar;\n this.#striped = data.striped;\n if (typeof data.autoScrollToBottom === 'boolean') {\n this.#autoScrollToBottom = data.autoScrollToBottom;\n }\n\n /**\n * On first render, now we have data, we can figure out which cell is the\n * focusable cell for the table.\n *\n * If any columns are sortable, we pick [0, 0], which is the first cell of\n * the columns row. However, if any columns are hidden, we adjust\n * accordingly. e.g., if the first column is hidden, we'll set the starting\n * index as [1, 0].\n *\n * If the columns aren't sortable, we pick the first visible body row as the\n * index.\n *\n * We only do this on the first render; otherwise if we re-render and the\n * user has focused a cell, this logic will reset it.\n */\n if (!this.#hasRenderedAtLeastOnce) {\n this.#cellToFocusIfUserTabsIn = calculateFirstFocusableCell({columns: this.#columns, rows: this.#rows});\n }\n\n if (data.paddingRowsCount !== undefined) {\n this.#paddingRowsCount = data.paddingRowsCount;\n }\n\n if (this.#hasRenderedAtLeastOnce && this.#userHasCellFocused()) {\n const [selectedColIndex, selectedRowIndex] = this.#tabbableCell();\n const columnOutOfBounds = selectedColIndex > this.#columns.length;\n const rowOutOfBounds = selectedRowIndex > this.#rows.length;\n\n /** If the row or column was removed, so the user is out of bounds, we\n * move them to the last focusable cell, which should be close to where\n * they were. */\n if (columnOutOfBounds || rowOutOfBounds) {\n this.#cellUserHasFocused = [\n columnOutOfBounds ? this.#columns.length : selectedColIndex,\n rowOutOfBounds ? this.#rows.length : selectedRowIndex,\n ];\n }\n }\n\n void this.#render();\n }\n\n #shouldAutoScrollToBottom(): boolean {\n if (!this.#autoScrollToBottom) {\n return false;\n }\n\n /**\n * If the user's last scroll took them to the bottom, then we assume they\n * want to automatically scroll.\n */\n if (this.#userScrollState === UserScrollState.SCROLLED_TO_BOTTOM) {\n return true;\n }\n\n /**\n * If the user does not have focus in the data grid (e.g. they haven't\n * selected a cell), we automatically scroll, as long as the user hasn't\n * manually scrolled the data-grid to somewhere that isn't the bottom.\n */\n if (!this.#userHasFocusInDataGrid && this.#userScrollState !== UserScrollState.MANUAL_SCROLL_NOT_BOTTOM) {\n return true;\n }\n\n /**\n * Else, the user has focused a cell, or their last scroll action took them\n * not to the bottom, so we assume that they don't want to be auto-scrolled.\n */\n return false;\n }\n\n #scrollToBottomIfRequired(): void {\n if (this.#hasRenderedAtLeastOnce === false || !this.#shouldAutoScrollToBottom()) {\n return;\n }\n\n const wrapper = this.#shadow.querySelector('.wrapping-container');\n if (!wrapper) {\n return;\n }\n\n void RenderCoordinator.scroll(() => {\n const scrollHeight = wrapper.scrollHeight;\n wrapper.scrollTo(0, scrollHeight);\n });\n }\n\n #engageResizeObserver(): void {\n if (!this.#hasRenderedAtLeastOnce) {\n this.#resizeObserver.observe(this.#shadow.host);\n }\n }\n\n #userHasCellFocused(): boolean {\n return this.#cellUserHasFocused !== null;\n }\n\n #getTableElementForCellUserHasFocused(): HTMLTableCellElement|null {\n if (!this.#cellUserHasFocused) {\n return null;\n }\n const [columnIndex, rowIndex] = this.#cellUserHasFocused;\n const cell = this.#shadow.querySelector(\n `[data-row-index=\"${rowIndex}\"][data-col-index=\"${columnIndex}\"]`);\n return cell;\n }\n\n #focusTableCellInDOM(cell: HTMLTableCellElement): void {\n cell.focus();\n }\n\n #focusCellIfRequired([newColumnIndex, newRowIndex]: CellPosition): void {\n this.#userHasFocusInDataGrid = true;\n\n if (this.#cellUserHasFocused && this.#cellUserHasFocused[0] === newColumnIndex &&\n this.#cellUserHasFocused[1] === newRowIndex) {\n // The cell is already active and focused so we don't need to do anything.\n return;\n }\n\n this.#cellUserHasFocused = [newColumnIndex, newRowIndex];\n void this.#render();\n const tableCell = this.#getTableElementForCellUserHasFocused();\n if (!tableCell) {\n // Return in case the cell is out of bounds and we do nothing\n return;\n }\n /* The cell may already be focused if the user clicked into it, but we also\n * add arrow key support, so in the case where we're programatically moving the\n * focus, ensure we actually focus the cell.\n */\n this.#focusTableCellInDOM(tableCell);\n // If it's a sortable column header, screen reader announce the information for sorting\n if (newRowIndex === 0 && this.#columns[newColumnIndex].sortable) {\n const localizedSortState = this.#getLocalizedSortState(this.#columns[newColumnIndex]);\n UI.ARIAUtils.alert(i18nString(UIStrings.enterToSort, {PH1: localizedSortState || ''}));\n }\n }\n\n #getLocalizedSortState(col: Column): string|undefined {\n const currentSortLabel = this.#ariaSortForHeader(col);\n switch (currentSortLabel) {\n case 'ascending':\n return UIStrings.sortAsc;\n case 'descending':\n return UIStrings.sortDesc;\n case 'none':\n return UIStrings.sortNone;\n }\n return undefined;\n }\n\n #onTableKeyDown(event: KeyboardEvent): void {\n const key = event.key;\n\n if (!this.#cellUserHasFocused) {\n return;\n }\n\n if (KEYS_TREATED_AS_CLICKS.has(key)) {\n const [focusedColumnIndex, focusedRowIndex] = this.#cellUserHasFocused;\n const activeColumn = this.#columns[focusedColumnIndex];\n if (focusedRowIndex === 0 && activeColumn && activeColumn.sortable) {\n this.#onColumnHeaderClick(activeColumn, focusedColumnIndex);\n }\n }\n\n if (!Platform.KeyboardUtilities.keyIsArrowKey(key)) {\n return;\n }\n\n const nextFocusedCell = handleArrowKeyNavigation({\n key,\n currentFocusedCell: this.#cellUserHasFocused,\n columns: this.#columns,\n rows: this.#rows,\n });\n event.preventDefault();\n this.#focusCellIfRequired(nextFocusedCell);\n }\n\n #onColumnHeaderClick(col: Column, index: number): void {\n this.dispatchEvent(new ColumnHeaderClickEvent(col, index));\n }\n\n /**\n * Applies the aria-sort label to a column's th.\n * Guidance on values of attribute taken from\n * https://www.w3.org/TR/wai-aria-practices/examples/grid/dataGrids.html.\n */\n #ariaSortForHeader(col: Column): 'none'|'ascending'|'descending'|undefined {\n if (col.sortable && (!this.#sortState || this.#sortState.columnId !== col.id)) {\n // Column is sortable but is not currently sorted\n return 'none';\n }\n\n if (this.#sortState && this.#sortState.columnId === col.id) {\n return this.#sortState.direction === SortDirection.ASC ? 'ascending' : 'descending';\n }\n\n // Column is not sortable, so don't apply any label\n return undefined;\n }\n\n #renderEmptyFillerRow(numberOfVisibleRows: number): LitHtml.TemplateResult {\n const emptyCells = this.#columns.map((col, colIndex) => {\n if (!col.visible) {\n return LitHtml.nothing;\n }\n const emptyCellClasses = LitHtml.Directives.classMap({\n firstVisibleColumn: colIndex === 0,\n });\n return html``;\n });\n const emptyRowClasses = LitHtml.Directives.classMap({\n 'filler-row': true,\n 'padding-row': true,\n 'empty-table': numberOfVisibleRows === 0,\n });\n return html`${emptyCells}`;\n }\n\n #cleanUpAfterResizeColumnComplete(): void {\n if (!this.#currentResize) {\n return;\n }\n this.#currentResize.documentForCursorChange.body.style.cursor = this.#currentResize.cursorToRestore;\n this.#currentResize = null;\n // Realign the scroll handlers now the table columns have been resized.\n void this.#alignScrollHandlers();\n }\n\n #onResizePointerDown(event: PointerEvent): void {\n if (event.buttons !== 1 || (Host.Platform.isMac() && event.ctrlKey)) {\n // Ensure we only react to a left click drag mouse down event.\n // On Mac we ignore Ctrl-click which can be used to bring up context menus, etc.\n return;\n }\n event.preventDefault();\n const resizerElement = event.target as HTMLElement;\n if (!resizerElement) {\n return;\n }\n const leftColumnIndex = resizerElement.dataset.columnIndex;\n if (!leftColumnIndex) {\n return;\n }\n const leftColumnIndexAsNumber = globalThis.parseInt(leftColumnIndex, 10);\n /* To find the cell to the right we can't just go +1 as it might be hidden,\n * so find the next index that is visible.\n */\n const rightColumnIndexAsNumber = this.#columns.findIndex((column, index) => {\n return index > leftColumnIndexAsNumber && column.visible === true;\n });\n\n const leftCell = this.#shadow.querySelector(`td[data-filler-row-column-index=\"${leftColumnIndexAsNumber}\"]`);\n const rightCell = this.#shadow.querySelector(`td[data-filler-row-column-index=\"${rightColumnIndexAsNumber}\"]`);\n if (!leftCell || !rightCell) {\n return;\n }\n // We query for the elements as they are the elements that we put the actual width on.\n const leftCellCol =\n this.#shadow.querySelector(`col[data-col-column-index=\"${leftColumnIndexAsNumber}\"]`);\n const rightCellCol =\n this.#shadow.querySelector(`col[data-col-column-index=\"${rightColumnIndexAsNumber}\"]`);\n if (!leftCellCol || !rightCellCol) {\n return;\n }\n\n const targetDocumentForCursorChange = (event.target as Node).ownerDocument;\n if (!targetDocumentForCursorChange) {\n return;\n }\n // We now store values that we'll make use of in the mousemouse event to calculate how much to resize the table by.\n this.#currentResize = {\n leftCellCol,\n rightCellCol,\n leftCellColInitialPercentageWidth: globalThis.parseInt(leftCellCol.style.width, 10),\n rightCellColInitialPercentageWidth: globalThis.parseInt(rightCellCol.style.width, 10),\n initialLeftCellWidth: leftCell.clientWidth,\n initialRightCellWidth: rightCell.clientWidth,\n initialMouseX: event.x,\n documentForCursorChange: targetDocumentForCursorChange,\n cursorToRestore: resizerElement.style.cursor,\n };\n\n targetDocumentForCursorChange.body.style.cursor = 'col-resize';\n resizerElement.setPointerCapture(event.pointerId);\n resizerElement.addEventListener('pointermove', this.#boundOnResizePointerMove);\n }\n\n #onResizePointerMove(event: PointerEvent): void {\n event.preventDefault();\n if (!this.#currentResize) {\n return;\n }\n\n const MIN_CELL_WIDTH_PERCENTAGE = 10;\n const MAX_CELL_WIDTH_PERCENTAGE = (this.#currentResize.leftCellColInitialPercentageWidth +\n this.#currentResize.rightCellColInitialPercentageWidth) -\n MIN_CELL_WIDTH_PERCENTAGE;\n const deltaOfMouseMove = event.x - this.#currentResize.initialMouseX;\n const absoluteDelta = Math.abs(deltaOfMouseMove);\n const percentageDelta =\n (absoluteDelta / (this.#currentResize.initialLeftCellWidth + this.#currentResize.initialRightCellWidth)) * 100;\n\n let newLeftColumnPercentage;\n let newRightColumnPercentage;\n if (deltaOfMouseMove > 0) {\n /**\n * A positive delta means the user moved their mouse to the right, so we\n * want to make the right column smaller, and the left column larger.\n */\n newLeftColumnPercentage = Platform.NumberUtilities.clamp(\n this.#currentResize.leftCellColInitialPercentageWidth + percentageDelta, MIN_CELL_WIDTH_PERCENTAGE,\n MAX_CELL_WIDTH_PERCENTAGE);\n newRightColumnPercentage = Platform.NumberUtilities.clamp(\n this.#currentResize.rightCellColInitialPercentageWidth - percentageDelta, MIN_CELL_WIDTH_PERCENTAGE,\n MAX_CELL_WIDTH_PERCENTAGE);\n } else if (deltaOfMouseMove < 0) {\n /**\n * Negative delta means the user moved their mouse to the left, which\n * means we want to make the right column larger, and the left column\n * smaller.\n */\n newLeftColumnPercentage = Platform.NumberUtilities.clamp(\n this.#currentResize.leftCellColInitialPercentageWidth - percentageDelta, MIN_CELL_WIDTH_PERCENTAGE,\n MAX_CELL_WIDTH_PERCENTAGE);\n newRightColumnPercentage = Platform.NumberUtilities.clamp(\n this.#currentResize.rightCellColInitialPercentageWidth + percentageDelta, MIN_CELL_WIDTH_PERCENTAGE,\n MAX_CELL_WIDTH_PERCENTAGE);\n }\n\n if (!newLeftColumnPercentage || !newRightColumnPercentage) {\n // The delta was 0, so nothing to do.\n return;\n }\n\n // We limit the values to two decimal places to not work with huge decimals.\n // It also prevents stuttering if the user barely moves the mouse, as the\n // browser won't try to move the column by 0.0000001% or similar.\n this.#currentResize.leftCellCol.style.width = newLeftColumnPercentage.toFixed(2) + '%';\n this.#currentResize.rightCellCol.style.width = newRightColumnPercentage.toFixed(2) + '%';\n }\n\n #onResizePointerUp(event: PointerEvent): void {\n event.preventDefault();\n const resizer = event.target as HTMLElement;\n if (!resizer) {\n return;\n }\n resizer.releasePointerCapture(event.pointerId);\n resizer.removeEventListener('pointermove', this.#boundOnResizePointerMove);\n this.#cleanUpAfterResizeColumnComplete();\n }\n\n #renderResizeForCell(column: Column, position: CellPosition): LitHtml.LitTemplate {\n /**\n * A resizer for a column is placed at the far right of the _previous column\n * cell_. So when we get called with [1, 0] that means this dragger is\n * resizing column 1, but the dragger itself is located within column 0. We\n * need the column to the left because when you resize a column you're not\n * only resizing it but also the column to its left.\n */\n const [columnIndex] = position;\n const lastVisibleColumnIndex = this.#getIndexOfLastVisibleColumn();\n // If we are in the very last column, there is no column to the right to resize, so don't render a resizer.\n if (columnIndex === lastVisibleColumnIndex || !column.visible) {\n return LitHtml.nothing;\n }\n\n return html``;\n }\n\n #getIndexOfLastVisibleColumn(): number {\n let index = this.#columns.length - 1;\n for (; index > -1; index--) {\n const col = this.#columns[index];\n if (col.visible) {\n break;\n }\n }\n return index;\n }\n\n /**\n * This function is called when the user right clicks on the header row of the\n * data grid.\n */\n #onHeaderContextMenu(event: MouseEvent): void {\n if (event.button !== 2 && event.button !== -1) {\n // -1 = right click invoked by keyboard, for example 'Shift + F10'.\n // 2 = secondary button = right click. We only show context menus if the\n // user has right clicked.\n return;\n }\n\n const menu = new UI.ContextMenu.ContextMenu(event);\n addColumnVisibilityCheckboxes(this, menu);\n const sortMenu = menu.defaultSection().appendSubMenuItem(i18nString(UIStrings.sortBy), false, 'sort-by');\n addSortableColumnItems(this, sortMenu);\n\n menu.defaultSection().appendItem(i18nString(UIStrings.resetColumns), () => {\n this.dispatchEvent(new ContextMenuHeaderResetClickEvent());\n }, {jslogContext: 'reset-columns'});\n\n if (this.#contextMenus && this.#contextMenus.headerRow) {\n // Let the user append things to the menu\n this.#contextMenus.headerRow(menu, this.#columns);\n }\n void menu.show();\n }\n\n #onBodyRowContextMenu(event: MouseEvent): void {\n if (event.button !== 2 && event.button !== -1) {\n // -1 = right click invoked by keyboard, for example 'Shift + F10'.\n // 2 = secondary button = right click. We only show context menus if the\n // user has right clicked.\n return;\n }\n /**\n * We now make sure that the event came from an HTML element with a\n * data-row-index attribute, else we bail.\n */\n if (!event.target || !(event.target instanceof HTMLElement)) {\n return;\n }\n const rowIndexAttribute = event.target.dataset.rowIndex;\n if (!rowIndexAttribute) {\n return;\n }\n\n const rowIndex = parseInt(rowIndexAttribute, 10);\n // rowIndex - 1 here because in the UI the 0th row is the column headers.\n const rowThatWasClicked = this.#rows[rowIndex - 1];\n\n const menu = new UI.ContextMenu.ContextMenu(event);\n const sortMenu = menu.defaultSection().appendSubMenuItem(i18nString(UIStrings.sortBy), false, 'sort-by');\n addSortableColumnItems(this, sortMenu);\n\n const headerOptionsMenu =\n menu.defaultSection().appendSubMenuItem(i18nString(UIStrings.headerOptions), false, 'header-options');\n addColumnVisibilityCheckboxes(this, headerOptionsMenu);\n headerOptionsMenu.defaultSection().appendItem(i18nString(UIStrings.resetColumns), () => {\n this.dispatchEvent(new ContextMenuHeaderResetClickEvent());\n }, {jslogContext: 'reset-columns'});\n\n if (this.#contextMenus && this.#contextMenus.bodyRow) {\n this.#contextMenus.bodyRow(menu, this.#columns, rowThatWasClicked, this.#rows);\n }\n void menu.show();\n }\n\n #onScroll(event: Event): void {\n const wrapper = event.target as HTMLElement;\n if (!wrapper) {\n return;\n }\n\n // Need to Math.round because on high res screens we can end up with decimal\n // point numbers for scroll positions.\n const userIsAtBottom = Math.round(wrapper.scrollTop + wrapper.clientHeight) === Math.round(wrapper.scrollHeight);\n this.#userScrollState =\n userIsAtBottom ? UserScrollState.SCROLLED_TO_BOTTOM : UserScrollState.MANUAL_SCROLL_NOT_BOTTOM;\n\n void this.#render();\n }\n\n #alignScrollHandlers(): Promise {\n return RenderCoordinator.read(() => {\n const columnHeaders = this.#shadow.querySelectorAll('th:not(.hidden)');\n const handlers = this.#shadow.querySelectorAll('.cell-resize-handle');\n const table = this.#shadow.querySelector('table');\n if (!table) {\n return;\n }\n\n columnHeaders.forEach(async (header, index) => {\n const columnWidth = header.clientWidth;\n const columnLeftOffset = header.offsetLeft;\n if (handlers[index]) {\n const handlerWidth = handlers[index].clientWidth;\n void RenderCoordinator.write(() => {\n /**\n * Render the resizer at the far right of the column; we subtract\n * its width so it sits on the inner edge of the column.\n */\n handlers[index].style.left = `${columnLeftOffset + columnWidth - handlerWidth}px`;\n });\n }\n });\n });\n }\n\n /**\n * Calculates the index of the first row we want to render, and the last row we want to render.\n * Pads in each direction by PADDING_ROWS_COUNT so we render some rows that are off scren.\n */\n #calculateTopAndBottomRowIndexes(): Promise<{topVisibleRow: number, bottomVisibleRow: number}> {\n return RenderCoordinator.read(() => {\n const wrapper = this.#shadow.querySelector('.wrapping-container');\n\n // On first render we don't have a wrapper, so we can't get at its\n // scroll/height values. So we default to the inner height of the window as\n // the limit for rendering. This means we may over-render by a few rows, but\n // better that than either render everything, or rendering too few rows.\n let scrollTop = 0;\n let clientHeight = window.innerHeight;\n if (wrapper) {\n scrollTop = wrapper.scrollTop;\n clientHeight = wrapper.clientHeight;\n }\n const padding = ROW_HEIGHT_PIXELS * this.#paddingRowsCount;\n let topVisibleRow = Math.floor((scrollTop - padding) / ROW_HEIGHT_PIXELS);\n let bottomVisibleRow = Math.ceil((scrollTop + clientHeight + padding) / ROW_HEIGHT_PIXELS);\n\n topVisibleRow = Math.max(0, topVisibleRow);\n bottomVisibleRow = Math.min(this.#rows.filter(r => !r.hidden).length, bottomVisibleRow);\n\n return {\n topVisibleRow,\n bottomVisibleRow,\n };\n });\n }\n\n #onFocusOut(): void {\n /**\n * When any element in the data-grid loses focus, we set this to false. If\n * the user then focuses another cell, that code will set the focus to true.\n * We need to know if the user is focused because if they are and they've\n * scrolled their focused cell out of rendering view and back in, we want to\n * refocus it. But if they aren't focused and that happens, we don't, else\n * we can steal focus away from the user if they are typing into an input\n * box to filter the data-grid, for example.\n */\n this.#userHasFocusInDataGrid = false;\n }\n\n #tabbableCell(): CellPosition {\n /**\n * If the user has selected a cell, this is the cell that should be\n * \"tabbable\" if the user tabs out and into the data-grid. If the user\n * hasn't selected a cell, we fallback to the default cell that we set as\n * tabbable when we render.\n */\n return this.#cellUserHasFocused || this.#cellToFocusIfUserTabsIn;\n }\n\n /**\n * Renders the data-grid table. Note that we do not render all rows; the\n * performance cost are too high once you have a large enough table. Instead\n * we calculate the size of the container we are rendering into, and then\n * render only the rows required to fill that table (plus a bit extra for\n * padding).\n */\n async #render(): Promise {\n if (!this.isConnected) {\n return;\n }\n if (this.#isRendering) {\n // If we receive a request to render during a previous render call, we block\n // the newly requested render (since we could receive a lot of them in quick\n // succession), but we do ensure that at the end of the current render we\n // go again with the latest data.\n this.#scheduleRender = true;\n return;\n }\n this.#isRendering = true;\n\n const {topVisibleRow, bottomVisibleRow} = await this.#calculateTopAndBottomRowIndexes();\n const nonHiddenRows = this.#rows.filter(row => !row.hidden);\n const renderableRows = nonHiddenRows.filter((_, idx) => idx >= topVisibleRow && idx <= bottomVisibleRow);\n const indexOfFirstVisibleColumn = this.#columns.findIndex(col => col.visible);\n const anyColumnsSortable = this.#columns.some(col => col.sortable === true);\n const containerClassMap = {\n 'wrapping-container': true,\n 'show-scrollbar': this.#showScrollbar === true,\n striped: this.#striped === true,\n };\n\n await RenderCoordinator.write(() => {\n // Disabled until https://crbug.com/1079231 is fixed.\n // clang-format off\n LitHtml.render(html`\n ${this.#columns.map((col, columnIndex) => {\n /**\n * We render the resizers outside of the table. One is rendered for each\n * column, and they are positioned absolutely at the right position. They\n * have 100% height so they sit over the entire table and can be grabbed\n * by the user.\n */\n return this.#renderResizeForCell(col, [columnIndex, 0]);\n })}\n
\n \n \n \n ${this.#columns.map((col, colIndex) => {\n const width = calculateColumnWidthPercentageFromWeighting(this.#columns, col.id);\n const style = `width: ${width}%`;\n if (!col.visible) {\n return LitHtml.nothing;\n }\n return html``;\n })}\n \n \n \n ${this.#columns.map((col, columnIndex) => {\n const thClasses = classMap({\n hidden: !col.visible,\n firstVisibleColumn: columnIndex === indexOfFirstVisibleColumn,\n sortable: anyColumnsSortable,\n });\n const tabbableCell = this.#tabbableCell();\n const cellIsFocusableCell = anyColumnsSortable && columnIndex === tabbableCell[0] && tabbableCell[1] === 0;\n\n return html` {\n this.#focusCellIfRequired([columnIndex, 0]);\n }}\n @click=${() => {\n /**\n * We use click here rather than focus because if you've\n * clicked on the header to sort, you've also focused it. If\n * you then click it again to change the sorting, this\n * doesn't emit a focus event as the cell is already\n * focused.\n */\n this.#onColumnHeaderClick(col, columnIndex);\n }}\n title=${col.title}\n aria-sort=${ifDefined(this.#ariaSortForHeader(col))}\n aria-colindex=${columnIndex + 1}\n data-row-index='0'\n data-col-index=${columnIndex}\n tabindex=${ifDefined(anyColumnsSortable ? (cellIsFocusableCell ? '0' : '-1') : undefined)}\n >${col.titleElement || col.title}`;\n })}\n \n \n \n \n ${repeat(renderableRows, row => this.#rowIndexMap.get(row), row => {\n const rowIndex = this.#rowIndexMap.get(row);\n if (rowIndex === undefined) {\n throw new Error('Trying to render a row that has no index in the rowIndexMap');\n }\n const tabbableCell = this.#tabbableCell();\n // Remember that row 0 is considered the header row, so the first tbody row is row 1.\n const tableRowIndex = rowIndex + 1;\n\n // Check for cellUserHasFocused instead of tabbableCell so that we\n // don't highlight the active cell before they've even clicked it.\n const rowIsSelected = this.#cellUserHasFocused ? tableRowIndex === this.#cellUserHasFocused[1] : false;\n\n const rowClasses = LitHtml.Directives.classMap({\n selected: rowIsSelected,\n hidden: row.hidden === true,\n });\n return html`\n {\n this.dispatchEvent(new RowMouseEnterEvent(row));\n }}\n @mouseleave=${() => {\n this.dispatchEvent(new RowMouseLeaveEvent(row));\n }}\n >${this.#columns.map((col, columnIndex) => {\n const cell = getRowEntryForColumnId(row, col.id);\n const cellClasses = classMap({\n hidden: !col.visible,\n firstVisibleColumn: columnIndex === indexOfFirstVisibleColumn,\n });\n const cellIsFocusableCell = columnIndex === tabbableCell[0] && tableRowIndex === tabbableCell[1];\n const cellOutput = col.visible ? renderCellValue(cell) : null;\n return html` {\n this.#focusCellIfRequired([columnIndex, tableRowIndex]);\n this.dispatchEvent(new BodyCellFocusedEvent(cell, row));\n }}\n >${cellOutput}`;\n })}\n `;\n })}\n ${this.#renderEmptyFillerRow(renderableRows.length)}\n \n \n \n
\n `, this.#shadow, {\n host: this,\n });\n });\n // clang-format on\n\n // This ensures if the user has a cell focused, but then scrolls so that\n // the focused cell is now not rendered, that when it then gets scrolled\n // back in, that it becomes rendered.\n // However, if the cell is a column header, we don't do this, as that\n // can never be not-rendered.\n const tabbableCell = this.#tabbableCell();\n const currentlyFocusedRowIndex = tabbableCell[1];\n const tabbableCellElement = this.#getTableElementForCellUserHasFocused();\n if (this.#userHasFocusInDataGrid && currentlyFocusedRowIndex > 0 && tabbableCellElement) {\n this.#focusTableCellInDOM(tabbableCellElement);\n }\n this.#scrollToBottomIfRequired();\n this.#engageResizeObserver();\n if (this.#hasRenderedAtLeastOnce) {\n // We may have had a cell's width change on a re-render, or it may have\n // been hidden entirely, so we need to ensure that the resize handlers are\n // re-positioned correctly if so.\n\n // We don't have to do this on first render as it will fire when the resize observer is engaged.\n void this.#alignScrollHandlers();\n }\n\n this.#isRendering = false;\n this.#hasRenderedAtLeastOnce = true;\n\n // If we've received more data mid-render we will do one extra render at\n // the end with the most recent data.\n if (this.#scheduleRender) {\n this.#scheduleRender = false;\n void this.#render();\n }\n }\n}\n\ncustomElements.define('devtools-data-grid', DataGrid);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'devtools-data-grid': DataGrid;\n }\n}\n"]} \ No newline at end of file diff --git a/public/ui/components/data_grid/DataGrid.test.js b/public/ui/components/data_grid/DataGrid.test.js index edcd87142..1d654aa3d 100644 --- a/public/ui/components/data_grid/DataGrid.test.js +++ b/public/ui/components/data_grid/DataGrid.test.js @@ -8,10 +8,9 @@ import { describeWithLocale } from '../../../testing/EnvironmentHelpers.js'; import { withMutations } from '../../../testing/MutationHelpers.js'; import * as LitHtml from '../../lit-html/lit-html.js'; import * as IconButton from '../icon_button/icon_button.js'; -import * as Coordinator from '../render_coordinator/render_coordinator.js'; +import * as RenderCoordinator from '../render_coordinator/render_coordinator.js'; import * as DataGrid from './data_grid.js'; const { html } = LitHtml; -const coordinator = Coordinator.RenderCoordinator.RenderCoordinator.instance(); const createColumns = () => { return [ { id: 'city', title: 'City', sortable: true, widthWeighting: 2, visible: true, hideable: false }, @@ -70,7 +69,7 @@ describe('DataGrid', () => { it('renders the right headers and values', async () => { const component = renderDataGrid({ rows, columns }); assert.isNotNull(component.shadowRoot); - await coordinator.done(); + await RenderCoordinator.done(); const headerCells = getHeaderCells(component.shadowRoot); const values = Array.from(headerCells, cell => cell.textContent || ''); assert.deepEqual(values, ['City', 'Country', 'Population']); @@ -87,7 +86,7 @@ describe('DataGrid', () => { columnsWithFirstHidden[0].visible = false; const component = renderDataGrid({ rows, columns: columnsWithFirstHidden }); assert.isNotNull(component.shadowRoot); - await coordinator.done(); + await RenderCoordinator.done(); const renderedRows = Array.from(component.shadowRoot.querySelectorAll('tbody tr:not(.padding-row)')); const cellsHaveChildren = renderedRows.map(row => { const cells = Array.from(row.querySelectorAll('td'), cell => { @@ -107,7 +106,7 @@ describe('DataGrid', () => { it('uses the cell\'s value as its title attribute by default', async () => { const component = renderDataGrid({ rows, columns }); assert.isNotNull(component.shadowRoot); - await coordinator.done(); + await RenderCoordinator.done(); const renderedBodyRows = getAllRows(component.shadowRoot); const renderedBodyCells = renderedBodyRows.map(row => Array.from(row.querySelectorAll('td'))); const titleAttributesForCellsByRow = renderedBodyCells.map(row => row.map(cell => cell.getAttribute('title'))); @@ -122,7 +121,7 @@ describe('DataGrid', () => { rowsWithTitleSpecified[0].cells[0].title = 'EXPLICITLY_PROVIDED_TITLE'; const component = renderDataGrid({ rows: rowsWithTitleSpecified, columns }); assert.isNotNull(component.shadowRoot); - await coordinator.done(); + await RenderCoordinator.done(); const renderedBodyRows = getAllRows(component.shadowRoot); const renderedBodyCells = renderedBodyRows.map(row => Array.from(row.querySelectorAll('td'))); const titleAttributesForCellsByRow = renderedBodyCells.map(row => row.map(cell => cell.getAttribute('title'))); @@ -137,7 +136,7 @@ describe('DataGrid', () => { columnsWithCityHidden[0].visible = false; const component = renderDataGrid({ rows, columns: columnsWithCityHidden }); assert.isNotNull(component.shadowRoot); - await coordinator.done(); + await RenderCoordinator.done(); const headerCells = getHeaderCells(component.shadowRoot, { onlyVisible: true }); const values = Array.from(headerCells, cell => cell.textContent || ''); assert.deepEqual(values, ['Country', 'Population']); @@ -153,7 +152,7 @@ describe('DataGrid', () => { rowsWithLondonHidden[0].hidden = true; const component = renderDataGrid({ rows: rowsWithLondonHidden, columns }); assert.isNotNull(component.shadowRoot); - await coordinator.done(); + await RenderCoordinator.done(); const rowValues = getValuesOfAllBodyRows(component.shadowRoot, { onlyVisible: true }); assert.deepEqual(rowValues, [ ['Munich', 'Germany', '1.47m'], @@ -167,7 +166,7 @@ describe('DataGrid', () => { const rows = [{ cells: [{ columnId: 'key', value: 'Hello World' }] }]; const component = renderDataGrid({ columns, rows }); assert.isNotNull(component.shadowRoot); - await coordinator.done(); + await RenderCoordinator.done(); const cell = getCellByIndexes(component.shadowRoot, { column: 0, row: 1 }); assert.deepEqual(stripLitHtmlCommentNodes(cell.innerHTML), 'Hello World'); }); @@ -185,7 +184,7 @@ describe('DataGrid', () => { }]; const component = renderDataGrid({ columns, rows }); assert.isNotNull(component.shadowRoot); - await coordinator.done(); + await RenderCoordinator.done(); const cell = getCellByIndexes(component.shadowRoot, { column: 0, row: 1 }); assert.deepEqual(stripLitHtmlCommentNodes(cell.innerHTML), 'Hello World'); }); @@ -205,7 +204,7 @@ describe('DataGrid', () => { }]; const component = renderDataGrid({ columns, rows }); assert.isNotNull(component.shadowRoot); - await coordinator.done(); + await RenderCoordinator.done(); const cell = getCellByIndexes(component.shadowRoot, { column: 0, row: 1 }); assert.deepEqual(stripLitHtmlCommentNodes(cell.innerHTML), '
'); }); @@ -221,7 +220,7 @@ describe('DataGrid', () => { }]; const component = renderDataGrid({ columns, rows }); assert.isNotNull(component.shadowRoot); - await coordinator.done(); + await RenderCoordinator.done(); const cell = getCellByIndexes(component.shadowRoot, { column: 0, row: 1 }); assert.deepEqual(stripLitHtmlCommentNodes(cell.innerHTML), '

foo: Hello World

'); }); @@ -230,7 +229,7 @@ describe('DataGrid', () => { it('it adds aria-label to the table if one is specified', async () => { const component = renderDataGrid({ columns, rows, label }); assert.isNotNull(component.shadowRoot); - await coordinator.done(); + await RenderCoordinator.done(); const table = component.shadowRoot.querySelector('table'); assert.instanceOf(table, HTMLTableElement); assert.strictEqual(table.getAttribute('aria-label'), label); @@ -238,15 +237,15 @@ describe('DataGrid', () => { it('it does not add an aria-label to the table if one is not specified', async () => { const component = renderDataGrid({ columns, rows }); assert.isNotNull(component.shadowRoot); - await coordinator.done(); + await RenderCoordinator.done(); const table = component.shadowRoot.querySelector('table'); assert.instanceOf(table, HTMLTableElement); - assert.strictEqual(table.getAttribute('aria-label'), null); + assert.isNull(table.getAttribute('aria-label')); }); it('adds rowcount and colcount to the table', async () => { const component = renderDataGrid({ columns, rows }); assert.isNotNull(component.shadowRoot); - await coordinator.done(); + await RenderCoordinator.done(); const table = component.shadowRoot.querySelector('table'); assert.instanceOf(table, HTMLTableElement); assert.strictEqual(table.getAttribute('aria-rowcount'), '3'); @@ -257,7 +256,7 @@ describe('DataGrid', () => { rowsWithLondonHidden[0].hidden = true; const component = renderDataGrid({ columns, rows: rowsWithLondonHidden }); assert.isNotNull(component.shadowRoot); - await coordinator.done(); + await RenderCoordinator.done(); const table = component.shadowRoot.querySelector('table'); assert.instanceOf(table, HTMLTableElement); assert.strictEqual(table.getAttribute('aria-rowcount'), '3'); @@ -266,11 +265,11 @@ describe('DataGrid', () => { it('labels a column when it is sortable and does not add a label when it is not', async () => { const component = renderDataGrid({ columns, rows }); assert.isNotNull(component.shadowRoot); - await coordinator.done(); + await RenderCoordinator.done(); const cityHeader = getHeaderCellForColumnId(component.shadowRoot, 'city'); const countryHeader = getHeaderCellForColumnId(component.shadowRoot, 'country'); assert.strictEqual(cityHeader.getAttribute('aria-sort'), 'none'); - assert.strictEqual(countryHeader.getAttribute('aria-sort'), null); + assert.isNull(countryHeader.getAttribute('aria-sort')); }); it('labels a column when it is sorted in ASC order', async () => { const component = renderDataGrid({ @@ -282,7 +281,7 @@ describe('DataGrid', () => { }, }); assert.isNotNull(component.shadowRoot); - await coordinator.done(); + await RenderCoordinator.done(); const cityHeader = getHeaderCellForColumnId(component.shadowRoot, 'city'); assert.strictEqual(cityHeader.getAttribute('aria-sort'), 'ascending'); }); @@ -296,7 +295,7 @@ describe('DataGrid', () => { }, }); assert.isNotNull(component.shadowRoot); - await coordinator.done(); + await RenderCoordinator.done(); const cityHeader = getHeaderCellForColumnId(component.shadowRoot, 'city'); assert.strictEqual(cityHeader.getAttribute('aria-sort'), 'descending'); }); @@ -305,13 +304,13 @@ describe('DataGrid', () => { it('makes the first body cell focusable by default when no columns are sortable', async () => { const component = renderDataGrid({ rows, columns: columnsWithNoneSortable }); assert.isNotNull(component.shadowRoot); - await coordinator.done(); + await RenderCoordinator.done(); assertCurrentFocusedCellIs(component.shadowRoot, { column: 0, row: 1 }); }); it('does not let the user navigate into the columns when no colums are sortable', async () => { const component = renderDataGrid({ rows, columns: columnsWithNoneSortable }); assert.isNotNull(component.shadowRoot); - await coordinator.done(); + await RenderCoordinator.done(); assertCurrentFocusedCellIs(component.shadowRoot, { column: 0, row: 1 }); emulateUserKeyboardNavigation(component.shadowRoot, 'ArrowUp'); assertCurrentFocusedCellIs(component.shadowRoot, { column: 0, row: 1 }); @@ -319,32 +318,32 @@ describe('DataGrid', () => { it('focuses the column header by default when it is sortable', async () => { const component = renderDataGrid({ rows, columns }); assert.isNotNull(component.shadowRoot); - await coordinator.done(); + await RenderCoordinator.done(); assertCurrentFocusedCellIs(component.shadowRoot, { column: 0, row: 0 }); }); it('lets the user press the right arrow key to navigate right', async () => { const component = renderDataGrid({ rows, columns: columnsWithNoneSortable }); assert.isNotNull(component.shadowRoot); - await coordinator.done(); + await RenderCoordinator.done(); focusCurrentlyFocusableCell(component.shadowRoot); emulateUserKeyboardNavigation(component.shadowRoot, 'ArrowRight'); - await coordinator.done(); + await RenderCoordinator.done(); assertCurrentFocusedCellIs(component.shadowRoot, { column: 1, row: 1 }); }); it('lets the user press the left arrow key to navigate left', async () => { const component = renderDataGrid({ rows, columns: columnsWithNoneSortable }); assert.isNotNull(component.shadowRoot); - await coordinator.done(); + await RenderCoordinator.done(); // Find a cell in the 2nd column to click to focus await emulateUserFocusingCellAt(component.shadowRoot, { column: 1, row: 1 }); emulateUserKeyboardNavigation(component.shadowRoot, 'ArrowLeft'); - await coordinator.done(); + await RenderCoordinator.done(); assertCurrentFocusedCellIs(component.shadowRoot, { column: 0, row: 1 }); }); it('does not let the user move left if they are at the first visible column', async () => { const component = renderDataGrid({ rows, columns: columnsWithNoneSortable }); assert.isNotNull(component.shadowRoot); - await coordinator.done(); + await RenderCoordinator.done(); focusCurrentlyFocusableCell(component.shadowRoot); assertCurrentFocusedCellIs(component.shadowRoot, { column: 0, row: 1 }); emulateUserKeyboardNavigation(component.shadowRoot, 'ArrowLeft'); @@ -353,56 +352,56 @@ describe('DataGrid', () => { it('lets the user press the down arrow key to navigate down', async () => { const component = renderDataGrid({ rows, columns: columnsWithNoneSortable }); assert.isNotNull(component.shadowRoot); - await coordinator.done(); + await RenderCoordinator.done(); focusCurrentlyFocusableCell(component.shadowRoot); emulateUserKeyboardNavigation(component.shadowRoot, 'ArrowDown'); - await coordinator.done(); + await RenderCoordinator.done(); assertCurrentFocusedCellIs(component.shadowRoot, { column: 0, row: 2 }); }); it('keeps the user where they are if they are on the last row', async () => { const component = renderDataGrid({ rows, columns: columnsWithNoneSortable }); assert.isNotNull(component.shadowRoot); - await coordinator.done(); + await RenderCoordinator.done(); focusCurrentlyFocusableCell(component.shadowRoot); // Go down to row 2 emulateUserKeyboardNavigation(component.shadowRoot, 'ArrowDown'); - await coordinator.done(); + await RenderCoordinator.done(); // Go down to row 3 (the last row) emulateUserKeyboardNavigation(component.shadowRoot, 'ArrowDown'); - await coordinator.done(); + await RenderCoordinator.done(); assertCurrentFocusedCellIs(component.shadowRoot, { column: 0, row: 3 }); // Try going down again emulateUserKeyboardNavigation(component.shadowRoot, 'ArrowDown'); - await coordinator.done(); + await RenderCoordinator.done(); assertCurrentFocusedCellIs(component.shadowRoot, { column: 0, row: 3 }); }); it('lets the user press the up arrow key to navigate up', async () => { const component = renderDataGrid({ rows, columns: columnsWithNoneSortable }); assert.isNotNull(component.shadowRoot); - await coordinator.done(); + await RenderCoordinator.done(); await emulateUserFocusingCellAt(component.shadowRoot, { column: 1, row: 2 }); emulateUserKeyboardNavigation(component.shadowRoot, 'ArrowUp'); - await coordinator.done(); + await RenderCoordinator.done(); assertCurrentFocusedCellIs(component.shadowRoot, { column: 1, row: 1 }); }); it('does not let the user move up into the column row when none are sortable', async () => { const component = renderDataGrid({ rows, columns: columnsWithNoneSortable }); assert.isNotNull(component.shadowRoot); - await coordinator.done(); + await RenderCoordinator.done(); focusCurrentlyFocusableCell(component.shadowRoot); emulateUserKeyboardNavigation(component.shadowRoot, 'ArrowUp'); - await coordinator.done(); + await RenderCoordinator.done(); assertCurrentFocusedCellIs(component.shadowRoot, { column: 0, row: 1 }); }); it('does let the user move up into the column row when they are sortable', async () => { const component = renderDataGrid({ rows, columns }); assert.isNotNull(component.shadowRoot); - await coordinator.done(); + await RenderCoordinator.done(); const table = component.shadowRoot.querySelector('table'); assert.instanceOf(table, HTMLTableElement); await emulateUserFocusingCellAt(component.shadowRoot, { column: 0, row: 1 }); emulateUserKeyboardNavigation(component.shadowRoot, 'ArrowUp'); - await coordinator.done(); + await RenderCoordinator.done(); assertCurrentFocusedCellIs(component.shadowRoot, { column: 0, row: 0 }); }); it('correctly skips hidden columns', async () => { @@ -410,10 +409,10 @@ describe('DataGrid', () => { columnsWithCountryHidden[1].visible = false; const component = renderDataGrid({ rows, columns: columnsWithCountryHidden }); assert.isNotNull(component.shadowRoot); - await coordinator.done(); + await RenderCoordinator.done(); focusCurrentlyFocusableCell(component.shadowRoot); emulateUserKeyboardNavigation(component.shadowRoot, 'ArrowRight'); - await coordinator.done(); + await RenderCoordinator.done(); // It's column 2 here because column 1 is hidden assertCurrentFocusedCellIs(component.shadowRoot, { column: 2, row: 0 }); }); @@ -422,11 +421,11 @@ describe('DataGrid', () => { rowsWithLondonHidden[0].hidden = true; const component = renderDataGrid({ rows: rowsWithLondonHidden, columns }); assert.isNotNull(component.shadowRoot); - await coordinator.done(); + await RenderCoordinator.done(); focusCurrentlyFocusableCell(component.shadowRoot); assertCurrentFocusedCellIs(component.shadowRoot, { column: 0, row: 0 }); emulateUserKeyboardNavigation(component.shadowRoot, 'ArrowDown'); - await coordinator.done(); + await RenderCoordinator.done(); // It's row 2 here because row 1 is hidden assertCurrentFocusedCellIs(component.shadowRoot, { column: 0, row: 2 }); }); @@ -435,10 +434,10 @@ describe('DataGrid', () => { rowsWithMunichHidden[1].hidden = true; const component = renderDataGrid({ rows: rowsWithMunichHidden, columns: columnsWithNoneSortable }); assert.isNotNull(component.shadowRoot); - await coordinator.done(); + await RenderCoordinator.done(); focusCurrentlyFocusableCell(component.shadowRoot); emulateUserKeyboardNavigation(component.shadowRoot, 'ArrowDown'); - await coordinator.done(); + await RenderCoordinator.done(); // It's 3 here because row 2 is hidden assertCurrentFocusedCellIs(component.shadowRoot, { column: 0, row: 3 }); }); @@ -447,20 +446,20 @@ describe('DataGrid', () => { rowsWithLondonHidden[0].hidden = true; const component = renderDataGrid({ rows: rowsWithLondonHidden, columns: columnsWithNoneSortable }); assert.isNotNull(component.shadowRoot); - await coordinator.done(); + await RenderCoordinator.done(); focusCurrentlyFocusableCell(component.shadowRoot); assertCurrentFocusedCellIs(component.shadowRoot, { column: 0, row: 2 }); }); it('re-adjusts the focused cell if a re-render puts that cell out of bounds', async () => { const component = renderDataGrid({ rows: createRows(), columns: columnsWithNoneSortable }); assert.isNotNull(component.shadowRoot); - await coordinator.done(); + await RenderCoordinator.done(); focusCurrentlyFocusableCell(component.shadowRoot); - await coordinator.done(); + await RenderCoordinator.done(); emulateUserKeyboardNavigation(component.shadowRoot, 'ArrowDown'); - await coordinator.done(); + await RenderCoordinator.done(); emulateUserKeyboardNavigation(component.shadowRoot, 'ArrowDown'); - await coordinator.done(); + await RenderCoordinator.done(); assertCurrentFocusedCellIs(component.shadowRoot, { column: 0, row: 3 }); const rowsWithLastRemoved = createRows(); rowsWithLastRemoved.splice(2); @@ -469,7 +468,7 @@ describe('DataGrid', () => { rows: rowsWithLastRemoved, activeSort: null, }; - await coordinator.done(); + await RenderCoordinator.done(); assertCurrentFocusedCellIs(component.shadowRoot, { column: 0, row: 2 }); }); }); @@ -477,7 +476,7 @@ describe('DataGrid', () => { it('when the user clicks a column header', async () => { const component = renderDataGrid({ rows, columns }); assert.isNotNull(component.shadowRoot); - await coordinator.done(); + await RenderCoordinator.done(); const columnHeaderClickEvent = getEventPromise(component, 'columnheaderclick'); const cityColumn = getHeaderCellForColumnId(component.shadowRoot, 'city'); dispatchClickEvent(cityColumn); @@ -487,7 +486,7 @@ describe('DataGrid', () => { it('when the user "clicks" a column header with the enter key', async () => { const component = renderDataGrid({ rows, columns }); assert.isNotNull(component.shadowRoot); - await coordinator.done(); + await RenderCoordinator.done(); const columnHeaderClickEvent = getEventPromise(component, 'columnheaderclick'); const focusableCell = getFocusableCell(component.shadowRoot); // Check that the focusable cell is the header cell as it's a table with @@ -495,7 +494,7 @@ describe('DataGrid', () => { assert.strictEqual(focusableCell.getAttribute('data-row-index'), '0'); assert.strictEqual(focusableCell.getAttribute('data-col-index'), '0'); focusableCell.focus(); - await coordinator.done(); + await RenderCoordinator.done(); const table = component.shadowRoot.querySelector('table'); assert.instanceOf(table, HTMLTableElement); dispatchKeyDownEvent(table, { key: 'Enter' }); @@ -505,7 +504,7 @@ describe('DataGrid', () => { it('when the user focuses a cell', async () => { const component = renderDataGrid({ rows, columns: columnsWithNoneSortable }); assert.isNotNull(component.shadowRoot); - await coordinator.done(); + await RenderCoordinator.done(); const bodyCellFocusedEvent = getEventPromise(component, 'cellfocused'); const focusableCell = getFocusableCell(component.shadowRoot); focusableCell.focus(); @@ -515,7 +514,7 @@ describe('DataGrid', () => { it('when the user hovers over a row', async () => { const component = renderDataGrid({ rows, columns }); assert.isNotNull(component.shadowRoot); - await coordinator.done(); + await RenderCoordinator.done(); const rowHoveredEvent = getEventPromise(component, 'rowmouseenter'); const rowLeaveEvent = getEventPromise(component, 'rowmouseleave'); const row = getBodyRowByAriaIndex(component.shadowRoot, 1); @@ -531,7 +530,7 @@ describe('DataGrid', () => { it('only has one DOM mutation to add the new row', async () => { const component = renderDataGrid({ rows, columns }); assert.isNotNull(component.shadowRoot); - await coordinator.done(); + await RenderCoordinator.done(); await withMutations([ // We expect one to be added { target: 'tr', max: 1 }, @@ -548,7 +547,7 @@ describe('DataGrid', () => { rows: [...rows, newRow], activeSort: null, }; - await coordinator.done(); + await RenderCoordinator.done(); const newRowValues = getValuesOfBodyRowByAriaIndex(shadowRoot, 4); assert.deepEqual(newRowValues, ['Berlin', 'Germany', '3.66m']); }); @@ -558,13 +557,13 @@ describe('DataGrid', () => { it('marks the row as selected when the user clicks on a cell', async () => { const component = renderDataGrid({ rows, columns: columnsWithNoneSortable }); assert.isNotNull(component.shadowRoot); - await coordinator.done(); + await RenderCoordinator.done(); // Ensure no row is selected before the user clicks let selectedRow = component.shadowRoot.querySelector('tr.selected'); assert.isNull(selectedRow); // // Focus the very first cell await emulateUserFocusingCellAt(component.shadowRoot, { column: 0, row: 1 }); - await coordinator.done(); + await RenderCoordinator.done(); // // Ensure the row is updated to be marked as selected selectedRow = component.shadowRoot.querySelector('tbody tr.selected'); assert.instanceOf(selectedRow, HTMLTableRowElement); @@ -573,14 +572,14 @@ describe('DataGrid', () => { const rows = createRows(); const component = renderDataGrid({ rows, columns: columnsWithNoneSortable }); assert.isNotNull(component.shadowRoot); - await coordinator.done(); + await RenderCoordinator.done(); focusCurrentlyFocusableCell(component.shadowRoot); - await coordinator.done(); + await RenderCoordinator.done(); const wrapper = component.shadowRoot.querySelector('.wrapping-container'); if (wrapper) { dispatchFocusOutEvent(wrapper); } - await coordinator.done(); + await RenderCoordinator.done(); assertSelectedRowIs(component.shadowRoot, 1); rows.push({ cells: [ @@ -594,7 +593,7 @@ describe('DataGrid', () => { rows, activeSort: null, }; - await coordinator.done(); + await RenderCoordinator.done(); assertSelectedRowIs(component.shadowRoot, 1); }); }); diff --git a/public/ui/components/data_grid/DataGrid.test.js.map b/public/ui/components/data_grid/DataGrid.test.js.map index 657804136..628ea53b3 100644 --- a/public/ui/components/data_grid/DataGrid.test.js.map +++ b/public/ui/components/data_grid/DataGrid.test.js.map @@ -1 +1 @@ -{"version":3,"file":"DataGrid.test.js","sourceRoot":"","sources":["../../../../../../../front_end/ui/components/data_grid/DataGrid.test.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,KAAK,QAAQ,MAAM,oCAAoC,CAAC;AAC/D,OAAO,EACL,0BAA0B,EAC1B,mBAAmB,EACnB,yBAAyB,EACzB,6BAA6B,EAC7B,2BAA2B,EAC3B,UAAU,EACV,qBAAqB,EACrB,gBAAgB,EAChB,gBAAgB,EAChB,wBAAwB,EACxB,cAAc,EACd,sBAAsB,EACtB,6BAA6B,GAC9B,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EACL,kBAAkB,EAClB,qBAAqB,EACrB,oBAAoB,EACpB,eAAe,EACf,oBAAoB,EACpB,wBAAwB,GACzB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAC,kBAAkB,EAAC,MAAM,wCAAwC,CAAC;AAC1E,OAAO,EAAC,aAAa,EAAC,MAAM,qCAAqC,CAAC;AAClE,OAAO,KAAK,OAAO,MAAM,4BAA4B,CAAC;AACtD,OAAO,KAAK,U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SAAS,CAAC,cAAc,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;YAC3C,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,QAAQ,CAAC,oDAAoD,EAAE,GAAG,EAAE;QAClE,EAAE,CAAC,0DAA0D,EAAE,KAAK,IAAI,EAAE;YACxE,MAAM,KAAK,GAAG,QAAQ,CAAC,aAAa,CAAC,2BAA2B,CAAC,0BAA0B,CAAC,CAAC;YAC7F,MAAM,CAAC,SAAS,CAAC,KAAK,EAAE,0BAA0B,CAAC,CAAC;QACtD,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,8DAA8D,EAAE,KAAK,IAAI,EAAE;YAC5E,MAAM,KAAK,GAAG,QAAQ,CAAC,aAAa,CAAC,2BAA2B,CAAC,+CAA+C,CAAC,CAAC;YAClH,MAAM,CAAC,SAAS,CAAC,KAAK,EAAE,uBAAuB,CAAC,CAAC;QACnD,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["// Copyright 2020 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport * as Platform from '../../../core/platform/platform.js';\nimport {\n assertCurrentFocusedCellIs,\n assertSelectedRowIs,\n emulateUserFocusingCellAt,\n emulateUserKeyboardNavigation,\n focusCurrentlyFocusableCell,\n getAllRows,\n getBodyRowByAriaIndex,\n getCellByIndexes,\n getFocusableCell,\n getHeaderCellForColumnId,\n getHeaderCells,\n getValuesOfAllBodyRows,\n getValuesOfBodyRowByAriaIndex,\n} from '../../../testing/DataGridHelpers.js';\nimport {\n dispatchClickEvent,\n dispatchFocusOutEvent,\n dispatchKeyDownEvent,\n getEventPromise,\n renderElementIntoDOM,\n stripLitHtmlCommentNodes,\n} from '../../../testing/DOMHelpers.js';\nimport {describeWithLocale} from '../../../testing/EnvironmentHelpers.js';\nimport {withMutations} from '../../../testing/MutationHelpers.js';\nimport * as LitHtml from '../../lit-html/lit-html.js';\nimport * as IconButton from '../icon_button/icon_button.js';\nimport * as Coordinator from '../render_coordinator/render_coordinator.js';\n\nimport * as DataGrid from './data_grid.js';\n\nconst {html} = LitHtml;\n\nconst coordinator = Coordinator.RenderCoordinator.RenderCoordinator.instance();\n\nconst createColumns = (): DataGrid.DataGridUtils.Column[] => {\n return [\n {id: 'city', title: 'City', sortable: true, widthWeighting: 2, visible: true, hideable: false},\n {id: 'country', title: 'Country', sortable: false, widthWeighting: 2, visible: true, hideable: false},\n {id: 'population', title: 'Population', sortable: false, widthWeighting: 1, visible: true, hideable: false},\n ];\n};\n\nconst createRows = (): DataGrid.DataGridUtils.Row[] => {\n return [\n {\n cells: [\n {columnId: 'city', value: 'London'},\n {columnId: 'country', value: 'UK'},\n {columnId: 'population', value: '8.98m'},\n ],\n },\n {\n cells: [\n {columnId: 'city', value: 'Munich'},\n {columnId: 'country', value: 'Germany'},\n {columnId: 'population', value: '1.47m'},\n ],\n },\n {\n cells: [\n {columnId: 'city', value: 'Barcelona'},\n {columnId: 'country', value: 'Spain'},\n {columnId: 'population', value: '1.62m'},\n ],\n },\n ];\n};\n\nconst columns: DataGrid.DataGridUtils.Column[] = createColumns();\nconst rows: DataGrid.DataGridUtils.Row[] = createRows();\nconst columnsWithNoneSortable = createColumns().map(col => {\n col.sortable = false;\n return col;\n});\nconst label: string = 'Test Data Grid Label';\n\nObject.freeze(columns);\nObject.freeze(columnsWithNoneSortable);\nObject.freeze(rows);\n\nconst renderDataGrid = (data: Partial): DataGrid.DataGrid.DataGrid => {\n const component = new DataGrid.DataGrid.DataGrid();\n component.data = {\n rows: data.rows || [],\n columns: data.columns || [],\n activeSort: data.activeSort || null,\n label: data.label,\n };\n renderElementIntoDOM(component);\n return component;\n};\n\ndescribe('DataGrid', () => {\n describe('rendering and hiding rows/columns', () => {\n it('renders the right headers and values', async () => {\n const component = renderDataGrid({rows, columns});\n assert.isNotNull(component.shadowRoot);\n await coordinator.done();\n\n const headerCells = getHeaderCells(component.shadowRoot);\n const values = Array.from(headerCells, cell => cell.textContent || '');\n assert.deepEqual(values, ['City', 'Country', 'Population']);\n\n const rowValues = getValuesOfAllBodyRows(component.shadowRoot);\n assert.deepEqual(rowValues, [\n ['London', 'UK', '8.98m'],\n ['Munich', 'Germany', '1.47m'],\n ['Barcelona', 'Spain', '1.62m'],\n ]);\n });\n\n it('does not render DOM within a cell whose column is hidden', async () => {\n const columnsWithFirstHidden = createColumns();\n columnsWithFirstHidden[0].hideable = true;\n columnsWithFirstHidden[0].visible = false;\n const component = renderDataGrid({rows, columns: columnsWithFirstHidden});\n assert.isNotNull(component.shadowRoot);\n await coordinator.done();\n\n const renderedRows = Array.from(component.shadowRoot.querySelectorAll('tbody tr:not(.padding-row)'));\n const cellsHaveChildren = renderedRows.map(row => {\n const cells = Array.from(row.querySelectorAll('td'), cell => {\n // Figure out if the cell has any children.\n return stripLitHtmlCommentNodes(cell.innerHTML).length > 0;\n });\n return cells;\n });\n assert.deepEqual(cellsHaveChildren, [\n // False for column 1 as it is hidden, true for the rest which are\n // visible.\n [false, true, true],\n [false, true, true],\n [false, true, true],\n ]);\n });\n\n it('uses the cell\\'s value as its title attribute by default', async () => {\n const component = renderDataGrid({rows, columns});\n assert.isNotNull(component.shadowRoot);\n await coordinator.done();\n\n const renderedBodyRows = getAllRows(component.shadowRoot);\n const renderedBodyCells = renderedBodyRows.map(row => Array.from(row.querySelectorAll('td')));\n const titleAttributesForCellsByRow = renderedBodyCells.map(row => row.map(cell => cell.getAttribute('title')));\n\n assert.deepEqual(titleAttributesForCellsByRow, [\n ['London', 'UK', '8.98m'],\n ['Munich', 'Germany', '1.47m'],\n ['Barcelona', 'Spain', '1.62m'],\n ]);\n });\n\n it('takes a title override and uses that if provided', async () => {\n const rowsWithTitleSpecified = createRows();\n rowsWithTitleSpecified[0].cells[0].title = 'EXPLICITLY_PROVIDED_TITLE';\n const component = renderDataGrid({rows: rowsWithTitleSpecified, columns});\n assert.isNotNull(component.shadowRoot);\n await coordinator.done();\n\n const renderedBodyRows = getAllRows(component.shadowRoot);\n const renderedBodyCells = renderedBodyRows.map(row => Array.from(row.querySelectorAll('td')));\n const titleAttributesForCellsByRow = renderedBodyCells.map(row => row.map(cell => cell.getAttribute('title')));\n\n assert.deepEqual(titleAttributesForCellsByRow, [\n ['EXPLICITLY_PROVIDED_TITLE', 'UK', '8.98m'],\n ['Munich', 'Germany', '1.47m'],\n ['Barcelona', 'Spain', '1.62m'],\n ]);\n });\n\n it('hides columns marked as hidden', async () => {\n const columnsWithCityHidden = createColumns();\n columnsWithCityHidden[0].visible = false;\n const component = renderDataGrid({rows, columns: columnsWithCityHidden});\n assert.isNotNull(component.shadowRoot);\n await coordinator.done();\n\n const headerCells = getHeaderCells(component.shadowRoot, {onlyVisible: true});\n const values = Array.from(headerCells, cell => cell.textContent || '');\n assert.deepEqual(values, ['Country', 'Population']);\n\n const rowValues = getValuesOfAllBodyRows(component.shadowRoot, {onlyVisible: true});\n assert.deepEqual(rowValues, [\n ['UK', '8.98m'],\n ['Germany', '1.47m'],\n ['Spain', '1.62m'],\n ]);\n });\n\n it('hides rows marked as hidden', async () => {\n const rowsWithLondonHidden = createRows();\n rowsWithLondonHidden[0].hidden = true;\n const component = renderDataGrid({rows: rowsWithLondonHidden, columns});\n assert.isNotNull(component.shadowRoot);\n await coordinator.done();\n\n const rowValues = getValuesOfAllBodyRows(component.shadowRoot, {onlyVisible: true});\n assert.deepEqual(rowValues, [\n ['Munich', 'Germany', '1.47m'],\n ['Barcelona', 'Spain', '1.62m'],\n ]);\n });\n });\n\n describe('data-grid renderers', () => {\n it('uses the string renderer by default', async () => {\n const columns: DataGrid.DataGridUtils.Column[] =\n [{id: 'key', title: 'Key', widthWeighting: 1, visible: true, hideable: false}];\n const rows: DataGrid.DataGridUtils.Row[] = [{cells: [{columnId: 'key', value: 'Hello World'}]}];\n const component = renderDataGrid({columns, rows});\n assert.isNotNull(component.shadowRoot);\n await coordinator.done();\n const cell = getCellByIndexes(component.shadowRoot, {column: 0, row: 1});\n assert.deepEqual(stripLitHtmlCommentNodes(cell.innerHTML), 'Hello World');\n });\n\n it('can use the code block renderer to render text in a tag', async () => {\n const columns: DataGrid.DataGridUtils.Column[] =\n [{id: 'key', title: 'Key', widthWeighting: 1, visible: true, hideable: false}];\n const rows: DataGrid.DataGridUtils.Row[] = [{\n cells: [\n {\n columnId: 'key',\n value: 'Hello World',\n title: 'Hello World',\n renderer: DataGrid.DataGridRenderers.codeBlockRenderer,\n },\n ],\n }];\n const component = renderDataGrid({columns, rows});\n assert.isNotNull(component.shadowRoot);\n await coordinator.done();\n const cell = getCellByIndexes(component.shadowRoot, {column: 0, row: 1});\n assert.deepEqual(stripLitHtmlCommentNodes(cell.innerHTML), 'Hello World');\n });\n\n it('can use the icon renderer for rendering icons', async () => {\n const icon = new IconButton.Icon.Icon();\n icon.data = {iconName: 'arrow-down', color: 'var(--icon-request)', width: '16px', height: '16px'};\n\n const columns: DataGrid.DataGridUtils.Column[] =\n [{id: 'type', title: 'Type', widthWeighting: 1, visible: true, hideable: false}];\n const rows: DataGrid.DataGridUtils.Row[] = [{\n cells: [\n {\n columnId: 'type',\n value: icon,\n title: 'received',\n renderer: DataGrid.DataGridRenderers.iconRenderer,\n },\n ],\n }];\n const component = renderDataGrid({columns, rows});\n assert.isNotNull(component.shadowRoot);\n await coordinator.done();\n const cell = getCellByIndexes(component.shadowRoot, {column: 0, row: 1});\n assert.deepEqual(\n stripLitHtmlCommentNodes(cell.innerHTML),\n '
');\n });\n\n it('accepts any custom renderer', async () => {\n const columns: DataGrid.DataGridUtils.Column[] =\n [{id: 'key', title: 'Key', widthWeighting: 1, visible: true, hideable: false}];\n const rows: DataGrid.DataGridUtils.Row[] = [{\n cells: [{\n columnId: 'key',\n value: 'Hello World',\n title: 'Hello World',\n renderer: value => html`

foo: ${value}

`,\n }],\n }];\n const component = renderDataGrid({columns, rows});\n assert.isNotNull(component.shadowRoot);\n await coordinator.done();\n const cell = getCellByIndexes(component.shadowRoot, {column: 0, row: 1});\n assert.deepEqual(stripLitHtmlCommentNodes(cell.innerHTML), '

foo: Hello World

');\n });\n });\n\n describe('aria-labels', () => {\n it('it adds aria-label to the table if one is specified', async () => {\n const component = renderDataGrid({columns, rows, label});\n assert.isNotNull(component.shadowRoot);\n await coordinator.done();\n const table = component.shadowRoot.querySelector('table');\n assert.instanceOf(table, HTMLTableElement);\n assert.strictEqual(table.getAttribute('aria-label'), label);\n });\n\n it('it does not add an aria-label to the table if one is not specified', async () => {\n const component = renderDataGrid({columns, rows});\n assert.isNotNull(component.shadowRoot);\n await coordinator.done();\n const table = component.shadowRoot.querySelector('table');\n assert.instanceOf(table, HTMLTableElement);\n assert.strictEqual(table.getAttribute('aria-label'), null);\n });\n\n it('adds rowcount and colcount to the table', async () => {\n const component = renderDataGrid({columns, rows});\n assert.isNotNull(component.shadowRoot);\n await coordinator.done();\n const table = component.shadowRoot.querySelector('table');\n assert.instanceOf(table, HTMLTableElement);\n assert.strictEqual(table.getAttribute('aria-rowcount'), '3');\n assert.strictEqual(table.getAttribute('aria-colcount'), '3');\n });\n\n it('shows the total row and colcount regardless of any hidden rows', async () => {\n const rowsWithLondonHidden = createRows();\n rowsWithLondonHidden[0].hidden = true;\n const component = renderDataGrid({columns, rows: rowsWithLondonHidden});\n assert.isNotNull(component.shadowRoot);\n await coordinator.done();\n const table = component.shadowRoot.querySelector('table');\n assert.instanceOf(table, HTMLTableElement);\n assert.strictEqual(table.getAttribute('aria-rowcount'), '3');\n assert.strictEqual(table.getAttribute('aria-colcount'), '3');\n });\n\n it('labels a column when it is sortable and does not add a label when it is not', async () => {\n const component = renderDataGrid({columns, rows});\n assert.isNotNull(component.shadowRoot);\n await coordinator.done();\n\n const cityHeader = getHeaderCellForColumnId(component.shadowRoot, 'city');\n const countryHeader = getHeaderCellForColumnId(component.shadowRoot, 'country');\n assert.strictEqual(cityHeader.getAttribute('aria-sort'), 'none');\n assert.strictEqual(countryHeader.getAttribute('aria-sort'), null);\n });\n\n it('labels a column when it is sorted in ASC order', async () => {\n const component = renderDataGrid({\n columns,\n rows,\n activeSort: {\n columnId: 'city',\n direction: DataGrid.DataGridUtils.SortDirection.ASC,\n },\n });\n assert.isNotNull(component.shadowRoot);\n await coordinator.done();\n\n const cityHeader = getHeaderCellForColumnId(component.shadowRoot, 'city');\n assert.strictEqual(cityHeader.getAttribute('aria-sort'), 'ascending');\n });\n\n it('labels a column when it is sorted in DESC order', async () => {\n const component = renderDataGrid({\n columns,\n rows,\n activeSort: {\n columnId: 'city',\n direction: DataGrid.DataGridUtils.SortDirection.DESC,\n },\n });\n assert.isNotNull(component.shadowRoot);\n await coordinator.done();\n const cityHeader = getHeaderCellForColumnId(component.shadowRoot, 'city');\n assert.strictEqual(cityHeader.getAttribute('aria-sort'), 'descending');\n });\n });\n\n describeWithLocale('navigating with the keyboard', () => {\n it('makes the first body cell focusable by default when no columns are sortable', async () => {\n const component = renderDataGrid({rows, columns: columnsWithNoneSortable});\n assert.isNotNull(component.shadowRoot);\n await coordinator.done();\n assertCurrentFocusedCellIs(component.shadowRoot, {column: 0, row: 1});\n });\n\n it('does not let the user navigate into the columns when no colums are sortable', async () => {\n const component = renderDataGrid({rows, columns: columnsWithNoneSortable});\n assert.isNotNull(component.shadowRoot);\n await coordinator.done();\n assertCurrentFocusedCellIs(component.shadowRoot, {column: 0, row: 1});\n emulateUserKeyboardNavigation(component.shadowRoot, 'ArrowUp');\n assertCurrentFocusedCellIs(component.shadowRoot, {column: 0, row: 1});\n });\n\n it('focuses the column header by default when it is sortable', async () => {\n const component = renderDataGrid({rows, columns});\n assert.isNotNull(component.shadowRoot);\n await coordinator.done();\n assertCurrentFocusedCellIs(component.shadowRoot, {column: 0, row: 0});\n });\n\n it('lets the user press the right arrow key to navigate right', async () => {\n const component = renderDataGrid({rows, columns: columnsWithNoneSortable});\n assert.isNotNull(component.shadowRoot);\n await coordinator.done();\n focusCurrentlyFocusableCell(component.shadowRoot);\n emulateUserKeyboardNavigation(component.shadowRoot, 'ArrowRight');\n await coordinator.done();\n assertCurrentFocusedCellIs(component.shadowRoot, {column: 1, row: 1});\n });\n\n it('lets the user press the left arrow key to navigate left', async () => {\n const component = renderDataGrid({rows, columns: columnsWithNoneSortable});\n assert.isNotNull(component.shadowRoot);\n await coordinator.done();\n // Find a cell in the 2nd column to click to focus\n await emulateUserFocusingCellAt(component.shadowRoot, {column: 1, row: 1});\n emulateUserKeyboardNavigation(component.shadowRoot, 'ArrowLeft');\n await coordinator.done();\n assertCurrentFocusedCellIs(component.shadowRoot, {column: 0, row: 1});\n });\n\n it('does not let the user move left if they are at the first visible column', async () => {\n const component = renderDataGrid({rows, columns: columnsWithNoneSortable});\n assert.isNotNull(component.shadowRoot);\n await coordinator.done();\n focusCurrentlyFocusableCell(component.shadowRoot);\n assertCurrentFocusedCellIs(component.shadowRoot, {column: 0, row: 1});\n emulateUserKeyboardNavigation(component.shadowRoot, 'ArrowLeft');\n assertCurrentFocusedCellIs(component.shadowRoot, {column: 0, row: 1});\n });\n\n it('lets the user press the down arrow key to navigate down', async () => {\n const component = renderDataGrid({rows, columns: columnsWithNoneSortable});\n assert.isNotNull(component.shadowRoot);\n await coordinator.done();\n focusCurrentlyFocusableCell(component.shadowRoot);\n emulateUserKeyboardNavigation(component.shadowRoot, 'ArrowDown');\n await coordinator.done();\n assertCurrentFocusedCellIs(component.shadowRoot, {column: 0, row: 2});\n });\n\n it('keeps the user where they are if they are on the last row', async () => {\n const component = renderDataGrid({rows, columns: columnsWithNoneSortable});\n assert.isNotNull(component.shadowRoot);\n await coordinator.done();\n focusCurrentlyFocusableCell(component.shadowRoot);\n // Go down to row 2\n emulateUserKeyboardNavigation(component.shadowRoot, 'ArrowDown');\n await coordinator.done();\n // Go down to row 3 (the last row)\n emulateUserKeyboardNavigation(component.shadowRoot, 'ArrowDown');\n await coordinator.done();\n assertCurrentFocusedCellIs(component.shadowRoot, {column: 0, row: 3});\n // Try going down again\n emulateUserKeyboardNavigation(component.shadowRoot, 'ArrowDown');\n await coordinator.done();\n assertCurrentFocusedCellIs(component.shadowRoot, {column: 0, row: 3});\n });\n\n it('lets the user press the up arrow key to navigate up', async () => {\n const component = renderDataGrid({rows, columns: columnsWithNoneSortable});\n assert.isNotNull(component.shadowRoot);\n await coordinator.done();\n\n await emulateUserFocusingCellAt(component.shadowRoot, {column: 1, row: 2});\n emulateUserKeyboardNavigation(component.shadowRoot, 'ArrowUp');\n await coordinator.done();\n assertCurrentFocusedCellIs(component.shadowRoot, {column: 1, row: 1});\n });\n\n it('does not let the user move up into the column row when none are sortable', async () => {\n const component = renderDataGrid({rows, columns: columnsWithNoneSortable});\n assert.isNotNull(component.shadowRoot);\n await coordinator.done();\n focusCurrentlyFocusableCell(component.shadowRoot);\n emulateUserKeyboardNavigation(component.shadowRoot, 'ArrowUp');\n await coordinator.done();\n assertCurrentFocusedCellIs(component.shadowRoot, {column: 0, row: 1});\n });\n\n it('does let the user move up into the column row when they are sortable', async () => {\n const component = renderDataGrid({rows, columns});\n assert.isNotNull(component.shadowRoot);\n await coordinator.done();\n const table = component.shadowRoot.querySelector('table');\n assert.instanceOf(table, HTMLTableElement);\n await emulateUserFocusingCellAt(component.shadowRoot, {column: 0, row: 1});\n emulateUserKeyboardNavigation(component.shadowRoot, 'ArrowUp');\n await coordinator.done();\n assertCurrentFocusedCellIs(component.shadowRoot, {column: 0, row: 0});\n });\n\n it('correctly skips hidden columns', async () => {\n const columnsWithCountryHidden = createColumns();\n columnsWithCountryHidden[1].visible = false;\n const component = renderDataGrid({rows, columns: columnsWithCountryHidden});\n assert.isNotNull(component.shadowRoot);\n await coordinator.done();\n focusCurrentlyFocusableCell(component.shadowRoot);\n emulateUserKeyboardNavigation(component.shadowRoot, 'ArrowRight');\n await coordinator.done();\n // It's column 2 here because column 1 is hidden\n assertCurrentFocusedCellIs(component.shadowRoot, {column: 2, row: 0});\n });\n\n it('correctly skips hidden rows when navigating from the column header', async () => {\n const rowsWithLondonHidden = createRows();\n rowsWithLondonHidden[0].hidden = true;\n const component = renderDataGrid({rows: rowsWithLondonHidden, columns});\n assert.isNotNull(component.shadowRoot);\n await coordinator.done();\n focusCurrentlyFocusableCell(component.shadowRoot);\n assertCurrentFocusedCellIs(component.shadowRoot, {column: 0, row: 0});\n emulateUserKeyboardNavigation(component.shadowRoot, 'ArrowDown');\n await coordinator.done();\n // It's row 2 here because row 1 is hidden\n assertCurrentFocusedCellIs(component.shadowRoot, {column: 0, row: 2});\n });\n\n it('correctly skips hidden rows when navigating from a body row to another', async () => {\n const rowsWithMunichHidden = createRows();\n rowsWithMunichHidden[1].hidden = true;\n const component = renderDataGrid({rows: rowsWithMunichHidden, columns: columnsWithNoneSortable});\n assert.isNotNull(component.shadowRoot);\n await coordinator.done();\n focusCurrentlyFocusableCell(component.shadowRoot);\n emulateUserKeyboardNavigation(component.shadowRoot, 'ArrowDown');\n await coordinator.done();\n // It's 3 here because row 2 is hidden\n assertCurrentFocusedCellIs(component.shadowRoot, {column: 0, row: 3});\n });\n\n it('correctly marks the first visible row cell as focusable when the first row is hidden', async () => {\n const rowsWithLondonHidden = createRows();\n rowsWithLondonHidden[0].hidden = true;\n const component = renderDataGrid({rows: rowsWithLondonHidden, columns: columnsWithNoneSortable});\n assert.isNotNull(component.shadowRoot);\n await coordinator.done();\n focusCurrentlyFocusableCell(component.shadowRoot);\n assertCurrentFocusedCellIs(component.shadowRoot, {column: 0, row: 2});\n });\n\n it('re-adjusts the focused cell if a re-render puts that cell out of bounds', async () => {\n const component = renderDataGrid({rows: createRows(), columns: columnsWithNoneSortable});\n assert.isNotNull(component.shadowRoot);\n await coordinator.done();\n focusCurrentlyFocusableCell(component.shadowRoot);\n await coordinator.done();\n emulateUserKeyboardNavigation(component.shadowRoot, 'ArrowDown');\n await coordinator.done();\n emulateUserKeyboardNavigation(component.shadowRoot, 'ArrowDown');\n await coordinator.done();\n assertCurrentFocusedCellIs(component.shadowRoot, {column: 0, row: 3});\n const rowsWithLastRemoved = createRows();\n rowsWithLastRemoved.splice(2);\n component.data = {\n columns: columnsWithNoneSortable,\n rows: rowsWithLastRemoved,\n activeSort: null,\n };\n await coordinator.done();\n assertCurrentFocusedCellIs(component.shadowRoot, {column: 0, row: 2});\n });\n });\n describeWithLocale('emits an event', () => {\n it('when the user clicks a column header', async () => {\n const component = renderDataGrid({rows, columns});\n assert.isNotNull(component.shadowRoot);\n await coordinator.done();\n\n const columnHeaderClickEvent =\n getEventPromise(component, 'columnheaderclick');\n const cityColumn = getHeaderCellForColumnId(component.shadowRoot, 'city');\n dispatchClickEvent(cityColumn);\n\n const clickEvent = await columnHeaderClickEvent;\n assert.deepEqual(clickEvent.data, {column: columns[0], columnIndex: 0});\n });\n\n it('when the user \"clicks\" a column header with the enter key', async () => {\n const component = renderDataGrid({rows, columns});\n assert.isNotNull(component.shadowRoot);\n await coordinator.done();\n\n const columnHeaderClickEvent =\n getEventPromise(component, 'columnheaderclick');\n const focusableCell = getFocusableCell(component.shadowRoot);\n // Check that the focusable cell is the header cell as it's a table with\n // sortable columns.\n assert.strictEqual(focusableCell.getAttribute('data-row-index'), '0');\n assert.strictEqual(focusableCell.getAttribute('data-col-index'), '0');\n focusableCell.focus();\n await coordinator.done();\n\n const table = component.shadowRoot.querySelector('table');\n assert.instanceOf(table, HTMLTableElement);\n dispatchKeyDownEvent(table, {key: 'Enter'});\n const clickEvent = await columnHeaderClickEvent;\n assert.deepEqual(clickEvent.data, {column: columns[0], columnIndex: 0});\n });\n\n it('when the user focuses a cell', async () => {\n const component = renderDataGrid({rows, columns: columnsWithNoneSortable});\n assert.isNotNull(component.shadowRoot);\n await coordinator.done();\n\n const bodyCellFocusedEvent =\n getEventPromise(component, 'cellfocused');\n const focusableCell = getFocusableCell(component.shadowRoot);\n focusableCell.focus();\n const cellFocusedEvent = await bodyCellFocusedEvent;\n assert.deepEqual(cellFocusedEvent.data, {cell: rows[0].cells[0], row: rows[0]});\n });\n\n it('when the user hovers over a row', async () => {\n const component = renderDataGrid({rows, columns});\n assert.isNotNull(component.shadowRoot);\n await coordinator.done();\n\n const rowHoveredEvent = getEventPromise(component, 'rowmouseenter');\n const rowLeaveEvent = getEventPromise(component, 'rowmouseleave');\n\n const row = getBodyRowByAriaIndex(component.shadowRoot, 1);\n row.dispatchEvent(new MouseEvent('mouseenter'));\n\n const hoverEvent = await rowHoveredEvent;\n assert.deepEqual(hoverEvent.data, {row: rows[0]});\n\n row.dispatchEvent(new MouseEvent('mouseleave'));\n const leaveEvent = await rowLeaveEvent;\n assert.deepEqual(leaveEvent.data, {row: rows[0]});\n });\n });\n\n describe('adding new rows', () => {\n it('only has one DOM mutation to add the new row', async () => {\n const component = renderDataGrid({rows, columns});\n assert.isNotNull(component.shadowRoot);\n await coordinator.done();\n\n await withMutations(\n [\n // We expect one to be added\n {target: 'tr', max: 1},\n ],\n component.shadowRoot, async shadowRoot => {\n const newRow = {\n cells: [\n {columnId: 'city', value: 'Berlin'},\n {columnId: 'country', value: 'Germany'},\n {columnId: 'population', value: '3.66m'},\n ],\n };\n\n component.data = {\n columns,\n rows: [...rows, newRow],\n activeSort: null,\n };\n\n await coordinator.done();\n\n const newRowValues = getValuesOfBodyRowByAriaIndex(shadowRoot, 4);\n assert.deepEqual(newRowValues, ['Berlin', 'Germany', '3.66m']);\n });\n });\n });\n\n describe('marking a row as selected', () => {\n it('marks the row as selected when the user clicks on a cell', async () => {\n const component = renderDataGrid({rows, columns: columnsWithNoneSortable});\n assert.isNotNull(component.shadowRoot);\n await coordinator.done();\n // Ensure no row is selected before the user clicks\n let selectedRow = component.shadowRoot.querySelector('tr.selected');\n assert.isNull(selectedRow);\n // // Focus the very first cell\n await emulateUserFocusingCellAt(component.shadowRoot, {column: 0, row: 1});\n await coordinator.done();\n // // Ensure the row is updated to be marked as selected\n selectedRow = component.shadowRoot.querySelector('tbody tr.selected');\n assert.instanceOf(selectedRow, HTMLTableRowElement);\n });\n\n it('persists over re-renders when not focused', async () => {\n const rows = createRows();\n const component = renderDataGrid({rows, columns: columnsWithNoneSortable});\n assert.isNotNull(component.shadowRoot);\n await coordinator.done();\n\n focusCurrentlyFocusableCell(component.shadowRoot);\n await coordinator.done();\n\n const wrapper = component.shadowRoot.querySelector('.wrapping-container');\n if (wrapper) {\n dispatchFocusOutEvent(wrapper);\n }\n await coordinator.done();\n assertSelectedRowIs(component.shadowRoot, 1);\n\n rows.push({\n cells: [\n {columnId: 'city', value: 'Vienna'},\n {columnId: 'country', value: 'Austria'},\n {columnId: 'population', value: '1.92m'},\n ],\n });\n component.data = {\n columns: columnsWithNoneSortable,\n rows,\n activeSort: null,\n };\n await coordinator.done();\n assertSelectedRowIs(component.shadowRoot, 1);\n });\n });\n\n describe('DataGrid.DataGridUtils.calculateColumnWidthPercentageFromWeighting', () => {\n const makeColumnsWithWeightings = (...weights: number[]): DataGrid.DataGridUtils.Column[] => {\n return weights.map((weight, index) => {\n return {\n id: `column-${index}` as Lowercase,\n title: `Column ${index}`,\n sortable: false,\n visible: true,\n hideable: false,\n widthWeighting: weight,\n };\n });\n };\n\n it('correctly divides columns based on the weighting', async () => {\n const columns = makeColumnsWithWeightings(1, 1);\n const calculatedWidths =\n columns.map(col => DataGrid.DataGridUtils.calculateColumnWidthPercentageFromWeighting(columns, col.id));\n assert.deepEqual(calculatedWidths, [50, 50]);\n });\n\n it('correctly divides and rounds when the % are not whole numbers', async () => {\n const columns = makeColumnsWithWeightings(1, 1, 1);\n const calculatedWidths =\n columns.map(col => DataGrid.DataGridUtils.calculateColumnWidthPercentageFromWeighting(columns, col.id));\n assert.deepEqual(calculatedWidths, [33, 33, 33]);\n });\n\n it('does not include hidden columns when calculating weighting', async () => {\n const columns = makeColumnsWithWeightings(1, 1, 1);\n columns[0].visible = false;\n const calculatedWidths =\n columns.map(col => DataGrid.DataGridUtils.calculateColumnWidthPercentageFromWeighting(columns, col.id));\n assert.deepEqual(calculatedWidths, [0, 50, 50]);\n });\n\n it('errors if a column has a weighting of less than 1', async () => {\n const columns = makeColumnsWithWeightings(0.5);\n assert.throws(\n () => DataGrid.DataGridUtils.calculateColumnWidthPercentageFromWeighting(columns, columns[0].id),\n 'Error with column column-0: width weightings must be >= 1.');\n });\n });\n\n describe('#DataGrid.DataGridUtils.handleArrowKeyNavigation util', () => {\n const makeColumns = (): DataGrid.DataGridUtils.Column[] => {\n return [\n {id: 'a', title: 'A', sortable: false, visible: true, hideable: false, widthWeighting: 1},\n {id: 'b', title: 'B', sortable: false, visible: true, hideable: false, widthWeighting: 1},\n {id: 'c', title: 'C', sortable: false, visible: true, hideable: false, widthWeighting: 1},\n ];\n };\n\n const makeRows = (): DataGrid.DataGridUtils.Row[] => {\n return [\n {\n cells: [\n {columnId: 'a', value: 'a: row 1'},\n {columnId: 'b', value: 'b: row 1'},\n {columnId: 'c', value: 'c: row 1'},\n ],\n hidden: false,\n },\n {\n cells: [\n {columnId: 'a', value: 'a: row 2'},\n {columnId: 'b', value: 'b: row 2'},\n {columnId: 'c', value: 'c: row 2'},\n ],\n hidden: false,\n },\n {\n cells: [\n {columnId: 'a', value: 'a: row 3'},\n {columnId: 'b', value: 'b: row 3'},\n {columnId: 'c', value: 'c: row 3'},\n ],\n hidden: false,\n },\n ];\n };\n\n describe('navigating left', () => {\n it('does not let the user move further left than the first column', async () => {\n const newFocusedCell = DataGrid.DataGridUtils.handleArrowKeyNavigation({\n key: Platform.KeyboardUtilities.ArrowKey.LEFT,\n currentFocusedCell: [0, 1],\n columns: makeColumns(),\n rows: makeRows(),\n });\n assert.deepEqual(newFocusedCell, [0, 1]);\n });\n\n it('does not let the user move left if there are no visible columns to the left', async () => {\n const columnsWithFirstHidden = makeColumns();\n columnsWithFirstHidden[0].visible = false;\n const newFocusedCell = DataGrid.DataGridUtils.handleArrowKeyNavigation({\n key: Platform.KeyboardUtilities.ArrowKey.LEFT,\n currentFocusedCell: [1, 1],\n columns: columnsWithFirstHidden,\n rows: makeRows(),\n });\n assert.deepEqual(newFocusedCell, [1, 1]);\n });\n\n it('lets the user move left if the column to the left is visible', async () => {\n const newFocusedCell = DataGrid.DataGridUtils.handleArrowKeyNavigation({\n key: Platform.KeyboardUtilities.ArrowKey.LEFT,\n currentFocusedCell: [1, 1],\n columns: makeColumns(),\n rows: makeRows(),\n });\n assert.deepEqual(newFocusedCell, [0, 1]);\n });\n\n it('correctly skips a hidden column to get to the next left visible column', async () => {\n const withSecondColumnHidden = makeColumns();\n withSecondColumnHidden[1].visible = false;\n const newFocusedCell = DataGrid.DataGridUtils.handleArrowKeyNavigation({\n key: Platform.KeyboardUtilities.ArrowKey.LEFT,\n currentFocusedCell: [2, 1],\n columns: withSecondColumnHidden,\n rows,\n });\n assert.deepEqual(newFocusedCell, [0, 1]);\n });\n });\n\n describe('navigating right', () => {\n it('does not let the user move further right than the last column', async () => {\n const newFocusedCell = DataGrid.DataGridUtils.handleArrowKeyNavigation({\n key: Platform.KeyboardUtilities.ArrowKey.RIGHT,\n currentFocusedCell: [2, 1],\n columns: makeColumns(),\n rows: makeRows(),\n });\n assert.deepEqual(newFocusedCell, [2, 1]);\n });\n\n it('does not let the user move right if there are no visible columns to the right', async () => {\n const columnsWithLastHidden = makeColumns();\n columnsWithLastHidden[2].visible = false;\n const newFocusedCell = DataGrid.DataGridUtils.handleArrowKeyNavigation({\n key: Platform.KeyboardUtilities.ArrowKey.RIGHT,\n currentFocusedCell: [1, 1],\n columns: columnsWithLastHidden,\n rows: makeRows(),\n });\n assert.deepEqual(newFocusedCell, [1, 1]);\n });\n\n it('lets the user move right if the column to the right is visible', async () => {\n const newFocusedCell = DataGrid.DataGridUtils.handleArrowKeyNavigation({\n key: Platform.KeyboardUtilities.ArrowKey.RIGHT,\n currentFocusedCell: [1, 1],\n columns: makeColumns(),\n rows: makeRows(),\n });\n assert.deepEqual(newFocusedCell, [2, 1]);\n });\n\n it('correctly skips a hidden column to get to the next right visible column', async () => {\n const withSecondColumnHidden = makeColumns();\n withSecondColumnHidden[1].visible = false;\n const newFocusedCell = DataGrid.DataGridUtils.handleArrowKeyNavigation({\n key: Platform.KeyboardUtilities.ArrowKey.RIGHT,\n currentFocusedCell: [0, 1],\n columns: withSecondColumnHidden,\n rows,\n });\n assert.deepEqual(newFocusedCell, [2, 1]);\n });\n });\n\n describe('navigating up', () => {\n it('does not let the user go into the columns row when none are sortable', async () => {\n const newFocusedCell = DataGrid.DataGridUtils.handleArrowKeyNavigation({\n key: Platform.KeyboardUtilities.ArrowKey.UP,\n currentFocusedCell: [0, 1],\n columns: makeColumns(),\n rows: makeRows(),\n });\n assert.deepEqual(newFocusedCell, [0, 1]);\n });\n\n describe('when at least one column is sortable', () => {\n const sortableColumns = makeColumns();\n sortableColumns.forEach(col => {\n col.sortable = true;\n });\n\n it('does let the user go into the columns row', async () => {\n const newFocusedCell = DataGrid.DataGridUtils.handleArrowKeyNavigation({\n key: Platform.KeyboardUtilities.ArrowKey.UP,\n currentFocusedCell: [0, 1],\n columns: sortableColumns,\n rows: makeRows(),\n });\n assert.deepEqual(newFocusedCell, [0, 0]);\n });\n\n it('does not let the user go up if they are in the column header', async () => {\n const newFocusedCell = DataGrid.DataGridUtils.handleArrowKeyNavigation({\n key: Platform.KeyboardUtilities.ArrowKey.UP,\n currentFocusedCell: [0, 0],\n columns: sortableColumns,\n rows: makeRows(),\n });\n assert.deepEqual(newFocusedCell, [0, 0]);\n });\n\n it('correctly skips a hidden row to navigate into the columns row', async () => {\n const rowsWithFirstHidden = makeRows();\n rowsWithFirstHidden[0].hidden = true;\n const newFocusedCell = DataGrid.DataGridUtils.handleArrowKeyNavigation({\n key: Platform.KeyboardUtilities.ArrowKey.UP,\n currentFocusedCell: [0, 2],\n columns: sortableColumns,\n rows: rowsWithFirstHidden,\n });\n assert.deepEqual(newFocusedCell, [0, 0]);\n });\n });\n\n it('correctly skips a hidden row while navigating through the body rows', async () => {\n const rowsWithSecondHidden = makeRows();\n rowsWithSecondHidden[1].hidden = true;\n const newFocusedCell = DataGrid.DataGridUtils.handleArrowKeyNavigation({\n key: Platform.KeyboardUtilities.ArrowKey.UP,\n currentFocusedCell: [0, 3],\n columns: makeColumns(),\n rows: rowsWithSecondHidden,\n });\n assert.deepEqual(newFocusedCell, [0, 1]);\n });\n\n it('does not let the user move up if no columns are sortable and all rows above are hidden', async () => {\n const rowsWithFirstAndSecondHidden = makeRows();\n rowsWithFirstAndSecondHidden[0].hidden = true;\n rowsWithFirstAndSecondHidden[1].hidden = true;\n const newFocusedCell = DataGrid.DataGridUtils.handleArrowKeyNavigation({\n key: Platform.KeyboardUtilities.ArrowKey.UP,\n currentFocusedCell: [0, 3],\n columns: makeColumns(),\n rows: rowsWithFirstAndSecondHidden,\n });\n assert.deepEqual(newFocusedCell, [0, 3]);\n });\n });\n\n describe('navigating down', () => {\n describe('when at least one column is sortable', () => {\n const sortableColumns = makeColumns();\n sortableColumns.forEach(col => {\n col.sortable = true;\n });\n\n it('lets the user navigate from the columns into the body', async () => {\n const newFocusedCell = DataGrid.DataGridUtils.handleArrowKeyNavigation({\n key: Platform.KeyboardUtilities.ArrowKey.DOWN,\n currentFocusedCell: [0, 0],\n columns: sortableColumns,\n rows: makeRows(),\n });\n assert.deepEqual(newFocusedCell, [0, 1]);\n });\n\n it('correctly skips any hidden body rows to find the first visible one', async () => {\n const rowsWithFirstHidden = makeRows();\n rowsWithFirstHidden[0].hidden = true;\n const newFocusedCell = DataGrid.DataGridUtils.handleArrowKeyNavigation({\n key: Platform.KeyboardUtilities.ArrowKey.DOWN,\n currentFocusedCell: [0, 0],\n columns: sortableColumns,\n rows: rowsWithFirstHidden,\n });\n assert.deepEqual(newFocusedCell, [0, 2]);\n });\n });\n\n it('correctly skips a hidden row while navigating through the body rows', async () => {\n const rowsWithSecondHidden = makeRows();\n rowsWithSecondHidden[1].hidden = true;\n const newFocusedCell = DataGrid.DataGridUtils.handleArrowKeyNavigation({\n key: Platform.KeyboardUtilities.ArrowKey.DOWN,\n currentFocusedCell: [0, 1],\n columns: makeColumns(),\n rows: rowsWithSecondHidden,\n });\n assert.deepEqual(newFocusedCell, [0, 3]);\n });\n\n it('does not let the user move down if all rows below are hidden', async () => {\n const rowsWithFirstAndSecondHidden = makeRows();\n rowsWithFirstAndSecondHidden[1].hidden = true;\n rowsWithFirstAndSecondHidden[2].hidden = true;\n const newFocusedCell = DataGrid.DataGridUtils.handleArrowKeyNavigation({\n key: Platform.KeyboardUtilities.ArrowKey.DOWN,\n currentFocusedCell: [0, 1],\n columns: makeColumns(),\n rows: rowsWithFirstAndSecondHidden,\n });\n assert.deepEqual(newFocusedCell, [0, 1]);\n });\n\n it('leaves the user where they are if no body rows are visible', async () => {\n const rowsAllHidden = makeRows().map(row => {\n row.hidden = true;\n return row;\n });\n const sortableColumns = makeColumns().map(col => {\n col.sortable = true;\n return col;\n });\n const newFocusedCell = DataGrid.DataGridUtils.handleArrowKeyNavigation({\n key: Platform.KeyboardUtilities.ArrowKey.DOWN,\n currentFocusedCell: [0, 0],\n columns: sortableColumns,\n rows: rowsAllHidden,\n });\n assert.deepEqual(newFocusedCell, [0, 0]);\n });\n\n it('does not let the user move down if they are on the last row', async () => {\n const newFocusedCell = DataGrid.DataGridUtils.handleArrowKeyNavigation({\n key: Platform.KeyboardUtilities.ArrowKey.DOWN,\n currentFocusedCell: [0, 3],\n columns: makeColumns(),\n rows: makeRows(),\n });\n assert.deepEqual(newFocusedCell, [0, 3]);\n });\n });\n });\n\n describe('DataGrid.DataGridUtils.getCellTitleFromCellContent', () => {\n it('returns full cell content as title when content is short', async () => {\n const title = DataGrid.DataGridUtils.getCellTitleFromCellContent('some shortish cell value');\n assert.deepEqual(title, 'some shortish cell value');\n });\n\n it('returns truncated cell content as title when content is long', async () => {\n const title = DataGrid.DataGridUtils.getCellTitleFromCellContent('This cell contains text which is a bit longer');\n assert.deepEqual(title, 'This cell contains t…');\n });\n });\n});\n"]} \ No newline at end of file +{"version":3,"file":"DataGrid.test.js","sourceRoot":"","sources":["../../../../../../../front_end/ui/components/data_grid/DataGrid.test.ts"],"names":[],"mappings":"AAAA,4DAA4D;AA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AM,CAAC,SAAS,CAAC,KAAK,EAAE,uBAAuB,CAAC,CAAC;QACnD,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["// Copyright 2020 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport * as Platform from '../../../core/platform/platform.js';\nimport {\n assertCurrentFocusedCellIs,\n assertSelectedRowIs,\n emulateUserFocusingCellAt,\n emulateUserKeyboardNavigation,\n focusCurrentlyFocusableCell,\n getAllRows,\n getBodyRowByAriaIndex,\n getCellByIndexes,\n getFocusableCell,\n getHeaderCellForColumnId,\n getHeaderCells,\n getValuesOfAllBodyRows,\n getValuesOfBodyRowByAriaIndex,\n} from '../../../testing/DataGridHelpers.js';\nimport {\n dispatchClickEvent,\n dispatchFocusOutEvent,\n dispatchKeyDownEvent,\n getEventPromise,\n renderElementIntoDOM,\n stripLitHtmlCommentNodes,\n} from '../../../testing/DOMHelpers.js';\nimport {describeWithLocale} from '../../../testing/EnvironmentHelpers.js';\nimport {withMutations} from '../../../testing/MutationHelpers.js';\nimport * as LitHtml from '../../lit-html/lit-html.js';\nimport * as IconButton from '../icon_button/icon_button.js';\nimport * as RenderCoordinator from '../render_coordinator/render_coordinator.js';\n\nimport * as DataGrid from './data_grid.js';\n\nconst {html} = LitHtml;\n\nconst createColumns = (): DataGrid.DataGridUtils.Column[] => {\n return [\n {id: 'city', title: 'City', sortable: true, widthWeighting: 2, visible: true, hideable: false},\n {id: 'country', title: 'Country', sortable: false, widthWeighting: 2, visible: true, hideable: false},\n {id: 'population', title: 'Population', sortable: false, widthWeighting: 1, visible: true, hideable: false},\n ];\n};\n\nconst createRows = (): DataGrid.DataGridUtils.Row[] => {\n return [\n {\n cells: [\n {columnId: 'city', value: 'London'},\n {columnId: 'country', value: 'UK'},\n {columnId: 'population', value: '8.98m'},\n ],\n },\n {\n cells: [\n {columnId: 'city', value: 'Munich'},\n {columnId: 'country', value: 'Germany'},\n {columnId: 'population', value: '1.47m'},\n ],\n },\n {\n cells: [\n {columnId: 'city', value: 'Barcelona'},\n {columnId: 'country', value: 'Spain'},\n {columnId: 'population', value: '1.62m'},\n ],\n },\n ];\n};\n\nconst columns: DataGrid.DataGridUtils.Column[] = createColumns();\nconst rows: DataGrid.DataGridUtils.Row[] = createRows();\nconst columnsWithNoneSortable = createColumns().map(col => {\n col.sortable = false;\n return col;\n});\nconst label: string = 'Test Data Grid Label';\n\nObject.freeze(columns);\nObject.freeze(columnsWithNoneSortable);\nObject.freeze(rows);\n\nconst renderDataGrid = (data: Partial): DataGrid.DataGrid.DataGrid => {\n const component = new DataGrid.DataGrid.DataGrid();\n component.data = {\n rows: data.rows || [],\n columns: data.columns || [],\n activeSort: data.activeSort || null,\n label: data.label,\n };\n renderElementIntoDOM(component);\n return component;\n};\n\ndescribe('DataGrid', () => {\n describe('rendering and hiding rows/columns', () => {\n it('renders the right headers and values', async () => {\n const component = renderDataGrid({rows, columns});\n assert.isNotNull(component.shadowRoot);\n await RenderCoordinator.done();\n\n const headerCells = getHeaderCells(component.shadowRoot);\n const values = Array.from(headerCells, cell => cell.textContent || '');\n assert.deepEqual(values, ['City', 'Country', 'Population']);\n\n const rowValues = getValuesOfAllBodyRows(component.shadowRoot);\n assert.deepEqual(rowValues, [\n ['London', 'UK', '8.98m'],\n ['Munich', 'Germany', '1.47m'],\n ['Barcelona', 'Spain', '1.62m'],\n ]);\n });\n\n it('does not render DOM within a cell whose column is hidden', async () => {\n const columnsWithFirstHidden = createColumns();\n columnsWithFirstHidden[0].hideable = true;\n columnsWithFirstHidden[0].visible = false;\n const component = renderDataGrid({rows, columns: columnsWithFirstHidden});\n assert.isNotNull(component.shadowRoot);\n await RenderCoordinator.done();\n\n const renderedRows = Array.from(component.shadowRoot.querySelectorAll('tbody tr:not(.padding-row)'));\n const cellsHaveChildren = renderedRows.map(row => {\n const cells = Array.from(row.querySelectorAll('td'), cell => {\n // Figure out if the cell has any children.\n return stripLitHtmlCommentNodes(cell.innerHTML).length > 0;\n });\n return cells;\n });\n assert.deepEqual(cellsHaveChildren, [\n // False for column 1 as it is hidden, true for the rest which are\n // visible.\n [false, true, true],\n [false, true, true],\n [false, true, true],\n ]);\n });\n\n it('uses the cell\\'s value as its title attribute by default', async () => {\n const component = renderDataGrid({rows, columns});\n assert.isNotNull(component.shadowRoot);\n await RenderCoordinator.done();\n\n const renderedBodyRows = getAllRows(component.shadowRoot);\n const renderedBodyCells = renderedBodyRows.map(row => Array.from(row.querySelectorAll('td')));\n const titleAttributesForCellsByRow = renderedBodyCells.map(row => row.map(cell => cell.getAttribute('title')));\n\n assert.deepEqual(titleAttributesForCellsByRow, [\n ['London', 'UK', '8.98m'],\n ['Munich', 'Germany', '1.47m'],\n ['Barcelona', 'Spain', '1.62m'],\n ]);\n });\n\n it('takes a title override and uses that if provided', async () => {\n const rowsWithTitleSpecified = createRows();\n rowsWithTitleSpecified[0].cells[0].title = 'EXPLICITLY_PROVIDED_TITLE';\n const component = renderDataGrid({rows: rowsWithTitleSpecified, columns});\n assert.isNotNull(component.shadowRoot);\n await RenderCoordinator.done();\n\n const renderedBodyRows = getAllRows(component.shadowRoot);\n const renderedBodyCells = renderedBodyRows.map(row => Array.from(row.querySelectorAll('td')));\n const titleAttributesForCellsByRow = renderedBodyCells.map(row => row.map(cell => cell.getAttribute('title')));\n\n assert.deepEqual(titleAttributesForCellsByRow, [\n ['EXPLICITLY_PROVIDED_TITLE', 'UK', '8.98m'],\n ['Munich', 'Germany', '1.47m'],\n ['Barcelona', 'Spain', '1.62m'],\n ]);\n });\n\n it('hides columns marked as hidden', async () => {\n const columnsWithCityHidden = createColumns();\n columnsWithCityHidden[0].visible = false;\n const component = renderDataGrid({rows, columns: columnsWithCityHidden});\n assert.isNotNull(component.shadowRoot);\n await RenderCoordinator.done();\n\n const headerCells = getHeaderCells(component.shadowRoot, {onlyVisible: true});\n const values = Array.from(headerCells, cell => cell.textContent || '');\n assert.deepEqual(values, ['Country', 'Population']);\n\n const rowValues = getValuesOfAllBodyRows(component.shadowRoot, {onlyVisible: true});\n assert.deepEqual(rowValues, [\n ['UK', '8.98m'],\n ['Germany', '1.47m'],\n ['Spain', '1.62m'],\n ]);\n });\n\n it('hides rows marked as hidden', async () => {\n const rowsWithLondonHidden = createRows();\n rowsWithLondonHidden[0].hidden = true;\n const component = renderDataGrid({rows: rowsWithLondonHidden, columns});\n assert.isNotNull(component.shadowRoot);\n await RenderCoordinator.done();\n\n const rowValues = getValuesOfAllBodyRows(component.shadowRoot, {onlyVisible: true});\n assert.deepEqual(rowValues, [\n ['Munich', 'Germany', '1.47m'],\n ['Barcelona', 'Spain', '1.62m'],\n ]);\n });\n });\n\n describe('data-grid renderers', () => {\n it('uses the string renderer by default', async () => {\n const columns: DataGrid.DataGridUtils.Column[] =\n [{id: 'key', title: 'Key', widthWeighting: 1, visible: true, hideable: false}];\n const rows: DataGrid.DataGridUtils.Row[] = [{cells: [{columnId: 'key', value: 'Hello World'}]}];\n const component = renderDataGrid({columns, rows});\n assert.isNotNull(component.shadowRoot);\n await RenderCoordinator.done();\n const cell = getCellByIndexes(component.shadowRoot, {column: 0, row: 1});\n assert.deepEqual(stripLitHtmlCommentNodes(cell.innerHTML), 'Hello World');\n });\n\n it('can use the code block renderer to render text in a tag', async () => {\n const columns: DataGrid.DataGridUtils.Column[] =\n [{id: 'key', title: 'Key', widthWeighting: 1, visible: true, hideable: false}];\n const rows: DataGrid.DataGridUtils.Row[] = [{\n cells: [\n {\n columnId: 'key',\n value: 'Hello World',\n title: 'Hello World',\n renderer: DataGrid.DataGridRenderers.codeBlockRenderer,\n },\n ],\n }];\n const component = renderDataGrid({columns, rows});\n assert.isNotNull(component.shadowRoot);\n await RenderCoordinator.done();\n const cell = getCellByIndexes(component.shadowRoot, {column: 0, row: 1});\n assert.deepEqual(stripLitHtmlCommentNodes(cell.innerHTML), 'Hello World');\n });\n\n it('can use the icon renderer for rendering icons', async () => {\n const icon = new IconButton.Icon.Icon();\n icon.data = {iconName: 'arrow-down', color: 'var(--icon-request)', width: '16px', height: '16px'};\n\n const columns: DataGrid.DataGridUtils.Column[] =\n [{id: 'type', title: 'Type', widthWeighting: 1, visible: true, hideable: false}];\n const rows: DataGrid.DataGridUtils.Row[] = [{\n cells: [\n {\n columnId: 'type',\n value: icon,\n title: 'received',\n renderer: DataGrid.DataGridRenderers.iconRenderer,\n },\n ],\n }];\n const component = renderDataGrid({columns, rows});\n assert.isNotNull(component.shadowRoot);\n await RenderCoordinator.done();\n const cell = getCellByIndexes(component.shadowRoot, {column: 0, row: 1});\n assert.deepEqual(\n stripLitHtmlCommentNodes(cell.innerHTML),\n '
');\n });\n\n it('accepts any custom renderer', async () => {\n const columns: DataGrid.DataGridUtils.Column[] =\n [{id: 'key', title: 'Key', widthWeighting: 1, visible: true, hideable: false}];\n const rows: DataGrid.DataGridUtils.Row[] = [{\n cells: [{\n columnId: 'key',\n value: 'Hello World',\n title: 'Hello World',\n renderer: value => html`

foo: ${value}

`,\n }],\n }];\n const component = renderDataGrid({columns, rows});\n assert.isNotNull(component.shadowRoot);\n await RenderCoordinator.done();\n const cell = getCellByIndexes(component.shadowRoot, {column: 0, row: 1});\n assert.deepEqual(stripLitHtmlCommentNodes(cell.innerHTML), '

foo: Hello World

');\n });\n });\n\n describe('aria-labels', () => {\n it('it adds aria-label to the table if one is specified', async () => {\n const component = renderDataGrid({columns, rows, label});\n assert.isNotNull(component.shadowRoot);\n await RenderCoordinator.done();\n const table = component.shadowRoot.querySelector('table');\n assert.instanceOf(table, HTMLTableElement);\n assert.strictEqual(table.getAttribute('aria-label'), label);\n });\n\n it('it does not add an aria-label to the table if one is not specified', async () => {\n const component = renderDataGrid({columns, rows});\n assert.isNotNull(component.shadowRoot);\n await RenderCoordinator.done();\n const table = component.shadowRoot.querySelector('table');\n assert.instanceOf(table, HTMLTableElement);\n assert.isNull(table.getAttribute('aria-label'));\n });\n\n it('adds rowcount and colcount to the table', async () => {\n const component = renderDataGrid({columns, rows});\n assert.isNotNull(component.shadowRoot);\n await RenderCoordinator.done();\n const table = component.shadowRoot.querySelector('table');\n assert.instanceOf(table, HTMLTableElement);\n assert.strictEqual(table.getAttribute('aria-rowcount'), '3');\n assert.strictEqual(table.getAttribute('aria-colcount'), '3');\n });\n\n it('shows the total row and colcount regardless of any hidden rows', async () => {\n const rowsWithLondonHidden = createRows();\n rowsWithLondonHidden[0].hidden = true;\n const component = renderDataGrid({columns, rows: rowsWithLondonHidden});\n assert.isNotNull(component.shadowRoot);\n await RenderCoordinator.done();\n const table = component.shadowRoot.querySelector('table');\n assert.instanceOf(table, HTMLTableElement);\n assert.strictEqual(table.getAttribute('aria-rowcount'), '3');\n assert.strictEqual(table.getAttribute('aria-colcount'), '3');\n });\n\n it('labels a column when it is sortable and does not add a label when it is not', async () => {\n const component = renderDataGrid({columns, rows});\n assert.isNotNull(component.shadowRoot);\n await RenderCoordinator.done();\n\n const cityHeader = getHeaderCellForColumnId(component.shadowRoot, 'city');\n const countryHeader = getHeaderCellForColumnId(component.shadowRoot, 'country');\n assert.strictEqual(cityHeader.getAttribute('aria-sort'), 'none');\n assert.isNull(countryHeader.getAttribute('aria-sort'));\n });\n\n it('labels a column when it is sorted in ASC order', async () => {\n const component = renderDataGrid({\n columns,\n rows,\n activeSort: {\n columnId: 'city',\n direction: DataGrid.DataGridUtils.SortDirection.ASC,\n },\n });\n assert.isNotNull(component.shadowRoot);\n await RenderCoordinator.done();\n\n const cityHeader = getHeaderCellForColumnId(component.shadowRoot, 'city');\n assert.strictEqual(cityHeader.getAttribute('aria-sort'), 'ascending');\n });\n\n it('labels a column when it is sorted in DESC order', async () => {\n const component = renderDataGrid({\n columns,\n rows,\n activeSort: {\n columnId: 'city',\n direction: DataGrid.DataGridUtils.SortDirection.DESC,\n },\n });\n assert.isNotNull(component.shadowRoot);\n await RenderCoordinator.done();\n const cityHeader = getHeaderCellForColumnId(component.shadowRoot, 'city');\n assert.strictEqual(cityHeader.getAttribute('aria-sort'), 'descending');\n });\n });\n\n describeWithLocale('navigating with the keyboard', () => {\n it('makes the first body cell focusable by default when no columns are sortable', async () => {\n const component = renderDataGrid({rows, columns: columnsWithNoneSortable});\n assert.isNotNull(component.shadowRoot);\n await RenderCoordinator.done();\n assertCurrentFocusedCellIs(component.shadowRoot, {column: 0, row: 1});\n });\n\n it('does not let the user navigate into the columns when no colums are sortable', async () => {\n const component = renderDataGrid({rows, columns: columnsWithNoneSortable});\n assert.isNotNull(component.shadowRoot);\n await RenderCoordinator.done();\n assertCurrentFocusedCellIs(component.shadowRoot, {column: 0, row: 1});\n emulateUserKeyboardNavigation(component.shadowRoot, 'ArrowUp');\n assertCurrentFocusedCellIs(component.shadowRoot, {column: 0, row: 1});\n });\n\n it('focuses the column header by default when it is sortable', async () => {\n const component = renderDataGrid({rows, columns});\n assert.isNotNull(component.shadowRoot);\n await RenderCoordinator.done();\n assertCurrentFocusedCellIs(component.shadowRoot, {column: 0, row: 0});\n });\n\n it('lets the user press the right arrow key to navigate right', async () => {\n const component = renderDataGrid({rows, columns: columnsWithNoneSortable});\n assert.isNotNull(component.shadowRoot);\n await RenderCoordinator.done();\n focusCurrentlyFocusableCell(component.shadowRoot);\n emulateUserKeyboardNavigation(component.shadowRoot, 'ArrowRight');\n await RenderCoordinator.done();\n assertCurrentFocusedCellIs(component.shadowRoot, {column: 1, row: 1});\n });\n\n it('lets the user press the left arrow key to navigate left', async () => {\n const component = renderDataGrid({rows, columns: columnsWithNoneSortable});\n assert.isNotNull(component.shadowRoot);\n await RenderCoordinator.done();\n // Find a cell in the 2nd column to click to focus\n await emulateUserFocusingCellAt(component.shadowRoot, {column: 1, row: 1});\n emulateUserKeyboardNavigation(component.shadowRoot, 'ArrowLeft');\n await RenderCoordinator.done();\n assertCurrentFocusedCellIs(component.shadowRoot, {column: 0, row: 1});\n });\n\n it('does not let the user move left if they are at the first visible column', async () => {\n const component = renderDataGrid({rows, columns: columnsWithNoneSortable});\n assert.isNotNull(component.shadowRoot);\n await RenderCoordinator.done();\n focusCurrentlyFocusableCell(component.shadowRoot);\n assertCurrentFocusedCellIs(component.shadowRoot, {column: 0, row: 1});\n emulateUserKeyboardNavigation(component.shadowRoot, 'ArrowLeft');\n assertCurrentFocusedCellIs(component.shadowRoot, {column: 0, row: 1});\n });\n\n it('lets the user press the down arrow key to navigate down', async () => {\n const component = renderDataGrid({rows, columns: columnsWithNoneSortable});\n assert.isNotNull(component.shadowRoot);\n await RenderCoordinator.done();\n focusCurrentlyFocusableCell(component.shadowRoot);\n emulateUserKeyboardNavigation(component.shadowRoot, 'ArrowDown');\n await RenderCoordinator.done();\n assertCurrentFocusedCellIs(component.shadowRoot, {column: 0, row: 2});\n });\n\n it('keeps the user where they are if they are on the last row', async () => {\n const component = renderDataGrid({rows, columns: columnsWithNoneSortable});\n assert.isNotNull(component.shadowRoot);\n await RenderCoordinator.done();\n focusCurrentlyFocusableCell(component.shadowRoot);\n // Go down to row 2\n emulateUserKeyboardNavigation(component.shadowRoot, 'ArrowDown');\n await RenderCoordinator.done();\n // Go down to row 3 (the last row)\n emulateUserKeyboardNavigation(component.shadowRoot, 'ArrowDown');\n await RenderCoordinator.done();\n assertCurrentFocusedCellIs(component.shadowRoot, {column: 0, row: 3});\n // Try going down again\n emulateUserKeyboardNavigation(component.shadowRoot, 'ArrowDown');\n await RenderCoordinator.done();\n assertCurrentFocusedCellIs(component.shadowRoot, {column: 0, row: 3});\n });\n\n it('lets the user press the up arrow key to navigate up', async () => {\n const component = renderDataGrid({rows, columns: columnsWithNoneSortable});\n assert.isNotNull(component.shadowRoot);\n await RenderCoordinator.done();\n\n await emulateUserFocusingCellAt(component.shadowRoot, {column: 1, row: 2});\n emulateUserKeyboardNavigation(component.shadowRoot, 'ArrowUp');\n await RenderCoordinator.done();\n assertCurrentFocusedCellIs(component.shadowRoot, {column: 1, row: 1});\n });\n\n it('does not let the user move up into the column row when none are sortable', async () => {\n const component = renderDataGrid({rows, columns: columnsWithNoneSortable});\n assert.isNotNull(component.shadowRoot);\n await RenderCoordinator.done();\n focusCurrentlyFocusableCell(component.shadowRoot);\n emulateUserKeyboardNavigation(component.shadowRoot, 'ArrowUp');\n await RenderCoordinator.done();\n assertCurrentFocusedCellIs(component.shadowRoot, {column: 0, row: 1});\n });\n\n it('does let the user move up into the column row when they are sortable', async () => {\n const component = renderDataGrid({rows, columns});\n assert.isNotNull(component.shadowRoot);\n await RenderCoordinator.done();\n const table = component.shadowRoot.querySelector('table');\n assert.instanceOf(table, HTMLTableElement);\n await emulateUserFocusingCellAt(component.shadowRoot, {column: 0, row: 1});\n emulateUserKeyboardNavigation(component.shadowRoot, 'ArrowUp');\n await RenderCoordinator.done();\n assertCurrentFocusedCellIs(component.shadowRoot, {column: 0, row: 0});\n });\n\n it('correctly skips hidden columns', async () => {\n const columnsWithCountryHidden = createColumns();\n columnsWithCountryHidden[1].visible = false;\n const component = renderDataGrid({rows, columns: columnsWithCountryHidden});\n assert.isNotNull(component.shadowRoot);\n await RenderCoordinator.done();\n focusCurrentlyFocusableCell(component.shadowRoot);\n emulateUserKeyboardNavigation(component.shadowRoot, 'ArrowRight');\n await RenderCoordinator.done();\n // It's column 2 here because column 1 is hidden\n assertCurrentFocusedCellIs(component.shadowRoot, {column: 2, row: 0});\n });\n\n it('correctly skips hidden rows when navigating from the column header', async () => {\n const rowsWithLondonHidden = createRows();\n rowsWithLondonHidden[0].hidden = true;\n const component = renderDataGrid({rows: rowsWithLondonHidden, columns});\n assert.isNotNull(component.shadowRoot);\n await RenderCoordinator.done();\n focusCurrentlyFocusableCell(component.shadowRoot);\n assertCurrentFocusedCellIs(component.shadowRoot, {column: 0, row: 0});\n emulateUserKeyboardNavigation(component.shadowRoot, 'ArrowDown');\n await RenderCoordinator.done();\n // It's row 2 here because row 1 is hidden\n assertCurrentFocusedCellIs(component.shadowRoot, {column: 0, row: 2});\n });\n\n it('correctly skips hidden rows when navigating from a body row to another', async () => {\n const rowsWithMunichHidden = createRows();\n rowsWithMunichHidden[1].hidden = true;\n const component = renderDataGrid({rows: rowsWithMunichHidden, columns: columnsWithNoneSortable});\n assert.isNotNull(component.shadowRoot);\n await RenderCoordinator.done();\n focusCurrentlyFocusableCell(component.shadowRoot);\n emulateUserKeyboardNavigation(component.shadowRoot, 'ArrowDown');\n await RenderCoordinator.done();\n // It's 3 here because row 2 is hidden\n assertCurrentFocusedCellIs(component.shadowRoot, {column: 0, row: 3});\n });\n\n it('correctly marks the first visible row cell as focusable when the first row is hidden', async () => {\n const rowsWithLondonHidden = createRows();\n rowsWithLondonHidden[0].hidden = true;\n const component = renderDataGrid({rows: rowsWithLondonHidden, columns: columnsWithNoneSortable});\n assert.isNotNull(component.shadowRoot);\n await RenderCoordinator.done();\n focusCurrentlyFocusableCell(component.shadowRoot);\n assertCurrentFocusedCellIs(component.shadowRoot, {column: 0, row: 2});\n });\n\n it('re-adjusts the focused cell if a re-render puts that cell out of bounds', async () => {\n const component = renderDataGrid({rows: createRows(), columns: columnsWithNoneSortable});\n assert.isNotNull(component.shadowRoot);\n await RenderCoordinator.done();\n focusCurrentlyFocusableCell(component.shadowRoot);\n await RenderCoordinator.done();\n emulateUserKeyboardNavigation(component.shadowRoot, 'ArrowDown');\n await RenderCoordinator.done();\n emulateUserKeyboardNavigation(component.shadowRoot, 'ArrowDown');\n await RenderCoordinator.done();\n assertCurrentFocusedCellIs(component.shadowRoot, {column: 0, row: 3});\n const rowsWithLastRemoved = createRows();\n rowsWithLastRemoved.splice(2);\n component.data = {\n columns: columnsWithNoneSortable,\n rows: rowsWithLastRemoved,\n activeSort: null,\n };\n await RenderCoordinator.done();\n assertCurrentFocusedCellIs(component.shadowRoot, {column: 0, row: 2});\n });\n });\n describeWithLocale('emits an event', () => {\n it('when the user clicks a column header', async () => {\n const component = renderDataGrid({rows, columns});\n assert.isNotNull(component.shadowRoot);\n await RenderCoordinator.done();\n\n const columnHeaderClickEvent =\n getEventPromise(component, 'columnheaderclick');\n const cityColumn = getHeaderCellForColumnId(component.shadowRoot, 'city');\n dispatchClickEvent(cityColumn);\n\n const clickEvent = await columnHeaderClickEvent;\n assert.deepEqual(clickEvent.data, {column: columns[0], columnIndex: 0});\n });\n\n it('when the user \"clicks\" a column header with the enter key', async () => {\n const component = renderDataGrid({rows, columns});\n assert.isNotNull(component.shadowRoot);\n await RenderCoordinator.done();\n\n const columnHeaderClickEvent =\n getEventPromise(component, 'columnheaderclick');\n const focusableCell = getFocusableCell(component.shadowRoot);\n // Check that the focusable cell is the header cell as it's a table with\n // sortable columns.\n assert.strictEqual(focusableCell.getAttribute('data-row-index'), '0');\n assert.strictEqual(focusableCell.getAttribute('data-col-index'), '0');\n focusableCell.focus();\n await RenderCoordinator.done();\n\n const table = component.shadowRoot.querySelector('table');\n assert.instanceOf(table, HTMLTableElement);\n dispatchKeyDownEvent(table, {key: 'Enter'});\n const clickEvent = await columnHeaderClickEvent;\n assert.deepEqual(clickEvent.data, {column: columns[0], columnIndex: 0});\n });\n\n it('when the user focuses a cell', async () => {\n const component = renderDataGrid({rows, columns: columnsWithNoneSortable});\n assert.isNotNull(component.shadowRoot);\n await RenderCoordinator.done();\n\n const bodyCellFocusedEvent =\n getEventPromise(component, 'cellfocused');\n const focusableCell = getFocusableCell(component.shadowRoot);\n focusableCell.focus();\n const cellFocusedEvent = await bodyCellFocusedEvent;\n assert.deepEqual(cellFocusedEvent.data, {cell: rows[0].cells[0], row: rows[0]});\n });\n\n it('when the user hovers over a row', async () => {\n const component = renderDataGrid({rows, columns});\n assert.isNotNull(component.shadowRoot);\n await RenderCoordinator.done();\n\n const rowHoveredEvent = getEventPromise(component, 'rowmouseenter');\n const rowLeaveEvent = getEventPromise(component, 'rowmouseleave');\n\n const row = getBodyRowByAriaIndex(component.shadowRoot, 1);\n row.dispatchEvent(new MouseEvent('mouseenter'));\n\n const hoverEvent = await rowHoveredEvent;\n assert.deepEqual(hoverEvent.data, {row: rows[0]});\n\n row.dispatchEvent(new MouseEvent('mouseleave'));\n const leaveEvent = await rowLeaveEvent;\n assert.deepEqual(leaveEvent.data, {row: rows[0]});\n });\n });\n\n describe('adding new rows', () => {\n it('only has one DOM mutation to add the new row', async () => {\n const component = renderDataGrid({rows, columns});\n assert.isNotNull(component.shadowRoot);\n await RenderCoordinator.done();\n\n await withMutations(\n [\n // We expect one to be added\n {target: 'tr', max: 1},\n ],\n component.shadowRoot, async shadowRoot => {\n const newRow = {\n cells: [\n {columnId: 'city', value: 'Berlin'},\n {columnId: 'country', value: 'Germany'},\n {columnId: 'population', value: '3.66m'},\n ],\n };\n\n component.data = {\n columns,\n rows: [...rows, newRow],\n activeSort: null,\n };\n\n await RenderCoordinator.done();\n\n const newRowValues = getValuesOfBodyRowByAriaIndex(shadowRoot, 4);\n assert.deepEqual(newRowValues, ['Berlin', 'Germany', '3.66m']);\n });\n });\n });\n\n describe('marking a row as selected', () => {\n it('marks the row as selected when the user clicks on a cell', async () => {\n const component = renderDataGrid({rows, columns: columnsWithNoneSortable});\n assert.isNotNull(component.shadowRoot);\n await RenderCoordinator.done();\n // Ensure no row is selected before the user clicks\n let selectedRow = component.shadowRoot.querySelector('tr.selected');\n assert.isNull(selectedRow);\n // // Focus the very first cell\n await emulateUserFocusingCellAt(component.shadowRoot, {column: 0, row: 1});\n await RenderCoordinator.done();\n // // Ensure the row is updated to be marked as selected\n selectedRow = component.shadowRoot.querySelector('tbody tr.selected');\n assert.instanceOf(selectedRow, HTMLTableRowElement);\n });\n\n it('persists over re-renders when not focused', async () => {\n const rows = createRows();\n const component = renderDataGrid({rows, columns: columnsWithNoneSortable});\n assert.isNotNull(component.shadowRoot);\n await RenderCoordinator.done();\n\n focusCurrentlyFocusableCell(component.shadowRoot);\n await RenderCoordinator.done();\n\n const wrapper = component.shadowRoot.querySelector('.wrapping-container');\n if (wrapper) {\n dispatchFocusOutEvent(wrapper);\n }\n await RenderCoordinator.done();\n assertSelectedRowIs(component.shadowRoot, 1);\n\n rows.push({\n cells: [\n {columnId: 'city', value: 'Vienna'},\n {columnId: 'country', value: 'Austria'},\n {columnId: 'population', value: '1.92m'},\n ],\n });\n component.data = {\n columns: columnsWithNoneSortable,\n rows,\n activeSort: null,\n };\n await RenderCoordinator.done();\n assertSelectedRowIs(component.shadowRoot, 1);\n });\n });\n\n describe('DataGrid.DataGridUtils.calculateColumnWidthPercentageFromWeighting', () => {\n const makeColumnsWithWeightings = (...weights: number[]): DataGrid.DataGridUtils.Column[] => {\n return weights.map((weight, index) => {\n return {\n id: `column-${index}` as Lowercase,\n title: `Column ${index}`,\n sortable: false,\n visible: true,\n hideable: false,\n widthWeighting: weight,\n };\n });\n };\n\n it('correctly divides columns based on the weighting', async () => {\n const columns = makeColumnsWithWeightings(1, 1);\n const calculatedWidths =\n columns.map(col => DataGrid.DataGridUtils.calculateColumnWidthPercentageFromWeighting(columns, col.id));\n assert.deepEqual(calculatedWidths, [50, 50]);\n });\n\n it('correctly divides and rounds when the % are not whole numbers', async () => {\n const columns = makeColumnsWithWeightings(1, 1, 1);\n const calculatedWidths =\n columns.map(col => DataGrid.DataGridUtils.calculateColumnWidthPercentageFromWeighting(columns, col.id));\n assert.deepEqual(calculatedWidths, [33, 33, 33]);\n });\n\n it('does not include hidden columns when calculating weighting', async () => {\n const columns = makeColumnsWithWeightings(1, 1, 1);\n columns[0].visible = false;\n const calculatedWidths =\n columns.map(col => DataGrid.DataGridUtils.calculateColumnWidthPercentageFromWeighting(columns, col.id));\n assert.deepEqual(calculatedWidths, [0, 50, 50]);\n });\n\n it('errors if a column has a weighting of less than 1', async () => {\n const columns = makeColumnsWithWeightings(0.5);\n assert.throws(\n () => DataGrid.DataGridUtils.calculateColumnWidthPercentageFromWeighting(columns, columns[0].id),\n 'Error with column column-0: width weightings must be >= 1.');\n });\n });\n\n describe('#DataGrid.DataGridUtils.handleArrowKeyNavigation util', () => {\n const makeColumns = (): DataGrid.DataGridUtils.Column[] => {\n return [\n {id: 'a', title: 'A', sortable: false, visible: true, hideable: false, widthWeighting: 1},\n {id: 'b', title: 'B', sortable: false, visible: true, hideable: false, widthWeighting: 1},\n {id: 'c', title: 'C', sortable: false, visible: true, hideable: false, widthWeighting: 1},\n ];\n };\n\n const makeRows = (): DataGrid.DataGridUtils.Row[] => {\n return [\n {\n cells: [\n {columnId: 'a', value: 'a: row 1'},\n {columnId: 'b', value: 'b: row 1'},\n {columnId: 'c', value: 'c: row 1'},\n ],\n hidden: false,\n },\n {\n cells: [\n {columnId: 'a', value: 'a: row 2'},\n {columnId: 'b', value: 'b: row 2'},\n {columnId: 'c', value: 'c: row 2'},\n ],\n hidden: false,\n },\n {\n cells: [\n {columnId: 'a', value: 'a: row 3'},\n {columnId: 'b', value: 'b: row 3'},\n {columnId: 'c', value: 'c: row 3'},\n ],\n hidden: false,\n },\n ];\n };\n\n describe('navigating left', () => {\n it('does not let the user move further left than the first column', async () => {\n const newFocusedCell = DataGrid.DataGridUtils.handleArrowKeyNavigation({\n key: Platform.KeyboardUtilities.ArrowKey.LEFT,\n currentFocusedCell: [0, 1],\n columns: makeColumns(),\n rows: makeRows(),\n });\n assert.deepEqual(newFocusedCell, [0, 1]);\n });\n\n it('does not let the user move left if there are no visible columns to the left', async () => {\n const columnsWithFirstHidden = makeColumns();\n columnsWithFirstHidden[0].visible = false;\n const newFocusedCell = DataGrid.DataGridUtils.handleArrowKeyNavigation({\n key: Platform.KeyboardUtilities.ArrowKey.LEFT,\n currentFocusedCell: [1, 1],\n columns: columnsWithFirstHidden,\n rows: makeRows(),\n });\n assert.deepEqual(newFocusedCell, [1, 1]);\n });\n\n it('lets the user move left if the column to the left is visible', async () => {\n const newFocusedCell = DataGrid.DataGridUtils.handleArrowKeyNavigation({\n key: Platform.KeyboardUtilities.ArrowKey.LEFT,\n currentFocusedCell: [1, 1],\n columns: makeColumns(),\n rows: makeRows(),\n });\n assert.deepEqual(newFocusedCell, [0, 1]);\n });\n\n it('correctly skips a hidden column to get to the next left visible column', async () => {\n const withSecondColumnHidden = makeColumns();\n withSecondColumnHidden[1].visible = false;\n const newFocusedCell = DataGrid.DataGridUtils.handleArrowKeyNavigation({\n key: Platform.KeyboardUtilities.ArrowKey.LEFT,\n currentFocusedCell: [2, 1],\n columns: withSecondColumnHidden,\n rows,\n });\n assert.deepEqual(newFocusedCell, [0, 1]);\n });\n });\n\n describe('navigating right', () => {\n it('does not let the user move further right than the last column', async () => {\n const newFocusedCell = DataGrid.DataGridUtils.handleArrowKeyNavigation({\n key: Platform.KeyboardUtilities.ArrowKey.RIGHT,\n currentFocusedCell: [2, 1],\n columns: makeColumns(),\n rows: makeRows(),\n });\n assert.deepEqual(newFocusedCell, [2, 1]);\n });\n\n it('does not let the user move right if there are no visible columns to the right', async () => {\n const columnsWithLastHidden = makeColumns();\n columnsWithLastHidden[2].visible = false;\n const newFocusedCell = DataGrid.DataGridUtils.handleArrowKeyNavigation({\n key: Platform.KeyboardUtilities.ArrowKey.RIGHT,\n currentFocusedCell: [1, 1],\n columns: columnsWithLastHidden,\n rows: makeRows(),\n });\n assert.deepEqual(newFocusedCell, [1, 1]);\n });\n\n it('lets the user move right if the column to the right is visible', async () => {\n const newFocusedCell = DataGrid.DataGridUtils.handleArrowKeyNavigation({\n key: Platform.KeyboardUtilities.ArrowKey.RIGHT,\n currentFocusedCell: [1, 1],\n columns: makeColumns(),\n rows: makeRows(),\n });\n assert.deepEqual(newFocusedCell, [2, 1]);\n });\n\n it('correctly skips a hidden column to get to the next right visible column', async () => {\n const withSecondColumnHidden = makeColumns();\n withSecondColumnHidden[1].visible = false;\n const newFocusedCell = DataGrid.DataGridUtils.handleArrowKeyNavigation({\n key: Platform.KeyboardUtilities.ArrowKey.RIGHT,\n currentFocusedCell: [0, 1],\n columns: withSecondColumnHidden,\n rows,\n });\n assert.deepEqual(newFocusedCell, [2, 1]);\n });\n });\n\n describe('navigating up', () => {\n it('does not let the user go into the columns row when none are sortable', async () => {\n const newFocusedCell = DataGrid.DataGridUtils.handleArrowKeyNavigation({\n key: Platform.KeyboardUtilities.ArrowKey.UP,\n currentFocusedCell: [0, 1],\n columns: makeColumns(),\n rows: makeRows(),\n });\n assert.deepEqual(newFocusedCell, [0, 1]);\n });\n\n describe('when at least one column is sortable', () => {\n const sortableColumns = makeColumns();\n sortableColumns.forEach(col => {\n col.sortable = true;\n });\n\n it('does let the user go into the columns row', async () => {\n const newFocusedCell = DataGrid.DataGridUtils.handleArrowKeyNavigation({\n key: Platform.KeyboardUtilities.ArrowKey.UP,\n currentFocusedCell: [0, 1],\n columns: sortableColumns,\n rows: makeRows(),\n });\n assert.deepEqual(newFocusedCell, [0, 0]);\n });\n\n it('does not let the user go up if they are in the column header', async () => {\n const newFocusedCell = DataGrid.DataGridUtils.handleArrowKeyNavigation({\n key: Platform.KeyboardUtilities.ArrowKey.UP,\n currentFocusedCell: [0, 0],\n columns: sortableColumns,\n rows: makeRows(),\n });\n assert.deepEqual(newFocusedCell, [0, 0]);\n });\n\n it('correctly skips a hidden row to navigate into the columns row', async () => {\n const rowsWithFirstHidden = makeRows();\n rowsWithFirstHidden[0].hidden = true;\n const newFocusedCell = DataGrid.DataGridUtils.handleArrowKeyNavigation({\n key: Platform.KeyboardUtilities.ArrowKey.UP,\n currentFocusedCell: [0, 2],\n columns: sortableColumns,\n rows: rowsWithFirstHidden,\n });\n assert.deepEqual(newFocusedCell, [0, 0]);\n });\n });\n\n it('correctly skips a hidden row while navigating through the body rows', async () => {\n const rowsWithSecondHidden = makeRows();\n rowsWithSecondHidden[1].hidden = true;\n const newFocusedCell = DataGrid.DataGridUtils.handleArrowKeyNavigation({\n key: Platform.KeyboardUtilities.ArrowKey.UP,\n currentFocusedCell: [0, 3],\n columns: makeColumns(),\n rows: rowsWithSecondHidden,\n });\n assert.deepEqual(newFocusedCell, [0, 1]);\n });\n\n it('does not let the user move up if no columns are sortable and all rows above are hidden', async () => {\n const rowsWithFirstAndSecondHidden = makeRows();\n rowsWithFirstAndSecondHidden[0].hidden = true;\n rowsWithFirstAndSecondHidden[1].hidden = true;\n const newFocusedCell = DataGrid.DataGridUtils.handleArrowKeyNavigation({\n key: Platform.KeyboardUtilities.ArrowKey.UP,\n currentFocusedCell: [0, 3],\n columns: makeColumns(),\n rows: rowsWithFirstAndSecondHidden,\n });\n assert.deepEqual(newFocusedCell, [0, 3]);\n });\n });\n\n describe('navigating down', () => {\n describe('when at least one column is sortable', () => {\n const sortableColumns = makeColumns();\n sortableColumns.forEach(col => {\n col.sortable = true;\n });\n\n it('lets the user navigate from the columns into the body', async () => {\n const newFocusedCell = DataGrid.DataGridUtils.handleArrowKeyNavigation({\n key: Platform.KeyboardUtilities.ArrowKey.DOWN,\n currentFocusedCell: [0, 0],\n columns: sortableColumns,\n rows: makeRows(),\n });\n assert.deepEqual(newFocusedCell, [0, 1]);\n });\n\n it('correctly skips any hidden body rows to find the first visible one', async () => {\n const rowsWithFirstHidden = makeRows();\n rowsWithFirstHidden[0].hidden = true;\n const newFocusedCell = DataGrid.DataGridUtils.handleArrowKeyNavigation({\n key: Platform.KeyboardUtilities.ArrowKey.DOWN,\n currentFocusedCell: [0, 0],\n columns: sortableColumns,\n rows: rowsWithFirstHidden,\n });\n assert.deepEqual(newFocusedCell, [0, 2]);\n });\n });\n\n it('correctly skips a hidden row while navigating through the body rows', async () => {\n const rowsWithSecondHidden = makeRows();\n rowsWithSecondHidden[1].hidden = true;\n const newFocusedCell = DataGrid.DataGridUtils.handleArrowKeyNavigation({\n key: Platform.KeyboardUtilities.ArrowKey.DOWN,\n currentFocusedCell: [0, 1],\n columns: makeColumns(),\n rows: rowsWithSecondHidden,\n });\n assert.deepEqual(newFocusedCell, [0, 3]);\n });\n\n it('does not let the user move down if all rows below are hidden', async () => {\n const rowsWithFirstAndSecondHidden = makeRows();\n rowsWithFirstAndSecondHidden[1].hidden = true;\n rowsWithFirstAndSecondHidden[2].hidden = true;\n const newFocusedCell = DataGrid.DataGridUtils.handleArrowKeyNavigation({\n key: Platform.KeyboardUtilities.ArrowKey.DOWN,\n currentFocusedCell: [0, 1],\n columns: makeColumns(),\n rows: rowsWithFirstAndSecondHidden,\n });\n assert.deepEqual(newFocusedCell, [0, 1]);\n });\n\n it('leaves the user where they are if no body rows are visible', async () => {\n const rowsAllHidden = makeRows().map(row => {\n row.hidden = true;\n return row;\n });\n const sortableColumns = makeColumns().map(col => {\n col.sortable = true;\n return col;\n });\n const newFocusedCell = DataGrid.DataGridUtils.handleArrowKeyNavigation({\n key: Platform.KeyboardUtilities.ArrowKey.DOWN,\n currentFocusedCell: [0, 0],\n columns: sortableColumns,\n rows: rowsAllHidden,\n });\n assert.deepEqual(newFocusedCell, [0, 0]);\n });\n\n it('does not let the user move down if they are on the last row', async () => {\n const newFocusedCell = DataGrid.DataGridUtils.handleArrowKeyNavigation({\n key: Platform.KeyboardUtilities.ArrowKey.DOWN,\n currentFocusedCell: [0, 3],\n columns: makeColumns(),\n rows: makeRows(),\n });\n assert.deepEqual(newFocusedCell, [0, 3]);\n });\n });\n });\n\n describe('DataGrid.DataGridUtils.getCellTitleFromCellContent', () => {\n it('returns full cell content as title when content is short', async () => {\n const title = DataGrid.DataGridUtils.getCellTitleFromCellContent('some shortish cell value');\n assert.deepEqual(title, 'some shortish cell value');\n });\n\n it('returns truncated cell content as title when content is long', async () => {\n const title = DataGrid.DataGridUtils.getCellTitleFromCellContent('This cell contains text which is a bit longer');\n assert.deepEqual(title, 'This cell contains t…');\n });\n });\n});\n"]} \ No newline at end of file diff --git a/public/ui/components/data_grid/DataGridController.test.js b/public/ui/components/data_grid/DataGridController.test.js index 6fa9de992..046d48edd 100644 --- a/public/ui/components/data_grid/DataGridController.test.js +++ b/public/ui/components/data_grid/DataGridController.test.js @@ -5,9 +5,8 @@ import { getAllRows, getHeaderCellForColumnId, getValuesForColumn, getValuesOfAl import { dispatchClickEvent, renderElementIntoDOM, } from '../../../testing/DOMHelpers.js'; import { describeWithLocale } from '../../../testing/EnvironmentHelpers.js'; import { TEXT_NODE, withMutations } from '../../../testing/MutationHelpers.js'; -import * as Coordinator from '../render_coordinator/render_coordinator.js'; +import * as RenderCoordinator from '../render_coordinator/render_coordinator.js'; import * as DataGrid from './data_grid.js'; -const coordinator = Coordinator.RenderCoordinator.RenderCoordinator.instance(); const getInternalDataGridShadowRoot = (component) => { const { shadowRoot } = component.shadowRoot.querySelector('devtools-data-grid'); assert.isNotNull(shadowRoot); @@ -33,7 +32,7 @@ describe('DataGridController', () => { component.data = { rows, columns }; renderElementIntoDOM(component); assert.isNotNull(component.shadowRoot); - await coordinator.done(); + await RenderCoordinator.done(); const internalDataGridShadow = getInternalDataGridShadowRoot(component); await withMutations([{ // Two text mutations as LitHtml updates the text nodes but does not @@ -43,7 +42,7 @@ describe('DataGridController', () => { }], internalDataGridShadow, async (shadowRoot) => { const keyHeader = getHeaderCellForColumnId(shadowRoot, 'key'); dispatchClickEvent(keyHeader); - await coordinator.done(); + await RenderCoordinator.done(); const cellValues = getValuesForColumn(shadowRoot, 'key'); assert.deepEqual(cellValues, ['Alpha', 'Bravo', 'Charlie']); }); @@ -53,15 +52,15 @@ describe('DataGridController', () => { component.data = { rows: numericRows, columns }; renderElementIntoDOM(component); assert.isNotNull(component.shadowRoot); - await coordinator.done(); + await RenderCoordinator.done(); const internalDataGridShadow = getInternalDataGridShadowRoot(component); const keyHeader = getHeaderCellForColumnId(internalDataGridShadow, 'key'); dispatchClickEvent(keyHeader); // ASC order - await coordinator.done(); + await RenderCoordinator.done(); let cellValues = getValuesForColumn(internalDataGridShadow, 'key'); assert.deepEqual(cellValues, ['1', '2', '3']); dispatchClickEvent(keyHeader); // DESC order - await coordinator.done(); + await RenderCoordinator.done(); cellValues = getValuesForColumn(internalDataGridShadow, 'key'); assert.deepEqual(cellValues, ['3', '2', '1']); }); @@ -77,7 +76,7 @@ describe('DataGridController', () => { }; renderElementIntoDOM(component); assert.isNotNull(component.shadowRoot); - await coordinator.done(); + await RenderCoordinator.done(); const internalDataGridShadow = getInternalDataGridShadowRoot(component); const cellValues = getValuesForColumn(internalDataGridShadow, 'key'); assert.deepEqual(cellValues, ['Alpha', 'Bravo', 'Charlie']); @@ -94,13 +93,13 @@ describe('DataGridController', () => { }; renderElementIntoDOM(component); assert.isNotNull(component.shadowRoot); - await coordinator.done(); + await RenderCoordinator.done(); const internalDataGridShadow = getInternalDataGridShadowRoot(component); const keyHeader = getHeaderCellForColumnId(internalDataGridShadow, 'key'); let cellValues = getValuesForColumn(internalDataGridShadow, 'key'); assert.deepEqual(cellValues, ['Alpha', 'Bravo', 'Charlie']); dispatchClickEvent(keyHeader); // DESC order - await coordinator.done(); + await RenderCoordinator.done(); cellValues = getValuesForColumn(internalDataGridShadow, 'key'); assert.deepEqual(cellValues, ['Charlie', 'Bravo', 'Alpha']); }); @@ -109,15 +108,15 @@ describe('DataGridController', () => { component.data = { rows, columns }; renderElementIntoDOM(component); assert.isNotNull(component.shadowRoot); - await coordinator.done(); + await RenderCoordinator.done(); const internalDataGridShadow = getInternalDataGridShadowRoot(component); const keyHeader = getHeaderCellForColumnId(internalDataGridShadow, 'key'); dispatchClickEvent(keyHeader); // ASC order - await coordinator.done(); + await RenderCoordinator.done(); let cellValues = getValuesForColumn(internalDataGridShadow, 'key'); assert.deepEqual(cellValues, ['Alpha', 'Bravo', 'Charlie']); dispatchClickEvent(keyHeader); // DESC order - await coordinator.done(); + await RenderCoordinator.done(); cellValues = getValuesForColumn(internalDataGridShadow, 'key'); assert.deepEqual(cellValues, ['Charlie', 'Bravo', 'Alpha']); }); @@ -126,20 +125,20 @@ describe('DataGridController', () => { component.data = { rows, columns }; renderElementIntoDOM(component); assert.isNotNull(component.shadowRoot); - await coordinator.done(); + await RenderCoordinator.done(); const internalDataGridShadow = getInternalDataGridShadowRoot(component); const keyHeader = getHeaderCellForColumnId(internalDataGridShadow, 'key'); const originalCellValues = getValuesForColumn(internalDataGridShadow, 'key'); dispatchClickEvent(keyHeader); // ASC order - await coordinator.done(); + await RenderCoordinator.done(); let cellValues = getValuesForColumn(internalDataGridShadow, 'key'); assert.deepEqual(cellValues, ['Alpha', 'Bravo', 'Charlie']); dispatchClickEvent(keyHeader); // DESC order - await coordinator.done(); + await RenderCoordinator.done(); cellValues = getValuesForColumn(internalDataGridShadow, 'key'); assert.deepEqual(cellValues, ['Charlie', 'Bravo', 'Alpha']); dispatchClickEvent(keyHeader); // Now reset! - await coordinator.done(); + await RenderCoordinator.done(); const finalCellValues = getValuesForColumn(internalDataGridShadow, 'key'); assert.deepEqual(finalCellValues, originalCellValues); }); @@ -148,11 +147,11 @@ describe('DataGridController', () => { component.data = { rows, columns }; renderElementIntoDOM(component); assert.isNotNull(component.shadowRoot); - await coordinator.done(); + await RenderCoordinator.done(); const internalDataGridShadow = getInternalDataGridShadowRoot(component); const keyHeader = getHeaderCellForColumnId(internalDataGridShadow, 'key'); dispatchClickEvent(keyHeader); // ASC order - await coordinator.done(); + await RenderCoordinator.done(); let cellValues = getValuesForColumn(internalDataGridShadow, 'key'); // Ensure we are in ASC order assert.deepEqual(cellValues, ['Alpha', 'Bravo', 'Charlie']); @@ -162,7 +161,7 @@ describe('DataGridController', () => { ...component.data, rows: newRows, }; - await coordinator.done(); + await RenderCoordinator.done(); cellValues = getValuesForColumn(internalDataGridShadow, 'key'); assert.deepEqual(cellValues, ['Alpha', 'Baz', 'Bravo', 'Charlie']); }); @@ -215,7 +214,7 @@ describe('DataGridController', () => { component.data = { rows, columns, filters: [createPlainTextFilter('bravo')] }; renderElementIntoDOM(component); assert.isNotNull(component.shadowRoot); - await coordinator.done(); + await RenderCoordinator.done(); const internalDataGridShadow = getInternalDataGridShadowRoot(component); const renderedRowValues = getValuesOfAllBodyRows(internalDataGridShadow, { onlyVisible: true }); assert.deepEqual(renderedRowValues, [ @@ -227,7 +226,7 @@ describe('DataGridController', () => { component.data = { rows, columns, filters: [createPlainTextFilter('e')] }; renderElementIntoDOM(component); assert.isNotNull(component.shadowRoot); - await coordinator.done(); + await RenderCoordinator.done(); const internalDataGridShadow = getInternalDataGridShadowRoot(component); let renderedRowValues = getValuesOfAllBodyRows(internalDataGridShadow, { onlyVisible: true }); assert.deepEqual(renderedRowValues, [ @@ -241,7 +240,7 @@ describe('DataGridController', () => { ...component.data, columns: columnsWithInvisible, }; - await coordinator.done(); + await RenderCoordinator.done(); renderedRowValues = getValuesOfAllBodyRows(internalDataGridShadow, { onlyVisible: true }); assert.deepEqual(renderedRowValues, [['Charlie']]); }); @@ -250,7 +249,7 @@ describe('DataGridController', () => { component.data = { rows, columns, filters: [createPlainTextFilter('bravo')] }; renderElementIntoDOM(component); assert.isNotNull(component.shadowRoot); - await coordinator.done(); + await RenderCoordinator.done(); const internalDataGridShadow = getInternalDataGridShadowRoot(component); const renderedRows = getAllRows(internalDataGridShadow); assert.deepEqual(renderedRows.map(row => row.getAttribute('aria-rowindex')), ['2']); @@ -260,7 +259,7 @@ describe('DataGridController', () => { component.data = { rows, columns, filters: [createPlainTextFilter('bravo')] }; renderElementIntoDOM(component); assert.isNotNull(component.shadowRoot); - await coordinator.done(); + await RenderCoordinator.done(); const internalDataGridShadow = getInternalDataGridShadowRoot(component); let renderedRowValues = getValuesOfAllBodyRows(internalDataGridShadow, { onlyVisible: true }); assert.lengthOf(renderedRowValues, 1); @@ -268,7 +267,7 @@ describe('DataGridController', () => { ...component.data, filters: [], }; - await coordinator.done(); + await RenderCoordinator.done(); renderedRowValues = getValuesOfAllBodyRows(internalDataGridShadow); assert.lengthOf(renderedRowValues, 3); }); @@ -277,7 +276,7 @@ describe('DataGridController', () => { component.data = { rows, columns, filters: [createRegexFilter('bravo')] }; renderElementIntoDOM(component); assert.isNotNull(component.shadowRoot); - await coordinator.done(); + await RenderCoordinator.done(); const internalDataGridShadow = getInternalDataGridShadowRoot(component); const renderedRowValues = getValuesOfAllBodyRows(internalDataGridShadow, { onlyVisible: true }); assert.deepEqual(renderedRowValues, [ @@ -291,7 +290,7 @@ describe('DataGridController', () => { component.data = { rows, columns, filters: [filter] }; renderElementIntoDOM(component); assert.isNotNull(component.shadowRoot); - await coordinator.done(); + await RenderCoordinator.done(); const internalDataGridShadow = getInternalDataGridShadowRoot(component); const renderedRowValues = getValuesOfAllBodyRows(internalDataGridShadow, { onlyVisible: true }); assert.deepEqual(renderedRowValues, [ @@ -305,7 +304,7 @@ describe('DataGridController', () => { component.data = { rows, columns, filters: [createPlainTextFilter('alpha'), createPlainTextFilter('charlie')] }; renderElementIntoDOM(component); assert.isNotNull(component.shadowRoot); - await coordinator.done(); + await RenderCoordinator.done(); const internalDataGridShadow = getInternalDataGridShadowRoot(component); const renderedRowValues = getValuesOfAllBodyRows(internalDataGridShadow, { onlyVisible: true }); assert.deepEqual(renderedRowValues, []); @@ -316,7 +315,7 @@ describe('DataGridController', () => { component.data = { rows, columns, filters: [createColumnFilter('value', 'e')] }; renderElementIntoDOM(component); assert.isNotNull(component.shadowRoot); - await coordinator.done(); + await RenderCoordinator.done(); const internalDataGridShadow = getInternalDataGridShadowRoot(component); const renderedRowValues = getValuesOfAllBodyRows(internalDataGridShadow, { onlyVisible: true }); assert.deepEqual(renderedRowValues, [ @@ -330,7 +329,7 @@ describe('DataGridController', () => { component.data = { rows, columns, filters: [filter] }; renderElementIntoDOM(component); assert.isNotNull(component.shadowRoot); - await coordinator.done(); + await RenderCoordinator.done(); const internalDataGridShadow = getInternalDataGridShadowRoot(component); const renderedRowValues = getValuesOfAllBodyRows(internalDataGridShadow, { onlyVisible: true }); assert.deepEqual(renderedRowValues, [ @@ -343,7 +342,7 @@ describe('DataGridController', () => { component.data = { rows, columns, filters: [createPlainTextFilter('h')] }; renderElementIntoDOM(component); assert.isNotNull(component.shadowRoot); - await coordinator.done(); + await RenderCoordinator.done(); const internalDataGridShadow = getInternalDataGridShadowRoot(component); let renderedRowValues = getValuesOfAllBodyRows(internalDataGridShadow, { onlyVisible: true }); assert.deepEqual(renderedRowValues, [ @@ -352,21 +351,21 @@ describe('DataGridController', () => { ]); const keyHeader = getHeaderCellForColumnId(internalDataGridShadow, 'key'); dispatchClickEvent(keyHeader); // ASC order - await coordinator.done(); + await RenderCoordinator.done(); renderedRowValues = getValuesOfAllBodyRows(internalDataGridShadow, { onlyVisible: true }); assert.deepEqual(renderedRowValues, [ ['Letter A', 'Alpha'], ['Letter C', 'Charlie'], ]); dispatchClickEvent(keyHeader); // DESC order - await coordinator.done(); + await RenderCoordinator.done(); renderedRowValues = getValuesOfAllBodyRows(internalDataGridShadow, { onlyVisible: true }); assert.deepEqual(renderedRowValues, [ ['Letter C', 'Charlie'], ['Letter A', 'Alpha'], ]); dispatchClickEvent(keyHeader); // reset order - await coordinator.done(); + await RenderCoordinator.done(); renderedRowValues = getValuesOfAllBodyRows(internalDataGridShadow, { onlyVisible: true }); assert.deepEqual(renderedRowValues, [ ['Letter A', 'Alpha'], diff --git a/public/ui/components/data_grid/DataGridController.test.js.map b/public/ui/components/data_grid/DataGridController.test.js.map index 13971c3b2..b64981f79 100644 --- a/public/ui/components/data_grid/DataGridController.test.js.map +++ b/public/ui/components/data_grid/DataGridController.test.js.map @@ -1 +1 @@ -{"version":3,"file":"DataGridController.test.js","sourceRoot":"","sources":["../../../../../../../front_end/ui/components/data_grid/DataGridController.test.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,EACL,UAAU,EACV,wBAAwB,EACxB,kBAAkB,EAClB,sBAAsB,GACvB,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EACL,kBAAkB,EAClB,oBAAoB,GACrB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAC,kBAAkB,EAAC,MAAM,wCAAwC,CAAC;AAC1E,OAAO,EAAC,SAAS,EAAE,aAAa,EAAC,MAAM,qCAAqC,CAAC;AAC7E,OAAO,KAAK,WAAW,MAAM,6CAA6C,CAAC;AAE3E,OAAO,KAAK,QAAQ,MAAM,gBAAgB,CAAC;AAE3C,MAAM,WAAW,GAAG,WAAW,CAAC,iBAAiB,CAAC,iBAAiB,CAAC,QAAQ,EAAE,CAAC;AAE/E,MAAM,6BAA6B,GAAG,CAAC,SAAyD,EAAE,EAAE;IAClG,MAAM,EAAC,UAAU,EAAC,GAAG,SAAS,CAAC,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YACxF,MAAM,CAAC,SAAS,CAAC,iBAAiB,EAAE;gBAClC,CAAC,UAAU,EAAE,OAAO,CAAC;gBACrB,CAAC,UAAU,EAAE,SAAS,CAAC;aACxB,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["// Copyright 2020 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport {\n getAllRows,\n getHeaderCellForColumnId,\n getValuesForColumn,\n getValuesOfAllBodyRows,\n} from '../../../testing/DataGridHelpers.js';\nimport {\n dispatchClickEvent,\n renderElementIntoDOM,\n} from '../../../testing/DOMHelpers.js';\nimport {describeWithLocale} from '../../../testing/EnvironmentHelpers.js';\nimport {TEXT_NODE, withMutations} from '../../../testing/MutationHelpers.js';\nimport * as Coordinator from '../render_coordinator/render_coordinator.js';\n\nimport * as DataGrid from './data_grid.js';\n\nconst coordinator = Coordinator.RenderCoordinator.RenderCoordinator.instance();\n\nconst getInternalDataGridShadowRoot = (component: DataGrid.DataGridController.DataGridController) => {\n const {shadowRoot} = component.shadowRoot!.querySelector('devtools-data-grid')!;\n assert.isNotNull(shadowRoot);\n return shadowRoot;\n};\n\ndescribe('DataGridController', () => {\n describeWithLocale('sorting the columns', () => {\n const columns = [\n {id: 'key', title: 'Key', sortable: true, widthWeighting: 1, visible: true, hideable: false},\n ] as DataGrid.DataGridUtils.Column[];\n const rows = [\n {cells: [{columnId: 'key', value: 'Bravo'}]},\n {cells: [{columnId: 'key', value: 'Alpha'}]},\n {cells: [{columnId: 'key', value: 'Charlie'}]},\n ];\n const numericRows = [\n {cells: [{columnId: 'key', value: 2}]},\n {cells: [{columnId: 'key', value: 1}]},\n {cells: [{columnId: 'key', value: 3}]},\n ];\n\n it('lets the user click to sort the column in ASC order', async () => {\n const component = new DataGrid.DataGridController.DataGridController();\n component.data = {rows, columns};\n renderElementIntoDOM(component);\n assert.isNotNull(component.shadowRoot);\n await coordinator.done();\n\n const internalDataGridShadow = getInternalDataGridShadowRoot(component);\n\n await withMutations(\n [{\n // Two text mutations as LitHtml updates the text nodes but does not\n // touch the actual DOM nodes.\n target: TEXT_NODE,\n max: 2,\n }],\n internalDataGridShadow, async shadowRoot => {\n const keyHeader = getHeaderCellForColumnId(shadowRoot, 'key');\n dispatchClickEvent(keyHeader);\n await coordinator.done();\n const cellValues = getValuesForColumn(shadowRoot, 'key');\n assert.deepEqual(cellValues, ['Alpha', 'Bravo', 'Charlie']);\n });\n });\n\n it('supports sorting numeric columns', async () => {\n const component = new DataGrid.DataGridController.DataGridController();\n component.data = {rows: numericRows, columns};\n renderElementIntoDOM(component);\n assert.isNotNull(component.shadowRoot);\n await coordinator.done();\n\n const internalDataGridShadow = getInternalDataGridShadowRoot(component);\n\n const keyHeader = getHeaderCellForColumnId(internalDataGridShadow, 'key');\n dispatchClickEvent(keyHeader); // ASC order\n await coordinator.done();\n let cellValues = getValuesForColumn(internalDataGridShadow, 'key');\n assert.deepEqual(cellValues, ['1', '2', '3']);\n dispatchClickEvent(keyHeader); // DESC order\n await coordinator.done();\n cellValues = getValuesForColumn(internalDataGridShadow, 'key');\n assert.deepEqual(cellValues, ['3', '2', '1']);\n });\n\n it('can be provided an initial sort which is immediately applied', async () => {\n const component = new DataGrid.DataGridController.DataGridController();\n component.data = {\n rows,\n columns,\n initialSort: {\n columnId: 'key',\n direction: DataGrid.DataGridUtils.SortDirection.ASC,\n },\n };\n\n renderElementIntoDOM(component);\n assert.isNotNull(component.shadowRoot);\n await coordinator.done();\n\n const internalDataGridShadow = getInternalDataGridShadowRoot(component);\n const cellValues = getValuesForColumn(internalDataGridShadow, 'key');\n assert.deepEqual(cellValues, ['Alpha', 'Bravo', 'Charlie']);\n });\n\n it('lets the user click to change the sort when it is initially provided', async () => {\n const component = new DataGrid.DataGridController.DataGridController();\n component.data = {\n rows,\n columns,\n initialSort: {\n columnId: 'key',\n direction: DataGrid.DataGridUtils.SortDirection.ASC,\n },\n };\n\n renderElementIntoDOM(component);\n assert.isNotNull(component.shadowRoot);\n await coordinator.done();\n\n const internalDataGridShadow = getInternalDataGridShadowRoot(component);\n const keyHeader = getHeaderCellForColumnId(internalDataGridShadow, 'key');\n let cellValues = getValuesForColumn(internalDataGridShadow, 'key');\n assert.deepEqual(cellValues, ['Alpha', 'Bravo', 'Charlie']);\n dispatchClickEvent(keyHeader); // DESC order\n await coordinator.done();\n cellValues = getValuesForColumn(internalDataGridShadow, 'key');\n assert.deepEqual(cellValues, ['Charlie', 'Bravo', 'Alpha']);\n });\n\n it('lets the user click twice to sort the column in DESC order', async () => {\n const component = new DataGrid.DataGridController.DataGridController();\n component.data = {rows, columns};\n\n renderElementIntoDOM(component);\n assert.isNotNull(component.shadowRoot);\n await coordinator.done();\n const internalDataGridShadow = getInternalDataGridShadowRoot(component);\n\n const keyHeader = getHeaderCellForColumnId(internalDataGridShadow, 'key');\n dispatchClickEvent(keyHeader); // ASC order\n await coordinator.done();\n let cellValues = getValuesForColumn(internalDataGridShadow, 'key');\n assert.deepEqual(cellValues, ['Alpha', 'Bravo', 'Charlie']);\n dispatchClickEvent(keyHeader); // DESC order\n await coordinator.done();\n cellValues = getValuesForColumn(internalDataGridShadow, 'key');\n assert.deepEqual(cellValues, ['Charlie', 'Bravo', 'Alpha']);\n });\n\n it('resets the sort if the user clicks after setting the sort to DESC', async () => {\n const component = new DataGrid.DataGridController.DataGridController();\n component.data = {rows, columns};\n\n renderElementIntoDOM(component);\n assert.isNotNull(component.shadowRoot);\n await coordinator.done();\n const internalDataGridShadow = getInternalDataGridShadowRoot(component);\n\n const keyHeader = getHeaderCellForColumnId(internalDataGridShadow, 'key');\n const originalCellValues = getValuesForColumn(internalDataGridShadow, 'key');\n dispatchClickEvent(keyHeader); // ASC order\n await coordinator.done();\n let cellValues = getValuesForColumn(internalDataGridShadow, 'key');\n assert.deepEqual(cellValues, ['Alpha', 'Bravo', 'Charlie']);\n dispatchClickEvent(keyHeader); // DESC order\n await coordinator.done();\n cellValues = getValuesForColumn(internalDataGridShadow, 'key');\n assert.deepEqual(cellValues, ['Charlie', 'Bravo', 'Alpha']);\n dispatchClickEvent(keyHeader); // Now reset!\n await coordinator.done();\n const finalCellValues = getValuesForColumn(internalDataGridShadow, 'key');\n assert.deepEqual(finalCellValues, originalCellValues);\n });\n\n it('persists the sort as new data is added and inserts new data into the right place', async () => {\n const component = new DataGrid.DataGridController.DataGridController();\n component.data = {rows, columns};\n\n renderElementIntoDOM(component);\n assert.isNotNull(component.shadowRoot);\n await coordinator.done();\n const internalDataGridShadow = getInternalDataGridShadowRoot(component);\n\n const keyHeader = getHeaderCellForColumnId(internalDataGridShadow, 'key');\n dispatchClickEvent(keyHeader); // ASC order\n await coordinator.done();\n let cellValues = getValuesForColumn(internalDataGridShadow, 'key');\n // Ensure we are in ASC order\n assert.deepEqual(cellValues, ['Alpha', 'Bravo', 'Charlie']);\n const newRow = {cells: [{columnId: 'key', value: 'Baz'}]};\n const newRows = [...rows, newRow];\n component.data = {\n ...component.data,\n rows: newRows,\n };\n await coordinator.done();\n cellValues = getValuesForColumn(internalDataGridShadow, 'key');\n assert.deepEqual(cellValues, ['Alpha', 'Baz', 'Bravo', 'Charlie']);\n });\n });\n\n describeWithLocale('filtering rows', () => {\n const columns = [\n {id: 'key', title: 'Letter', sortable: true, widthWeighting: 1, visible: true, hideable: false},\n {id: 'value', title: 'Phonetic', sortable: true, widthWeighting: 1, visible: true, hideable: false},\n ] as DataGrid.DataGridUtils.Column[];\n const rows = [\n {\n cells: [\n {columnId: 'key', value: 'Letter A'},\n {columnId: 'value', value: 'Alpha'},\n ],\n },\n {\n cells: [\n {columnId: 'key', value: 'Letter B'},\n {columnId: 'value', value: 'Bravo'},\n ],\n },\n {\n cells: [\n {columnId: 'key', value: 'Letter C'},\n {columnId: 'value', value: 'Charlie'},\n ],\n },\n ];\n\n const createPlainTextFilter = (text: string) => ({\n text,\n key: undefined,\n regex: undefined,\n negative: false,\n });\n\n const createRegexFilter = (text: string) => ({\n text: undefined,\n key: undefined,\n regex: new RegExp(text, 'i'), // i because the FilterParser adds that flag\n negative: false,\n });\n\n const createColumnFilter = (key: string, text: string) => ({\n text,\n key,\n regex: undefined,\n negative: false,\n });\n\n it('only shows rows with values that match the filter', async () => {\n const component = new DataGrid.DataGridController.DataGridController();\n component.data = {rows, columns, filters: [createPlainTextFilter('bravo')]};\n renderElementIntoDOM(component);\n assert.isNotNull(component.shadowRoot);\n await coordinator.done();\n const internalDataGridShadow = getInternalDataGridShadowRoot(component);\n const renderedRowValues = getValuesOfAllBodyRows(internalDataGridShadow, {onlyVisible: true});\n assert.deepEqual(renderedRowValues, [\n ['Letter B', 'Bravo'],\n ]);\n });\n\n it('only compares visible columns when matching filter', async () => {\n const component = new DataGrid.DataGridController.DataGridController();\n component.data = {rows, columns, filters: [createPlainTextFilter('e')]};\n renderElementIntoDOM(component);\n assert.isNotNull(component.shadowRoot);\n await coordinator.done();\n const internalDataGridShadow = getInternalDataGridShadowRoot(component);\n let renderedRowValues = getValuesOfAllBodyRows(internalDataGridShadow, {onlyVisible: true});\n assert.deepEqual(renderedRowValues, [\n ['Letter A', 'Alpha'],\n ['Letter B', 'Bravo'],\n ['Letter C', 'Charlie'],\n ]);\n\n const columnsWithInvisible = structuredClone(columns);\n columnsWithInvisible[0].visible = false;\n component.data = {\n ...component.data,\n columns: columnsWithInvisible,\n };\n await coordinator.done();\n renderedRowValues = getValuesOfAllBodyRows(internalDataGridShadow, {onlyVisible: true});\n assert.deepEqual(renderedRowValues, [['Charlie']]);\n });\n\n it('renders only visible rows, but maintains proper aria-rowindexes for the rows that are rendered', async () => {\n const component = new DataGrid.DataGridController.DataGridController();\n component.data = {rows, columns, filters: [createPlainTextFilter('bravo')]};\n\n renderElementIntoDOM(component);\n assert.isNotNull(component.shadowRoot);\n await coordinator.done();\n const internalDataGridShadow = getInternalDataGridShadowRoot(component);\n const renderedRows = getAllRows(internalDataGridShadow);\n assert.deepEqual(renderedRows.map(row => row.getAttribute('aria-rowindex')), ['2']);\n });\n\n it('shows all rows if the filter is then cleared', async () => {\n const component = new DataGrid.DataGridController.DataGridController();\n component.data = {rows, columns, filters: [createPlainTextFilter('bravo')]};\n renderElementIntoDOM(component);\n assert.isNotNull(component.shadowRoot);\n await coordinator.done();\n\n const internalDataGridShadow = getInternalDataGridShadowRoot(component);\n let renderedRowValues = getValuesOfAllBodyRows(internalDataGridShadow, {onlyVisible: true});\n assert.lengthOf(renderedRowValues, 1);\n component.data = {\n ...component.data,\n filters: [],\n };\n await coordinator.done();\n renderedRowValues = getValuesOfAllBodyRows(internalDataGridShadow);\n assert.lengthOf(renderedRowValues, 3);\n });\n\n it('supports a regex filter', async () => {\n const component = new DataGrid.DataGridController.DataGridController();\n component.data = {rows, columns, filters: [createRegexFilter('bravo')]};\n renderElementIntoDOM(component);\n assert.isNotNull(component.shadowRoot);\n await coordinator.done();\n const internalDataGridShadow = getInternalDataGridShadowRoot(component);\n const renderedRowValues = getValuesOfAllBodyRows(internalDataGridShadow, {onlyVisible: true});\n assert.deepEqual(renderedRowValues, [\n ['Letter B', 'Bravo'],\n ]);\n });\n\n it('inverts the filter if given a negative filter', async () => {\n const component = new DataGrid.DataGridController.DataGridController();\n const filter = createPlainTextFilter('bravo');\n filter.negative = true;\n component.data = {rows, columns, filters: [filter]};\n renderElementIntoDOM(component);\n assert.isNotNull(component.shadowRoot);\n await coordinator.done();\n const internalDataGridShadow = getInternalDataGridShadowRoot(component);\n const renderedRowValues = getValuesOfAllBodyRows(internalDataGridShadow, {onlyVisible: true});\n assert.deepEqual(renderedRowValues, [\n ['Letter A', 'Alpha'],\n ['Letter C', 'Charlie'],\n ]);\n });\n\n it('only shows rows that match all filters when given multiple filters', async () => {\n const component = new DataGrid.DataGridController.DataGridController();\n // This matches no rows, as no row can match both of these filters\n component.data = {rows, columns, filters: [createPlainTextFilter('alpha'), createPlainTextFilter('charlie')]};\n renderElementIntoDOM(component);\n assert.isNotNull(component.shadowRoot);\n await coordinator.done();\n const internalDataGridShadow = getInternalDataGridShadowRoot(component);\n const renderedRowValues = getValuesOfAllBodyRows(internalDataGridShadow, {onlyVisible: true});\n assert.deepEqual(renderedRowValues, []);\n });\n\n it('supports filtering by column key', async () => {\n const component = new DataGrid.DataGridController.DataGridController();\n // By filtering for values with `e` we expect to only get the \"Letter C: Charlie\" row as it's the only value field with an `e` in.\n component.data = {rows, columns, filters: [createColumnFilter('value', 'e')]};\n renderElementIntoDOM(component);\n assert.isNotNull(component.shadowRoot);\n await coordinator.done();\n const internalDataGridShadow = getInternalDataGridShadowRoot(component);\n const renderedRowValues = getValuesOfAllBodyRows(internalDataGridShadow, {onlyVisible: true});\n assert.deepEqual(renderedRowValues, [\n ['Letter C', 'Charlie'],\n ]);\n });\n\n it('supports negative filtering by column key', async () => {\n const component = new DataGrid.DataGridController.DataGridController();\n const filter = createColumnFilter('value', 'e');\n filter.negative = true;\n component.data = {rows, columns, filters: [filter]};\n renderElementIntoDOM(component);\n assert.isNotNull(component.shadowRoot);\n await coordinator.done();\n const internalDataGridShadow = getInternalDataGridShadowRoot(component);\n const renderedRowValues = getValuesOfAllBodyRows(internalDataGridShadow, {onlyVisible: true});\n assert.deepEqual(renderedRowValues, [\n ['Letter A', 'Alpha'],\n ['Letter B', 'Bravo'],\n ]);\n });\n\n it('renders only matching rows even after sorting columns', async () => {\n const component = new DataGrid.DataGridController.DataGridController();\n component.data = {rows, columns, filters: [createPlainTextFilter('h')]};\n renderElementIntoDOM(component);\n assert.isNotNull(component.shadowRoot);\n await coordinator.done();\n const internalDataGridShadow = getInternalDataGridShadowRoot(component);\n let renderedRowValues = getValuesOfAllBodyRows(internalDataGridShadow, {onlyVisible: true});\n assert.deepEqual(renderedRowValues, [\n ['Letter A', 'Alpha'],\n ['Letter C', 'Charlie'],\n ]);\n\n const keyHeader = getHeaderCellForColumnId(internalDataGridShadow, 'key');\n dispatchClickEvent(keyHeader); // ASC order\n await coordinator.done();\n renderedRowValues = getValuesOfAllBodyRows(internalDataGridShadow, {onlyVisible: true});\n assert.deepEqual(renderedRowValues, [\n ['Letter A', 'Alpha'],\n ['Letter C', 'Charlie'],\n ]);\n\n dispatchClickEvent(keyHeader); // DESC order\n await coordinator.done();\n renderedRowValues = getValuesOfAllBodyRows(internalDataGridShadow, {onlyVisible: true});\n assert.deepEqual(renderedRowValues, [\n ['Letter C', 'Charlie'],\n ['Letter A', 'Alpha'],\n ]);\n\n dispatchClickEvent(keyHeader); // reset order\n await coordinator.done();\n renderedRowValues = getValuesOfAllBodyRows(internalDataGridShadow, {onlyVisible: true});\n assert.deepEqual(renderedRowValues, [\n ['Letter A', 'Alpha'],\n ['Letter C', 'Charlie'],\n ]);\n });\n });\n});\n"]} \ No newline at end of file +{"version":3,"file":"DataGridController.test.js","sourceRoot":"","sources":["../../../../../../../front_end/ui/components/data_grid/DataGridController.test.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,EACL,UAAU,EACV,wBAAwB,EACxB,kBAAkB,EAClB,sBAAsB,GACvB,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EACL,kBAAkB,EAClB,oBAAoB,GACrB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAC,kBAAkB,EAAC,MAAM,wCAAwC,CAAC;AAC1E,OAAO,EAAC,SAAS,EAAE,aAAa,EAAC,MAAM,qCAAqC,CAAC;AAC7E,OAAO,KAAK,iBAAiB,MAAM,6CAA6C,CAAC;AAEjF,OAAO,KAAK,QAAQ,MAAM,gBAAgB,CAAC;AAE3C,MAAM,6BAA6B,GAAG,CAAC,SAAyD,EAAE,EAAE;IAClG,MAAM,EAAC,UAAU,EAAC,GAAG,SAAS,CAAC,UAAW,CAAC,aAAa,CAAC,oBAAoB,CAAE,CAAC;IAChF,MAAM,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC;IAC7B,OAAO,UAAU,CAAC;AACpB,CAAC,CAAC;AAEF,QAAQ,CAAC,oBA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BAClC,CAAC,UAAU,EAAE,OAAO,CAAC;gBACrB,CAAC,UAAU,EAAE,SAAS,CAAC;aACxB,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["// Copyright 2020 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport {\n getAllRows,\n getHeaderCellForColumnId,\n getValuesForColumn,\n getValuesOfAllBodyRows,\n} from '../../../testing/DataGridHelpers.js';\nimport {\n dispatchClickEvent,\n renderElementIntoDOM,\n} from '../../../testing/DOMHelpers.js';\nimport {describeWithLocale} from '../../../testing/EnvironmentHelpers.js';\nimport {TEXT_NODE, withMutations} from '../../../testing/MutationHelpers.js';\nimport * as RenderCoordinator from '../render_coordinator/render_coordinator.js';\n\nimport * as DataGrid from './data_grid.js';\n\nconst getInternalDataGridShadowRoot = (component: DataGrid.DataGridController.DataGridController) => {\n const {shadowRoot} = component.shadowRoot!.querySelector('devtools-data-grid')!;\n assert.isNotNull(shadowRoot);\n return shadowRoot;\n};\n\ndescribe('DataGridController', () => {\n describeWithLocale('sorting the columns', () => {\n const columns = [\n {id: 'key', title: 'Key', sortable: true, widthWeighting: 1, visible: true, hideable: false},\n ] as DataGrid.DataGridUtils.Column[];\n const rows = [\n {cells: [{columnId: 'key', value: 'Bravo'}]},\n {cells: [{columnId: 'key', value: 'Alpha'}]},\n {cells: [{columnId: 'key', value: 'Charlie'}]},\n ];\n const numericRows = [\n {cells: [{columnId: 'key', value: 2}]},\n {cells: [{columnId: 'key', value: 1}]},\n {cells: [{columnId: 'key', value: 3}]},\n ];\n\n it('lets the user click to sort the column in ASC order', async () => {\n const component = new DataGrid.DataGridController.DataGridController();\n component.data = {rows, columns};\n renderElementIntoDOM(component);\n assert.isNotNull(component.shadowRoot);\n await RenderCoordinator.done();\n\n const internalDataGridShadow = getInternalDataGridShadowRoot(component);\n\n await withMutations(\n [{\n // Two text mutations as LitHtml updates the text nodes but does not\n // touch the actual DOM nodes.\n target: TEXT_NODE,\n max: 2,\n }],\n internalDataGridShadow, async shadowRoot => {\n const keyHeader = getHeaderCellForColumnId(shadowRoot, 'key');\n dispatchClickEvent(keyHeader);\n await RenderCoordinator.done();\n const cellValues = getValuesForColumn(shadowRoot, 'key');\n assert.deepEqual(cellValues, ['Alpha', 'Bravo', 'Charlie']);\n });\n });\n\n it('supports sorting numeric columns', async () => {\n const component = new DataGrid.DataGridController.DataGridController();\n component.data = {rows: numericRows, columns};\n renderElementIntoDOM(component);\n assert.isNotNull(component.shadowRoot);\n await RenderCoordinator.done();\n\n const internalDataGridShadow = getInternalDataGridShadowRoot(component);\n\n const keyHeader = getHeaderCellForColumnId(internalDataGridShadow, 'key');\n dispatchClickEvent(keyHeader); // ASC order\n await RenderCoordinator.done();\n let cellValues = getValuesForColumn(internalDataGridShadow, 'key');\n assert.deepEqual(cellValues, ['1', '2', '3']);\n dispatchClickEvent(keyHeader); // DESC order\n await RenderCoordinator.done();\n cellValues = getValuesForColumn(internalDataGridShadow, 'key');\n assert.deepEqual(cellValues, ['3', '2', '1']);\n });\n\n it('can be provided an initial sort which is immediately applied', async () => {\n const component = new DataGrid.DataGridController.DataGridController();\n component.data = {\n rows,\n columns,\n initialSort: {\n columnId: 'key',\n direction: DataGrid.DataGridUtils.SortDirection.ASC,\n },\n };\n\n renderElementIntoDOM(component);\n assert.isNotNull(component.shadowRoot);\n await RenderCoordinator.done();\n\n const internalDataGridShadow = getInternalDataGridShadowRoot(component);\n const cellValues = getValuesForColumn(internalDataGridShadow, 'key');\n assert.deepEqual(cellValues, ['Alpha', 'Bravo', 'Charlie']);\n });\n\n it('lets the user click to change the sort when it is initially provided', async () => {\n const component = new DataGrid.DataGridController.DataGridController();\n component.data = {\n rows,\n columns,\n initialSort: {\n columnId: 'key',\n direction: DataGrid.DataGridUtils.SortDirection.ASC,\n },\n };\n\n renderElementIntoDOM(component);\n assert.isNotNull(component.shadowRoot);\n await RenderCoordinator.done();\n\n const internalDataGridShadow = getInternalDataGridShadowRoot(component);\n const keyHeader = getHeaderCellForColumnId(internalDataGridShadow, 'key');\n let cellValues = getValuesForColumn(internalDataGridShadow, 'key');\n assert.deepEqual(cellValues, ['Alpha', 'Bravo', 'Charlie']);\n dispatchClickEvent(keyHeader); // DESC order\n await RenderCoordinator.done();\n cellValues = getValuesForColumn(internalDataGridShadow, 'key');\n assert.deepEqual(cellValues, ['Charlie', 'Bravo', 'Alpha']);\n });\n\n it('lets the user click twice to sort the column in DESC order', async () => {\n const component = new DataGrid.DataGridController.DataGridController();\n component.data = {rows, columns};\n\n renderElementIntoDOM(component);\n assert.isNotNull(component.shadowRoot);\n await RenderCoordinator.done();\n const internalDataGridShadow = getInternalDataGridShadowRoot(component);\n\n const keyHeader = getHeaderCellForColumnId(internalDataGridShadow, 'key');\n dispatchClickEvent(keyHeader); // ASC order\n await RenderCoordinator.done();\n let cellValues = getValuesForColumn(internalDataGridShadow, 'key');\n assert.deepEqual(cellValues, ['Alpha', 'Bravo', 'Charlie']);\n dispatchClickEvent(keyHeader); // DESC order\n await RenderCoordinator.done();\n cellValues = getValuesForColumn(internalDataGridShadow, 'key');\n assert.deepEqual(cellValues, ['Charlie', 'Bravo', 'Alpha']);\n });\n\n it('resets the sort if the user clicks after setting the sort to DESC', async () => {\n const component = new DataGrid.DataGridController.DataGridController();\n component.data = {rows, columns};\n\n renderElementIntoDOM(component);\n assert.isNotNull(component.shadowRoot);\n await RenderCoordinator.done();\n const internalDataGridShadow = getInternalDataGridShadowRoot(component);\n\n const keyHeader = getHeaderCellForColumnId(internalDataGridShadow, 'key');\n const originalCellValues = getValuesForColumn(internalDataGridShadow, 'key');\n dispatchClickEvent(keyHeader); // ASC order\n await RenderCoordinator.done();\n let cellValues = getValuesForColumn(internalDataGridShadow, 'key');\n assert.deepEqual(cellValues, ['Alpha', 'Bravo', 'Charlie']);\n dispatchClickEvent(keyHeader); // DESC order\n await RenderCoordinator.done();\n cellValues = getValuesForColumn(internalDataGridShadow, 'key');\n assert.deepEqual(cellValues, ['Charlie', 'Bravo', 'Alpha']);\n dispatchClickEvent(keyHeader); // Now reset!\n await RenderCoordinator.done();\n const finalCellValues = getValuesForColumn(internalDataGridShadow, 'key');\n assert.deepEqual(finalCellValues, originalCellValues);\n });\n\n it('persists the sort as new data is added and inserts new data into the right place', async () => {\n const component = new DataGrid.DataGridController.DataGridController();\n component.data = {rows, columns};\n\n renderElementIntoDOM(component);\n assert.isNotNull(component.shadowRoot);\n await RenderCoordinator.done();\n const internalDataGridShadow = getInternalDataGridShadowRoot(component);\n\n const keyHeader = getHeaderCellForColumnId(internalDataGridShadow, 'key');\n dispatchClickEvent(keyHeader); // ASC order\n await RenderCoordinator.done();\n let cellValues = getValuesForColumn(internalDataGridShadow, 'key');\n // Ensure we are in ASC order\n assert.deepEqual(cellValues, ['Alpha', 'Bravo', 'Charlie']);\n const newRow = {cells: [{columnId: 'key', value: 'Baz'}]};\n const newRows = [...rows, newRow];\n component.data = {\n ...component.data,\n rows: newRows,\n };\n await RenderCoordinator.done();\n cellValues = getValuesForColumn(internalDataGridShadow, 'key');\n assert.deepEqual(cellValues, ['Alpha', 'Baz', 'Bravo', 'Charlie']);\n });\n });\n\n describeWithLocale('filtering rows', () => {\n const columns = [\n {id: 'key', title: 'Letter', sortable: true, widthWeighting: 1, visible: true, hideable: false},\n {id: 'value', title: 'Phonetic', sortable: true, widthWeighting: 1, visible: true, hideable: false},\n ] as DataGrid.DataGridUtils.Column[];\n const rows = [\n {\n cells: [\n {columnId: 'key', value: 'Letter A'},\n {columnId: 'value', value: 'Alpha'},\n ],\n },\n {\n cells: [\n {columnId: 'key', value: 'Letter B'},\n {columnId: 'value', value: 'Bravo'},\n ],\n },\n {\n cells: [\n {columnId: 'key', value: 'Letter C'},\n {columnId: 'value', value: 'Charlie'},\n ],\n },\n ];\n\n const createPlainTextFilter = (text: string) => ({\n text,\n key: undefined,\n regex: undefined,\n negative: false,\n });\n\n const createRegexFilter = (text: string) => ({\n text: undefined,\n key: undefined,\n regex: new RegExp(text, 'i'), // i because the FilterParser adds that flag\n negative: false,\n });\n\n const createColumnFilter = (key: string, text: string) => ({\n text,\n key,\n regex: undefined,\n negative: false,\n });\n\n it('only shows rows with values that match the filter', async () => {\n const component = new DataGrid.DataGridController.DataGridController();\n component.data = {rows, columns, filters: [createPlainTextFilter('bravo')]};\n renderElementIntoDOM(component);\n assert.isNotNull(component.shadowRoot);\n await RenderCoordinator.done();\n const internalDataGridShadow = getInternalDataGridShadowRoot(component);\n const renderedRowValues = getValuesOfAllBodyRows(internalDataGridShadow, {onlyVisible: true});\n assert.deepEqual(renderedRowValues, [\n ['Letter B', 'Bravo'],\n ]);\n });\n\n it('only compares visible columns when matching filter', async () => {\n const component = new DataGrid.DataGridController.DataGridController();\n component.data = {rows, columns, filters: [createPlainTextFilter('e')]};\n renderElementIntoDOM(component);\n assert.isNotNull(component.shadowRoot);\n await RenderCoordinator.done();\n const internalDataGridShadow = getInternalDataGridShadowRoot(component);\n let renderedRowValues = getValuesOfAllBodyRows(internalDataGridShadow, {onlyVisible: true});\n assert.deepEqual(renderedRowValues, [\n ['Letter A', 'Alpha'],\n ['Letter B', 'Bravo'],\n ['Letter C', 'Charlie'],\n ]);\n\n const columnsWithInvisible = structuredClone(columns);\n columnsWithInvisible[0].visible = false;\n component.data = {\n ...component.data,\n columns: columnsWithInvisible,\n };\n await RenderCoordinator.done();\n renderedRowValues = getValuesOfAllBodyRows(internalDataGridShadow, {onlyVisible: true});\n assert.deepEqual(renderedRowValues, [['Charlie']]);\n });\n\n it('renders only visible rows, but maintains proper aria-rowindexes for the rows that are rendered', async () => {\n const component = new DataGrid.DataGridController.DataGridController();\n component.data = {rows, columns, filters: [createPlainTextFilter('bravo')]};\n\n renderElementIntoDOM(component);\n assert.isNotNull(component.shadowRoot);\n await RenderCoordinator.done();\n const internalDataGridShadow = getInternalDataGridShadowRoot(component);\n const renderedRows = getAllRows(internalDataGridShadow);\n assert.deepEqual(renderedRows.map(row => row.getAttribute('aria-rowindex')), ['2']);\n });\n\n it('shows all rows if the filter is then cleared', async () => {\n const component = new DataGrid.DataGridController.DataGridController();\n component.data = {rows, columns, filters: [createPlainTextFilter('bravo')]};\n renderElementIntoDOM(component);\n assert.isNotNull(component.shadowRoot);\n await RenderCoordinator.done();\n\n const internalDataGridShadow = getInternalDataGridShadowRoot(component);\n let renderedRowValues = getValuesOfAllBodyRows(internalDataGridShadow, {onlyVisible: true});\n assert.lengthOf(renderedRowValues, 1);\n component.data = {\n ...component.data,\n filters: [],\n };\n await RenderCoordinator.done();\n renderedRowValues = getValuesOfAllBodyRows(internalDataGridShadow);\n assert.lengthOf(renderedRowValues, 3);\n });\n\n it('supports a regex filter', async () => {\n const component = new DataGrid.DataGridController.DataGridController();\n component.data = {rows, columns, filters: [createRegexFilter('bravo')]};\n renderElementIntoDOM(component);\n assert.isNotNull(component.shadowRoot);\n await RenderCoordinator.done();\n const internalDataGridShadow = getInternalDataGridShadowRoot(component);\n const renderedRowValues = getValuesOfAllBodyRows(internalDataGridShadow, {onlyVisible: true});\n assert.deepEqual(renderedRowValues, [\n ['Letter B', 'Bravo'],\n ]);\n });\n\n it('inverts the filter if given a negative filter', async () => {\n const component = new DataGrid.DataGridController.DataGridController();\n const filter = createPlainTextFilter('bravo');\n filter.negative = true;\n component.data = {rows, columns, filters: [filter]};\n renderElementIntoDOM(component);\n assert.isNotNull(component.shadowRoot);\n await RenderCoordinator.done();\n const internalDataGridShadow = getInternalDataGridShadowRoot(component);\n const renderedRowValues = getValuesOfAllBodyRows(internalDataGridShadow, {onlyVisible: true});\n assert.deepEqual(renderedRowValues, [\n ['Letter A', 'Alpha'],\n ['Letter C', 'Charlie'],\n ]);\n });\n\n it('only shows rows that match all filters when given multiple filters', async () => {\n const component = new DataGrid.DataGridController.DataGridController();\n // This matches no rows, as no row can match both of these filters\n component.data = {rows, columns, filters: [createPlainTextFilter('alpha'), createPlainTextFilter('charlie')]};\n renderElementIntoDOM(component);\n assert.isNotNull(component.shadowRoot);\n await RenderCoordinator.done();\n const internalDataGridShadow = getInternalDataGridShadowRoot(component);\n const renderedRowValues = getValuesOfAllBodyRows(internalDataGridShadow, {onlyVisible: true});\n assert.deepEqual(renderedRowValues, []);\n });\n\n it('supports filtering by column key', async () => {\n const component = new DataGrid.DataGridController.DataGridController();\n // By filtering for values with `e` we expect to only get the \"Letter C: Charlie\" row as it's the only value field with an `e` in.\n component.data = {rows, columns, filters: [createColumnFilter('value', 'e')]};\n renderElementIntoDOM(component);\n assert.isNotNull(component.shadowRoot);\n await RenderCoordinator.done();\n const internalDataGridShadow = getInternalDataGridShadowRoot(component);\n const renderedRowValues = getValuesOfAllBodyRows(internalDataGridShadow, {onlyVisible: true});\n assert.deepEqual(renderedRowValues, [\n ['Letter C', 'Charlie'],\n ]);\n });\n\n it('supports negative filtering by column key', async () => {\n const component = new DataGrid.DataGridController.DataGridController();\n const filter = createColumnFilter('value', 'e');\n filter.negative = true;\n component.data = {rows, columns, filters: [filter]};\n renderElementIntoDOM(component);\n assert.isNotNull(component.shadowRoot);\n await RenderCoordinator.done();\n const internalDataGridShadow = getInternalDataGridShadowRoot(component);\n const renderedRowValues = getValuesOfAllBodyRows(internalDataGridShadow, {onlyVisible: true});\n assert.deepEqual(renderedRowValues, [\n ['Letter A', 'Alpha'],\n ['Letter B', 'Bravo'],\n ]);\n });\n\n it('renders only matching rows even after sorting columns', async () => {\n const component = new DataGrid.DataGridController.DataGridController();\n component.data = {rows, columns, filters: [createPlainTextFilter('h')]};\n renderElementIntoDOM(component);\n assert.isNotNull(component.shadowRoot);\n await RenderCoordinator.done();\n const internalDataGridShadow = getInternalDataGridShadowRoot(component);\n let renderedRowValues = getValuesOfAllBodyRows(internalDataGridShadow, {onlyVisible: true});\n assert.deepEqual(renderedRowValues, [\n ['Letter A', 'Alpha'],\n ['Letter C', 'Charlie'],\n ]);\n\n const keyHeader = getHeaderCellForColumnId(internalDataGridShadow, 'key');\n dispatchClickEvent(keyHeader); // ASC order\n await RenderCoordinator.done();\n renderedRowValues = getValuesOfAllBodyRows(internalDataGridShadow, {onlyVisible: true});\n assert.deepEqual(renderedRowValues, [\n ['Letter A', 'Alpha'],\n ['Letter C', 'Charlie'],\n ]);\n\n dispatchClickEvent(keyHeader); // DESC order\n await RenderCoordinator.done();\n renderedRowValues = getValuesOfAllBodyRows(internalDataGridShadow, {onlyVisible: true});\n assert.deepEqual(renderedRowValues, [\n ['Letter C', 'Charlie'],\n ['Letter A', 'Alpha'],\n ]);\n\n dispatchClickEvent(keyHeader); // reset order\n await RenderCoordinator.done();\n renderedRowValues = getValuesOfAllBodyRows(internalDataGridShadow, {onlyVisible: true});\n assert.deepEqual(renderedRowValues, [\n ['Letter A', 'Alpha'],\n ['Letter C', 'Charlie'],\n ]);\n });\n });\n});\n"]} \ No newline at end of file diff --git a/public/ui/components/data_grid/dataGrid.css.js b/public/ui/components/data_grid/dataGrid.css.js index 291cad370..a7804eb1d 100644 --- a/public/ui/components/data_grid/dataGrid.css.js +++ b/public/ui/components/data_grid/dataGrid.css.js @@ -66,7 +66,7 @@ tbody tr.selected:focus-within { background-color: var(--sys-color-tonal-container); } -.wrapping-container.striped tr:nth-child(odd):not(.selected):not(.padding-row):not(:hover) { +.wrapping-container.striped tr:nth-child(odd):not(.selected, .padding-row, :hover) { background-color: var(--sys-color-surface1); } diff --git a/public/ui/components/dialogs/ButtonDialog.test.js b/public/ui/components/dialogs/ButtonDialog.test.js index 1a80c3a69..0b5276787 100644 --- a/public/ui/components/dialogs/ButtonDialog.test.js +++ b/public/ui/components/dialogs/ButtonDialog.test.js @@ -3,9 +3,8 @@ // found in the LICENSE file. import * as Helpers from '../../../testing/DOMHelpers.js'; // eslint-disable-line rulesdir/es-modules-import import * as Buttons from '../buttons/buttons.js'; -import * as Coordinator from '../render_coordinator/render_coordinator.js'; +import * as RenderCoordinator from '../render_coordinator/render_coordinator.js'; import * as Dialogs from './dialogs.js'; -const coordinator = Coordinator.RenderCoordinator.RenderCoordinator.instance(); describe('ButtonDialog', () => { async function getButtonDialog(fieldToTest) { const defaultMinimumButtonDialogData = { @@ -17,7 +16,7 @@ describe('ButtonDialog', () => { const buttonDialog = new Dialogs.ButtonDialog.ButtonDialog(); buttonDialog.data = Object.assign(defaultMinimumButtonDialogData, fieldToTest); Helpers.renderElementIntoDOM(buttonDialog); - await coordinator.done(); + await RenderCoordinator.done(); return buttonDialog; } function getButtonFromButtonDialog(buttonDialog) { @@ -58,7 +57,7 @@ describe('ButtonDialog', () => { assert.isFalse(dialog.hasAttribute('open')); const button = getButtonFromButtonDialog(buttonDialog); button.click(); - await coordinator.done(); + await RenderCoordinator.done(); assert.isTrue(dialog.hasAttribute('open')); }); }); diff --git a/public/ui/components/dialogs/ButtonDialog.test.js.map b/public/ui/components/dialogs/ButtonDialog.test.js.map index a30ab36d2..415299f10 100644 --- a/public/ui/components/dialogs/ButtonDialog.test.js.map +++ b/public/ui/components/dialogs/ButtonDialog.test.js.map @@ -1 +1 @@ -{"version":3,"file":"ButtonDialog.test.js","sourceRoot":"","sources":["../../../../../../../front_end/ui/components/dialogs/ButtonDialog.test.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,KAAK,OAAO,MAAM,gCAAgC,CAAC,CAAE,iDAAiD;AAC7G,OAAO,KAAK,OAAO,MAAM,uBAAuB,CAAC;AACjD,OAAO,KAAK,WAAW,MAAM,6CAA6C,CAAC;AAE3E,OAAO,KAAK,OAAO,MAAM,cAAc,CAAC;AAExC,MAAM,WAAW,GAAG,WAAW,CAAC,iBAAiB,CAAC,iBAAiB,CAAC,QAAQ,EAAE,CAAC;AAE/E,QAAQ,CAAC,cAAc,EAAE,GAAG,EAAE;IAC5B,KAAK,UAAU,eAAe,CAAC,WAA4D;QACzF,MAAM,8BAA8B,GAA0C;YAC5E,YAAY,EAAE,KAAK;YACnB,QAAQ,EAAE,MAAM;YAChB,OAAO,gDAAg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B,CAAC,YAAY,CAAC,CAAC;QAEvD,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC,CAAC;IAC7C,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,wDAAwD,EAAE,KAAK,IAAI,EAAE;QACtE,MAAM,YAAY,GAAG,MAAM,eAAe,CAAC;YACzC,YAAY,EAAE,KAAK;SACpB,CAAC,CAAC;QACH,MAAM,MAAM,GAAG,yBAAyB,CAAC,YAAY,CAAC,CAAC;QAEvD,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC,CAAC;IAC9C,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,4BAA4B,EAAE,KAAK,IAAI,EAAE;QAC1C,MAAM,YAAY,GAAG,MAAM,eAAe,CAAC,EAAE,CAAC,CAAC;QAC/C,MAAM,MAAM,GAAG,yBAAyB,CAAC,YAAY,CAAC,CAAC;QACvD,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC,CAAC;QAE5C,MAAM,MAAM,GAAG,yBAAyB,CAAC,YAAY,CAAC,CAAC;QACvD,MAAM,CAAC,KAAK,EAAE,CAAC;QACf,MAAM,WAAW,CAAC,IAAI,EAAE,CAAC;QACzB,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC,CAAC;IAC7C,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["// Copyright 2024 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport * as Helpers from '../../../testing/DOMHelpers.js'; // eslint-disable-line rulesdir/es-modules-import\nimport * as Buttons from '../buttons/buttons.js';\nimport * as Coordinator from '../render_coordinator/render_coordinator.js';\n\nimport * as Dialogs from './dialogs.js';\n\nconst coordinator = Coordinator.RenderCoordinator.RenderCoordinator.instance();\n\ndescribe('ButtonDialog', () => {\n async function getButtonDialog(fieldToTest?: Partial) {\n const defaultMinimumButtonDialogData: Dialogs.ButtonDialog.ButtonDialogData = {\n openOnRender: false,\n iconName: 'help',\n variant: Buttons.Button.Variant.TOOLBAR,\n dialogTitle: '',\n };\n const buttonDialog = new Dialogs.ButtonDialog.ButtonDialog();\n buttonDialog.data = Object.assign(defaultMinimumButtonDialogData, fieldToTest);\n\n Helpers.renderElementIntoDOM(buttonDialog);\n await coordinator.done();\n\n return buttonDialog;\n }\n\n function getButtonFromButtonDialog(buttonDialog: Dialogs.ButtonDialog.ButtonDialog): Buttons.Button.Button {\n assert.isNotNull(buttonDialog.shadowRoot);\n const button = buttonDialog.shadowRoot.querySelector('devtools-button');\n if (!button) {\n assert.fail('devtools-button not found');\n }\n assert.instanceOf(button, HTMLElement);\n return button;\n }\n\n function getDialogFromButtonDialog(buttonDialog: Dialogs.ButtonDialog.ButtonDialog): Dialogs.Dialog.Dialog {\n assert.isNotNull(buttonDialog.shadowRoot);\n const dialog = buttonDialog.shadowRoot.querySelector('devtools-dialog');\n if (!dialog) {\n assert.fail('devtools-dialog not found');\n }\n assert.instanceOf(dialog, HTMLElement);\n return dialog;\n }\n\n it('should display dialog on initial render when provided prop', async () => {\n const buttonDialog = await getButtonDialog({\n openOnRender: true,\n });\n const dialog = getDialogFromButtonDialog(buttonDialog);\n\n assert.isTrue(dialog.hasAttribute('open'));\n });\n\n it('should not display dialog on initial render by default', async () => {\n const buttonDialog = await getButtonDialog({\n openOnRender: false,\n });\n const dialog = getDialogFromButtonDialog(buttonDialog);\n\n assert.isFalse(dialog.hasAttribute('open'));\n });\n\n it('Opens if button is clicked', async () => {\n const buttonDialog = await getButtonDialog({});\n const dialog = getDialogFromButtonDialog(buttonDialog);\n assert.isFalse(dialog.hasAttribute('open'));\n\n const button = getButtonFromButtonDialog(buttonDialog);\n button.click();\n await coordinator.done();\n assert.isTrue(dialog.hasAttribute('open'));\n });\n});\n"]} \ No newline at end of file +{"version":3,"file":"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AAC;QACvD,MAAM,CAAC,KAAK,EAAE,CAAC;QACf,MAAM,iBAAiB,CAAC,IAAI,EAAE,CAAC;QAC/B,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC,CAAC;IAC7C,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["// Copyright 2024 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport * as Helpers from '../../../testing/DOMHelpers.js'; // eslint-disable-line rulesdir/es-modules-import\nimport * as Buttons from '../buttons/buttons.js';\nimport * as RenderCoordinator from '../render_coordinator/render_coordinator.js';\n\nimport * as Dialogs from './dialogs.js';\n\ndescribe('ButtonDialog', () => {\n async function getButtonDialog(fieldToTest?: Partial) {\n const defaultMinimumButtonDialogData: Dialogs.ButtonDialog.ButtonDialogData = {\n openOnRender: false,\n iconName: 'help',\n variant: Buttons.Button.Variant.TOOLBAR,\n dialogTitle: '',\n };\n const buttonDialog = new Dialogs.ButtonDialog.ButtonDialog();\n buttonDialog.data = Object.assign(defaultMinimumButtonDialogData, fieldToTest);\n\n Helpers.renderElementIntoDOM(buttonDialog);\n await RenderCoordinator.done();\n\n return buttonDialog;\n }\n\n function getButtonFromButtonDialog(buttonDialog: Dialogs.ButtonDialog.ButtonDialog): Buttons.Button.Button {\n assert.isNotNull(buttonDialog.shadowRoot);\n const button = buttonDialog.shadowRoot.querySelector('devtools-button');\n if (!button) {\n assert.fail('devtools-button not found');\n }\n assert.instanceOf(button, HTMLElement);\n return button;\n }\n\n function getDialogFromButtonDialog(buttonDialog: Dialogs.ButtonDialog.ButtonDialog): Dialogs.Dialog.Dialog {\n assert.isNotNull(buttonDialog.shadowRoot);\n const dialog = buttonDialog.shadowRoot.querySelector('devtools-dialog');\n if (!dialog) {\n assert.fail('devtools-dialog not found');\n }\n assert.instanceOf(dialog, HTMLElement);\n return dialog;\n }\n\n it('should display dialog on initial render when provided prop', async () => {\n const buttonDialog = await getButtonDialog({\n openOnRender: true,\n });\n const dialog = getDialogFromButtonDialog(buttonDialog);\n\n assert.isTrue(dialog.hasAttribute('open'));\n });\n\n it('should not display dialog on initial render by default', async () => {\n const buttonDialog = await getButtonDialog({\n openOnRender: false,\n });\n const dialog = getDialogFromButtonDialog(buttonDialog);\n\n assert.isFalse(dialog.hasAttribute('open'));\n });\n\n it('Opens if button is clicked', async () => {\n const buttonDialog = await getButtonDialog({});\n const dialog = getDialogFromButtonDialog(buttonDialog);\n assert.isFalse(dialog.hasAttribute('open'));\n\n const button = getButtonFromButtonDialog(buttonDialog);\n button.click();\n await RenderCoordinator.done();\n assert.isTrue(dialog.hasAttribute('open'));\n });\n});\n"]} \ No newline at end of file diff --git a/public/ui/components/dialogs/Dialog.js b/public/ui/components/dialogs/Dialog.js index a22a47fbe..07c1b8ba8 100644 --- a/public/ui/components/dialogs/Dialog.js +++ b/public/ui/components/dialogs/Dialog.js @@ -5,7 +5,7 @@ import * as i18n from '../../../core/i18n/i18n.js'; import * as Platform from '../../../core/platform/platform.js'; import * as WindowBoundsService from '../../../services/window_bounds/window_bounds.js'; import * as ComponentHelpers from '../../../ui/components/helpers/helpers.js'; -import * as Coordinator from '../../../ui/components/render_coordinator/render_coordinator.js'; +import * as RenderCoordinator from '../../../ui/components/render_coordinator/render_coordinator.js'; import * as LitHtml from '../../../ui/lit-html/lit-html.js'; import * as VisualLogging from '../../../ui/visual_logging/visual_logging.js'; import * as Buttons from '../buttons/buttons.js'; @@ -19,7 +19,6 @@ const UIStrings = { }; const str_ = i18n.i18n.registerUIStrings('ui/components/dialogs/Dialog.ts', UIStrings); const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_); -const coordinator = Coordinator.RenderCoordinator.RenderCoordinator.instance(); const IS_DIALOG_SUPPORTED = 'HTMLDialogElement' in globalThis; // Height in pixels of the dialog's connector. The connector is represented as // as a diamond and the height corresponds to half the height of the diamond. @@ -267,7 +266,7 @@ export class Dialog extends HTMLElement { return; } this.#isPendingShowDialog = true; - void coordinator.read(() => { + void RenderCoordinator.read(() => { // Fixed elements are positioned relative to the window, regardless if // DevTools is docked. As such, if DevTools is docked we must account for // its offset relative to the window when positioning fixed elements. @@ -280,7 +279,7 @@ export class Dialog extends HTMLElement { const devToolsTop = devtoolsBounds.top; const devToolsRight = devtoolsBounds.right; if (this.#props.origin === MODAL) { - void coordinator.write(() => { + void RenderCoordinator.write(() => { this.style.setProperty('--dialog-top', `${devToolsTop}px`); this.style.setProperty('--dialog-left', `${devToolsLeft}px`); this.style.setProperty('--dialog-margin', 'auto'); @@ -299,7 +298,7 @@ export class Dialog extends HTMLElement { const hitAreaWidth = anchorRight - anchorLeft + CONNECTOR_HEIGHT; const windowWidth = document.body.clientWidth; const connectorFixedXValue = this.#props.getConnectorCustomXPosition ? this.#props.getConnectorCustomXPosition() : originCenterX; - void coordinator.write(() => { + void RenderCoordinator.write(() => { this.style.setProperty('--dialog-top', '0'); // Start by showing the dialog hidden to allow measuring its width. const dialog = this.#getDialog(); @@ -406,7 +405,7 @@ export class Dialog extends HTMLElement { this.#isPendingShowDialog = true; this.#positionDialog(); // Allow the CSS variables to be set before showing. - await coordinator.done(); + await RenderCoordinator.done(); this.#isPendingShowDialog = false; const dialog = this.#getDialog(); // Make the dialog visible now. @@ -463,7 +462,7 @@ export class Dialog extends HTMLElement { return; } this.#isPendingCloseDialog = true; - void coordinator.write(() => { + void RenderCoordinator.write(() => { this.#hitArea.width = 0; this.removeAttribute('open'); this.#getDialog().close(); diff --git a/public/ui/components/dialogs/Dialog.js.map b/public/ui/components/dialogs/Dialog.js.map index c5f033175..9dfd34712 100644 --- a/public/ui/components/dialogs/Dialog.js.map +++ b/public/ui/components/dialogs/Dialog.js.map @@ -1 +1 @@ -{"version":3,"file":"Dialog.js","sourceRoot":"","sources":["../../../../../../../front_end/ui/components/dialogs/Dialog.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B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AI,EAAE,QAAQ,EAAE,IAAI,EAAC,CAAC,CAAC;IAC5E,CAAC;;AAGH,MAAM,OAAO,iBAAkB,SAAQ,KAAK;IAC1C,MAAM,CAAU,SAAS,GAAG,mBAAmB,CAAC;IAChD;QACE,KAAK,CAAC,iBAAiB,CAAC,SAAS,EAAE,EAAC,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAC,CAAC,CAAC;IACtE,CAAC","sourcesContent":["// Copyright 2023 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport * as i18n from '../../../core/i18n/i18n.js';\nimport * as Platform from '../../../core/platform/platform.js';\nimport * as WindowBoundsService from '../../../services/window_bounds/window_bounds.js';\nimport * as ComponentHelpers from '../../../ui/components/helpers/helpers.js';\nimport * as Coordinator from '../../../ui/components/render_coordinator/render_coordinator.js';\nimport * as LitHtml from '../../../ui/lit-html/lit-html.js';\nimport * as VisualLogging from '../../../ui/visual_logging/visual_logging.js';\nimport * as Buttons from '../buttons/buttons.js';\n\nimport dialogStyles from './dialog.css.js';\n\nconst {html} = LitHtml;\n\nconst UIStrings = {\n\n /**\n * @description Title of close button for the shortcuts dialog.\n */\n close: 'Close',\n};\n\nconst str_ = i18n.i18n.registerUIStrings('ui/components/dialogs/Dialog.ts', UIStrings);\nconst i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);\n\nconst coordinator = Coordinator.RenderCoordinator.RenderCoordinator.instance();\n\nconst IS_DIALOG_SUPPORTED = 'HTMLDialogElement' in globalThis;\n\n// Height in pixels of the dialog's connector. The connector is represented as\n// as a diamond and the height corresponds to half the height of the diamond.\n// (the visible height is only half of the diamond).\nexport const CONNECTOR_HEIGHT = 10;\nconst CONNECTOR_WIDTH = 2 * CONNECTOR_HEIGHT;\n\n// The offset used by the dialog's animation as it slides in when opened.\nconst DIALOG_ANIMATION_OFFSET = 20;\n\nexport const DIALOG_SIDE_PADDING = 5;\nexport const DIALOG_VERTICAL_PADDING = 3;\n\n// If the content of the dialog cannot be completely shown because otherwise\n// the dialog would overflow the window, the dialog's max width and height are\n// set such that the dialog remains inside the visible bounds. In this cases\n// some extra, determined by this constant, is added so that the dialog's borders\n// remain clearly visible. This constant accounts for the padding of the dialog's\n// content (20 px) and a 5px gap left on each extreme of the dialog from the viewport.\nexport const DIALOG_PADDING_FROM_WINDOW = 3 * CONNECTOR_HEIGHT;\ninterface DialogData {\n /**\n * Position or point the dialog is shown relative to.\n * If the dialog instance will be shown as a modal, set\n * this property to MODAL.\n */\n origin: DialogOrigin;\n position: DialogVerticalPosition;\n /**\n * Horizontal alignment of the dialog with respect to its origin.\n * Center by default.\n */\n horizontalAlignment: DialogHorizontalAlignment;\n /**\n * Optional function used to the determine the x coordinate of the connector's\n * end (tip of the triangle), relative to the viewport. If not defined, the x\n * coordinate of the origin's center is used instead.\n */\n getConnectorCustomXPosition: (() => number)|null;\n\n /**\n * Optional function called when the dialog is shown.\n */\n dialogShownCallback: (() => unknown)|null;\n\n /**\n * Optional. Service that provides the window dimensions used for positioning the Dialog.\n */\n windowBoundsService: WindowBoundsService.WindowBoundsService.WindowBoundsService;\n /**\n * Whether the dialog is closed when the 'Escape' key is pressed. When true, the event is\n * propagation is stopped.\n */\n closeOnESC: boolean;\n /**\n * Whether the dialog is closed when a scroll event is detected outside of the dialog's\n * content. Defaults to true.\n */\n closeOnScroll: boolean;\n /**\n * Whether render a closed button, when it is clicked, close the dialog. Defaults to false.\n */\n closeButton: boolean;\n /**\n * The string used in the header row of the dialog.\n */\n dialogTitle: string;\n /**\n * Specifies a context for the visual element.\n */\n jslogContext: string;\n}\n\ntype DialogAnchor = HTMLElement|DOMRect|DOMPoint;\n\nexport const MODAL = 'MODAL';\n\nexport type DialogOrigin = DialogAnchor|null|(() => DialogAnchor)|typeof MODAL;\nexport class Dialog extends HTMLElement {\n readonly #shadow = this.attachShadow({mode: 'open'});\n readonly #renderBound = this.#render.bind(this);\n readonly #forceDialogCloseInDevToolsBound = this.#forceDialogCloseInDevToolsMutation.bind(this);\n readonly #handleScrollAttemptBound = this.#handleScrollAttempt.bind(this);\n readonly #props: DialogData = {\n origin: MODAL,\n position: DialogVerticalPosition.BOTTOM,\n horizontalAlignment: DialogHorizontalAlignment.CENTER,\n getConnectorCustomXPosition: null,\n dialogShownCallback: null,\n windowBoundsService: WindowBoundsService.WindowBoundsService.WindowBoundsServiceImpl.instance(),\n closeOnESC: true,\n closeOnScroll: true,\n closeButton: false,\n dialogTitle: '',\n jslogContext: '',\n };\n\n #dialog: HTMLDialogElement|null = null;\n #isPendingShowDialog = false;\n #isPendingCloseDialog = false;\n #hitArea = new DOMRect(0, 0, 0, 0);\n #dialogClientRect = new DOMRect(0, 0, 0, 0);\n #bestVerticalPositionInternal: DialogVerticalPosition|null = null;\n #bestHorizontalAlignment: DialogHorizontalAlignment|null = null;\n readonly #devtoolsMutationObserver = new MutationObserver(this.#forceDialogCloseInDevToolsBound);\n readonly #dialogResizeObserver = new ResizeObserver(this.#updateDialogBounds.bind(this));\n #devToolsBoundingElement = this.windowBoundsService.getDevToolsBoundingElement();\n\n // We bind here because we have to listen to keydowns on the entire window,\n // not on the Dialog element itself. This is because if the user has the\n // dialog open, but their focus is elsewhere, and they hit ESC, we should\n // still close the dialog.\n #onKeyDownBound = this.#onKeyDown.bind(this);\n\n get origin(): DialogOrigin {\n return this.#props.origin;\n }\n\n set origin(origin: DialogOrigin) {\n this.#props.origin = origin;\n this.#onStateChange();\n }\n\n get position(): DialogVerticalPosition {\n return this.#props.position;\n }\n\n set position(position: DialogVerticalPosition) {\n this.#props.position = position;\n this.#onStateChange();\n }\n\n get horizontalAlignment(): DialogHorizontalAlignment {\n return this.#props.horizontalAlignment;\n }\n\n set horizontalAlignment(alignment: DialogHorizontalAlignment) {\n this.#props.horizontalAlignment = alignment;\n this.#onStateChange();\n }\n\n get windowBoundsService(): WindowBoundsService.WindowBoundsService.WindowBoundsService {\n return this.#props.windowBoundsService;\n }\n\n set windowBoundsService(windowBoundsService: WindowBoundsService.WindowBoundsService.WindowBoundsService) {\n this.#props.windowBoundsService = windowBoundsService;\n this.#devToolsBoundingElement = this.windowBoundsService.getDevToolsBoundingElement();\n this.#onStateChange();\n }\n\n get bestVerticalPosition(): DialogVerticalPosition|null {\n return this.#bestVerticalPositionInternal;\n }\n\n get bestHorizontalAlignment(): DialogHorizontalAlignment|null {\n return this.#bestHorizontalAlignment;\n }\n get getConnectorCustomXPosition(): (() => number)|null {\n return this.#props.getConnectorCustomXPosition;\n }\n\n set getConnectorCustomXPosition(connectorXPosition: (() => number)|null) {\n this.#props.getConnectorCustomXPosition = connectorXPosition;\n this.#onStateChange();\n }\n\n get dialogShownCallback(): (() => unknown)|null {\n return this.#props.dialogShownCallback;\n }\n\n get jslogContext(): string {\n return this.#props.jslogContext;\n }\n\n set dialogShownCallback(dialogShownCallback: (() => unknown)|null) {\n this.#props.dialogShownCallback = dialogShownCallback;\n this.#onStateChange();\n }\n\n set closeOnESC(closeOnESC: boolean) {\n this.#props.closeOnESC = closeOnESC;\n this.#onStateChange();\n }\n\n set closeOnScroll(closeOnScroll: boolean) {\n this.#props.closeOnScroll = closeOnScroll;\n this.#onStateChange();\n }\n\n set closeButton(closeButton: boolean) {\n this.#props.closeButton = closeButton;\n this.#onStateChange();\n }\n\n set dialogTitle(dialogTitle: string) {\n this.#props.dialogTitle = dialogTitle;\n this.#onStateChange();\n }\n\n set jslogContext(jslogContext: string) {\n this.#props.jslogContext = jslogContext;\n this.#onStateChange();\n }\n\n #updateDialogBounds(): void {\n this.#dialogClientRect = this.#getDialog().getBoundingClientRect();\n }\n\n #onStateChange(): void {\n void ComponentHelpers.ScheduledRender.scheduleRender(this, this.#renderBound);\n }\n\n connectedCallback(): void {\n this.#shadow.adoptedStyleSheets = [dialogStyles];\n\n window.addEventListener('resize', this.#forceDialogCloseInDevToolsBound);\n this.#devtoolsMutationObserver.observe(this.#devToolsBoundingElement, {childList: true, subtree: true});\n this.#devToolsBoundingElement.addEventListener('wheel', this.#handleScrollAttemptBound);\n this.style.setProperty('--dialog-padding', '0');\n this.style.setProperty('--dialog-display', IS_DIALOG_SUPPORTED ? 'block' : 'none');\n this.style.setProperty('--override-dialog-content-border', `${CONNECTOR_HEIGHT}px solid transparent`);\n this.style.setProperty('--dialog-padding', `${DIALOG_VERTICAL_PADDING}px ${DIALOG_SIDE_PADDING}px`);\n }\n\n disconnectedCallback(): void {\n window.removeEventListener('resize', this.#forceDialogCloseInDevToolsBound);\n\n this.#devToolsBoundingElement.removeEventListener('wheel', this.#handleScrollAttemptBound);\n this.#devtoolsMutationObserver.disconnect();\n this.#dialogResizeObserver.disconnect();\n }\n\n #getDialog(): HTMLDialogElement {\n if (!this.#dialog) {\n this.#dialog = this.#shadow.querySelector('dialog');\n if (!this.#dialog) {\n throw new Error('Dialog not found');\n }\n this.#dialogResizeObserver.observe(this.#dialog);\n }\n return this.#dialog;\n }\n\n getHitArea(): DOMRect {\n return this.#hitArea;\n }\n\n async setDialogVisible(show: boolean): Promise {\n if (show) {\n await this.#showDialog();\n return;\n }\n this.#closeDialog();\n }\n\n async #handlePointerEvent(evt: MouseEvent|PointerEvent): Promise {\n evt.stopPropagation();\n // If the user uses the keyboard to interact with an element within the\n // dialog, it will trigger a pointer event (for example, the user might use\n // their spacebar to \"click\" on a form input element). In that case the\n // pointerType will be an empty string, rather than `mouse`, `pen` or\n // `touch`. In this instance, we early return, because we only need to\n // worry about clicks outside of the dialog. Once the dialog is open, the\n // user can only use the keyboard to navigate within the dialog; so we\n // don't have to concern ourselves with keyboard events that occur outside\n // the dialog's bounds.\n if (evt instanceof PointerEvent && evt.pointerType === '') {\n return;\n }\n\n const eventWasInDialogContent = this.#mouseEventWasInDialogContent(evt);\n const eventWasInHitArea = this.#mouseEventWasInHitArea(evt);\n if (eventWasInDialogContent) {\n return;\n }\n if (evt.type === 'pointermove') {\n if (eventWasInHitArea) {\n return;\n }\n this.dispatchEvent(new PointerLeftDialogEvent());\n return;\n }\n this.dispatchEvent(new ClickOutsideDialogEvent());\n }\n\n #mouseEventWasInDialogContent(evt: MouseEvent): boolean {\n const dialogBounds = this.#dialogClientRect;\n\n let animationOffSetValue = this.bestVerticalPosition === DialogVerticalPosition.BOTTOM ?\n DIALOG_ANIMATION_OFFSET :\n -1 * DIALOG_ANIMATION_OFFSET;\n if (this.#props.origin === MODAL) {\n // When shown as a modal, the dialog is not animated\n animationOffSetValue = 0;\n }\n const eventWasDialogContentX =\n evt.pageX >= dialogBounds.left && evt.pageX <= dialogBounds.left + dialogBounds.width;\n const eventWasDialogContentY = evt.pageY >= dialogBounds.top + animationOffSetValue &&\n evt.pageY <= dialogBounds.top + dialogBounds.height + animationOffSetValue;\n\n return eventWasDialogContentX && eventWasDialogContentY;\n }\n\n #mouseEventWasInHitArea(evt: MouseEvent): boolean {\n const hitAreaBounds = this.#hitArea;\n const eventWasInHitAreaX = evt.pageX >= hitAreaBounds.left && evt.pageX <= hitAreaBounds.left + hitAreaBounds.width;\n const eventWasInHitAreaY = evt.pageY >= hitAreaBounds.top && evt.pageY <= hitAreaBounds.top + hitAreaBounds.height;\n\n return eventWasInHitAreaX && eventWasInHitAreaY;\n }\n\n #getCoordinatesFromDialogOrigin(origin: DialogOrigin): AnchorBounds {\n if (!origin || origin === MODAL) {\n throw new Error('Dialog origin is null');\n }\n const anchor = origin instanceof Function ? origin() : origin;\n if (anchor instanceof DOMPoint) {\n return {top: anchor.y, bottom: anchor.y, left: anchor.x, right: anchor.x};\n }\n if (anchor instanceof HTMLElement) {\n return anchor.getBoundingClientRect();\n }\n return anchor;\n }\n\n #getBestHorizontalAlignment(anchorBounds: AnchorBounds, devtoolsBounds: DOMRect): DialogHorizontalAlignment {\n if (devtoolsBounds.right - anchorBounds.left > anchorBounds.right - devtoolsBounds.left) {\n return DialogHorizontalAlignment.LEFT;\n }\n return DialogHorizontalAlignment.RIGHT;\n }\n\n #getBestVerticalPosition(originBounds: AnchorBounds, dialogHeight: number, devtoolsBounds: DOMRect):\n DialogVerticalPosition {\n // If the dialog's full height doesn't fit at the bottom attempt to\n // position it at the top. If it doesn't fit at the top either\n // position it at the bottom and make the overflow scrollable.\n if (originBounds.bottom + dialogHeight > devtoolsBounds.height &&\n originBounds.top - dialogHeight > devtoolsBounds.top) {\n return DialogVerticalPosition.TOP;\n }\n return DialogVerticalPosition.BOTTOM;\n }\n\n #positionDialog(): void {\n if (!this.#props.origin) {\n return;\n }\n\n this.#isPendingShowDialog = true;\n void coordinator.read(() => {\n // Fixed elements are positioned relative to the window, regardless if\n // DevTools is docked. As such, if DevTools is docked we must account for\n // its offset relative to the window when positioning fixed elements.\n // DevTools' effective offset can be determined using\n // this.#devToolsBoundingElement.\n const devtoolsBounds = this.#devToolsBoundingElement.getBoundingClientRect();\n const devToolsWidth = devtoolsBounds.width;\n const devToolsHeight = devtoolsBounds.height;\n const devToolsLeft = devtoolsBounds.left;\n const devToolsTop = devtoolsBounds.top;\n const devToolsRight = devtoolsBounds.right;\n if (this.#props.origin === MODAL) {\n void coordinator.write(() => {\n this.style.setProperty('--dialog-top', `${devToolsTop}px`);\n this.style.setProperty('--dialog-left', `${devToolsLeft}px`);\n this.style.setProperty('--dialog-margin', 'auto');\n this.style.setProperty('--dialog-margin-left', 'auto');\n this.style.setProperty('--dialog-margin-bottom', 'auto');\n this.style.setProperty('--dialog-max-height', `${devToolsHeight - DIALOG_PADDING_FROM_WINDOW}px`);\n this.style.setProperty('--dialog-max-width', `${devToolsWidth - DIALOG_PADDING_FROM_WINDOW}px`);\n this.style.setProperty('--dialog-right', `${document.body.clientWidth - devToolsRight}px`);\n });\n return;\n }\n const anchor = this.#props.origin;\n const absoluteAnchorBounds = this.#getCoordinatesFromDialogOrigin(anchor);\n const {top: anchorTop, right: anchorRight, bottom: anchorBottom, left: anchorLeft} = absoluteAnchorBounds;\n const originCenterX = (anchorLeft + anchorRight) / 2;\n const hitAreaWidth = anchorRight - anchorLeft + CONNECTOR_HEIGHT;\n const windowWidth = document.body.clientWidth;\n const connectorFixedXValue =\n this.#props.getConnectorCustomXPosition ? this.#props.getConnectorCustomXPosition() : originCenterX;\n void coordinator.write(() => {\n this.style.setProperty('--dialog-top', '0');\n\n // Start by showing the dialog hidden to allow measuring its width.\n const dialog = this.#getDialog();\n dialog.style.visibility = 'hidden';\n if (this.#isPendingShowDialog && !dialog.hasAttribute('open')) {\n dialog.showModal();\n this.setAttribute('open', '');\n this.#isPendingShowDialog = false;\n }\n const {width: dialogWidth, height: dialogHeight} = dialog.getBoundingClientRect();\n this.#bestHorizontalAlignment = this.#props.horizontalAlignment === DialogHorizontalAlignment.AUTO ?\n this.#getBestHorizontalAlignment(absoluteAnchorBounds, devtoolsBounds) :\n this.#props.horizontalAlignment;\n\n this.#bestVerticalPositionInternal = this.#props.position === DialogVerticalPosition.AUTO ?\n this.#getBestVerticalPosition(absoluteAnchorBounds, dialogHeight, devtoolsBounds) :\n this.#props.position;\n if (this.#bestHorizontalAlignment === DialogHorizontalAlignment.AUTO ||\n this.#bestVerticalPositionInternal === DialogVerticalPosition.AUTO) {\n return;\n }\n this.#hitArea.height = anchorBottom - anchorTop + CONNECTOR_HEIGHT;\n this.#hitArea.width = hitAreaWidth;\n // If the connector is to be shown, the dialog needs a minimum width such that it covers\n // the connector's width.\n this.style.setProperty(\n '--content-min-width',\n `${connectorFixedXValue - anchorLeft + CONNECTOR_WIDTH + DIALOG_SIDE_PADDING * 2}px`);\n this.style.setProperty('--dialog-left', 'auto');\n this.style.setProperty('--dialog-right', 'auto');\n this.style.setProperty('--dialog-margin', '0');\n switch (this.#bestHorizontalAlignment) {\n case DialogHorizontalAlignment.LEFT: {\n // Position the dialog such that its left border is in line with that of its anchor.\n // If this means the dialog's left border is out of DevTools bounds, move it to the right.\n // Cap its width as needed so that the right border doesn't overflow.\n const dialogLeft = Math.max(anchorLeft, devToolsLeft);\n const devtoolsRightBorderToDialogLeft = devToolsRight - dialogLeft;\n const dialogMaxWidth = devtoolsRightBorderToDialogLeft - DIALOG_PADDING_FROM_WINDOW;\n this.style.setProperty('--dialog-left', `${dialogLeft}px`);\n this.#hitArea.x = anchorLeft;\n this.style.setProperty('--dialog-max-width', `${dialogMaxWidth}px`);\n break;\n }\n case DialogHorizontalAlignment.RIGHT: {\n // Position the dialog such that its right border is in line with that of its anchor.\n // If this means the dialog's right border is out of DevTools bounds, move it to the left.\n // Cap its width as needed so that the left border doesn't overflow.\n const windowRightBorderToAnchorRight = windowWidth - anchorRight;\n const windowRightBorderToDevToolsRight = windowWidth - devToolsRight;\n const windowRightBorderToDialogRight =\n Math.max(windowRightBorderToAnchorRight, windowRightBorderToDevToolsRight);\n\n const dialogRight = windowWidth - windowRightBorderToDialogRight;\n const devtoolsLeftBorderToDialogRight = dialogRight - devToolsLeft;\n const dialogMaxWidth = devtoolsLeftBorderToDialogRight - DIALOG_PADDING_FROM_WINDOW;\n\n this.#hitArea.x = windowWidth - windowRightBorderToDialogRight - hitAreaWidth;\n this.style.setProperty('--dialog-right', `${windowRightBorderToDialogRight}px`);\n this.style.setProperty('--dialog-max-width', `${dialogMaxWidth}px`);\n break;\n }\n case DialogHorizontalAlignment.CENTER: {\n // Position the dialog aligned with its anchor's center as long as its borders don't overlap\n // with those of DevTools. In case one border overlaps, move the dialog to the opposite side.\n // In case both borders overlap, reduce its width to that of DevTools.\n const dialogCappedWidth = Math.min(devToolsWidth - DIALOG_PADDING_FROM_WINDOW, dialogWidth);\n\n let dialogLeft = Math.max(originCenterX - dialogCappedWidth * 0.5, devToolsLeft);\n dialogLeft = Math.min(dialogLeft, devToolsRight - dialogCappedWidth);\n this.style.setProperty('--dialog-left', `${dialogLeft}px`);\n this.#hitArea.x = originCenterX - hitAreaWidth * 0.5;\n this.style.setProperty('--dialog-max-width', `${devToolsWidth - DIALOG_PADDING_FROM_WINDOW}px`);\n break;\n }\n default:\n Platform.assertNever(\n this.#bestHorizontalAlignment, `Unknown alignment type: ${this.#bestHorizontalAlignment}`);\n }\n\n switch (this.#bestVerticalPositionInternal) {\n case DialogVerticalPosition.TOP: {\n this.style.setProperty('--dialog-top', '0');\n this.style.setProperty('--dialog-margin', 'auto');\n this.style.setProperty('--dialog-margin-bottom', `${innerHeight - anchorTop}px`);\n this.#hitArea.y = anchorTop - CONNECTOR_HEIGHT;\n this.style.setProperty('--dialog-offset-y', `${DIALOG_ANIMATION_OFFSET}px`);\n this.style.setProperty(\n '--dialog-max-height', `${devToolsHeight - (innerHeight - anchorTop) - DIALOG_PADDING_FROM_WINDOW}px`);\n break;\n }\n case DialogVerticalPosition.BOTTOM: {\n this.style.setProperty('--dialog-top', `${anchorBottom}px`);\n this.#hitArea.y = anchorTop;\n this.style.setProperty('--dialog-offset-y', `-${DIALOG_ANIMATION_OFFSET}px`);\n this.style.setProperty(\n '--dialog-max-height',\n `${devToolsHeight - (anchorBottom - devToolsTop) - DIALOG_PADDING_FROM_WINDOW}px`);\n break;\n }\n default:\n Platform.assertNever(\n this.#bestVerticalPositionInternal, `Unknown position type: ${this.#bestVerticalPositionInternal}`);\n }\n\n dialog.close();\n dialog.style.visibility = '';\n });\n });\n }\n\n async #showDialog(): Promise {\n if (!IS_DIALOG_SUPPORTED) {\n return;\n }\n\n if (this.#isPendingShowDialog || this.hasAttribute('open')) {\n return;\n }\n this.#isPendingShowDialog = true;\n this.#positionDialog();\n // Allow the CSS variables to be set before showing.\n await coordinator.done();\n this.#isPendingShowDialog = false;\n const dialog = this.#getDialog();\n // Make the dialog visible now.\n if (!dialog.hasAttribute('open')) {\n dialog.showModal();\n }\n if (this.#props.dialogShownCallback) {\n await this.#props.dialogShownCallback();\n }\n this.#updateDialogBounds();\n document.body.addEventListener('keydown', this.#onKeyDownBound);\n }\n\n #handleScrollAttempt(event: WheelEvent): void {\n if (this.#mouseEventWasInDialogContent(event) || !this.#props.closeOnScroll ||\n !this.#getDialog().hasAttribute('open')) {\n return;\n }\n this.#closeDialog();\n this.dispatchEvent(new ForcedDialogClose());\n }\n\n #onKeyDown(event: KeyboardEvent): void {\n if (!this.#getDialog().hasAttribute('open') || !this.#props.closeOnESC) {\n return;\n }\n\n if (event.key !== Platform.KeyboardUtilities.ESCAPE_KEY) {\n return;\n }\n event.stopPropagation();\n event.preventDefault();\n this.#closeDialog();\n this.dispatchEvent(new ForcedDialogClose());\n }\n\n #onCancel(event: Event): void {\n event.stopPropagation();\n event.preventDefault();\n if (!this.#getDialog().hasAttribute('open') || !this.#props.closeOnESC) {\n return;\n }\n this.dispatchEvent(new ForcedDialogClose());\n }\n\n #forceDialogCloseInDevToolsMutation(): void {\n if (!this.#dialog?.hasAttribute('open')) {\n return;\n }\n if (this.#devToolsBoundingElement === document.body) {\n // Do not close if running in test environment.\n return;\n }\n this.#closeDialog();\n this.dispatchEvent(new ForcedDialogClose());\n }\n\n #closeDialog(): void {\n if (this.#isPendingCloseDialog || !this.#getDialog().hasAttribute('open')) {\n return;\n }\n this.#isPendingCloseDialog = true;\n void coordinator.write(() => {\n this.#hitArea.width = 0;\n this.removeAttribute('open');\n this.#getDialog().close();\n this.#isPendingCloseDialog = false;\n document.body.removeEventListener('keydown', this.#onKeyDownBound);\n });\n }\n\n getDialogBounds(): DOMRect {\n return this.#dialogClientRect;\n }\n\n #renderHeaderRow(): LitHtml.TemplateResult|null {\n // If the title is empty and close button is false, let's skip the header row.\n if (!this.#props.dialogTitle && !this.#props.closeButton) {\n return null;\n }\n // Disabled until https://crbug.com/1079231 is fixed.\n // clang-format off\n return html`\n ${this.#props.dialogTitle}\n ${this.#props.closeButton ? html`\n \n ` : LitHtml.nothing}\n `;\n // clang-format on\n }\n\n #render(): void {\n if (!ComponentHelpers.ScheduledRender.isScheduledRender(this)) {\n throw new Error('Dialog render was not scheduled');\n }\n\n if (!IS_DIALOG_SUPPORTED) {\n // To make sure that light dom content passed into this component doesn't show up,\n // we have to explicitly render a slot and hide it with CSS.\n LitHtml.render(\n // clang-format off\n html`\n \n `, this.#shadow, {host: this});\n // clang-format on\n return;\n }\n\n // clang-format off\n LitHtml.render(html`\n \n
\n
${this.#renderHeaderRow()}
\n
\n \n
\n
\n
\n `, this.#shadow, { host: this });\n VisualLogging.setMappedParent(this.#getDialog(), this.parentElementOrShadowHost() as HTMLElement);\n // clang-format on\n }\n}\n\ncustomElements.define('devtools-dialog', Dialog);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'devtools-dialog': Dialog;\n }\n}\n\nexport class PointerLeftDialogEvent extends Event {\n static readonly eventName = 'pointerleftdialog';\n\n constructor() {\n super(PointerLeftDialogEvent.eventName, {bubbles: true, composed: true});\n }\n}\n\nexport class ClickOutsideDialogEvent extends Event {\n static readonly eventName = 'clickoutsidedialog';\n\n constructor() {\n super(ClickOutsideDialogEvent.eventName, {bubbles: true, composed: true});\n }\n}\n\nexport class ForcedDialogClose extends Event {\n static readonly eventName = 'forceddialogclose';\n constructor() {\n super(ForcedDialogClose.eventName, {bubbles: true, composed: true});\n }\n}\n\nexport const enum DialogVerticalPosition {\n TOP = 'top',\n BOTTOM = 'bottom',\n AUTO = 'auto',\n}\n\nexport const enum DialogHorizontalAlignment {\n // Dialog and anchor are aligned on their left borders.\n LEFT = 'left',\n // Dialog and anchor are aligned on their right borders.\n RIGHT = 'right',\n CENTER = 'center',\n // This option allows to set the alignment\n // automatically to LEFT or RIGHT depending\n // on whether the dialog overflows the\n // viewport if it's aligned to the left.\n AUTO = 'auto',\n}\n\ntype AnchorBounds = {\n top: number,\n bottom: number,\n left: number,\n right: number,\n};\n"]} \ No newline at end of file +{"version":3,"file":"Dialog.js","sourceRoot":"","sources":["../../../../../../../front_end/ui/components/dialogs/Dialog.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,KAAK,IAAI,MAAM,4BAA4B,CAAC;AACnD,OAAO,KAAK,QAAQ,MAAM,oCAAoC,CAAC;AAC/D,OAAO,KAAK,mBAAmB,MAAM,kDAAkD,CAAC;AACxF,OAAO,KAAK,gBAAgB,MAAM,2CAA2C,CAAC;AAC9E,OAAO,KAAK,iBAAiB,MAAM,iE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right 2023 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport * as i18n from '../../../core/i18n/i18n.js';\nimport * as Platform from '../../../core/platform/platform.js';\nimport * as WindowBoundsService from '../../../services/window_bounds/window_bounds.js';\nimport * as ComponentHelpers from '../../../ui/components/helpers/helpers.js';\nimport * as RenderCoordinator from '../../../ui/components/render_coordinator/render_coordinator.js';\nimport * as LitHtml from '../../../ui/lit-html/lit-html.js';\nimport * as VisualLogging from '../../../ui/visual_logging/visual_logging.js';\nimport * as Buttons from '../buttons/buttons.js';\n\nimport dialogStyles from './dialog.css.js';\n\nconst {html} = LitHtml;\n\nconst UIStrings = {\n\n /**\n * @description Title of close button for the shortcuts dialog.\n */\n close: 'Close',\n};\n\nconst str_ = i18n.i18n.registerUIStrings('ui/components/dialogs/Dialog.ts', UIStrings);\nconst i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);\n\nconst IS_DIALOG_SUPPORTED = 'HTMLDialogElement' in globalThis;\n\n// Height in pixels of the dialog's connector. The connector is represented as\n// as a diamond and the height corresponds to half the height of the diamond.\n// (the visible height is only half of the diamond).\nexport const CONNECTOR_HEIGHT = 10;\nconst CONNECTOR_WIDTH = 2 * CONNECTOR_HEIGHT;\n\n// The offset used by the dialog's animation as it slides in when opened.\nconst DIALOG_ANIMATION_OFFSET = 20;\n\nexport const DIALOG_SIDE_PADDING = 5;\nexport const DIALOG_VERTICAL_PADDING = 3;\n\n// If the content of the dialog cannot be completely shown because otherwise\n// the dialog would overflow the window, the dialog's max width and height are\n// set such that the dialog remains inside the visible bounds. In this cases\n// some extra, determined by this constant, is added so that the dialog's borders\n// remain clearly visible. This constant accounts for the padding of the dialog's\n// content (20 px) and a 5px gap left on each extreme of the dialog from the viewport.\nexport const DIALOG_PADDING_FROM_WINDOW = 3 * CONNECTOR_HEIGHT;\ninterface DialogData {\n /**\n * Position or point the dialog is shown relative to.\n * If the dialog instance will be shown as a modal, set\n * this property to MODAL.\n */\n origin: DialogOrigin;\n position: DialogVerticalPosition;\n /**\n * Horizontal alignment of the dialog with respect to its origin.\n * Center by default.\n */\n horizontalAlignment: DialogHorizontalAlignment;\n /**\n * Optional function used to the determine the x coordinate of the connector's\n * end (tip of the triangle), relative to the viewport. If not defined, the x\n * coordinate of the origin's center is used instead.\n */\n getConnectorCustomXPosition: (() => number)|null;\n\n /**\n * Optional function called when the dialog is shown.\n */\n dialogShownCallback: (() => unknown)|null;\n\n /**\n * Optional. Service that provides the window dimensions used for positioning the Dialog.\n */\n windowBoundsService: WindowBoundsService.WindowBoundsService.WindowBoundsService;\n /**\n * Whether the dialog is closed when the 'Escape' key is pressed. When true, the event is\n * propagation is stopped.\n */\n closeOnESC: boolean;\n /**\n * Whether the dialog is closed when a scroll event is detected outside of the dialog's\n * content. Defaults to true.\n */\n closeOnScroll: boolean;\n /**\n * Whether render a closed button, when it is clicked, close the dialog. Defaults to false.\n */\n closeButton: boolean;\n /**\n * The string used in the header row of the dialog.\n */\n dialogTitle: string;\n /**\n * Specifies a context for the visual element.\n */\n jslogContext: string;\n}\n\ntype DialogAnchor = HTMLElement|DOMRect|DOMPoint;\n\nexport const MODAL = 'MODAL';\n\nexport type DialogOrigin = DialogAnchor|null|(() => DialogAnchor)|typeof MODAL;\nexport class Dialog extends HTMLElement {\n readonly #shadow = this.attachShadow({mode: 'open'});\n readonly #renderBound = this.#render.bind(this);\n readonly #forceDialogCloseInDevToolsBound = this.#forceDialogCloseInDevToolsMutation.bind(this);\n readonly #handleScrollAttemptBound = this.#handleScrollAttempt.bind(this);\n readonly #props: DialogData = {\n origin: MODAL,\n position: DialogVerticalPosition.BOTTOM,\n horizontalAlignment: DialogHorizontalAlignment.CENTER,\n getConnectorCustomXPosition: null,\n dialogShownCallback: null,\n windowBoundsService: WindowBoundsService.WindowBoundsService.WindowBoundsServiceImpl.instance(),\n closeOnESC: true,\n closeOnScroll: true,\n closeButton: false,\n dialogTitle: '',\n jslogContext: '',\n };\n\n #dialog: HTMLDialogElement|null = null;\n #isPendingShowDialog = false;\n #isPendingCloseDialog = false;\n #hitArea = new DOMRect(0, 0, 0, 0);\n #dialogClientRect = new DOMRect(0, 0, 0, 0);\n #bestVerticalPositionInternal: DialogVerticalPosition|null = null;\n #bestHorizontalAlignment: DialogHorizontalAlignment|null = null;\n readonly #devtoolsMutationObserver = new MutationObserver(this.#forceDialogCloseInDevToolsBound);\n readonly #dialogResizeObserver = new ResizeObserver(this.#updateDialogBounds.bind(this));\n #devToolsBoundingElement = this.windowBoundsService.getDevToolsBoundingElement();\n\n // We bind here because we have to listen to keydowns on the entire window,\n // not on the Dialog element itself. This is because if the user has the\n // dialog open, but their focus is elsewhere, and they hit ESC, we should\n // still close the dialog.\n #onKeyDownBound = this.#onKeyDown.bind(this);\n\n get origin(): DialogOrigin {\n return this.#props.origin;\n }\n\n set origin(origin: DialogOrigin) {\n this.#props.origin = origin;\n this.#onStateChange();\n }\n\n get position(): DialogVerticalPosition {\n return this.#props.position;\n }\n\n set position(position: DialogVerticalPosition) {\n this.#props.position = position;\n this.#onStateChange();\n }\n\n get horizontalAlignment(): DialogHorizontalAlignment {\n return this.#props.horizontalAlignment;\n }\n\n set horizontalAlignment(alignment: DialogHorizontalAlignment) {\n this.#props.horizontalAlignment = alignment;\n this.#onStateChange();\n }\n\n get windowBoundsService(): WindowBoundsService.WindowBoundsService.WindowBoundsService {\n return this.#props.windowBoundsService;\n }\n\n set windowBoundsService(windowBoundsService: WindowBoundsService.WindowBoundsService.WindowBoundsService) {\n this.#props.windowBoundsService = windowBoundsService;\n this.#devToolsBoundingElement = this.windowBoundsService.getDevToolsBoundingElement();\n this.#onStateChange();\n }\n\n get bestVerticalPosition(): DialogVerticalPosition|null {\n return this.#bestVerticalPositionInternal;\n }\n\n get bestHorizontalAlignment(): DialogHorizontalAlignment|null {\n return this.#bestHorizontalAlignment;\n }\n get getConnectorCustomXPosition(): (() => number)|null {\n return this.#props.getConnectorCustomXPosition;\n }\n\n set getConnectorCustomXPosition(connectorXPosition: (() => number)|null) {\n this.#props.getConnectorCustomXPosition = connectorXPosition;\n this.#onStateChange();\n }\n\n get dialogShownCallback(): (() => unknown)|null {\n return this.#props.dialogShownCallback;\n }\n\n get jslogContext(): string {\n return this.#props.jslogContext;\n }\n\n set dialogShownCallback(dialogShownCallback: (() => unknown)|null) {\n this.#props.dialogShownCallback = dialogShownCallback;\n this.#onStateChange();\n }\n\n set closeOnESC(closeOnESC: boolean) {\n this.#props.closeOnESC = closeOnESC;\n this.#onStateChange();\n }\n\n set closeOnScroll(closeOnScroll: boolean) {\n this.#props.closeOnScroll = closeOnScroll;\n this.#onStateChange();\n }\n\n set closeButton(closeButton: boolean) {\n this.#props.closeButton = closeButton;\n this.#onStateChange();\n }\n\n set dialogTitle(dialogTitle: string) {\n this.#props.dialogTitle = dialogTitle;\n this.#onStateChange();\n }\n\n set jslogContext(jslogContext: string) {\n this.#props.jslogContext = jslogContext;\n this.#onStateChange();\n }\n\n #updateDialogBounds(): void {\n this.#dialogClientRect = this.#getDialog().getBoundingClientRect();\n }\n\n #onStateChange(): void {\n void ComponentHelpers.ScheduledRender.scheduleRender(this, this.#renderBound);\n }\n\n connectedCallback(): void {\n this.#shadow.adoptedStyleSheets = [dialogStyles];\n\n window.addEventListener('resize', this.#forceDialogCloseInDevToolsBound);\n this.#devtoolsMutationObserver.observe(this.#devToolsBoundingElement, {childList: true, subtree: true});\n this.#devToolsBoundingElement.addEventListener('wheel', this.#handleScrollAttemptBound);\n this.style.setProperty('--dialog-padding', '0');\n this.style.setProperty('--dialog-display', IS_DIALOG_SUPPORTED ? 'block' : 'none');\n this.style.setProperty('--override-dialog-content-border', `${CONNECTOR_HEIGHT}px solid transparent`);\n this.style.setProperty('--dialog-padding', `${DIALOG_VERTICAL_PADDING}px ${DIALOG_SIDE_PADDING}px`);\n }\n\n disconnectedCallback(): void {\n window.removeEventListener('resize', this.#forceDialogCloseInDevToolsBound);\n\n this.#devToolsBoundingElement.removeEventListener('wheel', this.#handleScrollAttemptBound);\n this.#devtoolsMutationObserver.disconnect();\n this.#dialogResizeObserver.disconnect();\n }\n\n #getDialog(): HTMLDialogElement {\n if (!this.#dialog) {\n this.#dialog = this.#shadow.querySelector('dialog');\n if (!this.#dialog) {\n throw new Error('Dialog not found');\n }\n this.#dialogResizeObserver.observe(this.#dialog);\n }\n return this.#dialog;\n }\n\n getHitArea(): DOMRect {\n return this.#hitArea;\n }\n\n async setDialogVisible(show: boolean): Promise {\n if (show) {\n await this.#showDialog();\n return;\n }\n this.#closeDialog();\n }\n\n async #handlePointerEvent(evt: MouseEvent|PointerEvent): Promise {\n evt.stopPropagation();\n // If the user uses the keyboard to interact with an element within the\n // dialog, it will trigger a pointer event (for example, the user might use\n // their spacebar to \"click\" on a form input element). In that case the\n // pointerType will be an empty string, rather than `mouse`, `pen` or\n // `touch`. In this instance, we early return, because we only need to\n // worry about clicks outside of the dialog. Once the dialog is open, the\n // user can only use the keyboard to navigate within the dialog; so we\n // don't have to concern ourselves with keyboard events that occur outside\n // the dialog's bounds.\n if (evt instanceof PointerEvent && evt.pointerType === '') {\n return;\n }\n\n const eventWasInDialogContent = this.#mouseEventWasInDialogContent(evt);\n const eventWasInHitArea = this.#mouseEventWasInHitArea(evt);\n if (eventWasInDialogContent) {\n return;\n }\n if (evt.type === 'pointermove') {\n if (eventWasInHitArea) {\n return;\n }\n this.dispatchEvent(new PointerLeftDialogEvent());\n return;\n }\n this.dispatchEvent(new ClickOutsideDialogEvent());\n }\n\n #mouseEventWasInDialogContent(evt: MouseEvent): boolean {\n const dialogBounds = this.#dialogClientRect;\n\n let animationOffSetValue = this.bestVerticalPosition === DialogVerticalPosition.BOTTOM ?\n DIALOG_ANIMATION_OFFSET :\n -1 * DIALOG_ANIMATION_OFFSET;\n if (this.#props.origin === MODAL) {\n // When shown as a modal, the dialog is not animated\n animationOffSetValue = 0;\n }\n const eventWasDialogContentX =\n evt.pageX >= dialogBounds.left && evt.pageX <= dialogBounds.left + dialogBounds.width;\n const eventWasDialogContentY = evt.pageY >= dialogBounds.top + animationOffSetValue &&\n evt.pageY <= dialogBounds.top + dialogBounds.height + animationOffSetValue;\n\n return eventWasDialogContentX && eventWasDialogContentY;\n }\n\n #mouseEventWasInHitArea(evt: MouseEvent): boolean {\n const hitAreaBounds = this.#hitArea;\n const eventWasInHitAreaX = evt.pageX >= hitAreaBounds.left && evt.pageX <= hitAreaBounds.left + hitAreaBounds.width;\n const eventWasInHitAreaY = evt.pageY >= hitAreaBounds.top && evt.pageY <= hitAreaBounds.top + hitAreaBounds.height;\n\n return eventWasInHitAreaX && eventWasInHitAreaY;\n }\n\n #getCoordinatesFromDialogOrigin(origin: DialogOrigin): AnchorBounds {\n if (!origin || origin === MODAL) {\n throw new Error('Dialog origin is null');\n }\n const anchor = origin instanceof Function ? origin() : origin;\n if (anchor instanceof DOMPoint) {\n return {top: anchor.y, bottom: anchor.y, left: anchor.x, right: anchor.x};\n }\n if (anchor instanceof HTMLElement) {\n return anchor.getBoundingClientRect();\n }\n return anchor;\n }\n\n #getBestHorizontalAlignment(anchorBounds: AnchorBounds, devtoolsBounds: DOMRect): DialogHorizontalAlignment {\n if (devtoolsBounds.right - anchorBounds.left > anchorBounds.right - devtoolsBounds.left) {\n return DialogHorizontalAlignment.LEFT;\n }\n return DialogHorizontalAlignment.RIGHT;\n }\n\n #getBestVerticalPosition(originBounds: AnchorBounds, dialogHeight: number, devtoolsBounds: DOMRect):\n DialogVerticalPosition {\n // If the dialog's full height doesn't fit at the bottom attempt to\n // position it at the top. If it doesn't fit at the top either\n // position it at the bottom and make the overflow scrollable.\n if (originBounds.bottom + dialogHeight > devtoolsBounds.height &&\n originBounds.top - dialogHeight > devtoolsBounds.top) {\n return DialogVerticalPosition.TOP;\n }\n return DialogVerticalPosition.BOTTOM;\n }\n\n #positionDialog(): void {\n if (!this.#props.origin) {\n return;\n }\n\n this.#isPendingShowDialog = true;\n void RenderCoordinator.read(() => {\n // Fixed elements are positioned relative to the window, regardless if\n // DevTools is docked. As such, if DevTools is docked we must account for\n // its offset relative to the window when positioning fixed elements.\n // DevTools' effective offset can be determined using\n // this.#devToolsBoundingElement.\n const devtoolsBounds = this.#devToolsBoundingElement.getBoundingClientRect();\n const devToolsWidth = devtoolsBounds.width;\n const devToolsHeight = devtoolsBounds.height;\n const devToolsLeft = devtoolsBounds.left;\n const devToolsTop = devtoolsBounds.top;\n const devToolsRight = devtoolsBounds.right;\n if (this.#props.origin === MODAL) {\n void RenderCoordinator.write(() => {\n this.style.setProperty('--dialog-top', `${devToolsTop}px`);\n this.style.setProperty('--dialog-left', `${devToolsLeft}px`);\n this.style.setProperty('--dialog-margin', 'auto');\n this.style.setProperty('--dialog-margin-left', 'auto');\n this.style.setProperty('--dialog-margin-bottom', 'auto');\n this.style.setProperty('--dialog-max-height', `${devToolsHeight - DIALOG_PADDING_FROM_WINDOW}px`);\n this.style.setProperty('--dialog-max-width', `${devToolsWidth - DIALOG_PADDING_FROM_WINDOW}px`);\n this.style.setProperty('--dialog-right', `${document.body.clientWidth - devToolsRight}px`);\n });\n return;\n }\n const anchor = this.#props.origin;\n const absoluteAnchorBounds = this.#getCoordinatesFromDialogOrigin(anchor);\n const {top: anchorTop, right: anchorRight, bottom: anchorBottom, left: anchorLeft} = absoluteAnchorBounds;\n const originCenterX = (anchorLeft + anchorRight) / 2;\n const hitAreaWidth = anchorRight - anchorLeft + CONNECTOR_HEIGHT;\n const windowWidth = document.body.clientWidth;\n const connectorFixedXValue =\n this.#props.getConnectorCustomXPosition ? this.#props.getConnectorCustomXPosition() : originCenterX;\n void RenderCoordinator.write(() => {\n this.style.setProperty('--dialog-top', '0');\n\n // Start by showing the dialog hidden to allow measuring its width.\n const dialog = this.#getDialog();\n dialog.style.visibility = 'hidden';\n if (this.#isPendingShowDialog && !dialog.hasAttribute('open')) {\n dialog.showModal();\n this.setAttribute('open', '');\n this.#isPendingShowDialog = false;\n }\n const {width: dialogWidth, height: dialogHeight} = dialog.getBoundingClientRect();\n this.#bestHorizontalAlignment = this.#props.horizontalAlignment === DialogHorizontalAlignment.AUTO ?\n this.#getBestHorizontalAlignment(absoluteAnchorBounds, devtoolsBounds) :\n this.#props.horizontalAlignment;\n\n this.#bestVerticalPositionInternal = this.#props.position === DialogVerticalPosition.AUTO ?\n this.#getBestVerticalPosition(absoluteAnchorBounds, dialogHeight, devtoolsBounds) :\n this.#props.position;\n if (this.#bestHorizontalAlignment === DialogHorizontalAlignment.AUTO ||\n this.#bestVerticalPositionInternal === DialogVerticalPosition.AUTO) {\n return;\n }\n this.#hitArea.height = anchorBottom - anchorTop + CONNECTOR_HEIGHT;\n this.#hitArea.width = hitAreaWidth;\n // If the connector is to be shown, the dialog needs a minimum width such that it covers\n // the connector's width.\n this.style.setProperty(\n '--content-min-width',\n `${connectorFixedXValue - anchorLeft + CONNECTOR_WIDTH + DIALOG_SIDE_PADDING * 2}px`);\n this.style.setProperty('--dialog-left', 'auto');\n this.style.setProperty('--dialog-right', 'auto');\n this.style.setProperty('--dialog-margin', '0');\n switch (this.#bestHorizontalAlignment) {\n case DialogHorizontalAlignment.LEFT: {\n // Position the dialog such that its left border is in line with that of its anchor.\n // If this means the dialog's left border is out of DevTools bounds, move it to the right.\n // Cap its width as needed so that the right border doesn't overflow.\n const dialogLeft = Math.max(anchorLeft, devToolsLeft);\n const devtoolsRightBorderToDialogLeft = devToolsRight - dialogLeft;\n const dialogMaxWidth = devtoolsRightBorderToDialogLeft - DIALOG_PADDING_FROM_WINDOW;\n this.style.setProperty('--dialog-left', `${dialogLeft}px`);\n this.#hitArea.x = anchorLeft;\n this.style.setProperty('--dialog-max-width', `${dialogMaxWidth}px`);\n break;\n }\n case DialogHorizontalAlignment.RIGHT: {\n // Position the dialog such that its right border is in line with that of its anchor.\n // If this means the dialog's right border is out of DevTools bounds, move it to the left.\n // Cap its width as needed so that the left border doesn't overflow.\n const windowRightBorderToAnchorRight = windowWidth - anchorRight;\n const windowRightBorderToDevToolsRight = windowWidth - devToolsRight;\n const windowRightBorderToDialogRight =\n Math.max(windowRightBorderToAnchorRight, windowRightBorderToDevToolsRight);\n\n const dialogRight = windowWidth - windowRightBorderToDialogRight;\n const devtoolsLeftBorderToDialogRight = dialogRight - devToolsLeft;\n const dialogMaxWidth = devtoolsLeftBorderToDialogRight - DIALOG_PADDING_FROM_WINDOW;\n\n this.#hitArea.x = windowWidth - windowRightBorderToDialogRight - hitAreaWidth;\n this.style.setProperty('--dialog-right', `${windowRightBorderToDialogRight}px`);\n this.style.setProperty('--dialog-max-width', `${dialogMaxWidth}px`);\n break;\n }\n case DialogHorizontalAlignment.CENTER: {\n // Position the dialog aligned with its anchor's center as long as its borders don't overlap\n // with those of DevTools. In case one border overlaps, move the dialog to the opposite side.\n // In case both borders overlap, reduce its width to that of DevTools.\n const dialogCappedWidth = Math.min(devToolsWidth - DIALOG_PADDING_FROM_WINDOW, dialogWidth);\n\n let dialogLeft = Math.max(originCenterX - dialogCappedWidth * 0.5, devToolsLeft);\n dialogLeft = Math.min(dialogLeft, devToolsRight - dialogCappedWidth);\n this.style.setProperty('--dialog-left', `${dialogLeft}px`);\n this.#hitArea.x = originCenterX - hitAreaWidth * 0.5;\n this.style.setProperty('--dialog-max-width', `${devToolsWidth - DIALOG_PADDING_FROM_WINDOW}px`);\n break;\n }\n default:\n Platform.assertNever(\n this.#bestHorizontalAlignment, `Unknown alignment type: ${this.#bestHorizontalAlignment}`);\n }\n\n switch (this.#bestVerticalPositionInternal) {\n case DialogVerticalPosition.TOP: {\n this.style.setProperty('--dialog-top', '0');\n this.style.setProperty('--dialog-margin', 'auto');\n this.style.setProperty('--dialog-margin-bottom', `${innerHeight - anchorTop}px`);\n this.#hitArea.y = anchorTop - CONNECTOR_HEIGHT;\n this.style.setProperty('--dialog-offset-y', `${DIALOG_ANIMATION_OFFSET}px`);\n this.style.setProperty(\n '--dialog-max-height', `${devToolsHeight - (innerHeight - anchorTop) - DIALOG_PADDING_FROM_WINDOW}px`);\n break;\n }\n case DialogVerticalPosition.BOTTOM: {\n this.style.setProperty('--dialog-top', `${anchorBottom}px`);\n this.#hitArea.y = anchorTop;\n this.style.setProperty('--dialog-offset-y', `-${DIALOG_ANIMATION_OFFSET}px`);\n this.style.setProperty(\n '--dialog-max-height',\n `${devToolsHeight - (anchorBottom - devToolsTop) - DIALOG_PADDING_FROM_WINDOW}px`);\n break;\n }\n default:\n Platform.assertNever(\n this.#bestVerticalPositionInternal, `Unknown position type: ${this.#bestVerticalPositionInternal}`);\n }\n\n dialog.close();\n dialog.style.visibility = '';\n });\n });\n }\n\n async #showDialog(): Promise {\n if (!IS_DIALOG_SUPPORTED) {\n return;\n }\n\n if (this.#isPendingShowDialog || this.hasAttribute('open')) {\n return;\n }\n this.#isPendingShowDialog = true;\n this.#positionDialog();\n // Allow the CSS variables to be set before showing.\n await RenderCoordinator.done();\n this.#isPendingShowDialog = false;\n const dialog = this.#getDialog();\n // Make the dialog visible now.\n if (!dialog.hasAttribute('open')) {\n dialog.showModal();\n }\n if (this.#props.dialogShownCallback) {\n await this.#props.dialogShownCallback();\n }\n this.#updateDialogBounds();\n document.body.addEventListener('keydown', this.#onKeyDownBound);\n }\n\n #handleScrollAttempt(event: WheelEvent): void {\n if (this.#mouseEventWasInDialogContent(event) || !this.#props.closeOnScroll ||\n !this.#getDialog().hasAttribute('open')) {\n return;\n }\n this.#closeDialog();\n this.dispatchEvent(new ForcedDialogClose());\n }\n\n #onKeyDown(event: KeyboardEvent): void {\n if (!this.#getDialog().hasAttribute('open') || !this.#props.closeOnESC) {\n return;\n }\n\n if (event.key !== Platform.KeyboardUtilities.ESCAPE_KEY) {\n return;\n }\n event.stopPropagation();\n event.preventDefault();\n this.#closeDialog();\n this.dispatchEvent(new ForcedDialogClose());\n }\n\n #onCancel(event: Event): void {\n event.stopPropagation();\n event.preventDefault();\n if (!this.#getDialog().hasAttribute('open') || !this.#props.closeOnESC) {\n return;\n }\n this.dispatchEvent(new ForcedDialogClose());\n }\n\n #forceDialogCloseInDevToolsMutation(): void {\n if (!this.#dialog?.hasAttribute('open')) {\n return;\n }\n if (this.#devToolsBoundingElement === document.body) {\n // Do not close if running in test environment.\n return;\n }\n this.#closeDialog();\n this.dispatchEvent(new ForcedDialogClose());\n }\n\n #closeDialog(): void {\n if (this.#isPendingCloseDialog || !this.#getDialog().hasAttribute('open')) {\n return;\n }\n this.#isPendingCloseDialog = true;\n void RenderCoordinator.write(() => {\n this.#hitArea.width = 0;\n this.removeAttribute('open');\n this.#getDialog().close();\n this.#isPendingCloseDialog = false;\n document.body.removeEventListener('keydown', this.#onKeyDownBound);\n });\n }\n\n getDialogBounds(): DOMRect {\n return this.#dialogClientRect;\n }\n\n #renderHeaderRow(): LitHtml.TemplateResult|null {\n // If the title is empty and close button is false, let's skip the header row.\n if (!this.#props.dialogTitle && !this.#props.closeButton) {\n return null;\n }\n // Disabled until https://crbug.com/1079231 is fixed.\n // clang-format off\n return html`\n ${this.#props.dialogTitle}\n ${this.#props.closeButton ? html`\n \n ` : LitHtml.nothing}\n `;\n // clang-format on\n }\n\n #render(): void {\n if (!ComponentHelpers.ScheduledRender.isScheduledRender(this)) {\n throw new Error('Dialog render was not scheduled');\n }\n\n if (!IS_DIALOG_SUPPORTED) {\n // To make sure that light dom content passed into this component doesn't show up,\n // we have to explicitly render a slot and hide it with CSS.\n LitHtml.render(\n // clang-format off\n html`\n \n `, this.#shadow, {host: this});\n // clang-format on\n return;\n }\n\n // clang-format off\n LitHtml.render(html`\n \n
\n
${this.#renderHeaderRow()}
\n
\n \n
\n
\n
\n `, this.#shadow, { host: this });\n VisualLogging.setMappedParent(this.#getDialog(), this.parentElementOrShadowHost() as HTMLElement);\n // clang-format on\n }\n}\n\ncustomElements.define('devtools-dialog', Dialog);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'devtools-dialog': Dialog;\n }\n}\n\nexport class PointerLeftDialogEvent extends Event {\n static readonly eventName = 'pointerleftdialog';\n\n constructor() {\n super(PointerLeftDialogEvent.eventName, {bubbles: true, composed: true});\n }\n}\n\nexport class ClickOutsideDialogEvent extends Event {\n static readonly eventName = 'clickoutsidedialog';\n\n constructor() {\n super(ClickOutsideDialogEvent.eventName, {bubbles: true, composed: true});\n }\n}\n\nexport class ForcedDialogClose extends Event {\n static readonly eventName = 'forceddialogclose';\n constructor() {\n super(ForcedDialogClose.eventName, {bubbles: true, composed: true});\n }\n}\n\nexport const enum DialogVerticalPosition {\n TOP = 'top',\n BOTTOM = 'bottom',\n AUTO = 'auto',\n}\n\nexport const enum DialogHorizontalAlignment {\n // Dialog and anchor are aligned on their left borders.\n LEFT = 'left',\n // Dialog and anchor are aligned on their right borders.\n RIGHT = 'right',\n CENTER = 'center',\n // This option allows to set the alignment\n // automatically to LEFT or RIGHT depending\n // on whether the dialog overflows the\n // viewport if it's aligned to the left.\n AUTO = 'auto',\n}\n\ntype AnchorBounds = {\n top: number,\n bottom: number,\n left: number,\n right: number,\n};\n"]} \ No newline at end of file diff --git a/public/ui/components/dialogs/Dialog.test.js b/public/ui/components/dialogs/Dialog.test.js index c25de3c89..51e51df40 100644 --- a/public/ui/components/dialogs/Dialog.test.js +++ b/public/ui/components/dialogs/Dialog.test.js @@ -4,9 +4,8 @@ import * as Platform from '../../../core/platform/platform.js'; import * as Helpers from '../../../testing/DOMHelpers.js'; // eslint-disable-line rulesdir/es-modules-import import { describeWithLocale } from '../../../testing/EnvironmentHelpers.js'; -import * as Coordinator from '../render_coordinator/render_coordinator.js'; +import * as RenderCoordinator from '../render_coordinator/render_coordinator.js'; import * as Dialogs from './dialogs.js'; -const coordinator = Coordinator.RenderCoordinator.RenderCoordinator.instance(); class DialogExampleWindowBoundsServiceFactory { boundingElement; constructor(boundingElement) { @@ -42,9 +41,9 @@ describe('Dialog', () => { container.appendChild(host); container.appendChild(dialog); Helpers.renderElementIntoDOM(container); - await coordinator.done(); + await RenderCoordinator.done(); Helpers.dispatchClickEvent(host); - await coordinator.done(); + await RenderCoordinator.done(); const hostBounds = host.getBoundingClientRect(); const hitAreaBounds = dialog.getHitArea(); // Make sure the hit area contains the host fully. @@ -75,23 +74,23 @@ describe('Dialog', () => { container.appendChild(host); container.appendChild(dialog); Helpers.renderElementIntoDOM(container); - await coordinator.done(); + await RenderCoordinator.done(); // Open the dialog and check its position. Helpers.dispatchClickEvent(host); - await coordinator.done(); + await RenderCoordinator.done(); // Test the dialog is deployed left to right, since this way there is more space. assert.strictEqual(dialog.bestHorizontalAlignment, "left" /* Dialogs.Dialog.DialogHorizontalAlignment.LEFT */); // Close the dialog Helpers.dispatchKeyDownEvent(dialog, { key: Platform.KeyboardUtilities.ESCAPE_KEY, bubbles: true, composed: true }); - await coordinator.done(); + await RenderCoordinator.done(); // With the host in the right border of the window, the Dialog // should deploy from right to left (left horizontal alignment). host.style.position = 'relative'; host.style.left = '450px'; - await coordinator.done(); + await RenderCoordinator.done(); // Open the dialog and check its position. Helpers.dispatchClickEvent(host); - await coordinator.done(); + await RenderCoordinator.done(); // Test the dialog is deployed right to left. assert.strictEqual(dialog.bestHorizontalAlignment, "right" /* Dialogs.Dialog.DialogHorizontalAlignment.RIGHT */); }); @@ -122,10 +121,10 @@ describe('Dialog', () => { container.appendChild(host); container.appendChild(dialog); Helpers.renderElementIntoDOM(container); - await coordinator.done(); + await RenderCoordinator.done(); // Open the dialog and check its position. Helpers.dispatchClickEvent(host); - await coordinator.done(); + await RenderCoordinator.done(); // Test the capped dimensions assert.strictEqual(dialog.bestVerticalPosition, "top" /* Dialogs.Dialog.DialogVerticalPosition.TOP */); }); @@ -156,10 +155,10 @@ describe('Dialog', () => { container.appendChild(host); container.appendChild(dialog); Helpers.renderElementIntoDOM(container); - await coordinator.done(); + await RenderCoordinator.done(); // Open the dialog and check its position. Helpers.dispatchClickEvent(host); - await coordinator.done(); + await RenderCoordinator.done(); // Test the capped dimensions assert.strictEqual(dialog.bestVerticalPosition, "bottom" /* Dialogs.Dialog.DialogVerticalPosition.BOTTOM */); }); @@ -187,11 +186,11 @@ describe('Dialog', () => { container.appendChild(host); container.appendChild(devtoolsDialog); Helpers.renderElementIntoDOM(container); - await coordinator.done(); + await RenderCoordinator.done(); devtoolsDialog.appendChild(content); // Open the dialog and check its position. Helpers.dispatchClickEvent(host); - await coordinator.done(); + await RenderCoordinator.done(); const dialog = devtoolsDialog.shadowRoot?.querySelector('dialog'); if (!dialog) { assert.fail('Dialog not found'); @@ -239,14 +238,14 @@ describe('Dialog', () => { container.appendChild(host); container.appendChild(devtoolsDialog); Helpers.renderElementIntoDOM(container); - await coordinator.done(); + await RenderCoordinator.done(); devtoolsDialog.appendChild(content); }); it('sets the max width and height correctly when the dialog\'s content dimensions exceed the viewport and the dialog is anchored to the left', async () => { devtoolsDialog.horizontalAlignment = "left" /* Dialogs.Dialog.DialogHorizontalAlignment.LEFT */; // Open the dialog and check its position. Helpers.dispatchClickEvent(host); - await coordinator.done(); + await RenderCoordinator.done(); const dialog = devtoolsDialog.shadowRoot?.querySelector('dialog'); if (!dialog) { assert.fail('Dialog not found'); @@ -262,10 +261,10 @@ describe('Dialog', () => { }); it('sets the max width and height correctly when the dialog\'s content dimensions exceed the viewport and the dialog is anchored to the right', async () => { devtoolsDialog.horizontalAlignment = "right" /* Dialogs.Dialog.DialogHorizontalAlignment.RIGHT */; - await coordinator.done(); + await RenderCoordinator.done(); // Open the dialog and check its position. Helpers.dispatchClickEvent(host); - await coordinator.done(); + await RenderCoordinator.done(); const dialog = devtoolsDialog.shadowRoot?.querySelector('dialog'); if (!dialog) { assert.fail('Dialog not found'); @@ -280,10 +279,10 @@ describe('Dialog', () => { it('sets the dialog\'s horizontal position correctly to prevent overlap with DevTools when alinged to the left.', async () => { devtoolsDialog.horizontalAlignment = "left" /* Dialogs.Dialog.DialogHorizontalAlignment.LEFT */; host.style.left = '-10px'; - await coordinator.done(); + await RenderCoordinator.done(); // Open the dialog and check its position. Helpers.dispatchClickEvent(host); - await coordinator.done(); + await RenderCoordinator.done(); const dialog = devtoolsDialog.shadowRoot?.querySelector('dialog'); if (!dialog) { assert.fail('Dialog not found'); @@ -298,10 +297,10 @@ describe('Dialog', () => { devtoolsDialog.horizontalAlignment = "right" /* Dialogs.Dialog.DialogHorizontalAlignment.RIGHT */; const containerWidth = container.clientWidth; host.style.left = `${containerWidth + 10}px`; - await coordinator.done(); + await RenderCoordinator.done(); // Open the dialog and check its position. Helpers.dispatchClickEvent(host); - await coordinator.done(); + await RenderCoordinator.done(); const dialog = devtoolsDialog.shadowRoot?.querySelector('dialog'); if (!dialog) { assert.fail('Dialog not found'); @@ -315,10 +314,10 @@ describe('Dialog', () => { it('sets the dialog\'s horizontal position correctly to prevent overlapping with DevTools on the right when alinged to the center.', async () => { const containerWidth = container.clientWidth; host.style.left = `${containerWidth + 260}px`; - await coordinator.done(); + await RenderCoordinator.done(); // Open the dialog and check its position. Helpers.dispatchClickEvent(host); - await coordinator.done(); + await RenderCoordinator.done(); const dialog = devtoolsDialog.shadowRoot?.querySelector('dialog'); if (!dialog) { assert.fail('Dialog not found'); @@ -331,10 +330,10 @@ describe('Dialog', () => { }); it('sets the dialog\'s horizontal position correctly to prevent overlapping with DevTools on the left when alinged to the center.', async () => { host.style.left = '-260px'; - await coordinator.done(); + await RenderCoordinator.done(); // Open the dialog and check its position. Helpers.dispatchClickEvent(host); - await coordinator.done(); + await RenderCoordinator.done(); const dialog = devtoolsDialog.shadowRoot?.querySelector('dialog'); if (!dialog) { assert.fail('Dialog not found'); @@ -358,9 +357,9 @@ describe('Dialog', () => { container.appendChild(host); container.appendChild(dialog); Helpers.renderElementIntoDOM(container); - await coordinator.done(); + await RenderCoordinator.done(); Helpers.dispatchClickEvent(host); - await coordinator.done(); + await RenderCoordinator.done(); const initialWidth = dialog.getDialogBounds().width; const initialHeight = dialog.getDialogBounds().height; // Increase the font size to increase the dialog's dimensions @@ -387,11 +386,11 @@ describe('Dialog', () => { container.appendChild(host); container.appendChild(devtoolsDialog); Helpers.renderElementIntoDOM(container); - await coordinator.done(); + await RenderCoordinator.done(); devtoolsDialog.appendChild(content); // Open the dialog. Helpers.dispatchClickEvent(host); - await coordinator.done(); + await RenderCoordinator.done(); }); it('closes the dialog by default when the ESC key is pressed', async () => { let dialog = devtoolsDialog.shadowRoot?.querySelector('dialog[open]'); @@ -400,7 +399,7 @@ describe('Dialog', () => { return; } Helpers.dispatchKeyDownEvent(dialog, { key: Platform.KeyboardUtilities.ESCAPE_KEY, bubbles: true, composed: true }); - await coordinator.done(); + await RenderCoordinator.done(); dialog = devtoolsDialog.shadowRoot?.querySelector('dialog[open]'); if (dialog) { assert.fail('Dialog did not close'); @@ -414,7 +413,7 @@ describe('Dialog', () => { return; } Helpers.dispatchKeyDownEvent(document.body, { key: Platform.KeyboardUtilities.ESCAPE_KEY, bubbles: true, composed: true }); - await coordinator.done(); + await RenderCoordinator.done(); dialog = devtoolsDialog.shadowRoot?.querySelector('dialog[open]'); if (dialog) { assert.fail('Dialog did not close'); @@ -429,7 +428,7 @@ describe('Dialog', () => { } const boundingElement = devtoolsDialog.windowBoundsService.getDevToolsBoundingElement(); Helpers.dispatchKeyDownEvent(boundingElement, { key: Platform.KeyboardUtilities.ESCAPE_KEY, bubbles: true, composed: true }); - await coordinator.done(); + await RenderCoordinator.done(); dialog = devtoolsDialog.shadowRoot?.querySelector('dialog[open]'); if (dialog) { assert.fail('Dialog did not close'); @@ -444,7 +443,7 @@ describe('Dialog', () => { return; } Helpers.dispatchKeyDownEvent(dialog, { key: Platform.KeyboardUtilities.ESCAPE_KEY }); - await coordinator.done(); + await RenderCoordinator.done(); dialog = devtoolsDialog.shadowRoot?.querySelector('dialog[open]'); if (!dialog) { assert.fail('Dialog was closed'); @@ -458,7 +457,7 @@ describe('Dialog', () => { dialog.closeButton = false; dialog.dialogTitle = ''; Helpers.renderElementIntoDOM(dialog); - await coordinator.done(); + await RenderCoordinator.done(); assert.isNotNull(dialog.shadowRoot); const dialogHeader = dialog.shadowRoot.querySelector('.dialog-header'); assert.exists(dialogHeader); @@ -468,7 +467,7 @@ describe('Dialog', () => { const dialog = new Dialogs.Dialog.Dialog(); dialog.closeButton = true; Helpers.renderElementIntoDOM(dialog); - await coordinator.done(); + await RenderCoordinator.done(); assert.isNotNull(dialog.shadowRoot); const dialogHeader = dialog.shadowRoot.querySelector('.dialog-header'); assert.exists(dialogHeader); @@ -480,7 +479,7 @@ describe('Dialog', () => { const dialog = new Dialogs.Dialog.Dialog(); dialog.dialogTitle = dialogTitle; Helpers.renderElementIntoDOM(dialog); - await coordinator.done(); + await RenderCoordinator.done(); assert.isNotNull(dialog.shadowRoot); const dialogHeader = dialog.shadowRoot.querySelector('.dialog-header'); assert.exists(dialogHeader); @@ -504,11 +503,11 @@ describe('closing the dialog with click', () => { container.appendChild(host); container.appendChild(devtoolsDialog); Helpers.renderElementIntoDOM(container); - await coordinator.done(); + await RenderCoordinator.done(); devtoolsDialog.appendChild(content); // Open the dialog. Helpers.dispatchClickEvent(host); - await coordinator.done(); + await RenderCoordinator.done(); }); it('Only closes the dialog if the click falls outside its content', async () => { let dialog = devtoolsDialog.shadowRoot?.querySelector('dialog[open]'); @@ -519,14 +518,14 @@ describe('closing the dialog with click', () => { const { x, width, bottom } = dialog.getBoundingClientRect(); // Click just inside must not close the dialog. Helpers.dispatchClickEvent(dialog, { clientX: x + width / 2, clientY: bottom - 1 }); - await coordinator.done(); + await RenderCoordinator.done(); dialog = devtoolsDialog.shadowRoot?.querySelector('dialog[open]'); if (!dialog) { assert.fail('Dialog closed when it should not'); return; } Helpers.dispatchClickEvent(dialog, { clientX: x + width / 2, clientY: bottom + 1 }); - await coordinator.done(); + await RenderCoordinator.done(); // Click just outside must close the dialog. dialog = devtoolsDialog.shadowRoot?.querySelector('dialog[open]'); if (dialog) { diff --git a/public/ui/components/dialogs/Dialog.test.js.map b/public/ui/components/dialogs/Dialog.test.js.map index cab70490b..78d3f00db 100644 --- a/public/ui/components/dialogs/Dialog.test.js.map +++ b/public/ui/components/dialogs/Dialog.test.js.map @@ -1 +1 @@ -{"version":3,"file":"Dialog.test.js","sourceRoot":"","sources":["../../../../../../../front_end/ui/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AE,OAAO,EAAE,MAAM,GAAG,CAAC,EAAC,CAAC,CAAC;QAClF,MAAM,WAAW,CAAC,IAAI,EAAE,CAAC;QAEzB,4CAA4C;QAC5C,MAAM,GAAG,cAAc,CAAC,UAAU,EAAE,aAAa,CAAC,cAAc,CAAC,CAAC;QAClE,IAAI,MAAM,EAAE,CAAC;YACX,MAAM,CAAC,IAAI,CAAC,sBAAsB,CAAC,CAAC;YACpC,OAAO;QACT,CAAC;IACH,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["// Copyright 2023 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport * as Platform from '../../../core/platform/platform.js';\nimport type * as WindowBoundsService from '../../../services/window_bounds/window_bounds.js';\nimport * as Helpers from '../../../testing/DOMHelpers.js'; // eslint-disable-line rulesdir/es-modules-import\nimport {describeWithLocale} from '../../../testing/EnvironmentHelpers.js';\nimport * as Coordinator from '../render_coordinator/render_coordinator.js';\n\nimport * as Dialogs from './dialogs.js';\n\nconst coordinator = Coordinator.RenderCoordinator.RenderCoordinator.instance();\nclass DialogExampleWindowBoundsServiceFactory implements WindowBoundsService.WindowBoundsService.WindowBoundsService {\n constructor(private boundingElement: HTMLElement) {\n }\n getDevToolsBoundingElement(): HTMLElement {\n return this.boundingElement;\n }\n}\n\ndescribe('Dialog', () => {\n describe('positioning', () => {\n let dialog: Dialogs.Dialog.Dialog;\n let container: HTMLDivElement;\n let host: HTMLDivElement;\n beforeEach(() => {\n dialog = new Dialogs.Dialog.Dialog();\n container = document.createElement('div');\n container.style.width = '500px';\n container.style.height = '500px';\n container.style.display = 'flex';\n container.style.alignItems = 'center';\n container.style.justifyContent = 'center';\n\n host = document.createElement('div');\n host.textContent = 'Hover me';\n host.style.width = '100px';\n host.style.height = '100px';\n\n dialog.position = Dialogs.Dialog.DialogVerticalPosition.TOP;\n dialog.origin = host;\n });\n it('places the Dialog hit area correctly', async () => {\n host.addEventListener('click', () => dialog.setDialogVisible(true));\n dialog.addEventListener('clickoutsidedialog', () => dialog.setDialogVisible(false));\n\n container.appendChild(host);\n container.appendChild(dialog);\n Helpers.renderElementIntoDOM(container);\n await coordinator.done();\n\n Helpers.dispatchClickEvent(host);\n await coordinator.done();\n\n const hostBounds = host.getBoundingClientRect();\n const hitAreaBounds = dialog.getHitArea();\n\n // Make sure the hit area contains the host fully.\n assert.isAtMost(hitAreaBounds.top, hostBounds.top);\n assert.isAtLeast(hitAreaBounds.bottom, hostBounds.top + hostBounds.height);\n\n assert.isAtMost(hitAreaBounds.left, hostBounds.left);\n assert.isAtLeast(hitAreaBounds.right, hostBounds.left + hostBounds.width);\n });\n it('sets the automatic horizontal alignment correctly', async () => {\n // Create the container for the dialog and its origin (host).\n // This container will be set as the dialog's \"window\".\n // With the host in the left border of the window, the Dialog\n // should deploy from left to right (left horizontal alignment).\n container.style.display = 'block';\n host.style.position = 'relative';\n host.style.left = '0';\n\n const content = document.createElement('div');\n content.classList.add('dialog-content');\n content.style.padding = '0 1em';\n content.innerHTML = 'Hi';\n\n dialog.horizontalAlignment = Dialogs.Dialog.DialogHorizontalAlignment.AUTO;\n dialog.origin = host;\n\n // Set the dialog's \"window\" to be the container element we just created.\n dialog.windowBoundsService = new DialogExampleWindowBoundsServiceFactory(container);\n\n host.addEventListener('click', () => dialog.setDialogVisible(true));\n dialog.addEventListener('clickoutsidedialog', () => dialog.setDialogVisible(false));\n\n dialog.appendChild(content);\n container.appendChild(host);\n container.appendChild(dialog);\n Helpers.renderElementIntoDOM(container);\n await coordinator.done();\n\n // Open the dialog and check its position.\n Helpers.dispatchClickEvent(host);\n await coordinator.done();\n\n // Test the dialog is deployed left to right, since this way there is more space.\n assert.strictEqual(dialog.bestHorizontalAlignment, Dialogs.Dialog.DialogHorizontalAlignment.LEFT);\n\n // Close the dialog\n Helpers.dispatchKeyDownEvent(dialog, {key: Platform.KeyboardUtilities.ESCAPE_KEY, bubbles: true, composed: true});\n await coordinator.done();\n\n // With the host in the right border of the window, the Dialog\n // should deploy from right to left (left horizontal alignment).\n host.style.position = 'relative';\n host.style.left = '450px';\n await coordinator.done();\n\n // Open the dialog and check its position.\n Helpers.dispatchClickEvent(host);\n await coordinator.done();\n\n // Test the dialog is deployed right to left.\n assert.strictEqual(dialog.bestHorizontalAlignment, Dialogs.Dialog.DialogHorizontalAlignment.RIGHT);\n });\n\n it('sets the automatic vertical position correctly when it fits on top', async () => {\n // Create the container for the dialog and its origin (host), aligning\n // items to the bottom of the container. This container will be set as the\n // dialog's \"window\".\n // By default the dialog is placed at the bottom of its origin, but doing\n // so means it wouldn't fit in its window. Because if shown on top would\n // fit in its window it should be automatically positioned there.\n container.style.width = '150px';\n container.style.height = '300px';\n container.style.display = 'flex';\n container.style.alignItems = 'end';\n container.style.justifyContent = 'center';\n\n // The dialogs content dimensions exceed the viewport's\n const content = document.createElement('div');\n content.classList.add('dialog-content');\n content.style.padding = '0 1em';\n content.innerHTML = 'Hello, World
I am
a Dialog!';\n\n dialog.position = Dialogs.Dialog.DialogVerticalPosition.AUTO;\n dialog.origin = host;\n\n // Set the dialog's \"window\" to be the container element we just created.\n dialog.windowBoundsService = new DialogExampleWindowBoundsServiceFactory(container);\n\n host.addEventListener('click', () => dialog.setDialogVisible(true));\n dialog.addEventListener('clickoutsidedialog', () => dialog.setDialogVisible(false));\n\n dialog.appendChild(content);\n container.appendChild(host);\n container.appendChild(dialog);\n Helpers.renderElementIntoDOM(container);\n await coordinator.done();\n\n // Open the dialog and check its position.\n Helpers.dispatchClickEvent(host);\n await coordinator.done();\n\n // Test the capped dimensions\n assert.strictEqual(dialog.bestVerticalPosition, Dialogs.Dialog.DialogVerticalPosition.TOP);\n });\n\n it('sets the automatic vertical position correctly when it does not fit on top', async () => {\n // Create the container for the dialog and its origin (host), aligning\n // items to the bottom of the container. This container will be set as the\n // dialog's \"window\".\n // Because the dialog's full height cannot be fully fit at the\n // bottom or at the top it is positioned at the bottom and the\n // overflow made visible by scrolling.\n container.style.width = '150px';\n container.style.height = '80px';\n container.style.display = 'flex';\n container.style.alignItems = 'end';\n container.style.justifyContent = 'center';\n\n // The dialogs content dimensions exceed the viewport's\n const content = document.createElement('div');\n content.classList.add('dialog-content');\n content.style.padding = '0 1em';\n content.innerHTML = 'Hello, World
I am
a Dialog!';\n\n dialog.position = Dialogs.Dialog.DialogVerticalPosition.AUTO;\n dialog.origin = host;\n\n // Set the dialog's \"window\" to be the container element we just created.\n dialog.windowBoundsService = new DialogExampleWindowBoundsServiceFactory(container);\n\n host.addEventListener('click', () => dialog.setDialogVisible(true));\n dialog.addEventListener('clickoutsidedialog', () => dialog.setDialogVisible(false));\n\n dialog.appendChild(content);\n container.appendChild(host);\n container.appendChild(dialog);\n Helpers.renderElementIntoDOM(container);\n await coordinator.done();\n\n // Open the dialog and check its position.\n Helpers.dispatchClickEvent(host);\n await coordinator.done();\n\n // Test the capped dimensions\n assert.strictEqual(dialog.bestVerticalPosition, Dialogs.Dialog.DialogVerticalPosition.BOTTOM);\n });\n // Fails on bots https://crbug.com/1441801.\n it.skip(\n '[crbug.com/1441801]: sets the max width and height correctly when the dialog\\'s content dimensions exceed the viewport and the dialog is displayed as a modal',\n async () => {\n const devtoolsDialog = new Dialogs.Dialog.Dialog();\n const WINDOW_WIDTH = 500;\n // This container will be set as the dialog's \"window\", or the representation\n // of DevTools bounding element.\n container.style.width = `${WINDOW_WIDTH}px`;\n container.style.height = `${WINDOW_WIDTH}px`;\n const host = document.createElement('div');\n host.textContent = 'Hover me';\n host.style.width = '100px';\n\n const content = document.createElement('div');\n content.classList.add('dialog-content');\n content.style.width = '600px';\n content.style.height = '600px';\n content.innerHTML = 'Hello, World
I am
a Dialog!';\n\n devtoolsDialog.origin = Dialogs.Dialog.MODAL;\n\n // Set the dialog's \"window\" to be the container element we just created.\n devtoolsDialog.windowBoundsService = new DialogExampleWindowBoundsServiceFactory(container);\n\n host.addEventListener('click', () => devtoolsDialog.setDialogVisible(true));\n devtoolsDialog.addEventListener('clickoutsidedialog', () => devtoolsDialog.setDialogVisible(false));\n\n container.appendChild(host);\n container.appendChild(devtoolsDialog);\n Helpers.renderElementIntoDOM(container);\n await coordinator.done();\n devtoolsDialog.appendChild(content);\n\n // Open the dialog and check its position.\n Helpers.dispatchClickEvent(host);\n await coordinator.done();\n const dialog = devtoolsDialog.shadowRoot?.querySelector('dialog');\n if (!dialog) {\n assert.fail('Dialog not found');\n return;\n }\n assert.strictEqual(\n dialog.clientWidth,\n WINDOW_WIDTH - Dialogs.Dialog.DIALOG_PADDING_FROM_WINDOW + 2 * Dialogs.Dialog.DIALOG_SIDE_PADDING);\n assert.strictEqual(\n dialog.clientHeight,\n WINDOW_WIDTH - Dialogs.Dialog.DIALOG_PADDING_FROM_WINDOW + 2 * Dialogs.Dialog.DIALOG_VERTICAL_PADDING);\n });\n describe('with an anchor and possible overflow', () => {\n const CONTAINER_WIDTH = 500;\n const CONTAINER_HEIGHT = 500;\n const HOST_OFFSET = 100;\n const HOST_HEIGHT = 100;\n const devtoolsDialog = new Dialogs.Dialog.Dialog();\n let host: HTMLElement;\n let container: HTMLElement;\n beforeEach(async () => {\n // This container will be set as the dialog's \"window\", or the representation\n // of DevTools bounding element.\n container = document.createElement('div');\n container.style.width = `${CONTAINER_WIDTH}px`;\n container.style.height = `${CONTAINER_HEIGHT}px`;\n container.style.position = 'fixed';\n container.style.top = '0';\n container.style.left = '0';\n\n host = document.createElement('div');\n host.textContent = 'Click me';\n host.style.width = `${HOST_HEIGHT}px`;\n host.style.height = `${HOST_HEIGHT}px`;\n host.style.position = 'absolute';\n host.style.top = `${HOST_OFFSET}px`;\n host.style.left = `${HOST_OFFSET}px`;\n\n // The dialogs content dimensions exceed the container's\n const content = document.createElement('div');\n content.classList.add('dialog-content');\n content.style.width = '600px';\n content.style.height = '600px';\n content.innerHTML = 'Hello, World
I am
a Dialog!';\n\n devtoolsDialog.origin = host;\n devtoolsDialog.horizontalAlignment = Dialogs.Dialog.DialogHorizontalAlignment.CENTER;\n\n // Set the dialog's \"window\" to be the container element we just created.\n devtoolsDialog.windowBoundsService = new DialogExampleWindowBoundsServiceFactory(container);\n\n host.addEventListener('click', () => devtoolsDialog.setDialogVisible(true));\n devtoolsDialog.addEventListener('clickoutsidedialog', () => devtoolsDialog.setDialogVisible(false));\n\n container.appendChild(host);\n container.appendChild(devtoolsDialog);\n Helpers.renderElementIntoDOM(container);\n await coordinator.done();\n devtoolsDialog.appendChild(content);\n });\n it('sets the max width and height correctly when the dialog\\'s content dimensions exceed the viewport and the dialog is anchored to the left',\n async () => {\n devtoolsDialog.horizontalAlignment = Dialogs.Dialog.DialogHorizontalAlignment.LEFT;\n // Open the dialog and check its position.\n Helpers.dispatchClickEvent(host);\n await coordinator.done();\n const dialog = devtoolsDialog.shadowRoot?.querySelector('dialog');\n if (!dialog) {\n assert.fail('Dialog not found');\n return;\n }\n // Test the capped dimensions\n const {left: dialogLeft, width: dialogWidth} = dialog.getBoundingClientRect();\n const dialogLeftBorderLimitPosition = dialogWidth + dialogLeft + Dialogs.Dialog.DIALOG_PADDING_FROM_WINDOW -\n 2 * Dialogs.Dialog.DIALOG_SIDE_PADDING;\n assert.strictEqual(dialogLeftBorderLimitPosition, CONTAINER_WIDTH);\n assert.strictEqual(\n dialog.clientHeight,\n CONTAINER_HEIGHT - Dialogs.Dialog.DIALOG_PADDING_FROM_WINDOW - HOST_HEIGHT - HOST_OFFSET +\n 2 * Dialogs.Dialog.DIALOG_VERTICAL_PADDING);\n });\n it('sets the max width and height correctly when the dialog\\'s content dimensions exceed the viewport and the dialog is anchored to the right',\n async () => {\n devtoolsDialog.horizontalAlignment = Dialogs.Dialog.DialogHorizontalAlignment.RIGHT;\n await coordinator.done();\n // Open the dialog and check its position.\n Helpers.dispatchClickEvent(host);\n await coordinator.done();\n const dialog = devtoolsDialog.shadowRoot?.querySelector('dialog');\n if (!dialog) {\n assert.fail('Dialog not found');\n return;\n }\n // Test the capped dimensions\n const dialogRight = host.getBoundingClientRect().right;\n const containerLeft = container.getBoundingClientRect().left;\n assert.strictEqual(\n dialog.clientWidth,\n (dialogRight - containerLeft) - Dialogs.Dialog.DIALOG_PADDING_FROM_WINDOW +\n 2 * Dialogs.Dialog.DIALOG_SIDE_PADDING);\n });\n it('sets the dialog\\'s horizontal position correctly to prevent overlap with DevTools when alinged to the left.',\n async () => {\n devtoolsDialog.horizontalAlignment = Dialogs.Dialog.DialogHorizontalAlignment.LEFT;\n host.style.left = '-10px';\n\n await coordinator.done();\n // Open the dialog and check its position.\n Helpers.dispatchClickEvent(host);\n await coordinator.done();\n const dialog = devtoolsDialog.shadowRoot?.querySelector('dialog');\n if (!dialog) {\n assert.fail('Dialog not found');\n return;\n }\n // Test the capped dimensions\n const dialogLeft = dialog.getBoundingClientRect().left;\n const containerLeft = container.getBoundingClientRect().left;\n assert.isAtLeast(dialogLeft, containerLeft);\n });\n it('sets the dialog\\'s horizontal position correctly to prevent overlap with DevTools when alinged to the right.',\n async () => {\n devtoolsDialog.horizontalAlignment = Dialogs.Dialog.DialogHorizontalAlignment.RIGHT;\n const containerWidth = container.clientWidth;\n host.style.left = `${containerWidth + 10}px`;\n\n await coordinator.done();\n // Open the dialog and check its position.\n Helpers.dispatchClickEvent(host);\n await coordinator.done();\n const dialog = devtoolsDialog.shadowRoot?.querySelector('dialog');\n if (!dialog) {\n assert.fail('Dialog not found');\n return;\n }\n // Test the capped dimensions\n const dialogRight = dialog.getBoundingClientRect().right;\n const dialogRightEdgePosition =\n dialogRight - 2 * Dialogs.Dialog.DIALOG_SIDE_PADDING - Dialogs.Dialog.DIALOG_PADDING_FROM_WINDOW / 2;\n assert.isAtMost(dialogRightEdgePosition, containerWidth);\n });\n it('sets the dialog\\'s horizontal position correctly to prevent overlapping with DevTools on the right when alinged to the center.',\n async () => {\n const containerWidth = container.clientWidth;\n host.style.left = `${containerWidth + 260}px`;\n\n await coordinator.done();\n // Open the dialog and check its position.\n Helpers.dispatchClickEvent(host);\n await coordinator.done();\n const dialog = devtoolsDialog.shadowRoot?.querySelector('dialog');\n if (!dialog) {\n assert.fail('Dialog not found');\n return;\n }\n // Test the capped dimensions\n const dialogRight = dialog.getBoundingClientRect().right;\n const dialogRightEdgePosition =\n dialogRight - 2 * Dialogs.Dialog.DIALOG_SIDE_PADDING - Dialogs.Dialog.DIALOG_PADDING_FROM_WINDOW / 2;\n\n assert.isAtMost(dialogRightEdgePosition, containerWidth);\n });\n it('sets the dialog\\'s horizontal position correctly to prevent overlapping with DevTools on the left when alinged to the center.',\n async () => {\n host.style.left = '-260px';\n\n await coordinator.done();\n // Open the dialog and check its position.\n Helpers.dispatchClickEvent(host);\n await coordinator.done();\n const dialog = devtoolsDialog.shadowRoot?.querySelector('dialog');\n if (!dialog) {\n assert.fail('Dialog not found');\n return;\n }\n // Test the capped dimensions\n const containerLeft = container.getBoundingClientRect().left;\n const dialogLeft = dialog.getBoundingClientRect().left;\n\n assert.isAtLeast(dialogLeft, containerLeft);\n });\n });\n\n it('updates the dialog client rect automatically when its dimensions change', async function() {\n host.addEventListener('click', () => dialog.setDialogVisible(true));\n const dialogContent = document.createElement('div');\n dialogContent.style.display = 'block';\n dialogContent.style.minWidth = '10px';\n dialogContent.style.minHeight = '10px';\n dialogContent.style.fontSize = '10px';\n dialogContent.innerText = 'Hello';\n\n dialog.append(dialogContent);\n container.appendChild(host);\n container.appendChild(dialog);\n Helpers.renderElementIntoDOM(container);\n await coordinator.done();\n\n Helpers.dispatchClickEvent(host);\n await coordinator.done();\n\n const initialWidth = dialog.getDialogBounds().width;\n const initialHeight = dialog.getDialogBounds().height;\n\n // Increase the font size to increase the dialog's dimensions\n dialogContent.style.fontSize = '200px';\n\n // Wait for the resize handling to take effect.\n await new Promise(res => setTimeout(res, 200));\n\n const finalWidth = dialog.getDialogBounds().width;\n const finalHeight = dialog.getDialogBounds().height;\n\n assert.isAbove(finalWidth, initialWidth);\n assert.isAbove(finalHeight, initialHeight);\n });\n });\n\n describe('closing the dialog with the ESC key', () => {\n let devtoolsDialog: Dialogs.Dialog.Dialog;\n beforeEach(async () => {\n devtoolsDialog = new Dialogs.Dialog.Dialog();\n const container = document.createElement('div');\n\n const host = document.createElement('div');\n\n const content = document.createElement('div');\n content.innerHTML = 'Hello, World
I am
a Dialog!';\n\n devtoolsDialog.origin = host;\n\n host.addEventListener('click', () => devtoolsDialog.setDialogVisible(true));\n devtoolsDialog.addEventListener('clickoutsidedialog', () => devtoolsDialog.setDialogVisible(false));\n\n container.appendChild(host);\n container.appendChild(devtoolsDialog);\n Helpers.renderElementIntoDOM(container);\n await coordinator.done();\n devtoolsDialog.appendChild(content);\n\n // Open the dialog.\n Helpers.dispatchClickEvent(host);\n await coordinator.done();\n });\n\n it('closes the dialog by default when the ESC key is pressed', async () => {\n let dialog = devtoolsDialog.shadowRoot?.querySelector('dialog[open]');\n if (!dialog) {\n assert.fail('Dialog not found');\n return;\n }\n\n Helpers.dispatchKeyDownEvent(dialog, {key: Platform.KeyboardUtilities.ESCAPE_KEY, bubbles: true, composed: true});\n await coordinator.done();\n dialog = devtoolsDialog.shadowRoot?.querySelector('dialog[open]');\n if (dialog) {\n assert.fail('Dialog did not close');\n return;\n }\n });\n\n it('closes the dialog by default when the ESC key is pressed from document.body', async () => {\n let dialog = devtoolsDialog.shadowRoot?.querySelector('dialog[open]');\n if (!dialog) {\n assert.fail('Dialog not found');\n return;\n }\n Helpers.dispatchKeyDownEvent(\n document.body, {key: Platform.KeyboardUtilities.ESCAPE_KEY, bubbles: true, composed: true});\n await coordinator.done();\n dialog = devtoolsDialog.shadowRoot?.querySelector('dialog[open]');\n if (dialog) {\n assert.fail('Dialog did not close');\n return;\n }\n });\n\n it('closes the dialog by default when the ESC key is pressed anywhere within the devtools bounding element',\n async () => {\n let dialog = devtoolsDialog.shadowRoot?.querySelector('dialog[open]');\n if (!dialog) {\n assert.fail('Dialog not found');\n return;\n }\n\n const boundingElement = devtoolsDialog.windowBoundsService.getDevToolsBoundingElement();\n Helpers.dispatchKeyDownEvent(\n boundingElement, {key: Platform.KeyboardUtilities.ESCAPE_KEY, bubbles: true, composed: true});\n await coordinator.done();\n dialog = devtoolsDialog.shadowRoot?.querySelector('dialog[open]');\n if (dialog) {\n assert.fail('Dialog did not close');\n return;\n }\n });\n\n it('does not close the dialog when the ESC key is pressed if the closeOnESC prop is set to false', async () => {\n let dialog = devtoolsDialog.shadowRoot?.querySelector('dialog[open]');\n devtoolsDialog.closeOnESC = false;\n if (!dialog) {\n assert.fail('Dialog not found');\n return;\n }\n\n Helpers.dispatchKeyDownEvent(dialog, {key: Platform.KeyboardUtilities.ESCAPE_KEY});\n await coordinator.done();\n dialog = devtoolsDialog.shadowRoot?.querySelector('dialog[open]');\n if (!dialog) {\n assert.fail('Dialog was closed');\n return;\n }\n });\n });\n\n describeWithLocale('rendering', () => {\n it('do not render dialog header line if title is empty and there is no close button', async () => {\n const dialog = new Dialogs.Dialog.Dialog();\n dialog.closeButton = false;\n dialog.dialogTitle = '';\n Helpers.renderElementIntoDOM(dialog);\n await coordinator.done();\n\n assert.isNotNull(dialog.shadowRoot);\n const dialogHeader = dialog.shadowRoot.querySelector('.dialog-header');\n assert.exists(dialogHeader);\n assert.isEmpty(dialogHeader.children);\n });\n\n it('should render a close button in the dialog if closeButton is true', async () => {\n const dialog = new Dialogs.Dialog.Dialog();\n dialog.closeButton = true;\n Helpers.renderElementIntoDOM(dialog);\n await coordinator.done();\n\n assert.isNotNull(dialog.shadowRoot);\n const dialogHeader = dialog.shadowRoot.querySelector('.dialog-header');\n assert.exists(dialogHeader);\n const closeButton = dialogHeader.querySelector('devtools-button');\n assert.exists(closeButton);\n });\n\n it('should render dialog title if it is not empty', async () => {\n const dialogTitle = 'Button dialog example';\n const dialog = new Dialogs.Dialog.Dialog();\n dialog.dialogTitle = dialogTitle;\n Helpers.renderElementIntoDOM(dialog);\n await coordinator.done();\n\n assert.isNotNull(dialog.shadowRoot);\n const dialogHeader = dialog.shadowRoot.querySelector('.dialog-header');\n assert.exists(dialogHeader);\n const dialogTitleElement = dialogHeader.querySelector('.dialog-header-text');\n assert.exists(dialogTitleElement);\n assert.strictEqual(dialogTitleElement.textContent, dialogTitle);\n });\n });\n});\n\ndescribe('closing the dialog with click', () => {\n let devtoolsDialog: Dialogs.Dialog.Dialog;\n beforeEach(async () => {\n devtoolsDialog = new Dialogs.Dialog.Dialog();\n const container = document.createElement('div');\n\n const host = document.createElement('div');\n\n const content = document.createElement('div');\n content.innerHTML = 'Hello, World
I am
a Dialog!';\n\n devtoolsDialog.origin = Dialogs.Dialog.MODAL;\n\n host.addEventListener('click', () => devtoolsDialog.setDialogVisible(true));\n devtoolsDialog.addEventListener('clickoutsidedialog', () => devtoolsDialog.setDialogVisible(false));\n\n container.appendChild(host);\n container.appendChild(devtoolsDialog);\n Helpers.renderElementIntoDOM(container);\n await coordinator.done();\n devtoolsDialog.appendChild(content);\n\n // Open the dialog.\n Helpers.dispatchClickEvent(host);\n await coordinator.done();\n });\n\n it('Only closes the dialog if the click falls outside its content', async () => {\n let dialog = devtoolsDialog.shadowRoot?.querySelector('dialog[open]');\n if (!dialog) {\n assert.fail('Dialog not found');\n return;\n }\n const {x, width, bottom} = dialog.getBoundingClientRect();\n\n // Click just inside must not close the dialog.\n Helpers.dispatchClickEvent(dialog, {clientX: x + width / 2, clientY: bottom - 1});\n await coordinator.done();\n dialog = devtoolsDialog.shadowRoot?.querySelector('dialog[open]');\n if (!dialog) {\n assert.fail('Dialog closed when it should not');\n return;\n }\n Helpers.dispatchClickEvent(dialog, {clientX: x + width / 2, clientY: bottom + 1});\n await coordinator.done();\n\n // Click just outside must close the dialog.\n dialog = devtoolsDialog.shadowRoot?.querySelector('dialog[open]');\n if (dialog) {\n assert.fail('Dialog did not close');\n return;\n }\n });\n});\n"]} \ No newline at end of file +{"version":3,"file":"Dialog.test.js","sourceRoot":"","sources":["../../../../../../../front_end/ui/components/dialogs/Dialog.test.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,KAAK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iBAAiB,CAAC,IAAI,EAAE,CAAC;QAE/B,4CAA4C;QAC5C,MAAM,GAAG,cAAc,CAAC,UAAU,EAAE,aAAa,CAAC,cAAc,CAAC,CAAC;QAClE,IAAI,MAAM,EAAE,CAAC;YACX,MAAM,CAAC,IAAI,CAAC,sBAAsB,CAAC,CAAC;YACpC,OAAO;QACT,CAAC;IACH,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["// Copyright 2023 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport * as Platform from '../../../core/platform/platform.js';\nimport type * as WindowBoundsService from '../../../services/window_bounds/window_bounds.js';\nimport * as Helpers from '../../../testing/DOMHelpers.js'; // eslint-disable-line rulesdir/es-modules-import\nimport {describeWithLocale} from '../../../testing/EnvironmentHelpers.js';\nimport * as RenderCoordinator from '../render_coordinator/render_coordinator.js';\n\nimport * as Dialogs from './dialogs.js';\n\nclass DialogExampleWindowBoundsServiceFactory implements WindowBoundsService.WindowBoundsService.WindowBoundsService {\n constructor(private boundingElement: HTMLElement) {\n }\n getDevToolsBoundingElement(): HTMLElement {\n return this.boundingElement;\n }\n}\n\ndescribe('Dialog', () => {\n describe('positioning', () => {\n let dialog: Dialogs.Dialog.Dialog;\n let container: HTMLDivElement;\n let host: HTMLDivElement;\n beforeEach(() => {\n dialog = new Dialogs.Dialog.Dialog();\n container = document.createElement('div');\n container.style.width = '500px';\n container.style.height = '500px';\n container.style.display = 'flex';\n container.style.alignItems = 'center';\n container.style.justifyContent = 'center';\n\n host = document.createElement('div');\n host.textContent = 'Hover me';\n host.style.width = '100px';\n host.style.height = '100px';\n\n dialog.position = Dialogs.Dialog.DialogVerticalPosition.TOP;\n dialog.origin = host;\n });\n it('places the Dialog hit area correctly', async () => {\n host.addEventListener('click', () => dialog.setDialogVisible(true));\n dialog.addEventListener('clickoutsidedialog', () => dialog.setDialogVisible(false));\n\n container.appendChild(host);\n container.appendChild(dialog);\n Helpers.renderElementIntoDOM(container);\n await RenderCoordinator.done();\n\n Helpers.dispatchClickEvent(host);\n await RenderCoordinator.done();\n\n const hostBounds = host.getBoundingClientRect();\n const hitAreaBounds = dialog.getHitArea();\n\n // Make sure the hit area contains the host fully.\n assert.isAtMost(hitAreaBounds.top, hostBounds.top);\n assert.isAtLeast(hitAreaBounds.bottom, hostBounds.top + hostBounds.height);\n\n assert.isAtMost(hitAreaBounds.left, hostBounds.left);\n assert.isAtLeast(hitAreaBounds.right, hostBounds.left + hostBounds.width);\n });\n it('sets the automatic horizontal alignment correctly', async () => {\n // Create the container for the dialog and its origin (host).\n // This container will be set as the dialog's \"window\".\n // With the host in the left border of the window, the Dialog\n // should deploy from left to right (left horizontal alignment).\n container.style.display = 'block';\n host.style.position = 'relative';\n host.style.left = '0';\n\n const content = document.createElement('div');\n content.classList.add('dialog-content');\n content.style.padding = '0 1em';\n content.innerHTML = 'Hi';\n\n dialog.horizontalAlignment = Dialogs.Dialog.DialogHorizontalAlignment.AUTO;\n dialog.origin = host;\n\n // Set the dialog's \"window\" to be the container element we just created.\n dialog.windowBoundsService = new DialogExampleWindowBoundsServiceFactory(container);\n\n host.addEventListener('click', () => dialog.setDialogVisible(true));\n dialog.addEventListener('clickoutsidedialog', () => dialog.setDialogVisible(false));\n\n dialog.appendChild(content);\n container.appendChild(host);\n container.appendChild(dialog);\n Helpers.renderElementIntoDOM(container);\n await RenderCoordinator.done();\n\n // Open the dialog and check its position.\n Helpers.dispatchClickEvent(host);\n await RenderCoordinator.done();\n\n // Test the dialog is deployed left to right, since this way there is more space.\n assert.strictEqual(dialog.bestHorizontalAlignment, Dialogs.Dialog.DialogHorizontalAlignment.LEFT);\n\n // Close the dialog\n Helpers.dispatchKeyDownEvent(dialog, {key: Platform.KeyboardUtilities.ESCAPE_KEY, bubbles: true, composed: true});\n await RenderCoordinator.done();\n\n // With the host in the right border of the window, the Dialog\n // should deploy from right to left (left horizontal alignment).\n host.style.position = 'relative';\n host.style.left = '450px';\n await RenderCoordinator.done();\n\n // Open the dialog and check its position.\n Helpers.dispatchClickEvent(host);\n await RenderCoordinator.done();\n\n // Test the dialog is deployed right to left.\n assert.strictEqual(dialog.bestHorizontalAlignment, Dialogs.Dialog.DialogHorizontalAlignment.RIGHT);\n });\n\n it('sets the automatic vertical position correctly when it fits on top', async () => {\n // Create the container for the dialog and its origin (host), aligning\n // items to the bottom of the container. This container will be set as the\n // dialog's \"window\".\n // By default the dialog is placed at the bottom of its origin, but doing\n // so means it wouldn't fit in its window. Because if shown on top would\n // fit in its window it should be automatically positioned there.\n container.style.width = '150px';\n container.style.height = '300px';\n container.style.display = 'flex';\n container.style.alignItems = 'end';\n container.style.justifyContent = 'center';\n\n // The dialogs content dimensions exceed the viewport's\n const content = document.createElement('div');\n content.classList.add('dialog-content');\n content.style.padding = '0 1em';\n content.innerHTML = 'Hello, World
I am
a Dialog!';\n\n dialog.position = Dialogs.Dialog.DialogVerticalPosition.AUTO;\n dialog.origin = host;\n\n // Set the dialog's \"window\" to be the container element we just created.\n dialog.windowBoundsService = new DialogExampleWindowBoundsServiceFactory(container);\n\n host.addEventListener('click', () => dialog.setDialogVisible(true));\n dialog.addEventListener('clickoutsidedialog', () => dialog.setDialogVisible(false));\n\n dialog.appendChild(content);\n container.appendChild(host);\n container.appendChild(dialog);\n Helpers.renderElementIntoDOM(container);\n await RenderCoordinator.done();\n\n // Open the dialog and check its position.\n Helpers.dispatchClickEvent(host);\n await RenderCoordinator.done();\n\n // Test the capped dimensions\n assert.strictEqual(dialog.bestVerticalPosition, Dialogs.Dialog.DialogVerticalPosition.TOP);\n });\n\n it('sets the automatic vertical position correctly when it does not fit on top', async () => {\n // Create the container for the dialog and its origin (host), aligning\n // items to the bottom of the container. This container will be set as the\n // dialog's \"window\".\n // Because the dialog's full height cannot be fully fit at the\n // bottom or at the top it is positioned at the bottom and the\n // overflow made visible by scrolling.\n container.style.width = '150px';\n container.style.height = '80px';\n container.style.display = 'flex';\n container.style.alignItems = 'end';\n container.style.justifyContent = 'center';\n\n // The dialogs content dimensions exceed the viewport's\n const content = document.createElement('div');\n content.classList.add('dialog-content');\n content.style.padding = '0 1em';\n content.innerHTML = 'Hello, World
I am
a Dialog!';\n\n dialog.position = Dialogs.Dialog.DialogVerticalPosition.AUTO;\n dialog.origin = host;\n\n // Set the dialog's \"window\" to be the container element we just created.\n dialog.windowBoundsService = new DialogExampleWindowBoundsServiceFactory(container);\n\n host.addEventListener('click', () => dialog.setDialogVisible(true));\n dialog.addEventListener('clickoutsidedialog', () => dialog.setDialogVisible(false));\n\n dialog.appendChild(content);\n container.appendChild(host);\n container.appendChild(dialog);\n Helpers.renderElementIntoDOM(container);\n await RenderCoordinator.done();\n\n // Open the dialog and check its position.\n Helpers.dispatchClickEvent(host);\n await RenderCoordinator.done();\n\n // Test the capped dimensions\n assert.strictEqual(dialog.bestVerticalPosition, Dialogs.Dialog.DialogVerticalPosition.BOTTOM);\n });\n // Fails on bots https://crbug.com/1441801.\n it.skip(\n '[crbug.com/1441801]: sets the max width and height correctly when the dialog\\'s content dimensions exceed the viewport and the dialog is displayed as a modal',\n async () => {\n const devtoolsDialog = new Dialogs.Dialog.Dialog();\n const WINDOW_WIDTH = 500;\n // This container will be set as the dialog's \"window\", or the representation\n // of DevTools bounding element.\n container.style.width = `${WINDOW_WIDTH}px`;\n container.style.height = `${WINDOW_WIDTH}px`;\n const host = document.createElement('div');\n host.textContent = 'Hover me';\n host.style.width = '100px';\n\n const content = document.createElement('div');\n content.classList.add('dialog-content');\n content.style.width = '600px';\n content.style.height = '600px';\n content.innerHTML = 'Hello, World
I am
a Dialog!';\n\n devtoolsDialog.origin = Dialogs.Dialog.MODAL;\n\n // Set the dialog's \"window\" to be the container element we just created.\n devtoolsDialog.windowBoundsService = new DialogExampleWindowBoundsServiceFactory(container);\n\n host.addEventListener('click', () => devtoolsDialog.setDialogVisible(true));\n devtoolsDialog.addEventListener('clickoutsidedialog', () => devtoolsDialog.setDialogVisible(false));\n\n container.appendChild(host);\n container.appendChild(devtoolsDialog);\n Helpers.renderElementIntoDOM(container);\n await RenderCoordinator.done();\n devtoolsDialog.appendChild(content);\n\n // Open the dialog and check its position.\n Helpers.dispatchClickEvent(host);\n await RenderCoordinator.done();\n const dialog = devtoolsDialog.shadowRoot?.querySelector('dialog');\n if (!dialog) {\n assert.fail('Dialog not found');\n return;\n }\n assert.strictEqual(\n dialog.clientWidth,\n WINDOW_WIDTH - Dialogs.Dialog.DIALOG_PADDING_FROM_WINDOW + 2 * Dialogs.Dialog.DIALOG_SIDE_PADDING);\n assert.strictEqual(\n dialog.clientHeight,\n WINDOW_WIDTH - Dialogs.Dialog.DIALOG_PADDING_FROM_WINDOW + 2 * Dialogs.Dialog.DIALOG_VERTICAL_PADDING);\n });\n describe('with an anchor and possible overflow', () => {\n const CONTAINER_WIDTH = 500;\n const CONTAINER_HEIGHT = 500;\n const HOST_OFFSET = 100;\n const HOST_HEIGHT = 100;\n const devtoolsDialog = new Dialogs.Dialog.Dialog();\n let host: HTMLElement;\n let container: HTMLElement;\n beforeEach(async () => {\n // This container will be set as the dialog's \"window\", or the representation\n // of DevTools bounding element.\n container = document.createElement('div');\n container.style.width = `${CONTAINER_WIDTH}px`;\n container.style.height = `${CONTAINER_HEIGHT}px`;\n container.style.position = 'fixed';\n container.style.top = '0';\n container.style.left = '0';\n\n host = document.createElement('div');\n host.textContent = 'Click me';\n host.style.width = `${HOST_HEIGHT}px`;\n host.style.height = `${HOST_HEIGHT}px`;\n host.style.position = 'absolute';\n host.style.top = `${HOST_OFFSET}px`;\n host.style.left = `${HOST_OFFSET}px`;\n\n // The dialogs content dimensions exceed the container's\n const content = document.createElement('div');\n content.classList.add('dialog-content');\n content.style.width = '600px';\n content.style.height = '600px';\n content.innerHTML = 'Hello, World
I am
a Dialog!';\n\n devtoolsDialog.origin = host;\n devtoolsDialog.horizontalAlignment = Dialogs.Dialog.DialogHorizontalAlignment.CENTER;\n\n // Set the dialog's \"window\" to be the container element we just created.\n devtoolsDialog.windowBoundsService = new DialogExampleWindowBoundsServiceFactory(container);\n\n host.addEventListener('click', () => devtoolsDialog.setDialogVisible(true));\n devtoolsDialog.addEventListener('clickoutsidedialog', () => devtoolsDialog.setDialogVisible(false));\n\n container.appendChild(host);\n container.appendChild(devtoolsDialog);\n Helpers.renderElementIntoDOM(container);\n await RenderCoordinator.done();\n devtoolsDialog.appendChild(content);\n });\n it('sets the max width and height correctly when the dialog\\'s content dimensions exceed the viewport and the dialog is anchored to the left',\n async () => {\n devtoolsDialog.horizontalAlignment = Dialogs.Dialog.DialogHorizontalAlignment.LEFT;\n // Open the dialog and check its position.\n Helpers.dispatchClickEvent(host);\n await RenderCoordinator.done();\n const dialog = devtoolsDialog.shadowRoot?.querySelector('dialog');\n if (!dialog) {\n assert.fail('Dialog not found');\n return;\n }\n // Test the capped dimensions\n const {left: dialogLeft, width: dialogWidth} = dialog.getBoundingClientRect();\n const dialogLeftBorderLimitPosition = dialogWidth + dialogLeft + Dialogs.Dialog.DIALOG_PADDING_FROM_WINDOW -\n 2 * Dialogs.Dialog.DIALOG_SIDE_PADDING;\n assert.strictEqual(dialogLeftBorderLimitPosition, CONTAINER_WIDTH);\n assert.strictEqual(\n dialog.clientHeight,\n CONTAINER_HEIGHT - Dialogs.Dialog.DIALOG_PADDING_FROM_WINDOW - HOST_HEIGHT - HOST_OFFSET +\n 2 * Dialogs.Dialog.DIALOG_VERTICAL_PADDING);\n });\n it('sets the max width and height correctly when the dialog\\'s content dimensions exceed the viewport and the dialog is anchored to the right',\n async () => {\n devtoolsDialog.horizontalAlignment = Dialogs.Dialog.DialogHorizontalAlignment.RIGHT;\n await RenderCoordinator.done();\n // Open the dialog and check its position.\n Helpers.dispatchClickEvent(host);\n await RenderCoordinator.done();\n const dialog = devtoolsDialog.shadowRoot?.querySelector('dialog');\n if (!dialog) {\n assert.fail('Dialog not found');\n return;\n }\n // Test the capped dimensions\n const dialogRight = host.getBoundingClientRect().right;\n const containerLeft = container.getBoundingClientRect().left;\n assert.strictEqual(\n dialog.clientWidth,\n (dialogRight - containerLeft) - Dialogs.Dialog.DIALOG_PADDING_FROM_WINDOW +\n 2 * Dialogs.Dialog.DIALOG_SIDE_PADDING);\n });\n it('sets the dialog\\'s horizontal position correctly to prevent overlap with DevTools when alinged to the left.',\n async () => {\n devtoolsDialog.horizontalAlignment = Dialogs.Dialog.DialogHorizontalAlignment.LEFT;\n host.style.left = '-10px';\n\n await RenderCoordinator.done();\n // Open the dialog and check its position.\n Helpers.dispatchClickEvent(host);\n await RenderCoordinator.done();\n const dialog = devtoolsDialog.shadowRoot?.querySelector('dialog');\n if (!dialog) {\n assert.fail('Dialog not found');\n return;\n }\n // Test the capped dimensions\n const dialogLeft = dialog.getBoundingClientRect().left;\n const containerLeft = container.getBoundingClientRect().left;\n assert.isAtLeast(dialogLeft, containerLeft);\n });\n it('sets the dialog\\'s horizontal position correctly to prevent overlap with DevTools when alinged to the right.',\n async () => {\n devtoolsDialog.horizontalAlignment = Dialogs.Dialog.DialogHorizontalAlignment.RIGHT;\n const containerWidth = container.clientWidth;\n host.style.left = `${containerWidth + 10}px`;\n\n await RenderCoordinator.done();\n // Open the dialog and check its position.\n Helpers.dispatchClickEvent(host);\n await RenderCoordinator.done();\n const dialog = devtoolsDialog.shadowRoot?.querySelector('dialog');\n if (!dialog) {\n assert.fail('Dialog not found');\n return;\n }\n // Test the capped dimensions\n const dialogRight = dialog.getBoundingClientRect().right;\n const dialogRightEdgePosition =\n dialogRight - 2 * Dialogs.Dialog.DIALOG_SIDE_PADDING - Dialogs.Dialog.DIALOG_PADDING_FROM_WINDOW / 2;\n assert.isAtMost(dialogRightEdgePosition, containerWidth);\n });\n it('sets the dialog\\'s horizontal position correctly to prevent overlapping with DevTools on the right when alinged to the center.',\n async () => {\n const containerWidth = container.clientWidth;\n host.style.left = `${containerWidth + 260}px`;\n\n await RenderCoordinator.done();\n // Open the dialog and check its position.\n Helpers.dispatchClickEvent(host);\n await RenderCoordinator.done();\n const dialog = devtoolsDialog.shadowRoot?.querySelector('dialog');\n if (!dialog) {\n assert.fail('Dialog not found');\n return;\n }\n // Test the capped dimensions\n const dialogRight = dialog.getBoundingClientRect().right;\n const dialogRightEdgePosition =\n dialogRight - 2 * Dialogs.Dialog.DIALOG_SIDE_PADDING - Dialogs.Dialog.DIALOG_PADDING_FROM_WINDOW / 2;\n\n assert.isAtMost(dialogRightEdgePosition, containerWidth);\n });\n it('sets the dialog\\'s horizontal position correctly to prevent overlapping with DevTools on the left when alinged to the center.',\n async () => {\n host.style.left = '-260px';\n\n await RenderCoordinator.done();\n // Open the dialog and check its position.\n Helpers.dispatchClickEvent(host);\n await RenderCoordinator.done();\n const dialog = devtoolsDialog.shadowRoot?.querySelector('dialog');\n if (!dialog) {\n assert.fail('Dialog not found');\n return;\n }\n // Test the capped dimensions\n const containerLeft = container.getBoundingClientRect().left;\n const dialogLeft = dialog.getBoundingClientRect().left;\n\n assert.isAtLeast(dialogLeft, containerLeft);\n });\n });\n\n it('updates the dialog client rect automatically when its dimensions change', async function() {\n host.addEventListener('click', () => dialog.setDialogVisible(true));\n const dialogContent = document.createElement('div');\n dialogContent.style.display = 'block';\n dialogContent.style.minWidth = '10px';\n dialogContent.style.minHeight = '10px';\n dialogContent.style.fontSize = '10px';\n dialogContent.innerText = 'Hello';\n\n dialog.append(dialogContent);\n container.appendChild(host);\n container.appendChild(dialog);\n Helpers.renderElementIntoDOM(container);\n await RenderCoordinator.done();\n\n Helpers.dispatchClickEvent(host);\n await RenderCoordinator.done();\n\n const initialWidth = dialog.getDialogBounds().width;\n const initialHeight = dialog.getDialogBounds().height;\n\n // Increase the font size to increase the dialog's dimensions\n dialogContent.style.fontSize = '200px';\n\n // Wait for the resize handling to take effect.\n await new Promise(res => setTimeout(res, 200));\n\n const finalWidth = dialog.getDialogBounds().width;\n const finalHeight = dialog.getDialogBounds().height;\n\n assert.isAbove(finalWidth, initialWidth);\n assert.isAbove(finalHeight, initialHeight);\n });\n });\n\n describe('closing the dialog with the ESC key', () => {\n let devtoolsDialog: Dialogs.Dialog.Dialog;\n beforeEach(async () => {\n devtoolsDialog = new Dialogs.Dialog.Dialog();\n const container = document.createElement('div');\n\n const host = document.createElement('div');\n\n const content = document.createElement('div');\n content.innerHTML = 'Hello, World
I am
a Dialog!';\n\n devtoolsDialog.origin = host;\n\n host.addEventListener('click', () => devtoolsDialog.setDialogVisible(true));\n devtoolsDialog.addEventListener('clickoutsidedialog', () => devtoolsDialog.setDialogVisible(false));\n\n container.appendChild(host);\n container.appendChild(devtoolsDialog);\n Helpers.renderElementIntoDOM(container);\n await RenderCoordinator.done();\n devtoolsDialog.appendChild(content);\n\n // Open the dialog.\n Helpers.dispatchClickEvent(host);\n await RenderCoordinator.done();\n });\n\n it('closes the dialog by default when the ESC key is pressed', async () => {\n let dialog = devtoolsDialog.shadowRoot?.querySelector('dialog[open]');\n if (!dialog) {\n assert.fail('Dialog not found');\n return;\n }\n\n Helpers.dispatchKeyDownEvent(dialog, {key: Platform.KeyboardUtilities.ESCAPE_KEY, bubbles: true, composed: true});\n await RenderCoordinator.done();\n dialog = devtoolsDialog.shadowRoot?.querySelector('dialog[open]');\n if (dialog) {\n assert.fail('Dialog did not close');\n return;\n }\n });\n\n it('closes the dialog by default when the ESC key is pressed from document.body', async () => {\n let dialog = devtoolsDialog.shadowRoot?.querySelector('dialog[open]');\n if (!dialog) {\n assert.fail('Dialog not found');\n return;\n }\n Helpers.dispatchKeyDownEvent(\n document.body, {key: Platform.KeyboardUtilities.ESCAPE_KEY, bubbles: true, composed: true});\n await RenderCoordinator.done();\n dialog = devtoolsDialog.shadowRoot?.querySelector('dialog[open]');\n if (dialog) {\n assert.fail('Dialog did not close');\n return;\n }\n });\n\n it('closes the dialog by default when the ESC key is pressed anywhere within the devtools bounding element',\n async () => {\n let dialog = devtoolsDialog.shadowRoot?.querySelector('dialog[open]');\n if (!dialog) {\n assert.fail('Dialog not found');\n return;\n }\n\n const boundingElement = devtoolsDialog.windowBoundsService.getDevToolsBoundingElement();\n Helpers.dispatchKeyDownEvent(\n boundingElement, {key: Platform.KeyboardUtilities.ESCAPE_KEY, bubbles: true, composed: true});\n await RenderCoordinator.done();\n dialog = devtoolsDialog.shadowRoot?.querySelector('dialog[open]');\n if (dialog) {\n assert.fail('Dialog did not close');\n return;\n }\n });\n\n it('does not close the dialog when the ESC key is pressed if the closeOnESC prop is set to false', async () => {\n let dialog = devtoolsDialog.shadowRoot?.querySelector('dialog[open]');\n devtoolsDialog.closeOnESC = false;\n if (!dialog) {\n assert.fail('Dialog not found');\n return;\n }\n\n Helpers.dispatchKeyDownEvent(dialog, {key: Platform.KeyboardUtilities.ESCAPE_KEY});\n await RenderCoordinator.done();\n dialog = devtoolsDialog.shadowRoot?.querySelector('dialog[open]');\n if (!dialog) {\n assert.fail('Dialog was closed');\n return;\n }\n });\n });\n\n describeWithLocale('rendering', () => {\n it('do not render dialog header line if title is empty and there is no close button', async () => {\n const dialog = new Dialogs.Dialog.Dialog();\n dialog.closeButton = false;\n dialog.dialogTitle = '';\n Helpers.renderElementIntoDOM(dialog);\n await RenderCoordinator.done();\n\n assert.isNotNull(dialog.shadowRoot);\n const dialogHeader = dialog.shadowRoot.querySelector('.dialog-header');\n assert.exists(dialogHeader);\n assert.isEmpty(dialogHeader.children);\n });\n\n it('should render a close button in the dialog if closeButton is true', async () => {\n const dialog = new Dialogs.Dialog.Dialog();\n dialog.closeButton = true;\n Helpers.renderElementIntoDOM(dialog);\n await RenderCoordinator.done();\n\n assert.isNotNull(dialog.shadowRoot);\n const dialogHeader = dialog.shadowRoot.querySelector('.dialog-header');\n assert.exists(dialogHeader);\n const closeButton = dialogHeader.querySelector('devtools-button');\n assert.exists(closeButton);\n });\n\n it('should render dialog title if it is not empty', async () => {\n const dialogTitle = 'Button dialog example';\n const dialog = new Dialogs.Dialog.Dialog();\n dialog.dialogTitle = dialogTitle;\n Helpers.renderElementIntoDOM(dialog);\n await RenderCoordinator.done();\n\n assert.isNotNull(dialog.shadowRoot);\n const dialogHeader = dialog.shadowRoot.querySelector('.dialog-header');\n assert.exists(dialogHeader);\n const dialogTitleElement = dialogHeader.querySelector('.dialog-header-text');\n assert.exists(dialogTitleElement);\n assert.strictEqual(dialogTitleElement.textContent, dialogTitle);\n });\n });\n});\n\ndescribe('closing the dialog with click', () => {\n let devtoolsDialog: Dialogs.Dialog.Dialog;\n beforeEach(async () => {\n devtoolsDialog = new Dialogs.Dialog.Dialog();\n const container = document.createElement('div');\n\n const host = document.createElement('div');\n\n const content = document.createElement('div');\n content.innerHTML = 'Hello, World
I am
a Dialog!';\n\n devtoolsDialog.origin = Dialogs.Dialog.MODAL;\n\n host.addEventListener('click', () => devtoolsDialog.setDialogVisible(true));\n devtoolsDialog.addEventListener('clickoutsidedialog', () => devtoolsDialog.setDialogVisible(false));\n\n container.appendChild(host);\n container.appendChild(devtoolsDialog);\n Helpers.renderElementIntoDOM(container);\n await RenderCoordinator.done();\n devtoolsDialog.appendChild(content);\n\n // Open the dialog.\n Helpers.dispatchClickEvent(host);\n await RenderCoordinator.done();\n });\n\n it('Only closes the dialog if the click falls outside its content', async () => {\n let dialog = devtoolsDialog.shadowRoot?.querySelector('dialog[open]');\n if (!dialog) {\n assert.fail('Dialog not found');\n return;\n }\n const {x, width, bottom} = dialog.getBoundingClientRect();\n\n // Click just inside must not close the dialog.\n Helpers.dispatchClickEvent(dialog, {clientX: x + width / 2, clientY: bottom - 1});\n await RenderCoordinator.done();\n dialog = devtoolsDialog.shadowRoot?.querySelector('dialog[open]');\n if (!dialog) {\n assert.fail('Dialog closed when it should not');\n return;\n }\n Helpers.dispatchClickEvent(dialog, {clientX: x + width / 2, clientY: bottom + 1});\n await RenderCoordinator.done();\n\n // Click just outside must close the dialog.\n dialog = devtoolsDialog.shadowRoot?.querySelector('dialog[open]');\n if (dialog) {\n assert.fail('Dialog did not close');\n return;\n }\n });\n});\n"]} \ No newline at end of file diff --git a/public/ui/components/dialogs/ShortcutDialog.test.js b/public/ui/components/dialogs/ShortcutDialog.test.js index ac835a7e5..aacac0e1d 100644 --- a/public/ui/components/dialogs/ShortcutDialog.test.js +++ b/public/ui/components/dialogs/ShortcutDialog.test.js @@ -3,9 +3,8 @@ // found in the LICENSE file. import * as Helpers from '../../../testing/DOMHelpers.js'; // eslint-disable-line rulesdir/es-modules-import import { describeWithLocale, } from '../../../testing/EnvironmentHelpers.js'; -import * as Coordinator from '../render_coordinator/render_coordinator.js'; +import * as RenderCoordinator from '../render_coordinator/render_coordinator.js'; import * as Dialogs from './dialogs.js'; -const coordinator = Coordinator.RenderCoordinator.RenderCoordinator.instance(); describeWithLocale('ShortcutDialog', () => { async function getShortcutDialog(open, prependedElement) { const shortcutDialog = new Dialogs.ShortcutDialog.ShortcutDialog(); @@ -14,7 +13,7 @@ describeWithLocale('ShortcutDialog', () => { } shortcutDialog.data = { shortcuts: [{ title: 'Shortcut Title', bindings: [['Ctrl+E']] }], open }; Helpers.renderElementIntoDOM(shortcutDialog); - await coordinator.done(); + await RenderCoordinator.done(); return shortcutDialog; } function getDialogFromShortcutDialog(shortcutDialog) { diff --git a/public/ui/components/dialogs/ShortcutDialog.test.js.map b/public/ui/components/dialogs/ShortcutDialog.test.js.map index 432821505..81b4515c1 100644 --- a/public/ui/components/dialogs/ShortcutDialog.test.js.map +++ b/public/ui/components/dialogs/ShortcutDialog.test.js.map @@ -1 +1 @@ -{"version":3,"file":"ShortcutDialog.test.js","sourceRoot":"","sources":["../../../../../../../front_end/ui/components/dialogs/ShortcutDialog.test.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,KAAK,OAAO,MAAM,gCAAgC,CAAC,CAAE,iDAAiD;AAC7G,OAAO,EACL,kBAAkB,GACnB,MAAM,wCAAwC,CAAC;AAChD,OAAO,KAAK,WAAW,MAAM,6CAA6C,CAAC;AAE3E,OAAO,KAAK,OAAO,MAAM,cAAc,CAAC;AAExC,MAAM,WAAW,GAAG,WAAW,CAAC,iBAAiB,CA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AAC;QACvE,MAAM,MAAM,GAAG,2BAA2B,CAAC,cAAc,CAAC,CAAC;QAC3D,MAAM,gCAAgC,GAAG,MAAM,CAAC,aAAa,CAAC,uBAAuB,CAAC,CAAC;QAEvF,MAAM,CAAC,UAAU,CAAC,gCAAgC,EAAE,cAAc,CAAC,CAAC;IACtE,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["// Copyright 2023 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport * as Helpers from '../../../testing/DOMHelpers.js'; // eslint-disable-line rulesdir/es-modules-import\nimport {\n describeWithLocale,\n} from '../../../testing/EnvironmentHelpers.js';\nimport * as Coordinator from '../render_coordinator/render_coordinator.js';\n\nimport * as Dialogs from './dialogs.js';\n\nconst coordinator = Coordinator.RenderCoordinator.RenderCoordinator.instance();\n\ndescribeWithLocale('ShortcutDialog', () => {\n async function getShortcutDialog(open?: boolean, prependedElement?: HTMLElement) {\n const shortcutDialog = new Dialogs.ShortcutDialog.ShortcutDialog();\n if (prependedElement) {\n shortcutDialog.prependElement(prependedElement);\n }\n shortcutDialog.data = {shortcuts: [{title: 'Shortcut Title', bindings: [['Ctrl+E']]}], open};\n Helpers.renderElementIntoDOM(shortcutDialog);\n await coordinator.done();\n\n return shortcutDialog;\n }\n\n function getDialogFromShortcutDialog(shortcutDialog: Dialogs.ShortcutDialog.ShortcutDialog) {\n assert.isNotNull(shortcutDialog.shadowRoot);\n const dialog = shortcutDialog.shadowRoot.querySelector('devtools-button-dialog');\n if (!dialog) {\n assert.fail('devtools-button-dialog not found');\n }\n assert.instanceOf(dialog, HTMLElement);\n return dialog;\n }\n\n it('prepends provided element to the dialog content', async () => {\n const prependedElement = document.createElement('div');\n prependedElement.classList.add('prepended-element');\n\n const shortcutDialog = await getShortcutDialog(true, prependedElement);\n const dialog = getDialogFromShortcutDialog(shortcutDialog);\n const prependedElementInShortcutDialog = dialog.querySelector('div.prepended-element');\n\n assert.instanceOf(prependedElementInShortcutDialog, HTMLDivElement);\n });\n});\n"]} \ No newline at end of file +{"version":3,"file":"ShortcutDialog.test.js","sourceRoot":"","sources":["../../../../../../../front_end/ui/components/dialogs/ShortcutDialog.test.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,KAAK,OAAO,MAAM,gCAAgC,CAAC,CAAE,iDAAiD;AAC7G,OAAO,EACL,kBAAkB,GACnB,MAAM,wCAAwC,CAAC;AAChD,OAAO,KAAK,iBAAiB,MAAM,6CAA6C,CAAC;AAEjF,OAAO,KAAK,OAAO,MAAM,cAAc,CAAC;AAExC,kBAAkB,CAAC,gBAAgB,EAAE,GAAG,EAAE;IACxC,KAAK,UAAU,iBAAiB,CAAC,IAAc,EAAE,gBAA8B;QAC7E,MAAM,cAAc,GAAG,IAAI,OAAO,CAAC,cAAc,CAAC,cAAc,EAAE,CAAC;QACnE,IAAI,gBAAgB,EAAE,CAAC;YACrB,cAAc,CAAC,cAAc,CAAC,gBAAgB,CAAC,CAAC;QAClD,CAAC;QACD,cAAc,CAAC,IAAI,GAAG,EAAC,SAAS,EAAE,CAAC,EAAC,KAAK,EAAE,gBAAgB,EAAE,QAAQ,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAC,CAAC,EAAE,IAAI,EAAC,CAAC;QAC7F,OAAO,CAAC,oBAAoB,CAAC,cAAc,CAAC,CAAC;QAC7C,MAAM,iBAAiB,CAAC,IAAI,EAAE,CAAC;QAE/B,OAAO,cAAc,CAAC;IACxB,CAAC;IAED,SAAS,2BAA2B,CAAC,cAAqD;QACxF,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,UAAU,CAAC,CAAC;QAC5C,MAAM,MAAM,GAAG,cAAc,CAAC,UAAU,CAAC,aAAa,CAAC,wBAAwB,CAAC,CAAC;QACjF,IAAI,CAAC,MAAM,EAAE,CAAC;YACZ,MAAM,CAAC,IAAI,CAAC,kCAAkC,CAAC,CAAC;QAClD,CAAC;QACD,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;QACvC,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,EAAE,CAAC,iDAAiD,EAAE,KAAK,IAAI,EAAE;QAC/D,MAAM,gBAAgB,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;QACvD,gBAAgB,CAAC,SAAS,CAAC,GAAG,CAAC,mBAAmB,CAAC,CAAC;QAEpD,MAAM,cAAc,GAAG,MAAM,iBAAiB,CAAC,IAAI,EAAE,gBAAgB,CAAC,CAAC;QACvE,MAAM,MAAM,GAAG,2BAA2B,CAAC,cAAc,CAAC,CAAC;QAC3D,MAAM,gCAAgC,GAAG,MAAM,CAAC,aAAa,CAAC,uBAAuB,CAAC,CAAC;QAEvF,MAAM,CAAC,UAAU,CAAC,gCAAgC,EAAE,cAAc,CAAC,CAAC;IACtE,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["// Copyright 2023 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport * as Helpers from '../../../testing/DOMHelpers.js'; // eslint-disable-line rulesdir/es-modules-import\nimport {\n describeWithLocale,\n} from '../../../testing/EnvironmentHelpers.js';\nimport * as RenderCoordinator from '../render_coordinator/render_coordinator.js';\n\nimport * as Dialogs from './dialogs.js';\n\ndescribeWithLocale('ShortcutDialog', () => {\n async function getShortcutDialog(open?: boolean, prependedElement?: HTMLElement) {\n const shortcutDialog = new Dialogs.ShortcutDialog.ShortcutDialog();\n if (prependedElement) {\n shortcutDialog.prependElement(prependedElement);\n }\n shortcutDialog.data = {shortcuts: [{title: 'Shortcut Title', bindings: [['Ctrl+E']]}], open};\n Helpers.renderElementIntoDOM(shortcutDialog);\n await RenderCoordinator.done();\n\n return shortcutDialog;\n }\n\n function getDialogFromShortcutDialog(shortcutDialog: Dialogs.ShortcutDialog.ShortcutDialog) {\n assert.isNotNull(shortcutDialog.shadowRoot);\n const dialog = shortcutDialog.shadowRoot.querySelector('devtools-button-dialog');\n if (!dialog) {\n assert.fail('devtools-button-dialog not found');\n }\n assert.instanceOf(dialog, HTMLElement);\n return dialog;\n }\n\n it('prepends provided element to the dialog content', async () => {\n const prependedElement = document.createElement('div');\n prependedElement.classList.add('prepended-element');\n\n const shortcutDialog = await getShortcutDialog(true, prependedElement);\n const dialog = getDialogFromShortcutDialog(shortcutDialog);\n const prependedElementInShortcutDialog = dialog.querySelector('div.prepended-element');\n\n assert.instanceOf(prependedElementInShortcutDialog, HTMLDivElement);\n });\n});\n"]} \ No newline at end of file diff --git a/public/ui/components/dialogs/shortcutDialog.css.js b/public/ui/components/dialogs/shortcutDialog.css.js index b1b25924b..9714650a5 100644 --- a/public/ui/components/dialogs/shortcutDialog.css.js +++ b/public/ui/components/dialogs/shortcutDialog.css.js @@ -78,6 +78,13 @@ styles.replaceSync( display: flex; flex-direction: column; border-bottom: var(--sys-size-1) solid var(--sys-color-divider); + padding-bottom: var(--sys-size-5); + + & label { + display: flex; + font: var(--sys-typescale-body3-regular); + gap: var(--sys-size-2); + } } .keybinds-key { diff --git a/public/ui/components/diff_view/DiffView.test.js b/public/ui/components/diff_view/DiffView.test.js index 2c6105d38..591c063b0 100644 --- a/public/ui/components/diff_view/DiffView.test.js +++ b/public/ui/components/diff_view/DiffView.test.js @@ -31,7 +31,7 @@ describeWithLocale('DiffView', () => { it('renders the proper content', async () => { const output = await simpleDiff(); const lines = Array.from(output.querySelectorAll('.diff-line-content')); - assert.strictEqual(lines.length, 6); + assert.lengthOf(lines, 6); assert.strictEqual(lines.filter(l => !l.classList.contains('diff-line-addition')).map(text).join('\n'), original); assert.strictEqual(lines.filter(l => !l.classList.contains('diff-line-deletion')).map(text).join('\n'), updated); }); diff --git a/public/ui/components/diff_view/DiffView.test.js.map b/public/ui/components/diff_view/DiffView.test.js.map index 99dca27e8..ebb3159d1 100644 --- a/public/ui/components/diff_view/DiffView.test.js.map +++ b/public/ui/components/diff_view/DiffView.test.js.map @@ -1 +1 @@ -{"version":3,"file":"DiffView.test.js","sourceRoot":"","sources":["../../../../../../../front_end/ui/components/diff_view/DiffView.test.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,EAAC,kBAAkB,EAAC,MAAM,wCAAwC,CAAC;AAC1E,OAAO,KAAK,IAAI,MAAM,mCAAmC,CAAC;AAE1D,OAAO,KAAK,QAAQ,MAAM,gBAAgB,CAAC;AAE3C,SAAS,SAAS,CAAC,QAAgB,EAAE,OAAe;IAClD,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC;IACvF,MAAM,IAAI,GAAG,IAAI,QAAQ,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAC,IAAI,EAAE,QAAQ,EAAE,iBAAiB,EAAC,CAAC,CAAC;IACjF,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,UAA8B,CAAC,CAAC;AACrE,CAAC;AAED,IAAI,gBAAgB,GAAmC,IAAI,CAAC;AAE5D,MAAM,QAAQ,GAAG,yDAAyD,CAAC;AAC3E,MAAM,OAAO,GAAG,0DAA0D,CAAC;AAE3E,SAAS,UAAU;IACjB,IAAI,CAAC,gBAAgB,EAAE,CAAC;QACtB,gBAAgB,GAAG,SAAS,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;IAClD,CAAC;IACD,OAAO,gBAAgB,CAAC;AAC1B,CAAC;AAED,SAAS,IAAI,CAAC,GAAS;IACrB,IAAI,GAAG,YAAY,IAAI,EAAE,CAAC;QACxB,OAAO,GAAG,CAAC,SAAmB,CAAC;IACjC,CAAC;IACD,IAAI,GAAG,YAAY,WAAW,IAAI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C,CAAC,CAAC;IAC5D,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["// Copyright 2020 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport {describeWithLocale} from '../../../testing/EnvironmentHelpers.js';\nimport * as Diff from '../../../third_party/diff/diff.js';\n\nimport * as DiffView from './diff_view.js';\n\nfunction buildDiff(original: string, updated: string): Promise {\n const diff = Diff.Diff.DiffWrapper.lineDiff(original.split('\\n'), updated.split('\\n'));\n const view = new DiffView.DiffView.DiffView({diff, mimeType: 'text/javascript'});\n return view.loaded.then(() => view.shadowRoot as DocumentFragment);\n}\n\nlet cachedSimpleDiff: Promise|null = null;\n\nconst original = 'let x = `one\\ntwo` /* with a\\ncomment */\\nreturn okay()';\nconst updated = 'let x = `one\\nthree` // with a\\n\"comment\"\\nreturn okay()';\n\nfunction simpleDiff(): Promise {\n if (!cachedSimpleDiff) {\n cachedSimpleDiff = buildDiff(original, updated);\n }\n return cachedSimpleDiff;\n}\n\nfunction text(elt: Node): string {\n if (elt instanceof Text) {\n return elt.nodeValue as string;\n }\n if (elt instanceof HTMLElement && !elt.classList.contains('diff-hidden-text')) {\n return Array.from(elt.childNodes).map(text).join('');\n }\n return '';\n}\n\ndescribeWithLocale('DiffView', () => {\n it('renders the proper content', async () => {\n const output = await simpleDiff();\n const lines = Array.from(output.querySelectorAll('.diff-line-content'));\n assert.strictEqual(lines.length, 6);\n assert.strictEqual(lines.filter(l => !l.classList.contains('diff-line-addition')).map(text).join('\\n'), original);\n assert.strictEqual(lines.filter(l => !l.classList.contains('diff-line-deletion')).map(text).join('\\n'), updated);\n });\n\n it('renders line numbers', async () => {\n const output = await simpleDiff();\n const numbers = Array.from(output.querySelectorAll('.diff-line-number'));\n // Line numbers are rendered pairwise per line, with one number\n // omitted from inserted/deleted lines\n assert.strictEqual(numbers.map(text).join('-'), '1-1-2--3---2--3-4-4');\n });\n\n it('highlights code properly', async () => {\n const output = await simpleDiff();\n const lines = output.querySelectorAll('.diff-line-content');\n // Basic highlighting\n assert.isNotNull(lines[0].querySelector('.token-keyword'));\n // Accurate per-file highlighting\n // - lines[2] holds 'comment */', lines[4] holds '\"comment\"'.\n assert.isNotNull(lines[2].querySelector('.token-comment'));\n assert.isNotNull(lines[4].querySelector('.token-string'));\n });\n\n it('collapses long stretches of equal text', async () => {\n const original = 'boring\\n'.repeat(100);\n const changed = 'interesting\\n' + original.slice(0, 500) + '...' + original.slice(500);\n const view = await buildDiff(original, changed);\n assert.isTrue(view.querySelectorAll('.diff-line-content').length < 100);\n assert.isNotNull(view.querySelector('.diff-line-spacer'));\n });\n});\n"]} \ No newline at end of file +{"version":3,"file":"DiffView.test.js","sourceRoot":"","sources":["../../../../../../../front_end/ui/components/diff_view/DiffView.test.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,EAAC,kBAAkB,EAAC,MAAM,wCAAwC,CAAC;AAC1E,OAAO,KAAK,IAAI,MAAM,mCAAmC,CAAC;AAE1D,OAAO,KAAK,QAAQ,MAAM,gBAAgB,CAAC;AAE3C,SAAS,SAAS,CAAC,QAAgB,EAAE,OAAe;IAClD,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC;IACvF,MAAM,IAAI,GAAG,IAAI,QAAQ,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAC,IAAI,EAAE,QAAQ,EAAE,iBAAiB,EAAC,CAAC,CAAC;IACjF,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,UAA8B,CAAC,CAAC;AACrE,CAAC;AAED,IAAI,gBAAgB,GAAmC,IAAI,CAAC;AAE5D,MAAM,QAAQ,GAAG,yDAAyD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GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,GAAG,KAAK,GAAG,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QACvF,MAAM,IAAI,GAAG,MAAM,SAAS,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;QAChD,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,gBAAgB,CAAC,oBAAoB,CAAC,CAAC,MAAM,GAAG,GAAG,CAAC,CAAC;QACxE,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,aAAa,CAAC,mBAAmB,CAAC,CAAC,CAAC;IAC5D,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["// Copyright 2020 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport {describeWithLocale} from '../../../testing/EnvironmentHelpers.js';\nimport * as Diff from '../../../third_party/diff/diff.js';\n\nimport * as DiffView from './diff_view.js';\n\nfunction buildDiff(original: string, updated: string): Promise {\n const diff = Diff.Diff.DiffWrapper.lineDiff(original.split('\\n'), updated.split('\\n'));\n const view = new DiffView.DiffView.DiffView({diff, mimeType: 'text/javascript'});\n return view.loaded.then(() => view.shadowRoot as DocumentFragment);\n}\n\nlet cachedSimpleDiff: Promise|null = null;\n\nconst original = 'let x = `one\\ntwo` /* with a\\ncomment */\\nreturn okay()';\nconst updated = 'let x = `one\\nthree` // with a\\n\"comment\"\\nreturn okay()';\n\nfunction simpleDiff(): Promise {\n if (!cachedSimpleDiff) {\n cachedSimpleDiff = buildDiff(original, updated);\n }\n return cachedSimpleDiff;\n}\n\nfunction text(elt: Node): string {\n if (elt instanceof Text) {\n return elt.nodeValue as string;\n }\n if (elt instanceof HTMLElement && !elt.classList.contains('diff-hidden-text')) {\n return Array.from(elt.childNodes).map(text).join('');\n }\n return '';\n}\n\ndescribeWithLocale('DiffView', () => {\n it('renders the proper content', async () => {\n const output = await simpleDiff();\n const lines = Array.from(output.querySelectorAll('.diff-line-content'));\n assert.lengthOf(lines, 6);\n assert.strictEqual(lines.filter(l => !l.classList.contains('diff-line-addition')).map(text).join('\\n'), original);\n assert.strictEqual(lines.filter(l => !l.classList.contains('diff-line-deletion')).map(text).join('\\n'), updated);\n });\n\n it('renders line numbers', async () => {\n const output = await simpleDiff();\n const numbers = Array.from(output.querySelectorAll('.diff-line-number'));\n // Line numbers are rendered pairwise per line, with one number\n // omitted from inserted/deleted lines\n assert.strictEqual(numbers.map(text).join('-'), '1-1-2--3---2--3-4-4');\n });\n\n it('highlights code properly', async () => {\n const output = await simpleDiff();\n const lines = output.querySelectorAll('.diff-line-content');\n // Basic highlighting\n assert.isNotNull(lines[0].querySelector('.token-keyword'));\n // Accurate per-file highlighting\n // - lines[2] holds 'comment */', lines[4] holds '\"comment\"'.\n assert.isNotNull(lines[2].querySelector('.token-comment'));\n assert.isNotNull(lines[4].querySelector('.token-string'));\n });\n\n it('collapses long stretches of equal text', async () => {\n const original = 'boring\\n'.repeat(100);\n const changed = 'interesting\\n' + original.slice(0, 500) + '...' + original.slice(500);\n const view = await buildDiff(original, changed);\n assert.isTrue(view.querySelectorAll('.diff-line-content').length < 100);\n assert.isNotNull(view.querySelector('.diff-line-spacer'));\n });\n});\n"]} \ No newline at end of file diff --git a/public/ui/components/diff_view/diffView.css.js b/public/ui/components/diff_view/diffView.css.js index aa5c70b4e..3be607db7 100644 --- a/public/ui/components/diff_view/diffView.css.js +++ b/public/ui/components/diff_view/diffView.css.js @@ -49,11 +49,11 @@ styles.replaceSync( } .diff-line-addition .inner-diff { - background-color: color-mix(in sRGB, var(--ref-palette-green70) 40%, transparent); + background-color: color-mix(in srgb, var(--ref-palette-green70) 40%, transparent); } .diff-line-deletion .inner-diff { - background-color: color-mix(in sRGB, var(--ref-palette-error60) 40%, transparent); + background-color: color-mix(in srgb, var(--ref-palette-error60) 40%, transparent); } .diff-hidden-text { diff --git a/public/ui/components/docs/radio_button/basic.d.ts b/public/ui/components/docs/radio_button/basic.d.ts new file mode 100644 index 000000000..cb0ff5c3b --- /dev/null +++ b/public/ui/components/docs/radio_button/basic.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/public/ui/components/docs/radio_button/basic.html b/public/ui/components/docs/radio_button/basic.html new file mode 100644 index 000000000..361ae1832 --- /dev/null +++ b/public/ui/components/docs/radio_button/basic.html @@ -0,0 +1,23 @@ + + + + + + + Basic Radio Button example + + + +
+
+ + + + + diff --git a/public/ui/components/docs/radio_button/basic.js b/public/ui/components/docs/radio_button/basic.js new file mode 100644 index 000000000..ae91dc025 --- /dev/null +++ b/public/ui/components/docs/radio_button/basic.js @@ -0,0 +1,39 @@ +// Copyright 2024 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. +import * as UI from '../../../legacy/legacy.js'; +import * as ComponentHelpers from '../../helpers/helpers.js'; +await ComponentHelpers.ComponentServerSetup.setup(); +function radioExample({ name, tabbable, disabled }) { + const example = document.createElement('fieldset'); + example.style.marginTop = '20px'; + const legend = document.createElement('legend'); + legend.textContent = name; + const list = document.createElement('div'); + for (let i = 0; i < 3; ++i) { + const { label, radio } = UI.UIUtils.createRadioButton(name, `Option #${i + 1}`, name); + radio.tabIndex = tabbable ? 0 : -1; + radio.disabled = disabled; + radio.checked = i === 0; + list.append(label); + } + example.append(legend, list); + return example; +} +function init() { + const container = document.getElementById('container'); + if (!container) { + return; + } + container.style.padding = '42px 42px'; + container.style.margin = '42px 42px'; + container.style.border = '1px solid rgb(0 0 0 / 20%)'; + // Basic + container.appendChild(radioExample({ name: 'basic', tabbable: true, disabled: false })); + // Not tab reachable + container.appendChild(radioExample({ name: 'not-table-reachable', tabbable: false, disabled: false })); + // Disabled + container.appendChild(radioExample({ name: 'disabled', tabbable: true, disabled: true })); +} +init(); +//# sourceMappingURL=basic.js.map \ No newline at end of file diff --git a/public/ui/components/docs/radio_button/basic.js.map b/public/ui/components/docs/radio_button/basic.js.map new file mode 100644 index 000000000..6748a0303 --- /dev/null +++ b/public/ui/components/docs/radio_button/basic.js.map @@ -0,0 +1 @@ +{"version":3,"file":"basic.js","sourceRoot":"","sources":["../../../../../../../../front_end/ui/components/docs/radio_button/basic.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,KAAK,EAAE,MAAM,2BAA2B,CAAC;AAChD,OAAO,KAAK,gBAAgB,MAAM,0BAA0B,CAAC;AAE7D,MAAM,gBAAgB,CAAC,oBAAoB,CAAC,KAAK,EAAE,CAAC;AACpD,SAAS,YAAY,CAAC,EAAC,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAI9C;IACC,MAAM,OAAO,GAAG,QAAQ,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC;IACnD,OAAO,CAAC,KAAK,CAAC,SAAS,GAAG,MAAM,CAAC;IACjC,MAAM,MAAM,GAAG,QAAQ,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC;IAChD,MAAM,CAAC,WAAW,GAAG,IAAI,CAAC;IAC1B,MAAM,IAAI,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;IAC3C,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC,EAAE,CAAC;QAC3B,MAAM,EAAC,KAAK,EAAE,KAAK,EAAC,GAAG,EAAE,CAAC,OAAO,CAAC,iBAAiB,CAAC,IAAI,EAAE,WAAW,CAAC,GAAG,CAAC,EAAE,EAAE,IAAI,CAAC,CAAC;QACpF,KAAK,CAAC,QAAQ,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QACnC,KAAK,CAAC,QAAQ,GAAG,QAAQ,CAAC;QAC1B,KAAK,CAAC,OAAO,GAAG,CAAC,KAAK,CAAC,CAAC;QACxB,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IACrB,CAAC;IACD,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;IAC7B,OAAO,OAAO,CAAC;AACjB,CAAC;AAED,SAAS,IAAI;IACX,MAAM,SAAS,GAAG,QAAQ,CAAC,cAAc,CAAC,WAAW,CAAC,CAAC;IACvD,IAAI,CAAC,SAAS,EAAE,CAAC;QACf,OAAO;IACT,CAAC;IAED,SAAS,CAAC,KAAK,CAAC,OAAO,GAAG,WAAW,CAAC;IACtC,SAAS,CAAC,KAAK,CAAC,MAAM,GAAG,WAAW,CAAC;IACrC,SAAS,CAAC,KAAK,CAAC,MAAM,GAAG,4BAA4B,CAAC;IAEtD,QAAQ;IACR,SAAS,CAAC,WAAW,CAAC,YAAY,CAAC,EAAC,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAC,CAAC,CAAC,CAAC;IAEtF,oBAAoB;IACpB,SAAS,CAAC,WAAW,CAAC,YAAY,CAAC,EAAC,IAAI,EAAE,qBAAqB,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAC,CAAC,CAAC,CAAC;IAErG,WAAW;IACX,SAAS,CAAC,WAAW,CAAC,YAAY,CAAC,EAAC,IAAI,EAAE,UAAU,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAC,CAAC,CAAC,CAAC;AAC1F,CAAC;AAED,IAAI,EAAE,CAAC","sourcesContent":["// Copyright 2024 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport * as UI from '../../../legacy/legacy.js';\nimport * as ComponentHelpers from '../../helpers/helpers.js';\n\nawait ComponentHelpers.ComponentServerSetup.setup();\nfunction radioExample({name, tabbable, disabled}: {\n name: string,\n tabbable: boolean,\n disabled: boolean,\n}): HTMLElement {\n const example = document.createElement('fieldset');\n example.style.marginTop = '20px';\n const legend = document.createElement('legend');\n legend.textContent = name;\n const list = document.createElement('div');\n for (let i = 0; i < 3; ++i) {\n const {label, radio} = UI.UIUtils.createRadioButton(name, `Option #${i + 1}`, name);\n radio.tabIndex = tabbable ? 0 : -1;\n radio.disabled = disabled;\n radio.checked = i === 0;\n list.append(label);\n }\n example.append(legend, list);\n return example;\n}\n\nfunction init(): void {\n const container = document.getElementById('container');\n if (!container) {\n return;\n }\n\n container.style.padding = '42px 42px';\n container.style.margin = '42px 42px';\n container.style.border = '1px solid rgb(0 0 0 / 20%)';\n\n // Basic\n container.appendChild(radioExample({name: 'basic', tabbable: true, disabled: false}));\n\n // Not tab reachable\n container.appendChild(radioExample({name: 'not-table-reachable', tabbable: false, disabled: false}));\n\n // Disabled\n container.appendChild(radioExample({name: 'disabled', tabbable: true, disabled: true}));\n}\n\ninit();\n"]} \ No newline at end of file diff --git a/public/ui/components/docs/radio_button/ts-tsconfig.json b/public/ui/components/docs/radio_button/ts-tsconfig.json new file mode 100644 index 000000000..a2d63aaf2 --- /dev/null +++ b/public/ui/components/docs/radio_button/ts-tsconfig.json @@ -0,0 +1,55 @@ +{ + "compilerOptions": { + "allowJs": true, + "allowUmdGlobalAccess": true, + "checkJs": true, + "composite": true, + "declaration": true, + "experimentalDecorators": true, + "forceConsistentCasingInFileNames": true, + "inlineSources": true, + "lib": [ + "esnext", + "dom", + "dom.iterable" + ], + "module": "esnext", + "noEmitOnError": true, + "noFallthroughCasesInSwitch": true, + "noImplicitOverride": true, + "noImplicitReturns": true, + "noUnusedLocals": false, + "outDir": ".", + "rootDir": "../../../../../../../../front_end/ui/components/docs/radio_button", + "skipLibCheck": true, + "sourceMap": true, + "strict": true, + "target": "esnext", + "tsBuildInfoFile": "ts-tsconfig.json.tsbuildinfo", + "typeRoots": [ + "../../../../../../../../node_modules/@types" + ], + "types": [ + "mocha", + "chai", + "sinon", + "karma-chai-sinon" + ], + "useUnknownInCatchVariables": false + }, + "files": [ + "../../../../../../../../front_end/ui/components/docs/radio_button/basic.ts", + "../../../../../../../../front_end/legacy/legacy-defs.d.ts", + "../../../../../../../../front_end/global_typings/global_defs.d.ts", + "../../../../../../../../node_modules/@types/filesystem/index.d.ts", + "../../../../../../../../node_modules/@types/wicg-task-scheduling/index.d.ts" + ], + "references": [ + { + "path": "../../../legacy/bundle-tsconfig.json" + }, + { + "path": "../../helpers/bundle-tsconfig.json" + } + ] +} \ No newline at end of file diff --git a/public/ui/components/docs/slider/basic.d.ts b/public/ui/components/docs/slider/basic.d.ts new file mode 100644 index 000000000..cb0ff5c3b --- /dev/null +++ b/public/ui/components/docs/slider/basic.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/public/ui/components/docs/slider/basic.html b/public/ui/components/docs/slider/basic.html new file mode 100644 index 000000000..8a5f8ebf5 --- /dev/null +++ b/public/ui/components/docs/slider/basic.html @@ -0,0 +1,20 @@ + + + + + + + Basic Slider example + + + +
+
+ + + + diff --git a/public/ui/components/docs/slider/basic.js b/public/ui/components/docs/slider/basic.js new file mode 100644 index 000000000..041424bca --- /dev/null +++ b/public/ui/components/docs/slider/basic.js @@ -0,0 +1,49 @@ +// Copyright 2024 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. +import * as UI from '../../../legacy/legacy.js'; +import * as ComponentHelpers from '../../helpers/helpers.js'; +await ComponentHelpers.ComponentServerSetup.setup(); +function sliderExample({ min, max, tabIndex, disabled }) { + const example = document.createElement('div'); + example.style.marginTop = '20px'; + const minExplanation = document.createElement('div'); + const maxExplanation = document.createElement('div'); + const valueExplanation = document.createElement('div'); + const disabledExplanation = document.createElement('div'); + const tabbableExplanation = document.createElement('div'); + const component = UI.UIUtils.createSlider(min, max, tabIndex); + component.disabled = disabled; + minExplanation.textContent = `min: ${min}`; + maxExplanation.textContent = `max: ${max}`; + valueExplanation.textContent = `value: ${component.value}`; + disabledExplanation.textContent = `is disabled? ${component.disabled}`; + tabbableExplanation.textContent = `is tabbable? ${component.tabIndex >= 0}`; + component.addEventListener('change', () => { + valueExplanation.textContent = `value: ${component.value}`; + }); + example.appendChild(component); + example.appendChild(minExplanation); + example.appendChild(maxExplanation); + example.appendChild(valueExplanation); + example.appendChild(disabledExplanation); + example.appendChild(tabbableExplanation); + return example; +} +function init() { + const container = document.getElementById('container'); + if (!container) { + return; + } + container.style.padding = '42px 42px'; + container.style.margin = '42px 42px'; + container.style.border = '1px solid rgb(0 0 0 / 20%)'; + // Basic + container.appendChild(sliderExample({ min: 0, max: 100, tabIndex: 0, disabled: false })); + // Not tab reachable + container.appendChild(sliderExample({ min: 0, max: 100, tabIndex: -1, disabled: false })); + // Disabled + container.appendChild(sliderExample({ min: 0, max: 100, tabIndex: 0, disabled: true })); +} +init(); +//# sourceMappingURL=basic.js.map \ No newline at end of file diff --git a/public/ui/components/docs/slider/basic.js.map b/public/ui/components/docs/slider/basic.js.map new file mode 100644 index 000000000..a244e5d6d --- /dev/null +++ b/public/ui/components/docs/slider/basic.js.map @@ -0,0 +1 @@ +{"version":3,"file":"basic.js","sourceRoot":"","sources":["../../../../../../../../front_end/ui/components/docs/slider/basic.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,KAAK,EAAE,MAAM,2BAA2B,CAAC;AAChD,OAAO,KAAK,gBAAgB,MAAM,0BAA0B,CAAC;AAE7D,MAAM,gBAAgB,CAAC,oBAAoB,CAAC,KAAK,EAAE,CAAC;AACpD,SAAS,aAAa,CAAC,EAAC,GAAG,EAAE,GAAG,EAAE,QAAQ,EAAE,QAAQ,EAKnD;IACC,MAAM,OAAO,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;IAC9C,OAAO,CAAC,KAAK,CAAC,SAAS,GAAG,MAAM,CAAC;IACjC,MAAM,cAAc,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;IACrD,MAAM,cAAc,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;IACrD,MAAM,gBAAgB,GAAG,QAAQ,CAAC,aAAa,C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I,CAAC,SAAS,EAAE,CAAC;QACf,OAAO;IACT,CAAC;IAED,SAAS,CAAC,KAAK,CAAC,OAAO,GAAG,WAAW,CAAC;IACtC,SAAS,CAAC,KAAK,CAAC,MAAM,GAAG,WAAW,CAAC;IACrC,SAAS,CAAC,KAAK,CAAC,MAAM,GAAG,4BAA4B,CAAC;IAEtD,QAAQ;IACR,SAAS,CAAC,WAAW,CAAC,aAAa,CAAC,EAAC,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,QAAQ,EAAE,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAC,CAAC,CAAC,CAAC;IAEvF,oBAAoB;IACpB,SAAS,CAAC,WAAW,CAAC,aAAa,CAAC,EAAC,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,QAAQ,EAAE,CAAC,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAC,CAAC,CAAC,CAAC;IAExF,WAAW;IACX,SAAS,CAAC,WAAW,CAAC,aAAa,CAAC,EAAC,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,QAAQ,EAAE,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAC,CAAC,CAAC,CAAC;AACxF,CAAC;AAED,IAAI,EAAE,CAAC","sourcesContent":["// Copyright 2024 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport * as UI from '../../../legacy/legacy.js';\nimport * as ComponentHelpers from '../../helpers/helpers.js';\n\nawait ComponentHelpers.ComponentServerSetup.setup();\nfunction sliderExample({min, max, tabIndex, disabled}: {\n min: number,\n max: number,\n tabIndex: number,\n disabled: boolean,\n}): HTMLElement {\n const example = document.createElement('div');\n example.style.marginTop = '20px';\n const minExplanation = document.createElement('div');\n const maxExplanation = document.createElement('div');\n const valueExplanation = document.createElement('div');\n const disabledExplanation = document.createElement('div');\n const tabbableExplanation = document.createElement('div');\n const component = UI.UIUtils.createSlider(min, max, tabIndex);\n component.disabled = disabled;\n minExplanation.textContent = `min: ${min}`;\n maxExplanation.textContent = `max: ${max}`;\n valueExplanation.textContent = `value: ${component.value}`;\n disabledExplanation.textContent = `is disabled? ${component.disabled}`;\n tabbableExplanation.textContent = `is tabbable? ${component.tabIndex >= 0}`;\n\n component.addEventListener('change', () => {\n valueExplanation.textContent = `value: ${component.value}`;\n });\n example.appendChild(component);\n example.appendChild(minExplanation);\n example.appendChild(maxExplanation);\n example.appendChild(valueExplanation);\n example.appendChild(disabledExplanation);\n example.appendChild(tabbableExplanation);\n return example;\n}\n\nfunction init(): void {\n const container = document.getElementById('container');\n if (!container) {\n return;\n }\n\n container.style.padding = '42px 42px';\n container.style.margin = '42px 42px';\n container.style.border = '1px solid rgb(0 0 0 / 20%)';\n\n // Basic\n container.appendChild(sliderExample({min: 0, max: 100, tabIndex: 0, disabled: false}));\n\n // Not tab reachable\n container.appendChild(sliderExample({min: 0, max: 100, tabIndex: -1, disabled: false}));\n\n // Disabled\n container.appendChild(sliderExample({min: 0, max: 100, tabIndex: 0, disabled: true}));\n}\n\ninit();\n"]} \ No newline at end of file diff --git a/public/ui/components/docs/slider/ts-tsconfig.json b/public/ui/components/docs/slider/ts-tsconfig.json new file mode 100644 index 000000000..436d7e03e --- /dev/null +++ b/public/ui/components/docs/slider/ts-tsconfig.json @@ -0,0 +1,55 @@ +{ + "compilerOptions": { + "allowJs": true, + "allowUmdGlobalAccess": true, + "checkJs": true, + "composite": true, + "declaration": true, + "experimentalDecorators": true, + "forceConsistentCasingInFileNames": true, + "inlineSources": true, + "lib": [ + "esnext", + "dom", + "dom.iterable" + ], + "module": "esnext", + "noEmitOnError": true, + "noFallthroughCasesInSwitch": true, + "noImplicitOverride": true, + "noImplicitReturns": true, + "noUnusedLocals": false, + "outDir": ".", + "rootDir": "../../../../../../../../front_end/ui/components/docs/slider", + "skipLibCheck": true, + "sourceMap": true, + "strict": true, + "target": "esnext", + "tsBuildInfoFile": "ts-tsconfig.json.tsbuildinfo", + "typeRoots": [ + "../../../../../../../../node_modules/@types" + ], + "types": [ + "mocha", + "chai", + "sinon", + "karma-chai-sinon" + ], + "useUnknownInCatchVariables": false + }, + "files": [ + "../../../../../../../../front_end/ui/components/docs/slider/basic.ts", + "../../../../../../../../front_end/legacy/legacy-defs.d.ts", + "../../../../../../../../front_end/global_typings/global_defs.d.ts", + "../../../../../../../../node_modules/@types/filesystem/index.d.ts", + "../../../../../../../../node_modules/@types/wicg-task-scheduling/index.d.ts" + ], + "references": [ + { + "path": "../../../legacy/bundle-tsconfig.json" + }, + { + "path": "../../helpers/bundle-tsconfig.json" + } + ] +} \ No newline at end of file diff --git a/public/ui/components/expandable_list/ExpandableList.test.js b/public/ui/components/expandable_list/ExpandableList.test.js index b6b65c265..ecdc18fec 100644 --- a/public/ui/components/expandable_list/ExpandableList.test.js +++ b/public/ui/components/expandable_list/ExpandableList.test.js @@ -19,7 +19,7 @@ describe('ExpandableList', () => { assert.isNotNull(list.shadowRoot); // checks that list is not expanded initially let rows = list.shadowRoot.querySelectorAll('.row'); - assert.strictEqual(rows.length, 1); + assert.lengthOf(rows, 1); const iconSpan = list.shadowRoot.querySelector('span.arrow-icon'); assert.isNotNull(iconSpan); assert.isFalse(iconSpan?.classList.contains('expanded')); @@ -31,7 +31,7 @@ describe('ExpandableList', () => { // checks that list is expanded assert.isTrue(iconSpan?.classList.contains('expanded')); rows = list.shadowRoot.querySelectorAll('.row'); - assert.strictEqual(rows.length, 2); + assert.lengthOf(rows, 2); }); it('does not render when given 0 rows', async () => { const list = new ExpandableList.ExpandableList.ExpandableList(); @@ -42,7 +42,7 @@ describe('ExpandableList', () => { assert.isNotNull(list.shadowRoot); // checks that list is not rendered const rows = list.shadowRoot.querySelectorAll('.row'); - assert.strictEqual(rows.length, 0); + assert.lengthOf(rows, 0); const iconSpan = list.shadowRoot.querySelector('span.arrow-icon'); assert.isNull(iconSpan); }); @@ -57,7 +57,7 @@ describe('ExpandableList', () => { assert.isNotNull(list.shadowRoot); // checks that list contains 1 row const rows = list.shadowRoot.querySelectorAll('.row'); - assert.strictEqual(rows.length, 1); + assert.lengthOf(rows, 1); // checks that list does not render button for expanding const iconSpan = list.shadowRoot.querySelector('span.arrow-icon'); assert.isNull(iconSpan); diff --git a/public/ui/components/expandable_list/ExpandableList.test.js.map b/public/ui/components/expandable_list/ExpandableList.test.js.map index e69802e7c..5e1af888d 100644 --- a/public/ui/components/expandable_list/ExpandableList.test.js.map +++ b/public/ui/components/expandable_list/ExpandableList.test.js.map @@ -1 +1 @@ -{"version":3,"file":"ExpandableList.test.js","sourceRoot":"","sources":["../../../../../../../front_end/ui/components/expandable_list/ExpandableList.test.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,EAAC,oBAAoB,EAAC,MAAM,gCAAgC,CAAC;AACpE,OAAO,EAAe,aAAa,EAAC,MAAM,qCAAqC,CAAC;AAChF,OAAO,KAAK,OAAO,MAAM,4BAA4B,CAAC;AAEtD,OAAO,KAAK,cAAc,MAAM,sBAAsB,CAAC;AAEvD,MAAM,EAAC,IAAI,EAAC,GAAG,OAAO,CAAC;AAEvB,QAAQ,CAAC,gBAAgB,EAAE,GAAG,EAAE;IAC9B,EAAE,CAAC,iBAAiB,EAAE,KAAK,IAAI,EAAE;QAC/B,MAAM,IAAI,GAAG,IAAI,cAAc,CAAC,cAAc,CAAC,cAAc,EAAE,CAAC;QAChE,oBAAoB,CAAC,IAAI,CAAC,CAAC;QAC3B,IAAI,CAAC,IAAI,GAAG;YACV,IAAI,EAAE;gBACJ,IAAI,CAAA,8BAA8B;gBAClC,IAAI,CAAA,8BAA8B;aACnC;SACF,CAAC;QACF,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QAElC,6CAA6C;QAC7C,IAAI,IAAI,GAAG,IAAI,CAAC,UAAU,CAAC,gBAAgB,CAAC,MAAM,CAAC,CAAC;QACpD,MAAM,CAAC,WAAW,CAAC,IAA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AC;QACtD,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;QACnC,MAAM,QAAQ,GAAG,IAAI,CAAC,UAAU,CAAC,aAAa,CAAc,iBAAiB,CAAC,CAAC;QAC/E,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;IAC1B,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,qCAAqC,EAAE,KAAK,IAAI,EAAE;QACnD,MAAM,IAAI,GAAG,IAAI,cAAc,CAAC,cAAc,CAAC,cAAc,EAAE,CAAC;QAChE,oBAAoB,CAAC,IAAI,CAAC,CAAC;QAC3B,IAAI,CAAC,IAAI,GAAG;YACV,IAAI,EAAE;gBACJ,IAAI,CAAA,8BAA8B;aACnC;SACF,CAAC;QACF,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QAElC,kCAAkC;QAClC,MAAM,IAAI,GAAG,IAAI,CAAC,UAAU,CAAC,gBAAgB,CAAC,MAAM,CAAC,CAAC;QACtD,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;QAEnC,wDAAwD;QACxD,MAAM,QAAQ,GAAG,IAAI,CAAC,UAAU,CAAC,aAAa,CAAc,iBAAiB,CAAC,CAAC;QAC/E,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;QACxB,MAAM,MAAM,GAAG,IAAI,CAAC,UAAU,CAAC,aAAa,CAAc,0BAA0B,CAAC,CAAC;QACtF,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IACxB,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["// Copyright 2021 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport {renderElementIntoDOM} from '../../../testing/DOMHelpers.js';\nimport {MutationType, withMutations} from '../../../testing/MutationHelpers.js';\nimport * as LitHtml from '../../lit-html/lit-html.js';\n\nimport * as ExpandableList from './expandable_list.js';\n\nconst {html} = LitHtml;\n\ndescribe('ExpandableList', () => {\n it('can be expanded', async () => {\n const list = new ExpandableList.ExpandableList.ExpandableList();\n renderElementIntoDOM(list);\n list.data = {\n rows: [\n html`
row 1
`,\n html`
row 2
`,\n ],\n };\n assert.isNotNull(list.shadowRoot);\n\n // checks that list is not expanded initially\n let rows = list.shadowRoot.querySelectorAll('.row');\n assert.strictEqual(rows.length, 1);\n const iconSpan = list.shadowRoot.querySelector('span.arrow-icon');\n assert.isNotNull(iconSpan);\n assert.isFalse(iconSpan?.classList.contains('expanded'));\n\n // checks that clicking button expands list by adding a div\n const button = list.shadowRoot.querySelector('button.arrow-icon-button');\n await withMutations([{target: 'div', type: MutationType.ADD, max: 1}], list.shadowRoot, () => {\n button?.click();\n });\n\n // checks that list is expanded\n assert.isTrue(iconSpan?.classList.contains('expanded'));\n rows = list.shadowRoot.querySelectorAll('.row');\n assert.strictEqual(rows.length, 2);\n });\n\n it('does not render when given 0 rows', async () => {\n const list = new ExpandableList.ExpandableList.ExpandableList();\n renderElementIntoDOM(list);\n list.data = {\n rows: [],\n };\n assert.isNotNull(list.shadowRoot);\n\n // checks that list is not rendered\n const rows = list.shadowRoot.querySelectorAll('.row');\n assert.strictEqual(rows.length, 0);\n const iconSpan = list.shadowRoot.querySelector('span.arrow-icon');\n assert.isNull(iconSpan);\n });\n\n it('cannot be expanded when given 1 row', async () => {\n const list = new ExpandableList.ExpandableList.ExpandableList();\n renderElementIntoDOM(list);\n list.data = {\n rows: [\n html`
row 1
`,\n ],\n };\n assert.isNotNull(list.shadowRoot);\n\n // checks that list contains 1 row\n const rows = list.shadowRoot.querySelectorAll('.row');\n assert.strictEqual(rows.length, 1);\n\n // checks that list does not render button for expanding\n const iconSpan = list.shadowRoot.querySelector('span.arrow-icon');\n assert.isNull(iconSpan);\n const button = list.shadowRoot.querySelector('button.arrow-icon-button');\n assert.isNull(button);\n });\n});\n"]} \ No newline at end of file +{"version":3,"file":"ExpandableList.test.js","sourceRoot":"","sources":["../../../../../../../front_end/ui/components/expandable_list/ExpandableList.test.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,EAAC,oBAAoB,EAAC,MAAM,gCAAgC,CAAC;AACpE,OAAO,EAAe,aAAa,EAAC,MAAM,qCAAqC,CAAC;AAChF,OAAO,KAAK,OAAO,MAAM,4BAA4B,CAAC;AAEtD,OAAO,KAAK,cAAc,MAAM,sBAAsB,CAAC;AAEvD,MAAM,EAAC,IAAI,EAAC,GAAG,OAAO,CAAC;AAEvB,QAAQ,CAAC,gBAAgB,EAAE,GAAG,EAAE;IAC9B,EAAE,CAAC,iBAAiB,EAAE,KAAK,IAAI,EAAE;QAC/B,MAAM,IAAI,GAAG,IAAI,cAAc,CAAC,cAAc,CAAC,cAAc,EAAE,CAAC;QAChE,oBAAoB,CAAC,IAAI,CAAC,CAAC;QAC3B,IAAI,CAAC,IAAI,GAAG;YACV,IAAI,EAAE;gBACJ,IAAI,CAAA,8BAA8B;gBAClC,IAAI,CAAA,8BAA8B;aACnC;SACF,CAAC;QACF,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QAElC,6CAA6C;QAC7C,IAAI,IAAI,GAAG,IAAI,CAAC,UAAU,CAAC,gBAAgB,CAAC,MAAM,CAAC,CAAC;QACpD,MAAM,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;QACzB,MAAM,QAAQ,GAAG,IAAI,CAAC,UAAU,CAAC,aAAa,CAAc,iBAAiB,CAAC,CAAC;QAC/E,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC;QAC3B,MAAM,CAAC,OAAO,CAAC,QAAQ,EAAE,SAAS,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC,CAAC;QAEzD,2DAA2D;QAC3D,MAAM,MAAM,GAAG,IAAI,CAAC,UAAU,CAAC,aAAa,CAAc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,oBAAoB,CAAC,IAAI,CAAC,CAAC;QAC3B,IAAI,CAAC,IAAI,GAAG;YACV,IAAI,EAAE;gBACJ,IAAI,CAAA,8BAA8B;aACnC;SACF,CAAC;QACF,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QAElC,kCAAkC;QAClC,MAAM,IAAI,GAAG,IAAI,CAAC,UAAU,CAAC,gBAAgB,CAAC,MAAM,CAAC,CAAC;QACtD,MAAM,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;QAEzB,wDAAwD;QACxD,MAAM,QAAQ,GAAG,IAAI,CAAC,UAAU,CAAC,aAAa,CAAc,iBAAiB,CAAC,CAAC;QAC/E,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;QACxB,MAAM,MAAM,GAAG,IAAI,CAAC,UAAU,CAAC,aAAa,CAAc,0BAA0B,CAAC,CAAC;QACtF,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IACxB,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["// Copyright 2021 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport {renderElementIntoDOM} from '../../../testing/DOMHelpers.js';\nimport {MutationType, withMutations} from '../../../testing/MutationHelpers.js';\nimport * as LitHtml from '../../lit-html/lit-html.js';\n\nimport * as ExpandableList from './expandable_list.js';\n\nconst {html} = LitHtml;\n\ndescribe('ExpandableList', () => {\n it('can be expanded', async () => {\n const list = new ExpandableList.ExpandableList.ExpandableList();\n renderElementIntoDOM(list);\n list.data = {\n rows: [\n html`
row 1
`,\n html`
row 2
`,\n ],\n };\n assert.isNotNull(list.shadowRoot);\n\n // checks that list is not expanded initially\n let rows = list.shadowRoot.querySelectorAll('.row');\n assert.lengthOf(rows, 1);\n const iconSpan = list.shadowRoot.querySelector('span.arrow-icon');\n assert.isNotNull(iconSpan);\n assert.isFalse(iconSpan?.classList.contains('expanded'));\n\n // checks that clicking button expands list by adding a div\n const button = list.shadowRoot.querySelector('button.arrow-icon-button');\n await withMutations([{target: 'div', type: MutationType.ADD, max: 1}], list.shadowRoot, () => {\n button?.click();\n });\n\n // checks that list is expanded\n assert.isTrue(iconSpan?.classList.contains('expanded'));\n rows = list.shadowRoot.querySelectorAll('.row');\n assert.lengthOf(rows, 2);\n });\n\n it('does not render when given 0 rows', async () => {\n const list = new ExpandableList.ExpandableList.ExpandableList();\n renderElementIntoDOM(list);\n list.data = {\n rows: [],\n };\n assert.isNotNull(list.shadowRoot);\n\n // checks that list is not rendered\n const rows = list.shadowRoot.querySelectorAll('.row');\n assert.lengthOf(rows, 0);\n const iconSpan = list.shadowRoot.querySelector('span.arrow-icon');\n assert.isNull(iconSpan);\n });\n\n it('cannot be expanded when given 1 row', async () => {\n const list = new ExpandableList.ExpandableList.ExpandableList();\n renderElementIntoDOM(list);\n list.data = {\n rows: [\n html`
row 1
`,\n ],\n };\n assert.isNotNull(list.shadowRoot);\n\n // checks that list contains 1 row\n const rows = list.shadowRoot.querySelectorAll('.row');\n assert.lengthOf(rows, 1);\n\n // checks that list does not render button for expanding\n const iconSpan = list.shadowRoot.querySelector('span.arrow-icon');\n assert.isNull(iconSpan);\n const button = list.shadowRoot.querySelector('button.arrow-icon-button');\n assert.isNull(button);\n });\n});\n"]} \ No newline at end of file diff --git a/public/ui/components/helpers/helpers.test.js b/public/ui/components/helpers/helpers.test.js index e8ab7a6ef..a5a533ae9 100644 --- a/public/ui/components/helpers/helpers.test.js +++ b/public/ui/components/helpers/helpers.test.js @@ -2,10 +2,9 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. import * as LitHtml from '../../lit-html/lit-html.js'; -import * as Coordinator from '../render_coordinator/render_coordinator.js'; +import * as RenderCoordinator from '../render_coordinator/render_coordinator.js'; import * as ComponentHelpers from './helpers.js'; const { html } = LitHtml; -const coordinator = Coordinator.RenderCoordinator.RenderCoordinator.instance(); const TestElement = class extends HTMLElement { renderCount = 0; renderAsyncCount = 0; @@ -81,7 +80,7 @@ describe('ComponentHelpers', () => { const element = new TestElement(); void ComponentHelpers.ScheduledRender.scheduleRender(element, element.renderBound); void ComponentHelpers.ScheduledRender.scheduleRender(element, element.renderBound); - await coordinator.done(); + await RenderCoordinator.done(); assert.strictEqual(element.renderCount, 1); }); it('handles async callbacks', async () => { @@ -90,7 +89,7 @@ describe('ComponentHelpers', () => { void ComponentHelpers.ScheduledRender.scheduleRender(element, element.renderAsyncBound); await element.renderAsyncBound(); }); - await coordinator.done(); + await RenderCoordinator.done(); assert.strictEqual(element.renderAsyncCount, 2); }); it('re-renders if second render call is made during the first', async () => { @@ -99,7 +98,7 @@ describe('ComponentHelpers', () => { void ComponentHelpers.ScheduledRender.scheduleRender(element, element.renderBound); element.renderBound(); }); - await coordinator.done(); + await RenderCoordinator.done(); assert.strictEqual(element.renderCount, 2); }); }); diff --git a/public/ui/components/helpers/helpers.test.js.map b/public/ui/components/helpers/helpers.test.js.map index abfbdec56..e07cf491c 100644 --- a/public/ui/components/helpers/helpers.test.js.map +++ b/public/ui/components/helpers/helpers.test.js.map @@ -1 +1 @@ -{"version":3,"file":"helpers.test.js","sourceRoot":"","sources":["../../../../../../../front_end/ui/components/helpers/helpers.test.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,KAAK,OAAO,MAAM,4BAA4B,CAAC;AACtD,OAAO,KAAK,WAAW,MAAM,6CAA6C,CAAC;AAE3E,OAAO,KAAK,gBAAgB,MAAM,cAAc,CAAC;AAEjD,MAAM,EAAC,IAAI,EAAC,GAAG,OAAO,CAAC;AAEvB,MAAM,WAAW,GAAG,WAAW,CAAC,iBAAiB,CAAC,iBAAiB,CAAC,QAAQ,EAAE,CAAC;AAE/E,MAAM,WAAW,GAAG,KAAM,SAAQ,WAAW;IAC3C,WAAW,GAAG,CAAC,CAAC;IAChB,gBAAgB,GAAG,CAAC,CAAC;IAC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EAAE;gBACjE,KAAK,gBAAgB,CAAC,eAAe,CAAC,cAAc,CAAC,OAAO,EAAE,OAAO,CAAC,WAAW,CAAC,CAAC;gBAEnF,OAAO,CAAC,WAAW,EAAE,CAAC;YACxB,CAAC,CAAC,CAAC;YAEH,MAAM,WAAW,CAAC,IAAI,EAAE,CAAC;YACzB,MAAM,CAAC,WAAW,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC;QAC7C,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["// Copyright 2020 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport * as LitHtml from '../../lit-html/lit-html.js';\nimport * as Coordinator from '../render_coordinator/render_coordinator.js';\n\nimport * as ComponentHelpers from './helpers.js';\n\nconst {html} = LitHtml;\n\nconst coordinator = Coordinator.RenderCoordinator.RenderCoordinator.instance();\n\nconst TestElement = class extends HTMLElement {\n renderCount = 0;\n renderAsyncCount = 0;\n readonly renderBound = this.#render.bind(this);\n readonly renderAsyncBound = this.#renderAsync.bind(this);\n #render() {\n if (!ComponentHelpers.ScheduledRender.isScheduledRender(this)) {\n throw new Error('Render is not scheduled');\n }\n\n this.renderCount++;\n }\n #renderAsync() {\n if (!ComponentHelpers.ScheduledRender.isScheduledRender(this)) {\n throw new Error('Render is not scheduled');\n }\n\n return new Promise(resolve => {\n setTimeout(() => {\n this.renderAsyncCount++;\n resolve();\n }, 40);\n });\n }\n};\ncustomElements.define('x-devtools-test-element', TestElement);\n\ndescribe('ComponentHelpers', () => {\n describe('Directives', () => {\n describe('nodeRenderedCallback', () => {\n it('runs when any node is rendered', () => {\n const targetDiv = document.createElement('div');\n const callback = sinon.spy();\n function fakeComponentRender(this: HTMLDivElement) {\n LitHtml.render(\n // clang-format off\n html`\n \n hello world\n `,\n // clang-format on\n targetDiv, {host: this});\n }\n fakeComponentRender.call(targetDiv);\n assert.isNotEmpty(targetDiv.innerHTML);\n assert.strictEqual(callback.callCount, 1);\n });\n\n it('runs again when Lit re-renders', () => {\n const targetDiv = document.createElement('div');\n const callback = sinon.spy();\n function fakeComponentRender(this: HTMLDivElement, output: string) {\n LitHtml.render(\n // clang-format off\n html`\n \n ${output}\n `,\n // clang-format on\n targetDiv, {host: this});\n }\n fakeComponentRender.call(targetDiv, 'render one');\n assert.strictEqual(callback.callCount, 1);\n fakeComponentRender.call(targetDiv, 'render two');\n assert.strictEqual(callback.callCount, 2);\n });\n });\n });\n\n describe('scheduleRender', () => {\n it('throws if renders are unscheduled', () => {\n const element = new TestElement();\n assert.throws(() => {\n element.renderBound();\n }, 'Render is not scheduled');\n });\n\n it('only renders once if second render call is made before the first has been handled', async () => {\n const element = new TestElement();\n void ComponentHelpers.ScheduledRender.scheduleRender(element, element.renderBound);\n void ComponentHelpers.ScheduledRender.scheduleRender(element, element.renderBound);\n\n await coordinator.done();\n assert.strictEqual(element.renderCount, 1);\n });\n\n it('handles async callbacks', async () => {\n const element = new TestElement();\n void ComponentHelpers.ScheduledRender.scheduleRender(element, async () => {\n void ComponentHelpers.ScheduledRender.scheduleRender(element, element.renderAsyncBound);\n\n await element.renderAsyncBound();\n });\n\n await coordinator.done();\n assert.strictEqual(element.renderAsyncCount, 2);\n });\n\n it('re-renders if second render call is made during the first', async () => {\n const element = new TestElement();\n void ComponentHelpers.ScheduledRender.scheduleRender(element, () => {\n void ComponentHelpers.ScheduledRender.scheduleRender(element, element.renderBound);\n\n element.renderBound();\n });\n\n await coordinator.done();\n assert.strictEqual(element.renderCount, 2);\n });\n });\n});\n"]} \ No newline at end of file +{"version":3,"file":"helpers.test.js","sourceRoot":"","sources":["../../../../../../../front_end/ui/components/helpers/helpers.test.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,KAAK,OAAO,MAAM,4BAA4B,CAAC;AACtD,OAAO,KAAK,iBAAiB,MAAM,6CAA6C,CA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,EAAE,CAAC,CAAC,CAAC;QAClD,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,2DAA2D,EAAE,KAAK,IAAI,EAAE;YACzE,MAAM,OAAO,GAAG,IAAI,WAAW,EAAE,CAAC;YAClC,KAAK,gBAAgB,CAAC,eAAe,CAAC,cAAc,CAAC,OAAO,EAAE,GAAG,EAAE;gBACjE,KAAK,gBAAgB,CAAC,eAAe,CAAC,cAAc,CAAC,OAAO,EAAE,OAAO,CAAC,WAAW,CAAC,CAAC;gBAEnF,OAAO,CAAC,WAAW,EAAE,CAAC;YACxB,CAAC,CAAC,CAAC;YAEH,MAAM,iBAAiB,CAAC,IAAI,EAAE,CAAC;YAC/B,MAAM,CAAC,WAAW,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC;QAC7C,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["// Copyright 2020 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport * as LitHtml from '../../lit-html/lit-html.js';\nimport * as RenderCoordinator from '../render_coordinator/render_coordinator.js';\n\nimport * as ComponentHelpers from './helpers.js';\n\nconst {html} = LitHtml;\n\nconst TestElement = class extends HTMLElement {\n renderCount = 0;\n renderAsyncCount = 0;\n readonly renderBound = this.#render.bind(this);\n readonly renderAsyncBound = this.#renderAsync.bind(this);\n #render() {\n if (!ComponentHelpers.ScheduledRender.isScheduledRender(this)) {\n throw new Error('Render is not scheduled');\n }\n\n this.renderCount++;\n }\n #renderAsync() {\n if (!ComponentHelpers.ScheduledRender.isScheduledRender(this)) {\n throw new Error('Render is not scheduled');\n }\n\n return new Promise(resolve => {\n setTimeout(() => {\n this.renderAsyncCount++;\n resolve();\n }, 40);\n });\n }\n};\ncustomElements.define('x-devtools-test-element', TestElement);\n\ndescribe('ComponentHelpers', () => {\n describe('Directives', () => {\n describe('nodeRenderedCallback', () => {\n it('runs when any node is rendered', () => {\n const targetDiv = document.createElement('div');\n const callback = sinon.spy();\n function fakeComponentRender(this: HTMLDivElement) {\n LitHtml.render(\n // clang-format off\n html`\n \n hello world\n `,\n // clang-format on\n targetDiv, {host: this});\n }\n fakeComponentRender.call(targetDiv);\n assert.isNotEmpty(targetDiv.innerHTML);\n assert.strictEqual(callback.callCount, 1);\n });\n\n it('runs again when Lit re-renders', () => {\n const targetDiv = document.createElement('div');\n const callback = sinon.spy();\n function fakeComponentRender(this: HTMLDivElement, output: string) {\n LitHtml.render(\n // clang-format off\n html`\n \n ${output}\n `,\n // clang-format on\n targetDiv, {host: this});\n }\n fakeComponentRender.call(targetDiv, 'render one');\n assert.strictEqual(callback.callCount, 1);\n fakeComponentRender.call(targetDiv, 'render two');\n assert.strictEqual(callback.callCount, 2);\n });\n });\n });\n\n describe('scheduleRender', () => {\n it('throws if renders are unscheduled', () => {\n const element = new TestElement();\n assert.throws(() => {\n element.renderBound();\n }, 'Render is not scheduled');\n });\n\n it('only renders once if second render call is made before the first has been handled', async () => {\n const element = new TestElement();\n void ComponentHelpers.ScheduledRender.scheduleRender(element, element.renderBound);\n void ComponentHelpers.ScheduledRender.scheduleRender(element, element.renderBound);\n\n await RenderCoordinator.done();\n assert.strictEqual(element.renderCount, 1);\n });\n\n it('handles async callbacks', async () => {\n const element = new TestElement();\n void ComponentHelpers.ScheduledRender.scheduleRender(element, async () => {\n void ComponentHelpers.ScheduledRender.scheduleRender(element, element.renderAsyncBound);\n\n await element.renderAsyncBound();\n });\n\n await RenderCoordinator.done();\n assert.strictEqual(element.renderAsyncCount, 2);\n });\n\n it('re-renders if second render call is made during the first', async () => {\n const element = new TestElement();\n void ComponentHelpers.ScheduledRender.scheduleRender(element, () => {\n void ComponentHelpers.ScheduledRender.scheduleRender(element, element.renderBound);\n\n element.renderBound();\n });\n\n await RenderCoordinator.done();\n assert.strictEqual(element.renderCount, 2);\n });\n });\n});\n"]} \ No newline at end of file diff --git a/public/ui/components/helpers/scheduled-render.js b/public/ui/components/helpers/scheduled-render.js index d76a2e99c..cd654d04e 100644 --- a/public/ui/components/helpers/scheduled-render.js +++ b/public/ui/components/helpers/scheduled-render.js @@ -1,8 +1,7 @@ // Copyright 2021 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import * as Coordinator from '../render_coordinator/render_coordinator.js'; -const coordinator = Coordinator.RenderCoordinator.RenderCoordinator.instance(); +import * as RenderCoordinator from '../render_coordinator/render_coordinator.js'; const pendingRenders = new WeakSet(); const activeRenders = new WeakSet(); const subsequentRender = new WeakMap(); @@ -43,7 +42,7 @@ export async function scheduleRender(component, callback) { wrappedCallbacks.set(callback, wrappedCallback); } // Track that there is render rendering, wait for it to finish, and stop tracking. - await coordinator.write(wrappedCallback); + await RenderCoordinator.write(wrappedCallback); // If during the render there was another schedule render call, get // the callback and schedule it to happen now. if (subsequentRender.has(component)) { diff --git a/public/ui/components/helpers/scheduled-render.js.map b/public/ui/components/helpers/scheduled-render.js.map index 9e15b1b5b..8d8f6a1f9 100644 --- a/public/ui/components/helpers/scheduled-render.js.map +++ b/public/ui/components/helpers/scheduled-render.js.map @@ -1 +1 @@ -{"version":3,"file":"scheduled-render.js","sourceRoot":"","sources":["../../../../../../../front_end/ui/components/helpers/scheduled-render.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAC7B,OAAO,KAAK,WAAW,MAAM,6CAA6C,CAAC;AAE3E,MAAM,WAAW,GAAG,WAAW,CAAC,iBAAiB,CAAC,iBAAiB,CAAC,QAAQ,EAAE,CAAC;AAC/E,MAAM,cAAc,GAAG,IAAI,OAAO,EAAe,CAAC;AAClD,MAAM,aAAa,GAAG,IAAI,OAAO,EAAe,CAAC;AACjD,MAAM,gBAAgB,GAAG,IAAI,OAAO,EAA2B,CAAC;AAChE,MAAM,gBAAgB,GAAG,IAAI,OAAO,EAA0B,CAAC;AAC/D,MAAM,CAAC,KAAK,UAAU,cAAc,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CAAC,GAAG,CAAC,SAAS,CAAC,EAAE,CAAC;QACpC,MAAM,WAAW,GAAG,gBAAgB,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;QACpD,gBAAgB,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;QACnC,IAAI,CAAC,WAAW,EAAE,CAAC;YACjB,OAAO;QACT,CAAC;QAED,KAAK,cAAc,CAAC,SAAS,EAAE,WAAW,CAAC,CAAC;IAC9C,CAAC;AACH,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,SAAsB;IACtD,OAAO,aAAa,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;AACtC,CAAC","sourcesContent":["// Copyright 2021 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\nimport * as Coordinator from '../render_coordinator/render_coordinator.js';\n\nconst coordinator = Coordinator.RenderCoordinator.RenderCoordinator.instance();\nconst pendingRenders = new WeakSet();\nconst activeRenders = new WeakSet();\nconst subsequentRender = new WeakMap void>();\nconst wrappedCallbacks = new WeakMap<() => void, () => void>();\nexport async function scheduleRender(component: HTMLElement, callback: () => void): Promise {\n // If scheduleRender is called when there is already a render scheduled for this\n // component, store the callback against the renderer for after the current\n // call has finished.\n if (activeRenders.has(component)) {\n subsequentRender.set(component, callback);\n return;\n }\n\n // If this render was already scheduled but hasn't started yet, just return.\n if (pendingRenders.has(component)) {\n return;\n }\n\n pendingRenders.add(component);\n\n // Create a wrapper around the callback so that we know that it has moved from\n // pending to active. When it has completed we remove it from the active renderers.\n let wrappedCallback = wrappedCallbacks.get(callback);\n if (!wrappedCallback) {\n wrappedCallback = async () => {\n pendingRenders.delete(component);\n activeRenders.add(component);\n try {\n await callback.call(component);\n } catch (error: unknown) {\n console.error(`ScheduledRender: rendering ${component.nodeName.toLowerCase()}:`);\n console.error(error);\n throw error;\n } finally {\n activeRenders.delete(component);\n }\n };\n\n // Store it for next time so we aren't creating wrappers unnecessarily.\n wrappedCallbacks.set(callback, wrappedCallback);\n }\n\n // Track that there is render rendering, wait for it to finish, and stop tracking.\n await coordinator.write(wrappedCallback);\n\n // If during the render there was another schedule render call, get\n // the callback and schedule it to happen now.\n if (subsequentRender.has(component)) {\n const newCallback = subsequentRender.get(component);\n subsequentRender.delete(component);\n if (!newCallback) {\n return;\n }\n\n void scheduleRender(component, newCallback);\n }\n}\n\nexport function isScheduledRender(component: HTMLElement): boolean {\n return activeRenders.has(component);\n}\n"]} \ No newline at end of file +{"version":3,"file":"scheduled-render.js","sourceRoot":"","sources":["../../../../../../../front_end/ui/components/helpers/scheduled-render.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,KAAK,iBAAiB,MAAM,6CAA6C,CAAC;AAEjF,MAAM,cAAc,GAAG,IAAI,OAAO,EAAe,CAAC;AAClD,MAAM,aAAa,GAAG,IAAI,OAAO,EAAe,CAAC;AACjD,MAAM,gBAAgB,GAAG,IAAI,OAAO,EAA2B,CAAC;AAChE,MAAM,gBAAgB,GAAG,IAAI,OAAO,EAA0B,CAAC;AAE/D,MAAM,CAAC,KAAK,UAAU,cAAc,CAAC,SAAsB,EAAE,QAAoB;IAC/E,gFAAgF;IAChF,2EAA2E;IAC3E,qBAAqB;IACrB,IAAI,aAAa,CAAC,GAAG,CAAC,SAAS,CAAC,EAAE,CAAC;QACjC,gBAAgB,CAAC,GAAG,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;QAC1C,OAAO;IACT,CAAC;IAED,4EAA4E;IAC5E,IAAI,cAAc,CAAC,GAAG,CAAC,SAAS,CAAC,EAAE,CAAC;QAClC,OAAO;IACT,CAAC;IAED,cAAc,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;IAE9B,8EAA8E;IAC9E,mFAAmF;IACnF,IAAI,eAAe,GAAG,gBAAgB,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;IACrD,IAAI,CAAC,eAAe,EAAE,CAAC;QACrB,eAAe,GAAG,KAAK,IAAI,EAAE;YAC3B,cAAc,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;YACjC,aAAa,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;YAC7B,IAAI,CAAC;gBACH,MAAM,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;YACjC,CAAC;YAAC,OAAO,KAAc,EAAE,CAAC;gBACxB,OAAO,CAAC,KAAK,CAAC,8BAA8B,SAAS,CAAC,QAAQ,CAAC,WAAW,EAAE,GAAG,CAAC,CAAC;gBACjF,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;gBACrB,MAAM,KAAK,CAAC;YACd,CAAC;oBAAS,CAAC;gBACT,aAAa,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;YAClC,CAAC;QACH,CAAC,CAAC;QAEF,uEAAuE;QACvE,gBAAgB,CAAC,GAAG,CAAC,QAAQ,EAAE,eAAe,CAAC,CAAC;IAClD,CAAC;IAED,kFAAkF;IAClF,MAAM,iBAAiB,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC;IAE/C,mEAAmE;IACnE,8CAA8C;IAC9C,IAAI,gBAAgB,CAAC,GAAG,CAAC,SAAS,CAAC,EAAE,CAAC;QACpC,MAAM,WAAW,GAAG,gBAAgB,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;QACpD,gBAAgB,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;QACnC,IAAI,CAAC,WAAW,EAAE,CAAC;YACjB,OAAO;QACT,CAAC;QAED,KAAK,cAAc,CAAC,SAAS,EAAE,WAAW,CAAC,CAAC;IAC9C,CAAC;AACH,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,SAAsB;IACtD,OAAO,aAAa,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;AACtC,CAAC","sourcesContent":["// Copyright 2021 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport * as RenderCoordinator from '../render_coordinator/render_coordinator.js';\n\nconst pendingRenders = new WeakSet();\nconst activeRenders = new WeakSet();\nconst subsequentRender = new WeakMap void>();\nconst wrappedCallbacks = new WeakMap<() => void, () => void>();\n\nexport async function scheduleRender(component: HTMLElement, callback: () => void): Promise {\n // If scheduleRender is called when there is already a render scheduled for this\n // component, store the callback against the renderer for after the current\n // call has finished.\n if (activeRenders.has(component)) {\n subsequentRender.set(component, callback);\n return;\n }\n\n // If this render was already scheduled but hasn't started yet, just return.\n if (pendingRenders.has(component)) {\n return;\n }\n\n pendingRenders.add(component);\n\n // Create a wrapper around the callback so that we know that it has moved from\n // pending to active. When it has completed we remove it from the active renderers.\n let wrappedCallback = wrappedCallbacks.get(callback);\n if (!wrappedCallback) {\n wrappedCallback = async () => {\n pendingRenders.delete(component);\n activeRenders.add(component);\n try {\n await callback.call(component);\n } catch (error: unknown) {\n console.error(`ScheduledRender: rendering ${component.nodeName.toLowerCase()}:`);\n console.error(error);\n throw error;\n } finally {\n activeRenders.delete(component);\n }\n };\n\n // Store it for next time so we aren't creating wrappers unnecessarily.\n wrappedCallbacks.set(callback, wrappedCallback);\n }\n\n // Track that there is render rendering, wait for it to finish, and stop tracking.\n await RenderCoordinator.write(wrappedCallback);\n\n // If during the render there was another schedule render call, get\n // the callback and schedule it to happen now.\n if (subsequentRender.has(component)) {\n const newCallback = subsequentRender.get(component);\n subsequentRender.delete(component);\n if (!newCallback) {\n return;\n }\n\n void scheduleRender(component, newCallback);\n }\n}\n\nexport function isScheduledRender(component: HTMLElement): boolean {\n return activeRenders.has(component);\n}\n"]} \ No newline at end of file diff --git a/public/ui/components/icon_button/FileSourceIcon.d.ts b/public/ui/components/icon_button/FileSourceIcon.d.ts index 0395d9138..65c2584ea 100644 --- a/public/ui/components/icon_button/FileSourceIcon.d.ts +++ b/public/ui/components/icon_button/FileSourceIcon.d.ts @@ -5,7 +5,6 @@ export interface FileSourceIconData { } export declare class FileSourceIcon extends HTMLElement { #private; - static readonly litTagName: import("../../lit-html/static.js").Static; constructor(iconType: string); set data(data: FileSourceIconData); get data(): FileSourceIconData; diff --git a/public/ui/components/icon_button/FileSourceIcon.js b/public/ui/components/icon_button/FileSourceIcon.js index d5256ebf1..ea770959b 100644 --- a/public/ui/components/icon_button/FileSourceIcon.js +++ b/public/ui/components/icon_button/FileSourceIcon.js @@ -6,7 +6,6 @@ import styles from './fileSourceIcon.css.js'; import { create } from './Icon.js'; const { html } = LitHtml; export class FileSourceIcon extends HTMLElement { - static litTagName = LitHtml.literal `devtools-file-source-icon`; #shadow = this.attachShadow({ mode: 'open' }); #iconType; #contentType; diff --git a/public/ui/components/icon_button/FileSourceIcon.js.map b/public/ui/components/icon_button/FileSourceIcon.js.map index 6efd5ee10..50b880a9b 100644 --- a/public/ui/components/icon_button/FileSourceIcon.js.map +++ b/public/ui/components/icon_button/FileSourceIcon.js.map @@ -1 +1 @@ -{"version":3,"file":"FileSourceIcon.js","sourceRoot":"","sources":["../../../../../../../front_end/ui/components/icon_button/FileSourceIcon.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,KAAK,OAAO,MAAM,4BAA4B,CAAC;AAEtD,OAAO,MAAM,MAAM,yBAAyB,CAAC;AAC7C,OAAO,EAAC,MAAM,EAAC,MAAM,WAAW,CAAC;AAEjC,MAAM,EAAC,IAAI,EAAC,GAAG,OAAO,CAAC;AAQvB,MAAM,OAAO,cAAe,SAAQ,WAAW;IAC7C,MAAM,CAAU,UAAU,GAAG,OAAO,CAAC,OAAO,CAAA,2BAA2B,CAAC;IAC/D,OAAO,GAAG,IAAI,CAAC,YAAY,CAAC,EAAC,IAAI,EAAE,MAAM,EAAC,CAAC,CAAC;IAErD,SAAS,CAAS;IAClB,YAAY,CAAU;IACtB,YAAY,CAAW;IACvB,YAAY,CAAW;IAEvB,YAAY,QAAgB;QAC1B,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC;IAC5B,CAAC;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sourcesContent":["// Copyright 2024 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport * as LitHtml from '../../lit-html/lit-html.js';\n\nimport styles from './fileSourceIcon.css.js';\nimport {create} from './Icon.js';\n\nconst {html} = LitHtml;\n\nexport interface FileSourceIconData {\n contentType?: string;\n hasDotBadge?: boolean;\n isDotPurple?: boolean;\n}\n\nexport class FileSourceIcon extends HTMLElement {\n static readonly litTagName = LitHtml.literal`devtools-file-source-icon`;\n readonly #shadow = this.attachShadow({mode: 'open'});\n\n #iconType: string;\n #contentType?: string;\n #hasDotBadge?: boolean;\n #isDotPurple?: boolean;\n\n constructor(iconType: string) {\n super();\n this.#iconType = iconType;\n }\n\n set data(data: FileSourceIconData) {\n this.#contentType = data.contentType;\n this.#hasDotBadge = data.hasDotBadge;\n this.#isDotPurple = data.isDotPurple;\n this.#render();\n }\n\n get data(): FileSourceIconData {\n return {\n contentType: this.#contentType,\n hasDotBadge: this.#hasDotBadge,\n isDotPurple: this.#isDotPurple,\n };\n }\n\n connectedCallback(): void {\n this.#shadow.adoptedStyleSheets = [styles];\n this.#render();\n }\n\n #render(): void {\n let iconStyles: string[] = [];\n if (this.#hasDotBadge) {\n iconStyles = this.#isDotPurple ? ['dot', 'purple'] : ['dot', 'green'];\n }\n if (this.#contentType) {\n iconStyles.push(this.#contentType);\n }\n const icon = create(this.#iconType, iconStyles.join(' '));\n\n // clang-format off\n LitHtml.render(html`${icon}`, this.#shadow, {\n host: this,\n });\n // clang-format on\n }\n}\n\ncustomElements.define('devtools-file-source-icon', FileSourceIcon);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'devtools-file-source-icon': FileSourceIcon;\n }\n}\n"]} \ No newline at end of file +{"version":3,"file":"FileSourceIcon.js","sourceRoot":"","sources":["../../../../../../../front_end/ui/components/icon_button/FileSourceIcon.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,O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C;QACxE,CAAC;QACD,IAAI,IAAI,CAAC,YAAY,EAAE,CAAC;YACtB,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;QACrC,CAAC;QACD,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,SAAS,EAAE,UAAU,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;QAE1D,mBAAmB;QACnB,OAAO,CAAC,MAAM,CAAC,IAAI,CAAA,GAAG,IAAI,EAAE,EAAE,IAAI,CAAC,OAAO,EAAE;YAC1C,IAAI,EAAE,IAAI;SACX,CAAC,CAAC;QACH,kBAAkB;IACpB,CAAC;CACF;AAED,cAAc,CAAC,MAAM,CAAC,2BAA2B,EAAE,cAAc,CAAC,CAAC","sourcesContent":["// Copyright 2024 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport * as LitHtml from '../../lit-html/lit-html.js';\n\nimport styles from './fileSourceIcon.css.js';\nimport {create} from './Icon.js';\n\nconst {html} = LitHtml;\n\nexport interface FileSourceIconData {\n contentType?: string;\n hasDotBadge?: boolean;\n isDotPurple?: boolean;\n}\n\nexport class FileSourceIcon extends HTMLElement {\n readonly #shadow = this.attachShadow({mode: 'open'});\n\n #iconType: string;\n #contentType?: string;\n #hasDotBadge?: boolean;\n #isDotPurple?: boolean;\n\n constructor(iconType: string) {\n super();\n this.#iconType = iconType;\n }\n\n set data(data: FileSourceIconData) {\n this.#contentType = data.contentType;\n this.#hasDotBadge = data.hasDotBadge;\n this.#isDotPurple = data.isDotPurple;\n this.#render();\n }\n\n get data(): FileSourceIconData {\n return {\n contentType: this.#contentType,\n hasDotBadge: this.#hasDotBadge,\n isDotPurple: this.#isDotPurple,\n };\n }\n\n connectedCallback(): void {\n this.#shadow.adoptedStyleSheets = [styles];\n this.#render();\n }\n\n #render(): void {\n let iconStyles: string[] = [];\n if (this.#hasDotBadge) {\n iconStyles = this.#isDotPurple ? ['dot', 'purple'] : ['dot', 'green'];\n }\n if (this.#contentType) {\n iconStyles.push(this.#contentType);\n }\n const icon = create(this.#iconType, iconStyles.join(' '));\n\n // clang-format off\n LitHtml.render(html`${icon}`, this.#shadow, {\n host: this,\n });\n // clang-format on\n }\n}\n\ncustomElements.define('devtools-file-source-icon', FileSourceIcon);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'devtools-file-source-icon': FileSourceIcon;\n }\n}\n"]} \ No newline at end of file diff --git a/public/ui/components/icon_button/IconButton.test.js b/public/ui/components/icon_button/IconButton.test.js index ab70c9adc..9bd96c3da 100644 --- a/public/ui/components/icon_button/IconButton.test.js +++ b/public/ui/components/icon_button/IconButton.test.js @@ -33,7 +33,7 @@ describe('IconButton', () => { it('renders correctly with one icon', () => { const { shadowRoot } = renderIconButton({ clickHandler: () => { }, groups: [defaultIcon] }); const icons = extractIconGroups(shadowRoot); - assert.strictEqual(icons.length, 1); + assert.lengthOf(icons, 1); assert.deepEqual(icons.map(c => c.label), ['1']); const iconNames = icons.map(c => 'iconName' in c.iconData ? c.iconData.iconName : undefined); assert.deepEqual(iconNames, ['cross-circle']); @@ -51,7 +51,7 @@ describe('IconButton', () => { ], }); const icons = extractIconGroups(shadowRoot); - assert.strictEqual(icons.length, 2); + assert.lengthOf(icons, 2); assert.deepEqual(icons.map(c => c.label), ['1', '12']); const iconNames = icons.map(c => 'iconName' in c.iconData ? c.iconData.iconName : undefined); assert.deepEqual(iconNames, ['cross-circle', 'warning']); @@ -60,7 +60,7 @@ describe('IconButton', () => { it('renders correctly with one icon', () => { const { shadowRoot } = renderIconButton({ clickHandler: () => { }, groups: [defaultIcon], compact: true }); const icons = extractIconGroups(shadowRoot); - assert.strictEqual(icons.length, 1); + assert.lengthOf(icons, 1); assert.deepEqual(icons.map(c => c.label), [null]); const iconNames = icons.map(c => 'iconName' in c.iconData ? c.iconData.iconName : undefined); assert.deepEqual(iconNames, ['cross-circle']); @@ -79,7 +79,7 @@ describe('IconButton', () => { compact: true, }); const icons = extractIconGroups(shadowRoot); - assert.strictEqual(icons.length, 1); + assert.lengthOf(icons, 1); assert.deepEqual(icons.map(c => c.label), [null]); const iconNames = icons.map(c => 'iconName' in c.iconData ? c.iconData.iconName : undefined); assert.deepEqual(iconNames, ['cross-circle']); @@ -98,7 +98,7 @@ describe('IconButton', () => { ], }); const icons = extractIconGroups(shadowRoot); - assert.strictEqual(icons.length, 1); + assert.lengthOf(icons, 1); assert.deepEqual(icons.map(c => c.label), ['1']); const iconNames = icons.map(c => 'iconName' in c.iconData ? c.iconData.iconName : undefined); assert.deepEqual(iconNames, ['cross-circle']); @@ -117,7 +117,7 @@ describe('IconButton', () => { ], }); const icons = extractIconGroups(shadowRoot); - assert.strictEqual(icons.length, 1); + assert.lengthOf(icons, 1); const icon = icons[0]; assert.strictEqual(icon.iconData.height, '2ex'); assert.strictEqual(icon.iconData.width, '3ex'); @@ -136,14 +136,14 @@ describe('IconButton', () => { ], }); const iconsBefore = extractIconGroups(shadowRoot); - assert.strictEqual(iconsBefore.length, 2); + assert.lengthOf(iconsBefore, 2); assert.deepEqual(iconsBefore.map(c => c.label), ['1', '31']); const iconNamesBefore = iconsBefore.map(c => 'iconName' in c.iconData ? c.iconData.iconName : undefined); assert.deepEqual(iconNamesBefore, ['cross-circle', 'warning']); const data = component.data; component.data = { ...data, groups: data.groups.map((group, index) => ({ ...group, text: `${index}` })) }; const iconsAfter = extractIconGroups(shadowRoot); - assert.strictEqual(iconsAfter.length, 2); + assert.lengthOf(iconsAfter, 2); assert.deepEqual(iconsAfter.map(c => c.label), ['0', '1']); const iconNamesAfter = iconsAfter.map(c => 'iconName' in c.iconData ? c.iconData.iconName : undefined); assert.deepEqual(iconNamesAfter, ['cross-circle', 'warning']); diff --git a/public/ui/components/icon_button/IconButton.test.js.map b/public/ui/components/icon_button/IconButton.test.js.map index 9325b82a8..1eebbca9e 100644 --- a/public/ui/components/icon_button/IconButton.test.js.map +++ b/public/ui/components/icon_button/IconButton.test.js.map @@ -1 +1 @@ -{"version":3,"file":"IconButton.test.js","sourceRoot":"","sources":["../../../../../../../front_end/ui/components/icon_button/IconButton.test.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,EACL,cAAc,EACd,oBAAoB,GACrB,MAAM,gCAAgC,CAAC;AAExC,OAAO,KAAK,UAAU,MAAM,kBAAkB,CAAC;AAE/C,MAAM,gBAAgB,GAAG,CAAC,IAA0C,EACM,EAAE;IACtE,MAAM,SAAS,GAAG,IAAI,UAAU,CAAC,UAAU,CAAC,UAAU,EAAE,CAAC;IACzD,SAAS,CAAC,IAAI,GAAG,IAAI,CAAC;IACtB,oBAAoB,CAAC,SAAS,CAAC,CAAC;IAChC,MAAM,CAAC,SAAS,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC;IACvC,OAAO,EAAC,SAAS,EAAE,UAAU,EAAE,SAAS,CAAC,UAAU,EAAC,CAAC;AACvD,CAAC,CAAC;AAEN,MAAM,WAAW,GAA2C;IAC1D,QAAQ,EAAE,cAAc;IACxB,SAAS,EAAE,mBAAmB;IAC9B,IAAI,EAAE,GAAG;CACV,CAAC;AAEF,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,UAAsB,EAAE,EAAE;IAC1D,MAAM,KAAK,GAAG,UAAU,CAAC,gBAAgB,CAAC,cAAc,CAAC,CAAC;IAC1D,cAAc,CAAC,KAAK,EAAE,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC5C,MAAM,MAAM,GAAG,UAAU,CAAC,gBAAgB,CAAC,oBAAoB,CAAC,CAAC;IACjE,cAAc,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC;IACxC,MAAM,CAAC,KAAK,CAAC,MAAM,KAAK,MAAM,CAAC,MAAM,EAAE,8CAA8C,CAAC,CAAC;IACvF,MAAM,UAAU,GAAG,EAAE,CAAC;IACtB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,C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AAG,EAAE;QAC/B,EAAE,CAAC,yBAAyB,EAAE,GAAG,EAAE;YACjC,MAAM,sBAAsB,GAAG,gBAAgB,CAAC;YAChD,MAAM,EAAC,UAAU,EAAC,GACd,gBAAgB,CAAC,EAAC,YAAY,EAAE,GAAG,EAAE,GAAE,CAAC,EAAE,MAAM,EAAE,CAAC,WAAW,CAAC,EAAE,cAAc,EAAE,sBAAsB,EAAC,CAAC,CAAC;YAC9G,MAAM,cAAc,GAAG,UAAU,CAAC,aAAa,CAAC,QAAQ,CAAE,CAAC,YAAY,CAAC,YAAY,CAAC,CAAC;YACtF,MAAM,CAAC,SAAS,CAAC,cAAc,EAAE,sBAAsB,CAAC,CAAC;QAC3D,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,4BAA4B,EAAE,GAAG,EAAE;YACpC,MAAM,EAAC,UAAU,EAAC,GAAG,gBAAgB,CAAC,EAAC,YAAY,EAAE,GAAG,EAAE,GAAE,CAAC,EAAE,MAAM,EAAE,CAAC,WAAW,CAAC,EAAC,CAAC,CAAC;YACvF,MAAM,cAAc,GAAG,UAAU,CAAC,aAAa,CAAC,QAAQ,CAAE,CAAC,YAAY,CAAC,YAAY,CAAC,CAAC;YACtF,MAAM,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC;QAChC,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["// Copyright 2020 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport {\n assertElements,\n renderElementIntoDOM,\n} from '../../../testing/DOMHelpers.js';\n\nimport * as IconButton from './icon_button.js';\n\nconst renderIconButton = (data: IconButton.IconButton.IconButtonData):\n {component: IconButton.IconButton.IconButton, shadowRoot: ShadowRoot} => {\n const component = new IconButton.IconButton.IconButton();\n component.data = data;\n renderElementIntoDOM(component);\n assert.isNotNull(component.shadowRoot);\n return {component, shadowRoot: component.shadowRoot};\n };\n\nconst defaultIcon: IconButton.IconButton.IconWithTextData = {\n iconName: 'cross-circle',\n iconColor: 'var(--icon-error)',\n text: '1',\n};\n\nexport const extractIconGroups = (shadowRoot: ShadowRoot) => {\n const icons = shadowRoot.querySelectorAll('.status-icon');\n assertElements(icons, IconButton.Icon.Icon);\n const labels = shadowRoot.querySelectorAll('.icon-button-title');\n assertElements(labels, HTMLSpanElement);\n assert(icons.length === labels.length, 'Expected icons and labels to appear in pairs');\n const iconGroups = [];\n for (let i = 0; i < icons.length; ++i) {\n const labelElement = labels[i];\n const label = window.getComputedStyle(labelElement).display === 'none' ? null : labelElement.textContent;\n iconGroups.push({iconData: icons[i].data, label});\n }\n return iconGroups;\n};\n\ndescribe('IconButton', () => {\n it('renders correctly with one icon', () => {\n const {shadowRoot} = renderIconButton({clickHandler: () => {}, groups: [defaultIcon]});\n\n const icons = extractIconGroups(shadowRoot);\n assert.strictEqual(icons.length, 1);\n assert.deepEqual(icons.map(c => c.label), ['1']);\n const iconNames = icons.map(c => 'iconName' in c.iconData ? c.iconData.iconName : undefined);\n assert.deepEqual(iconNames, ['cross-circle']);\n });\n\n it('renders correctly with two icons', () => {\n const {shadowRoot} = renderIconButton({\n clickHandler: () => {},\n groups: [\n defaultIcon,\n {\n iconName: 'warning',\n iconColor: 'var(--icon-warning)',\n text: '12',\n },\n ],\n });\n\n const icons = extractIconGroups(shadowRoot);\n assert.strictEqual(icons.length, 2);\n assert.deepEqual(icons.map(c => c.label), ['1', '12']);\n const iconNames = icons.map(c => 'iconName' in c.iconData ? c.iconData.iconName : undefined);\n assert.deepEqual(iconNames, ['cross-circle', 'warning']);\n });\n\n describe('compact mode', () => {\n it('renders correctly with one icon', () => {\n const {shadowRoot} = renderIconButton({clickHandler: () => {}, groups: [defaultIcon], compact: true});\n\n const icons = extractIconGroups(shadowRoot);\n assert.strictEqual(icons.length, 1);\n assert.deepEqual(icons.map(c => c.label), [null]);\n const iconNames = icons.map(c => 'iconName' in c.iconData ? c.iconData.iconName : undefined);\n assert.deepEqual(iconNames, ['cross-circle']);\n });\n\n it('renders correctly with two icons', () => {\n const {shadowRoot} = renderIconButton({\n clickHandler: () => {},\n groups: [\n defaultIcon,\n {\n iconName: 'warning',\n iconColor: 'var(--icon-warning)',\n text: '12',\n },\n ],\n compact: true,\n });\n\n const icons = extractIconGroups(shadowRoot);\n assert.strictEqual(icons.length, 1);\n assert.deepEqual(icons.map(c => c.label), [null]);\n const iconNames = icons.map(c => 'iconName' in c.iconData ? c.iconData.iconName : undefined);\n assert.deepEqual(iconNames, ['cross-circle']);\n });\n });\n\n it('renders correctly with two icons where one text is undefined', () => {\n const {shadowRoot} = renderIconButton({\n clickHandler: () => {},\n groups: [\n {\n iconName: 'warning',\n iconColor: 'var(--icon-warning)',\n text: undefined,\n },\n defaultIcon,\n ],\n });\n\n const icons = extractIconGroups(shadowRoot);\n assert.strictEqual(icons.length, 1);\n assert.deepEqual(icons.map(c => c.label), ['1']);\n const iconNames = icons.map(c => 'iconName' in c.iconData ? c.iconData.iconName : undefined);\n assert.deepEqual(iconNames, ['cross-circle']);\n });\n\n it('renders correctly with a customly sized icon', () => {\n const {shadowRoot} = renderIconButton({\n clickHandler: () => {},\n groups: [\n {\n iconName: 'warning',\n iconColor: 'var(--icon-warning)',\n text: 'Text',\n iconHeight: '2ex',\n iconWidth: '3ex',\n },\n ],\n });\n\n const icons = extractIconGroups(shadowRoot);\n assert.strictEqual(icons.length, 1);\n const icon = icons[0];\n assert.strictEqual(icon.iconData.height, '2ex');\n assert.strictEqual(icon.iconData.width, '3ex');\n });\n\n describe('data getter and setter', () => {\n it('renders correctly with two icons', () => {\n const {component, shadowRoot} = renderIconButton({\n clickHandler: () => {},\n groups: [\n defaultIcon,\n {\n iconName: 'warning',\n iconColor: 'var(--icon-warning)',\n text: '31',\n },\n ],\n });\n\n const iconsBefore = extractIconGroups(shadowRoot);\n assert.strictEqual(iconsBefore.length, 2);\n assert.deepEqual(iconsBefore.map(c => c.label), ['1', '31']);\n const iconNamesBefore = iconsBefore.map(c => 'iconName' in c.iconData ? c.iconData.iconName : undefined);\n assert.deepEqual(iconNamesBefore, ['cross-circle', 'warning']);\n\n const data = component.data;\n component.data = {...data, groups: data.groups.map((group, index) => ({...group, text: `${index}`}))};\n\n const iconsAfter = extractIconGroups(shadowRoot);\n assert.strictEqual(iconsAfter.length, 2);\n assert.deepEqual(iconsAfter.map(c => c.label), ['0', '1']);\n const iconNamesAfter = iconsAfter.map(c => 'iconName' in c.iconData ? c.iconData.iconName : undefined);\n assert.deepEqual(iconNamesAfter, ['cross-circle', 'warning']);\n });\n });\n\n describe('click event', () => {\n it('is dispatched from button', async () => {\n let clickHandler: () => void = () => {};\n const clicked = new Promise(r => {\n clickHandler = r;\n });\n const {shadowRoot} = renderIconButton({clickHandler, groups: [defaultIcon]});\n const icon = shadowRoot.querySelector('.status-icon');\n assert.instanceOf(icon, IconButton.Icon.Icon);\n icon.click();\n await clicked;\n });\n\n it('is dispatched from child of button', async () => {\n let clickHandler: () => void = () => {};\n const clicked = new Promise(r => {\n clickHandler = r;\n });\n const {shadowRoot} = renderIconButton({clickHandler, groups: [defaultIcon]});\n const icon = shadowRoot.querySelector('.icon-button');\n assert.instanceOf(icon, HTMLButtonElement);\n icon.click();\n await clicked;\n });\n });\n\n describe('border', () => {\n it('is rendered when there is a click handler', async () => {\n const {shadowRoot} = renderIconButton({clickHandler: () => {}, groups: [defaultIcon]});\n const button = shadowRoot.querySelector('.icon-button');\n assert.instanceOf(button, HTMLButtonElement);\n assert.isTrue(button.classList.contains('with-click-handler'));\n });\n\n it('is omitted when requested', async () => {\n const {shadowRoot} = renderIconButton({groups: [defaultIcon]});\n const button = shadowRoot.querySelector('.icon-button');\n assert.instanceOf(button, HTMLButtonElement);\n assert.isFalse(button.classList.contains('with-click-handler'));\n });\n });\n\n describe('leading text', () => {\n it('is rendered if provided', async () => {\n const {shadowRoot} = renderIconButton({clickHandler: () => {}, groups: [defaultIcon], leadingText: 'LEAD'});\n const texts = Array.from(shadowRoot.querySelectorAll('.icon-button-title'));\n assert.deepEqual(texts.map(x => x.textContent), ['LEAD', '1']);\n });\n\n it('is omitted in compact mode even if provided', async () => {\n const {shadowRoot} =\n renderIconButton({clickHandler: () => {}, groups: [defaultIcon], leadingText: 'LEAD', compact: true});\n const texts = Array.from(shadowRoot.querySelectorAll('.icon-button-title'));\n assert.deepEqual(texts.map(x => x.textContent), ['1']);\n });\n\n it('is omitted if not provided', async () => {\n const {shadowRoot} = renderIconButton({clickHandler: () => {}, groups: [defaultIcon]});\n const texts = Array.from(shadowRoot.querySelectorAll('.icon-button-title'));\n assert.deepEqual(texts.map(x => x.textContent), ['1']);\n });\n });\n\n describe('trailing text', () => {\n it('is rendered if provided', async () => {\n const {shadowRoot} = renderIconButton({clickHandler: () => {}, groups: [defaultIcon], trailingText: 'TRAIL'});\n const texts = Array.from(shadowRoot.querySelectorAll('.icon-button-title'));\n assert.deepEqual(texts.map(x => x.textContent), ['1', 'TRAIL']);\n });\n\n it('is omitted in compact mode even if provided', async () => {\n const {shadowRoot} =\n renderIconButton({clickHandler: () => {}, groups: [defaultIcon], trailingText: 'TRAIL', compact: true});\n const texts = Array.from(shadowRoot.querySelectorAll('.icon-button-title'));\n assert.deepEqual(texts.map(x => x.textContent), ['1']);\n });\n\n it('is omitted if not provided', async () => {\n const {shadowRoot} = renderIconButton({clickHandler: () => {}, groups: [defaultIcon]});\n const texts = Array.from(shadowRoot.querySelectorAll('.icon-button-title'));\n assert.deepEqual(texts.map(x => x.textContent), ['1']);\n });\n });\n\n describe('accessible name', () => {\n it('is rendered if provided', () => {\n const expectedAccessibleName = 'AccessibleName';\n const {shadowRoot} =\n renderIconButton({clickHandler: () => {}, groups: [defaultIcon], accessibleName: expectedAccessibleName});\n const accessibleName = shadowRoot.querySelector('button')!.getAttribute('aria-label');\n assert.deepEqual(accessibleName, expectedAccessibleName);\n });\n\n it('is omitted if not provided', () => {\n const {shadowRoot} = renderIconButton({clickHandler: () => {}, groups: [defaultIcon]});\n const accessibleName = shadowRoot.querySelector('button')!.getAttribute('aria-label');\n assert.isNull(accessibleName);\n });\n });\n});\n"]} \ No newline at end of file +{"version":3,"file":"IconButton.test.js","sourceRoot":"","sources":["../../../../../../../front_end/ui/components/icon_button/IconButton.test.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,EACL,cAAc,EACd,oBAAoB,GACrB,MAAM,gCAAgC,CAAC;AAExC,OAAO,KAAK,UAAU,MAAM,kBAAkB,CAAC;AAE/C,MAAM,gBAAgB,GAAG,CAAC,IAA0C,EACM,EAAE;IACtE,MAAM,SAAS,GAAG,IAAI,UAAU,CAAC,UAAU,CAAC,UAAU,EAAE,CAAC;IACzD,SAAS,CAAC,IAAI,GAAG,IAAI,CAAC;IACtB,oBAAoB,CAAC,SAAS,CAAC,CAAC;IAChC,MAAM,CAAC,SAAS,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC;IACvC,OAAO,EAAC,SAAS,EAAE,UAAU,EAAE,SAAS,CAAC,UAAU,EAAC,CAAC;AACvD,CAAC,CAAC;AAEN,MAAM,WAAW,GAA2C;IAC1D,QAAQ,EAAE,cAAc;IACxB,SAAS,EAAE,mBAAmB;IAC9B,IAAI,EAAE,GAAG;CACV,CAAC;AAEF,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,UAAsB,EAAE,EAAE;IAC1D,MAAM,KAAK,GAAG,UAAU,CAAC,gBAAgB,CAAC,cAAc,CAAC,CAAC;IAC1D,cAAc,CAAC,KAAK,EAAE,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC5C,MAAM,MAAM,GAAG,UAAU,CAAC,gBAAgB,CAAC,oBAAoB,CAAC,CAAC;IACjE,cAAc,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC;IACxC,MAAM,CAAC,KAAK,CAAC,MAAM,KAAK,MAAM,CAAC,MAAM,EAAE,8CAA8C,CAAC,CAAC;IACvF,MAAM,UAAU,GAA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,EAAE;QAC/B,EAAE,CAAC,yBAAyB,EAAE,GAAG,EAAE;YACjC,MAAM,sBAAsB,GAAG,gBAAgB,CAAC;YAChD,MAAM,EAAC,UAAU,EAAC,GACd,gBAAgB,CAAC,EAAC,YAAY,EAAE,GAAG,EAAE,GAAE,CAAC,EAAE,MAAM,EAAE,CAAC,WAAW,CAAC,EAAE,cAAc,EAAE,sBAAsB,EAAC,CAAC,CAAC;YAC9G,MAAM,cAAc,GAAG,UAAU,CAAC,aAAa,CAAC,QAAQ,CAAE,CAAC,YAAY,CAAC,YAAY,CAAC,CAAC;YACtF,MAAM,CAAC,SAAS,CAAC,cAAc,EAAE,sBAAsB,CAAC,CAAC;QAC3D,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,4BAA4B,EAAE,GAAG,EAAE;YACpC,MAAM,EAAC,UAAU,EAAC,GAAG,gBAAgB,CAAC,EAAC,YAAY,EAAE,GAAG,EAAE,GAAE,CAAC,EAAE,MAAM,EAAE,CAAC,WAAW,CAAC,EAAC,CAAC,CAAC;YACvF,MAAM,cAAc,GAAG,UAAU,CAAC,aAAa,CAAC,QAAQ,CAAE,CAAC,YAAY,CAAC,YAAY,CAAC,CAAC;YACtF,MAAM,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC;QAChC,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["// Copyright 2020 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport {\n assertElements,\n renderElementIntoDOM,\n} from '../../../testing/DOMHelpers.js';\n\nimport * as IconButton from './icon_button.js';\n\nconst renderIconButton = (data: IconButton.IconButton.IconButtonData):\n {component: IconButton.IconButton.IconButton, shadowRoot: ShadowRoot} => {\n const component = new IconButton.IconButton.IconButton();\n component.data = data;\n renderElementIntoDOM(component);\n assert.isNotNull(component.shadowRoot);\n return {component, shadowRoot: component.shadowRoot};\n };\n\nconst defaultIcon: IconButton.IconButton.IconWithTextData = {\n iconName: 'cross-circle',\n iconColor: 'var(--icon-error)',\n text: '1',\n};\n\nexport const extractIconGroups = (shadowRoot: ShadowRoot) => {\n const icons = shadowRoot.querySelectorAll('.status-icon');\n assertElements(icons, IconButton.Icon.Icon);\n const labels = shadowRoot.querySelectorAll('.icon-button-title');\n assertElements(labels, HTMLSpanElement);\n assert(icons.length === labels.length, 'Expected icons and labels to appear in pairs');\n const iconGroups = [];\n for (let i = 0; i < icons.length; ++i) {\n const labelElement = labels[i];\n const label = window.getComputedStyle(labelElement).display === 'none' ? null : labelElement.textContent;\n iconGroups.push({iconData: icons[i].data, label});\n }\n return iconGroups;\n};\n\ndescribe('IconButton', () => {\n it('renders correctly with one icon', () => {\n const {shadowRoot} = renderIconButton({clickHandler: () => {}, groups: [defaultIcon]});\n\n const icons = extractIconGroups(shadowRoot);\n assert.lengthOf(icons, 1);\n assert.deepEqual(icons.map(c => c.label), ['1']);\n const iconNames = icons.map(c => 'iconName' in c.iconData ? c.iconData.iconName : undefined);\n assert.deepEqual(iconNames, ['cross-circle']);\n });\n\n it('renders correctly with two icons', () => {\n const {shadowRoot} = renderIconButton({\n clickHandler: () => {},\n groups: [\n defaultIcon,\n {\n iconName: 'warning',\n iconColor: 'var(--icon-warning)',\n text: '12',\n },\n ],\n });\n\n const icons = extractIconGroups(shadowRoot);\n assert.lengthOf(icons, 2);\n assert.deepEqual(icons.map(c => c.label), ['1', '12']);\n const iconNames = icons.map(c => 'iconName' in c.iconData ? c.iconData.iconName : undefined);\n assert.deepEqual(iconNames, ['cross-circle', 'warning']);\n });\n\n describe('compact mode', () => {\n it('renders correctly with one icon', () => {\n const {shadowRoot} = renderIconButton({clickHandler: () => {}, groups: [defaultIcon], compact: true});\n\n const icons = extractIconGroups(shadowRoot);\n assert.lengthOf(icons, 1);\n assert.deepEqual(icons.map(c => c.label), [null]);\n const iconNames = icons.map(c => 'iconName' in c.iconData ? c.iconData.iconName : undefined);\n assert.deepEqual(iconNames, ['cross-circle']);\n });\n\n it('renders correctly with two icons', () => {\n const {shadowRoot} = renderIconButton({\n clickHandler: () => {},\n groups: [\n defaultIcon,\n {\n iconName: 'warning',\n iconColor: 'var(--icon-warning)',\n text: '12',\n },\n ],\n compact: true,\n });\n\n const icons = extractIconGroups(shadowRoot);\n assert.lengthOf(icons, 1);\n assert.deepEqual(icons.map(c => c.label), [null]);\n const iconNames = icons.map(c => 'iconName' in c.iconData ? c.iconData.iconName : undefined);\n assert.deepEqual(iconNames, ['cross-circle']);\n });\n });\n\n it('renders correctly with two icons where one text is undefined', () => {\n const {shadowRoot} = renderIconButton({\n clickHandler: () => {},\n groups: [\n {\n iconName: 'warning',\n iconColor: 'var(--icon-warning)',\n text: undefined,\n },\n defaultIcon,\n ],\n });\n\n const icons = extractIconGroups(shadowRoot);\n assert.lengthOf(icons, 1);\n assert.deepEqual(icons.map(c => c.label), ['1']);\n const iconNames = icons.map(c => 'iconName' in c.iconData ? c.iconData.iconName : undefined);\n assert.deepEqual(iconNames, ['cross-circle']);\n });\n\n it('renders correctly with a customly sized icon', () => {\n const {shadowRoot} = renderIconButton({\n clickHandler: () => {},\n groups: [\n {\n iconName: 'warning',\n iconColor: 'var(--icon-warning)',\n text: 'Text',\n iconHeight: '2ex',\n iconWidth: '3ex',\n },\n ],\n });\n\n const icons = extractIconGroups(shadowRoot);\n assert.lengthOf(icons, 1);\n const icon = icons[0];\n assert.strictEqual(icon.iconData.height, '2ex');\n assert.strictEqual(icon.iconData.width, '3ex');\n });\n\n describe('data getter and setter', () => {\n it('renders correctly with two icons', () => {\n const {component, shadowRoot} = renderIconButton({\n clickHandler: () => {},\n groups: [\n defaultIcon,\n {\n iconName: 'warning',\n iconColor: 'var(--icon-warning)',\n text: '31',\n },\n ],\n });\n\n const iconsBefore = extractIconGroups(shadowRoot);\n assert.lengthOf(iconsBefore, 2);\n assert.deepEqual(iconsBefore.map(c => c.label), ['1', '31']);\n const iconNamesBefore = iconsBefore.map(c => 'iconName' in c.iconData ? c.iconData.iconName : undefined);\n assert.deepEqual(iconNamesBefore, ['cross-circle', 'warning']);\n\n const data = component.data;\n component.data = {...data, groups: data.groups.map((group, index) => ({...group, text: `${index}`}))};\n\n const iconsAfter = extractIconGroups(shadowRoot);\n assert.lengthOf(iconsAfter, 2);\n assert.deepEqual(iconsAfter.map(c => c.label), ['0', '1']);\n const iconNamesAfter = iconsAfter.map(c => 'iconName' in c.iconData ? c.iconData.iconName : undefined);\n assert.deepEqual(iconNamesAfter, ['cross-circle', 'warning']);\n });\n });\n\n describe('click event', () => {\n it('is dispatched from button', async () => {\n let clickHandler: () => void = () => {};\n const clicked = new Promise(r => {\n clickHandler = r;\n });\n const {shadowRoot} = renderIconButton({clickHandler, groups: [defaultIcon]});\n const icon = shadowRoot.querySelector('.status-icon');\n assert.instanceOf(icon, IconButton.Icon.Icon);\n icon.click();\n await clicked;\n });\n\n it('is dispatched from child of button', async () => {\n let clickHandler: () => void = () => {};\n const clicked = new Promise(r => {\n clickHandler = r;\n });\n const {shadowRoot} = renderIconButton({clickHandler, groups: [defaultIcon]});\n const icon = shadowRoot.querySelector('.icon-button');\n assert.instanceOf(icon, HTMLButtonElement);\n icon.click();\n await clicked;\n });\n });\n\n describe('border', () => {\n it('is rendered when there is a click handler', async () => {\n const {shadowRoot} = renderIconButton({clickHandler: () => {}, groups: [defaultIcon]});\n const button = shadowRoot.querySelector('.icon-button');\n assert.instanceOf(button, HTMLButtonElement);\n assert.isTrue(button.classList.contains('with-click-handler'));\n });\n\n it('is omitted when requested', async () => {\n const {shadowRoot} = renderIconButton({groups: [defaultIcon]});\n const button = shadowRoot.querySelector('.icon-button');\n assert.instanceOf(button, HTMLButtonElement);\n assert.isFalse(button.classList.contains('with-click-handler'));\n });\n });\n\n describe('leading text', () => {\n it('is rendered if provided', async () => {\n const {shadowRoot} = renderIconButton({clickHandler: () => {}, groups: [defaultIcon], leadingText: 'LEAD'});\n const texts = Array.from(shadowRoot.querySelectorAll('.icon-button-title'));\n assert.deepEqual(texts.map(x => x.textContent), ['LEAD', '1']);\n });\n\n it('is omitted in compact mode even if provided', async () => {\n const {shadowRoot} =\n renderIconButton({clickHandler: () => {}, groups: [defaultIcon], leadingText: 'LEAD', compact: true});\n const texts = Array.from(shadowRoot.querySelectorAll('.icon-button-title'));\n assert.deepEqual(texts.map(x => x.textContent), ['1']);\n });\n\n it('is omitted if not provided', async () => {\n const {shadowRoot} = renderIconButton({clickHandler: () => {}, groups: [defaultIcon]});\n const texts = Array.from(shadowRoot.querySelectorAll('.icon-button-title'));\n assert.deepEqual(texts.map(x => x.textContent), ['1']);\n });\n });\n\n describe('trailing text', () => {\n it('is rendered if provided', async () => {\n const {shadowRoot} = renderIconButton({clickHandler: () => {}, groups: [defaultIcon], trailingText: 'TRAIL'});\n const texts = Array.from(shadowRoot.querySelectorAll('.icon-button-title'));\n assert.deepEqual(texts.map(x => x.textContent), ['1', 'TRAIL']);\n });\n\n it('is omitted in compact mode even if provided', async () => {\n const {shadowRoot} =\n renderIconButton({clickHandler: () => {}, groups: [defaultIcon], trailingText: 'TRAIL', compact: true});\n const texts = Array.from(shadowRoot.querySelectorAll('.icon-button-title'));\n assert.deepEqual(texts.map(x => x.textContent), ['1']);\n });\n\n it('is omitted if not provided', async () => {\n const {shadowRoot} = renderIconButton({clickHandler: () => {}, groups: [defaultIcon]});\n const texts = Array.from(shadowRoot.querySelectorAll('.icon-button-title'));\n assert.deepEqual(texts.map(x => x.textContent), ['1']);\n });\n });\n\n describe('accessible name', () => {\n it('is rendered if provided', () => {\n const expectedAccessibleName = 'AccessibleName';\n const {shadowRoot} =\n renderIconButton({clickHandler: () => {}, groups: [defaultIcon], accessibleName: expectedAccessibleName});\n const accessibleName = shadowRoot.querySelector('button')!.getAttribute('aria-label');\n assert.deepEqual(accessibleName, expectedAccessibleName);\n });\n\n it('is omitted if not provided', () => {\n const {shadowRoot} = renderIconButton({clickHandler: () => {}, groups: [defaultIcon]});\n const accessibleName = shadowRoot.querySelector('button')!.getAttribute('aria-label');\n assert.isNull(accessibleName);\n });\n });\n});\n"]} \ No newline at end of file diff --git a/public/ui/components/icon_button/icon.css.legacy.js b/public/ui/components/icon_button/icon.css.legacy.js index 05ef6eea9..a3bab6d4f 100644 --- a/public/ui/components/icon_button/icon.css.legacy.js +++ b/public/ui/components/icon_button/icon.css.legacy.js @@ -38,7 +38,7 @@ span { display: block; width: 100%; height: 100%; - background-color: currentColor; + background-color: currentcolor; mask: var(--icon-url) center / contain no-repeat; /* Default to a (scaled) 1x1 filled mask image, so that the \\'Icon\\' renders as transparent until a "name" is set */ diff --git a/public/ui/components/issue_counter/IssueCounter.test.js b/public/ui/components/issue_counter/IssueCounter.test.js index 6b46a614d..a3540fbaf 100644 --- a/public/ui/components/issue_counter/IssueCounter.test.js +++ b/public/ui/components/issue_counter/IssueCounter.test.js @@ -50,7 +50,7 @@ describeWithLocale('IssueCounter', () => { throttlerTimeout: 0, }); const icons = extractIconGroups(shadowRoot); - assert.strictEqual(icons.length, 2); + assert.lengthOf(icons, 2); assert.deepEqual(icons.map(c => c.label), ['2', '1']); const iconNames = icons.map(c => 'iconName' in c.iconData ? c.iconData.iconName : undefined); assert.deepEqual(iconNames, ['issue-cross-filled', 'issue-exclamation-filled']); @@ -63,7 +63,7 @@ describeWithLocale('IssueCounter', () => { }); { const icons = extractIconGroups(shadowRoot); - assert.strictEqual(icons.length, 2); + assert.lengthOf(icons, 2); assert.deepEqual(icons.map(c => c.label), ['2', '1']); const iconNames = icons.map(c => 'iconName' in c.iconData ? c.iconData.iconName : undefined); assert.deepEqual(iconNames, ['issue-cross-filled', 'issue-exclamation-filled']); @@ -71,7 +71,7 @@ describeWithLocale('IssueCounter', () => { issuesManager.incrementIssueCountsOfAllKinds(); { const icons = extractIconGroups(shadowRoot); - assert.strictEqual(icons.length, 3); + assert.lengthOf(icons, 3); assert.deepEqual(icons.map(c => c.label), ['3', '2', '1']); const iconNames = icons.map(c => 'iconName' in c.iconData ? c.iconData.iconName : undefined); assert.deepEqual(iconNames, ['issue-cross-filled', 'issue-exclamation-filled', 'issue-text-filled']); @@ -85,7 +85,7 @@ describeWithLocale('IssueCounter', () => { }); { const icons = extractIconGroups(shadowRoot); - assert.strictEqual(icons.length, 2); + assert.lengthOf(icons, 2); assert.deepEqual(icons.map(c => c.label), ['2', '1']); const iconNames = icons.map(c => 'iconName' in c.iconData ? c.iconData.iconName : undefined); assert.deepEqual(iconNames, ['issue-cross-filled', 'issue-exclamation-filled']); @@ -93,7 +93,7 @@ describeWithLocale('IssueCounter', () => { component.data = { ...component.data, displayMode: "OnlyMostImportant" /* IssueCounter.IssueCounter.DisplayMode.ONLY_MOST_IMPORTANT */ }; { const icons = extractIconGroups(shadowRoot); - assert.strictEqual(icons.length, 1); + assert.lengthOf(icons, 1); assert.deepEqual(icons.map(c => c.label), ['2']); const iconNames = icons.map(c => 'iconName' in c.iconData ? c.iconData.iconName : undefined); assert.deepEqual(iconNames, ['issue-cross-filled']); @@ -121,7 +121,7 @@ describeWithLocale('IssueCounter', () => { throttlerTimeout: 0, }); const icons = extractIconGroups(shadowRoot); - assert.strictEqual(icons.length, 3); + assert.lengthOf(icons, 3); assert.deepEqual(icons.map(c => c.label), ['2', '1', '0']); const iconNames = icons.map(c => 'iconName' in c.iconData ? c.iconData.iconName : undefined); assert.deepEqual(iconNames, ['issue-cross-filled', 'issue-exclamation-filled', 'issue-text-filled']); @@ -135,7 +135,7 @@ describeWithLocale('IssueCounter', () => { }); { const icons = extractIconGroups(shadowRoot); - assert.strictEqual(icons.length, 3); + assert.lengthOf(icons, 3); assert.deepEqual(icons.map(c => c.label), ['2', '1', '0']); const iconNames = icons.map(c => 'iconName' in c.iconData ? c.iconData.iconName : undefined); assert.deepEqual(iconNames, ['issue-cross-filled', 'issue-exclamation-filled', 'issue-text-filled']); @@ -143,7 +143,7 @@ describeWithLocale('IssueCounter', () => { issuesManager.incrementIssueCountsOfAllKinds(); { const icons = extractIconGroups(shadowRoot); - assert.strictEqual(icons.length, 3); + assert.lengthOf(icons, 3); assert.deepEqual(icons.map(c => c.label), ['3', '2', '1']); const iconNames = icons.map(c => 'iconName' in c.iconData ? c.iconData.iconName : undefined); assert.deepEqual(iconNames, ['issue-cross-filled', 'issue-exclamation-filled', 'issue-text-filled']); @@ -159,7 +159,7 @@ describeWithLocale('IssueCounter', () => { compact: true, }); const icons = extractIconGroups(shadowRoot); - assert.strictEqual(icons.length, 1); + assert.lengthOf(icons, 1); assert.deepEqual(icons.map(c => c.label), [null]); const iconNames = icons.map(c => 'iconName' in c.iconData ? c.iconData.iconName : undefined); assert.deepEqual(iconNames, ['issue-cross-filled']); @@ -177,7 +177,7 @@ describeWithLocale('IssueCounter', () => { compact: true, }); const icons = extractIconGroups(shadowRoot); - assert.strictEqual(icons.length, 1); + assert.lengthOf(icons, 1); assert.deepEqual(icons.map(c => c.label), [null]); const iconNames = icons.map(c => 'iconName' in c.iconData ? c.iconData.iconName : undefined); assert.deepEqual(iconNames, ['issue-text-filled']); diff --git a/public/ui/components/issue_counter/IssueCounter.test.js.map b/public/ui/components/issue_counter/IssueCounter.test.js.map index e908dd58c..e9a042ae5 100644 --- a/public/ui/components/issue_counter/IssueCounter.test.js.map +++ b/public/ui/components/issue_counter/IssueCounter.test.js.map @@ -1 +1 @@ -{"version":3,"file":"IssueCounter.test.js","sourceRoot":"","sources":["../../../../../../../front_end/ui/components/issue_counter/IssueCounter.test.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,KAAK,aAAa,MAAM,kDAAkD,CAAC;AAClF,OAAO,EACL,cAAc,EACd,oBAAoB,GACrB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAC,kBAAkB,EAAC,MAAM,wCAAwC,CAAC;AAC1E,OAAO,EAAC,iBAAiB,EAAC,MAAM,uCAAuC,CAAC;AACxE,OAAO,KAAK,UAAU,MAAM,+BAA+B,CAAC;AAE5D,OAAO,KAAK,YAAY,MAAM,oBAAoB,CAA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E,MAAM,CAAC,WAAW,CAAC,MAAM,EAAE,kCAAkC,CAAC,CAAC;IACjE,CAAC,CAAC,CAAC;IACH,EAAE,CAAC,6DAA6D,EAAE,GAAG,EAAE;QACrE,MAAM,aAAa,GAAG,IAAI,iBAAiB,CAAC,EAAE,CAAC,CAAC;QAChD,MAAM,MAAM,GAAG,YAAY,CAAC,YAAY,CAAC,yBAAyB,CAC9D,aAAqE,EAAE,KAAK,CAAC,CAAC;QAClF,MAAM,CAAC,WAAW,CAAC,MAAM,EAAE,2DAA2D,CAAC,CAAC;IAC1F,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["// Copyright 2020 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport * as IssuesManager from '../../../models/issues_manager/issues_manager.js';\nimport {\n assertElements,\n renderElementIntoDOM,\n} from '../../../testing/DOMHelpers.js';\nimport {describeWithLocale} from '../../../testing/EnvironmentHelpers.js';\nimport {MockIssuesManager} from '../../../testing/MockIssuesManager.js';\nimport * as IconButton from '../icon_button/icon_button.js';\n\nimport * as IssueCounter from './issue_counter.js';\n\nconst renderIssueCounter = (data: IssueCounter.IssueCounter.IssueCounterData):\n {component: IssueCounter.IssueCounter.IssueCounter, shadowRoot: ShadowRoot} => {\n const component = new IssueCounter.IssueCounter.IssueCounter();\n component.data = data;\n renderElementIntoDOM(component);\n assert.isNotNull(component.shadowRoot);\n return {component, shadowRoot: component.shadowRoot};\n };\n\nexport const extractIconGroups = (shadowRoot: ShadowRoot) => {\n const iconButton = shadowRoot.querySelector('icon-button');\n assert.instanceOf(iconButton, IconButton.IconButton.IconButton);\n const iconButtonShadowRoot = iconButton.shadowRoot;\n assert.exists(iconButtonShadowRoot);\n const icons = iconButtonShadowRoot.querySelectorAll('.status-icon');\n assertElements(icons, IconButton.Icon.Icon);\n const labels = iconButtonShadowRoot.querySelectorAll('.icon-button-title');\n assertElements(labels, HTMLSpanElement);\n assert(icons.length === labels.length, 'Expected icons and labels to appear in pairs');\n const iconGroups = [];\n for (let i = 0; i < icons.length; ++i) {\n const labelElement = labels[i];\n const label: string|null =\n window.getComputedStyle(labelElement).display === 'none' ? null : labelElement.textContent;\n iconGroups.push({iconData: icons[i].data, label});\n }\n return iconGroups;\n};\n\nexport const extractButton = (shadowRoot: ShadowRoot) => {\n const iconButton = shadowRoot.querySelector('icon-button');\n assert.instanceOf(iconButton, IconButton.IconButton.IconButton);\n const iconButtonShadowRoot = iconButton.shadowRoot;\n assert.exists(iconButtonShadowRoot);\n const button = iconButtonShadowRoot.querySelector('button');\n assert.instanceOf(button, HTMLButtonElement);\n return button;\n};\n\ndescribeWithLocale('IssueCounter', () => {\n describe('with omitting zero-count issue kinds', () => {\n it('renders correctly', () => {\n const issuesManager = new MockIssuesManager([]);\n const {shadowRoot} = renderIssueCounter({\n issuesManager: issuesManager as unknown as IssuesManager.IssuesManager.IssuesManager,\n throttlerTimeout: 0,\n });\n\n const icons = extractIconGroups(shadowRoot);\n assert.strictEqual(icons.length, 2);\n assert.deepEqual(icons.map(c => c.label), ['2', '1']);\n const iconNames = icons.map(c => 'iconName' in c.iconData ? c.iconData.iconName : undefined);\n assert.deepEqual(iconNames, ['issue-cross-filled', 'issue-exclamation-filled']);\n });\n\n it('updates correctly', () => {\n const issuesManager = new MockIssuesManager([]);\n const {shadowRoot} = renderIssueCounter({\n issuesManager: issuesManager as unknown as IssuesManager.IssuesManager.IssuesManager,\n throttlerTimeout: 0,\n });\n\n {\n const icons = extractIconGroups(shadowRoot);\n assert.strictEqual(icons.length, 2);\n assert.deepEqual(icons.map(c => c.label), ['2', '1']);\n const iconNames = icons.map(c => 'iconName' in c.iconData ? c.iconData.iconName : undefined);\n assert.deepEqual(iconNames, ['issue-cross-filled', 'issue-exclamation-filled']);\n }\n\n issuesManager.incrementIssueCountsOfAllKinds();\n\n {\n const icons = extractIconGroups(shadowRoot);\n assert.strictEqual(icons.length, 3);\n assert.deepEqual(icons.map(c => c.label), ['3', '2', '1']);\n const iconNames = icons.map(c => 'iconName' in c.iconData ? c.iconData.iconName : undefined);\n assert.deepEqual(iconNames, ['issue-cross-filled', 'issue-exclamation-filled', 'issue-text-filled']);\n }\n });\n\n it('updates correctly through setter', () => {\n const issuesManager = new MockIssuesManager([]);\n const {component, shadowRoot} = renderIssueCounter({\n issuesManager: issuesManager as unknown as IssuesManager.IssuesManager.IssuesManager,\n throttlerTimeout: 0,\n });\n\n {\n const icons = extractIconGroups(shadowRoot);\n assert.strictEqual(icons.length, 2);\n assert.deepEqual(icons.map(c => c.label), ['2', '1']);\n const iconNames = icons.map(c => 'iconName' in c.iconData ? c.iconData.iconName : undefined);\n assert.deepEqual(iconNames, ['issue-cross-filled', 'issue-exclamation-filled']);\n }\n\n component.data = {...component.data, displayMode: IssueCounter.IssueCounter.DisplayMode.ONLY_MOST_IMPORTANT};\n\n {\n const icons = extractIconGroups(shadowRoot);\n assert.strictEqual(icons.length, 1);\n assert.deepEqual(icons.map(c => c.label), ['2']);\n const iconNames = icons.map(c => 'iconName' in c.iconData ? c.iconData.iconName : undefined);\n assert.deepEqual(iconNames, ['issue-cross-filled']);\n }\n });\n\n it('Aria label is added correctly', () => {\n const expectedAccessibleName = 'Accessible Name';\n const issuesManager = new MockIssuesManager([]);\n const {shadowRoot} = renderIssueCounter({\n issuesManager: issuesManager as unknown as IssuesManager.IssuesManager.IssuesManager,\n throttlerTimeout: 0,\n accessibleName: expectedAccessibleName,\n });\n\n const button = extractButton(shadowRoot);\n const accessibleName = button.getAttribute('aria-label');\n\n assert.strictEqual(accessibleName, expectedAccessibleName);\n });\n });\n\n describe('without omitting zero count issue kinds', () => {\n it('renders correctly', () => {\n const issuesManager = new MockIssuesManager([]);\n const {shadowRoot} = renderIssueCounter({\n issuesManager: issuesManager as unknown as IssuesManager.IssuesManager.IssuesManager,\n displayMode: IssueCounter.IssueCounter.DisplayMode.SHOW_ALWAYS,\n throttlerTimeout: 0,\n });\n\n const icons = extractIconGroups(shadowRoot);\n assert.strictEqual(icons.length, 3);\n assert.deepEqual(icons.map(c => c.label), ['2', '1', '0']);\n const iconNames = icons.map(c => 'iconName' in c.iconData ? c.iconData.iconName : undefined);\n assert.deepEqual(iconNames, ['issue-cross-filled', 'issue-exclamation-filled', 'issue-text-filled']);\n });\n\n it('updates correctly', () => {\n const issuesManager = new MockIssuesManager([]);\n const {shadowRoot} = renderIssueCounter({\n issuesManager: issuesManager as unknown as IssuesManager.IssuesManager.IssuesManager,\n displayMode: IssueCounter.IssueCounter.DisplayMode.SHOW_ALWAYS,\n throttlerTimeout: 0,\n });\n\n {\n const icons = extractIconGroups(shadowRoot);\n assert.strictEqual(icons.length, 3);\n assert.deepEqual(icons.map(c => c.label), ['2', '1', '0']);\n const iconNames = icons.map(c => 'iconName' in c.iconData ? c.iconData.iconName : undefined);\n assert.deepEqual(iconNames, ['issue-cross-filled', 'issue-exclamation-filled', 'issue-text-filled']);\n }\n\n issuesManager.incrementIssueCountsOfAllKinds();\n\n {\n const icons = extractIconGroups(shadowRoot);\n assert.strictEqual(icons.length, 3);\n assert.deepEqual(icons.map(c => c.label), ['3', '2', '1']);\n const iconNames = icons.map(c => 'iconName' in c.iconData ? c.iconData.iconName : undefined);\n assert.deepEqual(iconNames, ['issue-cross-filled', 'issue-exclamation-filled', 'issue-text-filled']);\n }\n });\n });\n\n describe('in compact mode', () => {\n it('renders correctly', () => {\n const issuesManager = new MockIssuesManager([]);\n const {shadowRoot} = renderIssueCounter({\n issuesManager: issuesManager as unknown as IssuesManager.IssuesManager.IssuesManager,\n throttlerTimeout: 0,\n compact: true,\n });\n\n const icons = extractIconGroups(shadowRoot);\n assert.strictEqual(icons.length, 1);\n assert.deepEqual(icons.map(c => c.label), [null]);\n const iconNames = icons.map(c => 'iconName' in c.iconData ? c.iconData.iconName : undefined);\n assert.deepEqual(iconNames, ['issue-cross-filled']);\n });\n\n it('renders correctly with only improvement issues', () => {\n const issuesManager = new MockIssuesManager([]);\n issuesManager.setNumberOfIssues(new Map([\n [IssuesManager.Issue.IssueKind.IMPROVEMENT, 3],\n [IssuesManager.Issue.IssueKind.BREAKING_CHANGE, 0],\n [IssuesManager.Issue.IssueKind.PAGE_ERROR, 0],\n ]));\n const {shadowRoot} = renderIssueCounter({\n issuesManager: issuesManager as unknown as IssuesManager.IssuesManager.IssuesManager,\n throttlerTimeout: 0,\n compact: true,\n });\n\n const icons = extractIconGroups(shadowRoot);\n assert.strictEqual(icons.length, 1);\n assert.deepEqual(icons.map(c => c.label), [null]);\n const iconNames = icons.map(c => 'iconName' in c.iconData ? c.iconData.iconName : undefined);\n assert.deepEqual(iconNames, ['issue-text-filled']);\n });\n });\n});\n\ndescribeWithLocale('getIssueCountsEnumeration', () => {\n it('formats issue counts correctly', () => {\n const issuesManager = new MockIssuesManager([]);\n const string = IssueCounter.IssueCounter.getIssueCountsEnumeration(\n issuesManager as unknown as IssuesManager.IssuesManager.IssuesManager);\n assert.strictEqual(string, '2 page errors, 1 breaking change');\n });\n it('formats issue counts correctly when displaying zero entries', () => {\n const issuesManager = new MockIssuesManager([]);\n const string = IssueCounter.IssueCounter.getIssueCountsEnumeration(\n issuesManager as unknown as IssuesManager.IssuesManager.IssuesManager, false);\n assert.strictEqual(string, '2 page errors, 1 breaking change, 0 possible improvements');\n });\n});\n"]} \ No newline at end of file +{"version":3,"file":"IssueCounter.test.js","sourceRoot":"","sources":["../../../../../../../front_end/ui/components/issue_counter/IssueCounter.test.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,KAAK,aAAa,MAAM,kDAAkD,CAAC;AAClF,OAAO,EACL,cAAc,EACd,oBAAoB,GACrB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAC,kBAAkB,EAAC,MAAM,wCAAwC,CAAC;AAC1E,OAAO,EAAC,iBAAiB,EAAC,MAAM,uCAAuC,CAAC;AACxE,OAAO,KAAK,UAAU,MAAM,+BAA+B,CAAC;AAE5D,OAAO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CAAC,CAAC,CAAC;IACH,EAAE,CAAC,6DAA6D,EAAE,GAAG,EAAE;QACrE,MAAM,aAAa,GAAG,IAAI,iBAAiB,CAAC,EAAE,CAAC,CAAC;QAChD,MAAM,MAAM,GAAG,YAAY,CAAC,YAAY,CAAC,yBAAyB,CAC9D,aAAqE,EAAE,KAAK,CAAC,CAAC;QAClF,MAAM,CAAC,WAAW,CAAC,MAAM,EAAE,2DAA2D,CAAC,CAAC;IAC1F,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["// Copyright 2020 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport * as IssuesManager from '../../../models/issues_manager/issues_manager.js';\nimport {\n assertElements,\n renderElementIntoDOM,\n} from '../../../testing/DOMHelpers.js';\nimport {describeWithLocale} from '../../../testing/EnvironmentHelpers.js';\nimport {MockIssuesManager} from '../../../testing/MockIssuesManager.js';\nimport * as IconButton from '../icon_button/icon_button.js';\n\nimport * as IssueCounter from './issue_counter.js';\n\nconst renderIssueCounter = (data: IssueCounter.IssueCounter.IssueCounterData):\n {component: IssueCounter.IssueCounter.IssueCounter, shadowRoot: ShadowRoot} => {\n const component = new IssueCounter.IssueCounter.IssueCounter();\n component.data = data;\n renderElementIntoDOM(component);\n assert.isNotNull(component.shadowRoot);\n return {component, shadowRoot: component.shadowRoot};\n };\n\nexport const extractIconGroups = (shadowRoot: ShadowRoot) => {\n const iconButton = shadowRoot.querySelector('icon-button');\n assert.instanceOf(iconButton, IconButton.IconButton.IconButton);\n const iconButtonShadowRoot = iconButton.shadowRoot;\n assert.exists(iconButtonShadowRoot);\n const icons = iconButtonShadowRoot.querySelectorAll('.status-icon');\n assertElements(icons, IconButton.Icon.Icon);\n const labels = iconButtonShadowRoot.querySelectorAll('.icon-button-title');\n assertElements(labels, HTMLSpanElement);\n assert(icons.length === labels.length, 'Expected icons and labels to appear in pairs');\n const iconGroups = [];\n for (let i = 0; i < icons.length; ++i) {\n const labelElement = labels[i];\n const label: string|null =\n window.getComputedStyle(labelElement).display === 'none' ? null : labelElement.textContent;\n iconGroups.push({iconData: icons[i].data, label});\n }\n return iconGroups;\n};\n\nexport const extractButton = (shadowRoot: ShadowRoot) => {\n const iconButton = shadowRoot.querySelector('icon-button');\n assert.instanceOf(iconButton, IconButton.IconButton.IconButton);\n const iconButtonShadowRoot = iconButton.shadowRoot;\n assert.exists(iconButtonShadowRoot);\n const button = iconButtonShadowRoot.querySelector('button');\n assert.instanceOf(button, HTMLButtonElement);\n return button;\n};\n\ndescribeWithLocale('IssueCounter', () => {\n describe('with omitting zero-count issue kinds', () => {\n it('renders correctly', () => {\n const issuesManager = new MockIssuesManager([]);\n const {shadowRoot} = renderIssueCounter({\n issuesManager: issuesManager as unknown as IssuesManager.IssuesManager.IssuesManager,\n throttlerTimeout: 0,\n });\n\n const icons = extractIconGroups(shadowRoot);\n assert.lengthOf(icons, 2);\n assert.deepEqual(icons.map(c => c.label), ['2', '1']);\n const iconNames = icons.map(c => 'iconName' in c.iconData ? c.iconData.iconName : undefined);\n assert.deepEqual(iconNames, ['issue-cross-filled', 'issue-exclamation-filled']);\n });\n\n it('updates correctly', () => {\n const issuesManager = new MockIssuesManager([]);\n const {shadowRoot} = renderIssueCounter({\n issuesManager: issuesManager as unknown as IssuesManager.IssuesManager.IssuesManager,\n throttlerTimeout: 0,\n });\n\n {\n const icons = extractIconGroups(shadowRoot);\n assert.lengthOf(icons, 2);\n assert.deepEqual(icons.map(c => c.label), ['2', '1']);\n const iconNames = icons.map(c => 'iconName' in c.iconData ? c.iconData.iconName : undefined);\n assert.deepEqual(iconNames, ['issue-cross-filled', 'issue-exclamation-filled']);\n }\n\n issuesManager.incrementIssueCountsOfAllKinds();\n\n {\n const icons = extractIconGroups(shadowRoot);\n assert.lengthOf(icons, 3);\n assert.deepEqual(icons.map(c => c.label), ['3', '2', '1']);\n const iconNames = icons.map(c => 'iconName' in c.iconData ? c.iconData.iconName : undefined);\n assert.deepEqual(iconNames, ['issue-cross-filled', 'issue-exclamation-filled', 'issue-text-filled']);\n }\n });\n\n it('updates correctly through setter', () => {\n const issuesManager = new MockIssuesManager([]);\n const {component, shadowRoot} = renderIssueCounter({\n issuesManager: issuesManager as unknown as IssuesManager.IssuesManager.IssuesManager,\n throttlerTimeout: 0,\n });\n\n {\n const icons = extractIconGroups(shadowRoot);\n assert.lengthOf(icons, 2);\n assert.deepEqual(icons.map(c => c.label), ['2', '1']);\n const iconNames = icons.map(c => 'iconName' in c.iconData ? c.iconData.iconName : undefined);\n assert.deepEqual(iconNames, ['issue-cross-filled', 'issue-exclamation-filled']);\n }\n\n component.data = {...component.data, displayMode: IssueCounter.IssueCounter.DisplayMode.ONLY_MOST_IMPORTANT};\n\n {\n const icons = extractIconGroups(shadowRoot);\n assert.lengthOf(icons, 1);\n assert.deepEqual(icons.map(c => c.label), ['2']);\n const iconNames = icons.map(c => 'iconName' in c.iconData ? c.iconData.iconName : undefined);\n assert.deepEqual(iconNames, ['issue-cross-filled']);\n }\n });\n\n it('Aria label is added correctly', () => {\n const expectedAccessibleName = 'Accessible Name';\n const issuesManager = new MockIssuesManager([]);\n const {shadowRoot} = renderIssueCounter({\n issuesManager: issuesManager as unknown as IssuesManager.IssuesManager.IssuesManager,\n throttlerTimeout: 0,\n accessibleName: expectedAccessibleName,\n });\n\n const button = extractButton(shadowRoot);\n const accessibleName = button.getAttribute('aria-label');\n\n assert.strictEqual(accessibleName, expectedAccessibleName);\n });\n });\n\n describe('without omitting zero count issue kinds', () => {\n it('renders correctly', () => {\n const issuesManager = new MockIssuesManager([]);\n const {shadowRoot} = renderIssueCounter({\n issuesManager: issuesManager as unknown as IssuesManager.IssuesManager.IssuesManager,\n displayMode: IssueCounter.IssueCounter.DisplayMode.SHOW_ALWAYS,\n throttlerTimeout: 0,\n });\n\n const icons = extractIconGroups(shadowRoot);\n assert.lengthOf(icons, 3);\n assert.deepEqual(icons.map(c => c.label), ['2', '1', '0']);\n const iconNames = icons.map(c => 'iconName' in c.iconData ? c.iconData.iconName : undefined);\n assert.deepEqual(iconNames, ['issue-cross-filled', 'issue-exclamation-filled', 'issue-text-filled']);\n });\n\n it('updates correctly', () => {\n const issuesManager = new MockIssuesManager([]);\n const {shadowRoot} = renderIssueCounter({\n issuesManager: issuesManager as unknown as IssuesManager.IssuesManager.IssuesManager,\n displayMode: IssueCounter.IssueCounter.DisplayMode.SHOW_ALWAYS,\n throttlerTimeout: 0,\n });\n\n {\n const icons = extractIconGroups(shadowRoot);\n assert.lengthOf(icons, 3);\n assert.deepEqual(icons.map(c => c.label), ['2', '1', '0']);\n const iconNames = icons.map(c => 'iconName' in c.iconData ? c.iconData.iconName : undefined);\n assert.deepEqual(iconNames, ['issue-cross-filled', 'issue-exclamation-filled', 'issue-text-filled']);\n }\n\n issuesManager.incrementIssueCountsOfAllKinds();\n\n {\n const icons = extractIconGroups(shadowRoot);\n assert.lengthOf(icons, 3);\n assert.deepEqual(icons.map(c => c.label), ['3', '2', '1']);\n const iconNames = icons.map(c => 'iconName' in c.iconData ? c.iconData.iconName : undefined);\n assert.deepEqual(iconNames, ['issue-cross-filled', 'issue-exclamation-filled', 'issue-text-filled']);\n }\n });\n });\n\n describe('in compact mode', () => {\n it('renders correctly', () => {\n const issuesManager = new MockIssuesManager([]);\n const {shadowRoot} = renderIssueCounter({\n issuesManager: issuesManager as unknown as IssuesManager.IssuesManager.IssuesManager,\n throttlerTimeout: 0,\n compact: true,\n });\n\n const icons = extractIconGroups(shadowRoot);\n assert.lengthOf(icons, 1);\n assert.deepEqual(icons.map(c => c.label), [null]);\n const iconNames = icons.map(c => 'iconName' in c.iconData ? c.iconData.iconName : undefined);\n assert.deepEqual(iconNames, ['issue-cross-filled']);\n });\n\n it('renders correctly with only improvement issues', () => {\n const issuesManager = new MockIssuesManager([]);\n issuesManager.setNumberOfIssues(new Map([\n [IssuesManager.Issue.IssueKind.IMPROVEMENT, 3],\n [IssuesManager.Issue.IssueKind.BREAKING_CHANGE, 0],\n [IssuesManager.Issue.IssueKind.PAGE_ERROR, 0],\n ]));\n const {shadowRoot} = renderIssueCounter({\n issuesManager: issuesManager as unknown as IssuesManager.IssuesManager.IssuesManager,\n throttlerTimeout: 0,\n compact: true,\n });\n\n const icons = extractIconGroups(shadowRoot);\n assert.lengthOf(icons, 1);\n assert.deepEqual(icons.map(c => c.label), [null]);\n const iconNames = icons.map(c => 'iconName' in c.iconData ? c.iconData.iconName : undefined);\n assert.deepEqual(iconNames, ['issue-text-filled']);\n });\n });\n});\n\ndescribeWithLocale('getIssueCountsEnumeration', () => {\n it('formats issue counts correctly', () => {\n const issuesManager = new MockIssuesManager([]);\n const string = IssueCounter.IssueCounter.getIssueCountsEnumeration(\n issuesManager as unknown as IssuesManager.IssuesManager.IssuesManager);\n assert.strictEqual(string, '2 page errors, 1 breaking change');\n });\n it('formats issue counts correctly when displaying zero entries', () => {\n const issuesManager = new MockIssuesManager([]);\n const string = IssueCounter.IssueCounter.getIssueCountsEnumeration(\n issuesManager as unknown as IssuesManager.IssuesManager.IssuesManager, false);\n assert.strictEqual(string, '2 page errors, 1 breaking change, 0 possible improvements');\n });\n});\n"]} \ No newline at end of file diff --git a/public/ui/components/issue_counter/IssueLinkIcon.js b/public/ui/components/issue_counter/IssueLinkIcon.js index bc80ff806..4a04af396 100644 --- a/public/ui/components/issue_counter/IssueLinkIcon.js +++ b/public/ui/components/issue_counter/IssueLinkIcon.js @@ -5,7 +5,7 @@ import '../../../ui/components/icon_button/icon_button.js'; import * as Common from '../../../core/common/common.js'; import * as i18n from '../../../core/i18n/i18n.js'; import * as IssuesManager from '../../../models/issues_manager/issues_manager.js'; -import * as Coordinator from '../../../ui/components/render_coordinator/render_coordinator.js'; +import * as RenderCoordinator from '../../../ui/components/render_coordinator/render_coordinator.js'; import * as LitHtml from '../../../ui/lit-html/lit-html.js'; import * as VisualLogging from '../../../ui/visual_logging/visual_logging.js'; import { getIssueKindIconData } from './IssueCounter.js'; @@ -33,7 +33,6 @@ export const extractShortPath = (path) => { // if path ends with '/', 2nd regex returns everything between the last two '/' return (/[^/]+$/.exec(path) || /[^/]+\/$/.exec(path) || [''])[0]; }; -const coordinator = Coordinator.RenderCoordinator.RenderCoordinator.instance(); export class IssueLinkIcon extends HTMLElement { #shadow = this.attachShadow({ mode: 'open' }); // The value `null` indicates that the issue is not available, @@ -120,7 +119,7 @@ export class IssueLinkIcon extends HTMLElement { return iconName; } #render() { - return coordinator.write(() => { + return RenderCoordinator.write(() => { // clang-format off LitHtml.render(html ` `,\n this.#shadow, {host: this});\n // clang-format on\n });\n }\n}\n\ncustomElements.define('devtools-issue-link-icon', IssueLinkIcon);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'devtools-issue-link-icon': IssueLinkIcon;\n }\n}\n"]} \ No newline at end of file +{"version":3,"file":"IssueLinkIcon.js","sourceRoot":"","sources":["../../../../../../../front_end/ui/components/issue_counter/IssueLinkIcon.ts"],"names":[],"mappings":"AAAA,gEAAgE;AAChE,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,mDAAmD,CAAC;AAE3D,OAAO,KAAK,MAAM,MAAM,gCAAgC,CAAC;AACzD,OAAO,KAAK,IAAI,MAAM,4BAA4B,CAAC;AAGnD,OAAO,KAAK,aAAa,MAAM,kDAAkD,CAAC;AAClF,OAAO,KAAK,iBAAiB,MAAM,iEAAiE,CAAC;AACrG,OAAO,KAAK,OAAO,MAAM,kCAAkC,CAAC;AAC5D,OAAO,KAAK,aAAa,MAAM,8CAA8C,CAAC;AAE9E,OAAO,EAAC,oBAAoB,EAAC,MAAM,mBAAmB,CAAC;AACvD,OAAO,mBAAmB,MAAM,wBAAwB,CAAC;AAEzD,MAAM,EAAC,IAAI,EAAC,GAAG,OAAO,CAAC;AAEvB,MAAM,SAAS,GAAG;IAChB;;OAEG;IACH,gBAAgB,EAAE,uCAAuC;IACzD;;;OAGG;IACH,yBAAyB,EAAE,qDAAqD;IAChF;;OAEG;IACH,gBAAgB,EAAE,gCAAgC;C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AI,EAAE,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,EAAC,CAAC;sBACzD,IAAI,CAAC,WAAW,EAAE;sBAClB,aAAa,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,KAAK,CAAC,EAAC,KAAK,EAAE,IAAI,EAAC,CAAC;uBAC/C,IAAI,CAAC,WAAW;8BACT,IAAI,CAAC,YAAY,EAAE;gBACjC,EACV,IAAI,CAAC,OAAO,EAAE,EAAC,IAAI,EAAE,IAAI,EAAC,CAAC,CAAC;YAC5B,kBAAkB;QACpB,CAAC,CAAC,CAAC;IACL,CAAC;CACF;AAED,cAAc,CAAC,MAAM,CAAC,0BAA0B,EAAE,aAAa,CAAC,CAAC","sourcesContent":["// Copyright (c) 2021 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport '../../../ui/components/icon_button/icon_button.js';\n\nimport * as Common from '../../../core/common/common.js';\nimport * as i18n from '../../../core/i18n/i18n.js';\nimport type * as Platform from '../../../core/platform/platform.js';\nimport type * as Protocol from '../../../generated/protocol.js';\nimport * as IssuesManager from '../../../models/issues_manager/issues_manager.js';\nimport * as RenderCoordinator from '../../../ui/components/render_coordinator/render_coordinator.js';\nimport * as LitHtml from '../../../ui/lit-html/lit-html.js';\nimport * as VisualLogging from '../../../ui/visual_logging/visual_logging.js';\n\nimport {getIssueKindIconData} from './IssueCounter.js';\nimport IssueLinkIconStyles from './issueLinkIcon.css.js';\n\nconst {html} = LitHtml;\n\nconst UIStrings = {\n /**\n * @description Title for a link to show an issue in the issues tab\n */\n clickToShowIssue: 'Click to show issue in the issues tab',\n /**\n * @description Title for a link to show an issue in the issues tab\n * @example {A title of an Issue} title\n */\n clickToShowIssueWithTitle: 'Click to open the issue tab and show issue: {title}',\n /**\n *@description Title for an link to show an issue that is unavailable because the issue couldn't be resolved\n */\n issueUnavailable: 'Issue unavailable at this time',\n};\nconst str_ = i18n.i18n.registerUIStrings('ui/components/issue_counter/IssueLinkIcon.ts', UIStrings);\nconst i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);\n\nexport interface IssueLinkIconData {\n issue?: IssuesManager.Issue.Issue|null;\n issueId?: Protocol.Audits.IssueId;\n issueResolver?: IssuesManager.IssueResolver.IssueResolver;\n additionalOnClickAction?: () => void;\n revealOverride?: (revealable: unknown, omitFocus?: boolean) => Promise;\n}\n\nexport const extractShortPath = (path: string): string => {\n // 1st regex matches everything after last '/'\n // if path ends with '/', 2nd regex returns everything between the last two '/'\n return (/[^/]+$/.exec(path) || /[^/]+\\/$/.exec(path) || [''])[0];\n};\n\nexport class IssueLinkIcon extends HTMLElement {\n readonly #shadow = this.attachShadow({mode: 'open'});\n // The value `null` indicates that the issue is not available,\n // `undefined` that it is still being resolved.\n #issue?: IssuesManager.Issue.Issue|null;\n #issueTitle: string|null = null;\n #issueId?: Protocol.Audits.IssueId;\n #issueResolver?: IssuesManager.IssueResolver.IssueResolver;\n #additionalOnClickAction?: () => void;\n #reveal = Common.Revealer.reveal;\n\n set data(data: IssueLinkIconData) {\n this.#issue = data.issue;\n this.#issueId = data.issueId;\n this.#issueResolver = data.issueResolver;\n if (!this.#issue) {\n if (!this.#issueId) {\n throw new Error('Either `issue` or `issueId` must be provided');\n } else if (!this.#issueResolver) {\n throw new Error('An `IssueResolver` must be provided if an `issueId` is provided.');\n }\n }\n this.#additionalOnClickAction = data.additionalOnClickAction;\n if (data.revealOverride) {\n this.#reveal = data.revealOverride;\n }\n void this.#fetchIssueData();\n void this.#render();\n }\n\n async #fetchIssueData(): Promise {\n if (!this.#issue && this.#issueId) {\n try {\n this.#issue = await this.#issueResolver?.waitFor(this.#issueId);\n } catch {\n this.#issue = null;\n }\n }\n const description = this.#issue?.getDescription();\n if (description) {\n const title = await IssuesManager.MarkdownIssueDescription.getIssueTitleFromMarkdownDescription(description);\n if (title) {\n this.#issueTitle = title;\n }\n }\n await this.#render();\n }\n\n connectedCallback(): void {\n this.#shadow.adoptedStyleSheets = [IssueLinkIconStyles];\n }\n\n get data(): IssueLinkIconData {\n return {\n issue: this.#issue,\n issueId: this.#issueId,\n issueResolver: this.#issueResolver,\n additionalOnClickAction: this.#additionalOnClickAction,\n revealOverride: this.#reveal !== Common.Revealer.reveal ? this.#reveal : undefined,\n };\n }\n\n handleClick(event: MouseEvent): void {\n if (event.button !== 0) {\n return; // Only handle left-click for now.\n }\n if (this.#issue) {\n void this.#reveal(this.#issue);\n }\n this.#additionalOnClickAction?.();\n event.consume();\n }\n\n #getTooltip(): Platform.UIString.LocalizedString {\n if (this.#issueTitle) {\n return i18nString(UIStrings.clickToShowIssueWithTitle, {title: this.#issueTitle});\n }\n if (this.#issue) {\n return i18nString(UIStrings.clickToShowIssue);\n }\n return i18nString(UIStrings.issueUnavailable);\n }\n\n #getIconName(): string {\n if (!this.#issue) {\n return 'issue-questionmark-filled';\n }\n const {iconName} = getIssueKindIconData(this.#issue.getKind());\n return iconName;\n }\n\n #render(): Promise {\n return RenderCoordinator.write(() => {\n // clang-format off\n LitHtml.render(html`\n `,\n this.#shadow, {host: this});\n // clang-format on\n });\n }\n}\n\ncustomElements.define('devtools-issue-link-icon', IssueLinkIcon);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'devtools-issue-link-icon': IssueLinkIcon;\n }\n}\n"]} \ No newline at end of file diff --git a/public/ui/components/issue_counter/IssueLinkIcon.test.js b/public/ui/components/issue_counter/IssueLinkIcon.test.js index 37e3f7ad2..d1f6560a2 100644 --- a/public/ui/components/issue_counter/IssueLinkIcon.test.js +++ b/public/ui/components/issue_counter/IssueLinkIcon.test.js @@ -6,15 +6,14 @@ import * as IssuesManager from '../../../models/issues_manager/issues_manager.js import { renderElementIntoDOM, } from '../../../testing/DOMHelpers.js'; import { describeWithLocale } from '../../../testing/EnvironmentHelpers.js'; import * as IconButton from '../icon_button/icon_button.js'; -import * as Coordinator from '../render_coordinator/render_coordinator.js'; +import * as RenderCoordinator from '../render_coordinator/render_coordinator.js'; import * as IssueCounter from './issue_counter.js'; -const coordinator = Coordinator.RenderCoordinator.RenderCoordinator.instance(); const renderIssueLinkIcon = async (data) => { const component = new IssueCounter.IssueLinkIcon.IssueLinkIcon(); component.data = data; renderElementIntoDOM(component); assert.isNotNull(component.shadowRoot); - await coordinator.done(); + await RenderCoordinator.done(); return { component, shadowRoot: component.shadowRoot }; }; export const extractElements = (shadowRoot) => { @@ -116,7 +115,7 @@ describeWithLocale('IssueLinkIcon', () => { issueResolver: resolver, }); resolver.resolve(mockIssue); - await coordinator.done({ waitForWork: true }); + await RenderCoordinator.done({ waitForWork: true }); assert.isTrue(extractElements(shadowRoot).button.classList.contains('link')); }); it('handles multiple data assignments', async () => { @@ -131,7 +130,7 @@ describeWithLocale('IssueLinkIcon', () => { component.data = { issue: mockIssue2, }; - await coordinator.done({ waitForWork: true }); + await RenderCoordinator.done({ waitForWork: true }); const { icon } = extractElements(shadowRoot); assert.strictEqual(icon.name, 'issue-exclamation-filled'); }); diff --git a/public/ui/components/issue_counter/IssueLinkIcon.test.js.map b/public/ui/components/issue_counter/IssueLinkIcon.test.js.map index 566659ed1..e9e237aec 100644 --- a/public/ui/components/issue_counter/IssueLinkIcon.test.js.map +++ b/public/ui/components/issue_counter/IssueLinkIcon.test.js.map @@ -1 +1 @@ -{"version":3,"file":"IssueLinkIcon.test.js","sourceRoot":"","sources":["../../../../../../../front_end/ui/components/issue_counter/IssueLinkIcon.test.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,KAAK,MAAM,MAAM,gCAAgC,CAAC;AAEzD,OAAO,KAAK,aAAa,MAAM,kDAAkD,CAAC;AAClF,OAAO,EACL,oBAAoB,GACrB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAC,kBAAkB,EAAC,MAAM,wCAAwC,CAAC;AAC1E,OAAO,KAAK,UAAU,MAAM,+BAA+B,CAAC;AAC5D,OAAO,KAAK,WAAW,MAAM,6CAA6C,CAAC;AAE3E,OAAO,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D,CAAC;aACF,CAAC;YAEF,SAAS,CAAC,IAAI,GAAG;gBACf,KAAK,EAAE,UAAkD;aAC1D,CAAC;YACF,MAAM,WAAW,CAAC,IAAI,CAAC,EAAC,WAAW,EAAE,IAAI,EAAC,CAAC,CAAC;YAE5C,MAAM,EAAC,IAAI,EAAC,GAAG,eAAe,CAAC,UAAU,CAAC,CAAC;YAC3C,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,EAAE,0BAA0B,CAAC,CAAC;QAC5D,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,QAAQ,CAAC,0BAA0B,EAAE,GAAG,EAAE;QACxC,EAAE,CAAC,0BAA0B,EAAE,KAAK,IAAI,EAAE;YACxC,MAAM,cAAc,GAAG,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;YAC1D,MAAM,EAAC,UAAU,EAAC,GAAG,MAAM,mBAAmB,CAAC;gBAC7C,KAAK,EAAE,SAAiD;gBACxD,cAAc;aACf,CAAC,CAAC;YAEH,MAAM,EAAC,MAAM,EAAC,GAAG,eAAe,CAAC,UAAU,CAAC,CAAC;YAC7C,MAAM,CAAC,KAAK,EAAE,CAAC;YACf,MAAM,CAAC,MAAM,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC;QACvC,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["// Copyright 2020 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport * as Common from '../../../core/common/common.js';\nimport type * as Protocol from '../../../generated/protocol.js';\nimport * as IssuesManager from '../../../models/issues_manager/issues_manager.js';\nimport {\n renderElementIntoDOM,\n} from '../../../testing/DOMHelpers.js';\nimport {describeWithLocale} from '../../../testing/EnvironmentHelpers.js';\nimport * as IconButton from '../icon_button/icon_button.js';\nimport * as Coordinator from '../render_coordinator/render_coordinator.js';\n\nimport * as IssueCounter from './issue_counter.js';\n\nconst coordinator = Coordinator.RenderCoordinator.RenderCoordinator.instance();\n\nconst renderIssueLinkIcon = async(data: IssueCounter.IssueLinkIcon.IssueLinkIconData): Promise<{\n component: IssueCounter.IssueLinkIcon.IssueLinkIcon,\n shadowRoot: ShadowRoot,\n}> => {\n const component = new IssueCounter.IssueLinkIcon.IssueLinkIcon();\n component.data = data;\n renderElementIntoDOM(component);\n assert.isNotNull(component.shadowRoot);\n await coordinator.done();\n return {component, shadowRoot: component.shadowRoot};\n};\n\nexport const extractElements = (shadowRoot: ShadowRoot): {\n icon: IconButton.Icon.Icon,\n button: HTMLButtonElement,\n} => {\n const icon = shadowRoot.querySelector('devtools-icon');\n assert.instanceOf(icon, IconButton.Icon.Icon);\n const button = shadowRoot.querySelector('button');\n assert.instanceOf(button, HTMLButtonElement);\n return {icon, button};\n};\n\ninterface MockIssueResolverEntry {\n resolve: (issue: IssuesManager.Issue.Issue|null) => void;\n promise: Promise;\n}\n\nclass MockIssueResolver {\n #promiseMap: Map = new Map();\n\n waitFor(issueId?: string) {\n if (!issueId) {\n if (this.#promiseMap.size !== 1) {\n throw new Error('more than one issue being awaited, specify a issue id');\n }\n issueId = this.#promiseMap.keys().next().value;\n }\n issueId = issueId || '';\n const entry = this.#promiseMap.get(issueId);\n if (entry) {\n return entry.promise;\n }\n let resolve: (issue: IssuesManager.Issue.Issue|null) => void = () => {};\n const promise = new Promise(r => {\n resolve = r;\n });\n this.#promiseMap.set(issueId, {resolve, promise});\n return promise;\n }\n\n resolve(result: IssuesManager.Issue.Issue|null, issueId?: string): void {\n if (!issueId && this.#promiseMap.size === 1) {\n issueId = this.#promiseMap.keys().next().value;\n }\n issueId = issueId || result?.getIssueId() || '';\n const entry = this.#promiseMap.get(issueId);\n if (!entry) {\n throw new Error('resolve uninitialized');\n }\n entry.resolve(result);\n this.#promiseMap.delete(issueId);\n }\n}\n\ndescribeWithLocale('IssueLinkIcon', () => {\n const issueId = 'issue1' as Protocol.Audits.IssueId;\n const mockIssue = {\n getKind() {\n return IssuesManager.Issue.IssueKind.PAGE_ERROR;\n },\n getIssueId() {\n return issueId;\n },\n getDescription() {\n return null;\n },\n };\n\n describe('with simple issues', () => {\n const failingIssueResolver = {\n async waitFor() {\n throw new Error('Couldn\\'t resolve');\n },\n };\n\n it('renders correctly without an issue', async () => {\n const {shadowRoot} = await renderIssueLinkIcon({\n issueId,\n issueResolver: failingIssueResolver as unknown as IssuesManager.IssueResolver.IssueResolver,\n });\n\n const {icon} = extractElements(shadowRoot);\n assert.strictEqual(icon.name, 'issue-questionmark-filled');\n });\n\n it('renders correctly with a \"page error\" issue', async () => {\n const {shadowRoot} = await renderIssueLinkIcon({\n issue: mockIssue as unknown as IssuesManager.Issue.Issue,\n });\n\n const {icon} = extractElements(shadowRoot);\n assert.strictEqual(icon.name, 'issue-cross-filled');\n });\n\n it('the style reacts to the presence of the issue', async () => {\n const {shadowRoot} = await renderIssueLinkIcon({\n issue: mockIssue as unknown as IssuesManager.Issue.Issue,\n });\n\n const {button} = extractElements(shadowRoot);\n assert.isTrue(button.classList.contains('link'));\n });\n\n it('the style reacts to the absence of an issue', async () => {\n const {shadowRoot} = await renderIssueLinkIcon({\n issueId,\n issueResolver: failingIssueResolver as unknown as IssuesManager.IssueResolver.IssueResolver,\n });\n\n const {button} = extractElements(shadowRoot);\n assert.isFalse(button.classList.contains('link'));\n });\n });\n\n describe('transitions upon issue resolution', () => {\n it('to change the style correctly', async () => {\n const resolver = new MockIssueResolver();\n const {shadowRoot} = await renderIssueLinkIcon({\n issueId,\n issueResolver: resolver as unknown as IssuesManager.IssueResolver.IssueResolver,\n });\n\n resolver.resolve(mockIssue as unknown as IssuesManager.Issue.Issue);\n await coordinator.done({waitForWork: true});\n\n assert.isTrue(extractElements(shadowRoot).button.classList.contains('link'));\n });\n\n it('handles multiple data assignments', async () => {\n const {shadowRoot, component} = await renderIssueLinkIcon({\n issue: mockIssue as unknown as IssuesManager.Issue.Issue,\n });\n\n const mockIssue2 = {\n getKind() {\n return IssuesManager.Issue.IssueKind.BREAKING_CHANGE;\n },\n };\n\n component.data = {\n issue: mockIssue2 as unknown as IssuesManager.Issue.Issue,\n };\n await coordinator.done({waitForWork: true});\n\n const {icon} = extractElements(shadowRoot);\n assert.strictEqual(icon.name, 'issue-exclamation-filled');\n });\n });\n\n describe('handles clicks correctly', () => {\n it('if the button is clicked', async () => {\n const revealOverride = sinon.fake(Common.Revealer.reveal);\n const {shadowRoot} = await renderIssueLinkIcon({\n issue: mockIssue as unknown as IssuesManager.Issue.Issue,\n revealOverride,\n });\n\n const {button} = extractElements(shadowRoot);\n button.click();\n assert.isTrue(revealOverride.called);\n });\n });\n});\n"]} \ No newline at end of file +{"version":3,"file":"IssueLinkIcon.test.js","sourceRoot":"","sources":["../../../../../../../front_end/ui/components/issue_counter/IssueLinkIcon.test.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,KAAK,MAAM,MAAM,gCAAgC,CAAC;AAEzD,OAAO,KAAK,aAAa,MAAM,kDAAkD,CAAC;AAClF,OAAO,EACL,oBAAoB,GACrB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAC,kBAAkB,EAAC,MAAM,wCAAwC,CAAC;AAC1E,OAAO,KAAK,UAAU,MAAM,+BAA+B,CAAC;AAC5D,OAAO,KAAK,iBAAiB,MAAM,6CAA6C,CAAC;AAEjF,OAAO,KAAK,YAAY,MAAM,oBAAoB,CAAC;AAEnD,MAAM,mBAAmB,GAAG,KAAK,EAAC,IAAkD,EAGjF,EAAE;IACH,MAAM,SAAS,GAAG,IAAI,YAAY,CAAC,aAAa,CAAC,aAAa,EAAE,CAAC;IACjE,SAAS,CAAC,IAAI,GAAG,IAAI,CAAC;IACtB,oBAAoB,CAAC,SAAS,CAAC,CAAC;IAChC,MAAM,CAAC,SAAS,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC;IACvC,MAAM,iBAAiB,CAAC,I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E,CAAC,0BAA0B,EAAE,KAAK,IAAI,EAAE;YACxC,MAAM,cAAc,GAAG,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;YAC1D,MAAM,EAAC,UAAU,EAAC,GAAG,MAAM,mBAAmB,CAAC;gBAC7C,KAAK,EAAE,SAAiD;gBACxD,cAAc;aACf,CAAC,CAAC;YAEH,MAAM,EAAC,MAAM,EAAC,GAAG,eAAe,CAAC,UAAU,CAAC,CAAC;YAC7C,MAAM,CAAC,KAAK,EAAE,CAAC;YACf,MAAM,CAAC,MAAM,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC;QACvC,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["// Copyright 2020 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport * as Common from '../../../core/common/common.js';\nimport type * as Protocol from '../../../generated/protocol.js';\nimport * as IssuesManager from '../../../models/issues_manager/issues_manager.js';\nimport {\n renderElementIntoDOM,\n} from '../../../testing/DOMHelpers.js';\nimport {describeWithLocale} from '../../../testing/EnvironmentHelpers.js';\nimport * as IconButton from '../icon_button/icon_button.js';\nimport * as RenderCoordinator from '../render_coordinator/render_coordinator.js';\n\nimport * as IssueCounter from './issue_counter.js';\n\nconst renderIssueLinkIcon = async(data: IssueCounter.IssueLinkIcon.IssueLinkIconData): Promise<{\n component: IssueCounter.IssueLinkIcon.IssueLinkIcon,\n shadowRoot: ShadowRoot,\n}> => {\n const component = new IssueCounter.IssueLinkIcon.IssueLinkIcon();\n component.data = data;\n renderElementIntoDOM(component);\n assert.isNotNull(component.shadowRoot);\n await RenderCoordinator.done();\n return {component, shadowRoot: component.shadowRoot};\n};\n\nexport const extractElements = (shadowRoot: ShadowRoot): {\n icon: IconButton.Icon.Icon,\n button: HTMLButtonElement,\n} => {\n const icon = shadowRoot.querySelector('devtools-icon');\n assert.instanceOf(icon, IconButton.Icon.Icon);\n const button = shadowRoot.querySelector('button');\n assert.instanceOf(button, HTMLButtonElement);\n return {icon, button};\n};\n\ninterface MockIssueResolverEntry {\n resolve: (issue: IssuesManager.Issue.Issue|null) => void;\n promise: Promise;\n}\n\nclass MockIssueResolver {\n #promiseMap: Map = new Map();\n\n waitFor(issueId?: string) {\n if (!issueId) {\n if (this.#promiseMap.size !== 1) {\n throw new Error('more than one issue being awaited, specify a issue id');\n }\n issueId = this.#promiseMap.keys().next().value;\n }\n issueId = issueId || '';\n const entry = this.#promiseMap.get(issueId);\n if (entry) {\n return entry.promise;\n }\n let resolve: (issue: IssuesManager.Issue.Issue|null) => void = () => {};\n const promise = new Promise(r => {\n resolve = r;\n });\n this.#promiseMap.set(issueId, {resolve, promise});\n return promise;\n }\n\n resolve(result: IssuesManager.Issue.Issue|null, issueId?: string): void {\n if (!issueId && this.#promiseMap.size === 1) {\n issueId = this.#promiseMap.keys().next().value;\n }\n issueId = issueId || result?.getIssueId() || '';\n const entry = this.#promiseMap.get(issueId);\n if (!entry) {\n throw new Error('resolve uninitialized');\n }\n entry.resolve(result);\n this.#promiseMap.delete(issueId);\n }\n}\n\ndescribeWithLocale('IssueLinkIcon', () => {\n const issueId = 'issue1' as Protocol.Audits.IssueId;\n const mockIssue = {\n getKind() {\n return IssuesManager.Issue.IssueKind.PAGE_ERROR;\n },\n getIssueId() {\n return issueId;\n },\n getDescription() {\n return null;\n },\n };\n\n describe('with simple issues', () => {\n const failingIssueResolver = {\n async waitFor() {\n throw new Error('Couldn\\'t resolve');\n },\n };\n\n it('renders correctly without an issue', async () => {\n const {shadowRoot} = await renderIssueLinkIcon({\n issueId,\n issueResolver: failingIssueResolver as unknown as IssuesManager.IssueResolver.IssueResolver,\n });\n\n const {icon} = extractElements(shadowRoot);\n assert.strictEqual(icon.name, 'issue-questionmark-filled');\n });\n\n it('renders correctly with a \"page error\" issue', async () => {\n const {shadowRoot} = await renderIssueLinkIcon({\n issue: mockIssue as unknown as IssuesManager.Issue.Issue,\n });\n\n const {icon} = extractElements(shadowRoot);\n assert.strictEqual(icon.name, 'issue-cross-filled');\n });\n\n it('the style reacts to the presence of the issue', async () => {\n const {shadowRoot} = await renderIssueLinkIcon({\n issue: mockIssue as unknown as IssuesManager.Issue.Issue,\n });\n\n const {button} = extractElements(shadowRoot);\n assert.isTrue(button.classList.contains('link'));\n });\n\n it('the style reacts to the absence of an issue', async () => {\n const {shadowRoot} = await renderIssueLinkIcon({\n issueId,\n issueResolver: failingIssueResolver as unknown as IssuesManager.IssueResolver.IssueResolver,\n });\n\n const {button} = extractElements(shadowRoot);\n assert.isFalse(button.classList.contains('link'));\n });\n });\n\n describe('transitions upon issue resolution', () => {\n it('to change the style correctly', async () => {\n const resolver = new MockIssueResolver();\n const {shadowRoot} = await renderIssueLinkIcon({\n issueId,\n issueResolver: resolver as unknown as IssuesManager.IssueResolver.IssueResolver,\n });\n\n resolver.resolve(mockIssue as unknown as IssuesManager.Issue.Issue);\n await RenderCoordinator.done({waitForWork: true});\n\n assert.isTrue(extractElements(shadowRoot).button.classList.contains('link'));\n });\n\n it('handles multiple data assignments', async () => {\n const {shadowRoot, component} = await renderIssueLinkIcon({\n issue: mockIssue as unknown as IssuesManager.Issue.Issue,\n });\n\n const mockIssue2 = {\n getKind() {\n return IssuesManager.Issue.IssueKind.BREAKING_CHANGE;\n },\n };\n\n component.data = {\n issue: mockIssue2 as unknown as IssuesManager.Issue.Issue,\n };\n await RenderCoordinator.done({waitForWork: true});\n\n const {icon} = extractElements(shadowRoot);\n assert.strictEqual(icon.name, 'issue-exclamation-filled');\n });\n });\n\n describe('handles clicks correctly', () => {\n it('if the button is clicked', async () => {\n const revealOverride = sinon.fake(Common.Revealer.reveal);\n const {shadowRoot} = await renderIssueLinkIcon({\n issue: mockIssue as unknown as IssuesManager.Issue.Issue,\n revealOverride,\n });\n\n const {button} = extractElements(shadowRoot);\n button.click();\n assert.isTrue(revealOverride.called);\n });\n });\n});\n"]} \ No newline at end of file diff --git a/public/ui/components/linkifier/LinkifierImpl.js b/public/ui/components/linkifier/LinkifierImpl.js index 85f2e987b..d58b8163f 100644 --- a/public/ui/components/linkifier/LinkifierImpl.js +++ b/public/ui/components/linkifier/LinkifierImpl.js @@ -3,11 +3,10 @@ // found in the LICENSE file. import * as Platform from '../../../core/platform/platform.js'; import * as LitHtml from '../../lit-html/lit-html.js'; -import * as Coordinator from '../render_coordinator/render_coordinator.js'; +import * as RenderCoordinator from '../render_coordinator/render_coordinator.js'; import linkifierImplStyles from './linkifierImpl.css.js'; import * as LinkifierUtils from './LinkifierUtils.js'; const { html } = LitHtml; -const coordinator = Coordinator.RenderCoordinator.RenderCoordinator.instance(); export class LinkifierClick extends Event { data; static eventName = 'linkifieractivated'; @@ -53,7 +52,7 @@ export class Linkifier extends HTMLElement { async #render() { const linkText = this.#linkText ?? LinkifierUtils.linkText(this.#url, this.#lineNumber); // Disabled until https://crbug.com/1079231 is fixed. - await coordinator.write(() => { + await RenderCoordinator.write(() => { // clang-format off // eslint-disable-next-line rulesdir/no-a-tags-in-lit-html LitHtml.render(html `${linkText}`, this.#shadow, { host: this }); diff --git a/public/ui/components/linkifier/LinkifierImpl.js.map b/public/ui/components/linkifier/LinkifierImpl.js.map index 87d241241..505e9c5fb 100644 --- a/public/ui/components/linkifier/LinkifierImpl.js.map +++ b/public/ui/components/linkifier/LinkifierImpl.js.map @@ -1 +1 @@ -{"version":3,"file":"LinkifierImpl.js","sourceRoot":"","sources":["../../../../../../../front_end/ui/components/linkifier/LinkifierImpl.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,KAAK,QAAQ,MAAM,oCAAoC,CAAC;AAC/D,OAAO,KAAK,OAAO,MAAM,4BAA4B,CAAC;AACtD,OAAO,KAAK,WAAW,MAAM,6CAA6C,CAAC;AAE3E,OAAO,mBAAmB,MAAM,wBAAwB,CAAC;AACzD,OAAO,KAAK,cAAc,MAAM,q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G,CAAC,mBAAmB,CAAC,CAAC;IAC1D,CAAC;IAED,iBAAiB,CAAC,KAAY;QAC5B,KAAK,CAAC,cAAc,EAAE,CAAC;QACvB,MAAM,mBAAmB,GAAG,IAAI,cAAc,CAAC;YAC7C,GAAG,EAAE,IAAI,CAAC,IAAI;YACd,UAAU,EAAE,IAAI,CAAC,WAAW;YAC5B,YAAY,EAAE,IAAI,CAAC,aAAa;SACjC,CAAC,CAAC;QACH,IAAI,CAAC,aAAa,CAAC,mBAAmB,CAAC,CAAC;IAC1C,CAAC;IAED,KAAK,CAAC,OAAO;QACX,MAAM,QAAQ,GAAG,IAAI,CAAC,SAAS,IAAI,cAAc,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC;QACxF,qDAAqD;QACrD,MAAM,WAAW,CAAC,KAAK,CAAC,GAAG,EAAE;YAC3B,mBAAmB;YACnB,0DAA0D;YAC1D,OAAO,CAAC,MAAM,CAAC,IAAI,CAAA,wBAAwB,IAAI,CAAC,IAAI,WAAW,IAAI,CAAC,iBAAiB,UAAU,OAAO,CAAC,UAAU,CAAC,SAAS,CAAC,IAAI,CAAC,MAAM,CAAW,UAAU,QAAQ,aAAa,EAAE,IAAI,CAAC,OAAO,EAAE,EAAE,IAAI,EAAE,IAAI,EAAC,CAAC,CAAC;YAChN,kBAAkB;QACpB,CAAC,CAAC,CAAC;IACL,CAAC;CACF;AAED,cAAc,CAAC,MAAM,CAAC,oBAAoB,EAAE,SAAS,CAAC,CAAC","sourcesContent":["// Copyright 2020 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport * as Platform from '../../../core/platform/platform.js';\nimport * as LitHtml from '../../lit-html/lit-html.js';\nimport * as Coordinator from '../render_coordinator/render_coordinator.js';\n\nimport linkifierImplStyles from './linkifierImpl.css.js';\nimport * as LinkifierUtils from './LinkifierUtils.js';\n\nconst {html} = LitHtml;\n\nconst coordinator = Coordinator.RenderCoordinator.RenderCoordinator.instance();\n\nexport interface LinkifierData {\n url: Platform.DevToolsPath.UrlString;\n lineNumber?: number;\n columnNumber?: number;\n linkText?: string;\n title?: string;\n}\n\nexport class LinkifierClick extends Event {\n static readonly eventName = 'linkifieractivated';\n constructor(public data: LinkifierData) {\n super(LinkifierClick.eventName, {\n bubbles: true,\n composed: true,\n });\n this.data = data;\n }\n}\n\nexport class Linkifier extends HTMLElement {\n\n readonly #shadow = this.attachShadow({mode: 'open'});\n #url: Platform.DevToolsPath.UrlString = Platform.DevToolsPath.EmptyUrlString;\n #lineNumber?: number;\n #columnNumber?: number;\n #linkText?: string;\n #title?: string;\n\n set data(data: LinkifierData) {\n this.#url = data.url;\n this.#lineNumber = data.lineNumber;\n this.#columnNumber = data.columnNumber;\n this.#linkText = data.linkText;\n this.#title = data.title;\n\n if (!this.#url) {\n throw new Error('Cannot construct a Linkifier without providing a valid string URL.');\n }\n\n void this.#render();\n }\n\n connectedCallback(): void {\n this.#shadow.adoptedStyleSheets = [linkifierImplStyles];\n }\n\n #onLinkActivation(event: Event): void {\n event.preventDefault();\n const linkifierClickEvent = new LinkifierClick({\n url: this.#url,\n lineNumber: this.#lineNumber,\n columnNumber: this.#columnNumber,\n });\n this.dispatchEvent(linkifierClickEvent);\n }\n\n async #render(): Promise {\n const linkText = this.#linkText ?? LinkifierUtils.linkText(this.#url, this.#lineNumber);\n // Disabled until https://crbug.com/1079231 is fixed.\n await coordinator.write(() => {\n // clang-format off\n // eslint-disable-next-line rulesdir/no-a-tags-in-lit-html\n LitHtml.render(html`${linkText}`, this.#shadow, { host: this});\n // clang-format on\n });\n }\n}\n\ncustomElements.define('devtools-linkifier', Linkifier);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'devtools-linkifier': Linkifier;\n }\n}\n"]} \ No newline at end of file +{"version":3,"file":"LinkifierImpl.js","sourceRoot":"","sources":["../../../../../../../front_end/ui/components/linkifier/LinkifierImpl.ts"],"names":[],"mappings":"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AC;YACf,MAAM,IAAI,KAAK,CAAC,oEAAoE,CAAC,CAAC;QACxF,CAAC;QAED,KAAK,IAAI,CAAC,OAAO,EAAE,CAAC;IACtB,CAAC;IAED,iBAAiB;QACf,IAAI,CAAC,OAAO,CAAC,kBAAkB,GAAG,CAAC,mBAAmB,CAAC,CAAC;IAC1D,CAAC;IAED,iBAAiB,CAAC,KAAY;QAC5B,KAAK,CAAC,cAAc,EAAE,CAAC;QACvB,MAAM,mBAAmB,GAAG,IAAI,cAAc,CAAC;YAC7C,GAAG,EAAE,IAAI,CAAC,IAAI;YACd,UAAU,EAAE,IAAI,CAAC,WAAW;YAC5B,YAAY,EAAE,IAAI,CAAC,aAAa;SACjC,CAAC,CAAC;QACH,IAAI,CAAC,aAAa,CAAC,mBAAmB,CAAC,CAAC;IAC1C,CAAC;IAED,KAAK,CAAC,OAAO;QACX,MAAM,QAAQ,GAAG,IAAI,CAAC,SAAS,IAAI,cAAc,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC;QACxF,qDAAqD;QACrD,MAAM,iBAAiB,CAAC,KAAK,CAAC,GAAG,EAAE;YACjC,mBAAmB;YACnB,0DAA0D;YAC1D,OAAO,CAAC,MAAM,CAAC,IAAI,CAAA,wBAAwB,IAAI,CAAC,IAAI,WAAW,IAAI,CAAC,iBAAiB,UAAU,OAAO,CAAC,UAAU,CAAC,SAAS,CAAC,IAAI,CAAC,MAAM,CAAW,UAAU,QAAQ,aAAa,EAAE,IAAI,CAAC,OAAO,EAAE,EAAE,IAAI,EAAE,IAAI,EAAC,CAAC,CAAC;YAChN,kBAAkB;QACpB,CAAC,CAAC,CAAC;IACL,CAAC;CACF;AAED,cAAc,CAAC,MAAM,CAAC,oBAAoB,EAAE,SAAS,CAAC,CAAC","sourcesContent":["// Copyright 2020 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport * as Platform from '../../../core/platform/platform.js';\nimport * as LitHtml from '../../lit-html/lit-html.js';\nimport * as RenderCoordinator from '../render_coordinator/render_coordinator.js';\n\nimport linkifierImplStyles from './linkifierImpl.css.js';\nimport * as LinkifierUtils from './LinkifierUtils.js';\n\nconst {html} = LitHtml;\n\nexport interface LinkifierData {\n url: Platform.DevToolsPath.UrlString;\n lineNumber?: number;\n columnNumber?: number;\n linkText?: string;\n title?: string;\n}\n\nexport class LinkifierClick extends Event {\n static readonly eventName = 'linkifieractivated';\n constructor(public data: LinkifierData) {\n super(LinkifierClick.eventName, {\n bubbles: true,\n composed: true,\n });\n this.data = data;\n }\n}\n\nexport class Linkifier extends HTMLElement {\n\n readonly #shadow = this.attachShadow({mode: 'open'});\n #url: Platform.DevToolsPath.UrlString = Platform.DevToolsPath.EmptyUrlString;\n #lineNumber?: number;\n #columnNumber?: number;\n #linkText?: string;\n #title?: string;\n\n set data(data: LinkifierData) {\n this.#url = data.url;\n this.#lineNumber = data.lineNumber;\n this.#columnNumber = data.columnNumber;\n this.#linkText = data.linkText;\n this.#title = data.title;\n\n if (!this.#url) {\n throw new Error('Cannot construct a Linkifier without providing a valid string URL.');\n }\n\n void this.#render();\n }\n\n connectedCallback(): void {\n this.#shadow.adoptedStyleSheets = [linkifierImplStyles];\n }\n\n #onLinkActivation(event: Event): void {\n event.preventDefault();\n const linkifierClickEvent = new LinkifierClick({\n url: this.#url,\n lineNumber: this.#lineNumber,\n columnNumber: this.#columnNumber,\n });\n this.dispatchEvent(linkifierClickEvent);\n }\n\n async #render(): Promise {\n const linkText = this.#linkText ?? LinkifierUtils.linkText(this.#url, this.#lineNumber);\n // Disabled until https://crbug.com/1079231 is fixed.\n await RenderCoordinator.write(() => {\n // clang-format off\n // eslint-disable-next-line rulesdir/no-a-tags-in-lit-html\n LitHtml.render(html`${linkText}`, this.#shadow, { host: this});\n // clang-format on\n });\n }\n}\n\ncustomElements.define('devtools-linkifier', Linkifier);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'devtools-linkifier': Linkifier;\n }\n}\n"]} \ No newline at end of file diff --git a/public/ui/components/linkifier/LinkifierImpl.test.js b/public/ui/components/linkifier/LinkifierImpl.test.js index 5dc471806..f00714317 100644 --- a/public/ui/components/linkifier/LinkifierImpl.test.js +++ b/public/ui/components/linkifier/LinkifierImpl.test.js @@ -2,11 +2,10 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. import * as Platform from '../../../core/platform/platform.js'; +import { dispatchClickEvent, getEventPromise, renderElementIntoDOM, } from '../../../testing/DOMHelpers.js'; import { describeWithLocale } from '../../../testing/EnvironmentHelpers.js'; -import * as Coordinator from '../render_coordinator/render_coordinator.js'; +import * as RenderCoordinator from '../render_coordinator/render_coordinator.js'; import * as Linkifier from './linkifier.js'; -const coordinator = Coordinator.RenderCoordinator.RenderCoordinator.instance(); -import { dispatchClickEvent, getEventPromise, renderElementIntoDOM, } from '../../../testing/DOMHelpers.js'; describeWithLocale('Linkifier', () => { it('renders a link when given a URL', async () => { const component = new Linkifier.Linkifier.Linkifier(); @@ -14,7 +13,7 @@ describeWithLocale('Linkifier', () => { url: 'https://example.com', }; renderElementIntoDOM(component); - await coordinator.done(); + await RenderCoordinator.done(); assert.isNotNull(component.shadowRoot); const link = component.shadowRoot.querySelector('a'); assert.instanceOf(link, HTMLAnchorElement); @@ -33,7 +32,7 @@ describeWithLocale('Linkifier', () => { lineNumber: 1, }; renderElementIntoDOM(component); - await coordinator.done(); + await RenderCoordinator.done(); assert.isNotNull(component.shadowRoot); const link = component.shadowRoot.querySelector('a'); assert.instanceOf(link, HTMLAnchorElement); @@ -53,7 +52,7 @@ describeWithLocale('Linkifier', () => { e.preventDefault(); }); renderElementIntoDOM(component); - await coordinator.done(); + await RenderCoordinator.done(); assert.isNotNull(component.shadowRoot); const link = component.shadowRoot.querySelector('a'); assert.instanceOf(link, HTMLAnchorElement); diff --git a/public/ui/components/linkifier/LinkifierImpl.test.js.map b/public/ui/components/linkifier/LinkifierImpl.test.js.map index 11ed0e3e9..667c9b648 100644 --- a/public/ui/components/linkifier/LinkifierImpl.test.js.map +++ b/public/ui/components/linkifier/LinkifierImpl.test.js.map @@ -1 +1 @@ -{"version":3,"file":"LinkifierImpl.test.js","sourceRoot":"","sources":["../../../../../../../front_end/ui/components/linkifier/LinkifierImpl.test.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,KAAK,QAAQ,MAAM,oCAAoC,CAAC;AAC/D,OAAO,EAAC,kBAAkB,EAAC,MAAM,wCAAwC,CAAC;AAC1E,OAAO,KAAK,WAAW,MAAM,6CAA6C,CAAC;AAE3E,OAAO,KAAK,SAAS,MAAM,gBAAgB,CAAC;AAE5C,MAAM,WAAW,GAAG,WAAW,CAAC,iBAAiB,CAAC,iBAAiB,CAAC,QAAQ,EAAE,CAAC;AAE/E,OAAO,EACL,kBAAkB,EAClB,eAAe,EACf,oBAAoB,GACrB,MAAM,gCAAgC,CAAC;AACxC,kBAAkB,CAAC,WAAW,EAAE,GAAG,EAAE;IACnC,EAAE,CAAC,iCAAiC,EAAE,KAAK,IAAI,EAAE;QAC/C,MAAM,SAAS,GAAG,IAAI,SAAS,CAAC,SAAS,CAAC,SAAS,EAAE,CAAC;QACtD,SAAS,CAAC,IAAI,GAAG;YACf,GAAG,EAAE,qBAAwD;SAC9D,CAAC;QACF,oBAAoB,CAAC,SAAS,CAAC,CAAC;QAChC,MAAM,WAAW,CAAC,IAAI,EAAE,CAAC;QACzB,MAAM,CAAC,SAAS,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC;QACvC,MAAM,IAAI,GAAG,SAAS,CAAC,UAAU,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC;QACrD,MAAM,CAAC,UAAU,CAAC,IAAI,EAAE,iBAAiB,CAAC,CAAC;QAC3C,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,SAAS,EAAE,aAAa,CAAC,CAAC;IACpD,CAAC,CAAC,CAAC;IAEH,EA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;YACnD,CAAC,CAAC,eAAe,EAAE,CAAC;YACpB,CAAC,CAAC,cAAc,EAAE,CAAC;QACrB,CAAC,CAAC,CAAC;QACH,oBAAoB,CAAC,SAAS,CAAC,CAAC;QAChC,MAAM,WAAW,CAAC,IAAI,EAAE,CAAC;QACzB,MAAM,CAAC,SAAS,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC;QACvC,MAAM,IAAI,GAAG,SAAS,CAAC,UAAU,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC;QACrD,MAAM,CAAC,UAAU,CAAC,IAAI,EAAE,iBAAiB,CAAC,CAAC;QAE3C,MAAM,iBAAiB,GAAG,eAAe,CAAqC,SAAS,EAAE,oBAAoB,CAAC,CAAC;QAC/G,kBAAkB,CAAC,IAAI,EAAE;YACvB,UAAU,EAAE,IAAI;SACjB,CAAC,CAAC;QACH,MAAM,UAAU,GAAG,MAAM,iBAAiB,CAAC;QAC3C,MAAM,CAAC,SAAS,CAAC,UAAU,CAAC,IAAI,EAAE;YAChC,GAAG,EAAE,qBAAwD;YAC7D,UAAU,EAAE,CAAC;YACb,YAAY,EAAE,EAAE;SACjB,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["// Copyright 2020 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport * as Platform from '../../../core/platform/platform.js';\nimport {describeWithLocale} from '../../../testing/EnvironmentHelpers.js';\nimport * as Coordinator from '../render_coordinator/render_coordinator.js';\n\nimport * as Linkifier from './linkifier.js';\n\nconst coordinator = Coordinator.RenderCoordinator.RenderCoordinator.instance();\n\nimport {\n dispatchClickEvent,\n getEventPromise,\n renderElementIntoDOM,\n} from '../../../testing/DOMHelpers.js';\ndescribeWithLocale('Linkifier', () => {\n it('renders a link when given a URL', async () => {\n const component = new Linkifier.Linkifier.Linkifier();\n component.data = {\n url: 'https://example.com' as Platform.DevToolsPath.UrlString,\n };\n renderElementIntoDOM(component);\n await coordinator.done();\n assert.isNotNull(component.shadowRoot);\n const link = component.shadowRoot.querySelector('a');\n assert.instanceOf(link, HTMLAnchorElement);\n assert.strictEqual(link.innerText, 'example.com');\n });\n\n it('throws when given an invalid URL', () => {\n const component = new Linkifier.Linkifier.Linkifier();\n\n assert.throws(() => {\n component.data = {url: Platform.DevToolsPath.EmptyUrlString};\n }, 'Cannot construct a Linkifier without providing a valid string URL.');\n });\n\n it('appends the line number to the URL if given, and adds one to deal with 0 indexing', async () => {\n const component = new Linkifier.Linkifier.Linkifier();\n component.data = {\n url: 'https://example.com' as Platform.DevToolsPath.UrlString,\n lineNumber: 1,\n };\n renderElementIntoDOM(component);\n await coordinator.done();\n assert.isNotNull(component.shadowRoot);\n const link = component.shadowRoot.querySelector('a');\n assert.instanceOf(link, HTMLAnchorElement);\n assert.strictEqual(link.innerText, 'example.com:2');\n });\n\n it('emits an event when clicked', async () => {\n const component = new Linkifier.Linkifier.Linkifier();\n component.data = {\n url: 'https://example.com' as Platform.DevToolsPath.UrlString,\n lineNumber: 1,\n columnNumber: 50,\n };\n // Suppress the event so that the link is not actually opened in the test\n // runner by the global handler.\n component.addEventListener('linkifieractivated', e => {\n e.stopPropagation();\n e.preventDefault();\n });\n renderElementIntoDOM(component);\n await coordinator.done();\n assert.isNotNull(component.shadowRoot);\n const link = component.shadowRoot.querySelector('a');\n assert.instanceOf(link, HTMLAnchorElement);\n\n const clickEventPromise = getEventPromise(component, 'linkifieractivated');\n dispatchClickEvent(link, {\n cancelable: true,\n });\n const clickEvent = await clickEventPromise;\n assert.deepEqual(clickEvent.data, {\n url: 'https://example.com' as Platform.DevToolsPath.UrlString,\n lineNumber: 1,\n columnNumber: 50,\n });\n });\n});\n"]} \ No newline at end of file +{"version":3,"file":"LinkifierImpl.test.js","sourceRoot":"","sources":["../../../../../../../front_end/ui/components/linkifier/LinkifierImpl.test.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6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AAM,CAAC,UAAU,CAAC,IAAI,EAAE,iBAAiB,CAAC,CAAC;QAE3C,MAAM,iBAAiB,GAAG,eAAe,CAAqC,SAAS,EAAE,oBAAoB,CAAC,CAAC;QAC/G,kBAAkB,CAAC,IAAI,EAAE;YACvB,UAAU,EAAE,IAAI;SACjB,CAAC,CAAC;QACH,MAAM,UAAU,GAAG,MAAM,iBAAiB,CAAC;QAC3C,MAAM,CAAC,SAAS,CAAC,UAAU,CAAC,IAAI,EAAE;YAChC,GAAG,EAAE,qBAAwD;YAC7D,UAAU,EAAE,CAAC;YACb,YAAY,EAAE,EAAE;SACjB,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["// Copyright 2020 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport * as Platform from '../../../core/platform/platform.js';\nimport {\n dispatchClickEvent,\n getEventPromise,\n renderElementIntoDOM,\n} from '../../../testing/DOMHelpers.js';\nimport {describeWithLocale} from '../../../testing/EnvironmentHelpers.js';\nimport * as RenderCoordinator from '../render_coordinator/render_coordinator.js';\n\nimport * as Linkifier from './linkifier.js';\n\ndescribeWithLocale('Linkifier', () => {\n it('renders a link when given a URL', async () => {\n const component = new Linkifier.Linkifier.Linkifier();\n component.data = {\n url: 'https://example.com' as Platform.DevToolsPath.UrlString,\n };\n renderElementIntoDOM(component);\n await RenderCoordinator.done();\n assert.isNotNull(component.shadowRoot);\n const link = component.shadowRoot.querySelector('a');\n assert.instanceOf(link, HTMLAnchorElement);\n assert.strictEqual(link.innerText, 'example.com');\n });\n\n it('throws when given an invalid URL', () => {\n const component = new Linkifier.Linkifier.Linkifier();\n\n assert.throws(() => {\n component.data = {url: Platform.DevToolsPath.EmptyUrlString};\n }, 'Cannot construct a Linkifier without providing a valid string URL.');\n });\n\n it('appends the line number to the URL if given, and adds one to deal with 0 indexing', async () => {\n const component = new Linkifier.Linkifier.Linkifier();\n component.data = {\n url: 'https://example.com' as Platform.DevToolsPath.UrlString,\n lineNumber: 1,\n };\n renderElementIntoDOM(component);\n await RenderCoordinator.done();\n assert.isNotNull(component.shadowRoot);\n const link = component.shadowRoot.querySelector('a');\n assert.instanceOf(link, HTMLAnchorElement);\n assert.strictEqual(link.innerText, 'example.com:2');\n });\n\n it('emits an event when clicked', async () => {\n const component = new Linkifier.Linkifier.Linkifier();\n component.data = {\n url: 'https://example.com' as Platform.DevToolsPath.UrlString,\n lineNumber: 1,\n columnNumber: 50,\n };\n // Suppress the event so that the link is not actually opened in the test\n // runner by the global handler.\n component.addEventListener('linkifieractivated', e => {\n e.stopPropagation();\n e.preventDefault();\n });\n renderElementIntoDOM(component);\n await RenderCoordinator.done();\n assert.isNotNull(component.shadowRoot);\n const link = component.shadowRoot.querySelector('a');\n assert.instanceOf(link, HTMLAnchorElement);\n\n const clickEventPromise = getEventPromise(component, 'linkifieractivated');\n dispatchClickEvent(link, {\n cancelable: true,\n });\n const clickEvent = await clickEventPromise;\n assert.deepEqual(clickEvent.data, {\n url: 'https://example.com' as Platform.DevToolsPath.UrlString,\n lineNumber: 1,\n columnNumber: 50,\n });\n });\n});\n"]} \ No newline at end of file diff --git a/public/ui/components/markdown_view/MarkdownImage.test.js b/public/ui/components/markdown_view/MarkdownImage.test.js index ad7b4858c..12da32f82 100644 --- a/public/ui/components/markdown_view/MarkdownImage.test.js +++ b/public/ui/components/markdown_view/MarkdownImage.test.js @@ -3,9 +3,8 @@ // found in the LICENSE file. import { getElementWithinComponent, renderElementIntoDOM, } from '../../../testing/DOMHelpers.js'; import * as IconButton from '../icon_button/icon_button.js'; -import * as Coordinator from '../render_coordinator/render_coordinator.js'; +import * as RenderCoordinator from '../render_coordinator/render_coordinator.js'; import * as MarkdownView from './markdown_view.js'; -const coordinator = Coordinator.RenderCoordinator.RenderCoordinator.instance(); describe('MarkdownImage', () => { const imageSource = 'Images/lighthouse_logo.svg'; before(async () => { @@ -26,7 +25,7 @@ describe('MarkdownImage', () => { const component = new MarkdownView.MarkdownImage.MarkdownImage(); component.data = { key: 'test-icon', title: 'Test icon' }; renderElementIntoDOM(component); - await coordinator.done(); + await RenderCoordinator.done(); assert.isNotNull(component.shadowRoot); const iconComponent = getElementWithinComponent(component, 'devtools-icon', IconButton.Icon.Icon); assert.isNotNull(iconComponent); diff --git a/public/ui/components/markdown_view/MarkdownImage.test.js.map b/public/ui/components/markdown_view/MarkdownImage.test.js.map index 2bd0ada78..585fb6997 100644 --- a/public/ui/components/markdown_view/MarkdownImage.test.js.map +++ b/public/ui/components/markdown_view/MarkdownImage.test.js.map @@ -1 +1 @@ -{"version":3,"file":"MarkdownImage.test.js","sourceRoot":"","sources":["../../../../../../../front_end/ui/components/markdown_view/MarkdownImage.test.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,EACL,yBAAyB,EACzB,oBAAoB,GACrB,MAAM,gCAAgC,CAAC;AACxC,OAAO,KAAK,UAAU,MAAM,+BAA+B,CAAC;AAC5D,OAAO,KAAK,WAAW,MAAM,6CAA6C,CAAC;AAE3E,OAAO,KAAK,YAAY,MAAM,oBAAoB,CAAC;AAEnD,MAAM,WAAW,GAAG,WAAW,CAAC,iBAAiB,CAAC,iBAAiB,CAAC,QAAQ,EAAE,CAAC;AAE/E,QAAQ,CAAC,eAAe,EAAE,GAAG,EAAE;IAC7B,MAAM,WAAW,GAAG,4BAA4B,CAAC;IACjD,MAAM,CAAC,KAAK,IAAI,EAAE;QAChB,YAAY,CAAC,iBAAiB,CAAC,cAAc,CAAC,GAAG,CAAC,WAAW,EAAE;YAC7D,GAAG,EAAE,IAAI,GAAG,CAAC,4BAA4B,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE;YACtE,KAAK,EAAE,MAAM;YACb,MAAM,EAAE,MAAM;YACd,MAAM,EAAE,IAAI;SACb,CAAC,CAAC;QACH,YAAY,CAAC,iBAAiB,CAAC,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AE,gBAAgB,EAAE,KAAK,EAAE,kBAAkB,EAAC,CAAC;QACpE,oBAAoB,CAAC,SAAS,CAAC,CAAC;QAChC,MAAM,CAAC,SAAS,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC;QACvC,MAAM,cAAc,GAAG,yBAAyB,CAAC,SAAS,EAAE,KAAK,EAAE,gBAAgB,CAAC,CAAC;QACrF,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC;QACjC,MAAM,CAAC,OAAO,CAAC,cAAc,CAAC,GAAG,EAAE,WAAW,CAAC,CAAC;QAChD,MAAM,CAAC,WAAW,CAAC,cAAc,CAAC,GAAG,EAAE,kBAAkB,CAAC,CAAC;QAC3D,MAAM,CAAC,WAAW,CAAC,cAAc,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;QAC9C,MAAM,CAAC,WAAW,CAAC,cAAc,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IACjD,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["// Copyright 2020 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport {\n getElementWithinComponent,\n renderElementIntoDOM,\n} from '../../../testing/DOMHelpers.js';\nimport * as IconButton from '../icon_button/icon_button.js';\nimport * as Coordinator from '../render_coordinator/render_coordinator.js';\n\nimport * as MarkdownView from './markdown_view.js';\n\nconst coordinator = Coordinator.RenderCoordinator.RenderCoordinator.instance();\n\ndescribe('MarkdownImage', () => {\n const imageSource = 'Images/lighthouse_logo.svg';\n before(async () => {\n MarkdownView.MarkdownImagesMap.markdownImages.set('test-icon', {\n src: new URL('../../../Images/review.svg', import.meta.url).toString(),\n width: '20px',\n height: '20px',\n isIcon: true,\n });\n MarkdownView.MarkdownImagesMap.markdownImages.set('test-image', {\n src: new URL(`../../../${imageSource}`, import.meta.url).toString(),\n width: '100px',\n height: '100px',\n isIcon: false,\n });\n });\n it('renders icon correctly', async () => {\n const component = new MarkdownView.MarkdownImage.MarkdownImage();\n component.data = {key: 'test-icon', title: 'Test icon'};\n renderElementIntoDOM(component);\n await coordinator.done();\n assert.isNotNull(component.shadowRoot);\n const iconComponent = getElementWithinComponent(component, 'devtools-icon', IconButton.Icon.Icon);\n assert.isNotNull(iconComponent);\n const boundingClient = iconComponent.getBoundingClientRect();\n assert.strictEqual(boundingClient.width, 20);\n assert.strictEqual(boundingClient.height, 20);\n });\n it('renders image correctly', () => {\n const component = new MarkdownView.MarkdownImage.MarkdownImage();\n const markdownImageTitle = 'Test image';\n const markdownImageKey = 'test-image';\n component.data = {key: markdownImageKey, title: markdownImageTitle};\n renderElementIntoDOM(component);\n assert.isNotNull(component.shadowRoot);\n const imageComponent = getElementWithinComponent(component, 'img', HTMLImageElement);\n assert.isNotNull(imageComponent);\n assert.include(imageComponent.src, imageSource);\n assert.strictEqual(imageComponent.alt, markdownImageTitle);\n assert.strictEqual(imageComponent.width, 100);\n assert.strictEqual(imageComponent.height, 100);\n });\n});\n"]} \ No newline at end of file +{"version":3,"file":"MarkdownImage.test.js","sourceRoot":"","sources":["../../../../../../../front_end/ui/components/markdown_view/MarkdownImage.test.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,EACL,yBAAyB,EACzB,oBAAoB,GACrB,MAAM,gCAAgC,CAAC;AACxC,OAAO,KAAK,UAAU,MAAM,+BAA+B,CAAC;AAC5D,OAAO,KAAK,iBAAiB,MAAM,6CAA6C,CAAC;AAEjF,OAAO,KAAK,YAAY,MAAM,oBAAoB,CAAC;AAEnD,QAAQ,CAAC,eAAe,EAAE,GAAG,EAAE;IAC7B,MAAM,WAAW,GAAG,4BAA4B,CAAC;IACjD,MAAM,CAAC,KAAK,IAAI,EAAE;QAChB,YAAY,CAAC,iBAAiB,CAAC,cAAc,CAAC,GAAG,CAAC,WAAW,EAAE;YAC7D,GAAG,EAAE,IAAI,GAAG,CAAC,4BAA4B,EAAE,MAAM,CAAC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I,YAAY,CAAC,aAAa,CAAC,aAAa,EAAE,CAAC;QACjE,MAAM,kBAAkB,GAAG,YAAY,CAAC;QACxC,MAAM,gBAAgB,GAAG,YAAY,CAAC;QACtC,SAAS,CAAC,IAAI,GAAG,EAAC,GAAG,EAAE,gBAAgB,EAAE,KAAK,EAAE,kBAAkB,EAAC,CAAC;QACpE,oBAAoB,CAAC,SAAS,CAAC,CAAC;QAChC,MAAM,CAAC,SAAS,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC;QACvC,MAAM,cAAc,GAAG,yBAAyB,CAAC,SAAS,EAAE,KAAK,EAAE,gBAAgB,CAAC,CAAC;QACrF,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC;QACjC,MAAM,CAAC,OAAO,CAAC,cAAc,CAAC,GAAG,EAAE,WAAW,CAAC,CAAC;QAChD,MAAM,CAAC,WAAW,CAAC,cAAc,CAAC,GAAG,EAAE,kBAAkB,CAAC,CAAC;QAC3D,MAAM,CAAC,WAAW,CAAC,cAAc,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;QAC9C,MAAM,CAAC,WAAW,CAAC,cAAc,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IACjD,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["// Copyright 2020 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport {\n getElementWithinComponent,\n renderElementIntoDOM,\n} from '../../../testing/DOMHelpers.js';\nimport * as IconButton from '../icon_button/icon_button.js';\nimport * as RenderCoordinator from '../render_coordinator/render_coordinator.js';\n\nimport * as MarkdownView from './markdown_view.js';\n\ndescribe('MarkdownImage', () => {\n const imageSource = 'Images/lighthouse_logo.svg';\n before(async () => {\n MarkdownView.MarkdownImagesMap.markdownImages.set('test-icon', {\n src: new URL('../../../Images/review.svg', import.meta.url).toString(),\n width: '20px',\n height: '20px',\n isIcon: true,\n });\n MarkdownView.MarkdownImagesMap.markdownImages.set('test-image', {\n src: new URL(`../../../${imageSource}`, import.meta.url).toString(),\n width: '100px',\n height: '100px',\n isIcon: false,\n });\n });\n it('renders icon correctly', async () => {\n const component = new MarkdownView.MarkdownImage.MarkdownImage();\n component.data = {key: 'test-icon', title: 'Test icon'};\n renderElementIntoDOM(component);\n await RenderCoordinator.done();\n assert.isNotNull(component.shadowRoot);\n const iconComponent = getElementWithinComponent(component, 'devtools-icon', IconButton.Icon.Icon);\n assert.isNotNull(iconComponent);\n const boundingClient = iconComponent.getBoundingClientRect();\n assert.strictEqual(boundingClient.width, 20);\n assert.strictEqual(boundingClient.height, 20);\n });\n it('renders image correctly', () => {\n const component = new MarkdownView.MarkdownImage.MarkdownImage();\n const markdownImageTitle = 'Test image';\n const markdownImageKey = 'test-image';\n component.data = {key: markdownImageKey, title: markdownImageTitle};\n renderElementIntoDOM(component);\n assert.isNotNull(component.shadowRoot);\n const imageComponent = getElementWithinComponent(component, 'img', HTMLImageElement);\n assert.isNotNull(imageComponent);\n assert.include(imageComponent.src, imageSource);\n assert.strictEqual(imageComponent.alt, markdownImageTitle);\n assert.strictEqual(imageComponent.width, 100);\n assert.strictEqual(imageComponent.height, 100);\n });\n});\n"]} \ No newline at end of file diff --git a/public/ui/components/markdown_view/MarkdownView.test.js b/public/ui/components/markdown_view/MarkdownView.test.js index 00f4fbdf0..39b15c744 100644 --- a/public/ui/components/markdown_view/MarkdownView.test.js +++ b/public/ui/components/markdown_view/MarkdownView.test.js @@ -74,7 +74,7 @@ describeWithEnvironment('MarkdownView', () => { }); it('renders childless text tokens as-is', () => { const container = renderTemplateResult(renderer.renderToken(getFakeToken({ type: 'text', text: 'Simple text token' }))); - assert.deepEqual(container.childTextNodes().length, 1); + assert.lengthOf(container.childTextNodes(), 1); assert.deepEqual(container.childTextNodes()[0].textContent, 'Simple text token'); }); it('renders nested text tokens correctly', () => { @@ -236,10 +236,10 @@ ${paragraphText} component.data = { tokens: Marked.Marked.lexer(markdownString) }; assert.isNotNull(component.shadowRoot); const paragraphs = Array.from(component.shadowRoot.querySelectorAll('p')); - assert.strictEqual(paragraphs.length, 1); + assert.lengthOf(paragraphs, 1); assert.strictEqual(paragraphs[0].innerText, paragraphText); const listItems = Array.from(component.shadowRoot.querySelectorAll('li')); - assert.strictEqual(listItems.length, 2); + assert.lengthOf(listItems, 2); assert.deepEqual(listItems.map(item => item.textContent), listItemTexts); }); it('renders a codeblock', () => { diff --git a/public/ui/components/markdown_view/MarkdownView.test.js.map b/public/ui/components/markdown_view/MarkdownView.test.js.map index 924705427..a57a428fc 100644 --- a/public/ui/components/markdown_view/MarkdownView.test.js.map +++ b/public/ui/components/markdown_view/MarkdownView.test.js.map @@ -1 +1 @@ -{"version":3,"file":"MarkdownView.test.js","sourceRoot":"","sources":["../../../../../../../front_end/ui/components/markdown_view/MarkdownView.test.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,EAAC,oBAAoB,EAAC,MAAM,gCAAgC,CAAC;AACpE,OAAO,EAAC,uBAAuB,EAAC,MAAM,wCAAwC,CAAC;AAC/E,OAAO,KAAK,MAAM,MAAM,uCAAuC,CAAC;AAChE,OAAO,KAAK,OAAO,MAAM,4BAA4B,CAAC;AAEtD,OAAO,KAAK,YAAY,MAAM,oBAAoB,CAAC;AAEnD,MAAM,EAAC,IAAI,EAAC,GAAG,OAAO,CAAC;AAWvB,SAAS,YAAY,CAAC,KAAgB;IACpC,OAAO,KAAuC,CAAC;AACjD,CAAC;AAED,SAAS,oBAAoB,CAAC,cAAsC;IAClE,MAAM,SAAS,GAAG,QAAQ,CAAC,aAAa,CAAC,WAAW,CAAC,CAAC;IACtD,OAAO,CAAC,MAAM,CAAC,cAAc,EAAE,SAAS,CAAC,CAAC,CAAE,kDAAkD;IAC9F,OAAO,SAAS,CAAC;AACnB,CAAC;AAED,uBAAuB,CAAC,cAAc,EAAE,GAAG,EAAE;IAC3C,QAAQ,CAAC,WAAW,EAAE,GA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CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,QAAQ,CAAC,UAAU,EAAE,GAAG,EAAE;QACxB,EAAE,CAAC,oCAAoC,EAAE,GAAG,EAAE;YAC5C,MAAM,SAAS,GAAG,YAAY,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC;YAC7C,MAAM,CAAC,WAAW,CAAC,SAAS,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;QACnD,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,6BAA6B,EAAE,GAAG,EAAE;YACrC,MAAM,SAAS,GAAG,YAAY,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC;YAC9C,MAAM,CAAC,WAAW,CAAC,SAAS,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;QACpD,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,2BAA2B,EAAE,GAAG,EAAE;YACnC,MAAM,SAAS,GAAG,YAAY,CAAC,0BAA0B,EAAE,GAAG,CAAC,CAAC;YAChE,MAAM,CAAC,WAAW,CAAC,SAAS,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;QACpD,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,2CAA2C,EAAE,GAAG,EAAE;YACnD,MAAM,SAAS,GAAG,YAAY,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;YAClD,MAAM,CAAC,WAAW,CAAC,SAAS,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;QACnD,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["// Copyright 2020 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport {renderElementIntoDOM} from '../../../testing/DOMHelpers.js';\nimport {describeWithEnvironment} from '../../../testing/EnvironmentHelpers.js';\nimport * as Marked from '../../../third_party/marked/marked.js';\nimport * as LitHtml from '../../lit-html/lit-html.js';\n\nimport * as MarkdownView from './markdown_view.js';\n\nconst {html} = LitHtml;\n\ntype TestToken = {\n type: string,\n tokens?: Marked.Marked.Token[],\n text?: string,\n href?: string,\n items?: Object[],\n depth?: number,\n};\n\nfunction getFakeToken(token: TestToken): Marked.Marked.Token {\n return token as unknown as Marked.Marked.Token;\n}\n\nfunction renderTemplateResult(templateResult: LitHtml.TemplateResult): HTMLElement {\n const container = document.createElement('container');\n LitHtml.render(templateResult, container); // eslint-disable-line rulesdir/lit-html-host-this\n return container;\n}\n\ndescribeWithEnvironment('MarkdownView', () => {\n describe('tokenizer', () => {\n it('tokenizers links in single quotes', () => {\n assert.deepEqual(Marked.Marked.lexer('\\'https://example.com\\''), [\n {\n raw: '\\'https://example.com\\'',\n text: '\\'https://example.com\\'',\n tokens: [\n {\n raw: '\\'',\n text: ''',\n type: 'text',\n },\n {\n href: 'https://example.com',\n raw: 'https://example.com',\n text: 'https://example.com',\n tokens: [\n {\n raw: 'https://example.com',\n text: 'https://example.com',\n type: 'text',\n },\n ],\n type: 'link',\n },\n {\n raw: '\\'',\n text: ''',\n type: 'text',\n },\n ],\n type: 'paragraph',\n },\n ] as unknown as Marked.Marked.TokensList);\n });\n });\n describe('MarkdownLitRenderer renderToken', () => {\n const renderer = new MarkdownView.MarkdownView.MarkdownLitRenderer();\n\n it('wraps paragraph tokens in

tags', () => {\n const container = renderTemplateResult(renderer.renderToken(getFakeToken({type: 'paragraph', tokens: []})));\n\n assert.exists(container.querySelector('p'));\n });\n\n it('wraps an unordered list token in

    tags', () => {\n const container = renderTemplateResult(renderer.renderToken(getFakeToken({type: 'list', items: []})));\n\n assert.exists(container.querySelector('ul'));\n });\n\n it('wraps list items in
  • tags', () => {\n const container = renderTemplateResult(renderer.renderToken(getFakeToken({type: 'list_item', tokens: []})));\n assert.exists(container.querySelector('li'));\n });\n\n it('wraps a codespan token in tags', () => {\n const container =\n renderTemplateResult(renderer.renderToken(getFakeToken({type: 'codespan', text: 'const foo = 42;'})));\n\n const code = container.querySelector('code');\n assert.exists(code);\n assert.deepEqual(code.textContent, 'const foo = 42;');\n });\n\n it('renders childless text tokens as-is', () => {\n const container =\n renderTemplateResult(renderer.renderToken(getFakeToken({type: 'text', text: 'Simple text token'})));\n\n assert.deepEqual(container.childTextNodes().length, 1);\n assert.deepEqual(container.childTextNodes()[0].textContent, 'Simple text token');\n });\n\n it('renders nested text tokens correctly', () => {\n const container = renderTemplateResult(renderer.renderToken(getFakeToken({\n type: 'text',\n text: 'This text should not be rendered. Only the subtokens!',\n tokens: [\n getFakeToken({type: 'text', text: 'Nested raw text'}),\n getFakeToken({type: 'codespan', text: 'and a nested codespan to boot'}),\n ],\n })));\n\n assert.notInclude(container.textContent, 'This text should not be rendered. Only the subtokens!');\n assert.include(container.textContent, 'Nested raw text');\n assert.exists(container.querySelector('code'));\n assert.deepEqual(container.querySelector('code')?.textContent, 'and a nested codespan to boot');\n });\n\n it('throws an error for invalid or unsupported token types', () => {\n assert.throws(() => renderer.renderToken(getFakeToken({type: 'no_way_this_is_a_valid_markdown_token'})));\n });\n\n it('renders link with valid key', () => {\n MarkdownView.MarkdownLinksMap.markdownLinks.set('exampleLink', 'https://web.dev/');\n const renderResult =\n renderer.renderToken(getFakeToken({type: 'link', text: 'learn more', href: 'exampleLink'})).strings.join('');\n\n assert.isTrue(renderResult.includes(' {\n assert.throws(() => MarkdownView.MarkdownLinksMap.getMarkdownLink('testErrorLink'));\n });\n\n it('renders icon with valid key', () => {\n MarkdownView.MarkdownImagesMap.markdownImages.set('testExampleImage', {\n src: 'devices',\n isIcon: true,\n });\n const renderResult =\n renderer.renderToken(getFakeToken({type: 'image', text: 'phone', href: 'testExampleImage'})).strings.join('');\n assert.isTrue(renderResult.includes(' {\n MarkdownView.MarkdownImagesMap.markdownImages.set('exampleImage', {\n src: 'Images/phone-logo.png',\n isIcon: false,\n });\n const renderResult =\n renderer.renderToken(getFakeToken({type: 'image', text: 'phone', href: 'exampleImage'})).strings.join('');\n assert.isTrue(renderResult.includes(' {\n assert.throws(() => MarkdownView.MarkdownImagesMap.getMarkdownImage('testErrorImageLink'));\n });\n it('renders a heading correctly', () => {\n const renderResult =\n renderer.renderToken(getFakeToken({type: 'heading', text: 'a heading text', depth: 3})).strings.join('');\n\n assert.isTrue(renderResult.includes(' {\n const renderResult = renderer.renderToken(getFakeToken({type: 'strong', text: 'a strong text'})).strings.join('');\n\n assert.isTrue(renderResult.includes(' {\n const renderResult = renderer.renderToken(getFakeToken({type: 'em', text: 'em text'})).strings.join('');\n\n assert.isTrue(renderResult.includes(' {\n renderer.setCustomClasses({em: 'custom-class'});\n\n const renderResult = renderer.renderToken(getFakeToken({type: 'em', text: 'em text'}));\n const container = renderTemplateResult(renderResult);\n assert.isTrue(\n container.querySelector('em')?.classList.contains('custom-class'), 'Expected custom-class to be applied');\n });\n });\n\n describe('MarkdownInsightRenderer renderToken', () => {\n const renderer = new MarkdownView.MarkdownView.MarkdownInsightRenderer();\n it('renders link as an x-link', () => {\n const result =\n renderer.renderToken({type: 'link', text: 'learn more', href: 'https://example.com'} as Marked.Marked.Token);\n assert((result.values[0] as HTMLElement).tagName === 'X-LINK');\n });\n it('does not render URLs with \"javascript:\"', () => {\n const result = renderer.renderToken(\n {type: 'link', text: 'learn more', href: 'javascript:alert(\"test\")'} as Marked.Marked.Token);\n assert(result.values[0] === undefined);\n });\n it('does not render chrome:// URLs', () => {\n const result =\n renderer.renderToken({type: 'link', text: 'learn more', href: 'chrome://settings'} as Marked.Marked.Token);\n assert(result.values[0] === undefined);\n });\n it('does not render invalid URLs', () => {\n const result = renderer.renderToken({type: 'link', text: 'learn more', href: '123'} as Marked.Marked.Token);\n assert(result.values[0] === undefined);\n });\n it('renders images as an x-link', () => {\n const result =\n renderer.renderToken({type: 'image', text: 'learn more', href: 'https://example.com'} as Marked.Marked.Token);\n assert((result.values[0] as HTMLElement).tagName === 'X-LINK');\n });\n it('renders headers as a strong element', () => {\n const result = renderer.renderToken({type: 'heading', text: 'learn more'} as Marked.Marked.Token);\n assert(result.strings.join('').includes(''));\n });\n it('renders unsupported tokens', () => {\n const result = renderer.renderToken({type: 'html', raw: ''} as Marked.Marked.Token);\n assert(result.values.join('').includes(''));\n });\n it('detects language but default to provided', () => {\n let result =\n renderer.detectCodeLanguage({text: 'const int foo = \"bar\"', lang: 'cpp'} as Marked.Marked.Tokens.Code);\n assert.strictEqual(result, 'cpp');\n result = renderer.detectCodeLanguage({text: '', lang: 'cpp'} as Marked.Marked.Tokens.Code);\n assert.strictEqual(result, 'cpp');\n });\n it('detects JavaScript language', () => {\n let result = renderer.detectCodeLanguage({text: 'const t = 2', lang: ''} as Marked.Marked.Tokens.Code);\n assert.strictEqual(result, 'js');\n result = renderer.detectCodeLanguage({text: 'let t = 2', lang: ''} as Marked.Marked.Tokens.Code);\n assert.strictEqual(result, 'js');\n result = renderer.detectCodeLanguage({text: 'var t = 2', lang: ''} as Marked.Marked.Tokens.Code);\n assert.strictEqual(result, 'js');\n result = renderer.detectCodeLanguage({text: 'function t(){}', lang: ''} as Marked.Marked.Tokens.Code);\n assert.strictEqual(result, 'js');\n result = renderer.detectCodeLanguage({text: 'async function t(){}', lang: ''} as Marked.Marked.Tokens.Code);\n assert.strictEqual(result, 'js');\n result = renderer.detectCodeLanguage(\n {text: 'import puppeteer from \"puppeteer-core\"', lang: ''} as Marked.Marked.Tokens.Code);\n assert.strictEqual(result, 'js');\n });\n it('doesn`t detect JavaScript language', () => {\n let result = renderer.detectCodeLanguage({text: 'constant F', lang: ''} as Marked.Marked.Tokens.Code);\n assert.strictEqual(result, '');\n result = renderer.detectCodeLanguage({text: 'variable', lang: ''} as Marked.Marked.Tokens.Code);\n assert.strictEqual(result, '');\n result = renderer.detectCodeLanguage(\n {text: 'functions are better then classes', lang: ''} as Marked.Marked.Tokens.Code);\n assert.strictEqual(result, '');\n result = renderer.detectCodeLanguage(\n {text: 'asynchronous code it hard to understand', lang: ''} as Marked.Marked.Tokens.Code);\n assert.strictEqual(result, '');\n });\n it('detects CSS language', () => {\n let result = renderer.detectCodeLanguage({text: '.myClass {}', lang: ''} as Marked.Marked.Tokens.Code);\n assert.strictEqual(result, 'css');\n result = renderer.detectCodeLanguage({text: '.myClass{}', lang: ''} as Marked.Marked.Tokens.Code);\n assert.strictEqual(result, 'css');\n result = renderer.detectCodeLanguage({text: 'my-component {}', lang: ''} as Marked.Marked.Tokens.Code);\n assert.strictEqual(result, 'css');\n result = renderer.detectCodeLanguage({text: 'my-component::after {}', lang: ''} as Marked.Marked.Tokens.Code);\n assert.strictEqual(result, 'css');\n result = renderer.detectCodeLanguage({text: '.foo::[name=\"bar\"] {}', lang: ''} as Marked.Marked.Tokens.Code);\n assert.strictEqual(result, 'css');\n });\n });\n\n const paragraphText =\n 'Single paragraph with a sentence of text and some list items to test that the component works end-to-end.';\n const listItemTexts = ['Simple unordered list item 1', 'Simple unordered list item 2'];\n const markdownString = `\n${paragraphText}\n\n* ${listItemTexts[0]}\n* ${listItemTexts[1]}\n`;\n\n const renderString =\n (string: string, selector: 'p'|'code'|'devtools-code-block',\n renderer?: MarkdownView.MarkdownView.MarkdownLitRenderer) => {\n const component = new MarkdownView.MarkdownView.MarkdownView();\n renderElementIntoDOM(component);\n component.data = {tokens: Marked.Marked.lexer(string), renderer};\n assert.isNotNull(component.shadowRoot);\n const element = component.shadowRoot.querySelector(selector);\n return element ? element : document.createElement('span');\n };\n\n describe('component', () => {\n it('renders basic markdown correctly', () => {\n const component = new MarkdownView.MarkdownView.MarkdownView();\n renderElementIntoDOM(component);\n\n component.data = {tokens: Marked.Marked.lexer(markdownString)};\n\n assert.isNotNull(component.shadowRoot);\n\n const paragraphs = Array.from(component.shadowRoot.querySelectorAll('p'));\n assert.strictEqual(paragraphs.length, 1);\n assert.strictEqual(paragraphs[0].innerText, paragraphText);\n\n const listItems = Array.from(component.shadowRoot.querySelectorAll('li'));\n assert.strictEqual(listItems.length, 2);\n assert.deepEqual(listItems.map(item => item.textContent), listItemTexts);\n });\n\n it('renders a codeblock', () => {\n const codeBlock = renderString(\n `\\`\\`\\`\nconsole.log('test')\n\\`\\`\\``,\n 'devtools-code-block');\n assert.strictEqual((codeBlock as MarkdownView.CodeBlock.CodeBlock).code, 'console.log(\\'test\\')');\n });\n\n it('renders using a custom renderer', () => {\n const codeBlock =\n renderString('`console.log()`', 'code', new class extends MarkdownView.MarkdownView.MarkdownLitRenderer {\n override templateForToken(token: Marked.Marked.Token): LitHtml.TemplateResult|null {\n if (token.type === 'codespan') {\n return html`overriden`;\n }\n return super.templateForToken(token as Marked.Marked.MarkedToken);\n }\n }());\n assert.strictEqual(codeBlock.innerText, 'overriden');\n });\n });\n\n describe('escaping', () => {\n it('renders basic escaped non-html tag', () => {\n const paragraph = renderString('<123>', 'p');\n assert.strictEqual(paragraph.innerText, '<123>');\n });\n\n it('renders all unescaped chars', () => {\n const paragraph = renderString('<>&\\'\"', 'p');\n assert.strictEqual(paragraph.innerText, '<>&\\'\"');\n });\n\n it('renders all escaped chars', () => {\n const paragraph = renderString('<>&'"', 'p');\n assert.strictEqual(paragraph.innerText, '<>&\\'\"');\n });\n\n it('renders basic escaped tag inside codespan', () => {\n const codeBlock = renderString('`<123>`', 'code');\n assert.strictEqual(codeBlock.innerText, '<123>');\n });\n });\n});\n"]} \ No newline at end of file +{"version":3,"file":"MarkdownView.test.js","sourceRoot":"","sources":["../../../../../../../front_end/ui/components/markdown_view/MarkdownView.test.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,EAAC,oBAAoB,EAAC,MAAM,gCAAgC,CAAC;AACpE,OAAO,EAAC,uBAAuB,EAAC,MAAM,wCAAwC,CAAC;AAC/E,OAAO,KAAK,MAAM,MAAM,uCAAuC,CAAC;AAChE,OAAO,KAAK,OAAO,MAAM,4BAA4B,CAAC;AAEtD,OAAO,KAAK,YAAY,MAAM,oBAAoB,CAAC;AAEnD,MAAM,EAAC,IAAI,EAAC,GAAG,OAAO,CAAC;AAWvB,SAAS,YAAY,CAAC,KAAgB;IACpC,OAAO,KA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,CAAC,CAAC,CAAC","sourcesContent":["// Copyright 2020 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport {renderElementIntoDOM} from '../../../testing/DOMHelpers.js';\nimport {describeWithEnvironment} from '../../../testing/EnvironmentHelpers.js';\nimport * as Marked from '../../../third_party/marked/marked.js';\nimport * as LitHtml from '../../lit-html/lit-html.js';\n\nimport * as MarkdownView from './markdown_view.js';\n\nconst {html} = LitHtml;\n\ntype TestToken = {\n type: string,\n tokens?: Marked.Marked.Token[],\n text?: string,\n href?: string,\n items?: Object[],\n depth?: number,\n};\n\nfunction getFakeToken(token: TestToken): Marked.Marked.Token {\n return token as unknown as Marked.Marked.Token;\n}\n\nfunction renderTemplateResult(templateResult: LitHtml.TemplateResult): HTMLElement {\n const container = document.createElement('container');\n LitHtml.render(templateResult, container); // eslint-disable-line rulesdir/lit-html-host-this\n return container;\n}\n\ndescribeWithEnvironment('MarkdownView', () => {\n describe('tokenizer', () => {\n it('tokenizers links in single quotes', () => {\n assert.deepEqual(Marked.Marked.lexer('\\'https://example.com\\''), [\n {\n raw: '\\'https://example.com\\'',\n text: '\\'https://example.com\\'',\n tokens: [\n {\n raw: '\\'',\n text: ''',\n type: 'text',\n },\n {\n href: 'https://example.com',\n raw: 'https://example.com',\n text: 'https://example.com',\n tokens: [\n {\n raw: 'https://example.com',\n text: 'https://example.com',\n type: 'text',\n },\n ],\n type: 'link',\n },\n {\n raw: '\\'',\n text: ''',\n type: 'text',\n },\n ],\n type: 'paragraph',\n },\n ] as unknown as Marked.Marked.TokensList);\n });\n });\n describe('MarkdownLitRenderer renderToken', () => {\n const renderer = new MarkdownView.MarkdownView.MarkdownLitRenderer();\n\n it('wraps paragraph tokens in

    tags', () => {\n const container = renderTemplateResult(renderer.renderToken(getFakeToken({type: 'paragraph', tokens: []})));\n\n assert.exists(container.querySelector('p'));\n });\n\n it('wraps an unordered list token in

      tags', () => {\n const container = renderTemplateResult(renderer.renderToken(getFakeToken({type: 'list', items: []})));\n\n assert.exists(container.querySelector('ul'));\n });\n\n it('wraps list items in
    • tags', () => {\n const container = renderTemplateResult(renderer.renderToken(getFakeToken({type: 'list_item', tokens: []})));\n assert.exists(container.querySelector('li'));\n });\n\n it('wraps a codespan token in tags', () => {\n const container =\n renderTemplateResult(renderer.renderToken(getFakeToken({type: 'codespan', text: 'const foo = 42;'})));\n\n const code = container.querySelector('code');\n assert.exists(code);\n assert.deepEqual(code.textContent, 'const foo = 42;');\n });\n\n it('renders childless text tokens as-is', () => {\n const container =\n renderTemplateResult(renderer.renderToken(getFakeToken({type: 'text', text: 'Simple text token'})));\n\n assert.lengthOf(container.childTextNodes(), 1);\n assert.deepEqual(container.childTextNodes()[0].textContent, 'Simple text token');\n });\n\n it('renders nested text tokens correctly', () => {\n const container = renderTemplateResult(renderer.renderToken(getFakeToken({\n type: 'text',\n text: 'This text should not be rendered. Only the subtokens!',\n tokens: [\n getFakeToken({type: 'text', text: 'Nested raw text'}),\n getFakeToken({type: 'codespan', text: 'and a nested codespan to boot'}),\n ],\n })));\n\n assert.notInclude(container.textContent, 'This text should not be rendered. Only the subtokens!');\n assert.include(container.textContent, 'Nested raw text');\n assert.exists(container.querySelector('code'));\n assert.deepEqual(container.querySelector('code')?.textContent, 'and a nested codespan to boot');\n });\n\n it('throws an error for invalid or unsupported token types', () => {\n assert.throws(() => renderer.renderToken(getFakeToken({type: 'no_way_this_is_a_valid_markdown_token'})));\n });\n\n it('renders link with valid key', () => {\n MarkdownView.MarkdownLinksMap.markdownLinks.set('exampleLink', 'https://web.dev/');\n const renderResult =\n renderer.renderToken(getFakeToken({type: 'link', text: 'learn more', href: 'exampleLink'})).strings.join('');\n\n assert.isTrue(renderResult.includes(' {\n assert.throws(() => MarkdownView.MarkdownLinksMap.getMarkdownLink('testErrorLink'));\n });\n\n it('renders icon with valid key', () => {\n MarkdownView.MarkdownImagesMap.markdownImages.set('testExampleImage', {\n src: 'devices',\n isIcon: true,\n });\n const renderResult =\n renderer.renderToken(getFakeToken({type: 'image', text: 'phone', href: 'testExampleImage'})).strings.join('');\n assert.isTrue(renderResult.includes(' {\n MarkdownView.MarkdownImagesMap.markdownImages.set('exampleImage', {\n src: 'Images/phone-logo.png',\n isIcon: false,\n });\n const renderResult =\n renderer.renderToken(getFakeToken({type: 'image', text: 'phone', href: 'exampleImage'})).strings.join('');\n assert.isTrue(renderResult.includes(' {\n assert.throws(() => MarkdownView.MarkdownImagesMap.getMarkdownImage('testErrorImageLink'));\n });\n it('renders a heading correctly', () => {\n const renderResult =\n renderer.renderToken(getFakeToken({type: 'heading', text: 'a heading text', depth: 3})).strings.join('');\n\n assert.isTrue(renderResult.includes(' {\n const renderResult = renderer.renderToken(getFakeToken({type: 'strong', text: 'a strong text'})).strings.join('');\n\n assert.isTrue(renderResult.includes(' {\n const renderResult = renderer.renderToken(getFakeToken({type: 'em', text: 'em text'})).strings.join('');\n\n assert.isTrue(renderResult.includes(' {\n renderer.setCustomClasses({em: 'custom-class'});\n\n const renderResult = renderer.renderToken(getFakeToken({type: 'em', text: 'em text'}));\n const container = renderTemplateResult(renderResult);\n assert.isTrue(\n container.querySelector('em')?.classList.contains('custom-class'), 'Expected custom-class to be applied');\n });\n });\n\n describe('MarkdownInsightRenderer renderToken', () => {\n const renderer = new MarkdownView.MarkdownView.MarkdownInsightRenderer();\n it('renders link as an x-link', () => {\n const result =\n renderer.renderToken({type: 'link', text: 'learn more', href: 'https://example.com'} as Marked.Marked.Token);\n assert((result.values[0] as HTMLElement).tagName === 'X-LINK');\n });\n it('does not render URLs with \"javascript:\"', () => {\n const result = renderer.renderToken(\n {type: 'link', text: 'learn more', href: 'javascript:alert(\"test\")'} as Marked.Marked.Token);\n assert(result.values[0] === undefined);\n });\n it('does not render chrome:// URLs', () => {\n const result =\n renderer.renderToken({type: 'link', text: 'learn more', href: 'chrome://settings'} as Marked.Marked.Token);\n assert(result.values[0] === undefined);\n });\n it('does not render invalid URLs', () => {\n const result = renderer.renderToken({type: 'link', text: 'learn more', href: '123'} as Marked.Marked.Token);\n assert(result.values[0] === undefined);\n });\n it('renders images as an x-link', () => {\n const result =\n renderer.renderToken({type: 'image', text: 'learn more', href: 'https://example.com'} as Marked.Marked.Token);\n assert((result.values[0] as HTMLElement).tagName === 'X-LINK');\n });\n it('renders headers as a strong element', () => {\n const result = renderer.renderToken({type: 'heading', text: 'learn more'} as Marked.Marked.Token);\n assert(result.strings.join('').includes(''));\n });\n it('renders unsupported tokens', () => {\n const result = renderer.renderToken({type: 'html', raw: ''} as Marked.Marked.Token);\n assert(result.values.join('').includes(''));\n });\n it('detects language but default to provided', () => {\n let result =\n renderer.detectCodeLanguage({text: 'const int foo = \"bar\"', lang: 'cpp'} as Marked.Marked.Tokens.Code);\n assert.strictEqual(result, 'cpp');\n result = renderer.detectCodeLanguage({text: '', lang: 'cpp'} as Marked.Marked.Tokens.Code);\n assert.strictEqual(result, 'cpp');\n });\n it('detects JavaScript language', () => {\n let result = renderer.detectCodeLanguage({text: 'const t = 2', lang: ''} as Marked.Marked.Tokens.Code);\n assert.strictEqual(result, 'js');\n result = renderer.detectCodeLanguage({text: 'let t = 2', lang: ''} as Marked.Marked.Tokens.Code);\n assert.strictEqual(result, 'js');\n result = renderer.detectCodeLanguage({text: 'var t = 2', lang: ''} as Marked.Marked.Tokens.Code);\n assert.strictEqual(result, 'js');\n result = renderer.detectCodeLanguage({text: 'function t(){}', lang: ''} as Marked.Marked.Tokens.Code);\n assert.strictEqual(result, 'js');\n result = renderer.detectCodeLanguage({text: 'async function t(){}', lang: ''} as Marked.Marked.Tokens.Code);\n assert.strictEqual(result, 'js');\n result = renderer.detectCodeLanguage(\n {text: 'import puppeteer from \"puppeteer-core\"', lang: ''} as Marked.Marked.Tokens.Code);\n assert.strictEqual(result, 'js');\n });\n it('doesn`t detect JavaScript language', () => {\n let result = renderer.detectCodeLanguage({text: 'constant F', lang: ''} as Marked.Marked.Tokens.Code);\n assert.strictEqual(result, '');\n result = renderer.detectCodeLanguage({text: 'variable', lang: ''} as Marked.Marked.Tokens.Code);\n assert.strictEqual(result, '');\n result = renderer.detectCodeLanguage(\n {text: 'functions are better then classes', lang: ''} as Marked.Marked.Tokens.Code);\n assert.strictEqual(result, '');\n result = renderer.detectCodeLanguage(\n {text: 'asynchronous code it hard to understand', lang: ''} as Marked.Marked.Tokens.Code);\n assert.strictEqual(result, '');\n });\n it('detects CSS language', () => {\n let result = renderer.detectCodeLanguage({text: '.myClass {}', lang: ''} as Marked.Marked.Tokens.Code);\n assert.strictEqual(result, 'css');\n result = renderer.detectCodeLanguage({text: '.myClass{}', lang: ''} as Marked.Marked.Tokens.Code);\n assert.strictEqual(result, 'css');\n result = renderer.detectCodeLanguage({text: 'my-component {}', lang: ''} as Marked.Marked.Tokens.Code);\n assert.strictEqual(result, 'css');\n result = renderer.detectCodeLanguage({text: 'my-component::after {}', lang: ''} as Marked.Marked.Tokens.Code);\n assert.strictEqual(result, 'css');\n result = renderer.detectCodeLanguage({text: '.foo::[name=\"bar\"] {}', lang: ''} as Marked.Marked.Tokens.Code);\n assert.strictEqual(result, 'css');\n });\n });\n\n const paragraphText =\n 'Single paragraph with a sentence of text and some list items to test that the component works end-to-end.';\n const listItemTexts = ['Simple unordered list item 1', 'Simple unordered list item 2'];\n const markdownString = `\n${paragraphText}\n\n* ${listItemTexts[0]}\n* ${listItemTexts[1]}\n`;\n\n const renderString =\n (string: string, selector: 'p'|'code'|'devtools-code-block',\n renderer?: MarkdownView.MarkdownView.MarkdownLitRenderer) => {\n const component = new MarkdownView.MarkdownView.MarkdownView();\n renderElementIntoDOM(component);\n component.data = {tokens: Marked.Marked.lexer(string), renderer};\n assert.isNotNull(component.shadowRoot);\n const element = component.shadowRoot.querySelector(selector);\n return element ? element : document.createElement('span');\n };\n\n describe('component', () => {\n it('renders basic markdown correctly', () => {\n const component = new MarkdownView.MarkdownView.MarkdownView();\n renderElementIntoDOM(component);\n\n component.data = {tokens: Marked.Marked.lexer(markdownString)};\n\n assert.isNotNull(component.shadowRoot);\n\n const paragraphs = Array.from(component.shadowRoot.querySelectorAll('p'));\n assert.lengthOf(paragraphs, 1);\n assert.strictEqual(paragraphs[0].innerText, paragraphText);\n\n const listItems = Array.from(component.shadowRoot.querySelectorAll('li'));\n assert.lengthOf(listItems, 2);\n assert.deepEqual(listItems.map(item => item.textContent), listItemTexts);\n });\n\n it('renders a codeblock', () => {\n const codeBlock = renderString(\n `\\`\\`\\`\nconsole.log('test')\n\\`\\`\\``,\n 'devtools-code-block');\n assert.strictEqual((codeBlock as MarkdownView.CodeBlock.CodeBlock).code, 'console.log(\\'test\\')');\n });\n\n it('renders using a custom renderer', () => {\n const codeBlock =\n renderString('`console.log()`', 'code', new class extends MarkdownView.MarkdownView.MarkdownLitRenderer {\n override templateForToken(token: Marked.Marked.Token): LitHtml.TemplateResult|null {\n if (token.type === 'codespan') {\n return html`overriden`;\n }\n return super.templateForToken(token as Marked.Marked.MarkedToken);\n }\n }());\n assert.strictEqual(codeBlock.innerText, 'overriden');\n });\n });\n\n describe('escaping', () => {\n it('renders basic escaped non-html tag', () => {\n const paragraph = renderString('<123>', 'p');\n assert.strictEqual(paragraph.innerText, '<123>');\n });\n\n it('renders all unescaped chars', () => {\n const paragraph = renderString('<>&\\'\"', 'p');\n assert.strictEqual(paragraph.innerText, '<>&\\'\"');\n });\n\n it('renders all escaped chars', () => {\n const paragraph = renderString('<>&'"', 'p');\n assert.strictEqual(paragraph.innerText, '<>&\\'\"');\n });\n\n it('renders basic escaped tag inside codespan', () => {\n const codeBlock = renderString('`<123>`', 'code');\n assert.strictEqual(codeBlock.innerText, '<123>');\n });\n });\n});\n"]} \ No newline at end of file diff --git a/public/ui/components/menus/Menu.js b/public/ui/components/menus/Menu.js index 5b221bfbc..05833d163 100644 --- a/public/ui/components/menus/Menu.js +++ b/public/ui/components/menus/Menu.js @@ -3,7 +3,7 @@ // found in the LICENSE file. import * as Platform from '../../../core/platform/platform.js'; import * as ComponentHelpers from '../../../ui/components/helpers/helpers.js'; -import * as Coordinator from '../../../ui/components/render_coordinator/render_coordinator.js'; +import * as RenderCoordinator from '../../../ui/components/render_coordinator/render_coordinator.js'; import * as LitHtml from '../../../ui/lit-html/lit-html.js'; import * as VisualLogging from '../../../ui/visual_logging/visual_logging.js'; import * as Dialogs from '../dialogs/dialogs.js'; @@ -11,7 +11,6 @@ import menuStyles from './menu.css.js'; import menuGroupStyles from './menuGroup.css.js'; import menuItemStyles from './menuItem.css.js'; const { html } = LitHtml; -const coordinator = Coordinator.RenderCoordinator.RenderCoordinator.instance(); const selectedItemCheckmark = new URL('../../../Images/checkmark.svg', import.meta.url).toString(); export class Menu extends HTMLElement { #shadow = this.attachShadow({ mode: 'open' }); @@ -83,7 +82,7 @@ export class Menu extends HTMLElement { } connectedCallback() { this.#shadow.adoptedStyleSheets = [menuStyles]; - void coordinator.write(() => { + void RenderCoordinator.write(() => { this.style.setProperty('--selected-item-check', `url(${selectedItemCheckmark})`); this.style.setProperty('--menu-checkmark-width', this.#props.showSelectedItem ? '26px' : '0px'); this.style.setProperty('--menu-checkmark-height', this.#props.showSelectedItem ? '12px' : '0px'); @@ -98,7 +97,7 @@ export class Menu extends HTMLElement { return this.#dialog; } async #dialogDeployed() { - await coordinator.write(() => { + await RenderCoordinator.write(() => { this.setAttribute('has-open-dialog', 'has-open-dialog'); // Focus the container so tha twe can capture key events. const container = this.#shadow.querySelector('#container'); diff --git a/public/ui/components/menus/Menu.js.map b/public/ui/components/menus/Menu.js.map index 81c08e36e..f8286f990 100644 --- a/public/ui/components/menus/Menu.js.map +++ b/public/ui/components/menus/Menu.js.map @@ -1 +1 @@ -{"version":3,"file":"Menu.js","sourceRoot":"","sources":["../../../../../../../front_end/ui/components/menus/Menu.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,KAAK,QAAQ,MAAM,oCAAoC,CAAC;AAC/D,OAAO,KAAK,gBAAgB,MAAM,2CAA2C,CAAC;AAC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AAkB,CAAC;IAE/C,YAAmB,SAAwB;QACzC,KAAK,CAAC,qBAAqB,CAAC,SAAS,EAAE,EAAC,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAC,CAAC,CAAC;QADvD,cAAS,GAAT,SAAS,CAAe;IAE3C,CAAC;;AAEH,MAAM,OAAO,gBAAiB,SAAQ,KAAK;IACzC,MAAM,CAAU,SAAS,GAAG,kBAAkB,CAAC;IAC/C;QACE,KAAK,CAAC,gBAAgB,CAAC,SAAS,EAAE,EAAC,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAC,CAAC,CAAC;IACrE,CAAC","sourcesContent":["// Copyright 2023 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport * as Platform from '../../../core/platform/platform.js';\nimport * as ComponentHelpers from '../../../ui/components/helpers/helpers.js';\nimport * as Coordinator from '../../../ui/components/render_coordinator/render_coordinator.js';\nimport * as LitHtml from '../../../ui/lit-html/lit-html.js';\nimport * as VisualLogging from '../../../ui/visual_logging/visual_logging.js';\nimport * as Dialogs from '../dialogs/dialogs.js';\n\nimport menuStyles from './menu.css.js';\nimport menuGroupStyles from './menuGroup.css.js';\nimport menuItemStyles from './menuItem.css.js';\n\nconst {html} = LitHtml;\n\nconst coordinator = Coordinator.RenderCoordinator.RenderCoordinator.instance();\n\nexport interface MenuData {\n /**\n * Whether the menu is open.\n */\n open: boolean;\n /**\n * Determines where the dialog with the menu will show relative to\n * the menu's origin.\n * Defaults to Bottom.\n */\n position: Dialogs.Dialog.DialogVerticalPosition;\n /**\n * Position or point the dialog is shown relative to.\n */\n origin: Dialogs.Dialog.DialogOrigin;\n /**\n * Determines if dividing lines between the menu's options\n * are shown.\n * Defaults to false.\n */\n showDivider: boolean;\n /**\n * Determines if the selected item is marked using a checkmark.\n * Defaults to true.\n */\n showSelectedItem: boolean;\n /**\n * Determines where the dialog with the menu will show horizontally\n * relative to the show button.\n * Defaults to Auto\n */\n horizontalAlignment: Dialogs.Dialog.DialogHorizontalAlignment;\n /**\n * Optional function used to the determine the x coordinate of the connector's\n * end (tip of the triangle), relative to the viewport. If not defined, the x\n * coordinate of the origin's center is used instead.\n */\n getConnectorCustomXPosition: (() => number)|null;\n}\n\nconst selectedItemCheckmark = new URL('../../../Images/checkmark.svg', import.meta.url).toString();\n\nexport class Menu extends HTMLElement {\n readonly #shadow = this.attachShadow({mode: 'open'});\n readonly #renderBound = this.#render.bind(this);\n #dialog: Dialogs.Dialog.Dialog|null = null;\n #itemIsFocused = false;\n #props: MenuData = {\n origin: null,\n open: false,\n position: Dialogs.Dialog.DialogVerticalPosition.AUTO,\n showDivider: false,\n showSelectedItem: true,\n horizontalAlignment: Dialogs.Dialog.DialogHorizontalAlignment.AUTO,\n getConnectorCustomXPosition: null,\n };\n\n get origin(): Dialogs.Dialog.DialogOrigin {\n return this.#props.origin;\n }\n\n set origin(origin: Dialogs.Dialog.DialogOrigin) {\n this.#props.origin = origin;\n void ComponentHelpers.ScheduledRender.scheduleRender(this, this.#renderBound);\n }\n\n get open(): boolean {\n return this.#props.open;\n }\n\n set open(open: boolean) {\n if (open === this.open) {\n return;\n }\n this.#props.open = open;\n this.toggleAttribute('has-open-dialog', this.open);\n void this.#getDialog().setDialogVisible(this.open);\n void ComponentHelpers.ScheduledRender.scheduleRender(this, this.#renderBound);\n }\n\n get position(): Dialogs.Dialog.DialogVerticalPosition {\n return this.#props.position;\n }\n\n set position(position: Dialogs.Dialog.DialogVerticalPosition) {\n this.#props.position = position;\n void ComponentHelpers.ScheduledRender.scheduleRender(this, this.#renderBound);\n }\n\n get showDivider(): boolean {\n return this.#props.showDivider;\n }\n\n set showDivider(showDivider: boolean) {\n this.#props.showDivider = showDivider;\n void ComponentHelpers.ScheduledRender.scheduleRender(this, this.#renderBound);\n }\n\n get showSelectedItem(): boolean {\n return this.#props.showSelectedItem;\n }\n\n set showSelectedItem(showSelectedItem: boolean) {\n this.#props.showSelectedItem = showSelectedItem;\n void ComponentHelpers.ScheduledRender.scheduleRender(this, this.#renderBound);\n }\n\n get horizontalAlignment(): Dialogs.Dialog.DialogHorizontalAlignment {\n return this.#props.horizontalAlignment;\n }\n\n set horizontalAlignment(horizontalAlignment: Dialogs.Dialog.DialogHorizontalAlignment) {\n this.#props.horizontalAlignment = horizontalAlignment;\n void ComponentHelpers.ScheduledRender.scheduleRender(this, this.#renderBound);\n }\n\n get getConnectorCustomXPosition(): (() => number)|null {\n return this.#props.getConnectorCustomXPosition;\n }\n\n set getConnectorCustomXPosition(connectorXPosition: (() => number)|null) {\n this.#props.getConnectorCustomXPosition = connectorXPosition;\n void ComponentHelpers.ScheduledRender.scheduleRender(this, this.#renderBound);\n }\n\n connectedCallback(): void {\n this.#shadow.adoptedStyleSheets = [menuStyles];\n void coordinator.write(() => {\n this.style.setProperty('--selected-item-check', `url(${selectedItemCheckmark})`);\n this.style.setProperty('--menu-checkmark-width', this.#props.showSelectedItem ? '26px' : '0px');\n this.style.setProperty('--menu-checkmark-height', this.#props.showSelectedItem ? '12px' : '0px');\n const dividerLine = this.showDivider ? '1px var(--divider-line) solid' : 'none';\n this.style.setProperty('--override-divider-line', dividerLine);\n });\n }\n\n #getDialog(): Dialogs.Dialog.Dialog {\n if (!this.#dialog) {\n throw new Error('Dialog not found');\n }\n return this.#dialog;\n }\n\n async #dialogDeployed(): Promise {\n await coordinator.write(() => {\n this.setAttribute('has-open-dialog', 'has-open-dialog');\n // Focus the container so tha twe can capture key events.\n const container = this.#shadow.querySelector('#container');\n if (!(container instanceof HTMLElement)) {\n return;\n }\n container.focus();\n });\n }\n\n #focusFirstItem(): void {\n this.#getFirstItem().focus();\n }\n\n #getFirstItem(): HTMLElement {\n const defaultSlot = this.#shadow.querySelector('slot') as HTMLSlotElement;\n const items = defaultSlot?.assignedElements();\n let firstItem = items[0];\n if (firstItem instanceof HTMLSlotElement) {\n firstItem = firstItem?.assignedElements()[0];\n }\n if (firstItem instanceof MenuGroup) {\n const groupDefaultSlot = firstItem.shadowRoot?.querySelector('slot') as HTMLSlotElement;\n firstItem = groupDefaultSlot?.assignedElements()[0];\n }\n if (firstItem instanceof HTMLElement) {\n return firstItem;\n }\n throw new Error('First item not found');\n }\n\n #handleItemClick(evt: MouseEvent): void {\n const path = evt.composedPath();\n evt.stopPropagation();\n\n // If the clicked item is an input element, do not follow the default behaviour.\n if (path.find(element => element instanceof HTMLInputElement)) {\n return;\n }\n const item = evt.composedPath().find(element => element instanceof MenuItem);\n // Compare against MenuItem again to narrow the item's type.\n if (!(item instanceof MenuItem)) {\n return;\n }\n this.#updateSelectedValue(item);\n }\n\n #handleDialogKeyDown(evt: KeyboardEvent): void {\n const key = evt.key;\n evt.stopImmediatePropagation();\n let item: EventTarget|null|undefined = evt.target;\n const path = evt.composedPath();\n const shouldFocusFirstItem =\n key === Platform.KeyboardUtilities.ArrowKey.DOWN || key === Platform.KeyboardUtilities.ArrowKey.RIGHT;\n if (!this.#itemIsFocused && shouldFocusFirstItem) {\n this.#focusFirstItem();\n this.#itemIsFocused = true;\n return;\n }\n if (!this.#itemIsFocused && key === Platform.KeyboardUtilities.ArrowKey.UP) {\n this.#focusLastItem();\n this.#itemIsFocused = true;\n return;\n }\n // The focused item could be nested inside the MenuItem, hence\n // find the MenuItem item inside the event's composed path.\n if (!(item instanceof MenuItem)) {\n item = path.find(element => element instanceof MenuItem);\n\n // Compare against MenuItem again to narrow the item's type.\n if (!(item instanceof MenuItem)) {\n return;\n }\n }\n if (Platform.KeyboardUtilities.keyIsArrowKey(key)) {\n this.#handleArrowKeyNavigation(key, item);\n } else if (key === 'Home') {\n this.#handleHomeKeyDown(item);\n } else if (key === 'End') {\n this.#focusLastItem();\n } else if (key === 'Enter' || evt.code === 'Space') {\n this.#updateSelectedValue(item);\n } else if (key === 'Escape') {\n evt.preventDefault();\n this.#closeDialog();\n }\n }\n\n #updateSelectedValue(item: MenuItem): void {\n if (item.value === '') {\n return;\n }\n this.dispatchEvent(new MenuItemSelectedEvent(item.value));\n if (item.preventMenuCloseOnSelection) {\n return;\n }\n this.#closeDialog();\n }\n\n #handleArrowKeyNavigation(key: Platform.KeyboardUtilities.ArrowKey, currentItem: MenuItem): void {\n let nextSibling: Element|null = currentItem;\n if (key === Platform.KeyboardUtilities.ArrowKey.DOWN) {\n nextSibling = currentItem.nextElementSibling;\n // Handle last item in a group and navigating down:\n if (nextSibling === null && currentItem.parentElement instanceof MenuGroup) {\n nextSibling = this.#firstItemInNextGroup(currentItem);\n }\n } else if (key === Platform.KeyboardUtilities.ArrowKey.UP) {\n nextSibling = currentItem.previousElementSibling;\n // Handle first item in a group and navigating up:\n if (nextSibling === null && currentItem.parentElement instanceof MenuGroup) {\n nextSibling = this.#lastItemInPreviousGroup(currentItem);\n }\n }\n if (nextSibling instanceof MenuItem) {\n nextSibling.focus();\n }\n }\n #firstItemInNextGroup(currentItem: MenuItem): MenuItem|null {\n const parentElement = currentItem.parentElement;\n if (!(parentElement instanceof MenuGroup)) {\n return null;\n }\n const parentNextSibling = parentElement.nextElementSibling;\n if (parentNextSibling instanceof MenuItem) {\n return parentNextSibling;\n }\n if (!(parentNextSibling instanceof MenuGroup)) {\n return null;\n }\n for (const child of parentNextSibling.children) {\n if (child instanceof MenuItem) {\n return child;\n }\n }\n return null;\n }\n\n #lastItemInPreviousGroup(currentItem: MenuItem): MenuItem|null {\n const parentElement = currentItem.parentElement;\n if (!(parentElement instanceof MenuGroup)) {\n return null;\n }\n const parentPreviousSibling = parentElement.previousElementSibling;\n if (parentPreviousSibling instanceof MenuItem) {\n return parentPreviousSibling;\n }\n if (!(parentPreviousSibling instanceof MenuGroup)) {\n return null;\n }\n if (parentPreviousSibling.lastElementChild instanceof MenuItem) {\n return parentPreviousSibling.lastElementChild;\n }\n return null;\n }\n\n #handleHomeKeyDown(currentItem: MenuItem): void {\n let topMenuPart: Element|null = currentItem;\n if (currentItem.parentElement instanceof MenuGroup) {\n topMenuPart = currentItem.parentElement;\n }\n while (topMenuPart?.previousElementSibling) {\n topMenuPart = topMenuPart?.previousElementSibling;\n }\n if (topMenuPart instanceof MenuItem) {\n topMenuPart.focus();\n return;\n }\n for (const child of topMenuPart.children) {\n if (child instanceof MenuItem) {\n child.focus();\n return;\n }\n }\n }\n\n #focusLastItem(): void {\n const currentItem = this.#getFirstItem();\n let lastMenuPart: Element|null = currentItem;\n if (currentItem.parentElement instanceof MenuGroup) {\n lastMenuPart = currentItem.parentElement;\n }\n while (lastMenuPart?.nextElementSibling) {\n lastMenuPart = lastMenuPart?.nextElementSibling;\n }\n if (lastMenuPart instanceof MenuItem) {\n lastMenuPart.focus();\n return;\n }\n if (lastMenuPart instanceof MenuGroup && lastMenuPart.lastElementChild instanceof MenuItem) {\n lastMenuPart.lastElementChild.focus();\n }\n }\n\n #closeDialog(evt?: Dialogs.Dialog.ClickOutsideDialogEvent): void {\n if (evt) {\n evt.stopImmediatePropagation();\n }\n this.dispatchEvent(new MenuCloseRequest());\n void this.#getDialog().setDialogVisible(false);\n this.#itemIsFocused = false;\n }\n\n async #render(): Promise {\n if (!ComponentHelpers.ScheduledRender.isScheduledRender(this)) {\n throw new Error('Menu render was not scheduled');\n }\n // clang-format off\n LitHtml.render(html`\n {\n this.#dialog = domNode as Dialogs.Dialog.Dialog;\n })}\n >\n \n \n \n \n \n `, this.#shadow, { host: this });\n // clang-format on\n }\n}\n\ninterface MenuItemData {\n /**\n * If true, selecting the item (by clicking it or pressing enter when its focused)\n * would not cause the menu to be closed.\n * Defaults to false.\n */\n preventMenuCloseOnSelection: boolean;\n /**\n * The value associated with this item. It is used to determine what item is selected\n * and is the data sent in a MenuItemSelectedEvent, when an item is selected.\n */\n value: MenuItemValue;\n /**\n * Whether the item is selected.\n */\n selected: boolean;\n}\n\nexport class MenuItem extends HTMLElement {\n readonly #shadow = this.attachShadow({mode: 'open'});\n readonly #renderBound = this.#render.bind(this);\n connectedCallback(): void {\n this.#shadow.adoptedStyleSheets = [menuItemStyles];\n this.tabIndex = 0;\n this.setAttribute('role', 'menuitem');\n }\n #props: MenuItemData = {\n value: '',\n preventMenuCloseOnSelection: false,\n selected: false,\n };\n\n get preventMenuCloseOnSelection(): boolean {\n return this.#props.preventMenuCloseOnSelection;\n }\n\n set preventMenuCloseOnSelection(preventMenuCloseOnSelection: boolean) {\n this.#props.preventMenuCloseOnSelection = preventMenuCloseOnSelection;\n void ComponentHelpers.ScheduledRender.scheduleRender(this, this.#renderBound);\n }\n\n get value(): MenuItemValue {\n return this.#props.value;\n }\n\n set value(value: MenuItemValue) {\n this.#props.value = value;\n void ComponentHelpers.ScheduledRender.scheduleRender(this, this.#renderBound);\n }\n\n get selected(): boolean {\n return this.#props.selected;\n }\n\n set selected(selected: boolean) {\n this.#props.selected = selected;\n void ComponentHelpers.ScheduledRender.scheduleRender(this, this.#renderBound);\n }\n\n async #render(): Promise {\n if (!ComponentHelpers.ScheduledRender.isScheduledRender(this)) {\n throw new Error('MenuItem render was not scheduled');\n }\n // clang-format off\n\n LitHtml.render(html`\n \n \n \n `, this.#shadow, { host: this });\n // clang-format on\n }\n}\n\ninterface MenuGroupData {\n name: string|null;\n}\n\nexport class MenuGroup extends HTMLElement {\n readonly #shadow = this.attachShadow({mode: 'open'});\n readonly #renderBound = this.#render.bind(this);\n connectedCallback(): void {\n this.#shadow.adoptedStyleSheets = [menuGroupStyles];\n }\n\n #props: MenuGroupData = {\n name: null,\n };\n\n get name(): string|null {\n return this.#props.name;\n }\n\n set name(name: string|null) {\n this.#props.name = name;\n void ComponentHelpers.ScheduledRender.scheduleRender(this, this.#renderBound);\n }\n\n async #render(): Promise {\n if (!ComponentHelpers.ScheduledRender.isScheduledRender(this)) {\n throw new Error('MenuGroup render was not scheduled');\n }\n // clang-format off\n LitHtml.render(html`\n \n ${this.name}\n \n \n `, this.#shadow, { host: this });\n // clang-format on\n }\n}\n\ncustomElements.define('devtools-menu', Menu);\ncustomElements.define('devtools-menu-item', MenuItem);\ncustomElements.define('devtools-menu-group', MenuGroup);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'devtools-menu': Menu;\n 'devtools-menu-item': MenuItem;\n 'devtools-menu-group': MenuGroup;\n }\n\n interface HTMLElementEventMap {\n [MenuItemSelectedEvent.eventName]: MenuItemSelectedEvent;\n [MenuCloseRequest.eventName]: MenuCloseRequest;\n }\n}\n\nexport class MenuItemSelectedEvent extends Event {\n static readonly eventName = 'menuitemselected';\n\n constructor(public itemValue: MenuItemValue) {\n super(MenuItemSelectedEvent.eventName, {bubbles: true, composed: true});\n }\n}\nexport class MenuCloseRequest extends Event {\n static readonly eventName = 'menucloserequest';\n constructor() {\n super(MenuCloseRequest.eventName, {bubbles: true, composed: true});\n }\n}\n\nexport type MenuItemValue = string|number|boolean;\n"]} \ No newline at end of file +{"version":3,"file":"Menu.js","sourceRoot":"","sources":["../../../../../../../front_end/ui/components/menus/Menu.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,KAAK,QAAQ,MAAM,oCAAoC,CAAC;AAC/D,OAAO,KAAK,gBAAgB,MAAM,2CAA2C,CAAC;AAC9E,OAAO,KAAK,iBAAiB,MAAM,iEAAiE,CAAC;AACrG,OAAO,KAAK,OAAO,MAAM,kCAAkC,CAAC;AAC5D,OAAO,KAAK,aAAa,MAAM,8CAA8C,CAAC;AAC9E,OAAO,KAAK,OAAO,MAAM,uBAAuB,CAAC;AAEjD,OAAO,UAAU,MAAM,eAAe,CAAC;AACvC,OAAO,eAAe,MAAM,oBAAoB,CAAC;AACjD,OAAO,cAAc,MAAM,mBAAmB,CAAC;AAE/C,MAAM,EAAC,IAAI,EAAC,GAAG,OAAO,CAAC;AA0CvB,MAAM,qBAAqB,GAAG,IAAI,GAAG,CAAC,+BAA+B,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,CAAC;AAEnG,MAAM,OAAO,IAAK,SAAQ,WAAW;IAC1B,OAAO,GAAG,IAAI,CAAC,YAAY,CAAC,EAA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CAAC,gBAAgB,CAAC,eAAe,CAAC,iBAAiB,CAAC,IAAI,CAAC,EAAE,CAAC;YAC9D,MAAM,IAAI,KAAK,CAAC,oCAAoC,CAAC,CAAC;QACxD,CAAC;QACD,mBAAmB;QACnB,OAAO,CAAC,MAAM,CAAC,IAAI,CAAA;;yCAEkB,IAAI,CAAC,IAAI;;;KAG7C,EAAE,IAAI,CAAC,OAAO,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;QACjC,kBAAkB;IACpB,CAAC;CACF;AAED,cAAc,CAAC,MAAM,CAAC,eAAe,EAAE,IAAI,CAAC,CAAC;AAC7C,cAAc,CAAC,MAAM,CAAC,oBAAoB,EAAE,QAAQ,CAAC,CAAC;AACtD,cAAc,CAAC,MAAM,CAAC,qBAAqB,EAAE,SAAS,CAAC,CAAC;AAexD,MAAM,OAAO,qBAAsB,SAAQ,KAAK;IAG3B;IAFnB,MAAM,CAAU,SAAS,GAAG,kBAAkB,CAAC;IAE/C,YAAmB,SAAwB;QACzC,KAAK,CAAC,qBAAqB,CAAC,SAAS,EAAE,EAAC,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAC,CAAC,CAAC;QADvD,cAAS,GAAT,SAAS,CAAe;IAE3C,CAAC;;AAEH,MAAM,OAAO,gBAAiB,SAAQ,KAAK;IACzC,MAAM,CAAU,SAAS,GAAG,kBAAkB,CAAC;IAC/C;QACE,KAAK,CAAC,gBAAgB,CAAC,SAAS,EAAE,EAAC,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAC,CAAC,CAAC;IACrE,CAAC","sourcesContent":["// Copyright 2023 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport * as Platform from '../../../core/platform/platform.js';\nimport * as ComponentHelpers from '../../../ui/components/helpers/helpers.js';\nimport * as RenderCoordinator from '../../../ui/components/render_coordinator/render_coordinator.js';\nimport * as LitHtml from '../../../ui/lit-html/lit-html.js';\nimport * as VisualLogging from '../../../ui/visual_logging/visual_logging.js';\nimport * as Dialogs from '../dialogs/dialogs.js';\n\nimport menuStyles from './menu.css.js';\nimport menuGroupStyles from './menuGroup.css.js';\nimport menuItemStyles from './menuItem.css.js';\n\nconst {html} = LitHtml;\n\nexport interface MenuData {\n /**\n * Whether the menu is open.\n */\n open: boolean;\n /**\n * Determines where the dialog with the menu will show relative to\n * the menu's origin.\n * Defaults to Bottom.\n */\n position: Dialogs.Dialog.DialogVerticalPosition;\n /**\n * Position or point the dialog is shown relative to.\n */\n origin: Dialogs.Dialog.DialogOrigin;\n /**\n * Determines if dividing lines between the menu's options\n * are shown.\n * Defaults to false.\n */\n showDivider: boolean;\n /**\n * Determines if the selected item is marked using a checkmark.\n * Defaults to true.\n */\n showSelectedItem: boolean;\n /**\n * Determines where the dialog with the menu will show horizontally\n * relative to the show button.\n * Defaults to Auto\n */\n horizontalAlignment: Dialogs.Dialog.DialogHorizontalAlignment;\n /**\n * Optional function used to the determine the x coordinate of the connector's\n * end (tip of the triangle), relative to the viewport. If not defined, the x\n * coordinate of the origin's center is used instead.\n */\n getConnectorCustomXPosition: (() => number)|null;\n}\n\nconst selectedItemCheckmark = new URL('../../../Images/checkmark.svg', import.meta.url).toString();\n\nexport class Menu extends HTMLElement {\n readonly #shadow = this.attachShadow({mode: 'open'});\n readonly #renderBound = this.#render.bind(this);\n #dialog: Dialogs.Dialog.Dialog|null = null;\n #itemIsFocused = false;\n #props: MenuData = {\n origin: null,\n open: false,\n position: Dialogs.Dialog.DialogVerticalPosition.AUTO,\n showDivider: false,\n showSelectedItem: true,\n horizontalAlignment: Dialogs.Dialog.DialogHorizontalAlignment.AUTO,\n getConnectorCustomXPosition: null,\n };\n\n get origin(): Dialogs.Dialog.DialogOrigin {\n return this.#props.origin;\n }\n\n set origin(origin: Dialogs.Dialog.DialogOrigin) {\n this.#props.origin = origin;\n void ComponentHelpers.ScheduledRender.scheduleRender(this, this.#renderBound);\n }\n\n get open(): boolean {\n return this.#props.open;\n }\n\n set open(open: boolean) {\n if (open === this.open) {\n return;\n }\n this.#props.open = open;\n this.toggleAttribute('has-open-dialog', this.open);\n void this.#getDialog().setDialogVisible(this.open);\n void ComponentHelpers.ScheduledRender.scheduleRender(this, this.#renderBound);\n }\n\n get position(): Dialogs.Dialog.DialogVerticalPosition {\n return this.#props.position;\n }\n\n set position(position: Dialogs.Dialog.DialogVerticalPosition) {\n this.#props.position = position;\n void ComponentHelpers.ScheduledRender.scheduleRender(this, this.#renderBound);\n }\n\n get showDivider(): boolean {\n return this.#props.showDivider;\n }\n\n set showDivider(showDivider: boolean) {\n this.#props.showDivider = showDivider;\n void ComponentHelpers.ScheduledRender.scheduleRender(this, this.#renderBound);\n }\n\n get showSelectedItem(): boolean {\n return this.#props.showSelectedItem;\n }\n\n set showSelectedItem(showSelectedItem: boolean) {\n this.#props.showSelectedItem = showSelectedItem;\n void ComponentHelpers.ScheduledRender.scheduleRender(this, this.#renderBound);\n }\n\n get horizontalAlignment(): Dialogs.Dialog.DialogHorizontalAlignment {\n return this.#props.horizontalAlignment;\n }\n\n set horizontalAlignment(horizontalAlignment: Dialogs.Dialog.DialogHorizontalAlignment) {\n this.#props.horizontalAlignment = horizontalAlignment;\n void ComponentHelpers.ScheduledRender.scheduleRender(this, this.#renderBound);\n }\n\n get getConnectorCustomXPosition(): (() => number)|null {\n return this.#props.getConnectorCustomXPosition;\n }\n\n set getConnectorCustomXPosition(connectorXPosition: (() => number)|null) {\n this.#props.getConnectorCustomXPosition = connectorXPosition;\n void ComponentHelpers.ScheduledRender.scheduleRender(this, this.#renderBound);\n }\n\n connectedCallback(): void {\n this.#shadow.adoptedStyleSheets = [menuStyles];\n void RenderCoordinator.write(() => {\n this.style.setProperty('--selected-item-check', `url(${selectedItemCheckmark})`);\n this.style.setProperty('--menu-checkmark-width', this.#props.showSelectedItem ? '26px' : '0px');\n this.style.setProperty('--menu-checkmark-height', this.#props.showSelectedItem ? '12px' : '0px');\n const dividerLine = this.showDivider ? '1px var(--divider-line) solid' : 'none';\n this.style.setProperty('--override-divider-line', dividerLine);\n });\n }\n\n #getDialog(): Dialogs.Dialog.Dialog {\n if (!this.#dialog) {\n throw new Error('Dialog not found');\n }\n return this.#dialog;\n }\n\n async #dialogDeployed(): Promise {\n await RenderCoordinator.write(() => {\n this.setAttribute('has-open-dialog', 'has-open-dialog');\n // Focus the container so tha twe can capture key events.\n const container = this.#shadow.querySelector('#container');\n if (!(container instanceof HTMLElement)) {\n return;\n }\n container.focus();\n });\n }\n\n #focusFirstItem(): void {\n this.#getFirstItem().focus();\n }\n\n #getFirstItem(): HTMLElement {\n const defaultSlot = this.#shadow.querySelector('slot') as HTMLSlotElement;\n const items = defaultSlot?.assignedElements();\n let firstItem = items[0];\n if (firstItem instanceof HTMLSlotElement) {\n firstItem = firstItem?.assignedElements()[0];\n }\n if (firstItem instanceof MenuGroup) {\n const groupDefaultSlot = firstItem.shadowRoot?.querySelector('slot') as HTMLSlotElement;\n firstItem = groupDefaultSlot?.assignedElements()[0];\n }\n if (firstItem instanceof HTMLElement) {\n return firstItem;\n }\n throw new Error('First item not found');\n }\n\n #handleItemClick(evt: MouseEvent): void {\n const path = evt.composedPath();\n evt.stopPropagation();\n\n // If the clicked item is an input element, do not follow the default behaviour.\n if (path.find(element => element instanceof HTMLInputElement)) {\n return;\n }\n const item = evt.composedPath().find(element => element instanceof MenuItem);\n // Compare against MenuItem again to narrow the item's type.\n if (!(item instanceof MenuItem)) {\n return;\n }\n this.#updateSelectedValue(item);\n }\n\n #handleDialogKeyDown(evt: KeyboardEvent): void {\n const key = evt.key;\n evt.stopImmediatePropagation();\n let item: EventTarget|null|undefined = evt.target;\n const path = evt.composedPath();\n const shouldFocusFirstItem =\n key === Platform.KeyboardUtilities.ArrowKey.DOWN || key === Platform.KeyboardUtilities.ArrowKey.RIGHT;\n if (!this.#itemIsFocused && shouldFocusFirstItem) {\n this.#focusFirstItem();\n this.#itemIsFocused = true;\n return;\n }\n if (!this.#itemIsFocused && key === Platform.KeyboardUtilities.ArrowKey.UP) {\n this.#focusLastItem();\n this.#itemIsFocused = true;\n return;\n }\n // The focused item could be nested inside the MenuItem, hence\n // find the MenuItem item inside the event's composed path.\n if (!(item instanceof MenuItem)) {\n item = path.find(element => element instanceof MenuItem);\n\n // Compare against MenuItem again to narrow the item's type.\n if (!(item instanceof MenuItem)) {\n return;\n }\n }\n if (Platform.KeyboardUtilities.keyIsArrowKey(key)) {\n this.#handleArrowKeyNavigation(key, item);\n } else if (key === 'Home') {\n this.#handleHomeKeyDown(item);\n } else if (key === 'End') {\n this.#focusLastItem();\n } else if (key === 'Enter' || evt.code === 'Space') {\n this.#updateSelectedValue(item);\n } else if (key === 'Escape') {\n evt.preventDefault();\n this.#closeDialog();\n }\n }\n\n #updateSelectedValue(item: MenuItem): void {\n if (item.value === '') {\n return;\n }\n this.dispatchEvent(new MenuItemSelectedEvent(item.value));\n if (item.preventMenuCloseOnSelection) {\n return;\n }\n this.#closeDialog();\n }\n\n #handleArrowKeyNavigation(key: Platform.KeyboardUtilities.ArrowKey, currentItem: MenuItem): void {\n let nextSibling: Element|null = currentItem;\n if (key === Platform.KeyboardUtilities.ArrowKey.DOWN) {\n nextSibling = currentItem.nextElementSibling;\n // Handle last item in a group and navigating down:\n if (nextSibling === null && currentItem.parentElement instanceof MenuGroup) {\n nextSibling = this.#firstItemInNextGroup(currentItem);\n }\n } else if (key === Platform.KeyboardUtilities.ArrowKey.UP) {\n nextSibling = currentItem.previousElementSibling;\n // Handle first item in a group and navigating up:\n if (nextSibling === null && currentItem.parentElement instanceof MenuGroup) {\n nextSibling = this.#lastItemInPreviousGroup(currentItem);\n }\n }\n if (nextSibling instanceof MenuItem) {\n nextSibling.focus();\n }\n }\n #firstItemInNextGroup(currentItem: MenuItem): MenuItem|null {\n const parentElement = currentItem.parentElement;\n if (!(parentElement instanceof MenuGroup)) {\n return null;\n }\n const parentNextSibling = parentElement.nextElementSibling;\n if (parentNextSibling instanceof MenuItem) {\n return parentNextSibling;\n }\n if (!(parentNextSibling instanceof MenuGroup)) {\n return null;\n }\n for (const child of parentNextSibling.children) {\n if (child instanceof MenuItem) {\n return child;\n }\n }\n return null;\n }\n\n #lastItemInPreviousGroup(currentItem: MenuItem): MenuItem|null {\n const parentElement = currentItem.parentElement;\n if (!(parentElement instanceof MenuGroup)) {\n return null;\n }\n const parentPreviousSibling = parentElement.previousElementSibling;\n if (parentPreviousSibling instanceof MenuItem) {\n return parentPreviousSibling;\n }\n if (!(parentPreviousSibling instanceof MenuGroup)) {\n return null;\n }\n if (parentPreviousSibling.lastElementChild instanceof MenuItem) {\n return parentPreviousSibling.lastElementChild;\n }\n return null;\n }\n\n #handleHomeKeyDown(currentItem: MenuItem): void {\n let topMenuPart: Element|null = currentItem;\n if (currentItem.parentElement instanceof MenuGroup) {\n topMenuPart = currentItem.parentElement;\n }\n while (topMenuPart?.previousElementSibling) {\n topMenuPart = topMenuPart?.previousElementSibling;\n }\n if (topMenuPart instanceof MenuItem) {\n topMenuPart.focus();\n return;\n }\n for (const child of topMenuPart.children) {\n if (child instanceof MenuItem) {\n child.focus();\n return;\n }\n }\n }\n\n #focusLastItem(): void {\n const currentItem = this.#getFirstItem();\n let lastMenuPart: Element|null = currentItem;\n if (currentItem.parentElement instanceof MenuGroup) {\n lastMenuPart = currentItem.parentElement;\n }\n while (lastMenuPart?.nextElementSibling) {\n lastMenuPart = lastMenuPart?.nextElementSibling;\n }\n if (lastMenuPart instanceof MenuItem) {\n lastMenuPart.focus();\n return;\n }\n if (lastMenuPart instanceof MenuGroup && lastMenuPart.lastElementChild instanceof MenuItem) {\n lastMenuPart.lastElementChild.focus();\n }\n }\n\n #closeDialog(evt?: Dialogs.Dialog.ClickOutsideDialogEvent): void {\n if (evt) {\n evt.stopImmediatePropagation();\n }\n this.dispatchEvent(new MenuCloseRequest());\n void this.#getDialog().setDialogVisible(false);\n this.#itemIsFocused = false;\n }\n\n async #render(): Promise {\n if (!ComponentHelpers.ScheduledRender.isScheduledRender(this)) {\n throw new Error('Menu render was not scheduled');\n }\n // clang-format off\n LitHtml.render(html`\n {\n this.#dialog = domNode as Dialogs.Dialog.Dialog;\n })}\n >\n \n \n \n \n \n `, this.#shadow, { host: this });\n // clang-format on\n }\n}\n\ninterface MenuItemData {\n /**\n * If true, selecting the item (by clicking it or pressing enter when its focused)\n * would not cause the menu to be closed.\n * Defaults to false.\n */\n preventMenuCloseOnSelection: boolean;\n /**\n * The value associated with this item. It is used to determine what item is selected\n * and is the data sent in a MenuItemSelectedEvent, when an item is selected.\n */\n value: MenuItemValue;\n /**\n * Whether the item is selected.\n */\n selected: boolean;\n}\n\nexport class MenuItem extends HTMLElement {\n readonly #shadow = this.attachShadow({mode: 'open'});\n readonly #renderBound = this.#render.bind(this);\n connectedCallback(): void {\n this.#shadow.adoptedStyleSheets = [menuItemStyles];\n this.tabIndex = 0;\n this.setAttribute('role', 'menuitem');\n }\n #props: MenuItemData = {\n value: '',\n preventMenuCloseOnSelection: false,\n selected: false,\n };\n\n get preventMenuCloseOnSelection(): boolean {\n return this.#props.preventMenuCloseOnSelection;\n }\n\n set preventMenuCloseOnSelection(preventMenuCloseOnSelection: boolean) {\n this.#props.preventMenuCloseOnSelection = preventMenuCloseOnSelection;\n void ComponentHelpers.ScheduledRender.scheduleRender(this, this.#renderBound);\n }\n\n get value(): MenuItemValue {\n return this.#props.value;\n }\n\n set value(value: MenuItemValue) {\n this.#props.value = value;\n void ComponentHelpers.ScheduledRender.scheduleRender(this, this.#renderBound);\n }\n\n get selected(): boolean {\n return this.#props.selected;\n }\n\n set selected(selected: boolean) {\n this.#props.selected = selected;\n void ComponentHelpers.ScheduledRender.scheduleRender(this, this.#renderBound);\n }\n\n async #render(): Promise {\n if (!ComponentHelpers.ScheduledRender.isScheduledRender(this)) {\n throw new Error('MenuItem render was not scheduled');\n }\n // clang-format off\n\n LitHtml.render(html`\n \n \n \n `, this.#shadow, { host: this });\n // clang-format on\n }\n}\n\ninterface MenuGroupData {\n name: string|null;\n}\n\nexport class MenuGroup extends HTMLElement {\n readonly #shadow = this.attachShadow({mode: 'open'});\n readonly #renderBound = this.#render.bind(this);\n connectedCallback(): void {\n this.#shadow.adoptedStyleSheets = [menuGroupStyles];\n }\n\n #props: MenuGroupData = {\n name: null,\n };\n\n get name(): string|null {\n return this.#props.name;\n }\n\n set name(name: string|null) {\n this.#props.name = name;\n void ComponentHelpers.ScheduledRender.scheduleRender(this, this.#renderBound);\n }\n\n async #render(): Promise {\n if (!ComponentHelpers.ScheduledRender.isScheduledRender(this)) {\n throw new Error('MenuGroup render was not scheduled');\n }\n // clang-format off\n LitHtml.render(html`\n \n ${this.name}\n \n \n `, this.#shadow, { host: this });\n // clang-format on\n }\n}\n\ncustomElements.define('devtools-menu', Menu);\ncustomElements.define('devtools-menu-item', MenuItem);\ncustomElements.define('devtools-menu-group', MenuGroup);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'devtools-menu': Menu;\n 'devtools-menu-item': MenuItem;\n 'devtools-menu-group': MenuGroup;\n }\n\n interface HTMLElementEventMap {\n [MenuItemSelectedEvent.eventName]: MenuItemSelectedEvent;\n [MenuCloseRequest.eventName]: MenuCloseRequest;\n }\n}\n\nexport class MenuItemSelectedEvent extends Event {\n static readonly eventName = 'menuitemselected';\n\n constructor(public itemValue: MenuItemValue) {\n super(MenuItemSelectedEvent.eventName, {bubbles: true, composed: true});\n }\n}\nexport class MenuCloseRequest extends Event {\n static readonly eventName = 'menucloserequest';\n constructor() {\n super(MenuCloseRequest.eventName, {bubbles: true, composed: true});\n }\n}\n\nexport type MenuItemValue = string|number|boolean;\n"]} \ No newline at end of file diff --git a/public/ui/components/menus/SelectMenu.js b/public/ui/components/menus/SelectMenu.js index 8175cd9e9..106aeef8a 100644 --- a/public/ui/components/menus/SelectMenu.js +++ b/public/ui/components/menus/SelectMenu.js @@ -3,7 +3,7 @@ // found in the LICENSE file. import * as Platform from '../../../core/platform/platform.js'; import * as ComponentHelpers from '../../../ui/components/helpers/helpers.js'; -import * as Coordinator from '../../../ui/components/render_coordinator/render_coordinator.js'; +import * as RenderCoordinator from '../../../ui/components/render_coordinator/render_coordinator.js'; import * as LitHtml from '../../../ui/lit-html/lit-html.js'; import * as VisualLogging from '../../../ui/visual_logging/visual_logging.js'; import * as Dialogs from '../dialogs/dialogs.js'; @@ -11,7 +11,6 @@ import { MenuGroup, } from './Menu.js'; import selectMenuStyles from './selectMenu.css.js'; import selectMenuButtonStyles from './selectMenuButton.css.js'; const { html } = LitHtml; -const coordinator = Coordinator.RenderCoordinator.RenderCoordinator.instance(); const deployMenuArrow = new URL('../../../Images/triangle-down.svg', import.meta.url).toString(); export class SelectMenu extends HTMLElement { #shadow = this.attachShadow({ mode: 'open' }); @@ -155,7 +154,7 @@ export class SelectMenu extends HTMLElement { if (evt) { evt.stopImmediatePropagation(); } - void coordinator.write(() => { + void RenderCoordinator.write(() => { this.removeAttribute('has-open-dialog'); }); this.#open = false; @@ -194,7 +193,7 @@ export class SelectMenuButton extends HTMLElement { connectedCallback() { this.#shadow.adoptedStyleSheets = [selectMenuButtonStyles]; this.style.setProperty('--deploy-menu-arrow', `url(${deployMenuArrow})`); - void coordinator.write(() => { + void RenderCoordinator.write(() => { switch (this.arrowDirection) { case "auto" /* Dialogs.Dialog.DialogVerticalPosition.AUTO */: case "top" /* Dialogs.Dialog.DialogVerticalPosition.TOP */: { @@ -239,7 +238,7 @@ export class SelectMenuButton extends HTMLElement { void ComponentHelpers.ScheduledRender.scheduleRender(this, this.#renderBound); } set open(open) { - void coordinator.write(() => { + void RenderCoordinator.write(() => { this.#getShowButton()?.setAttribute('aria-expanded', String(open)); }); } diff --git a/public/ui/components/menus/SelectMenu.js.map b/public/ui/components/menus/SelectMenu.js.map index d3d22ea8c..87c77ccf3 100644 --- a/public/ui/components/menus/SelectMenu.js.map +++ b/public/ui/components/menus/SelectMenu.js.map @@ -1 +1 @@ -{"version":3,"file":"SelectMenu.js","sourceRoot":"","sources":["../../../../../../../front_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8BAA+B,SAAQ,KAAK;IACvD,MAAM,CAAU,SAAS,GAAG,2BAA2B,CAAC;IACxD;QACE,KAAK,CAAC,8BAA8B,CAAC,SAAS,EAAE,EAAC,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAC,CAAC,CAAC;IACnF,CAAC;;AAGH,MAAM,OAAO,4BAA6B,SAAQ,KAAK;IACrD,MAAM,CAAU,SAAS,GAAG,yBAAyB,CAAC;IACtD;QACE,KAAK,CAAC,4BAA4B,CAAC,SAAS,EAAE,EAAC,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAC,CAAC,CAAC;IACjF,CAAC;;AAQH,OAAO,EAAC,SAAS,IAAI,eAAe,EAAC,CAAC","sourcesContent":["// Copyright 2023 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport * as Platform from '../../../core/platform/platform.js';\nimport * as ComponentHelpers from '../../../ui/components/helpers/helpers.js';\nimport * as Coordinator from '../../../ui/components/render_coordinator/render_coordinator.js';\nimport * as LitHtml from '../../../ui/lit-html/lit-html.js';\nimport * as VisualLogging from '../../../ui/visual_logging/visual_logging.js';\nimport * as Dialogs from '../dialogs/dialogs.js';\n\nimport {\n MenuGroup,\n type MenuItemSelectedEvent,\n type MenuItemValue,\n} from './Menu.js';\nimport selectMenuStyles from './selectMenu.css.js';\nimport selectMenuButtonStyles from './selectMenuButton.css.js';\n\nconst {html} = LitHtml;\n\nconst coordinator = Coordinator.RenderCoordinator.RenderCoordinator.instance();\n\nexport interface SelectMenuData {\n /**\n * Determines where the dialog with the menu will show relative to\n * the show button.\n * Defaults to Bottom.\n */\n position: Dialogs.Dialog.DialogVerticalPosition;\n /**\n * Determines where the dialog with the menu will show horizontally\n * relative to the show button.\n * Defaults to Auto\n */\n horizontalAlignment: Dialogs.Dialog.DialogHorizontalAlignment;\n /**\n * The title of the menu button. Can be either a string or a function\n * that returns a LitHTML template.\n * If not set, the title of the button will default to the selected\n * item's text.\n */\n buttonTitle: string|TitleCallback;\n /**\n * Determines if an arrow, pointing to the opposite side of\n * the dialog, is shown at the end of the button.\n * Defaults to false.\n */\n showArrow: boolean;\n /**\n * Determines if the component is formed by two buttons:\n * one to open the meny and another that triggers a\n * selectmenusidebuttonclickEvent. The RecordMenu instance of\n * the component is an example of this use case.\n * Defaults to false.\n */\n sideButton: boolean;\n /**\n * Whether the menu button is disabled.\n * Defaults to false.\n */\n disabled: boolean;\n /**\n * Determines if dividing lines between the menu's options\n * are shown.\n */\n showDivider: boolean;\n /**\n * Determines if the selected item is marked using a checkmark.\n * Defaults to true.\n */\n showSelectedItem: boolean;\n /**\n * Specifies a context for the visual element.\n */\n jslogContext: string;\n}\ntype TitleCallback = () => LitHtml.TemplateResult;\n\nconst deployMenuArrow = new URL('../../../Images/triangle-down.svg', import.meta.url).toString();\n\nexport class SelectMenu extends HTMLElement {\n readonly #shadow = this.attachShadow({mode: 'open'});\n readonly #renderBound = this.#render.bind(this);\n #button: SelectMenuButton|null = null;\n #open: boolean = false;\n #props: SelectMenuData = {\n buttonTitle: '',\n position: Dialogs.Dialog.DialogVerticalPosition.BOTTOM,\n horizontalAlignment: Dialogs.Dialog.DialogHorizontalAlignment.AUTO,\n showArrow: false,\n sideButton: false,\n showDivider: false,\n disabled: false,\n showSelectedItem: true,\n jslogContext: '',\n };\n\n get buttonTitle(): string|TitleCallback {\n return this.#props.buttonTitle;\n }\n\n set buttonTitle(buttonTitle: string|TitleCallback) {\n this.#props.buttonTitle = buttonTitle;\n void ComponentHelpers.ScheduledRender.scheduleRender(this, this.#renderBound);\n }\n\n get position(): Dialogs.Dialog.DialogVerticalPosition {\n return this.#props.position;\n }\n\n set position(position: Dialogs.Dialog.DialogVerticalPosition) {\n this.#props.position = position;\n void ComponentHelpers.ScheduledRender.scheduleRender(this, this.#renderBound);\n }\n\n get horizontalAlignment(): Dialogs.Dialog.DialogHorizontalAlignment {\n return this.#props.horizontalAlignment;\n }\n\n set horizontalAlignment(horizontalAlignment: Dialogs.Dialog.DialogHorizontalAlignment) {\n this.#props.horizontalAlignment = horizontalAlignment;\n void ComponentHelpers.ScheduledRender.scheduleRender(this, this.#renderBound);\n }\n\n get showArrow(): boolean {\n return this.#props.showArrow;\n }\n\n set showArrow(showArrow: boolean) {\n this.#props.showArrow = showArrow;\n void ComponentHelpers.ScheduledRender.scheduleRender(this, this.#renderBound);\n }\n\n get sideButton(): boolean {\n return this.#props.sideButton;\n }\n\n set sideButton(sideButton: boolean) {\n this.#props.sideButton = sideButton;\n void ComponentHelpers.ScheduledRender.scheduleRender(this, this.#renderBound);\n }\n\n get disabled(): boolean {\n return this.#props.disabled;\n }\n\n set disabled(disabled: boolean) {\n this.#props.disabled = disabled;\n void ComponentHelpers.ScheduledRender.scheduleRender(this, this.#renderBound);\n }\n\n get showDivider(): boolean {\n return this.#props.showDivider;\n }\n\n set showDivider(showDivider: boolean) {\n this.#props.showDivider = showDivider;\n void ComponentHelpers.ScheduledRender.scheduleRender(this, this.#renderBound);\n }\n\n get showSelectedItem(): boolean {\n return this.#props.showSelectedItem;\n }\n\n set showSelectedItem(showSelectedItem: boolean) {\n this.#props.showSelectedItem = showSelectedItem;\n void ComponentHelpers.ScheduledRender.scheduleRender(this, this.#renderBound);\n }\n\n get jslogContext(): string {\n return this.#props.jslogContext;\n }\n\n set jslogContext(jslogContext: string) {\n this.#props.jslogContext = jslogContext;\n void ComponentHelpers.ScheduledRender.scheduleRender(this, this.#renderBound);\n }\n\n connectedCallback(): void {\n this.#shadow.adoptedStyleSheets = [selectMenuStyles];\n }\n\n #getButton(): SelectMenuButton {\n if (!this.#button) {\n this.#button = this.#shadow.querySelector('devtools-select-menu-button');\n if (!this.#button) {\n throw new Error('Arrow not found');\n }\n }\n return this.#button;\n }\n\n #showMenu(): void {\n this.#open = true;\n this.setAttribute('has-open-dialog', 'has-open-dialog');\n void ComponentHelpers.ScheduledRender.scheduleRender(this, this.#renderBound);\n }\n\n override click(): void {\n this.#getButton().click();\n }\n\n #sideButtonClicked(): void {\n this.dispatchEvent(new SelectMenuSideButtonClickEvent());\n }\n\n #getButtonText(): LitHtml.TemplateResult|string {\n return this.buttonTitle instanceof Function ? this.buttonTitle() : this.buttonTitle;\n }\n\n #renderButton(): LitHtml.TemplateResult {\n const buttonLabel = this.#getButtonText();\n if (!this.sideButton) {\n // clang-format off\n return html`\n \n ${buttonLabel}\n \n `;\n // clang-format on\n }\n\n // clang-format off\n return html`\n \n \n \n `;\n // clang-format on\n }\n\n #onMenuClose(evt?: Dialogs.Dialog.ClickOutsideDialogEvent): void {\n if (evt) {\n evt.stopImmediatePropagation();\n }\n void coordinator.write(() => {\n this.removeAttribute('has-open-dialog');\n });\n this.#open = false;\n void ComponentHelpers.ScheduledRender.scheduleRender(this, this.#renderBound);\n }\n\n #onItemSelected(evt: MenuItemSelectedEvent): void {\n this.dispatchEvent(new SelectMenuItemSelectedEvent(evt.itemValue));\n }\n\n async #render(): Promise {\n if (!ComponentHelpers.ScheduledRender.isScheduledRender(this)) {\n throw new Error('SelectMenu render was not scheduled');\n }\n LitHtml.render(\n html`\n \n \n \n \n ${this.#renderButton()}\n `,\n this.#shadow, {host: this});\n // clang-format on\n }\n}\n\nexport interface SelectMenuButtonData {\n showArrow: boolean;\n arrowDirection: Dialogs.Dialog.DialogVerticalPosition;\n disabled: boolean;\n singleArrow: boolean;\n jslogContext: string;\n}\nexport class SelectMenuButton extends HTMLElement {\n readonly #shadow = this.attachShadow({mode: 'open'});\n readonly #renderBound = this.#render.bind(this);\n #showButton: HTMLButtonElement|null = null;\n\n connectedCallback(): void {\n this.#shadow.adoptedStyleSheets = [selectMenuButtonStyles];\n this.style.setProperty('--deploy-menu-arrow', `url(${deployMenuArrow})`);\n void coordinator.write(() => {\n switch (this.arrowDirection) {\n case Dialogs.Dialog.DialogVerticalPosition.AUTO:\n case Dialogs.Dialog.DialogVerticalPosition.TOP: {\n this.style.setProperty('--arrow-angle', '180deg');\n break;\n }\n case Dialogs.Dialog.DialogVerticalPosition.BOTTOM: {\n this.style.setProperty('--arrow-angle', '0deg');\n break;\n }\n default:\n Platform.assertNever(this.arrowDirection, `Unknown position type: ${this.arrowDirection}`);\n }\n });\n }\n #props: SelectMenuButtonData = {\n showArrow: false,\n arrowDirection: Dialogs.Dialog.DialogVerticalPosition.BOTTOM,\n disabled: false,\n singleArrow: false,\n jslogContext: '',\n };\n\n get showArrow(): boolean {\n return this.#props.showArrow;\n }\n\n set showArrow(showArrow: boolean) {\n this.#props.showArrow = showArrow;\n void ComponentHelpers.ScheduledRender.scheduleRender(this, this.#renderBound);\n }\n\n get arrowDirection(): Dialogs.Dialog.DialogVerticalPosition {\n return this.#props.arrowDirection;\n }\n\n set arrowDirection(arrowDirection: Dialogs.Dialog.DialogVerticalPosition) {\n this.#props.arrowDirection = arrowDirection;\n void ComponentHelpers.ScheduledRender.scheduleRender(this, this.#renderBound);\n }\n\n get disabled(): boolean {\n return this.#props.disabled;\n }\n\n set disabled(disabled: boolean) {\n this.#props.disabled = disabled;\n void ComponentHelpers.ScheduledRender.scheduleRender(this, this.#renderBound);\n }\n\n set open(open: boolean) {\n void coordinator.write(() => {\n this.#getShowButton()?.setAttribute('aria-expanded', String(open));\n });\n }\n\n set singleArrow(singleArrow: boolean) {\n this.#props.singleArrow = singleArrow;\n void ComponentHelpers.ScheduledRender.scheduleRender(this, this.#renderBound);\n }\n\n get jslogContext(): string {\n return this.#props.jslogContext;\n }\n\n set jslogContext(jslogContext: string) {\n this.#props.jslogContext = jslogContext;\n void ComponentHelpers.ScheduledRender.scheduleRender(this, this.#renderBound);\n }\n\n override click(): void {\n this.#getShowButton()?.click();\n }\n\n #getShowButton(): HTMLButtonElement|null {\n if (!this.#showButton) {\n this.#showButton = this.#shadow.querySelector('button');\n }\n return this.#showButton;\n }\n\n #handleButtonKeyDown(evt: KeyboardEvent): void {\n const key = evt.key;\n const shouldShowDialogBelow = this.arrowDirection === Dialogs.Dialog.DialogVerticalPosition.BOTTOM &&\n key === Platform.KeyboardUtilities.ArrowKey.DOWN;\n const shouldShowDialogAbove = this.arrowDirection === Dialogs.Dialog.DialogVerticalPosition.TOP &&\n key === Platform.KeyboardUtilities.ArrowKey.UP;\n const isEnter = key === Platform.KeyboardUtilities.ENTER_KEY;\n const isSpace = evt.code === 'Space';\n if (shouldShowDialogBelow || shouldShowDialogAbove || isEnter || isSpace) {\n this.dispatchEvent(new SelectMenuButtonTriggerEvent());\n evt.preventDefault();\n }\n }\n\n #handleClick(): void {\n this.dispatchEvent(new SelectMenuButtonTriggerEvent());\n }\n\n async #render(): Promise {\n if (!ComponentHelpers.ScheduledRender.isScheduledRender(this)) {\n throw new Error('SelectMenuItem render was not scheduled');\n }\n const arrow = this.#props.showArrow ? html`` : LitHtml.nothing;\n const classMap = {'single-arrow': this.#props.singleArrow};\n // clang-format off\n const buttonTitle = html`\n \n \n ${arrow}\n \n `;\n\n // clang-format off\n LitHtml.render(html`\n \n `, this.#shadow, { host: this });\n // clang-format on\n }\n}\n\ncustomElements.define('devtools-select-menu', SelectMenu);\ncustomElements.define('devtools-select-menu-button', SelectMenuButton);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'devtools-select-menu': SelectMenu;\n 'devtools-select-menu-button': SelectMenuButton;\n }\n\n interface HTMLElementEventMap {\n [SelectMenuItemSelectedEvent.eventName]: SelectMenuItemSelectedEvent;\n }\n}\n\nexport class SelectMenuItemSelectedEvent extends Event {\n static readonly eventName = 'selectmenuselected';\n\n constructor(public itemValue: SelectMenuItemValue) {\n super(SelectMenuItemSelectedEvent.eventName, {bubbles: true, composed: true});\n }\n}\n\nexport class SelectMenuSideButtonClickEvent extends Event {\n static readonly eventName = 'selectmenusidebuttonclick';\n constructor() {\n super(SelectMenuSideButtonClickEvent.eventName, {bubbles: true, composed: true});\n }\n}\n\nexport class SelectMenuButtonTriggerEvent extends Event {\n static readonly eventName = 'selectmenubuttontrigger';\n constructor() {\n super(SelectMenuButtonTriggerEvent.eventName, {bubbles: true, composed: true});\n }\n}\n\n// Exported artifacts used in this component and that belong to the Menu are\n// renamed to only make reference to the SelectMenu. This way, the Menu API\n// doesn't have to be used in SelectMenu usages and the SelectMenu implementation\n// can remain transparent to its users.\nexport type SelectMenuItemValue = MenuItemValue;\nexport {MenuGroup as SelectMenuGroup};\n"]} \ No newline at end of file +{"version":3,"file":"SelectMenu.js","sourceRoot":"","sources":["../../../../../../../front_end/ui/components/menus/SelectMenu.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,KAAK,QAAQ,MAAM,oCAAoC,CAAC;AAC/D,OAAO,KAAK,gBAAgB,MAAM,2CAA2C,CAAC;AAC9E,OAAO,KAAK,iBAAiB,MAAM,iEAAiE,CAAC;AACrG,OAAO,KAAK,OAAO,MAAM,kCAAkC,CAAC;AAC5D,OAAO,KAAK,aAAa,MAAM,8CAA8C,CAAC;AAC9E,OAAO,KAAK,OAAO,MAAM,uBAAuB,CAAC;AAEjD,OAAO,EACL,SAAS,GAGV,MAAM,WAAW,CAAC;AACnB,OAAO,gBAAgB,MAAM,qBAAqB,CAAC;AACnD,OAAO,sBAAsB,MAAM,2BAA2B,CAAC;AAE/D,MAAM,EAAC,IAAI,EAAC,GAAG,OAAO,CAAC;AA0DvB,MAAM,eAAe,GAAG,IAAI,GAAG,CAAC,mCAAmC,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,CAAC;AAEjG,MAAM,OAAO,UAAW,SAAQ,WAAW;IAChC,OAAO,GAAG,IAAI,CAAC,YAAY,CAAC,EAAC,IAAI,EAAE,MAAM,EAAC,CAAC,CAAC;IAC5C,YAAY,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAChD,OAAO,GAA0B,IAAI,CAAC;IACtC,KAAK,GAAY,KAAK,CAAC;IACvB,MAAM,GAAmB;QACvB,WAAW,EAAE,EAAE;QACf,QAAQ,6DAA8C;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AK,CAAC,2BAA2B,CAAC,SAAS,EAAE,EAAC,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAC,CAAC,CAAC;QAD7D,cAAS,GAAT,SAAS,CAAqB;IAEjD,CAAC;;AAGH,MAAM,OAAO,8BAA+B,SAAQ,KAAK;IACvD,MAAM,CAAU,SAAS,GAAG,2BAA2B,CAAC;IACxD;QACE,KAAK,CAAC,8BAA8B,CAAC,SAAS,EAAE,EAAC,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAC,CAAC,CAAC;IACnF,CAAC;;AAGH,MAAM,OAAO,4BAA6B,SAAQ,KAAK;IACrD,MAAM,CAAU,SAAS,GAAG,yBAAyB,CAAC;IACtD;QACE,KAAK,CAAC,4BAA4B,CAAC,SAAS,EAAE,EAAC,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAC,CAAC,CAAC;IACjF,CAAC;;AAQH,OAAO,EAAC,SAAS,IAAI,eAAe,EAAC,CAAC","sourcesContent":["// Copyright 2023 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport * as Platform from '../../../core/platform/platform.js';\nimport * as ComponentHelpers from '../../../ui/components/helpers/helpers.js';\nimport * as RenderCoordinator from '../../../ui/components/render_coordinator/render_coordinator.js';\nimport * as LitHtml from '../../../ui/lit-html/lit-html.js';\nimport * as VisualLogging from '../../../ui/visual_logging/visual_logging.js';\nimport * as Dialogs from '../dialogs/dialogs.js';\n\nimport {\n MenuGroup,\n type MenuItemSelectedEvent,\n type MenuItemValue,\n} from './Menu.js';\nimport selectMenuStyles from './selectMenu.css.js';\nimport selectMenuButtonStyles from './selectMenuButton.css.js';\n\nconst {html} = LitHtml;\n\nexport interface SelectMenuData {\n /**\n * Determines where the dialog with the menu will show relative to\n * the show button.\n * Defaults to Bottom.\n */\n position: Dialogs.Dialog.DialogVerticalPosition;\n /**\n * Determines where the dialog with the menu will show horizontally\n * relative to the show button.\n * Defaults to Auto\n */\n horizontalAlignment: Dialogs.Dialog.DialogHorizontalAlignment;\n /**\n * The title of the menu button. Can be either a string or a function\n * that returns a LitHTML template.\n * If not set, the title of the button will default to the selected\n * item's text.\n */\n buttonTitle: string|TitleCallback;\n /**\n * Determines if an arrow, pointing to the opposite side of\n * the dialog, is shown at the end of the button.\n * Defaults to false.\n */\n showArrow: boolean;\n /**\n * Determines if the component is formed by two buttons:\n * one to open the meny and another that triggers a\n * selectmenusidebuttonclickEvent. The RecordMenu instance of\n * the component is an example of this use case.\n * Defaults to false.\n */\n sideButton: boolean;\n /**\n * Whether the menu button is disabled.\n * Defaults to false.\n */\n disabled: boolean;\n /**\n * Determines if dividing lines between the menu's options\n * are shown.\n */\n showDivider: boolean;\n /**\n * Determines if the selected item is marked using a checkmark.\n * Defaults to true.\n */\n showSelectedItem: boolean;\n /**\n * Specifies a context for the visual element.\n */\n jslogContext: string;\n}\ntype TitleCallback = () => LitHtml.TemplateResult;\n\nconst deployMenuArrow = new URL('../../../Images/triangle-down.svg', import.meta.url).toString();\n\nexport class SelectMenu extends HTMLElement {\n readonly #shadow = this.attachShadow({mode: 'open'});\n readonly #renderBound = this.#render.bind(this);\n #button: SelectMenuButton|null = null;\n #open: boolean = false;\n #props: SelectMenuData = {\n buttonTitle: '',\n position: Dialogs.Dialog.DialogVerticalPosition.BOTTOM,\n horizontalAlignment: Dialogs.Dialog.DialogHorizontalAlignment.AUTO,\n showArrow: false,\n sideButton: false,\n showDivider: false,\n disabled: false,\n showSelectedItem: true,\n jslogContext: '',\n };\n\n get buttonTitle(): string|TitleCallback {\n return this.#props.buttonTitle;\n }\n\n set buttonTitle(buttonTitle: string|TitleCallback) {\n this.#props.buttonTitle = buttonTitle;\n void ComponentHelpers.ScheduledRender.scheduleRender(this, this.#renderBound);\n }\n\n get position(): Dialogs.Dialog.DialogVerticalPosition {\n return this.#props.position;\n }\n\n set position(position: Dialogs.Dialog.DialogVerticalPosition) {\n this.#props.position = position;\n void ComponentHelpers.ScheduledRender.scheduleRender(this, this.#renderBound);\n }\n\n get horizontalAlignment(): Dialogs.Dialog.DialogHorizontalAlignment {\n return this.#props.horizontalAlignment;\n }\n\n set horizontalAlignment(horizontalAlignment: Dialogs.Dialog.DialogHorizontalAlignment) {\n this.#props.horizontalAlignment = horizontalAlignment;\n void ComponentHelpers.ScheduledRender.scheduleRender(this, this.#renderBound);\n }\n\n get showArrow(): boolean {\n return this.#props.showArrow;\n }\n\n set showArrow(showArrow: boolean) {\n this.#props.showArrow = showArrow;\n void ComponentHelpers.ScheduledRender.scheduleRender(this, this.#renderBound);\n }\n\n get sideButton(): boolean {\n return this.#props.sideButton;\n }\n\n set sideButton(sideButton: boolean) {\n this.#props.sideButton = sideButton;\n void ComponentHelpers.ScheduledRender.scheduleRender(this, this.#renderBound);\n }\n\n get disabled(): boolean {\n return this.#props.disabled;\n }\n\n set disabled(disabled: boolean) {\n this.#props.disabled = disabled;\n void ComponentHelpers.ScheduledRender.scheduleRender(this, this.#renderBound);\n }\n\n get showDivider(): boolean {\n return this.#props.showDivider;\n }\n\n set showDivider(showDivider: boolean) {\n this.#props.showDivider = showDivider;\n void ComponentHelpers.ScheduledRender.scheduleRender(this, this.#renderBound);\n }\n\n get showSelectedItem(): boolean {\n return this.#props.showSelectedItem;\n }\n\n set showSelectedItem(showSelectedItem: boolean) {\n this.#props.showSelectedItem = showSelectedItem;\n void ComponentHelpers.ScheduledRender.scheduleRender(this, this.#renderBound);\n }\n\n get jslogContext(): string {\n return this.#props.jslogContext;\n }\n\n set jslogContext(jslogContext: string) {\n this.#props.jslogContext = jslogContext;\n void ComponentHelpers.ScheduledRender.scheduleRender(this, this.#renderBound);\n }\n\n connectedCallback(): void {\n this.#shadow.adoptedStyleSheets = [selectMenuStyles];\n }\n\n #getButton(): SelectMenuButton {\n if (!this.#button) {\n this.#button = this.#shadow.querySelector('devtools-select-menu-button');\n if (!this.#button) {\n throw new Error('Arrow not found');\n }\n }\n return this.#button;\n }\n\n #showMenu(): void {\n this.#open = true;\n this.setAttribute('has-open-dialog', 'has-open-dialog');\n void ComponentHelpers.ScheduledRender.scheduleRender(this, this.#renderBound);\n }\n\n override click(): void {\n this.#getButton().click();\n }\n\n #sideButtonClicked(): void {\n this.dispatchEvent(new SelectMenuSideButtonClickEvent());\n }\n\n #getButtonText(): LitHtml.TemplateResult|string {\n return this.buttonTitle instanceof Function ? this.buttonTitle() : this.buttonTitle;\n }\n\n #renderButton(): LitHtml.TemplateResult {\n const buttonLabel = this.#getButtonText();\n if (!this.sideButton) {\n // clang-format off\n return html`\n \n ${buttonLabel}\n \n `;\n // clang-format on\n }\n\n // clang-format off\n return html`\n \n \n \n `;\n // clang-format on\n }\n\n #onMenuClose(evt?: Dialogs.Dialog.ClickOutsideDialogEvent): void {\n if (evt) {\n evt.stopImmediatePropagation();\n }\n void RenderCoordinator.write(() => {\n this.removeAttribute('has-open-dialog');\n });\n this.#open = false;\n void ComponentHelpers.ScheduledRender.scheduleRender(this, this.#renderBound);\n }\n\n #onItemSelected(evt: MenuItemSelectedEvent): void {\n this.dispatchEvent(new SelectMenuItemSelectedEvent(evt.itemValue));\n }\n\n async #render(): Promise {\n if (!ComponentHelpers.ScheduledRender.isScheduledRender(this)) {\n throw new Error('SelectMenu render was not scheduled');\n }\n LitHtml.render(\n html`\n \n \n \n \n ${this.#renderButton()}\n `,\n this.#shadow, {host: this});\n // clang-format on\n }\n}\n\nexport interface SelectMenuButtonData {\n showArrow: boolean;\n arrowDirection: Dialogs.Dialog.DialogVerticalPosition;\n disabled: boolean;\n singleArrow: boolean;\n jslogContext: string;\n}\nexport class SelectMenuButton extends HTMLElement {\n readonly #shadow = this.attachShadow({mode: 'open'});\n readonly #renderBound = this.#render.bind(this);\n #showButton: HTMLButtonElement|null = null;\n\n connectedCallback(): void {\n this.#shadow.adoptedStyleSheets = [selectMenuButtonStyles];\n this.style.setProperty('--deploy-menu-arrow', `url(${deployMenuArrow})`);\n void RenderCoordinator.write(() => {\n switch (this.arrowDirection) {\n case Dialogs.Dialog.DialogVerticalPosition.AUTO:\n case Dialogs.Dialog.DialogVerticalPosition.TOP: {\n this.style.setProperty('--arrow-angle', '180deg');\n break;\n }\n case Dialogs.Dialog.DialogVerticalPosition.BOTTOM: {\n this.style.setProperty('--arrow-angle', '0deg');\n break;\n }\n default:\n Platform.assertNever(this.arrowDirection, `Unknown position type: ${this.arrowDirection}`);\n }\n });\n }\n #props: SelectMenuButtonData = {\n showArrow: false,\n arrowDirection: Dialogs.Dialog.DialogVerticalPosition.BOTTOM,\n disabled: false,\n singleArrow: false,\n jslogContext: '',\n };\n\n get showArrow(): boolean {\n return this.#props.showArrow;\n }\n\n set showArrow(showArrow: boolean) {\n this.#props.showArrow = showArrow;\n void ComponentHelpers.ScheduledRender.scheduleRender(this, this.#renderBound);\n }\n\n get arrowDirection(): Dialogs.Dialog.DialogVerticalPosition {\n return this.#props.arrowDirection;\n }\n\n set arrowDirection(arrowDirection: Dialogs.Dialog.DialogVerticalPosition) {\n this.#props.arrowDirection = arrowDirection;\n void ComponentHelpers.ScheduledRender.scheduleRender(this, this.#renderBound);\n }\n\n get disabled(): boolean {\n return this.#props.disabled;\n }\n\n set disabled(disabled: boolean) {\n this.#props.disabled = disabled;\n void ComponentHelpers.ScheduledRender.scheduleRender(this, this.#renderBound);\n }\n\n set open(open: boolean) {\n void RenderCoordinator.write(() => {\n this.#getShowButton()?.setAttribute('aria-expanded', String(open));\n });\n }\n\n set singleArrow(singleArrow: boolean) {\n this.#props.singleArrow = singleArrow;\n void ComponentHelpers.ScheduledRender.scheduleRender(this, this.#renderBound);\n }\n\n get jslogContext(): string {\n return this.#props.jslogContext;\n }\n\n set jslogContext(jslogContext: string) {\n this.#props.jslogContext = jslogContext;\n void ComponentHelpers.ScheduledRender.scheduleRender(this, this.#renderBound);\n }\n\n override click(): void {\n this.#getShowButton()?.click();\n }\n\n #getShowButton(): HTMLButtonElement|null {\n if (!this.#showButton) {\n this.#showButton = this.#shadow.querySelector('button');\n }\n return this.#showButton;\n }\n\n #handleButtonKeyDown(evt: KeyboardEvent): void {\n const key = evt.key;\n const shouldShowDialogBelow = this.arrowDirection === Dialogs.Dialog.DialogVerticalPosition.BOTTOM &&\n key === Platform.KeyboardUtilities.ArrowKey.DOWN;\n const shouldShowDialogAbove = this.arrowDirection === Dialogs.Dialog.DialogVerticalPosition.TOP &&\n key === Platform.KeyboardUtilities.ArrowKey.UP;\n const isEnter = key === Platform.KeyboardUtilities.ENTER_KEY;\n const isSpace = evt.code === 'Space';\n if (shouldShowDialogBelow || shouldShowDialogAbove || isEnter || isSpace) {\n this.dispatchEvent(new SelectMenuButtonTriggerEvent());\n evt.preventDefault();\n }\n }\n\n #handleClick(): void {\n this.dispatchEvent(new SelectMenuButtonTriggerEvent());\n }\n\n async #render(): Promise {\n if (!ComponentHelpers.ScheduledRender.isScheduledRender(this)) {\n throw new Error('SelectMenuItem render was not scheduled');\n }\n const arrow = this.#props.showArrow ? html`` : LitHtml.nothing;\n const classMap = {'single-arrow': this.#props.singleArrow};\n // clang-format off\n const buttonTitle = html`\n \n \n ${arrow}\n \n `;\n\n // clang-format off\n LitHtml.render(html`\n \n `, this.#shadow, { host: this });\n // clang-format on\n }\n}\n\ncustomElements.define('devtools-select-menu', SelectMenu);\ncustomElements.define('devtools-select-menu-button', SelectMenuButton);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'devtools-select-menu': SelectMenu;\n 'devtools-select-menu-button': SelectMenuButton;\n }\n\n interface HTMLElementEventMap {\n [SelectMenuItemSelectedEvent.eventName]: SelectMenuItemSelectedEvent;\n }\n}\n\nexport class SelectMenuItemSelectedEvent extends Event {\n static readonly eventName = 'selectmenuselected';\n\n constructor(public itemValue: SelectMenuItemValue) {\n super(SelectMenuItemSelectedEvent.eventName, {bubbles: true, composed: true});\n }\n}\n\nexport class SelectMenuSideButtonClickEvent extends Event {\n static readonly eventName = 'selectmenusidebuttonclick';\n constructor() {\n super(SelectMenuSideButtonClickEvent.eventName, {bubbles: true, composed: true});\n }\n}\n\nexport class SelectMenuButtonTriggerEvent extends Event {\n static readonly eventName = 'selectmenubuttontrigger';\n constructor() {\n super(SelectMenuButtonTriggerEvent.eventName, {bubbles: true, composed: true});\n }\n}\n\n// Exported artifacts used in this component and that belong to the Menu are\n// renamed to only make reference to the SelectMenu. This way, the Menu API\n// doesn't have to be used in SelectMenu usages and the SelectMenu implementation\n// can remain transparent to its users.\nexport type SelectMenuItemValue = MenuItemValue;\nexport {MenuGroup as SelectMenuGroup};\n"]} \ No newline at end of file diff --git a/public/ui/components/menus/SelectMenu.test.js b/public/ui/components/menus/SelectMenu.test.js index e62ea199d..90773bffe 100644 --- a/public/ui/components/menus/SelectMenu.test.js +++ b/public/ui/components/menus/SelectMenu.test.js @@ -5,10 +5,9 @@ import * as Helpers from '../../../testing/DOMHelpers.js'; // eslint-disable-lin import { describeWithLocale, } from '../../../testing/EnvironmentHelpers.js'; import * as LitHtml from '../../lit-html/lit-html.js'; import * as Dialogs from '../dialogs/dialogs.js'; -import * as Coordinator from '../render_coordinator/render_coordinator.js'; +import * as RenderCoordinator from '../render_coordinator/render_coordinator.js'; import * as Menus from './menus.js'; const { html } = LitHtml; -const coordinator = Coordinator.RenderCoordinator.RenderCoordinator.instance(); async function createMenu() { const menuItems = [ { @@ -40,7 +39,7 @@ async function createMenu() { selectMenuItem.textContent = item.name; menu.appendChild(selectMenuItem); }); - await coordinator.done(); + await RenderCoordinator.done(); return menu; } describeWithLocale('SelectMenu', () => { @@ -53,7 +52,7 @@ describeWithLocale('SelectMenu', () => { } menu.buttonTitle = 'Override Title'; Helpers.renderElementIntoDOM(menu); - await coordinator.done(); + await RenderCoordinator.done(); assert.isNotNull(menu.shadowRoot); const button = menu.shadowRoot.querySelector('devtools-select-menu-button'); if (!button) { @@ -73,7 +72,7 @@ describeWithLocale('SelectMenu', () => { firsItem.selected = true; menu.buttonTitle = () => html `Override Title`; Helpers.renderElementIntoDOM(menu); - await coordinator.done(); + await RenderCoordinator.done(); assert.isNotNull(menu.shadowRoot); const button = menu.shadowRoot.querySelector('devtools-select-menu-button'); if (!button) { diff --git a/public/ui/components/menus/SelectMenu.test.js.map b/public/ui/components/menus/SelectMenu.test.js.map index ff1680554..7845d385b 100644 --- a/public/ui/components/menus/SelectMenu.test.js.map +++ b/public/ui/components/menus/SelectMenu.test.js.map @@ -1 +1 @@ -{"version":3,"file":"SelectMenu.test.js","sourceRoot":"","sources":["../../../../../../../front_end/ui/components/menus/SelectMenu.test.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,KAAK,OAAO,MAAM,gCAAgC,CAAC,CAAE,iDAAiD;AAC7G,OAAO,EACL,kBAAkB,GACnB,MAAM,wCAAwC,CAAC;AAChD,OAAO,KAAK,OAAO,MAAM,4BAA4B,CAAC;AACtD,OAAO,KAAK,OAAO,MAAM,uBAAuB,CAAC;AACjD,OAAO,KAAK,WAAW,MAAM,6CAA6C,CAAC;AAE3E,OAAO,KAAK,KAAK,MAAM,YAAY,CAAC;AAEpC,MAAM,EAAC,IAAI,EAAC,GAAG,OAAO,CAAC;AAEvB,MAAM,WAAW,GAAG,WAAW,CAAC,iBAAiB,CAAC,iBAAiB,CAAC,QAAQ,EAAE,CAAC;AAE/E,KAAK,UAAU,UAAU;IACvB,MAAM,SAAS,GAAG;QAChB;YACE,IAAI,EAAE,UAAU;YAChB,KAAK,EAAE,GAAG;YACV,KAAK,EAAE,EAAE;SACV;QACD;YACE,IAAI,EAAE,UAAU;YAChB,KAAK,EAAE,GAAG;YACV,KAAK,EAAE,EAAE;SACV;QACD;YACE,IAAI,EAAE,UAAU;YAChB,KAAK,EAAE,GAAG;YACV,KAAK,EAAE,EAAE;SACV;QACD;YACE,IAAI,EAAE,UAAU;YAChB,KAAK,EAAE,GAAG;YACV,KAAK,EAAE,EAAE;SACV;KACF,CAAC;IAEF,MAAM,IAAI,GAAG,IAAI,KAAK,CAAC,UAAU,CAAC,U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CAAC;QAC1E,CAAC,GAAG,UAAU,CAAC,gBAAgB,CAAC,oBAAoB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,GAAG,IAAI,CAAC;QAC1E,MAAM,CAAC,SAAS,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC;QACxC,MAAM,YAAY,GAAG,UAAU,CAAC,UAAU,CAAC,aAAa,CAAC,eAAe,CAAC,CAAC;QAC1E,MAAM,cAAc,GAAG,YAAY,EAAE,UAAU,EAAE,aAAa,CAAC,iBAAiB,CAAC,CAAC;QAClF,MAAM,cAAc,EAAE,gBAAgB,CAAC,IAAI,CAAC,CAAC;QAC7C,MAAM,aAAa,GAAG,CAAC,GAAG,UAAU,CAAC,gBAAgB,CAAC,oBAAoB,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAC3G,MAAM,CAAC,SAAS,CAAC,aAAa,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC,UAAU,EAAE,UAAU,CAAC,CAAC,CAAC;IACxF,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["// Copyright 2023 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport * as Helpers from '../../../testing/DOMHelpers.js'; // eslint-disable-line rulesdir/es-modules-import\nimport {\n describeWithLocale,\n} from '../../../testing/EnvironmentHelpers.js';\nimport * as LitHtml from '../../lit-html/lit-html.js';\nimport * as Dialogs from '../dialogs/dialogs.js';\nimport * as Coordinator from '../render_coordinator/render_coordinator.js';\n\nimport * as Menus from './menus.js';\n\nconst {html} = LitHtml;\n\nconst coordinator = Coordinator.RenderCoordinator.RenderCoordinator.instance();\n\nasync function createMenu(): Promise {\n const menuItems = [\n {\n name: 'Option 1',\n value: '1',\n group: '',\n },\n {\n name: 'Option 2',\n value: '2',\n group: '',\n },\n {\n name: 'Option 3',\n value: '3',\n group: '',\n },\n {\n name: 'Option 4',\n value: '4',\n group: '',\n },\n ];\n\n const menu = new Menus.SelectMenu.SelectMenu();\n menu.position = Dialogs.Dialog.DialogVerticalPosition.BOTTOM;\n menuItems.forEach(item => {\n const selectMenuItem = new Menus.Menu.MenuItem();\n selectMenuItem.value = item.value;\n selectMenuItem.textContent = item.name;\n menu.appendChild(selectMenuItem);\n });\n\n await coordinator.done();\n return menu;\n}\n\ndescribeWithLocale('SelectMenu', () => {\n it('will use the buttonTitle property if that is provided', async () => {\n const menu = await createMenu();\n const firsItem = menu.querySelector('devtools-menu-item');\n if (!firsItem) {\n assert.fail('No item was found.');\n return;\n }\n menu.buttonTitle = 'Override Title';\n Helpers.renderElementIntoDOM(menu);\n await coordinator.done();\n assert.isNotNull(menu.shadowRoot);\n const button = menu.shadowRoot.querySelector('devtools-select-menu-button');\n if (!button) {\n assert.fail('devtools-select-menu-button not found');\n return;\n }\n assert.instanceOf(button, HTMLElement);\n assert.strictEqual(button.innerText, 'Override Title');\n });\n\n it('allows the buttonTitle to be a function', async () => {\n const menu = await createMenu();\n const firsItem = menu.querySelector('devtools-menu-item');\n if (!firsItem) {\n assert.fail('No item was found.');\n return;\n }\n firsItem.selected = true;\n menu.buttonTitle = () => html`Override Title`;\n Helpers.renderElementIntoDOM(menu);\n await coordinator.done();\n assert.isNotNull(menu.shadowRoot);\n const button = menu.shadowRoot.querySelector('devtools-select-menu-button');\n if (!button) {\n assert.fail('devtools-select-menu-button not found');\n return;\n }\n assert.instanceOf(button, HTMLElement);\n assert.strictEqual(button.innerText, 'Override Title');\n });\n\n it('can render multiple options as selected at once', async () => {\n const selectMenu = await createMenu();\n Helpers.renderElementIntoDOM(selectMenu);\n [...selectMenu.querySelectorAll('devtools-menu-item')][0].selected = true;\n [...selectMenu.querySelectorAll('devtools-menu-item')][1].selected = true;\n assert.isNotNull(selectMenu.shadowRoot);\n const devtoolsMenu = selectMenu.shadowRoot.querySelector('devtools-menu');\n const devtoolsDialog = devtoolsMenu?.shadowRoot?.querySelector('devtools-dialog');\n await devtoolsDialog?.setDialogVisible(true);\n const selectedItems = [...selectMenu.querySelectorAll('devtools-menu-item')].filter(item => item.selected);\n assert.deepEqual(selectedItems.map(item => item.innerText), ['Option 1', 'Option 2']);\n });\n});\n"]} \ No newline at end of file +{"version":3,"file":"SelectMenu.test.js","sourceRoot":"","sources":["../../../../../../../front_end/ui/components/menus/SelectMenu.test.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,KAAK,OAAO,MAAM,gCAAgC,CAAC,CAAE,iDAAiD;AAC7G,OAAO,EACL,kBAAkB,GACnB,MAAM,wCAAwC,CAAC;AAChD,OAAO,KAAK,OAAO,MAAM,4BAA4B,CAAC;AACtD,OAAO,KAAK,OAAO,MAAM,uBAAuB,CAAC;AACjD,OAAO,KAAK,iBAAiB,MAAM,6CAA6C,CAAC;AAEjF,OAAO,KAAK,KAAK,MAAM,YAAY,CAAC;AAEpC,MAAM,EAAC,IAAI,EAAC,GAAG,OAAO,CAAC;AAEvB,KAAK,UAAU,UAAU;IACvB,MAAM,SAAS,GAAG;QAChB;YACE,IAAI,EAAE,UAAU;YAChB,KAAK,EAAE,GAAG;YACV,KAAK,EAAE,EAAE;SACV;QACD;YACE,IAAI,EAAE,UAAU;YAChB,KAAK,EAAE,GAAG;YACV,KAAK,EAAE,EAAE;SACV;QACD;YACE,IAAI,EAAE,UAAU;YAChB,KAAK,EAAE,GAAG;YACV,KAAK,EAAE,EAAE;SACV;QACD;YACE,IAAI,EAAE,UAAU;YAChB,KAAK,EAAE,GAAG;YACV,KAAK,EAAE,EAAE;SACV;KACF,CAAC;IAEF,MAAM,IAAI,GAAG,IAAI,KAAK,CAAC,UAAU,CAAC,UAAU,EAAE,CAAC;IAC/C,IAAI,CAAC,QAAQ,8DAA+C,CAAC;IAC7D,SAAS,CAAC,OAAO,CAAC,IAAI,C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AAC,CAAC,QAAQ,GAAG,IAAI,CAAC;QAC1E,MAAM,CAAC,SAAS,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC;QACxC,MAAM,YAAY,GAAG,UAAU,CAAC,UAAU,CAAC,aAAa,CAAC,eAAe,CAAC,CAAC;QAC1E,MAAM,cAAc,GAAG,YAAY,EAAE,UAAU,EAAE,aAAa,CAAC,iBAAiB,CAAC,CAAC;QAClF,MAAM,cAAc,EAAE,gBAAgB,CAAC,IAAI,CAAC,CAAC;QAC7C,MAAM,aAAa,GAAG,CAAC,GAAG,UAAU,CAAC,gBAAgB,CAAC,oBAAoB,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAC3G,MAAM,CAAC,SAAS,CAAC,aAAa,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC,UAAU,EAAE,UAAU,CAAC,CAAC,CAAC;IACxF,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["// Copyright 2023 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport * as Helpers from '../../../testing/DOMHelpers.js'; // eslint-disable-line rulesdir/es-modules-import\nimport {\n describeWithLocale,\n} from '../../../testing/EnvironmentHelpers.js';\nimport * as LitHtml from '../../lit-html/lit-html.js';\nimport * as Dialogs from '../dialogs/dialogs.js';\nimport * as RenderCoordinator from '../render_coordinator/render_coordinator.js';\n\nimport * as Menus from './menus.js';\n\nconst {html} = LitHtml;\n\nasync function createMenu(): Promise {\n const menuItems = [\n {\n name: 'Option 1',\n value: '1',\n group: '',\n },\n {\n name: 'Option 2',\n value: '2',\n group: '',\n },\n {\n name: 'Option 3',\n value: '3',\n group: '',\n },\n {\n name: 'Option 4',\n value: '4',\n group: '',\n },\n ];\n\n const menu = new Menus.SelectMenu.SelectMenu();\n menu.position = Dialogs.Dialog.DialogVerticalPosition.BOTTOM;\n menuItems.forEach(item => {\n const selectMenuItem = new Menus.Menu.MenuItem();\n selectMenuItem.value = item.value;\n selectMenuItem.textContent = item.name;\n menu.appendChild(selectMenuItem);\n });\n\n await RenderCoordinator.done();\n return menu;\n}\n\ndescribeWithLocale('SelectMenu', () => {\n it('will use the buttonTitle property if that is provided', async () => {\n const menu = await createMenu();\n const firsItem = menu.querySelector('devtools-menu-item');\n if (!firsItem) {\n assert.fail('No item was found.');\n return;\n }\n menu.buttonTitle = 'Override Title';\n Helpers.renderElementIntoDOM(menu);\n await RenderCoordinator.done();\n assert.isNotNull(menu.shadowRoot);\n const button = menu.shadowRoot.querySelector('devtools-select-menu-button');\n if (!button) {\n assert.fail('devtools-select-menu-button not found');\n return;\n }\n assert.instanceOf(button, HTMLElement);\n assert.strictEqual(button.innerText, 'Override Title');\n });\n\n it('allows the buttonTitle to be a function', async () => {\n const menu = await createMenu();\n const firsItem = menu.querySelector('devtools-menu-item');\n if (!firsItem) {\n assert.fail('No item was found.');\n return;\n }\n firsItem.selected = true;\n menu.buttonTitle = () => html`Override Title`;\n Helpers.renderElementIntoDOM(menu);\n await RenderCoordinator.done();\n assert.isNotNull(menu.shadowRoot);\n const button = menu.shadowRoot.querySelector('devtools-select-menu-button');\n if (!button) {\n assert.fail('devtools-select-menu-button not found');\n return;\n }\n assert.instanceOf(button, HTMLElement);\n assert.strictEqual(button.innerText, 'Override Title');\n });\n\n it('can render multiple options as selected at once', async () => {\n const selectMenu = await createMenu();\n Helpers.renderElementIntoDOM(selectMenu);\n [...selectMenu.querySelectorAll('devtools-menu-item')][0].selected = true;\n [...selectMenu.querySelectorAll('devtools-menu-item')][1].selected = true;\n assert.isNotNull(selectMenu.shadowRoot);\n const devtoolsMenu = selectMenu.shadowRoot.querySelector('devtools-menu');\n const devtoolsDialog = devtoolsMenu?.shadowRoot?.querySelector('devtools-dialog');\n await devtoolsDialog?.setDialogVisible(true);\n const selectedItems = [...selectMenu.querySelectorAll('devtools-menu-item')].filter(item => item.selected);\n assert.deepEqual(selectedItems.map(item => item.innerText), ['Option 1', 'Option 2']);\n });\n});\n"]} \ No newline at end of file diff --git a/public/ui/components/panel_feedback/FeedbackButton.test.js b/public/ui/components/panel_feedback/FeedbackButton.test.js index 002cc7183..853ee0da9 100644 --- a/public/ui/components/panel_feedback/FeedbackButton.test.js +++ b/public/ui/components/panel_feedback/FeedbackButton.test.js @@ -4,9 +4,8 @@ import * as Host from '../../../core/host/host.js'; import { dispatchClickEvent, renderElementIntoDOM, } from '../../../testing/DOMHelpers.js'; import { describeWithLocale } from '../../../testing/EnvironmentHelpers.js'; -import * as Coordinator from '../render_coordinator/render_coordinator.js'; +import * as RenderCoordinator from '../render_coordinator/render_coordinator.js'; import * as PanelFeedback from './panel_feedback.js'; -const coordinator = Coordinator.RenderCoordinator.RenderCoordinator.instance(); describeWithLocale('Feedback button', () => { it('calls out to the Host API to open the link in a new tab', async () => { const openInNewTabStub = sinon.stub(Host.InspectorFrontendHost.InspectorFrontendHostInstance, 'openInNewTab'); @@ -15,7 +14,7 @@ describeWithLocale('Feedback button', () => { feedbackUrl: 'https://feedbackurl.com', }; renderElementIntoDOM(component); - await coordinator.done(); + await RenderCoordinator.done(); const button = component.shadowRoot.querySelector('devtools-button'); assert.instanceOf(button, HTMLElement); dispatchClickEvent(button); diff --git a/public/ui/components/panel_feedback/FeedbackButton.test.js.map b/public/ui/components/panel_feedback/FeedbackButton.test.js.map index 1dc812748..a2c5f5afb 100644 --- a/public/ui/components/panel_feedback/FeedbackButton.test.js.map +++ b/public/ui/components/panel_feedback/FeedbackButton.test.js.map @@ -1 +1 @@ -{"version":3,"file":"FeedbackButton.test.js","sourceRoot":"","sources":["../../../../../../../front_end/ui/components/panel_feedback/FeedbackButton.test.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,KAAK,IAAI,MAAM,4BAA4B,CAAC;AAEnD,OAAO,EACL,kBAAkB,EAClB,oBAAoB,GACrB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAC,kBAAkB,EAAC,MAAM,wCAAwC,CAAC;AAC1E,OAAO,KAAK,WAAW,MAAM,6CAA6C,CAAC;AAE3E,OAAO,KAAK,aAAa,MAAM,qBAAqB,CAAC;AAErD,MAAM,WAAW,GAAG,WAAW,CAAC,iBAAiB,CAAC,iBAAiB,CAAC,QAAQ,EAAE,CAAC;AAE/E,kBAAkB,CAAC,iBAAiB,EAAE,GAAG,EAAE;IACzC,EAAE,CAAC,yDAAyD,EAAE,KAAK,IAAI,EAAE;QACvE,MAAM,gBAAgB,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,qBAAqB,CAAC,6BAA6B,EAAE,cAAc,CAAC,CAAC;QAC9G,MAAM,SAAS,GAAG,IAAI,aAAa,CAAC,cAAc,CAAC,cAAc,EAAE,CAAC;QACpE,SAAS,CAAC,IAAI,GAAG;YACf,WAAW,EAAE,yBAA4D;SAC1E,CAAC;QAEF,oBAAoB,CAAC,SAAS,CAAC,CAAC;QAChC,MAAM,WAAW,CAAC,IAAI,EAAE,CAAC;QACzB,MAAM,MAAM,GAAG,SAAS,CAAC,UAAW,CAAC,aAAa,CAAC,iBAAiB,CAAC,CAAC;QACtE,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;QACvC,kBAAkB,CAAC,MAAM,CAAC,CAAC;QAC3B,MAAM,CAAC,WAAW,CAAC,gBAAgB,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC;QAClD,MAAM,CAAC,MAAM,CACT,gBAAgB,CAAC,SAAS,CAAC,UAAU,CAAC,yBAA4D,CAAC,EACnG,oDAAoD,CAAC,CAAC;IAC5D,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["// Copyright 2021 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport * as Host from '../../../core/host/host.js';\nimport type * as Platform from '../../../core/platform/platform.js';\nimport {\n dispatchClickEvent,\n renderElementIntoDOM,\n} from '../../../testing/DOMHelpers.js';\nimport {describeWithLocale} from '../../../testing/EnvironmentHelpers.js';\nimport * as Coordinator from '../render_coordinator/render_coordinator.js';\n\nimport * as PanelFeedback from './panel_feedback.js';\n\nconst coordinator = Coordinator.RenderCoordinator.RenderCoordinator.instance();\n\ndescribeWithLocale('Feedback button', () => {\n it('calls out to the Host API to open the link in a new tab', async () => {\n const openInNewTabStub = sinon.stub(Host.InspectorFrontendHost.InspectorFrontendHostInstance, 'openInNewTab');\n const component = new PanelFeedback.FeedbackButton.FeedbackButton();\n component.data = {\n feedbackUrl: 'https://feedbackurl.com' as Platform.DevToolsPath.UrlString,\n };\n\n renderElementIntoDOM(component);\n await coordinator.done();\n const button = component.shadowRoot!.querySelector('devtools-button');\n assert.instanceOf(button, HTMLElement);\n dispatchClickEvent(button);\n assert.strictEqual(openInNewTabStub.callCount, 1);\n assert.isTrue(\n openInNewTabStub.firstCall.calledWith('https://feedbackurl.com' as Platform.DevToolsPath.UrlString),\n 'openInNewTab was not called with the expected URL.');\n });\n});\n"]} \ No newline at end of file +{"version":3,"file":"FeedbackButton.test.js","sourceRoot":"","sources":["../../../../../../../front_end/ui/components/panel_feedback/FeedbackButton.test.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,KAAK,IAAI,MAAM,4BAA4B,CAAC;AAEnD,OAAO,EACL,kBAAkB,EAClB,oBAAoB,GACrB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAC,kBAAkB,EAAC,MAAM,wCAAwC,CAAC;AAC1E,OAAO,KAAK,iBAAiB,MAAM,6CAA6C,CAAC;AAEjF,OAAO,KAAK,aAAa,MAAM,qBAAqB,CAAC;AAErD,kBAAkB,CAAC,iBAAiB,EAAE,GAAG,EAAE;IACzC,EAAE,CAAC,yDAAyD,EAAE,KAAK,IAAI,EAAE;QACvE,MAAM,gBAAgB,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,qBAAqB,CAAC,6BAA6B,EAAE,cAAc,CAAC,CAAC;QAC9G,MAAM,SAAS,GAAG,IAAI,aAAa,CAAC,cAAc,CAAC,cAAc,EAAE,CAAC;QACpE,SAAS,CAAC,IAAI,GAAG;YACf,WAAW,EAAE,yBAA4D;SAC1E,CAAC;QAEF,oBAAoB,CAAC,SAAS,CAAC,CAAC;QAChC,MAAM,iBAAiB,CAAC,IAAI,EAAE,CAAC;QAC/B,MAAM,MAAM,GAAG,SAAS,CAAC,UAAW,CAAC,aAAa,CAAC,iBAAiB,CAAC,CAAC;QACtE,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;QACvC,kBAAkB,CAAC,MAAM,CAAC,CAAC;QAC3B,MAAM,CAAC,WAAW,CAAC,gBAAgB,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC;QAClD,MAAM,CAAC,MAAM,CACT,gBAAgB,CAAC,SAAS,CAAC,UAAU,CAAC,yBAA4D,CAAC,EACnG,oDAAoD,CAAC,CAAC;IAC5D,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["// Copyright 2021 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport * as Host from '../../../core/host/host.js';\nimport type * as Platform from '../../../core/platform/platform.js';\nimport {\n dispatchClickEvent,\n renderElementIntoDOM,\n} from '../../../testing/DOMHelpers.js';\nimport {describeWithLocale} from '../../../testing/EnvironmentHelpers.js';\nimport * as RenderCoordinator from '../render_coordinator/render_coordinator.js';\n\nimport * as PanelFeedback from './panel_feedback.js';\n\ndescribeWithLocale('Feedback button', () => {\n it('calls out to the Host API to open the link in a new tab', async () => {\n const openInNewTabStub = sinon.stub(Host.InspectorFrontendHost.InspectorFrontendHostInstance, 'openInNewTab');\n const component = new PanelFeedback.FeedbackButton.FeedbackButton();\n component.data = {\n feedbackUrl: 'https://feedbackurl.com' as Platform.DevToolsPath.UrlString,\n };\n\n renderElementIntoDOM(component);\n await RenderCoordinator.done();\n const button = component.shadowRoot!.querySelector('devtools-button');\n assert.instanceOf(button, HTMLElement);\n dispatchClickEvent(button);\n assert.strictEqual(openInNewTabStub.callCount, 1);\n assert.isTrue(\n openInNewTabStub.firstCall.calledWith('https://feedbackurl.com' as Platform.DevToolsPath.UrlString),\n 'openInNewTab was not called with the expected URL.');\n });\n});\n"]} \ No newline at end of file diff --git a/public/ui/components/panel_feedback/PanelFeedback.test.js b/public/ui/components/panel_feedback/PanelFeedback.test.js index cec42c942..cf4f67893 100644 --- a/public/ui/components/panel_feedback/PanelFeedback.test.js +++ b/public/ui/components/panel_feedback/PanelFeedback.test.js @@ -3,9 +3,8 @@ // found in the LICENSE file. import { renderElementIntoDOM } from '../../../testing/DOMHelpers.js'; import { describeWithLocale } from '../../../testing/EnvironmentHelpers.js'; -import * as Coordinator from '../render_coordinator/render_coordinator.js'; +import * as RenderCoordinator from '../render_coordinator/render_coordinator.js'; import * as PanelFeedback from './panel_feedback.js'; -const coordinator = Coordinator.RenderCoordinator.RenderCoordinator.instance(); describeWithLocale('Panel Feedback', () => { async function renderFeedbackComponent() { const component = new PanelFeedback.PanelFeedback.PanelFeedback(); @@ -15,7 +14,7 @@ describeWithLocale('Panel Feedback', () => { quickStartLinkText: 'quick start link text', }; renderElementIntoDOM(component); - await coordinator.done(); + await RenderCoordinator.done(); return component; } it('uses the correct href for the feedback x-link', async () => { diff --git a/public/ui/components/panel_feedback/PanelFeedback.test.js.map b/public/ui/components/panel_feedback/PanelFeedback.test.js.map index a218e305c..f006e1afd 100644 --- a/public/ui/components/panel_feedback/PanelFeedback.test.js.map +++ b/public/ui/components/panel_feedback/PanelFeedback.test.js.map @@ -1 +1 @@ -{"version":3,"file":"PanelFeedback.test.js","sourceRoot":"","sources":["../../../../../../../front_end/ui/components/panel_feedback/PanelFeedback.test.ts"],"names":[],"mappings":"A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C;IAEH,EAAE,CAAC,kDAAkD,EAAE,KAAK,IAAI,EAAE;QAChE,MAAM,SAAS,GAAG,MAAM,uBAAuB,EAAE,CAAC;QAClD,MAAM,CAAC,SAAS,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC;QACvC,yEAAyE;QACzE,mEAAmE;QACnE,MAAM,SAAS,GAAG,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,gBAAgB,CAAoB,QAAQ,CAAC,CAAC,CAAC;QACjG,MAAM,eAAe,GAAG,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,SAAS,KAAK,uBAAuB,CAAC,CAAC;QAC3F,MAAM,CAAC,WAAW,CAAC,eAAe,EAAE,IAAI,EAAE,4BAA4B,CAAC,CAAC;IAC1E,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["// Copyright 2021 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport type * as Platform from '../../../core/platform/platform.js';\nimport {renderElementIntoDOM} from '../../../testing/DOMHelpers.js';\nimport {describeWithLocale} from '../../../testing/EnvironmentHelpers.js';\nimport * as Coordinator from '../render_coordinator/render_coordinator.js';\n\nimport * as PanelFeedback from './panel_feedback.js';\n\nconst coordinator = Coordinator.RenderCoordinator.RenderCoordinator.instance();\n\ndescribeWithLocale('Panel Feedback', () => {\n async function renderFeedbackComponent(): Promise {\n const component = new PanelFeedback.PanelFeedback.PanelFeedback();\n component.data = {\n feedbackUrl: 'https://feedbackurl.com' as Platform.DevToolsPath.UrlString,\n quickStartUrl: 'https://quickstarturl.com' as Platform.DevToolsPath.UrlString,\n quickStartLinkText: 'quick start link text',\n };\n\n renderElementIntoDOM(component);\n await coordinator.done();\n return component;\n }\n\n it('uses the correct href for the feedback x-link', async () => {\n const component = await renderFeedbackComponent();\n assert.isNotNull(component.shadowRoot);\n // Note that whilst they aren't HTMLAnchorElements, it is good enough for\n // this test as all we need is a type that has an `href` attribute.\n const allXLinks = Array.from(component.shadowRoot.querySelectorAll('x-link'));\n const feedbackXLink = allXLinks.find(link => link.innerText === 'Send us your feedback.');\n assert.strictEqual(feedbackXLink?.href, 'https://feedbackurl.com/');\n });\n\n it('uses the correct href for the quick start x-link', async () => {\n const component = await renderFeedbackComponent();\n assert.isNotNull(component.shadowRoot);\n // Note that whilst they aren't HTMLAnchorElements, it is good enough for\n // this test as all we need is a type that has an `href` attribute.\n const allXLinks = Array.from(component.shadowRoot.querySelectorAll('x-link'));\n const quickstartXLink = allXLinks.find(link => link.innerText === 'quick start link text');\n assert.strictEqual(quickstartXLink?.href, 'https://quickstarturl.com/');\n });\n});\n"]} \ No newline at end of file +{"version":3,"file":"PanelFeedback.test.js","sourceRoot":"","sources":["../../../../../../../front_end/ui/components/panel_feedback/PanelFeedback.test.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAG7B,OAAO,EAAC,oBAAoB,EAAC,MAAM,gCAAgC,CAAC;AACpE,OAAO,EAAC,kBAAkB,EAAC,MAAM,wCAAwC,CAAC;AAC1E,OAAO,KAAK,iBAAiB,MAAM,6CAA6C,CAAC;AAEjF,OAAO,KAAK,aAAa,MAAM,qBAAqB,CAAC;AAErD,kBAAkB,CAAC,gBAAgB,EAAE,GAAG,EAAE;IACxC,KAAK,UAAU,uBAAuB;QACpC,MAAM,SAAS,GAAG,IAAI,aAAa,CAAC,aAAa,CAAC,aAAa,EAAE,CAAC;QAClE,SAAS,CAAC,IAAI,GAAG;YACf,WAAW,EAAE,yBAA4D;YACzE,aAAa,EAAE,2BAA8D;YAC7E,kBAAkB,EAAE,uBAAuB;SAC5C,CAAC;QAEF,oBAAoB,CAAC,SAAS,CAAC,CAAC;QAChC,MAAM,iBAAiB,CAAC,IAAI,EAAE,CAAC;QAC/B,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,EAAE,CAAC,+CAA+C,EAAE,KAAK,IAAI,EAAE;QAC7D,MAAM,SAAS,GAAG,MAAM,uBAAuB,EAAE,CAAC;QAClD,MAAM,CAAC,SAAS,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC;QACvC,yEAAyE;QACzE,mEAAmE;QACnE,MAAM,SAAS,GAAG,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,gBAAgB,CAAoB,QAAQ,CAAC,CAAC,CAAC;QACjG,MAAM,aAAa,GAAG,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,SAAS,KAAK,wBAAwB,CAAC,CAAC;QAC1F,MAAM,CAAC,WAAW,CAAC,aAAa,EAAE,IAAI,EAAE,0BAA0B,CAAC,CAAC;IACtE,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,kDAAkD,EAAE,KAAK,IAAI,EAAE;QAChE,MAAM,SAAS,GAAG,MAAM,uBAAuB,EAAE,CAAC;QAClD,MAAM,CAAC,SAAS,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC;QACvC,yEAAyE;QACzE,mEAAmE;QACnE,MAAM,SAAS,GAAG,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,gBAAgB,CAAoB,QAAQ,CAAC,CAAC,CAAC;QACjG,MAAM,eAAe,GAAG,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,SAAS,KAAK,uBAAuB,CAAC,CAAC;QAC3F,MAAM,CAAC,WAAW,CAAC,eAAe,EAAE,IAAI,EAAE,4BAA4B,CAAC,CAAC;IAC1E,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["// Copyright 2021 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport type * as Platform from '../../../core/platform/platform.js';\nimport {renderElementIntoDOM} from '../../../testing/DOMHelpers.js';\nimport {describeWithLocale} from '../../../testing/EnvironmentHelpers.js';\nimport * as RenderCoordinator from '../render_coordinator/render_coordinator.js';\n\nimport * as PanelFeedback from './panel_feedback.js';\n\ndescribeWithLocale('Panel Feedback', () => {\n async function renderFeedbackComponent(): Promise {\n const component = new PanelFeedback.PanelFeedback.PanelFeedback();\n component.data = {\n feedbackUrl: 'https://feedbackurl.com' as Platform.DevToolsPath.UrlString,\n quickStartUrl: 'https://quickstarturl.com' as Platform.DevToolsPath.UrlString,\n quickStartLinkText: 'quick start link text',\n };\n\n renderElementIntoDOM(component);\n await RenderCoordinator.done();\n return component;\n }\n\n it('uses the correct href for the feedback x-link', async () => {\n const component = await renderFeedbackComponent();\n assert.isNotNull(component.shadowRoot);\n // Note that whilst they aren't HTMLAnchorElements, it is good enough for\n // this test as all we need is a type that has an `href` attribute.\n const allXLinks = Array.from(component.shadowRoot.querySelectorAll('x-link'));\n const feedbackXLink = allXLinks.find(link => link.innerText === 'Send us your feedback.');\n assert.strictEqual(feedbackXLink?.href, 'https://feedbackurl.com/');\n });\n\n it('uses the correct href for the quick start x-link', async () => {\n const component = await renderFeedbackComponent();\n assert.isNotNull(component.shadowRoot);\n // Note that whilst they aren't HTMLAnchorElements, it is good enough for\n // this test as all we need is a type that has an `href` attribute.\n const allXLinks = Array.from(component.shadowRoot.querySelectorAll('x-link'));\n const quickstartXLink = allXLinks.find(link => link.innerText === 'quick start link text');\n assert.strictEqual(quickstartXLink?.href, 'https://quickstarturl.com/');\n });\n});\n"]} \ No newline at end of file diff --git a/public/ui/components/panel_feedback/PreviewToggle.test.js b/public/ui/components/panel_feedback/PreviewToggle.test.js index 97156ae26..e206acf54 100644 --- a/public/ui/components/panel_feedback/PreviewToggle.test.js +++ b/public/ui/components/panel_feedback/PreviewToggle.test.js @@ -4,9 +4,8 @@ import * as Root from '../../../core/root/root.js'; import { dispatchClickEvent, renderElementIntoDOM, } from '../../../testing/DOMHelpers.js'; import { describeWithLocale } from '../../../testing/EnvironmentHelpers.js'; -import * as Coordinator from '../render_coordinator/render_coordinator.js'; +import * as RenderCoordinator from '../render_coordinator/render_coordinator.js'; import * as PanelFeedback from './panel_feedback.js'; -const coordinator = Coordinator.RenderCoordinator.RenderCoordinator.instance(); describeWithLocale('Preview toggle', () => { it('calls out correctly to enable experiment', async () => { const isEnabledStub = sinon.stub(Root.Runtime.experiments, 'isEnabled'); @@ -23,7 +22,7 @@ describeWithLocale('Preview toggle', () => { onChangeCallback: spy, }; renderElementIntoDOM(component); - await coordinator.done(); + await RenderCoordinator.done(); assert.isNotNull(component.shadowRoot); const input = component.shadowRoot.querySelector('input'); assert.instanceOf(input, HTMLElement); @@ -31,7 +30,7 @@ describeWithLocale('Preview toggle', () => { assert.strictEqual(setEnabledStub.callCount, 1); assert.isTrue(setEnabledStub.firstCall.calledWith('testExperiment', true), 'experiments.setEnabled was not called with the correct experiment'); assert.strictEqual(spy.callCount, 1); - assert.strictEqual(spy.firstCall.firstArg, true); + assert.isTrue(spy.firstCall.firstArg); }); it('calls out correctly to disable experiment', async () => { const isEnabledStub = sinon.stub(Root.Runtime.experiments, 'isEnabled'); @@ -48,14 +47,14 @@ describeWithLocale('Preview toggle', () => { onChangeCallback: spy, }; renderElementIntoDOM(component); - await coordinator.done(); + await RenderCoordinator.done(); const input = component.shadowRoot.querySelector('input'); assert.instanceOf(input, HTMLElement); dispatchClickEvent(input); assert.strictEqual(setEnabledStub.callCount, 1); assert.isTrue(setEnabledStub.firstCall.calledWith('testExperiment', false), 'experiments.setEnabled was not called with the correct experiment'); assert.strictEqual(spy.callCount, 1); - assert.strictEqual(spy.firstCall.firstArg, false); + assert.isFalse(spy.firstCall.firstArg); }); }); //# sourceMappingURL=PreviewToggle.test.js.map \ No newline at end of file diff --git a/public/ui/components/panel_feedback/PreviewToggle.test.js.map b/public/ui/components/panel_feedback/PreviewToggle.test.js.map index ea4fa904c..e31d6de6c 100644 --- a/public/ui/components/panel_feedback/PreviewToggle.test.js.map +++ b/public/ui/components/panel_feedback/PreviewToggle.test.js.map @@ -1 +1 @@ -{"version":3,"file":"PreviewTo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YACnB,UAAU,EAAE,wBAAwB;YACpC,WAAW,EAAE,yBAAyB;YACtC,UAAU,EAAE,gBAA+C;YAC3D,gBAAgB,EAAE,GAAG;SACtB,CAAC;QAEF,oBAAoB,CAAC,SAAS,CAAC,CAAC;QAChC,MAAM,WAAW,CAAC,IAAI,EAAE,CAAC;QAEzB,MAAM,KAAK,GAAG,SAAS,CAAC,UAAW,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;QAC3D,MAAM,CAAC,UAAU,CAAC,KAAK,EAAE,WAAW,CAAC,CAAC;QACtC,kBAAkB,CAAC,KAAK,CAAC,CAAC;QAC1B,MAAM,CAAC,WAAW,CAAC,cAAc,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC;QAChD,MAAM,CAAC,MAAM,CACT,cAAc,CAAC,SAAS,CAAC,UAAU,CAAC,gBAAgB,EAAE,KAAK,CAAC,EAC5D,mEAAmE,CAAC,CAAC;QACzE,MAAM,CAAC,WAAW,CAAC,GAAG,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC;QACrC,MAAM,CAAC,WAAW,CAAC,GAAG,CAAC,SAAS,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC;IACpD,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["// Copyright 2021 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport * as Root from '../../../core/root/root.js';\nimport {\n dispatchClickEvent,\n renderElementIntoDOM,\n} from '../../../testing/DOMHelpers.js';\nimport {describeWithLocale} from '../../../testing/EnvironmentHelpers.js';\nimport * as Coordinator from '../render_coordinator/render_coordinator.js';\n\nimport * as PanelFeedback from './panel_feedback.js';\n\nconst coordinator = Coordinator.RenderCoordinator.RenderCoordinator.instance();\n\ndescribeWithLocale('Preview toggle', () => {\n it('calls out correctly to enable experiment', async () => {\n const isEnabledStub = sinon.stub(Root.Runtime.experiments, 'isEnabled');\n isEnabledStub.callsFake(() => false);\n const setEnabledStub = sinon.stub(Root.Runtime.experiments, 'setEnabled');\n setEnabledStub.callsFake(() => {});\n const spy = sinon.spy();\n\n const component = new PanelFeedback.PreviewToggle.PreviewToggle();\n component.data = {\n name: 'toggle name',\n helperText: 'more about this toggle',\n feedbackURL: 'https://feedbackurl.com',\n experiment: 'testExperiment' as Root.Runtime.ExperimentName,\n onChangeCallback: spy,\n };\n\n renderElementIntoDOM(component);\n await coordinator.done();\n\n assert.isNotNull(component.shadowRoot);\n const input = component.shadowRoot.querySelector('input');\n assert.instanceOf(input, HTMLElement);\n dispatchClickEvent(input);\n assert.strictEqual(setEnabledStub.callCount, 1);\n assert.isTrue(\n setEnabledStub.firstCall.calledWith('testExperiment', true),\n 'experiments.setEnabled was not called with the correct experiment');\n assert.strictEqual(spy.callCount, 1);\n assert.strictEqual(spy.firstCall.firstArg, true);\n });\n\n it('calls out correctly to disable experiment', async () => {\n const isEnabledStub = sinon.stub(Root.Runtime.experiments, 'isEnabled');\n isEnabledStub.callsFake(() => true);\n const setEnabledStub = sinon.stub(Root.Runtime.experiments, 'setEnabled');\n setEnabledStub.callsFake(() => {});\n const spy = sinon.spy();\n\n const component = new PanelFeedback.PreviewToggle.PreviewToggle();\n component.data = {\n name: 'toggle name',\n helperText: 'more about this toggle',\n feedbackURL: 'https://feedbackurl.com',\n experiment: 'testExperiment' as Root.Runtime.ExperimentName,\n onChangeCallback: spy,\n };\n\n renderElementIntoDOM(component);\n await coordinator.done();\n\n const input = component.shadowRoot!.querySelector('input');\n assert.instanceOf(input, HTMLElement);\n dispatchClickEvent(input);\n assert.strictEqual(setEnabledStub.callCount, 1);\n assert.isTrue(\n setEnabledStub.firstCall.calledWith('testExperiment', false),\n 'experiments.setEnabled was not called with the correct experiment');\n assert.strictEqual(spy.callCount, 1);\n assert.strictEqual(spy.firstCall.firstArg, false);\n });\n});\n"]} \ No newline at end of file +{"version":3,"file":"PreviewToggle.test.js","sourceRoot":"","sources":["../../../../../../../front_end/ui/components/panel_feedback/Previ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AC,CAAC;QAChC,MAAM,iBAAiB,CAAC,IAAI,EAAE,CAAC;QAE/B,MAAM,KAAK,GAAG,SAAS,CAAC,UAAW,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;QAC3D,MAAM,CAAC,UAAU,CAAC,KAAK,EAAE,WAAW,CAAC,CAAC;QACtC,kBAAkB,CAAC,KAAK,CAAC,CAAC;QAC1B,MAAM,CAAC,WAAW,CAAC,cAAc,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC;QAChD,MAAM,CAAC,MAAM,CACT,cAAc,CAAC,SAAS,CAAC,UAAU,CAAC,gBAAgB,EAAE,KAAK,CAAC,EAC5D,mEAAmE,CAAC,CAAC;QACzE,MAAM,CAAC,WAAW,CAAC,GAAG,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC;QACrC,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC;IACzC,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["// Copyright 2021 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport * as Root from '../../../core/root/root.js';\nimport {\n dispatchClickEvent,\n renderElementIntoDOM,\n} from '../../../testing/DOMHelpers.js';\nimport {describeWithLocale} from '../../../testing/EnvironmentHelpers.js';\nimport * as RenderCoordinator from '../render_coordinator/render_coordinator.js';\n\nimport * as PanelFeedback from './panel_feedback.js';\n\ndescribeWithLocale('Preview toggle', () => {\n it('calls out correctly to enable experiment', async () => {\n const isEnabledStub = sinon.stub(Root.Runtime.experiments, 'isEnabled');\n isEnabledStub.callsFake(() => false);\n const setEnabledStub = sinon.stub(Root.Runtime.experiments, 'setEnabled');\n setEnabledStub.callsFake(() => {});\n const spy = sinon.spy();\n\n const component = new PanelFeedback.PreviewToggle.PreviewToggle();\n component.data = {\n name: 'toggle name',\n helperText: 'more about this toggle',\n feedbackURL: 'https://feedbackurl.com',\n experiment: 'testExperiment' as Root.Runtime.ExperimentName,\n onChangeCallback: spy,\n };\n\n renderElementIntoDOM(component);\n await RenderCoordinator.done();\n\n assert.isNotNull(component.shadowRoot);\n const input = component.shadowRoot.querySelector('input');\n assert.instanceOf(input, HTMLElement);\n dispatchClickEvent(input);\n assert.strictEqual(setEnabledStub.callCount, 1);\n assert.isTrue(\n setEnabledStub.firstCall.calledWith('testExperiment', true),\n 'experiments.setEnabled was not called with the correct experiment');\n assert.strictEqual(spy.callCount, 1);\n assert.isTrue(spy.firstCall.firstArg);\n });\n\n it('calls out correctly to disable experiment', async () => {\n const isEnabledStub = sinon.stub(Root.Runtime.experiments, 'isEnabled');\n isEnabledStub.callsFake(() => true);\n const setEnabledStub = sinon.stub(Root.Runtime.experiments, 'setEnabled');\n setEnabledStub.callsFake(() => {});\n const spy = sinon.spy();\n\n const component = new PanelFeedback.PreviewToggle.PreviewToggle();\n component.data = {\n name: 'toggle name',\n helperText: 'more about this toggle',\n feedbackURL: 'https://feedbackurl.com',\n experiment: 'testExperiment' as Root.Runtime.ExperimentName,\n onChangeCallback: spy,\n };\n\n renderElementIntoDOM(component);\n await RenderCoordinator.done();\n\n const input = component.shadowRoot!.querySelector('input');\n assert.instanceOf(input, HTMLElement);\n dispatchClickEvent(input);\n assert.strictEqual(setEnabledStub.callCount, 1);\n assert.isTrue(\n setEnabledStub.firstCall.calledWith('testExperiment', false),\n 'experiments.setEnabled was not called with the correct experiment');\n assert.strictEqual(spy.callCount, 1);\n assert.isFalse(spy.firstCall.firstArg);\n });\n});\n"]} \ No newline at end of file diff --git a/public/ui/components/render_coordinator/bundle-tsconfig.json b/public/ui/components/render_coordinator/bundle-tsconfig.json index 07e51cb46..9c8a0ea55 100644 --- a/public/ui/components/render_coordinator/bundle-tsconfig.json +++ b/public/ui/components/render_coordinator/bundle-tsconfig.json @@ -1 +1 @@ -{"compilerOptions":{"composite":true,"outDir":".","baseUrl":".","rootDir":"../../../../../../../front_end/ui/components/render_coordinator"},"files":["../../../../../../../front_end/ui/components/render_coordinator/render_coordinator.ts"],"references":[{"path":"./render_coordinator-tsconfig.json"}]} \ No newline at end of file +{"compilerOptions":{"composite":true,"outDir":".","baseUrl":".","rootDir":"../../../../../../../front_end/ui/components/render_coordinator"},"files":["../../../../../../../front_end/ui/components/render_coordinator/render_coordinator.ts"],"references":[{"path":"../../../core/platform/bundle-tsconfig.json"}]} \ No newline at end of file diff --git a/public/ui/components/render_coordinator/devtools_entrypoint-bundle-typescript-tsconfig.json b/public/ui/components/render_coordinator/devtools_entrypoint-bundle-typescript-tsconfig.json index fc4ee7724..299bc7d2d 100644 --- a/public/ui/components/render_coordinator/devtools_entrypoint-bundle-typescript-tsconfig.json +++ b/public/ui/components/render_coordinator/devtools_entrypoint-bundle-typescript-tsconfig.json @@ -37,7 +37,7 @@ ], "references": [ { - "path": "./render_coordinator-tsconfig.json" + "path": "../../../core/platform/bundle-tsconfig.json" } ] } \ No newline at end of file diff --git a/public/ui/components/render_coordinator/render_coordinator.d.ts b/public/ui/components/render_coordinator/render_coordinator.d.ts index 64451e4aa..9408cf509 100644 --- a/public/ui/components/render_coordinator/render_coordinator.d.ts +++ b/public/ui/components/render_coordinator/render_coordinator.d.ts @@ -1,2 +1,54 @@ -import * as RenderCoordinator from './RenderCoordinator.js'; -export { RenderCoordinator }; +export interface CoordinatorCallback { + (): T | PromiseLike; +} +export interface LoggingRecord { + time: number; + value: string; +} +export declare class RenderCoordinatorQueueEmptyEvent extends Event { + static readonly eventName = "renderqueueempty"; + constructor(); +} +export declare class RenderCoordinatorNewFrameEvent extends Event { + static readonly eventName = "newframe"; + constructor(); +} +export interface LoggingOptions { + onlyNamed?: boolean; + storageLimit?: number; +} +export declare function setLoggingEnabled(enabled: false): void; +export declare function setLoggingEnabled(enabled: true, options?: LoggingOptions): void; +export declare function hasPendingWork(): boolean; +export declare function done(options?: { + waitForWork: boolean; +}): Promise; +/** + * Schedules a 'read' job which is being executed within an animation frame + * before all 'write' jobs. If multiple jobs are scheduled with the same + * non-empty label, only the latest callback would be executed. Such + * invocations would return the same promise that will resolve to the value of + * the latest callback. + */ +export declare function read(callback: CoordinatorCallback): Promise; +export declare function read(label: string, callback: CoordinatorCallback): Promise; +/** + * Schedules a 'write' job which is being executed within an animation frame + * after all 'read' and 'scroll' jobs. If multiple jobs are scheduled with + * the same non-empty label, only the latest callback would be executed. Such + * invocations would return the same promise that will resolve when the latest callback is run. + */ +export declare function write(callback: CoordinatorCallback): Promise; +export declare function write(label: string, callback: CoordinatorCallback): Promise; +export declare function takeLoggingRecords(): LoggingRecord[]; +/** + * We offer a convenience function for scroll-based activity, but often triggering a scroll + * requires a layout pass, thus it is better handled as a read activity, i.e. we wait until + * the layout-triggering work has been completed then it should be possible to scroll without + * first forcing layout. If multiple jobs are scheduled with the same non-empty label, only + * the latest callback would be executed. Such invocations would return the same promise that + * will resolve when the latest callback is run. + */ +export declare function scroll(callback: CoordinatorCallback): Promise; +export declare function scroll(label: string, callback: CoordinatorCallback): Promise; +export declare function cancelPending(): void; diff --git a/public/ui/components/render_coordinator/render_coordinator.js b/public/ui/components/render_coordinator/render_coordinator.js index 1a62689f6..03f714a3f 100644 --- a/public/ui/components/render_coordinator/render_coordinator.js +++ b/public/ui/components/render_coordinator/render_coordinator.js @@ -1,6 +1,213 @@ // Copyright 2021 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import * as RenderCoordinator from './RenderCoordinator.js'; -export { RenderCoordinator }; +class WorkItem { + promise; + trigger; + cancel; + label; + handler; + constructor(label, handler) { + const { promise, resolve, reject } = Promise.withResolvers(); + this.promise = promise.then(() => this.handler()); + this.trigger = resolve; + this.cancel = reject; + this.label = label; + this.handler = handler; + } +} +export class RenderCoordinatorQueueEmptyEvent extends Event { + static eventName = 'renderqueueempty'; + constructor() { + super(RenderCoordinatorQueueEmptyEvent.eventName); + } +} +export class RenderCoordinatorNewFrameEvent extends Event { + static eventName = 'newframe'; + constructor() { + super(RenderCoordinatorNewFrameEvent.eventName); + } +} +let loggingEnabled = null; +const loggingRecords = []; +export function setLoggingEnabled(enabled, options = {}) { + if (enabled) { + loggingEnabled = { + onlyNamed: options.onlyNamed, + storageLimit: options.storageLimit, + }; + } + else { + loggingEnabled = null; + loggingRecords.length = 0; + } +} +const UNNAMED_READ = 'Unnamed read'; +const UNNAMED_WRITE = 'Unnamed write'; +const UNNAMED_SCROLL = 'Unnamed scroll'; +const DEADLOCK_TIMEOUT = 1500; +// eslint-disable-next-line @typescript-eslint/no-explicit-any +globalThis.__getRenderCoordinatorPendingFrames = function () { + return hasPendingWork() ? 1 : 0; +}; +let pendingReaders = []; +let pendingWriters = []; +let scheduledWorkId = 0; +export function hasPendingWork() { + return pendingReaders.length + pendingWriters.length !== 0; +} +export function done(options) { + if (!hasPendingWork() && !options?.waitForWork) { + logIfEnabled('[Queue empty]'); + return Promise.resolve(); + } + return new Promise(resolve => window.addEventListener(RenderCoordinatorQueueEmptyEvent.eventName, () => resolve(), { once: true })); +} +export async function read(labelOrCallback, callback) { + if (typeof labelOrCallback === 'string') { + if (!callback) { + throw new Error('Read called with label but no callback'); + } + return enqueueHandler("read" /* ACTION.READ */, labelOrCallback, callback); + } + return enqueueHandler("read" /* ACTION.READ */, UNNAMED_READ, labelOrCallback); +} +export async function write(labelOrCallback, callback) { + if (typeof labelOrCallback === 'string') { + if (!callback) { + throw new Error('Write called with label but no callback'); + } + return enqueueHandler("write" /* ACTION.WRITE */, labelOrCallback, callback); + } + return enqueueHandler("write" /* ACTION.WRITE */, UNNAMED_WRITE, labelOrCallback); +} +export function takeLoggingRecords() { + const logs = [...loggingRecords]; + loggingRecords.length = 0; + return logs; +} +export async function scroll(labelOrCallback, callback) { + if (typeof labelOrCallback === 'string') { + if (!callback) { + throw new Error('Scroll called with label but no callback'); + } + return enqueueHandler("read" /* ACTION.READ */, labelOrCallback, callback); + } + return enqueueHandler("read" /* ACTION.READ */, UNNAMED_SCROLL, labelOrCallback); +} +function enqueueHandler(action, label, callback) { + const hasName = ![UNNAMED_READ, UNNAMED_WRITE, UNNAMED_SCROLL].includes(label); + label = `${action === "read" /* ACTION.READ */ ? '[Read]' : '[Write]'}: ${label}`; + let workItems = null; + switch (action) { + case "read" /* ACTION.READ */: + workItems = pendingReaders; + break; + case "write" /* ACTION.WRITE */: + workItems = pendingWriters; + break; + default: + throw new Error(`Unknown action: ${action}`); + } + let workItem = hasName ? workItems.find(w => w.label === label) : undefined; + if (!workItem) { + workItem = new WorkItem(label, callback); + workItems.push(workItem); + } + else { + // We are always using the latest handler, so that we don't end up with a + // stale results. We are reusing the promise to avoid blocking the first invocation, when + // it is being "overridden" by another one. + workItem.handler = callback; + } + scheduleWork(); + return workItem.promise; +} +function scheduleWork() { + if (scheduledWorkId !== 0) { + return; + } + scheduledWorkId = requestAnimationFrame(async () => { + if (!hasPendingWork()) { + // All pending work has completed. + // The events dispatched below are mostly for testing contexts. + window.dispatchEvent(new RenderCoordinatorQueueEmptyEvent()); + logIfEnabled('[Queue empty]'); + scheduledWorkId = 0; + return; + } + window.dispatchEvent(new RenderCoordinatorNewFrameEvent()); + logIfEnabled('[New frame]'); + const readers = pendingReaders; + pendingReaders = []; + const writers = pendingWriters; + pendingWriters = []; + // Start with all the readers and allow them + // to proceed together. + for (const reader of readers) { + logIfEnabled(reader.label); + reader.trigger(); + } + // Wait for them all to be done. + try { + await Promise.race([ + Promise.all(readers.map(r => r.promise)), + new Promise((_, reject) => { + window.setTimeout(() => reject(new Error(`Readers took over ${DEADLOCK_TIMEOUT}ms. Possible deadlock?`)), DEADLOCK_TIMEOUT); + }), + ]); + } + catch (err) { + rejectAll(readers, err); + } + // Next do all the writers as a block. + for (const writer of writers) { + logIfEnabled(writer.label); + writer.trigger(); + } + // And wait for them to be done, too. + try { + await Promise.race([ + Promise.all(writers.map(w => w.promise)), + new Promise((_, reject) => { + window.setTimeout(() => reject(new Error(`Writers took over ${DEADLOCK_TIMEOUT}ms. Possible deadlock?`)), DEADLOCK_TIMEOUT); + }), + ]); + } + catch (err) { + rejectAll(writers, err); + } + // Since there may have been more work requested in + // the callback of a reader / writer, we attempt to schedule + // it at this point. + scheduledWorkId = 0; + scheduleWork(); + }); +} +function rejectAll(handlers, error) { + for (const handler of handlers) { + handler.cancel(error); + } +} +export function cancelPending() { + const error = new Error(); + rejectAll(pendingReaders, error); + rejectAll(pendingWriters, error); +} +function logIfEnabled(value) { + if (loggingEnabled === null) { + return; + } + if (loggingEnabled.onlyNamed) { + if (value.endsWith(UNNAMED_READ) || value.endsWith(UNNAMED_WRITE) || value.endsWith(UNNAMED_SCROLL)) { + return; + } + } + loggingRecords.push({ time: performance.now(), value }); + // Keep the log at the log size. + const loggingLimit = loggingEnabled.storageLimit ?? 100; + while (loggingRecords.length > loggingLimit) { + loggingRecords.shift(); + } +} //# sourceMappingURL=render_coordinator.js.map \ No newline at end of file diff --git a/public/ui/components/render_coordinator/render_coordinator.js.map b/public/ui/components/render_coordinator/render_coordinator.js.map index a942cc434..a98a9bd54 100644 --- a/public/ui/components/render_coordinator/render_coordinator.js.map +++ b/public/ui/components/render_coordinator/render_coordinator.js.map @@ -1 +1 @@ -{"version":3,"file":"render_coordinator.js","sourceRoot":"","sources":["../../../../../../../front_end/ui/components/render_coordinator/render_coordinator.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,KAAK,iBAAiB,MAAM,wBAAwB,CAAC;AAE5D,OAAO,EAAC,iBAAiB,EAAC,CAAC","sourcesContent":["// Copyright 2021 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport * as RenderCoordinator from './RenderCoordinator.js';\n\nexport {RenderCoordinator};\n"]} \ No newline at end of file +{"version":3,"file":"render_coordinator.js","sourceRoot":"","sources":["../../../../../../../front_end/ui/components/render_coordinator/render_coordinator.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAM7B,MAAM,QAAQ;IAC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AACH,CAAC","sourcesContent":["// Copyright 2021 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nexport interface CoordinatorCallback {\n (): T|PromiseLike;\n}\n\nclass WorkItem {\n readonly promise: Promise;\n readonly trigger: () => void;\n readonly cancel: (e: Error) => void;\n readonly label: string;\n handler: CoordinatorCallback;\n\n constructor(label: string, handler: CoordinatorCallback) {\n const {promise, resolve, reject} = Promise.withResolvers();\n this.promise = promise.then(() => this.handler());\n this.trigger = resolve;\n this.cancel = reject;\n this.label = label;\n this.handler = handler;\n }\n}\n\nexport interface LoggingRecord {\n time: number;\n value: string;\n}\n\nconst enum ACTION {\n READ = 'read',\n WRITE = 'write',\n}\n\nexport class RenderCoordinatorQueueEmptyEvent extends Event {\n static readonly eventName = 'renderqueueempty';\n constructor() {\n super(RenderCoordinatorQueueEmptyEvent.eventName);\n }\n}\n\nexport class RenderCoordinatorNewFrameEvent extends Event {\n static readonly eventName = 'newframe';\n constructor() {\n super(RenderCoordinatorNewFrameEvent.eventName);\n }\n}\n\nexport interface LoggingOptions {\n // If true, only log activity with an explicit label.\n // This does not affect logging frames or queue empty events.\n // Defaults to false.\n onlyNamed?: boolean;\n\n // Configurable log storage limit, defaults to 100.\n storageLimit?: number;\n}\n\nlet loggingEnabled: null|LoggingOptions = null;\nconst loggingRecords: LoggingRecord[] = [];\n\nexport function setLoggingEnabled(enabled: false): void;\nexport function setLoggingEnabled(enabled: true, options?: LoggingOptions): void;\nexport function setLoggingEnabled(enabled: boolean, options: LoggingOptions = {}): void {\n if (enabled) {\n loggingEnabled = {\n onlyNamed: options.onlyNamed,\n storageLimit: options.storageLimit,\n };\n } else {\n loggingEnabled = null;\n loggingRecords.length = 0;\n }\n}\n\nconst UNNAMED_READ = 'Unnamed read';\nconst UNNAMED_WRITE = 'Unnamed write';\nconst UNNAMED_SCROLL = 'Unnamed scroll';\nconst DEADLOCK_TIMEOUT = 1500;\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\n(globalThis as any).__getRenderCoordinatorPendingFrames = function(): number {\n return hasPendingWork() ? 1 : 0;\n};\n\nlet pendingReaders: WorkItem[] = [];\nlet pendingWriters: WorkItem[] = [];\nlet scheduledWorkId = 0;\n\nexport function hasPendingWork(): boolean {\n return pendingReaders.length + pendingWriters.length !== 0;\n}\n\nexport function done(options?: {waitForWork: boolean}): Promise {\n if (!hasPendingWork() && !options?.waitForWork) {\n logIfEnabled('[Queue empty]');\n return Promise.resolve();\n }\n return new Promise(\n resolve => window.addEventListener(RenderCoordinatorQueueEmptyEvent.eventName, () => resolve(), {once: true}));\n}\n\n/**\n * Schedules a 'read' job which is being executed within an animation frame\n * before all 'write' jobs. If multiple jobs are scheduled with the same\n * non-empty label, only the latest callback would be executed. Such\n * invocations would return the same promise that will resolve to the value of\n * the latest callback.\n */\nexport async function read(callback: CoordinatorCallback): Promise;\nexport async function read(label: string, callback: CoordinatorCallback): Promise;\nexport async function read(\n labelOrCallback: CoordinatorCallback|string, callback?: CoordinatorCallback): Promise {\n if (typeof labelOrCallback === 'string') {\n if (!callback) {\n throw new Error('Read called with label but no callback');\n }\n return enqueueHandler(ACTION.READ, labelOrCallback, callback);\n }\n\n return enqueueHandler(ACTION.READ, UNNAMED_READ, labelOrCallback);\n}\n\n/**\n * Schedules a 'write' job which is being executed within an animation frame\n * after all 'read' and 'scroll' jobs. If multiple jobs are scheduled with\n * the same non-empty label, only the latest callback would be executed. Such\n * invocations would return the same promise that will resolve when the latest callback is run.\n */\nexport async function write(callback: CoordinatorCallback): Promise;\nexport async function write(label: string, callback: CoordinatorCallback): Promise;\nexport async function write(\n labelOrCallback: CoordinatorCallback|string, callback?: CoordinatorCallback): Promise {\n if (typeof labelOrCallback === 'string') {\n if (!callback) {\n throw new Error('Write called with label but no callback');\n }\n return enqueueHandler(ACTION.WRITE, labelOrCallback, callback);\n }\n\n return enqueueHandler(ACTION.WRITE, UNNAMED_WRITE, labelOrCallback);\n}\n\nexport function takeLoggingRecords(): LoggingRecord[] {\n const logs = [...loggingRecords];\n loggingRecords.length = 0;\n return logs;\n}\n\n/**\n * We offer a convenience function for scroll-based activity, but often triggering a scroll\n * requires a layout pass, thus it is better handled as a read activity, i.e. we wait until\n * the layout-triggering work has been completed then it should be possible to scroll without\n * first forcing layout. If multiple jobs are scheduled with the same non-empty label, only\n * the latest callback would be executed. Such invocations would return the same promise that\n * will resolve when the latest callback is run.\n */\nexport async function scroll(callback: CoordinatorCallback): Promise;\nexport async function scroll(label: string, callback: CoordinatorCallback): Promise;\nexport async function scroll(\n labelOrCallback: CoordinatorCallback|string, callback?: CoordinatorCallback): Promise {\n if (typeof labelOrCallback === 'string') {\n if (!callback) {\n throw new Error('Scroll called with label but no callback');\n }\n return enqueueHandler(ACTION.READ, labelOrCallback, callback);\n }\n\n return enqueueHandler(ACTION.READ, UNNAMED_SCROLL, labelOrCallback);\n}\n\nfunction enqueueHandler(action: ACTION, label: string, callback: CoordinatorCallback): Promise {\n const hasName = ![UNNAMED_READ, UNNAMED_WRITE, UNNAMED_SCROLL].includes(label);\n label = `${action === ACTION.READ ? '[Read]' : '[Write]'}: ${label}`;\n\n let workItems = null;\n switch (action) {\n case ACTION.READ:\n workItems = pendingReaders;\n break;\n\n case ACTION.WRITE:\n workItems = pendingWriters;\n break;\n\n default:\n throw new Error(`Unknown action: ${action}`);\n }\n\n let workItem = hasName ? workItems.find(w => w.label === label) as WorkItem| undefined : undefined;\n if (!workItem) {\n workItem = new WorkItem(label, callback);\n workItems.push(workItem);\n } else {\n // We are always using the latest handler, so that we don't end up with a\n // stale results. We are reusing the promise to avoid blocking the first invocation, when\n // it is being \"overridden\" by another one.\n workItem.handler = callback;\n }\n\n scheduleWork();\n return workItem.promise;\n}\n\nfunction scheduleWork(): void {\n if (scheduledWorkId !== 0) {\n return;\n }\n\n scheduledWorkId = requestAnimationFrame(async () => {\n if (!hasPendingWork()) {\n // All pending work has completed.\n // The events dispatched below are mostly for testing contexts.\n window.dispatchEvent(new RenderCoordinatorQueueEmptyEvent());\n\n logIfEnabled('[Queue empty]');\n scheduledWorkId = 0;\n return;\n }\n\n window.dispatchEvent(new RenderCoordinatorNewFrameEvent());\n logIfEnabled('[New frame]');\n\n const readers = pendingReaders;\n pendingReaders = [];\n const writers = pendingWriters;\n pendingWriters = [];\n\n // Start with all the readers and allow them\n // to proceed together.\n for (const reader of readers) {\n logIfEnabled(reader.label);\n reader.trigger();\n }\n\n // Wait for them all to be done.\n try {\n await Promise.race([\n Promise.all(readers.map(r => r.promise)),\n new Promise((_, reject) => {\n window.setTimeout(\n () => reject(new Error(`Readers took over ${DEADLOCK_TIMEOUT}ms. Possible deadlock?`)), DEADLOCK_TIMEOUT);\n }),\n ]);\n } catch (err) {\n rejectAll(readers, err);\n }\n\n // Next do all the writers as a block.\n for (const writer of writers) {\n logIfEnabled(writer.label);\n writer.trigger();\n }\n\n // And wait for them to be done, too.\n try {\n await Promise.race([\n Promise.all(writers.map(w => w.promise)),\n new Promise((_, reject) => {\n window.setTimeout(\n () => reject(new Error(`Writers took over ${DEADLOCK_TIMEOUT}ms. Possible deadlock?`)), DEADLOCK_TIMEOUT);\n }),\n ]);\n } catch (err) {\n rejectAll(writers, err);\n }\n\n // Since there may have been more work requested in\n // the callback of a reader / writer, we attempt to schedule\n // it at this point.\n scheduledWorkId = 0;\n scheduleWork();\n });\n}\n\nfunction rejectAll(handlers: WorkItem[], error: Error): void {\n for (const handler of handlers) {\n handler.cancel(error);\n }\n}\n\nexport function cancelPending(): void {\n const error = new Error();\n rejectAll(pendingReaders, error);\n rejectAll(pendingWriters, error);\n}\n\nfunction logIfEnabled(value: string): void {\n if (loggingEnabled === null) {\n return;\n }\n if (loggingEnabled.onlyNamed) {\n if (value.endsWith(UNNAMED_READ) || value.endsWith(UNNAMED_WRITE) || value.endsWith(UNNAMED_SCROLL)) {\n return;\n }\n }\n\n loggingRecords.push({time: performance.now(), value});\n\n // Keep the log at the log size.\n const loggingLimit = loggingEnabled.storageLimit ?? 100;\n while (loggingRecords.length > loggingLimit) {\n loggingRecords.shift();\n }\n}\n"]} \ No newline at end of file diff --git a/public/ui/components/render_coordinator/render_coordinator.test.js b/public/ui/components/render_coordinator/render_coordinator.test.js index 3c8e1efca..f5445b5b7 100644 --- a/public/ui/components/render_coordinator/render_coordinator.test.js +++ b/public/ui/components/render_coordinator/render_coordinator.test.js @@ -2,17 +2,18 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. import * as RenderCoordinator from './render_coordinator.js'; -describe('Render Coordinator', () => { - let coordinator; - beforeEach(() => { - coordinator = RenderCoordinator.RenderCoordinator.RenderCoordinator.instance({ forceNew: true }); - coordinator.observe = true; - }); +describe('RenderCoordinator', () => { async function validateRecords(expected) { - await coordinator.done(); - const records = coordinator.takeRecords(); + await RenderCoordinator.done(); + const records = RenderCoordinator.takeLoggingRecords(); assert.deepEqual(records.map(r => r.value), expected, 'render coordinator messages are out of order'); } + beforeEach(() => { + RenderCoordinator.setLoggingEnabled(true); + }); + afterEach(() => { + RenderCoordinator.setLoggingEnabled(false); + }); it('groups interleaved reads and writes', async () => { const expected = [ '[New frame]', @@ -23,11 +24,11 @@ describe('Render Coordinator', () => { '[Write]: Write 2', '[Queue empty]', ]; - void coordinator.write('Write 1', () => { }); - void coordinator.read('Read 1', () => { }); - void coordinator.read('Read 2', () => { }); - void coordinator.write('Write 2', () => { }); - void coordinator.read('Read 3', () => { }); + void RenderCoordinator.write('Write 1', () => { }); + void RenderCoordinator.read('Read 1', () => { }); + void RenderCoordinator.read('Read 2', () => { }); + void RenderCoordinator.write('Write 2', () => { }); + void RenderCoordinator.read('Read 3', () => { }); await validateRecords(expected); }); it('deduplicates named tasks', async () => { @@ -39,12 +40,11 @@ describe('Render Coordinator', () => { '[Write]: Unnamed write', '[Queue empty]', ]; - coordinator.observeOnlyNamed = false; - void coordinator.read('Named Read', () => { }); - void coordinator.write(() => { }); - void coordinator.write('Named Write', () => { }); - void coordinator.write(() => { }); - void coordinator.write('Named Write', () => { }); + void RenderCoordinator.read('Named Read', () => { }); + void RenderCoordinator.write(() => { }); + void RenderCoordinator.write('Named Write', () => { }); + void RenderCoordinator.write(() => { }); + void RenderCoordinator.write('Named Write', () => { }); await validateRecords(expected); }); it('handles nested reads and writes', async () => { @@ -60,14 +60,14 @@ describe('Render Coordinator', () => { '[Write]: Write 3', '[Queue empty]', ]; - void coordinator.read('Read 1', () => { - void coordinator.write('Write 1', () => { }); + void RenderCoordinator.read('Read 1', () => { + void RenderCoordinator.write('Write 1', () => { }); }); - void coordinator.read('Read 2', () => { - void coordinator.write('Write 2', () => { - void coordinator.write('Write 3', () => { }); + void RenderCoordinator.read('Read 2', () => { + void RenderCoordinator.write('Write 2', () => { + void RenderCoordinator.write('Write 3', () => { }); }); - void coordinator.read('Read 3', () => { }); + void RenderCoordinator.read('Read 3', () => { }); }); await validateRecords(expected); }); @@ -79,21 +79,21 @@ describe('Render Coordinator', () => { '[Write]: Write at end', '[Queue empty]', ]; - void coordinator.read('Read', () => { + void RenderCoordinator.read('Read', () => { // This write is added when we are evaluating the last item in the queue, // and it should be enqueued correctly for the test to pass. - void coordinator.write('Write at end', () => { }); + void RenderCoordinator.write('Write at end', () => { }); }); - await coordinator.done(); - const records = coordinator.takeRecords(); + await RenderCoordinator.done(); + const records = RenderCoordinator.takeLoggingRecords(); assert.deepEqual(records.map(r => r.value), expected); }); it('returns values', async () => { const element = document.createElement('div'); element.style.height = '800px'; document.body.appendChild(element); - const height = await coordinator.read(() => element.clientHeight); - await coordinator.done(); + const height = await RenderCoordinator.read(() => element.clientHeight); + await RenderCoordinator.done(); element.remove(); assert.strictEqual(height, 800); }); @@ -106,48 +106,48 @@ describe('Render Coordinator', () => { resolve(); }, timeout)); }; - void coordinator.write(async () => delayedSet(expected, 100)); - await coordinator.done(); + void RenderCoordinator.write(async () => delayedSet(expected, 100)); + await RenderCoordinator.done(); assert.strictEqual(targetValue, expected); }); it('throws if there is a read-write deadlock (blocked on read)', async () => { const read = () => { }; try { - await coordinator.write(async () => { + await RenderCoordinator.write(async () => { // Awaiting a read block within a write should block because // this write can't proceed until the read has completed, but // the read won't start until this write has completed. - await coordinator.read(read); + await RenderCoordinator.read(read); }); } catch (err) { assert.strictEqual(err.toString(), new Error('Writers took over 1500ms. Possible deadlock?').toString()); } - coordinator.cancelPending(); + RenderCoordinator.cancelPending(); }); it('throws if there is a write deadlock (blocked on write)', async () => { const write = () => { }; try { - await coordinator.read(async () => { + await RenderCoordinator.read(async () => { // Awaiting a write block within a read should block because // this read can't proceed until the write has completed, but // the write won't start until this read has completed. - await coordinator.write(write); + await RenderCoordinator.write(write); }); } catch (err) { assert.strictEqual(err.toString(), new Error('Readers took over 1500ms. Possible deadlock?').toString()); } - coordinator.cancelPending(); + RenderCoordinator.cancelPending(); }); it('exposes the presence of pending work', async () => { - const readDonePromise = coordinator.read('Named Read', () => { }); - assert.isTrue(coordinator.hasPendingWork()); + const readDonePromise = RenderCoordinator.read('Named Read', () => { }); + assert.isTrue(RenderCoordinator.hasPendingWork()); await readDonePromise; - assert.isFalse(coordinator.hasPendingWork()); + assert.isFalse(RenderCoordinator.hasPendingWork()); }); it('exposes the pending work count globally for interaction/e2e tests', async () => { - const readDonePromise = coordinator.read('Named Read', () => { }); + const readDonePromise = RenderCoordinator.read('Named Read', () => { }); // eslint-disable-next-line @typescript-eslint/no-explicit-any assert.strictEqual(globalThis.__getRenderCoordinatorPendingFrames(), 1); await readDonePromise; @@ -156,13 +156,14 @@ describe('Render Coordinator', () => { }); describe('Logger', () => { it('only logs by default when provided with names', async () => { + RenderCoordinator.setLoggingEnabled(true, { onlyNamed: true }); const expected = [ '[New frame]', '[Read]: Named Read', '[Queue empty]', ]; - void coordinator.read('Named Read', () => { }); - void coordinator.write(() => { }); + void RenderCoordinator.read('Named Read', () => { }); + void RenderCoordinator.write(() => { }); await validateRecords(expected); }); it('allow logging of unnamed tasks', async () => { @@ -172,9 +173,8 @@ describe('Render Coordinator', () => { '[Write]: Unnamed write', '[Queue empty]', ]; - coordinator.observeOnlyNamed = false; - void coordinator.read('Named Read', () => { }); - void coordinator.write(() => { }); + void RenderCoordinator.read('Named Read', () => { }); + void RenderCoordinator.write(() => { }); await validateRecords(expected); }); it('tracks only the last 100 items', async () => { @@ -184,19 +184,19 @@ describe('Render Coordinator', () => { } expected.push('[Queue empty]'); for (let i = 0; i < 150; i++) { - void coordinator.read(`Named read ${i}`, () => { }); + void RenderCoordinator.read(`Named read ${i}`, () => { }); } await validateRecords(expected); }); it('supports different log sizes', async () => { - coordinator.recordStorageLimit = 10; + RenderCoordinator.setLoggingEnabled(true, { storageLimit: 10 }); const expected = []; for (let i = 41; i < 50; i++) { expected.push(`[Write]: Named write ${i}`); } expected.push('[Queue empty]'); for (let i = 0; i < 50; i++) { - void coordinator.write(`Named write ${i}`, () => { }); + void RenderCoordinator.write(`Named write ${i}`, () => { }); } await validateRecords(expected); }); diff --git a/public/ui/components/render_coordinator/render_coordinator.test.js.map b/public/ui/components/render_coordinator/render_coordinator.test.js.map index 94bbe7aef..53a980448 100644 --- a/public/ui/components/render_coordinator/render_coordinator.test.js.map +++ b/public/ui/components/render_coordinator/render_coordinator.test.js.map @@ -1 +1 @@ -{"version":3,"file":"render_coordinator.test.js","sourceRoot":"","sources":["../../../../../../../front_end/ui/components/render_coordinator/render_coordinator.test.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,KAAK,iBAAiB,MAAM,yBAAyB,CAAC;AAE7D,QAAQ,CAAC,oBAAoB,EAAE,GAAG,EAAE;IAClC,IAAI,WAAkE,CAAC;IACvE,UAAU,CAAC,GAAG,EAAE;QACd,WAAW,GAAG,iBAAiB,CAAC,iBAAiB,CAAC,iBAAiB,CAAC,QAAQ,CAAC,EAAC,QAAQ,EAAE,IAAI,EAAC,CAAC,CAAC;QAC/F,WAAW,CAAC,OAAO,GAAG,IAAI,CAAC;IAC7B,CAAC,CAAC,CAAC;IAEH,KAAK,UAAU,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;YAC5C,WAAW,CAAC,kBAAkB,GAAG,EAAE,CAAC;YACpC,MAAM,QAAQ,GAAG,EAAE,CAAC;YACpB,KAAK,IAAI,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC;gBAC7B,QAAQ,CAAC,IAAI,CAAC,wBAAwB,CAAC,EAAE,CAAC,CAAC;YAC7C,CAAC;YACD,QAAQ,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;YAE/B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC;gBAC5B,KAAK,WAAW,CAAC,KAAK,CAAC,eAAe,CAAC,EAAE,EAAE,GAAG,EAAE,GAAE,CAAC,CAAC,CAAC;YACvD,CAAC;YAED,MAAM,eAAe,CAAC,QAAQ,CAAC,CAAC;QAClC,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["// Copyright 2019 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport * as RenderCoordinator from './render_coordinator.js';\n\ndescribe('Render Coordinator', () => {\n let coordinator: RenderCoordinator.RenderCoordinator.RenderCoordinator;\n beforeEach(() => {\n coordinator = RenderCoordinator.RenderCoordinator.RenderCoordinator.instance({forceNew: true});\n coordinator.observe = true;\n });\n\n async function validateRecords(expected: string[]) {\n await coordinator.done();\n const records = coordinator.takeRecords();\n assert.deepEqual(records.map(r => r.value), expected, 'render coordinator messages are out of order');\n }\n\n it('groups interleaved reads and writes', async () => {\n const expected = [\n '[New frame]',\n '[Read]: Read 1',\n '[Read]: Read 2',\n '[Read]: Read 3',\n '[Write]: Write 1',\n '[Write]: Write 2',\n '[Queue empty]',\n ];\n\n void coordinator.write('Write 1', () => {});\n void coordinator.read('Read 1', () => {});\n void coordinator.read('Read 2', () => {});\n void coordinator.write('Write 2', () => {});\n void coordinator.read('Read 3', () => {});\n\n await validateRecords(expected);\n });\n\n it('deduplicates named tasks', async () => {\n const expected = [\n '[New frame]',\n '[Read]: Named Read',\n '[Write]: Unnamed write',\n '[Write]: Named Write',\n '[Write]: Unnamed write',\n '[Queue empty]',\n ];\n\n coordinator.observeOnlyNamed = false;\n void coordinator.read('Named Read', () => {});\n void coordinator.write(() => {});\n void coordinator.write('Named Write', () => {});\n void coordinator.write(() => {});\n void coordinator.write('Named Write', () => {});\n\n await validateRecords(expected);\n });\n\n it('handles nested reads and writes', async () => {\n const expected = [\n '[New frame]',\n '[Read]: Read 1',\n '[Read]: Read 2',\n '[New frame]',\n '[Read]: Read 3',\n '[Write]: Write 1',\n '[Write]: Write 2',\n '[New frame]',\n '[Write]: Write 3',\n '[Queue empty]',\n ];\n\n void coordinator.read('Read 1', () => {\n void coordinator.write('Write 1', () => {});\n });\n\n void coordinator.read('Read 2', () => {\n void coordinator.write('Write 2', () => {\n void coordinator.write('Write 3', () => {});\n });\n void coordinator.read('Read 3', () => {});\n });\n\n await validateRecords(expected);\n });\n\n it('completes work added while evaluating the last item in the queue', async () => {\n const expected = [\n '[New frame]',\n '[Read]: Read',\n '[New frame]',\n '[Write]: Write at end',\n '[Queue empty]',\n ];\n void coordinator.read('Read', () => {\n // This write is added when we are evaluating the last item in the queue,\n // and it should be enqueued correctly for the test to pass.\n void coordinator.write('Write at end', () => {});\n });\n\n await coordinator.done();\n\n const records = coordinator.takeRecords();\n assert.deepEqual(records.map(r => r.value), expected);\n });\n\n it('returns values', async () => {\n const element = document.createElement('div');\n element.style.height = '800px';\n document.body.appendChild(element);\n\n const height = await coordinator.read(() => element.clientHeight);\n await coordinator.done();\n\n element.remove();\n assert.strictEqual(height, 800);\n });\n\n it('awaits async callbacks', async () => {\n const expected = 100;\n let targetValue = 0;\n const delayedSet = (value: number, timeout: number): Promise => {\n return new Promise(resolve => setTimeout(() => {\n targetValue = value;\n resolve();\n }, timeout));\n };\n\n void coordinator.write(async () => delayedSet(expected, 100));\n await coordinator.done();\n\n assert.strictEqual(targetValue, expected);\n });\n\n it('throws if there is a read-write deadlock (blocked on read)', async () => {\n const read = () => {};\n try {\n await coordinator.write(async () => {\n // Awaiting a read block within a write should block because\n // this write can't proceed until the read has completed, but\n // the read won't start until this write has completed.\n await coordinator.read(read);\n });\n } catch (err) {\n assert.strictEqual(err.toString(), new Error('Writers took over 1500ms. Possible deadlock?').toString());\n }\n coordinator.cancelPending();\n });\n\n it('throws if there is a write deadlock (blocked on write)', async () => {\n const write = () => {};\n try {\n await coordinator.read(async () => {\n // Awaiting a write block within a read should block because\n // this read can't proceed until the write has completed, but\n // the write won't start until this read has completed.\n await coordinator.write(write);\n });\n } catch (err) {\n assert.strictEqual(err.toString(), new Error('Readers took over 1500ms. Possible deadlock?').toString());\n }\n coordinator.cancelPending();\n });\n\n it('exposes the presence of pending work', async () => {\n const readDonePromise = coordinator.read('Named Read', () => {});\n assert.isTrue(coordinator.hasPendingWork());\n await readDonePromise;\n assert.isFalse(coordinator.hasPendingWork());\n });\n\n it('exposes the pending work count globally for interaction/e2e tests', async () => {\n const readDonePromise = coordinator.read('Named Read', () => {});\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n assert.strictEqual((globalThis as any).__getRenderCoordinatorPendingFrames(), 1);\n await readDonePromise;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n assert.strictEqual((globalThis as any).__getRenderCoordinatorPendingFrames(), 0);\n });\n\n describe('Logger', () => {\n it('only logs by default when provided with names', async () => {\n const expected = [\n '[New frame]',\n '[Read]: Named Read',\n '[Queue empty]',\n ];\n\n void coordinator.read('Named Read', () => {});\n void coordinator.write(() => {});\n\n await validateRecords(expected);\n });\n\n it('allow logging of unnamed tasks', async () => {\n const expected = [\n '[New frame]',\n '[Read]: Named Read',\n '[Write]: Unnamed write',\n '[Queue empty]',\n ];\n\n coordinator.observeOnlyNamed = false;\n void coordinator.read('Named Read', () => {});\n void coordinator.write(() => {});\n\n await validateRecords(expected);\n });\n\n it('tracks only the last 100 items', async () => {\n const expected = [];\n for (let i = 51; i < 150; i++) {\n expected.push(`[Read]: Named read ${i}`);\n }\n expected.push('[Queue empty]');\n\n for (let i = 0; i < 150; i++) {\n void coordinator.read(`Named read ${i}`, () => {});\n }\n\n await validateRecords(expected);\n });\n\n it('supports different log sizes', async () => {\n coordinator.recordStorageLimit = 10;\n const expected = [];\n for (let i = 41; i < 50; i++) {\n expected.push(`[Write]: Named write ${i}`);\n }\n expected.push('[Queue empty]');\n\n for (let i = 0; i < 50; i++) {\n void coordinator.write(`Named write ${i}`, () => {});\n }\n\n await validateRecords(expected);\n });\n });\n});\n"]} \ No newline at end of file +{"version":3,"file":"render_coordinator.test.js","sourceRoot":"","sources":["../../../../../../../front_end/ui/components/render_coordinator/render_coordinator.test.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,KAAK,iBAAiB,MAAM,yBAAyB,CAAC;AAE7D,QAAQ,CAAC,mBAAmB,EAAE,GAAG,EAAE;IACjC,KAAK,UAAU,eAAe,CAAC,QAAkB;QAC/C,MAAM,iBAAiB,CAAC,IAAI,EAAE,CAAC;QAC/B,MAAM,OAAO,GAAG,iBAAiB,CAAC,kBAAkB,EAAE,CAAC;QACvD,MAAM,CAAC,SAAS,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,EAAE,QAAQ,EAAE,8CAA8C,CAAC,CAAC;IACxG,CAAC;IAED,UAAU,CAAC,GAAG,EAAE;QACd,iBAAiB,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC;IAC5C,CAAC,CAAC,CAAC;IAEH,SAAS,CAAC,GAAG,EAAE;QACb,iBAAiB,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAC;IAC7C,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,qCAAqC,EAAE,KAAK,IAAI,EAAE;QACnD,MAAM,QAAQ,GAAG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C,EAAE,CAAC,CAAC;YAC7C,CAAC;YACD,QAAQ,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;YAE/B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC;gBAC5B,KAAK,iBAAiB,CAAC,KAAK,CAAC,eAAe,CAAC,EAAE,EAAE,GAAG,EAAE,GAAE,CAAC,CAAC,CAAC;YAC7D,CAAC;YAED,MAAM,eAAe,CAAC,QAAQ,CAAC,CAAC;QAClC,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["// Copyright 2019 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport * as RenderCoordinator from './render_coordinator.js';\n\ndescribe('RenderCoordinator', () => {\n async function validateRecords(expected: string[]) {\n await RenderCoordinator.done();\n const records = RenderCoordinator.takeLoggingRecords();\n assert.deepEqual(records.map(r => r.value), expected, 'render coordinator messages are out of order');\n }\n\n beforeEach(() => {\n RenderCoordinator.setLoggingEnabled(true);\n });\n\n afterEach(() => {\n RenderCoordinator.setLoggingEnabled(false);\n });\n\n it('groups interleaved reads and writes', async () => {\n const expected = [\n '[New frame]',\n '[Read]: Read 1',\n '[Read]: Read 2',\n '[Read]: Read 3',\n '[Write]: Write 1',\n '[Write]: Write 2',\n '[Queue empty]',\n ];\n\n void RenderCoordinator.write('Write 1', () => {});\n void RenderCoordinator.read('Read 1', () => {});\n void RenderCoordinator.read('Read 2', () => {});\n void RenderCoordinator.write('Write 2', () => {});\n void RenderCoordinator.read('Read 3', () => {});\n\n await validateRecords(expected);\n });\n\n it('deduplicates named tasks', async () => {\n const expected = [\n '[New frame]',\n '[Read]: Named Read',\n '[Write]: Unnamed write',\n '[Write]: Named Write',\n '[Write]: Unnamed write',\n '[Queue empty]',\n ];\n\n void RenderCoordinator.read('Named Read', () => {});\n void RenderCoordinator.write(() => {});\n void RenderCoordinator.write('Named Write', () => {});\n void RenderCoordinator.write(() => {});\n void RenderCoordinator.write('Named Write', () => {});\n\n await validateRecords(expected);\n });\n\n it('handles nested reads and writes', async () => {\n const expected = [\n '[New frame]',\n '[Read]: Read 1',\n '[Read]: Read 2',\n '[New frame]',\n '[Read]: Read 3',\n '[Write]: Write 1',\n '[Write]: Write 2',\n '[New frame]',\n '[Write]: Write 3',\n '[Queue empty]',\n ];\n\n void RenderCoordinator.read('Read 1', () => {\n void RenderCoordinator.write('Write 1', () => {});\n });\n\n void RenderCoordinator.read('Read 2', () => {\n void RenderCoordinator.write('Write 2', () => {\n void RenderCoordinator.write('Write 3', () => {});\n });\n void RenderCoordinator.read('Read 3', () => {});\n });\n\n await validateRecords(expected);\n });\n\n it('completes work added while evaluating the last item in the queue', async () => {\n const expected = [\n '[New frame]',\n '[Read]: Read',\n '[New frame]',\n '[Write]: Write at end',\n '[Queue empty]',\n ];\n void RenderCoordinator.read('Read', () => {\n // This write is added when we are evaluating the last item in the queue,\n // and it should be enqueued correctly for the test to pass.\n void RenderCoordinator.write('Write at end', () => {});\n });\n\n await RenderCoordinator.done();\n\n const records = RenderCoordinator.takeLoggingRecords();\n assert.deepEqual(records.map(r => r.value), expected);\n });\n\n it('returns values', async () => {\n const element = document.createElement('div');\n element.style.height = '800px';\n document.body.appendChild(element);\n\n const height = await RenderCoordinator.read(() => element.clientHeight);\n await RenderCoordinator.done();\n\n element.remove();\n assert.strictEqual(height, 800);\n });\n\n it('awaits async callbacks', async () => {\n const expected = 100;\n let targetValue = 0;\n const delayedSet = (value: number, timeout: number): Promise => {\n return new Promise(resolve => setTimeout(() => {\n targetValue = value;\n resolve();\n }, timeout));\n };\n\n void RenderCoordinator.write(async () => delayedSet(expected, 100));\n await RenderCoordinator.done();\n\n assert.strictEqual(targetValue, expected);\n });\n\n it('throws if there is a read-write deadlock (blocked on read)', async () => {\n const read = () => {};\n try {\n await RenderCoordinator.write(async () => {\n // Awaiting a read block within a write should block because\n // this write can't proceed until the read has completed, but\n // the read won't start until this write has completed.\n await RenderCoordinator.read(read);\n });\n } catch (err) {\n assert.strictEqual(err.toString(), new Error('Writers took over 1500ms. Possible deadlock?').toString());\n }\n RenderCoordinator.cancelPending();\n });\n\n it('throws if there is a write deadlock (blocked on write)', async () => {\n const write = () => {};\n try {\n await RenderCoordinator.read(async () => {\n // Awaiting a write block within a read should block because\n // this read can't proceed until the write has completed, but\n // the write won't start until this read has completed.\n await RenderCoordinator.write(write);\n });\n } catch (err) {\n assert.strictEqual(err.toString(), new Error('Readers took over 1500ms. Possible deadlock?').toString());\n }\n RenderCoordinator.cancelPending();\n });\n\n it('exposes the presence of pending work', async () => {\n const readDonePromise = RenderCoordinator.read('Named Read', () => {});\n assert.isTrue(RenderCoordinator.hasPendingWork());\n await readDonePromise;\n assert.isFalse(RenderCoordinator.hasPendingWork());\n });\n\n it('exposes the pending work count globally for interaction/e2e tests', async () => {\n const readDonePromise = RenderCoordinator.read('Named Read', () => {});\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n assert.strictEqual((globalThis as any).__getRenderCoordinatorPendingFrames(), 1);\n await readDonePromise;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n assert.strictEqual((globalThis as any).__getRenderCoordinatorPendingFrames(), 0);\n });\n\n describe('Logger', () => {\n it('only logs by default when provided with names', async () => {\n RenderCoordinator.setLoggingEnabled(true, {onlyNamed: true});\n const expected = [\n '[New frame]',\n '[Read]: Named Read',\n '[Queue empty]',\n ];\n\n void RenderCoordinator.read('Named Read', () => {});\n void RenderCoordinator.write(() => {});\n\n await validateRecords(expected);\n });\n\n it('allow logging of unnamed tasks', async () => {\n const expected = [\n '[New frame]',\n '[Read]: Named Read',\n '[Write]: Unnamed write',\n '[Queue empty]',\n ];\n\n void RenderCoordinator.read('Named Read', () => {});\n void RenderCoordinator.write(() => {});\n\n await validateRecords(expected);\n });\n\n it('tracks only the last 100 items', async () => {\n const expected = [];\n for (let i = 51; i < 150; i++) {\n expected.push(`[Read]: Named read ${i}`);\n }\n expected.push('[Queue empty]');\n\n for (let i = 0; i < 150; i++) {\n void RenderCoordinator.read(`Named read ${i}`, () => {});\n }\n\n await validateRecords(expected);\n });\n\n it('supports different log sizes', async () => {\n RenderCoordinator.setLoggingEnabled(true, {storageLimit: 10});\n const expected = [];\n for (let i = 41; i < 50; i++) {\n expected.push(`[Write]: Named write ${i}`);\n }\n expected.push('[Queue empty]');\n\n for (let i = 0; i < 50; i++) {\n void RenderCoordinator.write(`Named write ${i}`, () => {});\n }\n\n await validateRecords(expected);\n });\n });\n});\n"]} \ No newline at end of file diff --git a/public/ui/components/request_link_icon/RequestLinkIcon.js b/public/ui/components/request_link_icon/RequestLinkIcon.js index d7bfeab02..c3e94e007 100644 --- a/public/ui/components/request_link_icon/RequestLinkIcon.js +++ b/public/ui/components/request_link_icon/RequestLinkIcon.js @@ -5,7 +5,7 @@ import '../../../ui/components/icon_button/icon_button.js'; import * as Common from '../../../core/common/common.js'; import * as i18n from '../../../core/i18n/i18n.js'; import * as NetworkForward from '../../../panels/network/forward/forward.js'; -import * as Coordinator from '../../../ui/components/render_coordinator/render_coordinator.js'; +import * as RenderCoordinator from '../../../ui/components/render_coordinator/render_coordinator.js'; import * as LitHtml from '../../../ui/lit-html/lit-html.js'; import * as VisualLogging from '../../../ui/visual_logging/visual_logging.js'; import requestLinkIconStyles from './requestLinkIcon.css.js'; @@ -27,7 +27,6 @@ const UIStrings = { }; const str_ = i18n.i18n.registerUIStrings('ui/components/request_link_icon/RequestLinkIcon.ts', UIStrings); const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_); -const coordinator = Coordinator.RenderCoordinator.RenderCoordinator.instance(); export const extractShortPath = (path) => { // 1st regex matches everything after last '/' // if path ends with '/', 2nd regex returns everything between the last two '/' @@ -140,7 +139,7 @@ export class RequestLinkIcon extends HTMLElement { return html `${filename}`; } async #render() { - return coordinator.write(() => { + return RenderCoordinator.write(() => { // By default we render just the URL for the request link. If we also know // the concrete network request, or at least its request ID, we surround // the URL with a button, that opens the request in the Network panel. diff --git a/public/ui/components/request_link_icon/RequestLinkIcon.js.map b/public/ui/components/request_link_icon/RequestLinkIcon.js.map index 15e08f714..468b4eb25 100644 --- a/public/ui/components/request_link_icon/RequestLinkIcon.js.map +++ b/public/ui/components/request_link_icon/RequestLinkIcon.js.map @@ -1 +1 @@ -{"version":3,"file":"RequestLinkIcon.js","sourceRoot":"","sources":["../../../../../../../front_end/ui/components/request_link_icon/RequestLinkIcon.ts"],"names":[],"mappings":"AAAA,gEAAgE;AAChE,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,mDAAmD,CAAC;AAE3D,OAAO,KAAK,MAAM,MAAM,gCAAgC,CAAC;AACzD,OAAO,KAAK,IAAI,MAAM,4BAA4B,CAAC;AAKnD,OAAO,KAAK,cAAc,MAAM,4CAA4C,CAAC;AAC7E,OAAO,KAAK,WAAW,MAAM,iEAAiE,CAAC;AAC/F,OAAO,KAAK,OAAO,MAAM,kCAAkC,CAAC;AAC5D,OAAO,KAAK,aAAa,MAAM,8CAA8C,CAAC;AAE9E,OAAO,qBAAqB,MAAM,0BAA0B,CAAC;AAE7D,MAAM,EAAC,IAAI,EAAC,GAAG,OAAO,CAAC;AAEvB,MAAM,SAAS,GAAG;IAChB;;;OAGG;IACH,8BAA8B,EAAE,iEAAiE;IACjG;;OAEG;IACH,8BAA8B,EAAE,4EAA4E;IAC5G;;OAEG;IACH,YAAY,EAAE,eAAe;CAC9B,CAAC;AACF,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,iBAAiB,CAAC,oDAAoD,EAAE,SAAS,CAAC,CAAC;AAC1G,MAAM,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC;AAEtE,MAAM,WAAW,GAAG,WAAW,CAAC,iBAAiB,CAAC,iBAAiB,CAAC,QAAQ,EAAE,CAAC;AAiB/E,MAAM,CAAC,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CAAC,EAAC,CAAC;0BAC3D,IAAI,CAAC,WAAW,EAAE;0BAClB,aAAa,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,KAAK,CAAC,EAAC,KAAK,EAAE,IAAI,EAAC,CAAC;2BACjD,IAAI,CAAC,WAAW;;cAE7B,QAAQ;oBACF,CAAC;gBACb,kBAAkB;YACpB,CAAC;YACD,OAAO,CAAC,MAAM,CAAC,QAAQ,EAAE,IAAI,CAAC,OAAO,EAAE,EAAC,IAAI,EAAE,IAAI,EAAC,CAAC,CAAC;QACvD,CAAC,CAAC,CAAC;IACL,CAAC;CACF;AAED,cAAc,CAAC,MAAM,CAAC,4BAA4B,EAAE,eAAe,CAAC,CAAC","sourcesContent":["// Copyright (c) 2021 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport '../../../ui/components/icon_button/icon_button.js';\n\nimport * as Common from '../../../core/common/common.js';\nimport * as i18n from '../../../core/i18n/i18n.js';\nimport type * as Platform from '../../../core/platform/platform.js';\nimport type * as SDK from '../../../core/sdk/sdk.js';\nimport type * as Protocol from '../../../generated/protocol.js';\nimport type * as Logs from '../../../models/logs/logs.js';\nimport * as NetworkForward from '../../../panels/network/forward/forward.js';\nimport * as Coordinator from '../../../ui/components/render_coordinator/render_coordinator.js';\nimport * as LitHtml from '../../../ui/lit-html/lit-html.js';\nimport * as VisualLogging from '../../../ui/visual_logging/visual_logging.js';\n\nimport requestLinkIconStyles from './requestLinkIcon.css.js';\n\nconst {html} = LitHtml;\n\nconst UIStrings = {\n /**\n * @description Title for a link to show a request in the network panel\n * @example {https://example.org/index.html} url\n */\n clickToShowRequestInTheNetwork: 'Click to open the network panel and show request for URL: {url}',\n /**\n * @description Title for an link to show a request that is unavailable because the request couldn't be resolved\n */\n requestUnavailableInTheNetwork: 'Request unavailable in the network panel, try reloading the inspected page',\n /**\n * @description Label for the shortened URL displayed in a link to show a request in the network panel\n */\n shortenedURL: 'Shortened URL',\n};\nconst str_ = i18n.i18n.registerUIStrings('ui/components/request_link_icon/RequestLinkIcon.ts', UIStrings);\nconst i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);\n\nconst coordinator = Coordinator.RenderCoordinator.RenderCoordinator.instance();\n\nexport interface RequestLinkIconData {\n linkToPreflight?: boolean;\n request?: SDK.NetworkRequest.NetworkRequest|null;\n affectedRequest?: {requestId?: Protocol.Network.RequestId, url?: string};\n highlightHeader?: {section: NetworkForward.UIRequestLocation.UIHeaderSection, name: string};\n networkTab?: NetworkForward.UIRequestLocation.UIRequestTabs;\n requestResolver?: Logs.RequestResolver.RequestResolver;\n displayURL?: boolean;\n // If displayURL && urlToDisplay !== undefined, uses urlToDisplay for the text of the link.\n // If displayURL only, uses filename of the URL.\n urlToDisplay?: string;\n additionalOnClickAction?: () => void;\n revealOverride?: (revealable: unknown, omitFocus?: boolean) => Promise;\n}\n\nexport const extractShortPath = (path: Platform.DevToolsPath.UrlString): string => {\n // 1st regex matches everything after last '/'\n // if path ends with '/', 2nd regex returns everything between the last two '/'\n return (/[^/]+$/.exec(path) || /[^/]+\\/$/.exec(path) || [''])[0];\n};\n\nexport class RequestLinkIcon extends HTMLElement {\n readonly #shadow = this.attachShadow({mode: 'open'});\n #linkToPreflight?: boolean;\n // The value `null` indicates that the request is not available,\n // `undefined` that it is still being resolved.\n #request?: SDK.NetworkRequest.NetworkRequest|null;\n #highlightHeader?: {section: NetworkForward.UIRequestLocation.UIHeaderSection, name: string};\n #requestResolver?: Logs.RequestResolver.RequestResolver;\n #displayURL: boolean = false;\n #urlToDisplay?: string;\n #networkTab?: NetworkForward.UIRequestLocation.UIRequestTabs;\n #affectedRequest?: {requestId?: Protocol.Network.RequestId, url?: string};\n #additionalOnClickAction?: () => void;\n #reveal = Common.Revealer.reveal;\n\n set data(data: RequestLinkIconData) {\n this.#linkToPreflight = data.linkToPreflight;\n this.#request = data.request;\n if (data.affectedRequest) {\n this.#affectedRequest = {...data.affectedRequest};\n }\n this.#highlightHeader = data.highlightHeader;\n this.#networkTab = data.networkTab;\n this.#requestResolver = data.requestResolver;\n this.#displayURL = data.displayURL ?? false;\n this.#urlToDisplay = data.urlToDisplay;\n this.#additionalOnClickAction = data.additionalOnClickAction;\n if (data.revealOverride) {\n this.#reveal = data.revealOverride;\n }\n if (!this.#request && data.affectedRequest && typeof data.affectedRequest.requestId !== 'undefined') {\n if (!this.#requestResolver) {\n throw new Error('A `RequestResolver` must be provided if an `affectedRequest` is provided.');\n }\n this.#requestResolver.waitFor(data.affectedRequest.requestId)\n .then(request => {\n this.#request = request;\n return this.#render();\n })\n .catch(() => {\n this.#request = null;\n });\n }\n void this.#render();\n }\n\n connectedCallback(): void {\n this.#shadow.adoptedStyleSheets = [requestLinkIconStyles];\n }\n\n get data(): RequestLinkIconData {\n return {\n linkToPreflight: this.#linkToPreflight,\n request: this.#request,\n affectedRequest: this.#affectedRequest,\n highlightHeader: this.#highlightHeader,\n networkTab: this.#networkTab,\n requestResolver: this.#requestResolver,\n displayURL: this.#displayURL,\n urlToDisplay: this.#urlToDisplay,\n additionalOnClickAction: this.#additionalOnClickAction,\n revealOverride: this.#reveal !== Common.Revealer.reveal ? this.#reveal : undefined,\n };\n }\n\n handleClick(event: MouseEvent): void {\n if (event.button !== 0) {\n return; // Only handle left-click for now.\n }\n const linkedRequest = this.#linkToPreflight ? this.#request?.preflightRequest() : this.#request;\n if (!linkedRequest) {\n return;\n }\n if (this.#highlightHeader) {\n const requestLocation = NetworkForward.UIRequestLocation.UIRequestLocation.header(\n linkedRequest, this.#highlightHeader.section, this.#highlightHeader.name);\n void this.#reveal(requestLocation);\n } else {\n const requestLocation = NetworkForward.UIRequestLocation.UIRequestLocation.tab(\n linkedRequest, this.#networkTab ?? NetworkForward.UIRequestLocation.UIRequestTabs.HEADERS_COMPONENT);\n void this.#reveal(requestLocation);\n }\n this.#additionalOnClickAction?.();\n event.consume();\n }\n\n #getTooltip(): Platform.UIString.LocalizedString {\n if (this.#request) {\n return i18nString(UIStrings.clickToShowRequestInTheNetwork, {url: this.#request.url()});\n }\n return i18nString(UIStrings.requestUnavailableInTheNetwork);\n }\n\n #getUrlForDisplaying(): string|undefined {\n if (!this.#displayURL) {\n return undefined;\n }\n if (this.#request) {\n return this.#request.url();\n }\n return this.#affectedRequest?.url;\n }\n\n #maybeRenderURL(): LitHtml.LitTemplate {\n const url = this.#getUrlForDisplaying();\n if (!url) {\n return LitHtml.nothing;\n }\n\n if (this.#urlToDisplay) {\n return html`${this.#urlToDisplay}`;\n }\n\n const filename = extractShortPath(url as Platform.DevToolsPath.UrlString);\n return html`${filename}`;\n }\n\n async #render(): Promise {\n return coordinator.write(() => {\n // By default we render just the URL for the request link. If we also know\n // the concrete network request, or at least its request ID, we surround\n // the URL with a button, that opens the request in the Network panel.\n let template = this.#maybeRenderURL();\n if (this.#request || this.#affectedRequest?.requestId !== undefined) {\n // clang-format off\n template = html`\n `;\n // clang-format on\n }\n LitHtml.render(template, this.#shadow, {host: this});\n });\n }\n}\n\ncustomElements.define('devtools-request-link-icon', RequestLinkIcon);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'devtools-request-link-icon': RequestLinkIcon;\n }\n}\n"]} \ No newline at end of file +{"version":3,"file":"RequestLinkIcon.js","sourceRoot":"","sources":["../../../../../../../front_end/ui/components/request_link_icon/RequestLinkIcon.ts"],"names":[],"mappings":"AAAA,gEAAgE;AAChE,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,mDAAmD,CAAC;AAE3D,OAAO,KAAK,MAAM,MAAM,gCAAgC,CAAC;AACzD,OAAO,KAAK,IAAI,MAAM,4BAA4B,CAAC;AAKnD,OAAO,KAAK,cAAc,MAAM,4CAA4C,CAAC;AAC7E,OAAO,KAAK,iBAAiB,MAAM,iEAAiE,CAAC;AACrG,OAAO,KAAK,OAAO,MAAM,kCAAkC,CAAC;AAC5D,OAAO,KAAK,aAAa,MAAM,8CAA8C,CAAC;AAE9E,OAAO,qBAAqB,MAAM,0BAA0B,CAAC;A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AS,CAAC;IACtG,CAAC;IAED,KAAK,CAAC,OAAO;QACX,OAAO,iBAAiB,CAAC,KAAK,CAAC,GAAG,EAAE;YAClC,0EAA0E;YAC1E,wEAAwE;YACxE,sEAAsE;YACtE,IAAI,QAAQ,GAAG,IAAI,CAAC,eAAe,EAAE,CAAC;YACtC,IAAI,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,gBAAgB,EAAE,SAAS,KAAK,SAAS,EAAE,CAAC;gBACpE,mBAAmB;gBACnB,QAAQ,GAAG,IAAI,CAAA;0BACG,OAAO,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAC,CAAC;0BAC3D,IAAI,CAAC,WAAW,EAAE;0BAClB,aAAa,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,KAAK,CAAC,EAAC,KAAK,EAAE,IAAI,EAAC,CAAC;2BACjD,IAAI,CAAC,WAAW;;cAE7B,QAAQ;oBACF,CAAC;gBACb,kBAAkB;YACpB,CAAC;YACD,OAAO,CAAC,MAAM,CAAC,QAAQ,EAAE,IAAI,CAAC,OAAO,EAAE,EAAC,IAAI,EAAE,IAAI,EAAC,CAAC,CAAC;QACvD,CAAC,CAAC,CAAC;IACL,CAAC;CACF;AAED,cAAc,CAAC,MAAM,CAAC,4BAA4B,EAAE,eAAe,CAAC,CAAC","sourcesContent":["// Copyright (c) 2021 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport '../../../ui/components/icon_button/icon_button.js';\n\nimport * as Common from '../../../core/common/common.js';\nimport * as i18n from '../../../core/i18n/i18n.js';\nimport type * as Platform from '../../../core/platform/platform.js';\nimport type * as SDK from '../../../core/sdk/sdk.js';\nimport type * as Protocol from '../../../generated/protocol.js';\nimport type * as Logs from '../../../models/logs/logs.js';\nimport * as NetworkForward from '../../../panels/network/forward/forward.js';\nimport * as RenderCoordinator from '../../../ui/components/render_coordinator/render_coordinator.js';\nimport * as LitHtml from '../../../ui/lit-html/lit-html.js';\nimport * as VisualLogging from '../../../ui/visual_logging/visual_logging.js';\n\nimport requestLinkIconStyles from './requestLinkIcon.css.js';\n\nconst {html} = LitHtml;\n\nconst UIStrings = {\n /**\n * @description Title for a link to show a request in the network panel\n * @example {https://example.org/index.html} url\n */\n clickToShowRequestInTheNetwork: 'Click to open the network panel and show request for URL: {url}',\n /**\n * @description Title for an link to show a request that is unavailable because the request couldn't be resolved\n */\n requestUnavailableInTheNetwork: 'Request unavailable in the network panel, try reloading the inspected page',\n /**\n * @description Label for the shortened URL displayed in a link to show a request in the network panel\n */\n shortenedURL: 'Shortened URL',\n};\nconst str_ = i18n.i18n.registerUIStrings('ui/components/request_link_icon/RequestLinkIcon.ts', UIStrings);\nconst i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);\n\nexport interface RequestLinkIconData {\n linkToPreflight?: boolean;\n request?: SDK.NetworkRequest.NetworkRequest|null;\n affectedRequest?: {requestId?: Protocol.Network.RequestId, url?: string};\n highlightHeader?: {section: NetworkForward.UIRequestLocation.UIHeaderSection, name: string};\n networkTab?: NetworkForward.UIRequestLocation.UIRequestTabs;\n requestResolver?: Logs.RequestResolver.RequestResolver;\n displayURL?: boolean;\n // If displayURL && urlToDisplay !== undefined, uses urlToDisplay for the text of the link.\n // If displayURL only, uses filename of the URL.\n urlToDisplay?: string;\n additionalOnClickAction?: () => void;\n revealOverride?: (revealable: unknown, omitFocus?: boolean) => Promise;\n}\n\nexport const extractShortPath = (path: Platform.DevToolsPath.UrlString): string => {\n // 1st regex matches everything after last '/'\n // if path ends with '/', 2nd regex returns everything between the last two '/'\n return (/[^/]+$/.exec(path) || /[^/]+\\/$/.exec(path) || [''])[0];\n};\n\nexport class RequestLinkIcon extends HTMLElement {\n readonly #shadow = this.attachShadow({mode: 'open'});\n #linkToPreflight?: boolean;\n // The value `null` indicates that the request is not available,\n // `undefined` that it is still being resolved.\n #request?: SDK.NetworkRequest.NetworkRequest|null;\n #highlightHeader?: {section: NetworkForward.UIRequestLocation.UIHeaderSection, name: string};\n #requestResolver?: Logs.RequestResolver.RequestResolver;\n #displayURL: boolean = false;\n #urlToDisplay?: string;\n #networkTab?: NetworkForward.UIRequestLocation.UIRequestTabs;\n #affectedRequest?: {requestId?: Protocol.Network.RequestId, url?: string};\n #additionalOnClickAction?: () => void;\n #reveal = Common.Revealer.reveal;\n\n set data(data: RequestLinkIconData) {\n this.#linkToPreflight = data.linkToPreflight;\n this.#request = data.request;\n if (data.affectedRequest) {\n this.#affectedRequest = {...data.affectedRequest};\n }\n this.#highlightHeader = data.highlightHeader;\n this.#networkTab = data.networkTab;\n this.#requestResolver = data.requestResolver;\n this.#displayURL = data.displayURL ?? false;\n this.#urlToDisplay = data.urlToDisplay;\n this.#additionalOnClickAction = data.additionalOnClickAction;\n if (data.revealOverride) {\n this.#reveal = data.revealOverride;\n }\n if (!this.#request && data.affectedRequest && typeof data.affectedRequest.requestId !== 'undefined') {\n if (!this.#requestResolver) {\n throw new Error('A `RequestResolver` must be provided if an `affectedRequest` is provided.');\n }\n this.#requestResolver.waitFor(data.affectedRequest.requestId)\n .then(request => {\n this.#request = request;\n return this.#render();\n })\n .catch(() => {\n this.#request = null;\n });\n }\n void this.#render();\n }\n\n connectedCallback(): void {\n this.#shadow.adoptedStyleSheets = [requestLinkIconStyles];\n }\n\n get data(): RequestLinkIconData {\n return {\n linkToPreflight: this.#linkToPreflight,\n request: this.#request,\n affectedRequest: this.#affectedRequest,\n highlightHeader: this.#highlightHeader,\n networkTab: this.#networkTab,\n requestResolver: this.#requestResolver,\n displayURL: this.#displayURL,\n urlToDisplay: this.#urlToDisplay,\n additionalOnClickAction: this.#additionalOnClickAction,\n revealOverride: this.#reveal !== Common.Revealer.reveal ? this.#reveal : undefined,\n };\n }\n\n handleClick(event: MouseEvent): void {\n if (event.button !== 0) {\n return; // Only handle left-click for now.\n }\n const linkedRequest = this.#linkToPreflight ? this.#request?.preflightRequest() : this.#request;\n if (!linkedRequest) {\n return;\n }\n if (this.#highlightHeader) {\n const requestLocation = NetworkForward.UIRequestLocation.UIRequestLocation.header(\n linkedRequest, this.#highlightHeader.section, this.#highlightHeader.name);\n void this.#reveal(requestLocation);\n } else {\n const requestLocation = NetworkForward.UIRequestLocation.UIRequestLocation.tab(\n linkedRequest, this.#networkTab ?? NetworkForward.UIRequestLocation.UIRequestTabs.HEADERS_COMPONENT);\n void this.#reveal(requestLocation);\n }\n this.#additionalOnClickAction?.();\n event.consume();\n }\n\n #getTooltip(): Platform.UIString.LocalizedString {\n if (this.#request) {\n return i18nString(UIStrings.clickToShowRequestInTheNetwork, {url: this.#request.url()});\n }\n return i18nString(UIStrings.requestUnavailableInTheNetwork);\n }\n\n #getUrlForDisplaying(): string|undefined {\n if (!this.#displayURL) {\n return undefined;\n }\n if (this.#request) {\n return this.#request.url();\n }\n return this.#affectedRequest?.url;\n }\n\n #maybeRenderURL(): LitHtml.LitTemplate {\n const url = this.#getUrlForDisplaying();\n if (!url) {\n return LitHtml.nothing;\n }\n\n if (this.#urlToDisplay) {\n return html`${this.#urlToDisplay}`;\n }\n\n const filename = extractShortPath(url as Platform.DevToolsPath.UrlString);\n return html`${filename}`;\n }\n\n async #render(): Promise {\n return RenderCoordinator.write(() => {\n // By default we render just the URL for the request link. If we also know\n // the concrete network request, or at least its request ID, we surround\n // the URL with a button, that opens the request in the Network panel.\n let template = this.#maybeRenderURL();\n if (this.#request || this.#affectedRequest?.requestId !== undefined) {\n // clang-format off\n template = html`\n `;\n // clang-format on\n }\n LitHtml.render(template, this.#shadow, {host: this});\n });\n }\n}\n\ncustomElements.define('devtools-request-link-icon', RequestLinkIcon);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'devtools-request-link-icon': RequestLinkIcon;\n }\n}\n"]} \ No newline at end of file diff --git a/public/ui/components/request_link_icon/RequestLinkIcon.test.js b/public/ui/components/request_link_icon/RequestLinkIcon.test.js index c83ba7edf..33d0b0def 100644 --- a/public/ui/components/request_link_icon/RequestLinkIcon.test.js +++ b/public/ui/components/request_link_icon/RequestLinkIcon.test.js @@ -7,15 +7,14 @@ import { renderElementIntoDOM } from '../../../testing/DOMHelpers.js'; import { describeWithEnvironment } from '../../../testing/EnvironmentHelpers.js'; import * as UI from '../../legacy/legacy.js'; import * as IconButton from '../icon_button/icon_button.js'; -import * as Coordinator from '../render_coordinator/render_coordinator.js'; +import * as RenderCoordinator from '../render_coordinator/render_coordinator.js'; import * as RequestLinkIcon from './request_link_icon.js'; -const coordinator = Coordinator.RenderCoordinator.RenderCoordinator.instance(); const renderRequestLinkIcon = async (data) => { const component = new RequestLinkIcon.RequestLinkIcon.RequestLinkIcon(); component.data = data; renderElementIntoDOM(component); assert.isNotNull(component.shadowRoot); - await coordinator.done(); + await RenderCoordinator.done(); return { component, shadowRoot: component.shadowRoot }; }; export const extractElements = (shadowRoot) => { @@ -156,7 +155,7 @@ describeWithEnvironment('RequestLinkIcon', () => { }); assert.isFalse(extractElements(shadowRoot).button.classList.contains('link')); resolver.resolve(mockRequest); - await coordinator.done({ waitForWork: true }); + await RenderCoordinator.done({ waitForWork: true }); assert.isTrue(extractElements(shadowRoot).button.classList.contains('link')); }); it('to set the label correctly', async () => { @@ -168,7 +167,7 @@ describeWithEnvironment('RequestLinkIcon', () => { }); assert.strictEqual(extractElements(shadowRoot).label?.textContent, 'gamma'); resolver.resolve(mockRequest); - await coordinator.done({ waitForWork: true }); + await RenderCoordinator.done({ waitForWork: true }); assert.strictEqual(extractElements(shadowRoot).label?.textContent, 'baz'); }); it('handles multiple data assignments', async () => { @@ -193,7 +192,7 @@ describeWithEnvironment('RequestLinkIcon', () => { displayURL: true, }; resolver.resolve(mockRequest2); - await coordinator.done({ waitForWork: true }); + await RenderCoordinator.done({ waitForWork: true }); assert.strictEqual(extractElements(shadowRoot).label?.textContent, 'baz'); resolver.clear(); }); diff --git a/public/ui/components/request_link_icon/RequestLinkIcon.test.js.map b/public/ui/components/request_link_icon/RequestLinkIcon.test.js.map index 9fcde0bab..2971a2769 100644 --- a/public/ui/components/request_link_icon/RequestLinkIcon.test.js.map +++ b/public/ui/components/request_link_icon/RequestLinkIcon.test.js.map @@ -1 +1 @@ -{"version":3,"file":"RequestLinkIcon.test.js","sourceRoot":"","sources":["../../../../../../../front_end/ui/components/request_link_icon/RequestLinkIcon.test.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,KAAK,MAAM,MAAM,gCAAgC,CAAC;AAKzD,OAAO,KAAK,cAAc,MAAM,4CAA4C,CAAC;AAC7E,OAAO,EAAC,oBAAoB,EAAC,MAAM,gCAAgC,CAAC;AACpE,OAAO,EAAC,uBAAuB,EAAC,MAAM,wCAAwC,CAAC;AAC/E,OAAO,KAAK,EAAE,MAAM,wBAAwB,CAAC;AAC7C,OAAO,KAAK,UAAU,MAAM,+BAA+B,CAAC;AAC5D,OAAO,KAAK,WAAW,MAAM,6CAA6C,CAAC;AAE3E,OAAO,KAAK,eAAe,MAAM,wBAAwB,CAAC;AAE1D,MAAM,WAAW,GAAG,WAAW,CAAC,iBAAiB,CAAC,iBAAiB,CAAC,QAAQ,EAAE,CAAC;AAE/E,MAAM,qBAAqB,GAAG,KAAK,EAAC,IAAyD,EAG1F,EAAE;IACH,MAAM,SAAS,GAAG,IAAI,eAAe,CAAC,eAAe,CAAC,eAAe,EAAE,CAAC;IACxE,SAAS,CAAC,IAAI,GAAG,IAAI,CAAC;IACtB,oBAAoB,CAAC,SAAS,CAAC,CAAC;IAChC,MAAM,CAAC,SAAS,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC;IACvC,MAAM,WAAW,CAAC,IAAI,EAAE,CAAC;IACzB,OAAO,EAAC,SAAS,EAAE,UAAU,EAAE,SAAS,CAAC,UAAU,EAAC,CAAC;AACvD,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,UAAsB,EAIpD,EAAE;IACF,MAAM,IAAI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GAAG,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;YAC1D,MAAM,EAAC,UAAU,EAAC,GAAG,MAAM,qBAAqB,CAAC;gBAC/C,OAAO,EAAE,WAA2D;gBACpE,UAAU,EAAE,IAAI;gBAChB,cAAc;aACf,CAAC,CAAC;YAEH,MAAM,EAAC,MAAM,EAAC,GAAG,eAAe,CAAC,UAAU,CAAC,CAAC;YAE7C,MAAM,CAAC,KAAK,EAAE,CAAC;YAEf,MAAM,CAAC,MAAM,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC;YACrC,MAAM,CAAC,MAAM,CAAC,cAAc,CAAC,cAAc,CACvC,KAAK,CAAC,KAAK,CAAC,EAAC,GAAG,4FAAkE,EAAC,CAAC,CAAC,CAAC,CAAC;QAC7F,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["// Copyright 2020 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport * as Common from '../../../core/common/common.js';\nimport type * as Platform from '../../../core/platform/platform.js';\nimport type * as SDK from '../../../core/sdk/sdk.js';\nimport type * as Protocol from '../../../generated/protocol.js';\nimport type * as Logs from '../../../models/logs/logs.js';\nimport * as NetworkForward from '../../../panels/network/forward/forward.js';\nimport {renderElementIntoDOM} from '../../../testing/DOMHelpers.js';\nimport {describeWithEnvironment} from '../../../testing/EnvironmentHelpers.js';\nimport * as UI from '../../legacy/legacy.js';\nimport * as IconButton from '../icon_button/icon_button.js';\nimport * as Coordinator from '../render_coordinator/render_coordinator.js';\n\nimport * as RequestLinkIcon from './request_link_icon.js';\n\nconst coordinator = Coordinator.RenderCoordinator.RenderCoordinator.instance();\n\nconst renderRequestLinkIcon = async(data: RequestLinkIcon.RequestLinkIcon.RequestLinkIconData): Promise<{\n component: RequestLinkIcon.RequestLinkIcon.RequestLinkIcon,\n shadowRoot: ShadowRoot,\n}> => {\n const component = new RequestLinkIcon.RequestLinkIcon.RequestLinkIcon();\n component.data = data;\n renderElementIntoDOM(component);\n assert.isNotNull(component.shadowRoot);\n await coordinator.done();\n return {component, shadowRoot: component.shadowRoot};\n};\n\nexport const extractElements = (shadowRoot: ShadowRoot): {\n icon: IconButton.Icon.Icon,\n button: HTMLButtonElement,\n label: HTMLSpanElement|null,\n} => {\n const icon = shadowRoot.querySelector('devtools-icon');\n assert.instanceOf(icon, IconButton.Icon.Icon);\n const button = shadowRoot.querySelector('button');\n assert.instanceOf(button, HTMLButtonElement);\n const label = shadowRoot.querySelector('button > span');\n if (label !== null) {\n assert.instanceOf(label, HTMLSpanElement);\n }\n return {icon, button, label};\n};\n\ninterface MockRequestResolverEntry {\n resolve: (request: SDK.NetworkRequest.NetworkRequest|null) => void;\n promise: Promise;\n}\n\nclass MockRequestResolver {\n #promiseMap: Map = new Map();\n\n waitFor(requestId?: string) {\n if (!requestId) {\n if (this.#promiseMap.size !== 1) {\n throw new Error('more than one request being awaited, specify a request id');\n }\n requestId = this.#promiseMap.keys().next().value;\n }\n requestId = requestId || '';\n const entry = this.#promiseMap.get(requestId);\n if (entry) {\n return entry.promise;\n }\n let resolve: (request: SDK.NetworkRequest.NetworkRequest|null) => void = () => {};\n const promise = new Promise(r => {\n resolve = r;\n });\n this.#promiseMap.set(requestId, {resolve, promise});\n return promise;\n }\n\n resolve(result: SDK.NetworkRequest.NetworkRequest|null, requestId?: string): void {\n if (!requestId && this.#promiseMap.size === 1) {\n requestId = this.#promiseMap.keys().next().value;\n }\n requestId = requestId || result?.requestId() || '';\n const entry = this.#promiseMap.get(requestId);\n if (!entry) {\n throw new Error('resolve uninitialized');\n }\n entry.resolve(result);\n this.#promiseMap.delete(requestId);\n }\n\n clear() {\n for (const {resolve} of this.#promiseMap.values()) {\n resolve(null);\n }\n }\n}\n\ndescribeWithEnvironment('RequestLinkIcon', () => {\n const requestId1 = 'r1' as Protocol.Network.RequestId;\n const requestId2 = 'r2' as Protocol.Network.RequestId;\n\n describe('with simple requests', () => {\n const mockRequest = {\n url() {\n return 'http://foo.bar/baz';\n },\n };\n\n const mockRequestWithTrailingSlash = {\n url() {\n return 'http://foo.bar/baz/';\n },\n };\n\n const failingRequestResolver = {\n async waitFor() {\n throw new Error('Couldn\\'t resolve');\n },\n };\n\n it('renders correctly without a request', async () => {\n const {shadowRoot} = await renderRequestLinkIcon({\n affectedRequest: {requestId: requestId1},\n requestResolver: failingRequestResolver as unknown as Logs.RequestResolver.RequestResolver,\n });\n\n const {button, icon, label} = extractElements(shadowRoot);\n assert.isFalse(button.classList.contains('link'));\n assert.strictEqual(icon.name, 'arrow-up-down-circle');\n assert.isNull(label, 'Didn\\'t expect a label');\n });\n\n it('renders correctly with a request', async () => {\n const {shadowRoot} = await renderRequestLinkIcon({\n request: mockRequest as unknown as SDK.NetworkRequest.NetworkRequest,\n });\n\n const {button, icon, label} = extractElements(shadowRoot);\n assert.isTrue(button.classList.contains('link'));\n assert.strictEqual(icon.name, 'arrow-up-down-circle');\n assert.isNull(label, 'Didn\\'t expect a label');\n });\n\n it('renders the request label correctly without a trailing slash', async () => {\n const {shadowRoot} = await renderRequestLinkIcon({\n request: mockRequest as unknown as SDK.NetworkRequest.NetworkRequest,\n displayURL: true,\n });\n\n const {label} = extractElements(shadowRoot);\n assert.strictEqual(label?.textContent, 'baz');\n });\n\n it('renders the request label correctly with a trailing slash', async () => {\n const {shadowRoot} = await renderRequestLinkIcon({\n request: mockRequestWithTrailingSlash as unknown as SDK.NetworkRequest.NetworkRequest,\n displayURL: true,\n });\n\n const {label} = extractElements(shadowRoot);\n assert.strictEqual(label?.textContent, 'baz/');\n });\n\n it('renders the request label correctly without a request', async () => {\n const {shadowRoot} = await renderRequestLinkIcon({\n affectedRequest: {requestId: requestId1, url: 'https://alpha.beta/gamma'},\n requestResolver: failingRequestResolver as unknown as Logs.RequestResolver.RequestResolver,\n displayURL: true,\n });\n\n const {label} = extractElements(shadowRoot);\n assert.strictEqual(label?.textContent, 'gamma');\n });\n\n it('renders alternative text for URL', async () => {\n const {shadowRoot} = await renderRequestLinkIcon({\n affectedRequest: {requestId: requestId1, url: 'https://alpha.beta/gamma'},\n requestResolver: failingRequestResolver as unknown as Logs.RequestResolver.RequestResolver,\n displayURL: true,\n urlToDisplay: 'https://alpha.beta/gamma',\n });\n\n const {label} = extractElements(shadowRoot);\n assert.strictEqual(label?.textContent, 'https://alpha.beta/gamma');\n });\n });\n\n describe('transitions upon request resolution', () => {\n const mockRequest = {\n url() {\n return 'http://foo.bar/baz';\n },\n };\n\n it('to change the style correctly', async () => {\n const resolver = new MockRequestResolver();\n const {shadowRoot} = await renderRequestLinkIcon({\n affectedRequest: {requestId: requestId1, url: 'https://alpha.beta/gamma'},\n requestResolver: resolver as unknown as Logs.RequestResolver.RequestResolver,\n });\n\n assert.isFalse(extractElements(shadowRoot).button.classList.contains('link'));\n\n resolver.resolve(mockRequest as unknown as SDK.NetworkRequest.NetworkRequest);\n await coordinator.done({waitForWork: true});\n\n assert.isTrue(extractElements(shadowRoot).button.classList.contains('link'));\n });\n\n it('to set the label correctly', async () => {\n const resolver = new MockRequestResolver();\n const {shadowRoot} = await renderRequestLinkIcon({\n affectedRequest: {requestId: requestId1, url: 'https://alpha.beta/gamma'},\n requestResolver: resolver as unknown as Logs.RequestResolver.RequestResolver,\n displayURL: true,\n });\n\n assert.strictEqual(extractElements(shadowRoot).label?.textContent, 'gamma');\n\n resolver.resolve(mockRequest as unknown as SDK.NetworkRequest.NetworkRequest);\n await coordinator.done({waitForWork: true});\n\n assert.strictEqual(extractElements(shadowRoot).label?.textContent, 'baz');\n });\n\n it('handles multiple data assignments', async () => {\n const resolver = new MockRequestResolver();\n const {shadowRoot, component} = await renderRequestLinkIcon({\n affectedRequest: {requestId: requestId2, url: 'https://alpha.beta/gamma'},\n requestResolver: resolver as unknown as Logs.RequestResolver.RequestResolver,\n displayURL: true,\n });\n\n assert.strictEqual(extractElements(shadowRoot).label?.textContent, 'gamma');\n\n const mockRequest2 = {\n url() {\n return 'http://foo.bar/baz';\n },\n requestId() {\n return requestId1;\n },\n };\n\n component.data = {\n affectedRequest: {requestId: requestId1, url: 'https://alpha.beta/gamma'},\n requestResolver: resolver as unknown as Logs.RequestResolver.RequestResolver,\n displayURL: true,\n };\n\n resolver.resolve(mockRequest2 as unknown as SDK.NetworkRequest.NetworkRequest);\n await coordinator.done({waitForWork: true});\n\n assert.strictEqual(extractElements(shadowRoot).label?.textContent, 'baz');\n\n resolver.clear();\n });\n });\n\n describe('handles clicks correctly', () => {\n const mockRequest = {\n url() {\n return 'http://foo.bar/baz';\n },\n };\n\n before(() => {\n UI.ViewManager.resetViewRegistration();\n UI.ViewManager.registerViewExtension({\n // @ts-ignore\n location: 'mock-location',\n id: 'network',\n title: () => 'Network' as Platform.UIString.LocalizedString,\n commandPrompt: () => 'Network' as Platform.UIString.LocalizedString,\n persistence: UI.ViewManager.ViewPersistence.CLOSEABLE,\n async loadView() {\n return new UI.Widget.Widget();\n },\n });\n UI.ViewManager.ViewManager.instance({forceNew: true});\n });\n\n after(() => {\n UI.ViewManager.maybeRemoveViewExtension('network');\n });\n\n it('if the button is clicked', async () => {\n const revealOverride = sinon.fake(Common.Revealer.reveal);\n const {shadowRoot} = await renderRequestLinkIcon({\n request: mockRequest as unknown as SDK.NetworkRequest.NetworkRequest,\n displayURL: true,\n revealOverride,\n });\n\n const {button} = extractElements(shadowRoot);\n\n button.click();\n\n assert.isTrue(revealOverride.called);\n assert.isTrue(revealOverride.calledOnceWith(\n sinon.match({tab: NetworkForward.UIRequestLocation.UIRequestTabs.HEADERS_COMPONENT})));\n });\n });\n});\n"]} \ No newline at end of file +{"version":3,"file":"RequestLinkIcon.test.js","sourceRoot":"","sources":["../../../../../../../front_end/ui/components/request_link_icon/RequestLinkIcon.test.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,KAAK,MAAM,MAAM,gCAAgC,CAAC;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AC,cAAc,CAAC,cAAc,CACvC,KAAK,CAAC,KAAK,CAAC,EAAC,GAAG,4FAAkE,EAAC,CAAC,CAAC,CAAC,CAAC;QAC7F,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["// Copyright 2020 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport * as Common from '../../../core/common/common.js';\nimport type * as Platform from '../../../core/platform/platform.js';\nimport type * as SDK from '../../../core/sdk/sdk.js';\nimport type * as Protocol from '../../../generated/protocol.js';\nimport type * as Logs from '../../../models/logs/logs.js';\nimport * as NetworkForward from '../../../panels/network/forward/forward.js';\nimport {renderElementIntoDOM} from '../../../testing/DOMHelpers.js';\nimport {describeWithEnvironment} from '../../../testing/EnvironmentHelpers.js';\nimport * as UI from '../../legacy/legacy.js';\nimport * as IconButton from '../icon_button/icon_button.js';\nimport * as RenderCoordinator from '../render_coordinator/render_coordinator.js';\n\nimport * as RequestLinkIcon from './request_link_icon.js';\n\nconst renderRequestLinkIcon = async(data: RequestLinkIcon.RequestLinkIcon.RequestLinkIconData): Promise<{\n component: RequestLinkIcon.RequestLinkIcon.RequestLinkIcon,\n shadowRoot: ShadowRoot,\n}> => {\n const component = new RequestLinkIcon.RequestLinkIcon.RequestLinkIcon();\n component.data = data;\n renderElementIntoDOM(component);\n assert.isNotNull(component.shadowRoot);\n await RenderCoordinator.done();\n return {component, shadowRoot: component.shadowRoot};\n};\n\nexport const extractElements = (shadowRoot: ShadowRoot): {\n icon: IconButton.Icon.Icon,\n button: HTMLButtonElement,\n label: HTMLSpanElement|null,\n} => {\n const icon = shadowRoot.querySelector('devtools-icon');\n assert.instanceOf(icon, IconButton.Icon.Icon);\n const button = shadowRoot.querySelector('button');\n assert.instanceOf(button, HTMLButtonElement);\n const label = shadowRoot.querySelector('button > span');\n if (label !== null) {\n assert.instanceOf(label, HTMLSpanElement);\n }\n return {icon, button, label};\n};\n\ninterface MockRequestResolverEntry {\n resolve: (request: SDK.NetworkRequest.NetworkRequest|null) => void;\n promise: Promise;\n}\n\nclass MockRequestResolver {\n #promiseMap: Map = new Map();\n\n waitFor(requestId?: string) {\n if (!requestId) {\n if (this.#promiseMap.size !== 1) {\n throw new Error('more than one request being awaited, specify a request id');\n }\n requestId = this.#promiseMap.keys().next().value;\n }\n requestId = requestId || '';\n const entry = this.#promiseMap.get(requestId);\n if (entry) {\n return entry.promise;\n }\n let resolve: (request: SDK.NetworkRequest.NetworkRequest|null) => void = () => {};\n const promise = new Promise(r => {\n resolve = r;\n });\n this.#promiseMap.set(requestId, {resolve, promise});\n return promise;\n }\n\n resolve(result: SDK.NetworkRequest.NetworkRequest|null, requestId?: string): void {\n if (!requestId && this.#promiseMap.size === 1) {\n requestId = this.#promiseMap.keys().next().value;\n }\n requestId = requestId || result?.requestId() || '';\n const entry = this.#promiseMap.get(requestId);\n if (!entry) {\n throw new Error('resolve uninitialized');\n }\n entry.resolve(result);\n this.#promiseMap.delete(requestId);\n }\n\n clear() {\n for (const {resolve} of this.#promiseMap.values()) {\n resolve(null);\n }\n }\n}\n\ndescribeWithEnvironment('RequestLinkIcon', () => {\n const requestId1 = 'r1' as Protocol.Network.RequestId;\n const requestId2 = 'r2' as Protocol.Network.RequestId;\n\n describe('with simple requests', () => {\n const mockRequest = {\n url() {\n return 'http://foo.bar/baz';\n },\n };\n\n const mockRequestWithTrailingSlash = {\n url() {\n return 'http://foo.bar/baz/';\n },\n };\n\n const failingRequestResolver = {\n async waitFor() {\n throw new Error('Couldn\\'t resolve');\n },\n };\n\n it('renders correctly without a request', async () => {\n const {shadowRoot} = await renderRequestLinkIcon({\n affectedRequest: {requestId: requestId1},\n requestResolver: failingRequestResolver as unknown as Logs.RequestResolver.RequestResolver,\n });\n\n const {button, icon, label} = extractElements(shadowRoot);\n assert.isFalse(button.classList.contains('link'));\n assert.strictEqual(icon.name, 'arrow-up-down-circle');\n assert.isNull(label, 'Didn\\'t expect a label');\n });\n\n it('renders correctly with a request', async () => {\n const {shadowRoot} = await renderRequestLinkIcon({\n request: mockRequest as unknown as SDK.NetworkRequest.NetworkRequest,\n });\n\n const {button, icon, label} = extractElements(shadowRoot);\n assert.isTrue(button.classList.contains('link'));\n assert.strictEqual(icon.name, 'arrow-up-down-circle');\n assert.isNull(label, 'Didn\\'t expect a label');\n });\n\n it('renders the request label correctly without a trailing slash', async () => {\n const {shadowRoot} = await renderRequestLinkIcon({\n request: mockRequest as unknown as SDK.NetworkRequest.NetworkRequest,\n displayURL: true,\n });\n\n const {label} = extractElements(shadowRoot);\n assert.strictEqual(label?.textContent, 'baz');\n });\n\n it('renders the request label correctly with a trailing slash', async () => {\n const {shadowRoot} = await renderRequestLinkIcon({\n request: mockRequestWithTrailingSlash as unknown as SDK.NetworkRequest.NetworkRequest,\n displayURL: true,\n });\n\n const {label} = extractElements(shadowRoot);\n assert.strictEqual(label?.textContent, 'baz/');\n });\n\n it('renders the request label correctly without a request', async () => {\n const {shadowRoot} = await renderRequestLinkIcon({\n affectedRequest: {requestId: requestId1, url: 'https://alpha.beta/gamma'},\n requestResolver: failingRequestResolver as unknown as Logs.RequestResolver.RequestResolver,\n displayURL: true,\n });\n\n const {label} = extractElements(shadowRoot);\n assert.strictEqual(label?.textContent, 'gamma');\n });\n\n it('renders alternative text for URL', async () => {\n const {shadowRoot} = await renderRequestLinkIcon({\n affectedRequest: {requestId: requestId1, url: 'https://alpha.beta/gamma'},\n requestResolver: failingRequestResolver as unknown as Logs.RequestResolver.RequestResolver,\n displayURL: true,\n urlToDisplay: 'https://alpha.beta/gamma',\n });\n\n const {label} = extractElements(shadowRoot);\n assert.strictEqual(label?.textContent, 'https://alpha.beta/gamma');\n });\n });\n\n describe('transitions upon request resolution', () => {\n const mockRequest = {\n url() {\n return 'http://foo.bar/baz';\n },\n };\n\n it('to change the style correctly', async () => {\n const resolver = new MockRequestResolver();\n const {shadowRoot} = await renderRequestLinkIcon({\n affectedRequest: {requestId: requestId1, url: 'https://alpha.beta/gamma'},\n requestResolver: resolver as unknown as Logs.RequestResolver.RequestResolver,\n });\n\n assert.isFalse(extractElements(shadowRoot).button.classList.contains('link'));\n\n resolver.resolve(mockRequest as unknown as SDK.NetworkRequest.NetworkRequest);\n await RenderCoordinator.done({waitForWork: true});\n\n assert.isTrue(extractElements(shadowRoot).button.classList.contains('link'));\n });\n\n it('to set the label correctly', async () => {\n const resolver = new MockRequestResolver();\n const {shadowRoot} = await renderRequestLinkIcon({\n affectedRequest: {requestId: requestId1, url: 'https://alpha.beta/gamma'},\n requestResolver: resolver as unknown as Logs.RequestResolver.RequestResolver,\n displayURL: true,\n });\n\n assert.strictEqual(extractElements(shadowRoot).label?.textContent, 'gamma');\n\n resolver.resolve(mockRequest as unknown as SDK.NetworkRequest.NetworkRequest);\n await RenderCoordinator.done({waitForWork: true});\n\n assert.strictEqual(extractElements(shadowRoot).label?.textContent, 'baz');\n });\n\n it('handles multiple data assignments', async () => {\n const resolver = new MockRequestResolver();\n const {shadowRoot, component} = await renderRequestLinkIcon({\n affectedRequest: {requestId: requestId2, url: 'https://alpha.beta/gamma'},\n requestResolver: resolver as unknown as Logs.RequestResolver.RequestResolver,\n displayURL: true,\n });\n\n assert.strictEqual(extractElements(shadowRoot).label?.textContent, 'gamma');\n\n const mockRequest2 = {\n url() {\n return 'http://foo.bar/baz';\n },\n requestId() {\n return requestId1;\n },\n };\n\n component.data = {\n affectedRequest: {requestId: requestId1, url: 'https://alpha.beta/gamma'},\n requestResolver: resolver as unknown as Logs.RequestResolver.RequestResolver,\n displayURL: true,\n };\n\n resolver.resolve(mockRequest2 as unknown as SDK.NetworkRequest.NetworkRequest);\n await RenderCoordinator.done({waitForWork: true});\n\n assert.strictEqual(extractElements(shadowRoot).label?.textContent, 'baz');\n\n resolver.clear();\n });\n });\n\n describe('handles clicks correctly', () => {\n const mockRequest = {\n url() {\n return 'http://foo.bar/baz';\n },\n };\n\n before(() => {\n UI.ViewManager.resetViewRegistration();\n UI.ViewManager.registerViewExtension({\n // @ts-ignore\n location: 'mock-location',\n id: 'network',\n title: () => 'Network' as Platform.UIString.LocalizedString,\n commandPrompt: () => 'Network' as Platform.UIString.LocalizedString,\n persistence: UI.ViewManager.ViewPersistence.CLOSEABLE,\n async loadView() {\n return new UI.Widget.Widget();\n },\n });\n UI.ViewManager.ViewManager.instance({forceNew: true});\n });\n\n after(() => {\n UI.ViewManager.maybeRemoveViewExtension('network');\n });\n\n it('if the button is clicked', async () => {\n const revealOverride = sinon.fake(Common.Revealer.reveal);\n const {shadowRoot} = await renderRequestLinkIcon({\n request: mockRequest as unknown as SDK.NetworkRequest.NetworkRequest,\n displayURL: true,\n revealOverride,\n });\n\n const {button} = extractElements(shadowRoot);\n\n button.click();\n\n assert.isTrue(revealOverride.called);\n assert.isTrue(revealOverride.calledOnceWith(\n sinon.match({tab: NetworkForward.UIRequestLocation.UIRequestTabs.HEADERS_COMPONENT})));\n });\n });\n});\n"]} \ No newline at end of file diff --git a/public/ui/components/spinners/spinner.css.js b/public/ui/components/spinners/spinner.css.js index c83eee55b..6df74edd2 100644 --- a/public/ui/components/spinners/spinner.css.js +++ b/public/ui/components/spinners/spinner.css.js @@ -140,7 +140,7 @@ circle { } @keyframes indeterminate-left-circle-spinner-animation { - from { + 0% { transform: rotate(265deg); } @@ -148,13 +148,13 @@ circle { transform: rotate(130deg); } - to { + 100% { transform: rotate(265deg); } } @keyframes indeterminate-right-circle-spinner-animation { - from { + 0% { transform: rotate(-265deg); } @@ -162,7 +162,7 @@ circle { transform: rotate(-130deg); } - to { + 100% { transform: rotate(-265deg); } } diff --git a/public/ui/components/split_view/SplitView.test.js b/public/ui/components/split_view/SplitView.test.js index 6c97c22db..793ae392e 100644 --- a/public/ui/components/split_view/SplitView.test.js +++ b/public/ui/components/split_view/SplitView.test.js @@ -4,7 +4,6 @@ import { renderElementIntoDOM } from '../../../testing/DOMHelpers.js'; import * as RenderCoordinator from '../render_coordinator/render_coordinator.js'; import * as SplitView from './split_view.js'; -const coordinator = RenderCoordinator.RenderCoordinator.RenderCoordinator.instance(); describe('SplitView', () => { it('should resize split view', async () => { const view = new SplitView.SplitView.SplitView(); @@ -12,7 +11,7 @@ describe('SplitView', () => { view.style.width = '800px'; view.style.height = '600px'; const resizer = view.shadowRoot?.querySelector('#resizer'); - assert.ok(resizer); + assert.isOk(resizer); assert.strictEqual(view.style.getPropertyValue('--current-main-area-size'), '60%'); let rect = resizer.getBoundingClientRect(); resizer.dispatchEvent(new MouseEvent('mousedown', { @@ -34,10 +33,10 @@ describe('SplitView', () => { view.style.width = '800px'; view.style.height = '600px'; const resizer = view.shadowRoot?.querySelector('#resizer'); - assert.ok(resizer); + assert.isOk(resizer); view.style.width = '600px'; view.style.height = '800px'; - await coordinator.done({ waitForWork: true }); + await RenderCoordinator.done({ waitForWork: true }); const rect = resizer.getBoundingClientRect(); assert.strictEqual(rect.width, 600); assert.strictEqual(rect.height, 3); @@ -49,8 +48,8 @@ describe('SplitView', () => { view.style.width = '800px'; view.style.height = '600px'; const resizer = view.shadowRoot?.querySelector('#resizer'); - assert.ok(resizer); - await coordinator.done({ waitForWork: true }); + assert.isOk(resizer); + await RenderCoordinator.done({ waitForWork: true }); const rect = resizer.getBoundingClientRect(); assert.strictEqual(rect.width, 800); assert.strictEqual(rect.height, 3); @@ -61,7 +60,7 @@ describe('SplitView', () => { view.style.width = '800px'; view.style.height = '600px'; const resizer = view.shadowRoot?.querySelector('#resizer'); - assert.ok(resizer); + assert.isOk(resizer); view.style.width = '600px'; view.style.height = '550px'; const rect = resizer.getBoundingClientRect(); diff --git a/public/ui/components/split_view/SplitView.test.js.map b/public/ui/components/split_view/SplitView.test.js.map index 53a4f6c4f..5015ad344 100644 --- a/public/ui/components/split_view/SplitView.test.js.map +++ b/public/ui/components/split_view/SplitView.test.js.map @@ -1 +1 @@ -{"version":3,"file":"SplitView.test.js","sourceRoot":"","sources":["../../../../../../../front_end/ui/components/split_view/SplitView.test.ts"],"names":[],"mappings":"A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AI,GAAG,OAAO,CAAC,qBAAqB,EAAE,CAAC;QAC7C,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;QAClC,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IACvC,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["// Copyright 2023 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport {renderElementIntoDOM} from '../../../testing/DOMHelpers.js';\nimport * as RenderCoordinator from '../render_coordinator/render_coordinator.js';\n\nimport * as SplitView from './split_view.js';\n\nconst coordinator = RenderCoordinator.RenderCoordinator.RenderCoordinator.instance();\n\ndescribe('SplitView', () => {\n it('should resize split view', async () => {\n const view = new SplitView.SplitView.SplitView();\n renderElementIntoDOM(view);\n view.style.width = '800px';\n view.style.height = '600px';\n\n const resizer = view.shadowRoot?.querySelector(\n '#resizer',\n ) as HTMLDivElement;\n assert.ok(resizer);\n\n assert.strictEqual(\n view.style.getPropertyValue('--current-main-area-size'),\n '60%',\n );\n\n let rect = resizer.getBoundingClientRect();\n resizer.dispatchEvent(\n new MouseEvent('mousedown', {\n clientX: rect.x + rect.width / 2,\n clientY: rect.y + rect.height / 2,\n }),\n );\n\n rect = view.getBoundingClientRect();\n window.dispatchEvent(\n new MouseEvent('mousemove', {\n clientX: rect.x + rect.width / 4,\n clientY: rect.y + rect.height / 4,\n }),\n );\n\n window.dispatchEvent(new MouseEvent('mouseup'));\n // Exact value might be different based on the environment.\n assert.notStrictEqual(\n view.style.getPropertyValue('--current-main-area-size'),\n '60%',\n );\n });\n\n it('should change layout to horizontal split on resize to narrow view', async () => {\n const view = new SplitView.SplitView.SplitView();\n renderElementIntoDOM(view);\n view.style.width = '800px';\n view.style.height = '600px';\n\n const resizer = view.shadowRoot?.querySelector(\n '#resizer',\n ) as HTMLDivElement;\n assert.ok(resizer);\n\n view.style.width = '600px';\n view.style.height = '800px';\n\n await coordinator.done({waitForWork: true});\n\n const rect = resizer.getBoundingClientRect();\n assert.strictEqual(rect.width, 600);\n assert.strictEqual(rect.height, 3);\n });\n\n it('always uses horizontal split if explicitly set', async () => {\n const view = new SplitView.SplitView.SplitView();\n view.horizontal = true;\n renderElementIntoDOM(view);\n view.style.width = '800px';\n view.style.height = '600px';\n\n const resizer = view.shadowRoot?.querySelector(\n '#resizer',\n ) as HTMLDivElement;\n assert.ok(resizer);\n\n await coordinator.done({waitForWork: true});\n\n const rect = resizer.getBoundingClientRect();\n assert.strictEqual(rect.width, 800);\n assert.strictEqual(rect.height, 3);\n });\n\n it('should keep vertical split on short viewports', () => {\n const view = new SplitView.SplitView.SplitView();\n renderElementIntoDOM(view);\n view.style.width = '800px';\n view.style.height = '600px';\n\n const resizer = view.shadowRoot?.querySelector(\n '#resizer',\n ) as HTMLDivElement;\n assert.ok(resizer);\n\n view.style.width = '600px';\n view.style.height = '550px';\n\n const rect = resizer.getBoundingClientRect();\n assert.strictEqual(rect.width, 3);\n assert.strictEqual(rect.height, 550);\n });\n});\n"]} \ No newline at end of file +{"version":3,"file":"SplitView.test.js","sourceRoot":"","sources":["../../../../../../../front_end/ui/components/split_view/SplitView.test.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,EAAC,oBAAoB,EAAC,MAAM,gCAAgC,CAAC;AACpE,OAAO,KAAK,iBAAiB,MAAM,6CAA6C,CAAC;AAEjF,OAAO,KAAK,SAAS,MAAM,iBAAiB,CAAC;AAE7C,QAAQ,CAAC,WAAW,EAAE,GAAG,EAAE;IACzB,EAAE,CAAC,0BAA0B,EAAE,KAAK,IAAI,EAAE;QACxC,MAAM,IAAI,GAAG,IAAI,SAAS,CAAC,SAAS,CAAC,SAAS,EAAE,CAAC;QACjD,oBAAoB,CAAC,IAAI,CAAC,CAAC;QAC3B,IAAI,CAAC,KAAK,CAAC,KAAK,GA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BAAqB,EAAE,CAAC;QAC7C,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;QACpC,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;IACrC,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,+CAA+C,EAAE,GAAG,EAAE;QACvD,MAAM,IAAI,GAAG,IAAI,SAAS,CAAC,SAAS,CAAC,SAAS,EAAE,CAAC;QACjD,oBAAoB,CAAC,IAAI,CAAC,CAAC;QAC3B,IAAI,CAAC,KAAK,CAAC,KAAK,GAAG,OAAO,CAAC;QAC3B,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,OAAO,CAAC;QAE5B,MAAM,OAAO,GAAG,IAAI,CAAC,UAAU,EAAE,aAAa,CAC1B,UAAU,CACS,CAAC;QACxC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAErB,IAAI,CAAC,KAAK,CAAC,KAAK,GAAG,OAAO,CAAC;QAC3B,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,OAAO,CAAC;QAE5B,MAAM,IAAI,GAAG,OAAO,CAAC,qBAAqB,EAAE,CAAC;QAC7C,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;QAClC,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IACvC,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["// Copyright 2023 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport {renderElementIntoDOM} from '../../../testing/DOMHelpers.js';\nimport * as RenderCoordinator from '../render_coordinator/render_coordinator.js';\n\nimport * as SplitView from './split_view.js';\n\ndescribe('SplitView', () => {\n it('should resize split view', async () => {\n const view = new SplitView.SplitView.SplitView();\n renderElementIntoDOM(view);\n view.style.width = '800px';\n view.style.height = '600px';\n\n const resizer = view.shadowRoot?.querySelector(\n '#resizer',\n ) as HTMLDivElement;\n assert.isOk(resizer);\n\n assert.strictEqual(\n view.style.getPropertyValue('--current-main-area-size'),\n '60%',\n );\n\n let rect = resizer.getBoundingClientRect();\n resizer.dispatchEvent(\n new MouseEvent('mousedown', {\n clientX: rect.x + rect.width / 2,\n clientY: rect.y + rect.height / 2,\n }),\n );\n\n rect = view.getBoundingClientRect();\n window.dispatchEvent(\n new MouseEvent('mousemove', {\n clientX: rect.x + rect.width / 4,\n clientY: rect.y + rect.height / 4,\n }),\n );\n\n window.dispatchEvent(new MouseEvent('mouseup'));\n // Exact value might be different based on the environment.\n assert.notStrictEqual(\n view.style.getPropertyValue('--current-main-area-size'),\n '60%',\n );\n });\n\n it('should change layout to horizontal split on resize to narrow view', async () => {\n const view = new SplitView.SplitView.SplitView();\n renderElementIntoDOM(view);\n view.style.width = '800px';\n view.style.height = '600px';\n\n const resizer = view.shadowRoot?.querySelector(\n '#resizer',\n ) as HTMLDivElement;\n assert.isOk(resizer);\n\n view.style.width = '600px';\n view.style.height = '800px';\n\n await RenderCoordinator.done({waitForWork: true});\n\n const rect = resizer.getBoundingClientRect();\n assert.strictEqual(rect.width, 600);\n assert.strictEqual(rect.height, 3);\n });\n\n it('always uses horizontal split if explicitly set', async () => {\n const view = new SplitView.SplitView.SplitView();\n view.horizontal = true;\n renderElementIntoDOM(view);\n view.style.width = '800px';\n view.style.height = '600px';\n\n const resizer = view.shadowRoot?.querySelector(\n '#resizer',\n ) as HTMLDivElement;\n assert.isOk(resizer);\n\n await RenderCoordinator.done({waitForWork: true});\n\n const rect = resizer.getBoundingClientRect();\n assert.strictEqual(rect.width, 800);\n assert.strictEqual(rect.height, 3);\n });\n\n it('should keep vertical split on short viewports', () => {\n const view = new SplitView.SplitView.SplitView();\n renderElementIntoDOM(view);\n view.style.width = '800px';\n view.style.height = '600px';\n\n const resizer = view.shadowRoot?.querySelector(\n '#resizer',\n ) as HTMLDivElement;\n assert.isOk(resizer);\n\n view.style.width = '600px';\n view.style.height = '550px';\n\n const rect = resizer.getBoundingClientRect();\n assert.strictEqual(rect.width, 3);\n assert.strictEqual(rect.height, 550);\n });\n});\n"]} \ No newline at end of file diff --git a/public/ui/components/srgb_overlay/SrgbOverlay.js b/public/ui/components/srgb_overlay/SrgbOverlay.js index 350baef3d..9267f5ff1 100644 --- a/public/ui/components/srgb_overlay/SrgbOverlay.js +++ b/public/ui/components/srgb_overlay/SrgbOverlay.js @@ -2,11 +2,10 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. import * as Common from '../../../core/common/common.js'; -import * as Coordinator from '../../../ui/components/render_coordinator/render_coordinator.js'; +import * as RenderCoordinator from '../../../ui/components/render_coordinator/render_coordinator.js'; import * as LitHtml from '../../../ui/lit-html/lit-html.js'; import srgbOverlayStyles from './srgbOverlay.css.js'; const { html } = LitHtml; -const coordinator = Coordinator.RenderCoordinator.RenderCoordinator.instance(); const SRGB_LABEL_HEIGHT = 10; const SRGB_LABEL_BOTTOM = 3; const SRGB_TEXT_UPPER_POINT_FROM_BOTTOM = SRGB_LABEL_HEIGHT + SRGB_LABEL_BOTTOM; @@ -67,7 +66,7 @@ export class SrgbOverlay extends HTMLElement { return closestPoint; } render({ hue, width, height }) { - return coordinator.write('Srgb Overlay render', () => { + return RenderCoordinator.write('Srgb Overlay render', () => { const points = this.#getLinePoints({ hue, width, height }); if (!points || points.length === 0) { return; diff --git a/public/ui/components/srgb_overlay/SrgbOverlay.js.map b/public/ui/components/srgb_overlay/SrgbOverlay.js.map index 477b2e202..8718e199b 100644 --- a/public/ui/components/srgb_overlay/SrgbOverlay.js.map +++ b/public/ui/components/srgb_overlay/SrgbOverlay.js.map @@ -1 +1 @@ -{"version":3,"file":"SrgbOverlay.js","sourceRoot":"","sources":["../../../../../../../front_end/ui/components/srgb_overlay/SrgbOverlay.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE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AAC,IAAI,CAAC,GAAG,CAAC;;SAEjF,EACC,IAAI,CAAC,OAAO,EAAE,EAAC,IAAI,EAAE,IAAI,EAAC,CAAC,CAAC;QAClC,CAAC,CAAC,CAAC;IACL,CAAC;CACF;AAED,cAAc,CAAC,MAAM,CAAC,gCAAgC,EAAE,WAAW,CAAC,CAAC","sourcesContent":["// Copyright 2017 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport * as Common from '../../../core/common/common.js';\nimport * as Coordinator from '../../../ui/components/render_coordinator/render_coordinator.js';\nimport * as LitHtml from '../../../ui/lit-html/lit-html.js';\n\nimport srgbOverlayStyles from './srgbOverlay.css.js';\n\nconst {html} = LitHtml;\n\nconst coordinator = Coordinator.RenderCoordinator.RenderCoordinator.instance();\n\ntype SrgbOverlayProps = {\n // [0 - 1] corresponding to HSV hue\n hue: number,\n width: number,\n height: number,\n};\n\nconst SRGB_LABEL_HEIGHT = 10;\nconst SRGB_LABEL_BOTTOM = 3;\nconst SRGB_TEXT_UPPER_POINT_FROM_BOTTOM = SRGB_LABEL_HEIGHT + SRGB_LABEL_BOTTOM;\n\nconst EPSILON = 0.001;\n// TODO(crbug.com/1409892): Use `Color` class here for a better code (and not duplicate isInGamut logic here)\nfunction isColorInSrgbGamut(hsv: Common.ColorUtils.Color3D): boolean {\n const rgba = Common.Color.hsva2rgba([...hsv, 1]);\n const xyzd50 = Common.ColorConverter.ColorConverter.displayP3ToXyzd50(rgba[0], rgba[1], rgba[2]);\n const srgb = Common.ColorConverter.ColorConverter.xyzd50ToSrgb(xyzd50[0], xyzd50[1], xyzd50[2]);\n return srgb.every(val => val + EPSILON >= 0 && val - EPSILON <= 1);\n}\n\nexport class SrgbOverlay extends HTMLElement {\n readonly #shadow = this.attachShadow({mode: 'open'});\n\n constructor() {\n super();\n this.#shadow.adoptedStyleSheets = [\n srgbOverlayStyles,\n ];\n }\n\n #getLinePoints({hue, width, height}: SrgbOverlayProps): {x: number, y: number}[]|null {\n if (width === 0 || height === 0) {\n return null;\n }\n\n const step = 1 / window.devicePixelRatio;\n const linePoints = [];\n let x = 0;\n for (let y = 0; y < height; y += step) {\n const value = 1 - (y / height);\n\n for (; x < width; x += step) {\n const saturation = x / width;\n if (!isColorInSrgbGamut([hue, saturation, value])) {\n linePoints.push({x, y});\n break;\n }\n }\n }\n\n if (linePoints.length === 0) {\n return null;\n }\n\n const lastPoint = linePoints[linePoints.length - 1];\n if (lastPoint.x < width) {\n linePoints.push({\n y: lastPoint.y,\n x: width,\n });\n }\n\n return linePoints;\n }\n\n #closestPointAtHeight(points: {x: number, y: number}[], atHeight: number): {x: number, y: number}|null {\n let min = Infinity;\n let closestPoint = null;\n for (const point of points) {\n if (Math.abs(atHeight - point.y) <= min) {\n min = Math.abs(atHeight - point.y);\n closestPoint = point;\n }\n }\n\n return closestPoint;\n }\n\n render({hue, width, height}: SrgbOverlayProps): Promise {\n return coordinator.write('Srgb Overlay render', () => {\n const points = this.#getLinePoints({hue, width, height});\n if (!points || points.length === 0) {\n return;\n }\n\n const closestPoint = this.#closestPointAtHeight(points, height - SRGB_TEXT_UPPER_POINT_FROM_BOTTOM);\n if (!closestPoint) {\n return;\n }\n\n LitHtml.render(\n html`\n sRGB\n \n `${point.x.toFixed(2)},${point.y.toFixed(2)}`).join(' ')} class=\"gamut-line\" />\n \n `,\n this.#shadow, {host: this});\n });\n }\n}\n\ncustomElements.define('devtools-spectrum-srgb-overlay', SrgbOverlay);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'devtools-spectrum-srgb-overlay': SrgbOverlay;\n }\n}\n"]} \ No newline at end of file +{"version":3,"file":"SrgbOverlay.js","sourceRoot":"","sources":["../../../../../../../front_end/ui/components/srgb_overlay/SrgbOverlay.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,KAAK,MAAM,MAAM,gCAAgC,CAAC;AACzD,OAAO,KAAK,iBAAiB,MA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AAc,CAAC,MAAM,CAAC,gCAAgC,EAAE,WAAW,CAAC,CAAC","sourcesContent":["// Copyright 2017 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport * as Common from '../../../core/common/common.js';\nimport * as RenderCoordinator from '../../../ui/components/render_coordinator/render_coordinator.js';\nimport * as LitHtml from '../../../ui/lit-html/lit-html.js';\n\nimport srgbOverlayStyles from './srgbOverlay.css.js';\n\nconst {html} = LitHtml;\n\ntype SrgbOverlayProps = {\n // [0 - 1] corresponding to HSV hue\n hue: number,\n width: number,\n height: number,\n};\n\nconst SRGB_LABEL_HEIGHT = 10;\nconst SRGB_LABEL_BOTTOM = 3;\nconst SRGB_TEXT_UPPER_POINT_FROM_BOTTOM = SRGB_LABEL_HEIGHT + SRGB_LABEL_BOTTOM;\n\nconst EPSILON = 0.001;\n// TODO(crbug.com/1409892): Use `Color` class here for a better code (and not duplicate isInGamut logic here)\nfunction isColorInSrgbGamut(hsv: Common.ColorUtils.Color3D): boolean {\n const rgba = Common.Color.hsva2rgba([...hsv, 1]);\n const xyzd50 = Common.ColorConverter.ColorConverter.displayP3ToXyzd50(rgba[0], rgba[1], rgba[2]);\n const srgb = Common.ColorConverter.ColorConverter.xyzd50ToSrgb(xyzd50[0], xyzd50[1], xyzd50[2]);\n return srgb.every(val => val + EPSILON >= 0 && val - EPSILON <= 1);\n}\n\nexport class SrgbOverlay extends HTMLElement {\n readonly #shadow = this.attachShadow({mode: 'open'});\n\n constructor() {\n super();\n this.#shadow.adoptedStyleSheets = [\n srgbOverlayStyles,\n ];\n }\n\n #getLinePoints({hue, width, height}: SrgbOverlayProps): {x: number, y: number}[]|null {\n if (width === 0 || height === 0) {\n return null;\n }\n\n const step = 1 / window.devicePixelRatio;\n const linePoints = [];\n let x = 0;\n for (let y = 0; y < height; y += step) {\n const value = 1 - (y / height);\n\n for (; x < width; x += step) {\n const saturation = x / width;\n if (!isColorInSrgbGamut([hue, saturation, value])) {\n linePoints.push({x, y});\n break;\n }\n }\n }\n\n if (linePoints.length === 0) {\n return null;\n }\n\n const lastPoint = linePoints[linePoints.length - 1];\n if (lastPoint.x < width) {\n linePoints.push({\n y: lastPoint.y,\n x: width,\n });\n }\n\n return linePoints;\n }\n\n #closestPointAtHeight(points: {x: number, y: number}[], atHeight: number): {x: number, y: number}|null {\n let min = Infinity;\n let closestPoint = null;\n for (const point of points) {\n if (Math.abs(atHeight - point.y) <= min) {\n min = Math.abs(atHeight - point.y);\n closestPoint = point;\n }\n }\n\n return closestPoint;\n }\n\n render({hue, width, height}: SrgbOverlayProps): Promise {\n return RenderCoordinator.write('Srgb Overlay render', () => {\n const points = this.#getLinePoints({hue, width, height});\n if (!points || points.length === 0) {\n return;\n }\n\n const closestPoint = this.#closestPointAtHeight(points, height - SRGB_TEXT_UPPER_POINT_FROM_BOTTOM);\n if (!closestPoint) {\n return;\n }\n\n LitHtml.render(\n html`\n sRGB\n \n `${point.x.toFixed(2)},${point.y.toFixed(2)}`).join(' ')} class=\"gamut-line\" />\n \n `,\n this.#shadow, {host: this});\n });\n }\n}\n\ncustomElements.define('devtools-spectrum-srgb-overlay', SrgbOverlay);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'devtools-spectrum-srgb-overlay': SrgbOverlay;\n }\n}\n"]} \ No newline at end of file diff --git a/public/ui/components/srgb_overlay/srgbOverlay.css.js b/public/ui/components/srgb_overlay/srgbOverlay.css.js index b7eeb0a5f..1cde2ec3b 100644 --- a/public/ui/components/srgb_overlay/srgbOverlay.css.js +++ b/public/ui/components/srgb_overlay/srgbOverlay.css.js @@ -21,7 +21,7 @@ styles.replaceSync( .gamut-line { /* We want to show 50% white color in all themes since this is drawn over a color rectangle */ - stroke: color-mix(in sRGB, var(--ref-palette-neutral100) 50%, transparent); /* stylelint-disable-line plugin/use_theme_colors */ + stroke: color-mix(in srgb, var(--ref-palette-neutral100) 50%, transparent); /* stylelint-disable-line plugin/use_theme_colors */ fill: none; } @@ -30,7 +30,7 @@ styles.replaceSync( bottom: 3px; margin-right: 5px; /* We want to show 50% white color in all themes since this is drawn over a color rectangle */ - color: color-mix(in sRGB, var(--ref-palette-neutral100) 50%, transparent); /* stylelint-disable-line plugin/use_theme_colors */ + color: color-mix(in srgb, var(--ref-palette-neutral100) 50%, transparent); /* stylelint-disable-line plugin/use_theme_colors */ } /*# sourceURL=srgbOverlay.css */ diff --git a/public/ui/components/suggestion_input/suggestionInput.css.js b/public/ui/components/suggestion_input/suggestionInput.css.js index ec0df85ac..9a8b380ac 100644 --- a/public/ui/components/suggestion_input/suggestionInput.css.js +++ b/public/ui/components/suggestion_input/suggestionInput.css.js @@ -65,8 +65,7 @@ devtools-editable-content:focus ~ devtools-suggestion-box { box-shadow: var(--drop-shadow); min-height: 1em; min-width: 150px; - overflow-x: hidden; - overflow-y: auto; + overflow: hidden auto; position: relative; z-index: 100; max-height: 350px; diff --git a/public/ui/components/text_editor/TextEditor.test.js b/public/ui/components/text_editor/TextEditor.test.js index c00b4510a..01c8c067a 100644 --- a/public/ui/components/text_editor/TextEditor.test.js +++ b/public/ui/components/text_editor/TextEditor.test.js @@ -44,15 +44,15 @@ describeWithEnvironment('TextEditor', () => { it('can highlight whitespace', () => { const editor = new TextEditor.TextEditor.TextEditor(makeState('line1 \n line2( )\n\tline3 ', TextEditor.Config.showWhitespace.instance())); renderElementIntoDOM(editor); - assert.strictEqual(editor.editor.dom.querySelectorAll('.cm-trailingWhitespace, .cm-highlightedSpaces').length, 0); + assert.lengthOf(editor.editor.dom.querySelectorAll('.cm-trailingWhitespace, .cm-highlightedSpaces'), 0); Common.Settings.Settings.instance().moduleSetting('show-whitespaces-in-editor').set('all'); - assert.strictEqual(editor.editor.dom.querySelectorAll('.cm-highlightedSpaces').length, 4); - assert.strictEqual(editor.editor.dom.querySelectorAll('.cm-highlightedTab').length, 1); + assert.lengthOf(editor.editor.dom.querySelectorAll('.cm-highlightedSpaces'), 4); + assert.lengthOf(editor.editor.dom.querySelectorAll('.cm-highlightedTab'), 1); Common.Settings.Settings.instance().moduleSetting('show-whitespaces-in-editor').set('trailing'); - assert.strictEqual(editor.editor.dom.querySelectorAll('.cm-highlightedSpaces').length, 0); - assert.strictEqual(editor.editor.dom.querySelectorAll('.cm-trailingWhitespace').length, 2); + assert.lengthOf(editor.editor.dom.querySelectorAll('.cm-highlightedSpaces'), 0); + assert.lengthOf(editor.editor.dom.querySelectorAll('.cm-trailingWhitespace'), 2); Common.Settings.Settings.instance().moduleSetting('show-whitespaces-in-editor').set('none'); - assert.strictEqual(editor.editor.dom.querySelectorAll('.cm-trailingWhitespace, .cm-highlightedSpaces').length, 0); + assert.lengthOf(editor.editor.dom.querySelectorAll('.cm-trailingWhitespace, .cm-highlightedSpaces'), 0); editor.remove(); }); it('should restore scroll to the same position after reconnecting to DOM when it is scrollable', async () => { diff --git a/public/ui/components/text_editor/TextEditor.test.js.map b/public/ui/components/text_editor/TextEditor.test.js.map index 1cdf4f929..d8d9d51cc 100644 --- a/public/ui/components/text_editor/TextEditor.test.js.map +++ b/public/ui/components/text_editor/TextEditor.test.js.map @@ -1 +1 @@ -{"version":3,"file":"TextEditor.test.js","sourceRoot":"","sources":["../../../../../../../front_end/ui/components/text_editor/TextEditor.test.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,KAAK,MAAM,MAAM,gCAAgC,CAAC;AAEzD,OAAO,KAAK,GAAG,MAAM,0BAA0B,CAAC;AAEhD,OAAO,KAAK,QAAQ,MAAM,sCAAsC,CAAC;AACjE,OAAO,KAAK,SAAS,MAAM,wCAAwC,CAAC;AACpE,OAAO,EAAC,oBAAoB,EAAC,MAAM,gCAAgC,CAAC;AACpE,OAAO,EACL,YAAY,EACZ,uBAAuB,GACxB,MAAM,wCAAwC,CAAC;AAChD,OAAO,EAAC,UAAU,EAAC,MAAM,oCAAoC,CAAC;AAC9D,OAAO,EAAC,UAAU,EAAC,MAAM,2CAA2C,CAAC;A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,KAAK,CAAC,sBAAsB,CAAC,CAAC;YAChC,CAAC;YAEQ,YAAY,CAAC,MAAyB;gBAC7C,OAAO,MAAM,KAAK,UAAU,CAAC;YAC/B,CAAC;SACF,EAAE,CAAC,CAAC;QAEL,MAAM,KAAK,GAAG,SAAS,CAAC,GAAG,EAAE,UAAU,CAAC,UAAU,CAAC,kBAAkB,CAAC,CAAC;QACvE,MAAM,MAAM,GACR,MAAM,UAAU,CAAC,UAAU,CAAC,0BAA0B,CAAC,IAAI,UAAU,CAAC,iBAAiB,CAAC,KAAK,EAAE,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC;QAC9G,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IACxB,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["// Copyright 2020 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport * as Common from '../../../core/common/common.js';\nimport type * as Platform from '../../../core/platform/platform.js';\nimport * as SDK from '../../../core/sdk/sdk.js';\nimport type * as Protocol from '../../../generated/protocol.js';\nimport * as Bindings from '../../../models/bindings/bindings.js';\nimport * as Workspace from '../../../models/workspace/workspace.js';\nimport {renderElementIntoDOM} from '../../../testing/DOMHelpers.js';\nimport {\n createTarget,\n describeWithEnvironment,\n} from '../../../testing/EnvironmentHelpers.js';\nimport {expectCall} from '../../../testing/ExpectStubCall.js';\nimport {TestPlugin} from '../../../testing/LanguagePluginHelpers.js';\nimport {describeWithMockConnection} from '../../../testing/MockConnection.js';\nimport {MockExecutionContext} from '../../../testing/MockExecutionContext.js';\nimport * as CodeMirror from '../../../third_party/codemirror.next/codemirror.next.js';\nimport * as UI from '../../legacy/legacy.js';\n\nimport * as TextEditor from './text_editor.js';\n\nfunction makeState(doc: string, extensions: CodeMirror.Extension = []) {\n return CodeMirror.EditorState.create({\n doc,\n extensions: [\n extensions,\n TextEditor.Config.baseConfiguration(doc),\n TextEditor.Config.autocompletion.instance(),\n ],\n });\n}\n\ndescribeWithEnvironment('TextEditor', () => {\n describe('component', () => {\n it('has a state property', () => {\n const editor = new TextEditor.TextEditor.TextEditor(makeState('one'));\n assert.strictEqual(editor.state.doc.toString(), 'one');\n editor.state = makeState('two');\n assert.strictEqual(editor.state.doc.toString(), 'two');\n renderElementIntoDOM(editor);\n assert.strictEqual(editor.editor.state.doc.toString(), 'two');\n editor.editor.dispatch({changes: {from: 3, insert: '!'}});\n editor.remove();\n assert.strictEqual(editor.editor.state.doc.toString(), 'two!');\n });\n\n it('sets an aria-label attribute', () => {\n const editor = new TextEditor.TextEditor.TextEditor(makeState(''));\n assert.strictEqual(editor.editor.contentDOM.getAttribute('aria-label'), 'Code editor');\n });\n\n it('can highlight whitespace', () => {\n const editor = new TextEditor.TextEditor.TextEditor(\n makeState('line1 \\n line2( )\\n\\tline3 ', TextEditor.Config.showWhitespace.instance()));\n renderElementIntoDOM(editor);\n assert.strictEqual(editor.editor.dom.querySelectorAll('.cm-trailingWhitespace, .cm-highlightedSpaces').length, 0);\n Common.Settings.Settings.instance().moduleSetting('show-whitespaces-in-editor').set('all');\n assert.strictEqual(editor.editor.dom.querySelectorAll('.cm-highlightedSpaces').length, 4);\n assert.strictEqual(editor.editor.dom.querySelectorAll('.cm-highlightedTab').length, 1);\n Common.Settings.Settings.instance().moduleSetting('show-whitespaces-in-editor').set('trailing');\n assert.strictEqual(editor.editor.dom.querySelectorAll('.cm-highlightedSpaces').length, 0);\n assert.strictEqual(editor.editor.dom.querySelectorAll('.cm-trailingWhitespace').length, 2);\n Common.Settings.Settings.instance().moduleSetting('show-whitespaces-in-editor').set('none');\n assert.strictEqual(editor.editor.dom.querySelectorAll('.cm-trailingWhitespace, .cm-highlightedSpaces').length, 0);\n editor.remove();\n });\n\n it('should restore scroll to the same position after reconnecting to DOM when it is scrollable', async () => {\n const editor = new TextEditor.TextEditor.TextEditor(makeState(\n 'line1\\nline2\\nline3\\nline4\\nline5\\nline6andthisisalonglinesothatwehaveenoughspacetoscrollhorizontally',\n [CodeMirror.EditorView.theme(\n {'&.cm-editor': {height: '50px', width: '50px'}, '.cm-scroller': {overflow: 'auto'}})]));\n const scrollEventHandledToSaveScrollPositionForTest =\n sinon.stub(editor, 'scrollEventHandledToSaveScrollPositionForTest');\n const waitForFirstScrollPromise = expectCall(scrollEventHandledToSaveScrollPositionForTest);\n renderElementIntoDOM(editor);\n editor.editor.dispatch({\n effects: CodeMirror.EditorView.scrollIntoView(0, {\n x: 'start',\n xMargin: -20,\n y: 'start',\n yMargin: -20,\n }),\n });\n await waitForFirstScrollPromise;\n const scrollTopBeforeRemove = editor.editor.scrollDOM.scrollTop;\n const scrollLeftBeforeRemove = editor.editor.scrollDOM.scrollLeft;\n\n const waitForSecondScrollPromise = expectCall(scrollEventHandledToSaveScrollPositionForTest);\n editor.remove();\n renderElementIntoDOM(editor);\n await waitForSecondScrollPromise;\n\n const scrollTopAfterReconnect = editor.editor.scrollDOM.scrollTop;\n const scrollLeftAfterReconnect = editor.editor.scrollDOM.scrollLeft;\n assert.strictEqual(scrollTopBeforeRemove, scrollTopAfterReconnect);\n assert.strictEqual(scrollLeftBeforeRemove, scrollLeftAfterReconnect);\n });\n });\n\n describe('configuration', () => {\n it('can detect line separators', () => {\n assert.strictEqual(makeState('one\\r\\ntwo\\r\\nthree').lineBreak, '\\r\\n');\n assert.strictEqual(makeState('one\\ntwo\\nthree').lineBreak, '\\n');\n assert.strictEqual(makeState('one\\r\\ntwo\\nthree').lineBreak, '\\n');\n });\n\n it('handles dynamic reconfiguration', () => {\n const editor = new TextEditor.TextEditor.TextEditor(makeState(''));\n renderElementIntoDOM(editor);\n\n assert.strictEqual(editor.state.facet(CodeMirror.indentUnit), ' ');\n Common.Settings.Settings.instance().moduleSetting('text-editor-indent').set('\\t');\n assert.strictEqual(editor.state.facet(CodeMirror.indentUnit), '\\t');\n Common.Settings.Settings.instance().moduleSetting('text-editor-indent').set(' ');\n });\n\n it('does not treat dashes as word chars in CSS', () => {\n const state = makeState('.some-selector {}', CodeMirror.css.cssLanguage);\n const {from, to} = state.wordAt(1)!;\n assert.strictEqual(state.sliceDoc(from, to), 'some');\n });\n });\n\n describe('autocompletion', () => {\n it('can complete builtins and keywords', async () => {\n const state = makeState('c', CodeMirror.javascript.javascriptLanguage);\n const result =\n await TextEditor.JavaScript.javascriptCompletionSource(new CodeMirror.CompletionContext(state, 1, false));\n assert.isNotNull(result);\n const completions = result ? result.options : [];\n assert.isTrue(completions.some(o => o.label === 'clear'));\n assert.isTrue(completions.some(o => o.label === 'continue'));\n });\n\n async function testQueryType(\n code: string,\n pos: number,\n type?: TextEditor.JavaScript.QueryType,\n range: string = '',\n related?: string,\n ): Promise {\n const state = makeState(code, CodeMirror.javascript.javascriptLanguage);\n const query = TextEditor.JavaScript.getQueryType(CodeMirror.syntaxTree(state), pos, state.doc);\n if (type === undefined) {\n assert.isNull(query);\n } else {\n assert.isNotNull(query);\n if (query) {\n assert.strictEqual(query.type, type);\n assert.strictEqual(code.slice(query.from ?? pos, pos), range);\n assert.strictEqual(query.relatedNode && code.slice(query.relatedNode.from, query.relatedNode.to), related);\n }\n }\n }\n\n it('recognizes expression queries', async () => {\n await testQueryType('foo', 3, TextEditor.JavaScript.QueryType.EXPRESSION, 'foo');\n await testQueryType('foo ', 4, TextEditor.JavaScript.QueryType.EXPRESSION, '');\n await testQueryType('let', 3, TextEditor.JavaScript.QueryType.EXPRESSION, 'let');\n });\n\n it('recognizes propery name queries', async () => {\n await testQueryType('foo.bar', 7, TextEditor.JavaScript.QueryType.PROPERTY_NAME, 'bar', 'foo.bar');\n await testQueryType('foo.', 4, TextEditor.JavaScript.QueryType.PROPERTY_NAME, '', 'foo.');\n await testQueryType('if (foo.', 8, TextEditor.JavaScript.QueryType.PROPERTY_NAME, '', 'foo.');\n await testQueryType('new foo.bar().', 14, TextEditor.JavaScript.QueryType.PROPERTY_NAME, '', 'new foo.bar().');\n await testQueryType('foo?.', 5, TextEditor.JavaScript.QueryType.PROPERTY_NAME, '', 'foo?.');\n await testQueryType('foo?.b', 6, TextEditor.JavaScript.QueryType.PROPERTY_NAME, 'b', 'foo?.b');\n });\n\n it('recognizes property expression queries', async () => {\n await testQueryType('foo[', 4, TextEditor.JavaScript.QueryType.PROPERTY_EXPRESSION, '', 'foo[');\n await testQueryType('foo[\"ba', 7, TextEditor.JavaScript.QueryType.PROPERTY_EXPRESSION, '\"ba', 'foo[\"ba');\n });\n\n describe('potential map key retrievals', () => {\n it('recognizes potential maps', async () => {\n await testQueryType('foo.get(', 8, TextEditor.JavaScript.QueryType.POTENTIALLY_RETRIEVING_FROM_MAP, '', 'foo');\n await testQueryType(\n 'foo\\n.get(', 9, TextEditor.JavaScript.QueryType.POTENTIALLY_RETRIEVING_FROM_MAP, '', 'foo');\n });\n\n it('leaves other expressions as-is', async () => {\n await testQueryType('foo.method(', 11, TextEditor.JavaScript.QueryType.EXPRESSION);\n await testQueryType('5 + (', 5, TextEditor.JavaScript.QueryType.EXPRESSION);\n await testQueryType('functionCall(', 13, TextEditor.JavaScript.QueryType.EXPRESSION);\n });\n });\n\n it('does not complete in inappropriate places', async () => {\n await testQueryType('\"foo bar\"', 4);\n await testQueryType('x[\"foo\" + \"bar', 14);\n await testQueryType('// comment', 10);\n });\n });\n\n it('dispatching a transaction from a saved editor reference should not throw an error', () => {\n const textEditor = new TextEditor.TextEditor.TextEditor(makeState('one'));\n const editorViewA = textEditor.editor;\n\n renderElementIntoDOM(textEditor);\n // textEditor.editor references to EditorView A.\n textEditor.dispatch({changes: {from: 0, insert: 'a'}});\n // `disconnectedCallback` removed `textEditor.#activeEditor`\n // so reaching to `textEditor.editor` will create a new EditorView after this.\n textEditor.remove();\n // EditorView B is created from the previous state\n // and EditorView B's state is diverged from previous state after this transaction.\n textEditor.dispatch({changes: {from: 0, insert: 'b'}});\n\n // directly dispatching from Editor A now calls `textEditor.editor.update`\n // which references to EditorView B that has a different state.\n assert.doesNotThrow(() => editorViewA.dispatch({changes: {from: 3, insert: '!'}}));\n });\n});\n\ndescribeWithMockConnection('TextEditor autocompletion', () => {\n it('does not complete on language plugin frames', async () => {\n const executionContext = new MockExecutionContext(createTarget());\n const {debuggerModel} = executionContext;\n UI.Context.Context.instance().setFlavor(SDK.RuntimeModel.ExecutionContext, executionContext);\n const workspace = Workspace.Workspace.WorkspaceImpl.instance();\n const targetManager = SDK.TargetManager.TargetManager.instance();\n const resourceMapping = new Bindings.ResourceMapping.ResourceMapping(targetManager, workspace);\n\n const {pluginManager} = Bindings.DebuggerWorkspaceBinding.DebuggerWorkspaceBinding.instance(\n {forceNew: true, targetManager, resourceMapping});\n const testScript = debuggerModel.parsedScriptSource(\n '1' as Protocol.Runtime.ScriptId, 'script://1' as Platform.DevToolsPath.UrlString, 0, 0, 0, 0,\n executionContext.id, '', undefined, false, undefined, false, false, 0, null, null, null, null, null, null);\n const payload: Protocol.Debugger.CallFrame = {\n callFrameId: '0' as Protocol.Debugger.CallFrameId,\n functionName: 'test',\n functionLocation: undefined,\n location: {\n scriptId: testScript.scriptId,\n lineNumber: 0,\n columnNumber: 0,\n },\n url: 'test-url',\n scopeChain: [],\n this: {type: 'object'} as Protocol.Runtime.RemoteObject,\n returnValue: undefined,\n canBeRestarted: false,\n };\n const callframe = new SDK.DebuggerModel.CallFrame(debuggerModel, testScript, payload);\n\n executionContext.debuggerModel.setSelectedCallFrame(callframe);\n pluginManager.addPlugin(new class extends TestPlugin {\n constructor() {\n super('TextEditorTestPlugin');\n }\n\n override handleScript(script: SDK.Script.Script) {\n return script === testScript;\n }\n }());\n\n const state = makeState('c', CodeMirror.javascript.javascriptLanguage);\n const result =\n await TextEditor.JavaScript.javascriptCompletionSource(new CodeMirror.CompletionContext(state, 1, false));\n assert.isNull(result);\n });\n});\n"]} \ No newline at end of file +{"version":3,"file":"TextEditor.test.js","sourceRoot":"","sources":["../../../../../../../front_end/ui/components/text_editor/TextEditor.test.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;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E,EAAC,IAAI,EAAE,QAAQ,EAAkC;YACvD,WAAW,EAAE,SAAS;YACtB,cAAc,EAAE,KAAK;SACtB,CAAC;QACF,MAAM,SAAS,GAAG,IAAI,GAAG,CAAC,aAAa,CAAC,SAAS,CAAC,aAAa,EAAE,UAAU,EAAE,OAAO,CAAC,CAAC;QAEtF,gBAAgB,CAAC,aAAa,CAAC,oBAAoB,CAAC,SAAS,CAAC,CAAC;QAC/D,aAAa,CAAC,SAAS,CAAC,IAAI,KAAM,SAAQ,UAAU;YAClD;gBACE,KAAK,CAAC,sBAAsB,CAAC,CAAC;YAChC,CAAC;YAEQ,YAAY,CAAC,MAAyB;gBAC7C,OAAO,MAAM,KAAK,UAAU,CAAC;YAC/B,CAAC;SACF,EAAE,CAAC,CAAC;QAEL,MAAM,KAAK,GAAG,SAAS,CAAC,GAAG,EAAE,UAAU,CAAC,UAAU,CAAC,kBAAkB,CAAC,CAAC;QACvE,MAAM,MAAM,GACR,MAAM,UAAU,CAAC,UAAU,CAAC,0BAA0B,CAAC,IAAI,UAAU,CAAC,iBAAiB,CAAC,KAAK,EAAE,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC;QAC9G,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IACxB,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["// Copyright 2020 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport * as Common from '../../../core/common/common.js';\nimport type * as Platform from '../../../core/platform/platform.js';\nimport * as SDK from '../../../core/sdk/sdk.js';\nimport type * as Protocol from '../../../generated/protocol.js';\nimport * as Bindings from '../../../models/bindings/bindings.js';\nimport * as Workspace from '../../../models/workspace/workspace.js';\nimport {renderElementIntoDOM} from '../../../testing/DOMHelpers.js';\nimport {\n createTarget,\n describeWithEnvironment,\n} from '../../../testing/EnvironmentHelpers.js';\nimport {expectCall} from '../../../testing/ExpectStubCall.js';\nimport {TestPlugin} from '../../../testing/LanguagePluginHelpers.js';\nimport {describeWithMockConnection} from '../../../testing/MockConnection.js';\nimport {MockExecutionContext} from '../../../testing/MockExecutionContext.js';\nimport * as CodeMirror from '../../../third_party/codemirror.next/codemirror.next.js';\nimport * as UI from '../../legacy/legacy.js';\n\nimport * as TextEditor from './text_editor.js';\n\nfunction makeState(doc: string, extensions: CodeMirror.Extension = []) {\n return CodeMirror.EditorState.create({\n doc,\n extensions: [\n extensions,\n TextEditor.Config.baseConfiguration(doc),\n TextEditor.Config.autocompletion.instance(),\n ],\n });\n}\n\ndescribeWithEnvironment('TextEditor', () => {\n describe('component', () => {\n it('has a state property', () => {\n const editor = new TextEditor.TextEditor.TextEditor(makeState('one'));\n assert.strictEqual(editor.state.doc.toString(), 'one');\n editor.state = makeState('two');\n assert.strictEqual(editor.state.doc.toString(), 'two');\n renderElementIntoDOM(editor);\n assert.strictEqual(editor.editor.state.doc.toString(), 'two');\n editor.editor.dispatch({changes: {from: 3, insert: '!'}});\n editor.remove();\n assert.strictEqual(editor.editor.state.doc.toString(), 'two!');\n });\n\n it('sets an aria-label attribute', () => {\n const editor = new TextEditor.TextEditor.TextEditor(makeState(''));\n assert.strictEqual(editor.editor.contentDOM.getAttribute('aria-label'), 'Code editor');\n });\n\n it('can highlight whitespace', () => {\n const editor = new TextEditor.TextEditor.TextEditor(\n makeState('line1 \\n line2( )\\n\\tline3 ', TextEditor.Config.showWhitespace.instance()));\n renderElementIntoDOM(editor);\n assert.lengthOf(editor.editor.dom.querySelectorAll('.cm-trailingWhitespace, .cm-highlightedSpaces'), 0);\n Common.Settings.Settings.instance().moduleSetting('show-whitespaces-in-editor').set('all');\n assert.lengthOf(editor.editor.dom.querySelectorAll('.cm-highlightedSpaces'), 4);\n assert.lengthOf(editor.editor.dom.querySelectorAll('.cm-highlightedTab'), 1);\n Common.Settings.Settings.instance().moduleSetting('show-whitespaces-in-editor').set('trailing');\n assert.lengthOf(editor.editor.dom.querySelectorAll('.cm-highlightedSpaces'), 0);\n assert.lengthOf(editor.editor.dom.querySelectorAll('.cm-trailingWhitespace'), 2);\n Common.Settings.Settings.instance().moduleSetting('show-whitespaces-in-editor').set('none');\n assert.lengthOf(editor.editor.dom.querySelectorAll('.cm-trailingWhitespace, .cm-highlightedSpaces'), 0);\n editor.remove();\n });\n\n it('should restore scroll to the same position after reconnecting to DOM when it is scrollable', async () => {\n const editor = new TextEditor.TextEditor.TextEditor(makeState(\n 'line1\\nline2\\nline3\\nline4\\nline5\\nline6andthisisalonglinesothatwehaveenoughspacetoscrollhorizontally',\n [CodeMirror.EditorView.theme(\n {'&.cm-editor': {height: '50px', width: '50px'}, '.cm-scroller': {overflow: 'auto'}})]));\n const scrollEventHandledToSaveScrollPositionForTest =\n sinon.stub(editor, 'scrollEventHandledToSaveScrollPositionForTest');\n const waitForFirstScrollPromise = expectCall(scrollEventHandledToSaveScrollPositionForTest);\n renderElementIntoDOM(editor);\n editor.editor.dispatch({\n effects: CodeMirror.EditorView.scrollIntoView(0, {\n x: 'start',\n xMargin: -20,\n y: 'start',\n yMargin: -20,\n }),\n });\n await waitForFirstScrollPromise;\n const scrollTopBeforeRemove = editor.editor.scrollDOM.scrollTop;\n const scrollLeftBeforeRemove = editor.editor.scrollDOM.scrollLeft;\n\n const waitForSecondScrollPromise = expectCall(scrollEventHandledToSaveScrollPositionForTest);\n editor.remove();\n renderElementIntoDOM(editor);\n await waitForSecondScrollPromise;\n\n const scrollTopAfterReconnect = editor.editor.scrollDOM.scrollTop;\n const scrollLeftAfterReconnect = editor.editor.scrollDOM.scrollLeft;\n assert.strictEqual(scrollTopBeforeRemove, scrollTopAfterReconnect);\n assert.strictEqual(scrollLeftBeforeRemove, scrollLeftAfterReconnect);\n });\n });\n\n describe('configuration', () => {\n it('can detect line separators', () => {\n assert.strictEqual(makeState('one\\r\\ntwo\\r\\nthree').lineBreak, '\\r\\n');\n assert.strictEqual(makeState('one\\ntwo\\nthree').lineBreak, '\\n');\n assert.strictEqual(makeState('one\\r\\ntwo\\nthree').lineBreak, '\\n');\n });\n\n it('handles dynamic reconfiguration', () => {\n const editor = new TextEditor.TextEditor.TextEditor(makeState(''));\n renderElementIntoDOM(editor);\n\n assert.strictEqual(editor.state.facet(CodeMirror.indentUnit), ' ');\n Common.Settings.Settings.instance().moduleSetting('text-editor-indent').set('\\t');\n assert.strictEqual(editor.state.facet(CodeMirror.indentUnit), '\\t');\n Common.Settings.Settings.instance().moduleSetting('text-editor-indent').set(' ');\n });\n\n it('does not treat dashes as word chars in CSS', () => {\n const state = makeState('.some-selector {}', CodeMirror.css.cssLanguage);\n const {from, to} = state.wordAt(1)!;\n assert.strictEqual(state.sliceDoc(from, to), 'some');\n });\n });\n\n describe('autocompletion', () => {\n it('can complete builtins and keywords', async () => {\n const state = makeState('c', CodeMirror.javascript.javascriptLanguage);\n const result =\n await TextEditor.JavaScript.javascriptCompletionSource(new CodeMirror.CompletionContext(state, 1, false));\n assert.isNotNull(result);\n const completions = result ? result.options : [];\n assert.isTrue(completions.some(o => o.label === 'clear'));\n assert.isTrue(completions.some(o => o.label === 'continue'));\n });\n\n async function testQueryType(\n code: string,\n pos: number,\n type?: TextEditor.JavaScript.QueryType,\n range: string = '',\n related?: string,\n ): Promise {\n const state = makeState(code, CodeMirror.javascript.javascriptLanguage);\n const query = TextEditor.JavaScript.getQueryType(CodeMirror.syntaxTree(state), pos, state.doc);\n if (type === undefined) {\n assert.isNull(query);\n } else {\n assert.isNotNull(query);\n if (query) {\n assert.strictEqual(query.type, type);\n assert.strictEqual(code.slice(query.from ?? pos, pos), range);\n assert.strictEqual(query.relatedNode && code.slice(query.relatedNode.from, query.relatedNode.to), related);\n }\n }\n }\n\n it('recognizes expression queries', async () => {\n await testQueryType('foo', 3, TextEditor.JavaScript.QueryType.EXPRESSION, 'foo');\n await testQueryType('foo ', 4, TextEditor.JavaScript.QueryType.EXPRESSION, '');\n await testQueryType('let', 3, TextEditor.JavaScript.QueryType.EXPRESSION, 'let');\n });\n\n it('recognizes propery name queries', async () => {\n await testQueryType('foo.bar', 7, TextEditor.JavaScript.QueryType.PROPERTY_NAME, 'bar', 'foo.bar');\n await testQueryType('foo.', 4, TextEditor.JavaScript.QueryType.PROPERTY_NAME, '', 'foo.');\n await testQueryType('if (foo.', 8, TextEditor.JavaScript.QueryType.PROPERTY_NAME, '', 'foo.');\n await testQueryType('new foo.bar().', 14, TextEditor.JavaScript.QueryType.PROPERTY_NAME, '', 'new foo.bar().');\n await testQueryType('foo?.', 5, TextEditor.JavaScript.QueryType.PROPERTY_NAME, '', 'foo?.');\n await testQueryType('foo?.b', 6, TextEditor.JavaScript.QueryType.PROPERTY_NAME, 'b', 'foo?.b');\n });\n\n it('recognizes property expression queries', async () => {\n await testQueryType('foo[', 4, TextEditor.JavaScript.QueryType.PROPERTY_EXPRESSION, '', 'foo[');\n await testQueryType('foo[\"ba', 7, TextEditor.JavaScript.QueryType.PROPERTY_EXPRESSION, '\"ba', 'foo[\"ba');\n });\n\n describe('potential map key retrievals', () => {\n it('recognizes potential maps', async () => {\n await testQueryType('foo.get(', 8, TextEditor.JavaScript.QueryType.POTENTIALLY_RETRIEVING_FROM_MAP, '', 'foo');\n await testQueryType(\n 'foo\\n.get(', 9, TextEditor.JavaScript.QueryType.POTENTIALLY_RETRIEVING_FROM_MAP, '', 'foo');\n });\n\n it('leaves other expressions as-is', async () => {\n await testQueryType('foo.method(', 11, TextEditor.JavaScript.QueryType.EXPRESSION);\n await testQueryType('5 + (', 5, TextEditor.JavaScript.QueryType.EXPRESSION);\n await testQueryType('functionCall(', 13, TextEditor.JavaScript.QueryType.EXPRESSION);\n });\n });\n\n it('does not complete in inappropriate places', async () => {\n await testQueryType('\"foo bar\"', 4);\n await testQueryType('x[\"foo\" + \"bar', 14);\n await testQueryType('// comment', 10);\n });\n });\n\n it('dispatching a transaction from a saved editor reference should not throw an error', () => {\n const textEditor = new TextEditor.TextEditor.TextEditor(makeState('one'));\n const editorViewA = textEditor.editor;\n\n renderElementIntoDOM(textEditor);\n // textEditor.editor references to EditorView A.\n textEditor.dispatch({changes: {from: 0, insert: 'a'}});\n // `disconnectedCallback` removed `textEditor.#activeEditor`\n // so reaching to `textEditor.editor` will create a new EditorView after this.\n textEditor.remove();\n // EditorView B is created from the previous state\n // and EditorView B's state is diverged from previous state after this transaction.\n textEditor.dispatch({changes: {from: 0, insert: 'b'}});\n\n // directly dispatching from Editor A now calls `textEditor.editor.update`\n // which references to EditorView B that has a different state.\n assert.doesNotThrow(() => editorViewA.dispatch({changes: {from: 3, insert: '!'}}));\n });\n});\n\ndescribeWithMockConnection('TextEditor autocompletion', () => {\n it('does not complete on language plugin frames', async () => {\n const executionContext = new MockExecutionContext(createTarget());\n const {debuggerModel} = executionContext;\n UI.Context.Context.instance().setFlavor(SDK.RuntimeModel.ExecutionContext, executionContext);\n const workspace = Workspace.Workspace.WorkspaceImpl.instance();\n const targetManager = SDK.TargetManager.TargetManager.instance();\n const resourceMapping = new Bindings.ResourceMapping.ResourceMapping(targetManager, workspace);\n\n const {pluginManager} = Bindings.DebuggerWorkspaceBinding.DebuggerWorkspaceBinding.instance(\n {forceNew: true, targetManager, resourceMapping});\n const testScript = debuggerModel.parsedScriptSource(\n '1' as Protocol.Runtime.ScriptId, 'script://1' as Platform.DevToolsPath.UrlString, 0, 0, 0, 0,\n executionContext.id, '', undefined, false, undefined, false, false, 0, null, null, null, null, null, null);\n const payload: Protocol.Debugger.CallFrame = {\n callFrameId: '0' as Protocol.Debugger.CallFrameId,\n functionName: 'test',\n functionLocation: undefined,\n location: {\n scriptId: testScript.scriptId,\n lineNumber: 0,\n columnNumber: 0,\n },\n url: 'test-url',\n scopeChain: [],\n this: {type: 'object'} as Protocol.Runtime.RemoteObject,\n returnValue: undefined,\n canBeRestarted: false,\n };\n const callframe = new SDK.DebuggerModel.CallFrame(debuggerModel, testScript, payload);\n\n executionContext.debuggerModel.setSelectedCallFrame(callframe);\n pluginManager.addPlugin(new class extends TestPlugin {\n constructor() {\n super('TextEditorTestPlugin');\n }\n\n override handleScript(script: SDK.Script.Script) {\n return script === testScript;\n }\n }());\n\n const state = makeState('c', CodeMirror.javascript.javascriptLanguage);\n const result =\n await TextEditor.JavaScript.javascriptCompletionSource(new CodeMirror.CompletionContext(state, 1, false));\n assert.isNull(result);\n });\n});\n"]} \ No newline at end of file diff --git a/public/ui/components/text_prompt/TextPrompt.test.js b/public/ui/components/text_prompt/TextPrompt.test.js index 89b875629..06b58d2ae 100644 --- a/public/ui/components/text_prompt/TextPrompt.test.js +++ b/public/ui/components/text_prompt/TextPrompt.test.js @@ -31,7 +31,7 @@ describe('TextPrompt', () => { renderElementIntoDOM(component); component.setPrefix('Run'); const textPromptPrefixs = component.shadowRoot.querySelectorAll('.prefix'); - assert.strictEqual(textPromptPrefixs.length, 1); + assert.lengthOf(textPromptPrefixs, 1); assert.strictEqual(textPromptPrefixs[0].textContent?.trim(), 'Run'); }); it('sets the suggestion correctly', () => { @@ -39,7 +39,7 @@ describe('TextPrompt', () => { renderElementIntoDOM(component); component.setSuggestion('Command'); const textPromptSuggestions = component.shadowRoot.querySelectorAll('.suggestion'); - assert.strictEqual(textPromptSuggestions.length, 1); + assert.lengthOf(textPromptSuggestions, 1); assert.strictEqual(textPromptSuggestions[0].value.trim(), 'Command'); }); it('sets the input text correctly', () => { @@ -47,7 +47,7 @@ describe('TextPrompt', () => { renderElementIntoDOM(component); component.setText('text'); const textPromptInputs = component.shadowRoot.querySelectorAll('.input'); - assert.strictEqual(textPromptInputs.length, 1); + assert.lengthOf(textPromptInputs, 1); assert.strictEqual(textPromptInputs[0].value.trim(), 'text'); }); it('sets the input and suggestion text correctly', () => { diff --git a/public/ui/components/text_prompt/TextPrompt.test.js.map b/public/ui/components/text_prompt/TextPrompt.test.js.map index 2902ce774..5f908ab74 100644 --- a/public/ui/components/text_prompt/TextPrompt.test.js.map +++ b/public/ui/components/text_prompt/TextPrompt.test.js.map @@ -1 +1 @@ -{"version":3,"file":"TextPrompt.test.js","sourceRoot":"","sources":["../../../../../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AAC,CAAC;QACxF,MAAM,CAAC,OAAO,CAAC,eAAe,CAAC,QAAQ,EAAE,CAAC,CAAC;QAE3C,SAAS,CAAC,KAAK,EAAE,CAAC;QAClB,MAAM,CAAC,MAAM,CAAC,eAAe,CAAC,QAAQ,EAAE,CAAC,CAAC;IAC5C,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["// Copyright 2021 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport {renderElementIntoDOM} from '../../../testing/DOMHelpers.js';\n\nimport * as TextPrompt from './text_prompt.js';\n\nconst renderTextPrompt = (data: TextPrompt.TextPrompt.TextPromptData) => {\n const component = new TextPrompt.TextPrompt.TextPrompt();\n component.data = data;\n return component;\n};\n\nconst defaultTextPromptData: TextPrompt.TextPrompt.TextPromptData = {\n ariaLabel: 'Quick open prompt',\n prefix: 'Open',\n suggestion: 'File',\n};\n\ndescribe('TextPrompt', () => {\n it('renders one text prompt correctly', () => {\n const component = renderTextPrompt(defaultTextPromptData);\n renderElementIntoDOM(component);\n\n const textPromptPrefixs = component.shadowRoot!.querySelectorAll('.prefix');\n assert.lengthOf(textPromptPrefixs, 1);\n assert.instanceOf(textPromptPrefixs[0], HTMLSpanElement);\n\n const textPromptInputs = component.shadowRoot!.querySelectorAll('.text-prompt-input');\n assert.lengthOf(textPromptInputs, 1);\n assert.instanceOf(textPromptInputs[0], HTMLSpanElement);\n assert.deepEqual(component.data, defaultTextPromptData);\n });\n\n describe('data setter', () => {\n it('sets the prefix correctly', () => {\n const component = renderTextPrompt(defaultTextPromptData);\n renderElementIntoDOM(component);\n\n component.setPrefix('Run');\n\n const textPromptPrefixs = component.shadowRoot!.querySelectorAll('.prefix');\n assert.strictEqual(textPromptPrefixs.length, 1);\n assert.strictEqual(textPromptPrefixs[0].textContent?.trim(), 'Run');\n });\n\n it('sets the suggestion correctly', () => {\n const component = renderTextPrompt(defaultTextPromptData);\n renderElementIntoDOM(component);\n\n component.setSuggestion('Command');\n\n const textPromptSuggestions = component.shadowRoot!.querySelectorAll('.suggestion');\n assert.strictEqual(textPromptSuggestions.length, 1);\n assert.strictEqual((textPromptSuggestions[0] as HTMLInputElement).value.trim(), 'Command');\n });\n\n it('sets the input text correctly', () => {\n const component = renderTextPrompt(defaultTextPromptData);\n renderElementIntoDOM(component);\n\n component.setText('text');\n\n const textPromptInputs = component.shadowRoot!.querySelectorAll('.input');\n assert.strictEqual(textPromptInputs.length, 1);\n assert.strictEqual((textPromptInputs[0] as HTMLInputElement).value.trim(), 'text');\n });\n\n it('sets the input and suggestion text correctly', () => {\n const component = renderTextPrompt(defaultTextPromptData);\n renderElementIntoDOM(component);\n\n component.setText('@');\n component.setSuggestion('Command');\n\n const textPromptInputs = component.shadowRoot!.querySelectorAll('.input');\n assert.strictEqual((textPromptInputs[0] as HTMLInputElement).value.trim(), '@');\n const textPromptSuggestions = component.shadowRoot!.querySelectorAll('.suggestion');\n assert.strictEqual((textPromptSuggestions[0] as HTMLInputElement).value.trim(), '@Command');\n });\n });\n\n it('focus on the input element correctly', () => {\n const component = renderTextPrompt(defaultTextPromptData);\n renderElementIntoDOM(component);\n\n const textPromptInput = component.shadowRoot!.querySelectorAll('.text-prompt-input')[0];\n assert.isFalse(textPromptInput.hasFocus());\n\n component.focus();\n assert.isTrue(textPromptInput.hasFocus());\n });\n});\n"]} \ No newline at end of file +{"version":3,"file":"TextPrompt.test.js","sourceRoot":"","sources":["../../../../../../../front_end/ui/components/text_prompt/TextPrompt.test.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,EAAC,oBAAoB,EAAC,MAAM,gCAAgC,CAAC;AAEpE,OAAO,KAAK,UAAU,MAAM,kBAAkB,CAAC;AAE/C,MAAM,gBAAgB,GAAG,CAAC,IAA0C,EAAE,EAAE;IACtE,MAAM,SAAS,GAAG,IAAI,UAAU,CAAC,UAAU,CAAC,UAAU,EAAE,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,GAAG,EAAE;YACtD,MAAM,SAAS,GAAG,gBAAgB,CAAC,qBAAqB,CAAC,CAAC;YAC1D,oBAAoB,CAAC,SAAS,CAAC,CAAC;YAEhC,SAAS,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;YACvB,SAAS,CAAC,aAAa,CAAC,SAAS,CAAC,CAAC;YAEnC,MAAM,gBAAgB,GAAG,SAAS,CAAC,UAAW,CAAC,gBAAgB,CAAC,QAAQ,CAAC,CAAC;YAC1E,MAAM,CAAC,WAAW,CAAE,gBAAgB,CAAC,CAAC,CAAsB,CAAC,KAAK,CAAC,IAAI,EAAE,EAAE,GAAG,CAAC,CAAC;YAChF,MAAM,qBAAqB,GAAG,SAAS,CAAC,UAAW,CAAC,gBAAgB,CAAC,aAAa,CAAC,CAAC;YACpF,MAAM,CAAC,WAAW,CAAE,qBAAqB,CAAC,CAAC,CAAsB,CAAC,KAAK,CAAC,IAAI,EAAE,EAAE,UAAU,CAAC,CAAC;QAC9F,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,sCAAsC,EAAE,GAAG,EAAE;QAC9C,MAAM,SAAS,GAAG,gBAAgB,CAAC,qBAAqB,CAAC,CAAC;QAC1D,oBAAoB,CAAC,SAAS,CAAC,CAAC;QAEhC,MAAM,eAAe,GAAG,SAAS,CAAC,UAAW,CAAC,gBAAgB,CAAC,oBAAoB,CAAC,CAAC,CAAC,CAAC,CAAC;QACxF,MAAM,CAAC,OAAO,CAAC,eAAe,CAAC,QAAQ,EAAE,CAAC,CAAC;QAE3C,SAAS,CAAC,KAAK,EAAE,CAAC;QAClB,MAAM,CAAC,MAAM,CAAC,eAAe,CAAC,QAAQ,EAAE,CAAC,CAAC;IAC5C,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["// Copyright 2021 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport {renderElementIntoDOM} from '../../../testing/DOMHelpers.js';\n\nimport * as TextPrompt from './text_prompt.js';\n\nconst renderTextPrompt = (data: TextPrompt.TextPrompt.TextPromptData) => {\n const component = new TextPrompt.TextPrompt.TextPrompt();\n component.data = data;\n return component;\n};\n\nconst defaultTextPromptData: TextPrompt.TextPrompt.TextPromptData = {\n ariaLabel: 'Quick open prompt',\n prefix: 'Open',\n suggestion: 'File',\n};\n\ndescribe('TextPrompt', () => {\n it('renders one text prompt correctly', () => {\n const component = renderTextPrompt(defaultTextPromptData);\n renderElementIntoDOM(component);\n\n const textPromptPrefixs = component.shadowRoot!.querySelectorAll('.prefix');\n assert.lengthOf(textPromptPrefixs, 1);\n assert.instanceOf(textPromptPrefixs[0], HTMLSpanElement);\n\n const textPromptInputs = component.shadowRoot!.querySelectorAll('.text-prompt-input');\n assert.lengthOf(textPromptInputs, 1);\n assert.instanceOf(textPromptInputs[0], HTMLSpanElement);\n assert.deepEqual(component.data, defaultTextPromptData);\n });\n\n describe('data setter', () => {\n it('sets the prefix correctly', () => {\n const component = renderTextPrompt(defaultTextPromptData);\n renderElementIntoDOM(component);\n\n component.setPrefix('Run');\n\n const textPromptPrefixs = component.shadowRoot!.querySelectorAll('.prefix');\n assert.lengthOf(textPromptPrefixs, 1);\n assert.strictEqual(textPromptPrefixs[0].textContent?.trim(), 'Run');\n });\n\n it('sets the suggestion correctly', () => {\n const component = renderTextPrompt(defaultTextPromptData);\n renderElementIntoDOM(component);\n\n component.setSuggestion('Command');\n\n const textPromptSuggestions = component.shadowRoot!.querySelectorAll('.suggestion');\n assert.lengthOf(textPromptSuggestions, 1);\n assert.strictEqual((textPromptSuggestions[0] as HTMLInputElement).value.trim(), 'Command');\n });\n\n it('sets the input text correctly', () => {\n const component = renderTextPrompt(defaultTextPromptData);\n renderElementIntoDOM(component);\n\n component.setText('text');\n\n const textPromptInputs = component.shadowRoot!.querySelectorAll('.input');\n assert.lengthOf(textPromptInputs, 1);\n assert.strictEqual((textPromptInputs[0] as HTMLInputElement).value.trim(), 'text');\n });\n\n it('sets the input and suggestion text correctly', () => {\n const component = renderTextPrompt(defaultTextPromptData);\n renderElementIntoDOM(component);\n\n component.setText('@');\n component.setSuggestion('Command');\n\n const textPromptInputs = component.shadowRoot!.querySelectorAll('.input');\n assert.strictEqual((textPromptInputs[0] as HTMLInputElement).value.trim(), '@');\n const textPromptSuggestions = component.shadowRoot!.querySelectorAll('.suggestion');\n assert.strictEqual((textPromptSuggestions[0] as HTMLInputElement).value.trim(), '@Command');\n });\n });\n\n it('focus on the input element correctly', () => {\n const component = renderTextPrompt(defaultTextPromptData);\n renderElementIntoDOM(component);\n\n const textPromptInput = component.shadowRoot!.querySelectorAll('.text-prompt-input')[0];\n assert.isFalse(textPromptInput.hasFocus());\n\n component.focus();\n assert.isTrue(textPromptInput.hasFocus());\n });\n});\n"]} \ No newline at end of file diff --git a/public/ui/components/tree_outline/TreeOutline.js b/public/ui/components/tree_outline/TreeOutline.js index 3d9ab002d..cc31a56a9 100644 --- a/public/ui/components/tree_outline/TreeOutline.js +++ b/public/ui/components/tree_outline/TreeOutline.js @@ -6,11 +6,10 @@ import * as LitHtml from '../../lit-html/lit-html.js'; import * as VisualLogging from '../../visual_logging/visual_logging.js'; import * as CodeHighlighter from '../code_highlighter/code_highlighter.js'; import * as ComponentHelpers from '../helpers/helpers.js'; -import * as Coordinator from '../render_coordinator/render_coordinator.js'; +import * as RenderCoordinator from '../render_coordinator/render_coordinator.js'; import treeOutlineStyles from './treeOutline.css.js'; import { findNextNodeForTreeOutlineKeyboardNavigation, getNodeChildren, getPathToTreeNode, isExpandableNode, trackDOMNodeToTreeNode, } from './TreeOutlineUtils.js'; const { html, Directives: { ifDefined } } = LitHtml; -const coordinator = Coordinator.RenderCoordinator.RenderCoordinator.instance(); export function defaultRenderer(node) { return html `${node.treeNodeData}`; } @@ -254,7 +253,7 @@ export class TreeOutline extends HTMLElement { this.#selectedTreeNode = treeNode; await this.#render(); this.dispatchEvent(new ItemSelectedEvent(treeNode)); - void coordinator.write('DOMNode focus', () => { + void RenderCoordinator.write('DOMNode focus', () => { domNode.focus(); }); } @@ -421,7 +420,7 @@ export class TreeOutline extends HTMLElement { return; } this.#scheduledRender = true; - await coordinator.write('TreeOutline render', () => { + await RenderCoordinator.write('TreeOutline render', () => { // Disabled until https://crbug.com/1079231 is fixed. // clang-format off LitHtml.render(html ` diff --git a/public/ui/components/tree_outline/TreeOutline.js.map b/public/ui/components/tree_outline/TreeOutline.js.map index 3db327aef..59d8876ae 100644 --- a/public/ui/components/tree_outline/TreeOutline.js.map +++ b/public/ui/components/tree_outline/TreeOutline.js.map @@ -1 +1 @@ -{"version":3,"file":"TreeOutline.js","sourceRoot":"","sources":["../../../../../../../front_end/ui/components/tree_outline/TreeOutline.ts"],"names":[],"mappings":"AAAA,gEAAgE;AAChE,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,KAAK,QAAQ,MAAM,oCAAoC,CAAC;AAC/D,OAAO,KAAK,OAAO,MAAM,4BAA4B,CAAC;AACtD,OAAO,KAAK,aAAa,MAAM,wCAAwC,CAAC;AACxE,OAAO,KAAK,eAAe,MAAM,yCAAyC,CAAC;AAC3E,OAAO,KAAK,gBAAgB,MAAM,uBAAuB,CAAC;AAC1D,OAAO,KAAK,WAAW,MAAM,6CAA6C,CAAC;AAE3E,OAAO,iBAAiB,MAAM,sBAAsB,CAAC;AACrD,OAAO,EACL,4CAA4C,EAC5C,eAAe,EACf,iBAAiB,EACjB,gBAAgB,EAChB,sBAAsB,GAIvB,MAAM,uBAAuB,CAAC;AAE/B,MAAM,EAAC,IAAI,EAAE,UAAU,EAAE,EAAC,SAAS,EAAC,EAAC,GAAG,OAAO,CAAC;AAEhD,MAAM,WAAW,GAAG,WAAW,CAAC,iBAAiB,CAAC,iBAAiB,CAAC,QAAQ,EAAE,CAAC;AAe/E,MAAM,UAAU,eAAe,CAAC,IAAsB;IACpD,OAAO,IAAI,CAAA,GAAG,IAAI,CAAC,YAAY,EAAE,CAAC;AACpC,CAAC;AAED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The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport * as Platform from '../../../core/platform/platform.js';\nimport * as LitHtml from '../../lit-html/lit-html.js';\nimport * as VisualLogging from '../../visual_logging/visual_logging.js';\nimport * as CodeHighlighter from '../code_highlighter/code_highlighter.js';\nimport * as ComponentHelpers from '../helpers/helpers.js';\nimport * as Coordinator from '../render_coordinator/render_coordinator.js';\n\nimport treeOutlineStyles from './treeOutline.css.js';\nimport {\n findNextNodeForTreeOutlineKeyboardNavigation,\n getNodeChildren,\n getPathToTreeNode,\n isExpandableNode,\n trackDOMNodeToTreeNode,\n type TreeNode,\n type TreeNodeId,\n type TreeNodeWithChildren,\n} from './TreeOutlineUtils.js';\n\nconst {html, Directives: {ifDefined}} = LitHtml;\n\nconst coordinator = Coordinator.RenderCoordinator.RenderCoordinator.instance();\n\nexport interface TreeOutlineData {\n defaultRenderer: (node: TreeNode, state: {isExpanded: boolean}) => LitHtml.TemplateResult;\n /**\n * Note: it is important that all the TreeNode objects are unique. They are\n * used internally to the TreeOutline as keys to track state (such as if a\n * node is expanded or not), and providing the same object multiple times will\n * cause issues in the TreeOutline.\n */\n tree: readonly TreeNode[];\n filter?: (node: TreeNodeDataType) => FilterOption;\n compact?: boolean;\n}\n\nexport function defaultRenderer(node: TreeNode): LitHtml.TemplateResult {\n return html`${node.treeNodeData}`;\n}\n\nexport class ItemSelectedEvent extends Event {\n static readonly eventName = 'itemselected';\n data: {\n node: TreeNode,\n };\n\n constructor(node: TreeNode) {\n super(ItemSelectedEvent.eventName, {bubbles: true, composed: true});\n this.data = {node};\n }\n}\n\nexport class ItemMouseOverEvent extends Event {\n static readonly eventName = 'itemmouseover';\n data: {\n node: TreeNode,\n };\n\n constructor(node: TreeNode) {\n super(ItemMouseOverEvent.eventName, {bubbles: true, composed: true});\n this.data = {node};\n }\n}\n\nexport class ItemMouseOutEvent extends Event {\n static readonly eventName = 'itemmouseout';\n data: {\n node: TreeNode,\n };\n\n constructor(node: TreeNode) {\n super(ItemMouseOutEvent.eventName, {bubbles: true, composed: true});\n this.data = {node};\n }\n}\n\n/**\n *\n * The tree can be filtered by providing a custom filter function.\n * The filter is applied on every node when constructing the tree\n * and proceeds as follows:\n * - If the filter return SHOW for a node, the node is included in the tree.\n * - If the filter returns FLATTEN, the node is ignored but its subtree is included.\n */\nexport const enum FilterOption {\n SHOW = 'SHOW',\n FLATTEN = 'FLATTEN',\n}\n\nexport class TreeOutline extends HTMLElement {\n readonly #shadow = this.attachShadow({mode: 'open'});\n #treeData: readonly TreeNode[] = [];\n #nodeExpandedMap: Map = new Map();\n #domNodeToTreeNodeMap: WeakMap> = new WeakMap();\n #hasRenderedAtLeastOnce = false;\n /**\n * If we have expanded to a certain node, we want to focus it once we've\n * rendered. But we render lazily and wrapped in LitHtml.until, so we can't\n * know for sure when that node will be rendered. This variable tracks the\n * node that we want focused but may not yet have been rendered.\n */\n #nodeIdPendingFocus: TreeNodeId|null = null;\n #selectedTreeNode: TreeNode|null = null;\n #defaultRenderer = (node: TreeNode, _state: {isExpanded: boolean}): LitHtml.TemplateResult => {\n if (typeof node.treeNodeData !== 'string') {\n console.warn(`The default TreeOutline renderer simply stringifies its given value. You passed in ${\n JSON.stringify(\n node.treeNodeData, null,\n 2)}. Consider providing a different defaultRenderer that can handle nodes of this type.`);\n }\n return html`${String(node.treeNodeData)}`;\n };\n #nodeFilter?: ((node: TreeNodeDataType) => FilterOption);\n #compact = false;\n\n /**\n * scheduledRender = render() has been called and scheduled a render.\n */\n #scheduledRender = false;\n /**\n * enqueuedRender = render() was called mid-way through an existing render.\n */\n #enqueuedRender = false;\n\n static get observedAttributes(): string[] {\n return ['nowrap', 'toplevelbordercolor'];\n }\n\n attributeChangedCallback(name: 'nowrap'|'toplevelbordercolor', oldValue: string|null, newValue: string|null): void {\n switch (name) {\n case 'nowrap': {\n this.#setNodeKeyNoWrapCSSVariable(newValue);\n break;\n }\n case 'toplevelbordercolor': {\n this.#setTopLevelNodeBorderColorCSSVariable(newValue);\n break;\n }\n }\n }\n\n connectedCallback(): void {\n this.#setTopLevelNodeBorderColorCSSVariable(this.getAttribute('toplevelbordercolor'));\n this.#setNodeKeyNoWrapCSSVariable(this.getAttribute('nowrap'));\n this.#shadow.adoptedStyleSheets = [treeOutlineStyles, CodeHighlighter.Style.default];\n }\n\n get data(): TreeOutlineData {\n return {\n tree: this.#treeData as TreeNode[],\n defaultRenderer: this.#defaultRenderer,\n };\n }\n\n set data(data: TreeOutlineData) {\n this.#defaultRenderer = data.defaultRenderer;\n this.#treeData = data.tree;\n this.#nodeFilter = data.filter;\n this.#compact = data.compact || false;\n\n if (!this.#hasRenderedAtLeastOnce) {\n this.#selectedTreeNode = this.#treeData[0];\n }\n void this.#render();\n }\n\n /**\n * Recursively expands the tree from the root nodes, to a max depth. The max\n * depth is 0 indexed - so a maxDepth of 2 (default) will expand 3 levels: 0,\n * 1 and 2.\n */\n async expandRecursively(maxDepth = 2): Promise {\n await Promise.all(this.#treeData.map(rootNode => this.#expandAndRecurse(rootNode, 0, maxDepth)));\n await this.#render();\n }\n\n /**\n * Collapses all nodes in the tree.\n */\n async collapseAllNodes(): Promise {\n this.#nodeExpandedMap.clear();\n await this.#render();\n }\n\n /**\n * Takes a TreeNode, expands the outline to reveal it, and focuses it.\n */\n async expandToAndSelectTreeNode(targetTreeNode: TreeNode): Promise {\n return this.expandToAndSelectTreeNodeId(targetTreeNode.id);\n }\n\n /**\n * Takes a TreeNode ID, expands the outline to reveal it, and focuses it.\n */\n async expandToAndSelectTreeNodeId(targetTreeNodeId: TreeNodeId): Promise {\n const pathToTreeNode = await getPathToTreeNode(this.#treeData, targetTreeNodeId);\n\n if (pathToTreeNode === null) {\n throw new Error(`Could not find node with id ${targetTreeNodeId} in the tree.`);\n }\n pathToTreeNode.forEach((node, index) => {\n // We don't expand the very last node, which was the target node.\n if (index < pathToTreeNode.length - 1) {\n this.#setNodeExpandedState(node, true);\n }\n });\n\n // Mark the node as pending focus so when it is rendered into the DOM we can focus it\n this.#nodeIdPendingFocus = targetTreeNodeId;\n await this.#render();\n }\n\n /**\n * Takes a list of TreeNode IDs and expands the corresponding nodes.\n */\n expandNodeIds(nodeIds: TreeNodeId[]): Promise {\n nodeIds.forEach(id => this.#nodeExpandedMap.set(id, true));\n return this.#render();\n }\n\n /**\n * Takes a TreeNode ID and focuses the corresponding node.\n */\n focusNodeId(nodeId: TreeNodeId): Promise {\n this.#nodeIdPendingFocus = nodeId;\n return this.#render();\n }\n\n async collapseChildrenOfNode(domNode: HTMLLIElement): Promise {\n const treeNode = this.#domNodeToTreeNodeMap.get(domNode);\n if (!treeNode) {\n return;\n }\n await this.#recursivelyCollapseTreeNodeChildren(treeNode);\n await this.#render();\n }\n\n #setNodeKeyNoWrapCSSVariable(attributeValue: string|null): void {\n this.style.setProperty('--override-key-whitespace-wrapping', attributeValue !== null ? 'nowrap' : 'initial');\n }\n\n #setTopLevelNodeBorderColorCSSVariable(attributeValue: string|null): void {\n this.style.setProperty('--override-top-node-border', attributeValue ? `1px solid ${attributeValue}` : '');\n }\n\n async #recursivelyCollapseTreeNodeChildren(treeNode: TreeNode): Promise {\n if (!isExpandableNode(treeNode) || !this.#nodeIsExpanded(treeNode)) {\n return;\n }\n const children = await this.#fetchNodeChildren(treeNode);\n const childRecursions = Promise.all(children.map(child => this.#recursivelyCollapseTreeNodeChildren(child)));\n await childRecursions;\n this.#setNodeExpandedState(treeNode, false);\n }\n\n async #flattenSubtree(node: TreeNodeWithChildren, filter: (node: TreeNodeDataType) => FilterOption):\n Promise[]> {\n const children = await getNodeChildren(node);\n const filteredChildren = [];\n for (const child of children) {\n const filtering = filter(child.treeNodeData);\n // We always include the selected node in the tree, regardless of its filtering status.\n const toBeSelected = this.#isSelectedNode(child) || child.id === this.#nodeIdPendingFocus;\n // If a node is already expanded we should not flatten it away.\n const expanded = this.#nodeExpandedMap.get(child.id);\n if (filtering === FilterOption.SHOW || toBeSelected || expanded) {\n filteredChildren.push(child);\n } else if (filtering === FilterOption.FLATTEN && isExpandableNode(child)) {\n const grandChildren = await this.#flattenSubtree(child, filter);\n filteredChildren.push(...grandChildren);\n }\n }\n return filteredChildren;\n }\n\n async #fetchNodeChildren(node: TreeNodeWithChildren): Promise[]> {\n const children = await getNodeChildren(node);\n const filter = this.#nodeFilter;\n if (!filter) {\n return children;\n }\n const filteredDescendants = await this.#flattenSubtree(node, filter);\n return filteredDescendants.length ? filteredDescendants : children;\n }\n\n #setNodeExpandedState(node: TreeNode, newExpandedState: boolean): void {\n this.#nodeExpandedMap.set(node.id, newExpandedState);\n }\n\n #nodeIsExpanded(node: TreeNode): boolean {\n return this.#nodeExpandedMap.get(node.id) || false;\n }\n\n async #expandAndRecurse(node: TreeNode, currentDepth: number, maxDepth: number): Promise {\n if (!isExpandableNode(node)) {\n return;\n }\n this.#setNodeExpandedState(node, true);\n if (currentDepth === maxDepth || !isExpandableNode(node)) {\n return;\n }\n const children = await this.#fetchNodeChildren(node);\n await Promise.all(children.map(child => this.#expandAndRecurse(child, currentDepth + 1, maxDepth)));\n }\n\n #onArrowClick(node: TreeNode): ((e: Event) => void) {\n return (event: Event): void => {\n event.stopPropagation();\n if (isExpandableNode(node)) {\n this.#setNodeExpandedState(node, !this.#nodeIsExpanded(node));\n void this.#render();\n }\n };\n }\n\n #onNodeClick(event: Event): void {\n // Avoid it bubbling up to parent tree elements, else clicking a node deep in the tree will toggle it + all its ancestor's visibility.\n event.stopPropagation();\n const nodeClickExpandsOrContracts = this.getAttribute('clickabletitle') !== null;\n const domNode = event.currentTarget as HTMLLIElement;\n const node = this.#domNodeToTreeNodeMap.get(domNode);\n if (nodeClickExpandsOrContracts && node && isExpandableNode(node)) {\n this.#setNodeExpandedState(node, !this.#nodeIsExpanded(node));\n }\n void this.#focusTreeNode(domNode);\n }\n\n async #focusTreeNode(domNode: HTMLLIElement): Promise {\n const treeNode = this.#domNodeToTreeNodeMap.get(domNode);\n if (!treeNode) {\n return;\n }\n this.#selectedTreeNode = treeNode;\n await this.#render();\n this.dispatchEvent(new ItemSelectedEvent(treeNode));\n void coordinator.write('DOMNode focus', () => {\n domNode.focus();\n });\n }\n\n #processHomeAndEndKeysNavigation(key: 'Home'|'End'): void {\n if (key === 'Home') {\n const firstRootNode = this.#shadow.querySelector('ul[role=\"tree\"] > li[role=\"treeitem\"]');\n if (firstRootNode) {\n void this.#focusTreeNode(firstRootNode);\n }\n } else if (key === 'End') {\n /**\n * The End key takes the user to the last visible node in the tree - you\n * can think of this as the one that's rendered closest to the bottom of\n * the page.\n *\n * We could walk our tree and compute this - but it will also be the last\n * li[role=\"treeitem\"] in the DOM because we only render visible nodes.\n * Therefore we can select all the nodes and pick the last one.\n */\n const allTreeItems = this.#shadow.querySelectorAll('li[role=\"treeitem\"]');\n const lastTreeItem = allTreeItems[allTreeItems.length - 1];\n if (lastTreeItem) {\n void this.#focusTreeNode(lastTreeItem);\n }\n }\n }\n\n async #processArrowKeyNavigation(key: Platform.KeyboardUtilities.ArrowKey, currentDOMNode: HTMLLIElement):\n Promise {\n const currentTreeNode = this.#domNodeToTreeNodeMap.get(currentDOMNode);\n if (!currentTreeNode) {\n return;\n }\n\n const domNode = findNextNodeForTreeOutlineKeyboardNavigation({\n currentDOMNode,\n currentTreeNode,\n direction: key,\n setNodeExpandedState: (node, expanded) => this.#setNodeExpandedState(node, expanded),\n });\n await this.#focusTreeNode(domNode);\n }\n\n #processEnterOrSpaceNavigation(currentDOMNode: HTMLLIElement): void {\n const currentTreeNode = this.#domNodeToTreeNodeMap.get(currentDOMNode);\n if (!currentTreeNode) {\n return;\n }\n if (isExpandableNode(currentTreeNode)) {\n const currentExpandedState = this.#nodeIsExpanded(currentTreeNode);\n this.#setNodeExpandedState(currentTreeNode, !currentExpandedState);\n void this.#render();\n }\n }\n\n async #onTreeKeyDown(event: KeyboardEvent): Promise {\n if (!(event.target instanceof HTMLLIElement)) {\n throw new Error('event.target was not an
    • element');\n }\n\n if (event.key === 'Home' || event.key === 'End') {\n event.preventDefault();\n this.#processHomeAndEndKeysNavigation(event.key);\n } else if (Platform.KeyboardUtilities.keyIsArrowKey(event.key)) {\n event.preventDefault();\n await this.#processArrowKeyNavigation(event.key, event.target);\n } else if (event.key === 'Enter' || event.key === ' ') {\n event.preventDefault();\n this.#processEnterOrSpaceNavigation(event.target);\n }\n }\n\n #focusPendingNode(domNode: HTMLLIElement): void {\n this.#nodeIdPendingFocus = null;\n void this.#focusTreeNode(domNode);\n }\n\n #isSelectedNode(node: TreeNode): boolean {\n if (this.#selectedTreeNode) {\n return node.id === this.#selectedTreeNode.id;\n }\n return false;\n }\n\n #renderNode(node: TreeNode, {depth, setSize, positionInSet}: {\n depth: number,\n setSize: number,\n positionInSet: number,\n }): LitHtml.TemplateResult {\n let childrenToRender;\n const nodeIsExpanded = this.#nodeIsExpanded(node);\n if (!isExpandableNode(node) || !nodeIsExpanded) {\n childrenToRender = LitHtml.nothing;\n } else {\n const childNodes = this.#fetchNodeChildren(node).then(children => {\n return children.map((childNode, index) => {\n return this.#renderNode(childNode, {depth: depth + 1, setSize: children.length, positionInSet: index});\n });\n });\n // Disabled until https://crbug.com/1079231 is fixed.\n // clang-format off\n childrenToRender = html`
        ${LitHtml.Directives.until(childNodes)}
      `;\n // clang-format on\n }\n\n const nodeIsFocusable = this.#isSelectedNode(node);\n const tabIndex = nodeIsFocusable ? 0 : -1;\n const listItemClasses = LitHtml.Directives.classMap({\n expanded: isExpandableNode(node) && nodeIsExpanded,\n parent: isExpandableNode(node),\n selected: this.#isSelectedNode(node),\n 'is-top-level': depth === 0,\n compact: this.#compact,\n });\n const ariaExpandedAttribute = !isExpandableNode(node) ? undefined : nodeIsExpanded ? 'true' : 'false';\n\n let renderedNodeKey: LitHtml.TemplateResult;\n if (node.renderer) {\n renderedNodeKey = node.renderer(node, {isExpanded: nodeIsExpanded});\n } else {\n renderedNodeKey = this.#defaultRenderer(node, {isExpanded: nodeIsExpanded});\n }\n\n // Disabled until https://crbug.com/1079231 is fixed.\n // clang-format off\n return html`\n
    • {\n /**\n * Because TreeNodes are lazily rendered, you can call\n * `outline.expandToAndSelect(NodeX)`, but `NodeX` will be rendered at some\n * later point, once it's been fully resolved, within a LitHtml.until\n * directive. That means we don't have a direct hook into when it's\n * rendered, which we need because we want to focus the element, so we use this directive to receive a callback when the node is rendered.\n */\n if (!(domNode instanceof HTMLLIElement)) {\n return;\n }\n\n if (this.#nodeIdPendingFocus && node.id === this.#nodeIdPendingFocus) {\n this.#focusPendingNode(domNode);\n }\n })}\n >\n {\n this.dispatchEvent(new ItemMouseOverEvent(node));\n }}\n @mouseout=${() => {\n this.dispatchEvent(new ItemMouseOutEvent(node));\n }}\n >\n \n \n ${renderedNodeKey}\n \n ${childrenToRender}\n
    • \n `;\n // clang-format on\n }\n\n async #render(): Promise {\n if (this.#scheduledRender) {\n // If we are already rendering, don't render again immediately, but\n // enqueue it to be run after we're done on our current render.\n this.#enqueuedRender = true;\n return;\n }\n\n this.#scheduledRender = true;\n\n await coordinator.write('TreeOutline render', () => {\n // Disabled until https://crbug.com/1079231 is fixed.\n // clang-format off\n LitHtml.render(html`\n
      \n
        \n ${this.#treeData.map((topLevelNode, index) => {\n return this.#renderNode(topLevelNode, {\n depth: 0,\n setSize: this.#treeData.length,\n positionInSet: index,\n });\n })}\n
      \n
      \n `, this.#shadow, {\n host: this,\n });\n });\n // clang-format on\n this.#hasRenderedAtLeastOnce = true;\n this.#scheduledRender = false;\n\n // If render() was called when we were already mid-render, let's re-render\n // to ensure we're not rendering any stale UI.\n if (this.#enqueuedRender) {\n this.#enqueuedRender = false;\n return this.#render();\n }\n }\n}\n\ncustomElements.define('devtools-tree-outline', TreeOutline);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'devtools-tree-outline': TreeOutline;\n }\n}\n"]} \ No newline at end of file +{"version":3,"file":"TreeOutline.js","sourceRoot":"","sources":["../../../../../../../front_end/ui/components/tree_outline/TreeOutline.ts"],"names":[],"mappings":"AAAA,gEAAgE;AAChE,yEAAyE;AAC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AAC,WAAW,CAAC,YAAY,EAAE;oBACpC,KAAK,EAAE,CAAC;oBACR,OAAO,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM;oBAC9B,aAAa,EAAE,KAAK;iBACrB,CAAC,CAAC;YACL,CAAC,CAAC;;;OAGL,EAAE,IAAI,CAAC,OAAO,EAAE;gBACf,IAAI,EAAE,IAAI;aACX,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;QACH,kBAAkB;QAClB,IAAI,CAAC,uBAAuB,GAAG,IAAI,CAAC;QACpC,IAAI,CAAC,gBAAgB,GAAG,KAAK,CAAC;QAE9B,0EAA0E;QAC1E,8CAA8C;QAC9C,IAAI,IAAI,CAAC,eAAe,EAAE,CAAC;YACzB,IAAI,CAAC,eAAe,GAAG,KAAK,CAAC;YAC7B,OAAO,IAAI,CAAC,OAAO,EAAE,CAAC;QACxB,CAAC;IACH,CAAC;CACF;AAED,cAAc,CAAC,MAAM,CAAC,uBAAuB,EAAE,WAAW,CAAC,CAAC","sourcesContent":["// Copyright (c) 2020 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport * as Platform from '../../../core/platform/platform.js';\nimport * as LitHtml from '../../lit-html/lit-html.js';\nimport * as VisualLogging from '../../visual_logging/visual_logging.js';\nimport * as CodeHighlighter from '../code_highlighter/code_highlighter.js';\nimport * as ComponentHelpers from '../helpers/helpers.js';\nimport * as RenderCoordinator from '../render_coordinator/render_coordinator.js';\n\nimport treeOutlineStyles from './treeOutline.css.js';\nimport {\n findNextNodeForTreeOutlineKeyboardNavigation,\n getNodeChildren,\n getPathToTreeNode,\n isExpandableNode,\n trackDOMNodeToTreeNode,\n type TreeNode,\n type TreeNodeId,\n type TreeNodeWithChildren,\n} from './TreeOutlineUtils.js';\n\nconst {html, Directives: {ifDefined}} = LitHtml;\n\nexport interface TreeOutlineData {\n defaultRenderer: (node: TreeNode, state: {isExpanded: boolean}) => LitHtml.TemplateResult;\n /**\n * Note: it is important that all the TreeNode objects are unique. They are\n * used internally to the TreeOutline as keys to track state (such as if a\n * node is expanded or not), and providing the same object multiple times will\n * cause issues in the TreeOutline.\n */\n tree: readonly TreeNode[];\n filter?: (node: TreeNodeDataType) => FilterOption;\n compact?: boolean;\n}\n\nexport function defaultRenderer(node: TreeNode): LitHtml.TemplateResult {\n return html`${node.treeNodeData}`;\n}\n\nexport class ItemSelectedEvent extends Event {\n static readonly eventName = 'itemselected';\n data: {\n node: TreeNode,\n };\n\n constructor(node: TreeNode) {\n super(ItemSelectedEvent.eventName, {bubbles: true, composed: true});\n this.data = {node};\n }\n}\n\nexport class ItemMouseOverEvent extends Event {\n static readonly eventName = 'itemmouseover';\n data: {\n node: TreeNode,\n };\n\n constructor(node: TreeNode) {\n super(ItemMouseOverEvent.eventName, {bubbles: true, composed: true});\n this.data = {node};\n }\n}\n\nexport class ItemMouseOutEvent extends Event {\n static readonly eventName = 'itemmouseout';\n data: {\n node: TreeNode,\n };\n\n constructor(node: TreeNode) {\n super(ItemMouseOutEvent.eventName, {bubbles: true, composed: true});\n this.data = {node};\n }\n}\n\n/**\n *\n * The tree can be filtered by providing a custom filter function.\n * The filter is applied on every node when constructing the tree\n * and proceeds as follows:\n * - If the filter return SHOW for a node, the node is included in the tree.\n * - If the filter returns FLATTEN, the node is ignored but its subtree is included.\n */\nexport const enum FilterOption {\n SHOW = 'SHOW',\n FLATTEN = 'FLATTEN',\n}\n\nexport class TreeOutline extends HTMLElement {\n readonly #shadow = this.attachShadow({mode: 'open'});\n #treeData: readonly TreeNode[] = [];\n #nodeExpandedMap: Map = new Map();\n #domNodeToTreeNodeMap: WeakMap> = new WeakMap();\n #hasRenderedAtLeastOnce = false;\n /**\n * If we have expanded to a certain node, we want to focus it once we've\n * rendered. But we render lazily and wrapped in LitHtml.until, so we can't\n * know for sure when that node will be rendered. This variable tracks the\n * node that we want focused but may not yet have been rendered.\n */\n #nodeIdPendingFocus: TreeNodeId|null = null;\n #selectedTreeNode: TreeNode|null = null;\n #defaultRenderer = (node: TreeNode, _state: {isExpanded: boolean}): LitHtml.TemplateResult => {\n if (typeof node.treeNodeData !== 'string') {\n console.warn(`The default TreeOutline renderer simply stringifies its given value. You passed in ${\n JSON.stringify(\n node.treeNodeData, null,\n 2)}. Consider providing a different defaultRenderer that can handle nodes of this type.`);\n }\n return html`${String(node.treeNodeData)}`;\n };\n #nodeFilter?: ((node: TreeNodeDataType) => FilterOption);\n #compact = false;\n\n /**\n * scheduledRender = render() has been called and scheduled a render.\n */\n #scheduledRender = false;\n /**\n * enqueuedRender = render() was called mid-way through an existing render.\n */\n #enqueuedRender = false;\n\n static get observedAttributes(): string[] {\n return ['nowrap', 'toplevelbordercolor'];\n }\n\n attributeChangedCallback(name: 'nowrap'|'toplevelbordercolor', oldValue: string|null, newValue: string|null): void {\n switch (name) {\n case 'nowrap': {\n this.#setNodeKeyNoWrapCSSVariable(newValue);\n break;\n }\n case 'toplevelbordercolor': {\n this.#setTopLevelNodeBorderColorCSSVariable(newValue);\n break;\n }\n }\n }\n\n connectedCallback(): void {\n this.#setTopLevelNodeBorderColorCSSVariable(this.getAttribute('toplevelbordercolor'));\n this.#setNodeKeyNoWrapCSSVariable(this.getAttribute('nowrap'));\n this.#shadow.adoptedStyleSheets = [treeOutlineStyles, CodeHighlighter.Style.default];\n }\n\n get data(): TreeOutlineData {\n return {\n tree: this.#treeData as TreeNode[],\n defaultRenderer: this.#defaultRenderer,\n };\n }\n\n set data(data: TreeOutlineData) {\n this.#defaultRenderer = data.defaultRenderer;\n this.#treeData = data.tree;\n this.#nodeFilter = data.filter;\n this.#compact = data.compact || false;\n\n if (!this.#hasRenderedAtLeastOnce) {\n this.#selectedTreeNode = this.#treeData[0];\n }\n void this.#render();\n }\n\n /**\n * Recursively expands the tree from the root nodes, to a max depth. The max\n * depth is 0 indexed - so a maxDepth of 2 (default) will expand 3 levels: 0,\n * 1 and 2.\n */\n async expandRecursively(maxDepth = 2): Promise {\n await Promise.all(this.#treeData.map(rootNode => this.#expandAndRecurse(rootNode, 0, maxDepth)));\n await this.#render();\n }\n\n /**\n * Collapses all nodes in the tree.\n */\n async collapseAllNodes(): Promise {\n this.#nodeExpandedMap.clear();\n await this.#render();\n }\n\n /**\n * Takes a TreeNode, expands the outline to reveal it, and focuses it.\n */\n async expandToAndSelectTreeNode(targetTreeNode: TreeNode): Promise {\n return this.expandToAndSelectTreeNodeId(targetTreeNode.id);\n }\n\n /**\n * Takes a TreeNode ID, expands the outline to reveal it, and focuses it.\n */\n async expandToAndSelectTreeNodeId(targetTreeNodeId: TreeNodeId): Promise {\n const pathToTreeNode = await getPathToTreeNode(this.#treeData, targetTreeNodeId);\n\n if (pathToTreeNode === null) {\n throw new Error(`Could not find node with id ${targetTreeNodeId} in the tree.`);\n }\n pathToTreeNode.forEach((node, index) => {\n // We don't expand the very last node, which was the target node.\n if (index < pathToTreeNode.length - 1) {\n this.#setNodeExpandedState(node, true);\n }\n });\n\n // Mark the node as pending focus so when it is rendered into the DOM we can focus it\n this.#nodeIdPendingFocus = targetTreeNodeId;\n await this.#render();\n }\n\n /**\n * Takes a list of TreeNode IDs and expands the corresponding nodes.\n */\n expandNodeIds(nodeIds: TreeNodeId[]): Promise {\n nodeIds.forEach(id => this.#nodeExpandedMap.set(id, true));\n return this.#render();\n }\n\n /**\n * Takes a TreeNode ID and focuses the corresponding node.\n */\n focusNodeId(nodeId: TreeNodeId): Promise {\n this.#nodeIdPendingFocus = nodeId;\n return this.#render();\n }\n\n async collapseChildrenOfNode(domNode: HTMLLIElement): Promise {\n const treeNode = this.#domNodeToTreeNodeMap.get(domNode);\n if (!treeNode) {\n return;\n }\n await this.#recursivelyCollapseTreeNodeChildren(treeNode);\n await this.#render();\n }\n\n #setNodeKeyNoWrapCSSVariable(attributeValue: string|null): void {\n this.style.setProperty('--override-key-whitespace-wrapping', attributeValue !== null ? 'nowrap' : 'initial');\n }\n\n #setTopLevelNodeBorderColorCSSVariable(attributeValue: string|null): void {\n this.style.setProperty('--override-top-node-border', attributeValue ? `1px solid ${attributeValue}` : '');\n }\n\n async #recursivelyCollapseTreeNodeChildren(treeNode: TreeNode): Promise {\n if (!isExpandableNode(treeNode) || !this.#nodeIsExpanded(treeNode)) {\n return;\n }\n const children = await this.#fetchNodeChildren(treeNode);\n const childRecursions = Promise.all(children.map(child => this.#recursivelyCollapseTreeNodeChildren(child)));\n await childRecursions;\n this.#setNodeExpandedState(treeNode, false);\n }\n\n async #flattenSubtree(node: TreeNodeWithChildren, filter: (node: TreeNodeDataType) => FilterOption):\n Promise[]> {\n const children = await getNodeChildren(node);\n const filteredChildren = [];\n for (const child of children) {\n const filtering = filter(child.treeNodeData);\n // We always include the selected node in the tree, regardless of its filtering status.\n const toBeSelected = this.#isSelectedNode(child) || child.id === this.#nodeIdPendingFocus;\n // If a node is already expanded we should not flatten it away.\n const expanded = this.#nodeExpandedMap.get(child.id);\n if (filtering === FilterOption.SHOW || toBeSelected || expanded) {\n filteredChildren.push(child);\n } else if (filtering === FilterOption.FLATTEN && isExpandableNode(child)) {\n const grandChildren = await this.#flattenSubtree(child, filter);\n filteredChildren.push(...grandChildren);\n }\n }\n return filteredChildren;\n }\n\n async #fetchNodeChildren(node: TreeNodeWithChildren): Promise[]> {\n const children = await getNodeChildren(node);\n const filter = this.#nodeFilter;\n if (!filter) {\n return children;\n }\n const filteredDescendants = await this.#flattenSubtree(node, filter);\n return filteredDescendants.length ? filteredDescendants : children;\n }\n\n #setNodeExpandedState(node: TreeNode, newExpandedState: boolean): void {\n this.#nodeExpandedMap.set(node.id, newExpandedState);\n }\n\n #nodeIsExpanded(node: TreeNode): boolean {\n return this.#nodeExpandedMap.get(node.id) || false;\n }\n\n async #expandAndRecurse(node: TreeNode, currentDepth: number, maxDepth: number): Promise {\n if (!isExpandableNode(node)) {\n return;\n }\n this.#setNodeExpandedState(node, true);\n if (currentDepth === maxDepth || !isExpandableNode(node)) {\n return;\n }\n const children = await this.#fetchNodeChildren(node);\n await Promise.all(children.map(child => this.#expandAndRecurse(child, currentDepth + 1, maxDepth)));\n }\n\n #onArrowClick(node: TreeNode): ((e: Event) => void) {\n return (event: Event): void => {\n event.stopPropagation();\n if (isExpandableNode(node)) {\n this.#setNodeExpandedState(node, !this.#nodeIsExpanded(node));\n void this.#render();\n }\n };\n }\n\n #onNodeClick(event: Event): void {\n // Avoid it bubbling up to parent tree elements, else clicking a node deep in the tree will toggle it + all its ancestor's visibility.\n event.stopPropagation();\n const nodeClickExpandsOrContracts = this.getAttribute('clickabletitle') !== null;\n const domNode = event.currentTarget as HTMLLIElement;\n const node = this.#domNodeToTreeNodeMap.get(domNode);\n if (nodeClickExpandsOrContracts && node && isExpandableNode(node)) {\n this.#setNodeExpandedState(node, !this.#nodeIsExpanded(node));\n }\n void this.#focusTreeNode(domNode);\n }\n\n async #focusTreeNode(domNode: HTMLLIElement): Promise {\n const treeNode = this.#domNodeToTreeNodeMap.get(domNode);\n if (!treeNode) {\n return;\n }\n this.#selectedTreeNode = treeNode;\n await this.#render();\n this.dispatchEvent(new ItemSelectedEvent(treeNode));\n void RenderCoordinator.write('DOMNode focus', () => {\n domNode.focus();\n });\n }\n\n #processHomeAndEndKeysNavigation(key: 'Home'|'End'): void {\n if (key === 'Home') {\n const firstRootNode = this.#shadow.querySelector('ul[role=\"tree\"] > li[role=\"treeitem\"]');\n if (firstRootNode) {\n void this.#focusTreeNode(firstRootNode);\n }\n } else if (key === 'End') {\n /**\n * The End key takes the user to the last visible node in the tree - you\n * can think of this as the one that's rendered closest to the bottom of\n * the page.\n *\n * We could walk our tree and compute this - but it will also be the last\n * li[role=\"treeitem\"] in the DOM because we only render visible nodes.\n * Therefore we can select all the nodes and pick the last one.\n */\n const allTreeItems = this.#shadow.querySelectorAll('li[role=\"treeitem\"]');\n const lastTreeItem = allTreeItems[allTreeItems.length - 1];\n if (lastTreeItem) {\n void this.#focusTreeNode(lastTreeItem);\n }\n }\n }\n\n async #processArrowKeyNavigation(key: Platform.KeyboardUtilities.ArrowKey, currentDOMNode: HTMLLIElement):\n Promise {\n const currentTreeNode = this.#domNodeToTreeNodeMap.get(currentDOMNode);\n if (!currentTreeNode) {\n return;\n }\n\n const domNode = findNextNodeForTreeOutlineKeyboardNavigation({\n currentDOMNode,\n currentTreeNode,\n direction: key,\n setNodeExpandedState: (node, expanded) => this.#setNodeExpandedState(node, expanded),\n });\n await this.#focusTreeNode(domNode);\n }\n\n #processEnterOrSpaceNavigation(currentDOMNode: HTMLLIElement): void {\n const currentTreeNode = this.#domNodeToTreeNodeMap.get(currentDOMNode);\n if (!currentTreeNode) {\n return;\n }\n if (isExpandableNode(currentTreeNode)) {\n const currentExpandedState = this.#nodeIsExpanded(currentTreeNode);\n this.#setNodeExpandedState(currentTreeNode, !currentExpandedState);\n void this.#render();\n }\n }\n\n async #onTreeKeyDown(event: KeyboardEvent): Promise {\n if (!(event.target instanceof HTMLLIElement)) {\n throw new Error('event.target was not an
    • element');\n }\n\n if (event.key === 'Home' || event.key === 'End') {\n event.preventDefault();\n this.#processHomeAndEndKeysNavigation(event.key);\n } else if (Platform.KeyboardUtilities.keyIsArrowKey(event.key)) {\n event.preventDefault();\n await this.#processArrowKeyNavigation(event.key, event.target);\n } else if (event.key === 'Enter' || event.key === ' ') {\n event.preventDefault();\n this.#processEnterOrSpaceNavigation(event.target);\n }\n }\n\n #focusPendingNode(domNode: HTMLLIElement): void {\n this.#nodeIdPendingFocus = null;\n void this.#focusTreeNode(domNode);\n }\n\n #isSelectedNode(node: TreeNode): boolean {\n if (this.#selectedTreeNode) {\n return node.id === this.#selectedTreeNode.id;\n }\n return false;\n }\n\n #renderNode(node: TreeNode, {depth, setSize, positionInSet}: {\n depth: number,\n setSize: number,\n positionInSet: number,\n }): LitHtml.TemplateResult {\n let childrenToRender;\n const nodeIsExpanded = this.#nodeIsExpanded(node);\n if (!isExpandableNode(node) || !nodeIsExpanded) {\n childrenToRender = LitHtml.nothing;\n } else {\n const childNodes = this.#fetchNodeChildren(node).then(children => {\n return children.map((childNode, index) => {\n return this.#renderNode(childNode, {depth: depth + 1, setSize: children.length, positionInSet: index});\n });\n });\n // Disabled until https://crbug.com/1079231 is fixed.\n // clang-format off\n childrenToRender = html`
        ${LitHtml.Directives.until(childNodes)}
      `;\n // clang-format on\n }\n\n const nodeIsFocusable = this.#isSelectedNode(node);\n const tabIndex = nodeIsFocusable ? 0 : -1;\n const listItemClasses = LitHtml.Directives.classMap({\n expanded: isExpandableNode(node) && nodeIsExpanded,\n parent: isExpandableNode(node),\n selected: this.#isSelectedNode(node),\n 'is-top-level': depth === 0,\n compact: this.#compact,\n });\n const ariaExpandedAttribute = !isExpandableNode(node) ? undefined : nodeIsExpanded ? 'true' : 'false';\n\n let renderedNodeKey: LitHtml.TemplateResult;\n if (node.renderer) {\n renderedNodeKey = node.renderer(node, {isExpanded: nodeIsExpanded});\n } else {\n renderedNodeKey = this.#defaultRenderer(node, {isExpanded: nodeIsExpanded});\n }\n\n // Disabled until https://crbug.com/1079231 is fixed.\n // clang-format off\n return html`\n
    • {\n /**\n * Because TreeNodes are lazily rendered, you can call\n * `outline.expandToAndSelect(NodeX)`, but `NodeX` will be rendered at some\n * later point, once it's been fully resolved, within a LitHtml.until\n * directive. That means we don't have a direct hook into when it's\n * rendered, which we need because we want to focus the element, so we use this directive to receive a callback when the node is rendered.\n */\n if (!(domNode instanceof HTMLLIElement)) {\n return;\n }\n\n if (this.#nodeIdPendingFocus && node.id === this.#nodeIdPendingFocus) {\n this.#focusPendingNode(domNode);\n }\n })}\n >\n {\n this.dispatchEvent(new ItemMouseOverEvent(node));\n }}\n @mouseout=${() => {\n this.dispatchEvent(new ItemMouseOutEvent(node));\n }}\n >\n \n \n ${renderedNodeKey}\n \n ${childrenToRender}\n
    • \n `;\n // clang-format on\n }\n\n async #render(): Promise {\n if (this.#scheduledRender) {\n // If we are already rendering, don't render again immediately, but\n // enqueue it to be run after we're done on our current render.\n this.#enqueuedRender = true;\n return;\n }\n\n this.#scheduledRender = true;\n\n await RenderCoordinator.write('TreeOutline render', () => {\n // Disabled until https://crbug.com/1079231 is fixed.\n // clang-format off\n LitHtml.render(html`\n
      \n
        \n ${this.#treeData.map((topLevelNode, index) => {\n return this.#renderNode(topLevelNode, {\n depth: 0,\n setSize: this.#treeData.length,\n positionInSet: index,\n });\n })}\n
      \n
      \n `, this.#shadow, {\n host: this,\n });\n });\n // clang-format on\n this.#hasRenderedAtLeastOnce = true;\n this.#scheduledRender = false;\n\n // If render() was called when we were already mid-render, let's re-render\n // to ensure we're not rendering any stale UI.\n if (this.#enqueuedRender) {\n this.#enqueuedRender = false;\n return this.#render();\n }\n }\n}\n\ncustomElements.define('devtools-tree-outline', TreeOutline);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'devtools-tree-outline': TreeOutline;\n }\n}\n"]} \ No newline at end of file diff --git a/public/ui/components/tree_outline/TreeOutline.test.js b/public/ui/components/tree_outline/TreeOutline.test.js index 4a4a2cd87..9e1e080b6 100644 --- a/public/ui/components/tree_outline/TreeOutline.test.js +++ b/public/ui/components/tree_outline/TreeOutline.test.js @@ -3,10 +3,9 @@ // found in the LICENSE file. import { dispatchClickEvent, dispatchKeyDownEvent, dispatchMouseOutEvent, dispatchMouseOverEvent, getEventPromise, renderElementIntoDOM, stripLitHtmlCommentNodes, } from '../../../testing/DOMHelpers.js'; import * as LitHtml from '../../lit-html/lit-html.js'; -import * as Coordinator from '../render_coordinator/render_coordinator.js'; +import * as RenderCoordinator from '../render_coordinator/render_coordinator.js'; import * as TreeOutline from './tree_outline.js'; const { html } = LitHtml; -const coordinator = Coordinator.RenderCoordinator.RenderCoordinator.instance(); async function renderTreeOutline({ tree, defaultRenderer, filter, }) { const component = new TreeOutline.TreeOutline.TreeOutline(); const data = { @@ -18,7 +17,7 @@ async function renderTreeOutline({ tree, defaultRenderer, filter, }) { component.data = data; renderElementIntoDOM(component); assert.isNotNull(component.shadowRoot); - await coordinator.done(); + await RenderCoordinator.done(); return { component, shadowRoot: component.shadowRoot, @@ -428,7 +427,7 @@ describe('TreeOutline', () => { // Wait for the tree to be expanded await waitForRenderedTreeNodeCount(shadowRoot, 9); // Wait for the coordinator to have called focus() on the right node - await coordinator.done(); + await RenderCoordinator.done(); assert.strictEqual(getFocusableTreeNode(shadowRoot), getVisibleTreeNodeByText(shadowRoot, 'BEL')); }); }); @@ -615,7 +614,7 @@ describe('TreeOutline', () => { }); const officeNode = getVisibleTreeNodeByText(shadowRoot, 'Offices'); dispatchClickEvent(officeNode); - await coordinator.done(); + await RenderCoordinator.done(); dispatchKeyDownEvent(officeNode, { key: 'Enter', bubbles: true }); await waitForRenderedTreeNodeCount(shadowRoot, 3); assert.strictEqual(officeNode.getAttribute('aria-expanded'), 'true'); @@ -628,7 +627,7 @@ describe('TreeOutline', () => { await waitForRenderedTreeNodeCount(shadowRoot, NODE_COUNT_BASIC_DATA_DEFAULT_EXPANDED); const officeNode = getVisibleTreeNodeByText(shadowRoot, 'Offices'); dispatchClickEvent(officeNode); - await coordinator.done(); + await RenderCoordinator.done(); dispatchKeyDownEvent(officeNode, { key: 'Enter', bubbles: true }); await waitForRenderedTreeNodeCount(shadowRoot, 6); assert.strictEqual(officeNode.getAttribute('aria-expanded'), 'false'); @@ -641,7 +640,7 @@ describe('TreeOutline', () => { }); const officeNode = getVisibleTreeNodeByText(shadowRoot, 'Offices'); dispatchClickEvent(officeNode); - await coordinator.done(); + await RenderCoordinator.done(); dispatchKeyDownEvent(officeNode, { key: ' ', bubbles: true }); await waitForRenderedTreeNodeCount(shadowRoot, 3); assert.strictEqual(officeNode.getAttribute('aria-expanded'), 'true'); @@ -654,7 +653,7 @@ describe('TreeOutline', () => { await waitForRenderedTreeNodeCount(shadowRoot, 12); const officeNode = getVisibleTreeNodeByText(shadowRoot, 'Offices'); dispatchClickEvent(officeNode); - await coordinator.done(); + await RenderCoordinator.done(); dispatchKeyDownEvent(officeNode, { key: ' ', bubbles: true }); await waitForRenderedTreeNodeCount(shadowRoot, 6); assert.strictEqual(officeNode.getAttribute('aria-expanded'), 'false'); @@ -669,9 +668,9 @@ describe('TreeOutline', () => { await waitForRenderedTreeNodeCount(shadowRoot, NODE_COUNT_BASIC_DATA_FULLY_EXPANDED); const berlinNode = getVisibleTreeNodeByText(shadowRoot, 'BER'); dispatchClickEvent(berlinNode); - await coordinator.done(); + await RenderCoordinator.done(); dispatchKeyDownEvent(berlinNode, { key: 'Home', bubbles: true }); - await coordinator.done(); + await RenderCoordinator.done(); assert.strictEqual(getFocusableTreeNode(shadowRoot), getVisibleTreeNodeByText(shadowRoot, 'Offices')); }); }); @@ -681,11 +680,11 @@ describe('TreeOutline', () => { tree: basicTreeData, }); await component.expandRecursively(Number.POSITIVE_INFINITY); - await coordinator.done(); + await RenderCoordinator.done(); const officeNode = getVisibleTreeNodeByText(shadowRoot, 'Offices'); dispatchClickEvent(officeNode); dispatchKeyDownEvent(officeNode, { key: 'End', bubbles: true }); - await coordinator.done(); + await RenderCoordinator.done(); assert.strictEqual(getFocusableTreeNode(shadowRoot), // Calendar is the very last node in the tree getVisibleTreeNodeByText(shadowRoot, 'Calendar')); @@ -704,7 +703,7 @@ describe('TreeOutline', () => { const europeNode = getVisibleTreeNodeByText(shadowRoot, 'Europe'); dispatchClickEvent(europeNode); dispatchKeyDownEvent(officeNode, { key: 'End', bubbles: true }); - await coordinator.done(); + await RenderCoordinator.done(); assert.strictEqual(getFocusableTreeNode(shadowRoot), // Products is the last node in the tree, as its children are not expanded getVisibleTreeNodeByText(shadowRoot, 'Products')); @@ -718,7 +717,7 @@ describe('TreeOutline', () => { const officeNode = getVisibleTreeNodeByText(shadowRoot, 'Offices'); dispatchClickEvent(officeNode); dispatchKeyDownEvent(officeNode, { key: 'ArrowUp', bubbles: true }); - await coordinator.done(); + await RenderCoordinator.done(); assert.strictEqual(getFocusableTreeNode(shadowRoot), officeNode); }); it('moves focus to the previous sibling', async () => { @@ -730,7 +729,7 @@ describe('TreeOutline', () => { const berlinNode = getVisibleTreeNodeByText(shadowRoot, 'BER'); dispatchClickEvent(berlinNode); dispatchKeyDownEvent(berlinNode, { key: 'ArrowUp', bubbles: true }); - await coordinator.done(); + await RenderCoordinator.done(); assert.strictEqual(getFocusableTreeNode(shadowRoot), getVisibleTreeNodeByText(shadowRoot, 'MUC')); }); it('moves focus to the parent if there are no previous siblings', async () => { @@ -742,7 +741,7 @@ describe('TreeOutline', () => { const ukNode = getVisibleTreeNodeByText(shadowRoot, 'UK'); dispatchClickEvent(ukNode); dispatchKeyDownEvent(ukNode, { key: 'ArrowUp', bubbles: true }); - await coordinator.done(); + await RenderCoordinator.done(); assert.strictEqual(getFocusableTreeNode(shadowRoot), getVisibleTreeNodeByText(shadowRoot, 'Europe')); }); it('moves focus to the parent\'s last child if there are no previous siblings and the parent is expanded', async () => { @@ -754,7 +753,7 @@ describe('TreeOutline', () => { const germanyNode = getVisibleTreeNodeByText(shadowRoot, 'Germany'); dispatchClickEvent(germanyNode); dispatchKeyDownEvent(germanyNode, { key: 'ArrowUp', bubbles: true }); - await coordinator.done(); + await RenderCoordinator.done(); assert.strictEqual(getFocusableTreeNode(shadowRoot), getVisibleTreeNodeByText(shadowRoot, 'LON')); }); it('moves focus to the parent\'s deeply nested last child if there are no previous siblings and the parent has children that are expanded', async () => { @@ -766,7 +765,7 @@ describe('TreeOutline', () => { const germanyNode = getVisibleTreeNodeByText(shadowRoot, 'Germany'); dispatchClickEvent(germanyNode); dispatchKeyDownEvent(germanyNode, { key: 'ArrowUp', bubbles: true }); - await coordinator.done(); + await RenderCoordinator.done(); assert.strictEqual(getFocusableTreeNode(shadowRoot), getVisibleTreeNodeByText(shadowRoot, 'BEL')); }); }); @@ -780,7 +779,7 @@ describe('TreeOutline', () => { const chromeNode = getVisibleTreeNodeByText(shadowRoot, 'Chrome'); dispatchClickEvent(chromeNode); dispatchKeyDownEvent(chromeNode, { key: 'ArrowRight', bubbles: true }); - await coordinator.done(); + await RenderCoordinator.done(); assert.strictEqual(getFocusableTreeNode(shadowRoot), chromeNode); }); it('expands the node if on an expandable node that is closed and does not move focus', async () => { @@ -790,7 +789,7 @@ describe('TreeOutline', () => { const officeNode = getVisibleTreeNodeByText(shadowRoot, 'Offices'); dispatchClickEvent(officeNode); dispatchKeyDownEvent(officeNode, { key: 'ArrowRight', bubbles: true }); - await coordinator.done(); + await RenderCoordinator.done(); assert.strictEqual(getFocusableTreeNode(shadowRoot), officeNode); assert.strictEqual(officeNode.getAttribute('aria-expanded'), 'true'); }); @@ -802,9 +801,9 @@ describe('TreeOutline', () => { dispatchClickEvent(officeNode); // Press once to expand, twice to navigate in to the first child dispatchKeyDownEvent(officeNode, { key: 'ArrowRight', bubbles: true }); - await coordinator.done(); + await RenderCoordinator.done(); dispatchKeyDownEvent(officeNode, { key: 'ArrowRight', bubbles: true }); - await coordinator.done(); + await RenderCoordinator.done(); assert.strictEqual(getFocusableTreeNode(shadowRoot), getVisibleTreeNodeByText(shadowRoot, 'Europe')); }); }); @@ -814,11 +813,11 @@ describe('TreeOutline', () => { tree: basicTreeData, }); await component.expandRecursively(Number.POSITIVE_INFINITY); - await coordinator.done(); + await RenderCoordinator.done(); const europeNode = getVisibleTreeNodeByText(shadowRoot, 'Europe'); dispatchClickEvent(europeNode); dispatchKeyDownEvent(europeNode, { key: 'ArrowLeft', bubbles: true }); - await coordinator.done(); + await RenderCoordinator.done(); assert.strictEqual(getFocusableTreeNode(shadowRoot), getVisibleTreeNodeByText(shadowRoot, 'Europe')); const visibleTree = visibleNodesToTree(shadowRoot); // The tree below "Europe" is hidden as the left arrow press closed that node. @@ -854,11 +853,11 @@ describe('TreeOutline', () => { }); await component.expandRecursively(Number.POSITIVE_INFINITY); await waitForRenderedTreeNodeCount(shadowRoot, NODE_COUNT_BASIC_DATA_FULLY_EXPANDED); - await coordinator.done(); + await RenderCoordinator.done(); const berlinNode = getVisibleTreeNodeByText(shadowRoot, 'BER'); dispatchClickEvent(berlinNode); dispatchKeyDownEvent(berlinNode, { key: 'ArrowLeft', bubbles: true }); - await coordinator.done(); + await RenderCoordinator.done(); assert.strictEqual(getFocusableTreeNode(shadowRoot), getVisibleTreeNodeByText(shadowRoot, 'Germany')); }); it('does nothing when called on a root node', async () => { @@ -868,7 +867,7 @@ describe('TreeOutline', () => { const productsNode = getVisibleTreeNodeByText(shadowRoot, 'Products'); dispatchClickEvent(productsNode); dispatchKeyDownEvent(productsNode, { key: 'ArrowLeft', bubbles: true }); - await coordinator.done(); + await RenderCoordinator.done(); assert.strictEqual(getFocusableTreeNode(shadowRoot), getVisibleTreeNodeByText(shadowRoot, 'Products')); }); }); @@ -880,7 +879,7 @@ describe('TreeOutline', () => { const officeNode = getVisibleTreeNodeByText(shadowRoot, 'Offices'); dispatchClickEvent(officeNode); dispatchKeyDownEvent(officeNode, { key: 'ArrowDown', bubbles: true }); - await coordinator.done(); + await RenderCoordinator.done(); assert.strictEqual(getFocusableTreeNode(shadowRoot), getVisibleTreeNodeByText(shadowRoot, 'Products')); }); it('does not move if it is the last sibling and there are no parent siblings', async () => { @@ -890,7 +889,7 @@ describe('TreeOutline', () => { const productsNode = getVisibleTreeNodeByText(shadowRoot, 'Products'); dispatchClickEvent(productsNode); dispatchKeyDownEvent(productsNode, { key: 'ArrowDown', bubbles: true }); - await coordinator.done(); + await RenderCoordinator.done(); assert.strictEqual(getFocusableTreeNode(shadowRoot), getVisibleTreeNodeByText(shadowRoot, 'Products')); }); it('moves down to the first child of the node if it is expanded', async () => { @@ -898,11 +897,11 @@ describe('TreeOutline', () => { tree: basicTreeData, }); await component.expandRecursively(); - await coordinator.done(); + await RenderCoordinator.done(); const officeNode = getVisibleTreeNodeByText(shadowRoot, 'Offices'); dispatchClickEvent(officeNode); dispatchKeyDownEvent(officeNode, { key: 'ArrowDown', bubbles: true }); - await coordinator.done(); + await RenderCoordinator.done(); assert.strictEqual(getFocusableTreeNode(shadowRoot), getVisibleTreeNodeByText(shadowRoot, 'Europe')); }); it('moves to its parent\'s sibling if it is the last child', async () => { @@ -914,7 +913,7 @@ describe('TreeOutline', () => { const lonNode = getVisibleTreeNodeByText(shadowRoot, 'LON'); dispatchClickEvent(lonNode); dispatchKeyDownEvent(lonNode, { key: 'ArrowDown', bubbles: true }); - await coordinator.done(); + await RenderCoordinator.done(); assert.strictEqual(getFocusableTreeNode(shadowRoot), getVisibleTreeNodeByText(shadowRoot, 'Germany')); }); it('is able to navigate high up the tree to the correct next parent\'s sibling', async () => { @@ -926,7 +925,7 @@ describe('TreeOutline', () => { const berNode = getVisibleTreeNodeByText(shadowRoot, 'BER'); dispatchClickEvent(berNode); dispatchKeyDownEvent(berNode, { key: 'ArrowDown', bubbles: true }); - await coordinator.done(); + await RenderCoordinator.done(); assert.strictEqual(getFocusableTreeNode(shadowRoot), getVisibleTreeNodeByText(shadowRoot, 'Products')); }); }); @@ -939,7 +938,7 @@ describe('TreeOutline', () => { }); await component.expandRecursively(Number.POSITIVE_INFINITY); await waitForRenderedTreeNodeCount(shadowRoot, NODE_COUNT_BASIC_DATA_FULLY_EXPANDED); - await coordinator.done(); + await RenderCoordinator.done(); const rootNode = getVisibleTreeNodeByText(shadowRoot, 'Offices'); assert.strictEqual(rootNode.getAttribute('aria-level'), '1'); const europeNode = getVisibleTreeNodeByText(shadowRoot, 'Europe'); @@ -995,7 +994,7 @@ describe('TreeOutline', () => { const arrowIcon = rootNode.querySelector('.arrow-icon'); assert.instanceOf(arrowIcon, HTMLSpanElement); dispatchClickEvent(arrowIcon); - await coordinator.done(); + await RenderCoordinator.done(); assert.strictEqual(rootNode.getAttribute('aria-expanded'), 'true'); }); it('does not set aria-expanded at all on leaf nodes', async () => { @@ -1005,7 +1004,7 @@ describe('TreeOutline', () => { await component.expandRecursively(Number.POSITIVE_INFINITY); await waitForRenderedTreeNodeCount(shadowRoot, NODE_COUNT_BASIC_DATA_FULLY_EXPANDED); const leafNodeCSGOffice = getVisibleTreeNodeByText(shadowRoot, 'CSG'); - assert.strictEqual(leafNodeCSGOffice.getAttribute('aria-expanded'), null); + assert.isNull(leafNodeCSGOffice.getAttribute('aria-expanded')); }); }); describe('emitting events', () => { @@ -1014,7 +1013,7 @@ describe('TreeOutline', () => { const { component, shadowRoot } = await renderTreeOutline({ tree: basicTreeData, }); - await coordinator.done(); + await RenderCoordinator.done(); const officeNode = getVisibleTreeNodeByText(shadowRoot, 'Offices'); const treeItemSelectedEvent = getEventPromise(component, 'itemselected'); dispatchClickEvent(officeNode); @@ -1025,13 +1024,13 @@ describe('TreeOutline', () => { const { component, shadowRoot } = await renderTreeOutline({ tree: basicTreeData, }); - await coordinator.done(); + await RenderCoordinator.done(); const officeNode = getVisibleTreeNodeByText(shadowRoot, 'Offices'); dispatchClickEvent(officeNode); - await coordinator.done(); + await RenderCoordinator.done(); dispatchKeyDownEvent(officeNode, { key: 'ArrowDown', bubbles: true }); const treeItemSelectedEvent = getEventPromise(component, 'itemselected'); - await coordinator.done(); + await RenderCoordinator.done(); const event = await treeItemSelectedEvent; assert.deepEqual(event.data, { node: basicTreeData[1] }); }); @@ -1041,7 +1040,7 @@ describe('TreeOutline', () => { const { component, shadowRoot } = await renderTreeOutline({ tree: basicTreeData, }); - await coordinator.done(); + await RenderCoordinator.done(); const officeNode = getVisibleTreeNodeByText(shadowRoot, 'Offices').querySelector('.arrow-and-key-wrapper'); assert.instanceOf(officeNode, HTMLSpanElement); const itemMouseOverEvent = getEventPromise(component, 'itemmouseover'); @@ -1055,7 +1054,7 @@ describe('TreeOutline', () => { const { component, shadowRoot } = await renderTreeOutline({ tree: basicTreeData, }); - await coordinator.done(); + await RenderCoordinator.done(); const officeNode = getVisibleTreeNodeByText(shadowRoot, 'Offices').querySelector('.arrow-and-key-wrapper'); assert.instanceOf(officeNode, HTMLSpanElement); dispatchMouseOverEvent(officeNode); @@ -1125,7 +1124,7 @@ describe('TreeOutline', () => { defaultRenderer: (node => html `${node.treeNodeData}`), }; await waitForRenderedTreeNodeCount(shadowRoot, 4); - await coordinator.done(); + await RenderCoordinator.done(); const visibleTree = visibleNodesToTree(shadowRoot); // The tree should still be expanded down to the node with key `gawler`. assert.deepEqual(visibleTree, [{ @@ -1151,7 +1150,7 @@ describe('TreeOutline', () => { }); await component.expandToAndSelectTreeNode({ treeNodeData: 'literally anything', id: 'gawler' }); await waitForRenderedTreeNodeCount(shadowRoot, 7); - await coordinator.done(); + await RenderCoordinator.done(); // The tree is expanded down to include "Gawler" but the rest of the tree is still collapsed. assert.strictEqual(getFocusableTreeNode(shadowRoot), getVisibleTreeNodeByText(shadowRoot, 'Gawler')); }); @@ -1165,7 +1164,7 @@ describe('TreeOutlineUtils', () => { }); it('returns null if no path is found', async () => { const path = await TreeOutline.TreeOutlineUtils.getPathToTreeNode(basicTreeData, '-1'); - assert.strictEqual(path, null); + assert.isNull(path); }); }); }); @@ -1178,7 +1177,7 @@ describe('TreeOutlineFiltering', () => { "SHOW" /* TreeOutline.TreeOutline.FilterOption.SHOW */, }); await component.expandRecursively(); - await coordinator.done(); + await RenderCoordinator.done(); await waitForRenderedTreeNodeCount(shadowRoot, 7); const visibleTree = visibleNodesToTree(shadowRoot); assert.deepEqual(visibleTree, [{ @@ -1198,7 +1197,7 @@ describe('TreeOutlineFiltering', () => { tree: [nodeAustralia], }); await component.expandNodeIds(['australia', 'sa', 'adelaide']); - await coordinator.done(); + await RenderCoordinator.done(); await waitForRenderedTreeNodeCount(shadowRoot, 7); const visibleTree = visibleNodesToTree(shadowRoot); assert.deepEqual(visibleTree, [{ diff --git a/public/ui/components/tree_outline/TreeOutline.test.js.map b/public/ui/components/tree_outline/TreeOutline.test.js.map index 168994a89..f40401d49 100644 --- a/public/ui/components/tree_outline/TreeOutline.test.js.map +++ b/public/ui/components/tree_outline/TreeOutline.test.js.map @@ -1 +1 @@ -{"version":3,"file":"TreeOutline.test.js","sourceRoot":"","sources":["../../../../../../../front_end/ui/components/tree_outline/TreeOutline.test.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,EACL,kBAAkB,EAClB,oBAAoB,EACpB,qBAAqB,EACrB,sBAAsB,EACtB,eAAe,EACf,o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AE,gBAAgB,EAAC;oCAC/B,EAAC,WAAW,EAAE,iBAAiB,EAAC;oCAChC,EAAC,WAAW,EAAE,QAAQ,EAAC;iCACxB;6BACF;yBACF;qBACF;oBACD,EAAC,WAAW,EAAE,OAAO,EAAC;oBACtB,EAAC,WAAW,EAAE,SAAS,EAAC;oBACxB,EAAC,WAAW,EAAE,YAAY,EAAC;iBAC5B;aACF,CAAC,CAAC,CAAC;IACvB,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["// Copyright 2020 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport {\n dispatchClickEvent,\n dispatchKeyDownEvent,\n dispatchMouseOutEvent,\n dispatchMouseOverEvent,\n getEventPromise,\n renderElementIntoDOM,\n stripLitHtmlCommentNodes,\n} from '../../../testing/DOMHelpers.js';\nimport * as LitHtml from '../../lit-html/lit-html.js';\nimport * as Coordinator from '../render_coordinator/render_coordinator.js';\n\nimport * as TreeOutline from './tree_outline.js';\n\nconst {html} = LitHtml;\n\nconst coordinator = Coordinator.RenderCoordinator.RenderCoordinator.instance();\n\nasync function renderTreeOutline({\n tree,\n defaultRenderer,\n filter,\n}: {\n tree: TreeOutline.TreeOutline.TreeOutlineData['tree'],\n // defaultRenderer is required usually but here we make it optinal and provide a default one as part of renderTreeOutline, to save duplication in every single test where we want to use a simple string renderer.\n defaultRenderer?: TreeOutline.TreeOutline.TreeOutlineData['defaultRenderer'],\n filter?: TreeOutline.TreeOutline.TreeOutlineData['filter'],\n}): Promise<{\n component: TreeOutline.TreeOutline.TreeOutline,\n shadowRoot: ShadowRoot,\n}> {\n const component = new TreeOutline.TreeOutline.TreeOutline();\n const data: TreeOutline.TreeOutline.TreeOutlineData = {\n tree,\n defaultRenderer: defaultRenderer ||\n ((node: TreeOutline.TreeOutlineUtils.TreeNode) => html`${node.treeNodeData}`),\n filter,\n };\n component.data = data;\n renderElementIntoDOM(component);\n assert.isNotNull(component.shadowRoot);\n await coordinator.done();\n return {\n component,\n shadowRoot: component.shadowRoot,\n };\n}\n\n/**\n * Wait for a certain number of children are rendered. We need this as the\n * component uses LitHtml's until directive, which is async and not within the\n * render coordinator's control.\n */\nasync function waitForRenderedTreeNodeCount(shadowRoot: ShadowRoot, expectedNodeCount: number): Promise {\n const actualNodeCount = shadowRoot.querySelectorAll('li[role=\"treeitem\"]').length;\n if (actualNodeCount === expectedNodeCount) {\n return;\n }\n\n await new Promise(resolve => {\n requestAnimationFrame(async () => {\n await waitForRenderedTreeNodeCount(shadowRoot, expectedNodeCount);\n resolve();\n });\n });\n}\n\nfunction getFocusableTreeNode(shadowRoot: ShadowRoot): HTMLLIElement {\n const focusableNode = shadowRoot.querySelector('li[role=\"treeitem\"][tabindex=\"0\"]');\n if (!focusableNode) {\n throw new Error('Could not find focused node in Tree shadow root');\n }\n return focusableNode;\n}\n\n/*\nThe structure represented by basicTreeData is:\n\n- Offices\n - Europe\n - UK\n - LON\n - 6PS\n - CSG\n - BEL\n - Germany\n - MUC\n - BER\n- Products\n - Chrome\n - YouTube\n - Drive\n - Calendar\n*/\n\n// These node is pulled out as we test expandAndSelectTreeNode and getPathToTreeNode with them.\nconst nodeBelgraveHouse = {\n treeNodeData: 'BEL',\n id: 'BEL',\n};\n\nconst nodeLondon = {\n treeNodeData: 'LON',\n id: 'LON',\n children: async () => [{treeNodeData: '6PS', id: '6PS'}, {treeNodeData: 'CSG', id: 'CSG'}, nodeBelgraveHouse],\n};\n\nconst nodeUK = {\n treeNodeData: 'UK',\n id: 'UK',\n children: async () => [nodeLondon],\n};\n\nconst nodeEurope = {\n treeNodeData: 'Europe',\n id: 'Europe',\n children: async () => [nodeUK, {\n treeNodeData: 'Germany',\n id: 'Germany',\n children: async () => [{treeNodeData: 'MUC', id: 'MUC'}, {treeNodeData: 'BER', id: 'BER'}],\n }],\n};\n\nconst nodeOffices = {\n treeNodeData: 'Offices',\n id: 'Offices',\n children: async () => [nodeEurope],\n};\n\nconst basicTreeData: TreeOutline.TreeOutlineUtils.TreeNode[] = [\n nodeOffices,\n {\n treeNodeData: 'Products',\n id: '1',\n children: async () =>\n [{\n treeNodeData: 'Chrome',\n id: '2',\n },\n {\n treeNodeData: 'YouTube',\n id: '3',\n },\n {\n treeNodeData: 'Drive',\n id: '4',\n },\n {\n treeNodeData: 'Calendar',\n id: '5',\n }],\n },\n];\n\n/*\nThe structure represented by nodeAustralia is:\n\n- Australia\n - SA\n - Adelaide\n - Toorak Gardens\n - Woodville South\n - Gawler\n - NSW\n - Glebe\n - Newtown\n - Camperdown\n*/\n\nconst nodeAustralia = {\n treeNodeData: 'Australia',\n id: 'australia',\n children: async () =>\n [{\n treeNodeData: 'SA',\n id: 'sa',\n children: async () =>\n [{\n treeNodeData: 'Adelaide',\n id: 'adelaide',\n children: async () =>\n [{treeNodeData: 'Toorak Gardens', id: 'toorak'},\n {treeNodeData: 'Woodville South', id: 'woodville'},\n {treeNodeData: 'Gawler', id: 'gawler'},\n],\n },\n],\n },\n {\n treeNodeData: 'NSW',\n id: 'nsw',\n children: async () =>\n [{treeNodeData: 'Glebe', id: 'glebe'},\n {treeNodeData: 'Newtown', id: 'newtown'},\n {treeNodeData: 'Camperdown', id: 'camperdown'},\n],\n },\n],\n};\n\nconst NODE_COUNT_BASIC_DATA_FULLY_EXPANDED = 15;\nconst NODE_COUNT_BASIC_DATA_DEFAULT_EXPANDED = 12;\n\ninterface VisibleTreeNodeFromDOM {\n renderedKey: string;\n children?: VisibleTreeNodeFromDOM[];\n}\n\n/**\n * Converts the nodes into a tree structure that we can assert against.\n */\nfunction visibleNodesToTree(shadowRoot: ShadowRoot): VisibleTreeNodeFromDOM[] {\n const tree: VisibleTreeNodeFromDOM[] = [];\n\n function buildTreeNode(node: HTMLLIElement): VisibleTreeNodeFromDOM {\n const item: VisibleTreeNodeFromDOM = {\n renderedKey: nodeKeyInnerHTML(node),\n };\n\n if (node.getAttribute('aria-expanded') && node.getAttribute('aria-expanded') === 'true') {\n item.children = [];\n const childNodes = node.querySelectorAll(':scope > ul[role=\"group\"]>li');\n for (const child of childNodes) {\n item.children.push(buildTreeNode(child));\n }\n }\n\n return item;\n }\n const rootNodes = shadowRoot.querySelectorAll('ul[role=\"tree\"]>li');\n for (const root of rootNodes) {\n tree.push(buildTreeNode(root));\n }\n return tree;\n}\n\nfunction treeNodeKeyText(node: HTMLLIElement) {\n const keyNode = node.querySelector('[data-node-key]');\n if (!keyNode) {\n throw new Error('Found tree node without a key within it.');\n }\n return keyNode.getAttribute('data-node-key') || '';\n}\n\nfunction nodeKeyInnerHTML(node: HTMLLIElement) {\n const keyNode = node.querySelector('[data-node-key]');\n if (!keyNode) {\n throw new Error('Found tree node without a key within it.');\n }\n return stripLitHtmlCommentNodes(keyNode.innerHTML);\n}\n\nfunction getVisibleTreeNodeByText(shadowRoot: ShadowRoot, text: string): HTMLLIElement {\n const nodes = shadowRoot.querySelectorAll('li[role=\"treeitem\"]');\n const matchingNode = Array.from(nodes).find(node => {\n return treeNodeKeyText(node) === text;\n });\n\n if (!matchingNode) {\n throw new Error(`Could not find tree item with text ${text}.`);\n }\n return matchingNode;\n}\n\ndescribe('TreeOutline', () => {\n it('renders with all non-root nodes hidden by default', async () => {\n const {shadowRoot} = await renderTreeOutline({\n tree: basicTreeData,\n });\n const visibleItems = shadowRoot.querySelectorAll('li[role=\"treeitem\"]');\n assert.lengthOf(visibleItems, 2);\n const itemText1 = treeNodeKeyText(visibleItems[0]);\n const itemText2 = treeNodeKeyText(visibleItems[1]);\n assert.strictEqual(itemText1, 'Offices');\n assert.strictEqual(itemText2, 'Products');\n });\n\n it('expands a node when the arrow icon is clicked', async () => {\n const {shadowRoot} = await renderTreeOutline({\n tree: basicTreeData,\n });\n const rootNode = getVisibleTreeNodeByText(shadowRoot, 'Offices');\n const arrowIcon = rootNode.querySelector('.arrow-icon');\n assert.instanceOf(arrowIcon, HTMLSpanElement);\n dispatchClickEvent(arrowIcon);\n await waitForRenderedTreeNodeCount(shadowRoot, 3);\n const visibleTree = visibleNodesToTree(shadowRoot);\n assert.deepEqual(visibleTree, [\n {renderedKey: 'Offices', children: [{renderedKey: 'Europe'}]},\n {renderedKey: 'Products'},\n ]);\n });\n\n it('does not expand nodes when clicking outside of the arrow by default', async () => {\n const {shadowRoot} = await renderTreeOutline({\n tree: basicTreeData,\n });\n const rootNode = getVisibleTreeNodeByText(shadowRoot, 'Offices');\n dispatchClickEvent(rootNode);\n await waitForRenderedTreeNodeCount(shadowRoot, 2);\n const visibleTree = visibleNodesToTree(shadowRoot);\n assert.deepEqual(visibleTree, [\n {renderedKey: 'Offices'},\n {renderedKey: 'Products'},\n ]);\n });\n\n it('can be configured to expand nodes when any part of the node is clicked', async () => {\n const {component, shadowRoot} = await renderTreeOutline({\n tree: basicTreeData,\n });\n component.setAttribute('clickabletitle', '');\n const rootNode = getVisibleTreeNodeByText(shadowRoot, 'Offices');\n dispatchClickEvent(rootNode);\n await waitForRenderedTreeNodeCount(shadowRoot, 3);\n const visibleTree = visibleNodesToTree(shadowRoot);\n assert.deepEqual(visibleTree, [\n {renderedKey: 'Offices', children: [{renderedKey: 'Europe'}]},\n {renderedKey: 'Products'},\n ]);\n });\n\n describe('nowrap attribute', () => {\n it('sets the white-space to initial by default', async () => {\n const {shadowRoot} = await renderTreeOutline({\n tree: basicTreeData,\n });\n const rootNode = getVisibleTreeNodeByText(shadowRoot, 'Offices');\n const key = rootNode.querySelector('[data-node-key]');\n assert.instanceOf(key, HTMLElement);\n const whiteSpaceValue = window.getComputedStyle(key).getPropertyValue('white-space');\n assert.strictEqual(whiteSpaceValue, 'normal');\n });\n\n it('will set white-space: nowrap if the attribute is set', async () => {\n const {component, shadowRoot} = await renderTreeOutline({\n tree: basicTreeData,\n });\n component.setAttribute('nowrap', '');\n const rootNode = getVisibleTreeNodeByText(shadowRoot, 'Offices');\n const key = rootNode.querySelector('[data-node-key]');\n assert.instanceOf(key, HTMLElement);\n const whiteSpaceValue = window.getComputedStyle(key).getPropertyValue('white-space');\n assert.strictEqual(whiteSpaceValue, 'nowrap');\n });\n });\n\n describe('toplevelbordercolor attribute', () => {\n it('by default the nodes are not given a border', async () => {\n const {shadowRoot} = await renderTreeOutline({\n tree: basicTreeData,\n });\n const rootNode = getVisibleTreeNodeByText(shadowRoot, 'Offices');\n const borderTopValue = window.getComputedStyle(rootNode).getPropertyValue('border-top');\n // Odd assertion: this is the default borderTop the browser \"applies\" if none is set.\n assert.strictEqual(borderTopValue, '0px none rgb(0, 0, 0)');\n });\n\n it('gives the nodes a border if the attribute is set', async () => {\n const {component, shadowRoot} = await renderTreeOutline({\n tree: basicTreeData,\n });\n component.setAttribute('toplevelbordercolor', 'rgb(255, 0, 0)');\n const rootNode = getVisibleTreeNodeByText(shadowRoot, 'Offices');\n const borderTopValue = window.getComputedStyle(rootNode).getPropertyValue('border-top');\n assert.strictEqual(borderTopValue, '1px solid rgb(255, 0, 0)');\n });\n });\n\n it('can take nodes with a custom key type', async () => {\n interface CustomTreeKeyType {\n property: string;\n value: string;\n }\n const customRenderer = (node: TreeOutline.TreeOutlineUtils.TreeNode) => {\n return html`

      ${node.treeNodeData.property.toUpperCase()}:

      ${node.treeNodeData.value}`;\n };\n const tinyTree: TreeOutline.TreeOutlineUtils.TreeNode[] = [{\n treeNodeData: {property: 'name', value: 'jack'},\n id: '0',\n renderer: customRenderer,\n children: async () =>\n [{\n renderer: customRenderer,\n id: '1',\n treeNodeData: {property: 'locationGroupName', value: 'EMEA'},\n },\n {\n renderer: customRenderer,\n id: '2',\n treeNodeData: {property: 'locationGroupName', value: 'USA'},\n },\n {\n renderer: customRenderer,\n id: '3',\n treeNodeData: {property: 'locationGroupName', value: 'APAC'},\n }],\n }];\n const {component, shadowRoot} = await renderTreeOutline({\n tree: tinyTree,\n });\n\n await component.expandRecursively();\n await waitForRenderedTreeNodeCount(shadowRoot, 4);\n const visibleTree = visibleNodesToTree(shadowRoot);\n assert.deepEqual(visibleTree, [\n {\n renderedKey: '

      NAME:

      jack',\n children: [\n {\n renderedKey: '

      LOCATIONGROUPNAME:

      EMEA',\n },\n {\n renderedKey: '

      LOCATIONGROUPNAME:

      USA',\n },\n {\n renderedKey: '

      LOCATIONGROUPNAME:

      APAC',\n },\n ],\n },\n ]);\n });\n\n it('can recursively expand the tree, going 3 levels deep by default', async () => {\n const {component, shadowRoot} = await renderTreeOutline({\n tree: basicTreeData,\n });\n await component.expandRecursively();\n await waitForRenderedTreeNodeCount(shadowRoot, 12);\n const visibleTree = visibleNodesToTree(shadowRoot);\n assert.deepEqual(visibleTree, [\n {\n renderedKey: 'Offices',\n children: [{\n renderedKey: 'Europe',\n children: [\n {renderedKey: 'UK', children: [{renderedKey: 'LON'}]},\n {renderedKey: 'Germany', children: [{renderedKey: 'MUC'}, {renderedKey: 'BER'}]},\n ],\n }],\n },\n {\n renderedKey: 'Products',\n children: [\n {\n renderedKey: 'Chrome',\n },\n {\n renderedKey: 'YouTube',\n },\n {\n renderedKey: 'Drive',\n },\n {\n renderedKey: 'Calendar',\n },\n ],\n },\n ]);\n });\n\n describe('expandToAndSelectTreeNode', () => {\n it('expands the relevant part of the tree to reveal the given node', async () => {\n const {component, shadowRoot} = await renderTreeOutline({\n tree: basicTreeData,\n });\n await component.expandToAndSelectTreeNode(nodeBelgraveHouse);\n await waitForRenderedTreeNodeCount(shadowRoot, 9);\n const visibleTree = visibleNodesToTree(shadowRoot);\n // The tree is expanded down to include \"BEL\" but the rest of the tree is still collapsed.\n assert.deepEqual(visibleTree, [\n {\n renderedKey: 'Offices',\n children: [{\n renderedKey: 'Europe',\n children: [\n {\n renderedKey: 'UK',\n children: [\n {renderedKey: 'LON', children: [{renderedKey: '6PS'}, {renderedKey: 'CSG'}, {renderedKey: 'BEL'}]},\n ],\n },\n {renderedKey: 'Germany'},\n ],\n }],\n },\n {\n renderedKey: 'Products',\n },\n ]);\n });\n\n it('selects the given node once the tree has been expanded', async () => {\n const {component, shadowRoot} = await renderTreeOutline({\n tree: basicTreeData,\n });\n await component.expandToAndSelectTreeNode(nodeBelgraveHouse);\n // Wait for the tree to be expanded\n await waitForRenderedTreeNodeCount(shadowRoot, 9);\n // Wait for the coordinator to have called focus() on the right node\n await coordinator.done();\n\n assert.strictEqual(\n getFocusableTreeNode(shadowRoot),\n getVisibleTreeNodeByText(shadowRoot, 'BEL'),\n );\n });\n });\n\n it('can recursively collapse all children of a node', async () => {\n const {component, shadowRoot} = await renderTreeOutline({\n tree: basicTreeData,\n });\n await component.expandRecursively(Number.POSITIVE_INFINITY);\n await waitForRenderedTreeNodeCount(shadowRoot, NODE_COUNT_BASIC_DATA_FULLY_EXPANDED);\n const europeNode = getVisibleTreeNodeByText(shadowRoot, 'Europe');\n await component.collapseChildrenOfNode(europeNode);\n await waitForRenderedTreeNodeCount(shadowRoot, 7);\n const visibleTree = visibleNodesToTree(shadowRoot);\n assert.deepEqual(visibleTree, [\n {\n renderedKey: 'Offices',\n children: [{\n renderedKey: 'Europe',\n }],\n },\n {\n renderedKey: 'Products',\n children: [\n {\n renderedKey: 'Chrome',\n },\n {\n renderedKey: 'YouTube',\n },\n {\n renderedKey: 'Drive',\n },\n {\n renderedKey: 'Calendar',\n },\n ],\n },\n ]);\n });\n\n it('can collapse all nodes', async () => {\n const {component, shadowRoot} = await renderTreeOutline({\n tree: basicTreeData,\n });\n await component.expandRecursively(Number.POSITIVE_INFINITY);\n await waitForRenderedTreeNodeCount(shadowRoot, NODE_COUNT_BASIC_DATA_FULLY_EXPANDED);\n await component.collapseAllNodes();\n await waitForRenderedTreeNodeCount(shadowRoot, 2);\n const visibleTree = visibleNodesToTree(shadowRoot);\n assert.deepEqual(visibleTree, [\n {\n renderedKey: 'Offices',\n },\n {\n renderedKey: 'Products',\n },\n ]);\n });\n\n it('caches async child nodes and only fetches them once', async () => {\n const fetchChildrenSpy = sinon.spy<() => Promise[]>>(async () => {\n return [\n {\n treeNodeData: 'EMEA',\n id: '1',\n },\n {\n treeNodeData: 'USA',\n id: '2',\n },\n {\n treeNodeData: 'APAC',\n id: '3',\n },\n ];\n });\n const tinyTree: TreeOutline.TreeOutlineUtils.TreeNode[] = [\n {\n treeNodeData: 'Offices',\n id: '0',\n children: fetchChildrenSpy,\n },\n ];\n\n const {component, shadowRoot} = await renderTreeOutline({\n tree: tinyTree,\n });\n\n // Expand it, then collapse it, then expand it again\n await component.expandRecursively(Number.POSITIVE_INFINITY);\n await waitForRenderedTreeNodeCount(shadowRoot, 4);\n assert.strictEqual(fetchChildrenSpy.callCount, 1);\n const officesNode = getVisibleTreeNodeByText(shadowRoot, 'Offices');\n await component.collapseChildrenOfNode(officesNode);\n await waitForRenderedTreeNodeCount(shadowRoot, 1);\n await component.expandRecursively(Number.POSITIVE_INFINITY);\n await waitForRenderedTreeNodeCount(shadowRoot, 4);\n // Make sure that we only fetched the children once despite expanding the\n // Tree twice.\n assert.strictEqual(fetchChildrenSpy.callCount, 1);\n const visibleTree = visibleNodesToTree(shadowRoot);\n assert.deepEqual(visibleTree, [\n {\n renderedKey: 'Offices',\n children: [\n {\n renderedKey: 'EMEA',\n },\n {renderedKey: 'USA'},\n {renderedKey: 'APAC'},\n ],\n },\n ]);\n });\n\n it('allows a node to have a custom renderer', async () => {\n const tinyTree: TreeOutline.TreeOutlineUtils.TreeNode[] = [{\n treeNodeData: 'Offices',\n id: 'Offices',\n renderer: node => html`

      ${node.treeNodeData.toUpperCase()}

      `,\n children: async () =>\n [{\n treeNodeData: 'EMEA',\n id: 'EMEA',\n },\n {\n treeNodeData: 'USA',\n id: 'USA',\n },\n {\n treeNodeData: 'APAC',\n id: 'APAC',\n }],\n }];\n\n const {component, shadowRoot} = await renderTreeOutline({\n tree: tinyTree,\n });\n\n await component.expandRecursively(Number.POSITIVE_INFINITY);\n await waitForRenderedTreeNodeCount(shadowRoot, 4);\n const officeNode = getVisibleTreeNodeByText(shadowRoot, 'Offices');\n const key = officeNode.querySelector('[data-node-key]');\n assert.instanceOf(key, HTMLElement);\n const renderedKey = stripLitHtmlCommentNodes(key.innerHTML);\n assert.strictEqual(renderedKey, '

      OFFICES

      ');\n });\n\n it('passes the custom renderer the expanded state', async () => {\n const tinyTree: TreeOutline.TreeOutlineUtils.TreeNode[] = [{\n treeNodeData: 'Offices',\n id: 'Offices',\n renderer: (node, {isExpanded}) => {\n return html`

      ${node.treeNodeData.toUpperCase()}. Expanded: ${isExpanded}

      `;\n },\n children: async () =>\n [{\n treeNodeData: 'EMEA',\n id: 'EMEA',\n },\n {\n treeNodeData: 'USA',\n id: 'USA',\n },\n {\n treeNodeData: 'APAC',\n id: 'APAC',\n }],\n }];\n\n const {component, shadowRoot} = await renderTreeOutline({\n tree: tinyTree,\n });\n\n const officeNode = getVisibleTreeNodeByText(shadowRoot, 'Offices');\n const key = officeNode.querySelector('[data-node-key]');\n assert.instanceOf(key, HTMLElement);\n let renderedKey = stripLitHtmlCommentNodes(key.innerHTML);\n assert.strictEqual(renderedKey, '

      OFFICES. Expanded: false

      ');\n await component.expandRecursively(Number.POSITIVE_INFINITY);\n await waitForRenderedTreeNodeCount(shadowRoot, 4);\n renderedKey = stripLitHtmlCommentNodes(key.innerHTML);\n assert.strictEqual(renderedKey, '

      OFFICES. Expanded: true

      ');\n });\n\n describe('navigating with keyboard', () => {\n it('defaults to the first root node as active', async () => {\n const {shadowRoot} = await renderTreeOutline({\n tree: basicTreeData,\n });\n assert.strictEqual(\n getFocusableTreeNode(shadowRoot),\n getVisibleTreeNodeByText(shadowRoot, 'Offices'),\n );\n });\n\n describe('pressing the ENTER key', () => {\n it('expands the node if it is closed', async () => {\n const {shadowRoot} = await renderTreeOutline({\n tree: basicTreeData,\n });\n const officeNode = getVisibleTreeNodeByText(shadowRoot, 'Offices');\n dispatchClickEvent(officeNode);\n await coordinator.done();\n dispatchKeyDownEvent(officeNode, {key: 'Enter', bubbles: true});\n await waitForRenderedTreeNodeCount(shadowRoot, 3);\n assert.strictEqual(officeNode.getAttribute('aria-expanded'), 'true');\n });\n\n it('closes the node if it is open', async () => {\n const {component, shadowRoot} = await renderTreeOutline({\n tree: basicTreeData,\n });\n void component.expandRecursively();\n await waitForRenderedTreeNodeCount(shadowRoot, NODE_COUNT_BASIC_DATA_DEFAULT_EXPANDED);\n const officeNode = getVisibleTreeNodeByText(shadowRoot, 'Offices');\n dispatchClickEvent(officeNode);\n await coordinator.done();\n dispatchKeyDownEvent(officeNode, {key: 'Enter', bubbles: true});\n await waitForRenderedTreeNodeCount(shadowRoot, 6);\n assert.strictEqual(officeNode.getAttribute('aria-expanded'), 'false');\n });\n });\n\n describe('pressing the SPACE key', () => {\n it('expands the node if it is closed', async () => {\n const {shadowRoot} = await renderTreeOutline({\n tree: basicTreeData,\n });\n const officeNode = getVisibleTreeNodeByText(shadowRoot, 'Offices');\n dispatchClickEvent(officeNode);\n await coordinator.done();\n dispatchKeyDownEvent(officeNode, {key: ' ', bubbles: true});\n await waitForRenderedTreeNodeCount(shadowRoot, 3);\n assert.strictEqual(officeNode.getAttribute('aria-expanded'), 'true');\n });\n\n it('closes the node if it is open', async () => {\n const {component, shadowRoot} = await renderTreeOutline({\n tree: basicTreeData,\n });\n await component.expandRecursively();\n await waitForRenderedTreeNodeCount(shadowRoot, 12);\n const officeNode = getVisibleTreeNodeByText(shadowRoot, 'Offices');\n dispatchClickEvent(officeNode);\n await coordinator.done();\n dispatchKeyDownEvent(officeNode, {key: ' ', bubbles: true});\n await waitForRenderedTreeNodeCount(shadowRoot, 6);\n assert.strictEqual(officeNode.getAttribute('aria-expanded'), 'false');\n });\n });\n\n describe('pressing the HOME key', () => {\n it('takes the user to the top most root node', async () => {\n const {component, shadowRoot} = await renderTreeOutline({\n tree: basicTreeData,\n });\n await component.expandRecursively(Number.POSITIVE_INFINITY);\n await waitForRenderedTreeNodeCount(shadowRoot, NODE_COUNT_BASIC_DATA_FULLY_EXPANDED);\n const berlinNode = getVisibleTreeNodeByText(shadowRoot, 'BER');\n dispatchClickEvent(berlinNode);\n await coordinator.done();\n dispatchKeyDownEvent(berlinNode, {key: 'Home', bubbles: true});\n await coordinator.done();\n assert.strictEqual(\n getFocusableTreeNode(shadowRoot),\n getVisibleTreeNodeByText(shadowRoot, 'Offices'),\n );\n });\n });\n\n describe('pressing the END key', () => {\n it('takes the user to the last visible node if they are all expanded', async () => {\n const {component, shadowRoot} = await renderTreeOutline({\n tree: basicTreeData,\n });\n await component.expandRecursively(Number.POSITIVE_INFINITY);\n await coordinator.done();\n const officeNode = getVisibleTreeNodeByText(shadowRoot, 'Offices');\n dispatchClickEvent(officeNode);\n dispatchKeyDownEvent(officeNode, {key: 'End', bubbles: true});\n await coordinator.done();\n assert.strictEqual(\n getFocusableTreeNode(shadowRoot),\n // Calendar is the very last node in the tree\n getVisibleTreeNodeByText(shadowRoot, 'Calendar'),\n );\n });\n\n it('does not expand any closed nodes and focuses the last visible node', async () => {\n const {shadowRoot} = await renderTreeOutline({\n tree: basicTreeData,\n });\n const officeNode = getVisibleTreeNodeByText(shadowRoot, 'Offices');\n // Expand the Offices part of the tree\n const arrowIcon = officeNode.querySelector('.arrow-icon');\n assert.instanceOf(arrowIcon, HTMLSpanElement);\n dispatchClickEvent(arrowIcon);\n await waitForRenderedTreeNodeCount(shadowRoot, 3);\n\n // Focus the \"Europe\" node.\n const europeNode = getVisibleTreeNodeByText(shadowRoot, 'Europe');\n dispatchClickEvent(europeNode);\n dispatchKeyDownEvent(officeNode, {key: 'End', bubbles: true});\n await coordinator.done();\n assert.strictEqual(\n getFocusableTreeNode(shadowRoot),\n // Products is the last node in the tree, as its children are not expanded\n getVisibleTreeNodeByText(shadowRoot, 'Products'),\n );\n });\n });\n\n describe('pressing the UP arrow', () => {\n it('does nothing if on the root node', async () => {\n const {shadowRoot} = await renderTreeOutline({\n tree: basicTreeData,\n });\n const officeNode = getVisibleTreeNodeByText(shadowRoot, 'Offices');\n dispatchClickEvent(officeNode);\n dispatchKeyDownEvent(officeNode, {key: 'ArrowUp', bubbles: true});\n await coordinator.done();\n\n assert.strictEqual(\n getFocusableTreeNode(shadowRoot),\n officeNode,\n );\n });\n\n it('moves focus to the previous sibling', async () => {\n const {component, shadowRoot} = await renderTreeOutline({\n tree: basicTreeData,\n });\n await component.expandRecursively();\n await waitForRenderedTreeNodeCount(shadowRoot, 12);\n const berlinNode = getVisibleTreeNodeByText(shadowRoot, 'BER');\n dispatchClickEvent(berlinNode);\n dispatchKeyDownEvent(berlinNode, {key: 'ArrowUp', bubbles: true});\n await coordinator.done();\n assert.strictEqual(\n getFocusableTreeNode(shadowRoot),\n getVisibleTreeNodeByText(shadowRoot, 'MUC'),\n );\n });\n\n it('moves focus to the parent if there are no previous siblings', async () => {\n const {component, shadowRoot} = await renderTreeOutline({\n tree: basicTreeData,\n });\n await component.expandRecursively();\n await waitForRenderedTreeNodeCount(shadowRoot, NODE_COUNT_BASIC_DATA_DEFAULT_EXPANDED);\n const ukNode = getVisibleTreeNodeByText(shadowRoot, 'UK');\n dispatchClickEvent(ukNode);\n dispatchKeyDownEvent(ukNode, {key: 'ArrowUp', bubbles: true});\n await coordinator.done();\n assert.strictEqual(\n getFocusableTreeNode(shadowRoot),\n getVisibleTreeNodeByText(shadowRoot, 'Europe'),\n );\n });\n\n it('moves focus to the parent\\'s last child if there are no previous siblings and the parent is expanded',\n async () => {\n const {component, shadowRoot} = await renderTreeOutline({\n tree: basicTreeData,\n });\n await component.expandRecursively();\n await waitForRenderedTreeNodeCount(shadowRoot, NODE_COUNT_BASIC_DATA_DEFAULT_EXPANDED);\n const germanyNode = getVisibleTreeNodeByText(shadowRoot, 'Germany');\n dispatchClickEvent(germanyNode);\n dispatchKeyDownEvent(germanyNode, {key: 'ArrowUp', bubbles: true});\n await coordinator.done();\n assert.strictEqual(\n getFocusableTreeNode(shadowRoot),\n getVisibleTreeNodeByText(shadowRoot, 'LON'),\n );\n });\n\n it('moves focus to the parent\\'s deeply nested last child if there are no previous siblings and the parent has children that are expanded',\n async () => {\n const {component, shadowRoot} = await renderTreeOutline({\n tree: basicTreeData,\n });\n await component.expandRecursively(Number.POSITIVE_INFINITY);\n await waitForRenderedTreeNodeCount(shadowRoot, NODE_COUNT_BASIC_DATA_FULLY_EXPANDED);\n const germanyNode = getVisibleTreeNodeByText(shadowRoot, 'Germany');\n dispatchClickEvent(germanyNode);\n dispatchKeyDownEvent(germanyNode, {key: 'ArrowUp', bubbles: true});\n await coordinator.done();\n assert.strictEqual(\n getFocusableTreeNode(shadowRoot),\n getVisibleTreeNodeByText(shadowRoot, 'BEL'),\n );\n });\n });\n\n describe('pressing the RIGHT arrow', () => {\n it('does nothing if it is on a node that cannot be expanded', async () => {\n const {component, shadowRoot} = await renderTreeOutline({\n tree: basicTreeData,\n });\n await component.expandRecursively(Number.POSITIVE_INFINITY);\n await waitForRenderedTreeNodeCount(shadowRoot, NODE_COUNT_BASIC_DATA_FULLY_EXPANDED);\n const chromeNode = getVisibleTreeNodeByText(shadowRoot, 'Chrome');\n dispatchClickEvent(chromeNode);\n dispatchKeyDownEvent(chromeNode, {key: 'ArrowRight', bubbles: true});\n await coordinator.done();\n assert.strictEqual(\n getFocusableTreeNode(shadowRoot),\n chromeNode,\n );\n });\n\n it('expands the node if on an expandable node that is closed and does not move focus', async () => {\n const {shadowRoot} = await renderTreeOutline({\n tree: basicTreeData,\n });\n const officeNode = getVisibleTreeNodeByText(shadowRoot, 'Offices');\n dispatchClickEvent(officeNode);\n dispatchKeyDownEvent(officeNode, {key: 'ArrowRight', bubbles: true});\n await coordinator.done();\n assert.strictEqual(\n getFocusableTreeNode(shadowRoot),\n officeNode,\n );\n assert.strictEqual(officeNode.getAttribute('aria-expanded'), 'true');\n });\n\n it('moves focus into the child if pressed on an expanded node', async () => {\n const {shadowRoot} = await renderTreeOutline({\n tree: basicTreeData,\n });\n const officeNode = getVisibleTreeNodeByText(shadowRoot, 'Offices');\n dispatchClickEvent(officeNode);\n // Press once to expand, twice to navigate in to the first child\n dispatchKeyDownEvent(officeNode, {key: 'ArrowRight', bubbles: true});\n await coordinator.done();\n dispatchKeyDownEvent(officeNode, {key: 'ArrowRight', bubbles: true});\n await coordinator.done();\n assert.strictEqual(\n getFocusableTreeNode(shadowRoot),\n getVisibleTreeNodeByText(shadowRoot, 'Europe'),\n );\n });\n });\n\n describe('pressing the LEFT arrow', () => {\n it('closes the node if the focused node is expanded', async () => {\n const {component, shadowRoot} = await renderTreeOutline({\n tree: basicTreeData,\n });\n await component.expandRecursively(Number.POSITIVE_INFINITY);\n await coordinator.done();\n const europeNode = getVisibleTreeNodeByText(shadowRoot, 'Europe');\n dispatchClickEvent(europeNode);\n dispatchKeyDownEvent(europeNode, {key: 'ArrowLeft', bubbles: true});\n await coordinator.done();\n assert.strictEqual(\n getFocusableTreeNode(shadowRoot),\n getVisibleTreeNodeByText(shadowRoot, 'Europe'),\n );\n const visibleTree = visibleNodesToTree(shadowRoot);\n // The tree below \"Europe\" is hidden as the left arrow press closed that node.\n assert.deepEqual(visibleTree, [\n {\n renderedKey: 'Offices',\n children: [{\n renderedKey: 'Europe',\n }],\n },\n {\n renderedKey: 'Products',\n children: [\n {\n renderedKey: 'Chrome',\n },\n {\n renderedKey: 'YouTube',\n },\n {\n renderedKey: 'Drive',\n },\n {\n renderedKey: 'Calendar',\n },\n ],\n },\n ]);\n });\n\n it('moves to the parent node if the current node is not expanded or unexpandable', async () => {\n const {component, shadowRoot} = await renderTreeOutline({\n tree: basicTreeData,\n });\n await component.expandRecursively(Number.POSITIVE_INFINITY);\n await waitForRenderedTreeNodeCount(shadowRoot, NODE_COUNT_BASIC_DATA_FULLY_EXPANDED);\n await coordinator.done();\n const berlinNode = getVisibleTreeNodeByText(shadowRoot, 'BER');\n dispatchClickEvent(berlinNode);\n dispatchKeyDownEvent(berlinNode, {key: 'ArrowLeft', bubbles: true});\n await coordinator.done();\n assert.strictEqual(\n getFocusableTreeNode(shadowRoot),\n getVisibleTreeNodeByText(shadowRoot, 'Germany'),\n );\n });\n it('does nothing when called on a root node', async () => {\n const {shadowRoot} = await renderTreeOutline({\n tree: basicTreeData,\n });\n const productsNode = getVisibleTreeNodeByText(shadowRoot, 'Products');\n dispatchClickEvent(productsNode);\n dispatchKeyDownEvent(productsNode, {key: 'ArrowLeft', bubbles: true});\n await coordinator.done();\n assert.strictEqual(\n getFocusableTreeNode(shadowRoot),\n getVisibleTreeNodeByText(shadowRoot, 'Products'),\n );\n });\n });\n describe('pressing the DOWN arrow', () => {\n it('moves down to the next sibling if the node is not expanded', async () => {\n const {shadowRoot} = await renderTreeOutline({\n tree: basicTreeData,\n });\n const officeNode = getVisibleTreeNodeByText(shadowRoot, 'Offices');\n dispatchClickEvent(officeNode);\n dispatchKeyDownEvent(officeNode, {key: 'ArrowDown', bubbles: true});\n await coordinator.done();\n assert.strictEqual(\n getFocusableTreeNode(shadowRoot),\n getVisibleTreeNodeByText(shadowRoot, 'Products'),\n );\n });\n\n it('does not move if it is the last sibling and there are no parent siblings', async () => {\n const {shadowRoot} = await renderTreeOutline({\n tree: basicTreeData,\n });\n const productsNode = getVisibleTreeNodeByText(shadowRoot, 'Products');\n dispatchClickEvent(productsNode);\n dispatchKeyDownEvent(productsNode, {key: 'ArrowDown', bubbles: true});\n await coordinator.done();\n assert.strictEqual(\n getFocusableTreeNode(shadowRoot),\n getVisibleTreeNodeByText(shadowRoot, 'Products'),\n );\n });\n\n it('moves down to the first child of the node if it is expanded', async () => {\n const {component, shadowRoot} = await renderTreeOutline({\n tree: basicTreeData,\n });\n await component.expandRecursively();\n await coordinator.done();\n const officeNode = getVisibleTreeNodeByText(shadowRoot, 'Offices');\n dispatchClickEvent(officeNode);\n dispatchKeyDownEvent(officeNode, {key: 'ArrowDown', bubbles: true});\n await coordinator.done();\n assert.strictEqual(\n getFocusableTreeNode(shadowRoot),\n getVisibleTreeNodeByText(shadowRoot, 'Europe'),\n );\n });\n\n it('moves to its parent\\'s sibling if it is the last child', async () => {\n const {component, shadowRoot} = await renderTreeOutline({\n tree: basicTreeData,\n });\n await component.expandRecursively();\n await waitForRenderedTreeNodeCount(shadowRoot, NODE_COUNT_BASIC_DATA_DEFAULT_EXPANDED);\n const lonNode = getVisibleTreeNodeByText(shadowRoot, 'LON');\n dispatchClickEvent(lonNode);\n dispatchKeyDownEvent(lonNode, {key: 'ArrowDown', bubbles: true});\n await coordinator.done();\n assert.strictEqual(\n getFocusableTreeNode(shadowRoot),\n getVisibleTreeNodeByText(shadowRoot, 'Germany'),\n );\n });\n\n it('is able to navigate high up the tree to the correct next parent\\'s sibling', async () => {\n const {component, shadowRoot} = await renderTreeOutline({\n tree: basicTreeData,\n });\n await component.expandRecursively(Number.POSITIVE_INFINITY);\n await waitForRenderedTreeNodeCount(shadowRoot, NODE_COUNT_BASIC_DATA_FULLY_EXPANDED);\n const berNode = getVisibleTreeNodeByText(shadowRoot, 'BER');\n dispatchClickEvent(berNode);\n dispatchKeyDownEvent(berNode, {key: 'ArrowDown', bubbles: true});\n await coordinator.done();\n assert.strictEqual(\n getFocusableTreeNode(shadowRoot),\n getVisibleTreeNodeByText(shadowRoot, 'Products'),\n );\n });\n });\n });\n\n // Note: all aria-* positional labels are 1 indexed, not 0 indexed.\n describe('aria-* labels', () => {\n it('adds correct aria-level labels', async () => {\n const {component, shadowRoot} = await renderTreeOutline({\n tree: basicTreeData,\n });\n await component.expandRecursively(Number.POSITIVE_INFINITY);\n await waitForRenderedTreeNodeCount(shadowRoot, NODE_COUNT_BASIC_DATA_FULLY_EXPANDED);\n await coordinator.done();\n const rootNode = getVisibleTreeNodeByText(shadowRoot, 'Offices');\n assert.strictEqual(rootNode.getAttribute('aria-level'), '1');\n\n const europeNode = getVisibleTreeNodeByText(shadowRoot, 'Europe');\n assert.strictEqual(europeNode.getAttribute('aria-level'), '2');\n\n const germanyNode = getVisibleTreeNodeByText(shadowRoot, 'Germany');\n assert.strictEqual(germanyNode.getAttribute('aria-level'), '3');\n\n const berlinNode = getVisibleTreeNodeByText(shadowRoot, 'BER');\n assert.strictEqual(berlinNode.getAttribute('aria-level'), '4');\n });\n\n it('adds the correct setsize label to the root node', async () => {\n const {shadowRoot} = await renderTreeOutline({\n tree: basicTreeData,\n });\n const rootNode = getVisibleTreeNodeByText(shadowRoot, 'Products');\n assert.strictEqual(rootNode.getAttribute('aria-setsize'), '2');\n });\n\n it('adds the correct setsize label to a deeply nested node', async () => {\n const {component, shadowRoot} = await renderTreeOutline({\n tree: basicTreeData,\n });\n await component.expandRecursively(Number.POSITIVE_INFINITY);\n await waitForRenderedTreeNodeCount(shadowRoot, NODE_COUNT_BASIC_DATA_FULLY_EXPANDED);\n const europeKey = getVisibleTreeNodeByText(shadowRoot, 'Europe');\n assert.strictEqual(europeKey.getAttribute('aria-setsize'), '1');\n const germanyKey = getVisibleTreeNodeByText(shadowRoot, 'Germany');\n // 2 because there are two keys at this level in the tree: UK & Germany\n assert.strictEqual(germanyKey.getAttribute('aria-setsize'), '2');\n });\n\n it('adds the posinset label to nodes correctly', async () => {\n const {component, shadowRoot} = await renderTreeOutline({\n tree: basicTreeData,\n });\n await component.expandRecursively(Number.POSITIVE_INFINITY);\n await waitForRenderedTreeNodeCount(shadowRoot, NODE_COUNT_BASIC_DATA_FULLY_EXPANDED);\n const europeKey = getVisibleTreeNodeByText(shadowRoot, 'Europe');\n assert.strictEqual(europeKey.getAttribute('aria-posinset'), '1');\n const csgOfficeKey = getVisibleTreeNodeByText(shadowRoot, 'CSG');\n // CSG is 2nd in the LON office list: 6PS, CSG, BEL\n assert.strictEqual(csgOfficeKey.getAttribute('aria-posinset'), '2');\n });\n\n it('sets aria-expanded to false on non-expanded nodes', async () => {\n const {shadowRoot} = await renderTreeOutline({\n tree: basicTreeData,\n });\n const rootNode = getVisibleTreeNodeByText(shadowRoot, 'Offices');\n assert.strictEqual(rootNode.getAttribute('aria-expanded'), 'false');\n });\n\n it('sets aria-expanded to true on expanded nodes', async () => {\n const {shadowRoot} = await renderTreeOutline({\n tree: basicTreeData,\n });\n const rootNode = getVisibleTreeNodeByText(shadowRoot, 'Offices');\n const arrowIcon = rootNode.querySelector('.arrow-icon');\n assert.instanceOf(arrowIcon, HTMLSpanElement);\n dispatchClickEvent(arrowIcon);\n await coordinator.done();\n assert.strictEqual(rootNode.getAttribute('aria-expanded'), 'true');\n });\n\n it('does not set aria-expanded at all on leaf nodes', async () => {\n const {component, shadowRoot} = await renderTreeOutline({\n tree: basicTreeData,\n });\n await component.expandRecursively(Number.POSITIVE_INFINITY);\n await waitForRenderedTreeNodeCount(shadowRoot, NODE_COUNT_BASIC_DATA_FULLY_EXPANDED);\n const leafNodeCSGOffice = getVisibleTreeNodeByText(shadowRoot, 'CSG');\n assert.strictEqual(leafNodeCSGOffice.getAttribute('aria-expanded'), null);\n });\n });\n\n describe('emitting events', () => {\n describe('itemselected event', () => {\n it('emits an event when the user clicks on the node', async () => {\n const {component, shadowRoot} = await renderTreeOutline({\n tree: basicTreeData,\n });\n await coordinator.done();\n const officeNode = getVisibleTreeNodeByText(shadowRoot, 'Offices');\n const treeItemSelectedEvent =\n getEventPromise>(component, 'itemselected');\n dispatchClickEvent(officeNode);\n const event = await treeItemSelectedEvent;\n assert.deepEqual(event.data, {node: basicTreeData[0]});\n });\n\n it('emits an event when the user navigates to the node with their keyboard', async () => {\n const {component, shadowRoot} = await renderTreeOutline({\n tree: basicTreeData,\n });\n await coordinator.done();\n const officeNode = getVisibleTreeNodeByText(shadowRoot, 'Offices');\n dispatchClickEvent(officeNode);\n await coordinator.done();\n dispatchKeyDownEvent(officeNode, {key: 'ArrowDown', bubbles: true});\n const treeItemSelectedEvent =\n getEventPromise>(component, 'itemselected');\n await coordinator.done();\n const event = await treeItemSelectedEvent;\n assert.deepEqual(event.data, {node: basicTreeData[1]});\n });\n });\n\n describe('itemmouseover', () => {\n it('emits an event when the user mouses over the element', async () => {\n const {component, shadowRoot} = await renderTreeOutline({\n tree: basicTreeData,\n });\n await coordinator.done();\n const officeNode = getVisibleTreeNodeByText(shadowRoot, 'Offices').querySelector('.arrow-and-key-wrapper');\n assert.instanceOf(officeNode, HTMLSpanElement);\n const itemMouseOverEvent =\n getEventPromise>(component, 'itemmouseover');\n dispatchMouseOverEvent(officeNode);\n const event = await itemMouseOverEvent;\n assert.deepEqual(event.data, {node: basicTreeData[0]});\n });\n });\n\n describe('itemmouseout', () => {\n it('emits an event when the user mouses out of the element', async () => {\n const {component, shadowRoot} = await renderTreeOutline({\n tree: basicTreeData,\n });\n await coordinator.done();\n const officeNode = getVisibleTreeNodeByText(shadowRoot, 'Offices').querySelector('.arrow-and-key-wrapper');\n assert.instanceOf(officeNode, HTMLSpanElement);\n dispatchMouseOverEvent(officeNode);\n const itemMouseOutEvent =\n getEventPromise>(component, 'itemmouseout');\n dispatchMouseOutEvent(officeNode);\n const event = await itemMouseOutEvent;\n assert.deepEqual(event.data, {node: basicTreeData[0]});\n });\n });\n });\n\n describe('matching on id parameter', () => {\n it('expands the relevant part of the tree to reveal the given node', async () => {\n const {component, shadowRoot} = await renderTreeOutline({\n tree: [nodeAustralia],\n });\n\n // Expand to the node with the given ID, the actual data doesn't matter in this case.\n // This means you can search the tree, without having a reference to the specific tree data,\n // just as long as you know the id for whatever thing you are looking for.\n await component.expandToAndSelectTreeNode({treeNodeData: 'something else', id: 'gawler'});\n await waitForRenderedTreeNodeCount(shadowRoot, 7);\n const visibleTree = visibleNodesToTree(shadowRoot);\n\n // The tree is expanded down to include \"Gawler\" but the rest of the tree is still collapsed.\n assert.deepEqual(visibleTree, [{\n renderedKey: 'Australia',\n children: [\n {\n renderedKey: 'SA',\n children: [\n {\n renderedKey: 'Adelaide',\n children: [\n {renderedKey: 'Toorak Gardens'},\n {renderedKey: 'Woodville South'},\n {renderedKey: 'Gawler'},\n ],\n },\n ],\n },\n {renderedKey: 'NSW'},\n ],\n }]);\n });\n\n it('remembers nodes expanded state across node updates', async () => {\n const {component, shadowRoot} = await renderTreeOutline({\n tree: [nodeAustralia],\n });\n\n await component.expandToAndSelectTreeNode({treeNodeData: 'something else', id: 'gawler'});\n\n // Update the node by replacing the root node.\n const newNodeAustralia = {\n treeNodeData: 'New Australia',\n id: 'australia',\n children: async () =>\n [{\n treeNodeData: 'Different SA',\n id: 'sa',\n children: async () =>\n [{\n treeNodeData: 'Phantom Adelaide',\n id: 'adelaide',\n children: async () =>\n [{treeNodeData: 'Totally not Gawler', id: 'gawler'},\n ],\n },\n ],\n },\n ],\n };\n\n component.data = {\n tree: [newNodeAustralia],\n defaultRenderer: (node => html`${node.treeNodeData}`),\n };\n await waitForRenderedTreeNodeCount(shadowRoot, 4);\n await coordinator.done();\n const visibleTree = visibleNodesToTree(shadowRoot);\n\n // The tree should still be expanded down to the node with key `gawler`.\n assert.deepEqual(visibleTree, [{\n renderedKey: 'New Australia',\n children: [\n {\n renderedKey: 'Different SA',\n children: [\n {\n renderedKey: 'Phantom Adelaide',\n children: [\n {renderedKey: 'Totally not Gawler'},\n ],\n },\n ],\n },\n ],\n }]);\n });\n\n it('focuses the given node with an id once the tree has been expanded', async () => {\n const {component, shadowRoot} = await renderTreeOutline({\n tree: [nodeAustralia],\n });\n\n await component.expandToAndSelectTreeNode({treeNodeData: 'literally anything', id: 'gawler'});\n await waitForRenderedTreeNodeCount(shadowRoot, 7);\n await coordinator.done();\n\n // The tree is expanded down to include \"Gawler\" but the rest of the tree is still collapsed.\n assert.strictEqual(\n getFocusableTreeNode(shadowRoot),\n getVisibleTreeNodeByText(shadowRoot, 'Gawler'),\n );\n });\n });\n});\n\ndescribe('TreeOutlineUtils', () => {\n describe('getPathToTreeNode', () => {\n it('can find the path to the given node', async () => {\n const path = await TreeOutline.TreeOutlineUtils.getPathToTreeNode(basicTreeData, nodeBelgraveHouse.id);\n assert.deepEqual(path, [nodeOffices, nodeEurope, nodeUK, nodeLondon, nodeBelgraveHouse]);\n });\n\n it('returns null if no path is found', async () => {\n const path = await TreeOutline.TreeOutlineUtils.getPathToTreeNode(basicTreeData, '-1');\n assert.strictEqual(path, null);\n });\n });\n});\n\ndescribe('TreeOutlineFiltering', () => {\n it('can flatten nodes', async () => {\n const {component, shadowRoot} = await renderTreeOutline({\n tree: [nodeAustralia],\n filter: node => node === 'SA' || node === 'NSW' || node === 'Adelaide' ?\n TreeOutline.TreeOutline.FilterOption.FLATTEN :\n TreeOutline.TreeOutline.FilterOption.SHOW,\n });\n\n await component.expandRecursively();\n await coordinator.done();\n await waitForRenderedTreeNodeCount(shadowRoot, 7);\n const visibleTree = visibleNodesToTree(shadowRoot);\n\n assert.deepEqual(visibleTree, [{\n renderedKey: 'Australia',\n children: [\n {renderedKey: 'Toorak Gardens'},\n {renderedKey: 'Woodville South'},\n {renderedKey: 'Gawler'},\n {renderedKey: 'Glebe'},\n {renderedKey: 'Newtown'},\n {renderedKey: 'Camperdown'},\n ],\n }]);\n });\n\n it('should not flatten an already expanded node', async () => {\n const {component, shadowRoot} = await renderTreeOutline({\n tree: [nodeAustralia],\n });\n\n await component.expandNodeIds(['australia', 'sa', 'adelaide']);\n await coordinator.done();\n await waitForRenderedTreeNodeCount(shadowRoot, 7);\n const visibleTree = visibleNodesToTree(shadowRoot);\n\n assert.deepEqual(visibleTree, [{\n renderedKey: 'Australia',\n children: [\n {\n renderedKey: 'SA',\n children: [\n {\n renderedKey: 'Adelaide',\n children: [\n {renderedKey: 'Toorak Gardens'},\n {renderedKey: 'Woodville South'},\n {renderedKey: 'Gawler'},\n ],\n },\n ],\n },\n {\n renderedKey: 'NSW',\n },\n ],\n }]);\n\n component.data = {\n tree: [nodeAustralia],\n filter: node => node === 'SA' || node === 'NSW' ? TreeOutline.TreeOutline.FilterOption.FLATTEN :\n TreeOutline.TreeOutline.FilterOption.SHOW,\n defaultRenderer: (node => html`${node.treeNodeData}`),\n };\n await waitForRenderedTreeNodeCount(shadowRoot, 9);\n const visibleTreeAfterFilter = visibleNodesToTree(shadowRoot);\n\n assert.deepEqual(visibleTreeAfterFilter, [{\n renderedKey: 'Australia',\n children: [\n {\n renderedKey: 'SA',\n children: [\n {\n renderedKey: 'Adelaide',\n children: [\n {renderedKey: 'Toorak Gardens'},\n {renderedKey: 'Woodville South'},\n {renderedKey: 'Gawler'},\n ],\n },\n ],\n },\n {renderedKey: 'Glebe'},\n {renderedKey: 'Newtown'},\n {renderedKey: 'Camperdown'},\n ],\n }]);\n });\n});\n"]} \ No newline at end of file +{"version":3,"file":"TreeOutline.test.js","sourceRoot":"","sources":["../../../../../../../front_end/ui/components/tree_outline/TreeOutline.test.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,EACL,kBAAkB,EAClB,oBAAoB,EACpB,qBAAqB,EACrB,sBAAsB,EACtB,eAAe,EACf,oBAAoB,EACpB,wBAAwB,GACzB,MAAM,gCAAgC,CAAC;AACxC,OAAO,KAAK,OAAO,MAAM,4BAA4B,CAAC;AACtD,OAAO,KAAK,iBAAiB,MAAM,6CAA6C,CAAC;AAEjF,OAAO,KAAK,WAAW,MAAM,mBAAmB,CAAC;AAEjD,MAAM,EAAC,IAAI,EAAC,GAAG,OAAO,CAAC;AAEvB,KAAK,UAAU,iBAAiB,CAAmB,EACjD,IAAI,EACJ,eAAe,EACf,MAAM,GAMP;IAIC,MAAM,SAAS,GAAG,IAAI,WAAW,CAAC,WAAW,CAAC,WAAW,EAAoB,CAAC;IAC9E,MAAM,IAAI,GAA8D;QACtE,IAAI;QACJ,eAAe,EAAE,eAAe;YAC5B,CAAC,CAAC,IAA6D,EAAE,EAAE,CAAC,IAAI,CAAA,GAAG,IAAI,CAAC,YAAY,EAAE,CAAC;QACnG,MAAM;KACP,CAAC;IACF,SAAS,CAAC,IAAI,GAAG,IAAI,CAAC;IACtB,oBAAoB,CAAC,SAAS,CAAC,CAAC;IAChC,MAAM,CAAC,SAAS,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC;IACvC,MAAM,iBAAiB,CAAC,IAAI,EAAE,CAAC;IAC/B,OAAO;QACL,SAAS;QACT,UAAU,EAAE,SAAS,CAAC,UAAU;KACjC,CAAC;AACJ,CAAC;AAED;;;;GAIG;AACH,KAAK,UAAU,4BAA4B,CAAC,UAAsB,EAAE,iBAAyB;IAC3F,MAAM,eAAe,GAAG,UAAU,CAAC,gBAAgB,CA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F,MAAM,4BAA4B,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC;QAClD,MAAM,sBAAsB,GAAG,kBAAkB,CAAC,UAAU,CAAC,CAAC;QAE9D,MAAM,CAAC,SAAS,CAAC,sBAAsB,EAAE,CAAC;gBACvB,WAAW,EAAE,WAAW;gBACxB,QAAQ,EAAE;oBACR;wBACE,WAAW,EAAE,IAAI;wBACjB,QAAQ,EAAE;4BACR;gCACE,WAAW,EAAE,UAAU;gCACvB,QAAQ,EAAE;oCACR,EAAC,WAAW,EAAE,gBAAgB,EAAC;oCAC/B,EAAC,WAAW,EAAE,iBAAiB,EAAC;oCAChC,EAAC,WAAW,EAAE,QAAQ,EAAC;iCACxB;6BACF;yBACF;qBACF;oBACD,EAAC,WAAW,EAAE,OAAO,EAAC;oBACtB,EAAC,WAAW,EAAE,SAAS,EAAC;oBACxB,EAAC,WAAW,EAAE,YAAY,EAAC;iBAC5B;aACF,CAAC,CAAC,CAAC;IACvB,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["// Copyright 2020 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport {\n dispatchClickEvent,\n dispatchKeyDownEvent,\n dispatchMouseOutEvent,\n dispatchMouseOverEvent,\n getEventPromise,\n renderElementIntoDOM,\n stripLitHtmlCommentNodes,\n} from '../../../testing/DOMHelpers.js';\nimport * as LitHtml from '../../lit-html/lit-html.js';\nimport * as RenderCoordinator from '../render_coordinator/render_coordinator.js';\n\nimport * as TreeOutline from './tree_outline.js';\n\nconst {html} = LitHtml;\n\nasync function renderTreeOutline({\n tree,\n defaultRenderer,\n filter,\n}: {\n tree: TreeOutline.TreeOutline.TreeOutlineData['tree'],\n // defaultRenderer is required usually but here we make it optinal and provide a default one as part of renderTreeOutline, to save duplication in every single test where we want to use a simple string renderer.\n defaultRenderer?: TreeOutline.TreeOutline.TreeOutlineData['defaultRenderer'],\n filter?: TreeOutline.TreeOutline.TreeOutlineData['filter'],\n}): Promise<{\n component: TreeOutline.TreeOutline.TreeOutline,\n shadowRoot: ShadowRoot,\n}> {\n const component = new TreeOutline.TreeOutline.TreeOutline();\n const data: TreeOutline.TreeOutline.TreeOutlineData = {\n tree,\n defaultRenderer: defaultRenderer ||\n ((node: TreeOutline.TreeOutlineUtils.TreeNode) => html`${node.treeNodeData}`),\n filter,\n };\n component.data = data;\n renderElementIntoDOM(component);\n assert.isNotNull(component.shadowRoot);\n await RenderCoordinator.done();\n return {\n component,\n shadowRoot: component.shadowRoot,\n };\n}\n\n/**\n * Wait for a certain number of children are rendered. We need this as the\n * component uses LitHtml's until directive, which is async and not within the\n * render coordinator's control.\n */\nasync function waitForRenderedTreeNodeCount(shadowRoot: ShadowRoot, expectedNodeCount: number): Promise {\n const actualNodeCount = shadowRoot.querySelectorAll('li[role=\"treeitem\"]').length;\n if (actualNodeCount === expectedNodeCount) {\n return;\n }\n\n await new Promise(resolve => {\n requestAnimationFrame(async () => {\n await waitForRenderedTreeNodeCount(shadowRoot, expectedNodeCount);\n resolve();\n });\n });\n}\n\nfunction getFocusableTreeNode(shadowRoot: ShadowRoot): HTMLLIElement {\n const focusableNode = shadowRoot.querySelector('li[role=\"treeitem\"][tabindex=\"0\"]');\n if (!focusableNode) {\n throw new Error('Could not find focused node in Tree shadow root');\n }\n return focusableNode;\n}\n\n/*\nThe structure represented by basicTreeData is:\n\n- Offices\n - Europe\n - UK\n - LON\n - 6PS\n - CSG\n - BEL\n - Germany\n - MUC\n - BER\n- Products\n - Chrome\n - YouTube\n - Drive\n - Calendar\n*/\n\n// These node is pulled out as we test expandAndSelectTreeNode and getPathToTreeNode with them.\nconst nodeBelgraveHouse = {\n treeNodeData: 'BEL',\n id: 'BEL',\n};\n\nconst nodeLondon = {\n treeNodeData: 'LON',\n id: 'LON',\n children: async () => [{treeNodeData: '6PS', id: '6PS'}, {treeNodeData: 'CSG', id: 'CSG'}, nodeBelgraveHouse],\n};\n\nconst nodeUK = {\n treeNodeData: 'UK',\n id: 'UK',\n children: async () => [nodeLondon],\n};\n\nconst nodeEurope = {\n treeNodeData: 'Europe',\n id: 'Europe',\n children: async () => [nodeUK, {\n treeNodeData: 'Germany',\n id: 'Germany',\n children: async () => [{treeNodeData: 'MUC', id: 'MUC'}, {treeNodeData: 'BER', id: 'BER'}],\n }],\n};\n\nconst nodeOffices = {\n treeNodeData: 'Offices',\n id: 'Offices',\n children: async () => [nodeEurope],\n};\n\nconst basicTreeData: TreeOutline.TreeOutlineUtils.TreeNode[] = [\n nodeOffices,\n {\n treeNodeData: 'Products',\n id: '1',\n children: async () =>\n [{\n treeNodeData: 'Chrome',\n id: '2',\n },\n {\n treeNodeData: 'YouTube',\n id: '3',\n },\n {\n treeNodeData: 'Drive',\n id: '4',\n },\n {\n treeNodeData: 'Calendar',\n id: '5',\n }],\n },\n];\n\n/*\nThe structure represented by nodeAustralia is:\n\n- Australia\n - SA\n - Adelaide\n - Toorak Gardens\n - Woodville South\n - Gawler\n - NSW\n - Glebe\n - Newtown\n - Camperdown\n*/\n\nconst nodeAustralia = {\n treeNodeData: 'Australia',\n id: 'australia',\n children: async () =>\n [{\n treeNodeData: 'SA',\n id: 'sa',\n children: async () =>\n [{\n treeNodeData: 'Adelaide',\n id: 'adelaide',\n children: async () =>\n [{treeNodeData: 'Toorak Gardens', id: 'toorak'},\n {treeNodeData: 'Woodville South', id: 'woodville'},\n {treeNodeData: 'Gawler', id: 'gawler'},\n],\n },\n],\n },\n {\n treeNodeData: 'NSW',\n id: 'nsw',\n children: async () =>\n [{treeNodeData: 'Glebe', id: 'glebe'},\n {treeNodeData: 'Newtown', id: 'newtown'},\n {treeNodeData: 'Camperdown', id: 'camperdown'},\n],\n },\n],\n};\n\nconst NODE_COUNT_BASIC_DATA_FULLY_EXPANDED = 15;\nconst NODE_COUNT_BASIC_DATA_DEFAULT_EXPANDED = 12;\n\ninterface VisibleTreeNodeFromDOM {\n renderedKey: string;\n children?: VisibleTreeNodeFromDOM[];\n}\n\n/**\n * Converts the nodes into a tree structure that we can assert against.\n */\nfunction visibleNodesToTree(shadowRoot: ShadowRoot): VisibleTreeNodeFromDOM[] {\n const tree: VisibleTreeNodeFromDOM[] = [];\n\n function buildTreeNode(node: HTMLLIElement): VisibleTreeNodeFromDOM {\n const item: VisibleTreeNodeFromDOM = {\n renderedKey: nodeKeyInnerHTML(node),\n };\n\n if (node.getAttribute('aria-expanded') && node.getAttribute('aria-expanded') === 'true') {\n item.children = [];\n const childNodes = node.querySelectorAll(':scope > ul[role=\"group\"]>li');\n for (const child of childNodes) {\n item.children.push(buildTreeNode(child));\n }\n }\n\n return item;\n }\n const rootNodes = shadowRoot.querySelectorAll('ul[role=\"tree\"]>li');\n for (const root of rootNodes) {\n tree.push(buildTreeNode(root));\n }\n return tree;\n}\n\nfunction treeNodeKeyText(node: HTMLLIElement) {\n const keyNode = node.querySelector('[data-node-key]');\n if (!keyNode) {\n throw new Error('Found tree node without a key within it.');\n }\n return keyNode.getAttribute('data-node-key') || '';\n}\n\nfunction nodeKeyInnerHTML(node: HTMLLIElement) {\n const keyNode = node.querySelector('[data-node-key]');\n if (!keyNode) {\n throw new Error('Found tree node without a key within it.');\n }\n return stripLitHtmlCommentNodes(keyNode.innerHTML);\n}\n\nfunction getVisibleTreeNodeByText(shadowRoot: ShadowRoot, text: string): HTMLLIElement {\n const nodes = shadowRoot.querySelectorAll('li[role=\"treeitem\"]');\n const matchingNode = Array.from(nodes).find(node => {\n return treeNodeKeyText(node) === text;\n });\n\n if (!matchingNode) {\n throw new Error(`Could not find tree item with text ${text}.`);\n }\n return matchingNode;\n}\n\ndescribe('TreeOutline', () => {\n it('renders with all non-root nodes hidden by default', async () => {\n const {shadowRoot} = await renderTreeOutline({\n tree: basicTreeData,\n });\n const visibleItems = shadowRoot.querySelectorAll('li[role=\"treeitem\"]');\n assert.lengthOf(visibleItems, 2);\n const itemText1 = treeNodeKeyText(visibleItems[0]);\n const itemText2 = treeNodeKeyText(visibleItems[1]);\n assert.strictEqual(itemText1, 'Offices');\n assert.strictEqual(itemText2, 'Products');\n });\n\n it('expands a node when the arrow icon is clicked', async () => {\n const {shadowRoot} = await renderTreeOutline({\n tree: basicTreeData,\n });\n const rootNode = getVisibleTreeNodeByText(shadowRoot, 'Offices');\n const arrowIcon = rootNode.querySelector('.arrow-icon');\n assert.instanceOf(arrowIcon, HTMLSpanElement);\n dispatchClickEvent(arrowIcon);\n await waitForRenderedTreeNodeCount(shadowRoot, 3);\n const visibleTree = visibleNodesToTree(shadowRoot);\n assert.deepEqual(visibleTree, [\n {renderedKey: 'Offices', children: [{renderedKey: 'Europe'}]},\n {renderedKey: 'Products'},\n ]);\n });\n\n it('does not expand nodes when clicking outside of the arrow by default', async () => {\n const {shadowRoot} = await renderTreeOutline({\n tree: basicTreeData,\n });\n const rootNode = getVisibleTreeNodeByText(shadowRoot, 'Offices');\n dispatchClickEvent(rootNode);\n await waitForRenderedTreeNodeCount(shadowRoot, 2);\n const visibleTree = visibleNodesToTree(shadowRoot);\n assert.deepEqual(visibleTree, [\n {renderedKey: 'Offices'},\n {renderedKey: 'Products'},\n ]);\n });\n\n it('can be configured to expand nodes when any part of the node is clicked', async () => {\n const {component, shadowRoot} = await renderTreeOutline({\n tree: basicTreeData,\n });\n component.setAttribute('clickabletitle', '');\n const rootNode = getVisibleTreeNodeByText(shadowRoot, 'Offices');\n dispatchClickEvent(rootNode);\n await waitForRenderedTreeNodeCount(shadowRoot, 3);\n const visibleTree = visibleNodesToTree(shadowRoot);\n assert.deepEqual(visibleTree, [\n {renderedKey: 'Offices', children: [{renderedKey: 'Europe'}]},\n {renderedKey: 'Products'},\n ]);\n });\n\n describe('nowrap attribute', () => {\n it('sets the white-space to initial by default', async () => {\n const {shadowRoot} = await renderTreeOutline({\n tree: basicTreeData,\n });\n const rootNode = getVisibleTreeNodeByText(shadowRoot, 'Offices');\n const key = rootNode.querySelector('[data-node-key]');\n assert.instanceOf(key, HTMLElement);\n const whiteSpaceValue = window.getComputedStyle(key).getPropertyValue('white-space');\n assert.strictEqual(whiteSpaceValue, 'normal');\n });\n\n it('will set white-space: nowrap if the attribute is set', async () => {\n const {component, shadowRoot} = await renderTreeOutline({\n tree: basicTreeData,\n });\n component.setAttribute('nowrap', '');\n const rootNode = getVisibleTreeNodeByText(shadowRoot, 'Offices');\n const key = rootNode.querySelector('[data-node-key]');\n assert.instanceOf(key, HTMLElement);\n const whiteSpaceValue = window.getComputedStyle(key).getPropertyValue('white-space');\n assert.strictEqual(whiteSpaceValue, 'nowrap');\n });\n });\n\n describe('toplevelbordercolor attribute', () => {\n it('by default the nodes are not given a border', async () => {\n const {shadowRoot} = await renderTreeOutline({\n tree: basicTreeData,\n });\n const rootNode = getVisibleTreeNodeByText(shadowRoot, 'Offices');\n const borderTopValue = window.getComputedStyle(rootNode).getPropertyValue('border-top');\n // Odd assertion: this is the default borderTop the browser \"applies\" if none is set.\n assert.strictEqual(borderTopValue, '0px none rgb(0, 0, 0)');\n });\n\n it('gives the nodes a border if the attribute is set', async () => {\n const {component, shadowRoot} = await renderTreeOutline({\n tree: basicTreeData,\n });\n component.setAttribute('toplevelbordercolor', 'rgb(255, 0, 0)');\n const rootNode = getVisibleTreeNodeByText(shadowRoot, 'Offices');\n const borderTopValue = window.getComputedStyle(rootNode).getPropertyValue('border-top');\n assert.strictEqual(borderTopValue, '1px solid rgb(255, 0, 0)');\n });\n });\n\n it('can take nodes with a custom key type', async () => {\n interface CustomTreeKeyType {\n property: string;\n value: string;\n }\n const customRenderer = (node: TreeOutline.TreeOutlineUtils.TreeNode) => {\n return html`

      ${node.treeNodeData.property.toUpperCase()}:

      ${node.treeNodeData.value}`;\n };\n const tinyTree: TreeOutline.TreeOutlineUtils.TreeNode[] = [{\n treeNodeData: {property: 'name', value: 'jack'},\n id: '0',\n renderer: customRenderer,\n children: async () =>\n [{\n renderer: customRenderer,\n id: '1',\n treeNodeData: {property: 'locationGroupName', value: 'EMEA'},\n },\n {\n renderer: customRenderer,\n id: '2',\n treeNodeData: {property: 'locationGroupName', value: 'USA'},\n },\n {\n renderer: customRenderer,\n id: '3',\n treeNodeData: {property: 'locationGroupName', value: 'APAC'},\n }],\n }];\n const {component, shadowRoot} = await renderTreeOutline({\n tree: tinyTree,\n });\n\n await component.expandRecursively();\n await waitForRenderedTreeNodeCount(shadowRoot, 4);\n const visibleTree = visibleNodesToTree(shadowRoot);\n assert.deepEqual(visibleTree, [\n {\n renderedKey: '

      NAME:

      jack',\n children: [\n {\n renderedKey: '

      LOCATIONGROUPNAME:

      EMEA',\n },\n {\n renderedKey: '

      LOCATIONGROUPNAME:

      USA',\n },\n {\n renderedKey: '

      LOCATIONGROUPNAME:

      APAC',\n },\n ],\n },\n ]);\n });\n\n it('can recursively expand the tree, going 3 levels deep by default', async () => {\n const {component, shadowRoot} = await renderTreeOutline({\n tree: basicTreeData,\n });\n await component.expandRecursively();\n await waitForRenderedTreeNodeCount(shadowRoot, 12);\n const visibleTree = visibleNodesToTree(shadowRoot);\n assert.deepEqual(visibleTree, [\n {\n renderedKey: 'Offices',\n children: [{\n renderedKey: 'Europe',\n children: [\n {renderedKey: 'UK', children: [{renderedKey: 'LON'}]},\n {renderedKey: 'Germany', children: [{renderedKey: 'MUC'}, {renderedKey: 'BER'}]},\n ],\n }],\n },\n {\n renderedKey: 'Products',\n children: [\n {\n renderedKey: 'Chrome',\n },\n {\n renderedKey: 'YouTube',\n },\n {\n renderedKey: 'Drive',\n },\n {\n renderedKey: 'Calendar',\n },\n ],\n },\n ]);\n });\n\n describe('expandToAndSelectTreeNode', () => {\n it('expands the relevant part of the tree to reveal the given node', async () => {\n const {component, shadowRoot} = await renderTreeOutline({\n tree: basicTreeData,\n });\n await component.expandToAndSelectTreeNode(nodeBelgraveHouse);\n await waitForRenderedTreeNodeCount(shadowRoot, 9);\n const visibleTree = visibleNodesToTree(shadowRoot);\n // The tree is expanded down to include \"BEL\" but the rest of the tree is still collapsed.\n assert.deepEqual(visibleTree, [\n {\n renderedKey: 'Offices',\n children: [{\n renderedKey: 'Europe',\n children: [\n {\n renderedKey: 'UK',\n children: [\n {renderedKey: 'LON', children: [{renderedKey: '6PS'}, {renderedKey: 'CSG'}, {renderedKey: 'BEL'}]},\n ],\n },\n {renderedKey: 'Germany'},\n ],\n }],\n },\n {\n renderedKey: 'Products',\n },\n ]);\n });\n\n it('selects the given node once the tree has been expanded', async () => {\n const {component, shadowRoot} = await renderTreeOutline({\n tree: basicTreeData,\n });\n await component.expandToAndSelectTreeNode(nodeBelgraveHouse);\n // Wait for the tree to be expanded\n await waitForRenderedTreeNodeCount(shadowRoot, 9);\n // Wait for the coordinator to have called focus() on the right node\n await RenderCoordinator.done();\n\n assert.strictEqual(\n getFocusableTreeNode(shadowRoot),\n getVisibleTreeNodeByText(shadowRoot, 'BEL'),\n );\n });\n });\n\n it('can recursively collapse all children of a node', async () => {\n const {component, shadowRoot} = await renderTreeOutline({\n tree: basicTreeData,\n });\n await component.expandRecursively(Number.POSITIVE_INFINITY);\n await waitForRenderedTreeNodeCount(shadowRoot, NODE_COUNT_BASIC_DATA_FULLY_EXPANDED);\n const europeNode = getVisibleTreeNodeByText(shadowRoot, 'Europe');\n await component.collapseChildrenOfNode(europeNode);\n await waitForRenderedTreeNodeCount(shadowRoot, 7);\n const visibleTree = visibleNodesToTree(shadowRoot);\n assert.deepEqual(visibleTree, [\n {\n renderedKey: 'Offices',\n children: [{\n renderedKey: 'Europe',\n }],\n },\n {\n renderedKey: 'Products',\n children: [\n {\n renderedKey: 'Chrome',\n },\n {\n renderedKey: 'YouTube',\n },\n {\n renderedKey: 'Drive',\n },\n {\n renderedKey: 'Calendar',\n },\n ],\n },\n ]);\n });\n\n it('can collapse all nodes', async () => {\n const {component, shadowRoot} = await renderTreeOutline({\n tree: basicTreeData,\n });\n await component.expandRecursively(Number.POSITIVE_INFINITY);\n await waitForRenderedTreeNodeCount(shadowRoot, NODE_COUNT_BASIC_DATA_FULLY_EXPANDED);\n await component.collapseAllNodes();\n await waitForRenderedTreeNodeCount(shadowRoot, 2);\n const visibleTree = visibleNodesToTree(shadowRoot);\n assert.deepEqual(visibleTree, [\n {\n renderedKey: 'Offices',\n },\n {\n renderedKey: 'Products',\n },\n ]);\n });\n\n it('caches async child nodes and only fetches them once', async () => {\n const fetchChildrenSpy = sinon.spy<() => Promise[]>>(async () => {\n return [\n {\n treeNodeData: 'EMEA',\n id: '1',\n },\n {\n treeNodeData: 'USA',\n id: '2',\n },\n {\n treeNodeData: 'APAC',\n id: '3',\n },\n ];\n });\n const tinyTree: TreeOutline.TreeOutlineUtils.TreeNode[] = [\n {\n treeNodeData: 'Offices',\n id: '0',\n children: fetchChildrenSpy,\n },\n ];\n\n const {component, shadowRoot} = await renderTreeOutline({\n tree: tinyTree,\n });\n\n // Expand it, then collapse it, then expand it again\n await component.expandRecursively(Number.POSITIVE_INFINITY);\n await waitForRenderedTreeNodeCount(shadowRoot, 4);\n assert.strictEqual(fetchChildrenSpy.callCount, 1);\n const officesNode = getVisibleTreeNodeByText(shadowRoot, 'Offices');\n await component.collapseChildrenOfNode(officesNode);\n await waitForRenderedTreeNodeCount(shadowRoot, 1);\n await component.expandRecursively(Number.POSITIVE_INFINITY);\n await waitForRenderedTreeNodeCount(shadowRoot, 4);\n // Make sure that we only fetched the children once despite expanding the\n // Tree twice.\n assert.strictEqual(fetchChildrenSpy.callCount, 1);\n const visibleTree = visibleNodesToTree(shadowRoot);\n assert.deepEqual(visibleTree, [\n {\n renderedKey: 'Offices',\n children: [\n {\n renderedKey: 'EMEA',\n },\n {renderedKey: 'USA'},\n {renderedKey: 'APAC'},\n ],\n },\n ]);\n });\n\n it('allows a node to have a custom renderer', async () => {\n const tinyTree: TreeOutline.TreeOutlineUtils.TreeNode[] = [{\n treeNodeData: 'Offices',\n id: 'Offices',\n renderer: node => html`

      ${node.treeNodeData.toUpperCase()}

      `,\n children: async () =>\n [{\n treeNodeData: 'EMEA',\n id: 'EMEA',\n },\n {\n treeNodeData: 'USA',\n id: 'USA',\n },\n {\n treeNodeData: 'APAC',\n id: 'APAC',\n }],\n }];\n\n const {component, shadowRoot} = await renderTreeOutline({\n tree: tinyTree,\n });\n\n await component.expandRecursively(Number.POSITIVE_INFINITY);\n await waitForRenderedTreeNodeCount(shadowRoot, 4);\n const officeNode = getVisibleTreeNodeByText(shadowRoot, 'Offices');\n const key = officeNode.querySelector('[data-node-key]');\n assert.instanceOf(key, HTMLElement);\n const renderedKey = stripLitHtmlCommentNodes(key.innerHTML);\n assert.strictEqual(renderedKey, '

      OFFICES

      ');\n });\n\n it('passes the custom renderer the expanded state', async () => {\n const tinyTree: TreeOutline.TreeOutlineUtils.TreeNode[] = [{\n treeNodeData: 'Offices',\n id: 'Offices',\n renderer: (node, {isExpanded}) => {\n return html`

      ${node.treeNodeData.toUpperCase()}. Expanded: ${isExpanded}

      `;\n },\n children: async () =>\n [{\n treeNodeData: 'EMEA',\n id: 'EMEA',\n },\n {\n treeNodeData: 'USA',\n id: 'USA',\n },\n {\n treeNodeData: 'APAC',\n id: 'APAC',\n }],\n }];\n\n const {component, shadowRoot} = await renderTreeOutline({\n tree: tinyTree,\n });\n\n const officeNode = getVisibleTreeNodeByText(shadowRoot, 'Offices');\n const key = officeNode.querySelector('[data-node-key]');\n assert.instanceOf(key, HTMLElement);\n let renderedKey = stripLitHtmlCommentNodes(key.innerHTML);\n assert.strictEqual(renderedKey, '

      OFFICES. Expanded: false

      ');\n await component.expandRecursively(Number.POSITIVE_INFINITY);\n await waitForRenderedTreeNodeCount(shadowRoot, 4);\n renderedKey = stripLitHtmlCommentNodes(key.innerHTML);\n assert.strictEqual(renderedKey, '

      OFFICES. Expanded: true

      ');\n });\n\n describe('navigating with keyboard', () => {\n it('defaults to the first root node as active', async () => {\n const {shadowRoot} = await renderTreeOutline({\n tree: basicTreeData,\n });\n assert.strictEqual(\n getFocusableTreeNode(shadowRoot),\n getVisibleTreeNodeByText(shadowRoot, 'Offices'),\n );\n });\n\n describe('pressing the ENTER key', () => {\n it('expands the node if it is closed', async () => {\n const {shadowRoot} = await renderTreeOutline({\n tree: basicTreeData,\n });\n const officeNode = getVisibleTreeNodeByText(shadowRoot, 'Offices');\n dispatchClickEvent(officeNode);\n await RenderCoordinator.done();\n dispatchKeyDownEvent(officeNode, {key: 'Enter', bubbles: true});\n await waitForRenderedTreeNodeCount(shadowRoot, 3);\n assert.strictEqual(officeNode.getAttribute('aria-expanded'), 'true');\n });\n\n it('closes the node if it is open', async () => {\n const {component, shadowRoot} = await renderTreeOutline({\n tree: basicTreeData,\n });\n void component.expandRecursively();\n await waitForRenderedTreeNodeCount(shadowRoot, NODE_COUNT_BASIC_DATA_DEFAULT_EXPANDED);\n const officeNode = getVisibleTreeNodeByText(shadowRoot, 'Offices');\n dispatchClickEvent(officeNode);\n await RenderCoordinator.done();\n dispatchKeyDownEvent(officeNode, {key: 'Enter', bubbles: true});\n await waitForRenderedTreeNodeCount(shadowRoot, 6);\n assert.strictEqual(officeNode.getAttribute('aria-expanded'), 'false');\n });\n });\n\n describe('pressing the SPACE key', () => {\n it('expands the node if it is closed', async () => {\n const {shadowRoot} = await renderTreeOutline({\n tree: basicTreeData,\n });\n const officeNode = getVisibleTreeNodeByText(shadowRoot, 'Offices');\n dispatchClickEvent(officeNode);\n await RenderCoordinator.done();\n dispatchKeyDownEvent(officeNode, {key: ' ', bubbles: true});\n await waitForRenderedTreeNodeCount(shadowRoot, 3);\n assert.strictEqual(officeNode.getAttribute('aria-expanded'), 'true');\n });\n\n it('closes the node if it is open', async () => {\n const {component, shadowRoot} = await renderTreeOutline({\n tree: basicTreeData,\n });\n await component.expandRecursively();\n await waitForRenderedTreeNodeCount(shadowRoot, 12);\n const officeNode = getVisibleTreeNodeByText(shadowRoot, 'Offices');\n dispatchClickEvent(officeNode);\n await RenderCoordinator.done();\n dispatchKeyDownEvent(officeNode, {key: ' ', bubbles: true});\n await waitForRenderedTreeNodeCount(shadowRoot, 6);\n assert.strictEqual(officeNode.getAttribute('aria-expanded'), 'false');\n });\n });\n\n describe('pressing the HOME key', () => {\n it('takes the user to the top most root node', async () => {\n const {component, shadowRoot} = await renderTreeOutline({\n tree: basicTreeData,\n });\n await component.expandRecursively(Number.POSITIVE_INFINITY);\n await waitForRenderedTreeNodeCount(shadowRoot, NODE_COUNT_BASIC_DATA_FULLY_EXPANDED);\n const berlinNode = getVisibleTreeNodeByText(shadowRoot, 'BER');\n dispatchClickEvent(berlinNode);\n await RenderCoordinator.done();\n dispatchKeyDownEvent(berlinNode, {key: 'Home', bubbles: true});\n await RenderCoordinator.done();\n assert.strictEqual(\n getFocusableTreeNode(shadowRoot),\n getVisibleTreeNodeByText(shadowRoot, 'Offices'),\n );\n });\n });\n\n describe('pressing the END key', () => {\n it('takes the user to the last visible node if they are all expanded', async () => {\n const {component, shadowRoot} = await renderTreeOutline({\n tree: basicTreeData,\n });\n await component.expandRecursively(Number.POSITIVE_INFINITY);\n await RenderCoordinator.done();\n const officeNode = getVisibleTreeNodeByText(shadowRoot, 'Offices');\n dispatchClickEvent(officeNode);\n dispatchKeyDownEvent(officeNode, {key: 'End', bubbles: true});\n await RenderCoordinator.done();\n assert.strictEqual(\n getFocusableTreeNode(shadowRoot),\n // Calendar is the very last node in the tree\n getVisibleTreeNodeByText(shadowRoot, 'Calendar'),\n );\n });\n\n it('does not expand any closed nodes and focuses the last visible node', async () => {\n const {shadowRoot} = await renderTreeOutline({\n tree: basicTreeData,\n });\n const officeNode = getVisibleTreeNodeByText(shadowRoot, 'Offices');\n // Expand the Offices part of the tree\n const arrowIcon = officeNode.querySelector('.arrow-icon');\n assert.instanceOf(arrowIcon, HTMLSpanElement);\n dispatchClickEvent(arrowIcon);\n await waitForRenderedTreeNodeCount(shadowRoot, 3);\n\n // Focus the \"Europe\" node.\n const europeNode = getVisibleTreeNodeByText(shadowRoot, 'Europe');\n dispatchClickEvent(europeNode);\n dispatchKeyDownEvent(officeNode, {key: 'End', bubbles: true});\n await RenderCoordinator.done();\n assert.strictEqual(\n getFocusableTreeNode(shadowRoot),\n // Products is the last node in the tree, as its children are not expanded\n getVisibleTreeNodeByText(shadowRoot, 'Products'),\n );\n });\n });\n\n describe('pressing the UP arrow', () => {\n it('does nothing if on the root node', async () => {\n const {shadowRoot} = await renderTreeOutline({\n tree: basicTreeData,\n });\n const officeNode = getVisibleTreeNodeByText(shadowRoot, 'Offices');\n dispatchClickEvent(officeNode);\n dispatchKeyDownEvent(officeNode, {key: 'ArrowUp', bubbles: true});\n await RenderCoordinator.done();\n\n assert.strictEqual(\n getFocusableTreeNode(shadowRoot),\n officeNode,\n );\n });\n\n it('moves focus to the previous sibling', async () => {\n const {component, shadowRoot} = await renderTreeOutline({\n tree: basicTreeData,\n });\n await component.expandRecursively();\n await waitForRenderedTreeNodeCount(shadowRoot, 12);\n const berlinNode = getVisibleTreeNodeByText(shadowRoot, 'BER');\n dispatchClickEvent(berlinNode);\n dispatchKeyDownEvent(berlinNode, {key: 'ArrowUp', bubbles: true});\n await RenderCoordinator.done();\n assert.strictEqual(\n getFocusableTreeNode(shadowRoot),\n getVisibleTreeNodeByText(shadowRoot, 'MUC'),\n );\n });\n\n it('moves focus to the parent if there are no previous siblings', async () => {\n const {component, shadowRoot} = await renderTreeOutline({\n tree: basicTreeData,\n });\n await component.expandRecursively();\n await waitForRenderedTreeNodeCount(shadowRoot, NODE_COUNT_BASIC_DATA_DEFAULT_EXPANDED);\n const ukNode = getVisibleTreeNodeByText(shadowRoot, 'UK');\n dispatchClickEvent(ukNode);\n dispatchKeyDownEvent(ukNode, {key: 'ArrowUp', bubbles: true});\n await RenderCoordinator.done();\n assert.strictEqual(\n getFocusableTreeNode(shadowRoot),\n getVisibleTreeNodeByText(shadowRoot, 'Europe'),\n );\n });\n\n it('moves focus to the parent\\'s last child if there are no previous siblings and the parent is expanded',\n async () => {\n const {component, shadowRoot} = await renderTreeOutline({\n tree: basicTreeData,\n });\n await component.expandRecursively();\n await waitForRenderedTreeNodeCount(shadowRoot, NODE_COUNT_BASIC_DATA_DEFAULT_EXPANDED);\n const germanyNode = getVisibleTreeNodeByText(shadowRoot, 'Germany');\n dispatchClickEvent(germanyNode);\n dispatchKeyDownEvent(germanyNode, {key: 'ArrowUp', bubbles: true});\n await RenderCoordinator.done();\n assert.strictEqual(\n getFocusableTreeNode(shadowRoot),\n getVisibleTreeNodeByText(shadowRoot, 'LON'),\n );\n });\n\n it('moves focus to the parent\\'s deeply nested last child if there are no previous siblings and the parent has children that are expanded',\n async () => {\n const {component, shadowRoot} = await renderTreeOutline({\n tree: basicTreeData,\n });\n await component.expandRecursively(Number.POSITIVE_INFINITY);\n await waitForRenderedTreeNodeCount(shadowRoot, NODE_COUNT_BASIC_DATA_FULLY_EXPANDED);\n const germanyNode = getVisibleTreeNodeByText(shadowRoot, 'Germany');\n dispatchClickEvent(germanyNode);\n dispatchKeyDownEvent(germanyNode, {key: 'ArrowUp', bubbles: true});\n await RenderCoordinator.done();\n assert.strictEqual(\n getFocusableTreeNode(shadowRoot),\n getVisibleTreeNodeByText(shadowRoot, 'BEL'),\n );\n });\n });\n\n describe('pressing the RIGHT arrow', () => {\n it('does nothing if it is on a node that cannot be expanded', async () => {\n const {component, shadowRoot} = await renderTreeOutline({\n tree: basicTreeData,\n });\n await component.expandRecursively(Number.POSITIVE_INFINITY);\n await waitForRenderedTreeNodeCount(shadowRoot, NODE_COUNT_BASIC_DATA_FULLY_EXPANDED);\n const chromeNode = getVisibleTreeNodeByText(shadowRoot, 'Chrome');\n dispatchClickEvent(chromeNode);\n dispatchKeyDownEvent(chromeNode, {key: 'ArrowRight', bubbles: true});\n await RenderCoordinator.done();\n assert.strictEqual(\n getFocusableTreeNode(shadowRoot),\n chromeNode,\n );\n });\n\n it('expands the node if on an expandable node that is closed and does not move focus', async () => {\n const {shadowRoot} = await renderTreeOutline({\n tree: basicTreeData,\n });\n const officeNode = getVisibleTreeNodeByText(shadowRoot, 'Offices');\n dispatchClickEvent(officeNode);\n dispatchKeyDownEvent(officeNode, {key: 'ArrowRight', bubbles: true});\n await RenderCoordinator.done();\n assert.strictEqual(\n getFocusableTreeNode(shadowRoot),\n officeNode,\n );\n assert.strictEqual(officeNode.getAttribute('aria-expanded'), 'true');\n });\n\n it('moves focus into the child if pressed on an expanded node', async () => {\n const {shadowRoot} = await renderTreeOutline({\n tree: basicTreeData,\n });\n const officeNode = getVisibleTreeNodeByText(shadowRoot, 'Offices');\n dispatchClickEvent(officeNode);\n // Press once to expand, twice to navigate in to the first child\n dispatchKeyDownEvent(officeNode, {key: 'ArrowRight', bubbles: true});\n await RenderCoordinator.done();\n dispatchKeyDownEvent(officeNode, {key: 'ArrowRight', bubbles: true});\n await RenderCoordinator.done();\n assert.strictEqual(\n getFocusableTreeNode(shadowRoot),\n getVisibleTreeNodeByText(shadowRoot, 'Europe'),\n );\n });\n });\n\n describe('pressing the LEFT arrow', () => {\n it('closes the node if the focused node is expanded', async () => {\n const {component, shadowRoot} = await renderTreeOutline({\n tree: basicTreeData,\n });\n await component.expandRecursively(Number.POSITIVE_INFINITY);\n await RenderCoordinator.done();\n const europeNode = getVisibleTreeNodeByText(shadowRoot, 'Europe');\n dispatchClickEvent(europeNode);\n dispatchKeyDownEvent(europeNode, {key: 'ArrowLeft', bubbles: true});\n await RenderCoordinator.done();\n assert.strictEqual(\n getFocusableTreeNode(shadowRoot),\n getVisibleTreeNodeByText(shadowRoot, 'Europe'),\n );\n const visibleTree = visibleNodesToTree(shadowRoot);\n // The tree below \"Europe\" is hidden as the left arrow press closed that node.\n assert.deepEqual(visibleTree, [\n {\n renderedKey: 'Offices',\n children: [{\n renderedKey: 'Europe',\n }],\n },\n {\n renderedKey: 'Products',\n children: [\n {\n renderedKey: 'Chrome',\n },\n {\n renderedKey: 'YouTube',\n },\n {\n renderedKey: 'Drive',\n },\n {\n renderedKey: 'Calendar',\n },\n ],\n },\n ]);\n });\n\n it('moves to the parent node if the current node is not expanded or unexpandable', async () => {\n const {component, shadowRoot} = await renderTreeOutline({\n tree: basicTreeData,\n });\n await component.expandRecursively(Number.POSITIVE_INFINITY);\n await waitForRenderedTreeNodeCount(shadowRoot, NODE_COUNT_BASIC_DATA_FULLY_EXPANDED);\n await RenderCoordinator.done();\n const berlinNode = getVisibleTreeNodeByText(shadowRoot, 'BER');\n dispatchClickEvent(berlinNode);\n dispatchKeyDownEvent(berlinNode, {key: 'ArrowLeft', bubbles: true});\n await RenderCoordinator.done();\n assert.strictEqual(\n getFocusableTreeNode(shadowRoot),\n getVisibleTreeNodeByText(shadowRoot, 'Germany'),\n );\n });\n it('does nothing when called on a root node', async () => {\n const {shadowRoot} = await renderTreeOutline({\n tree: basicTreeData,\n });\n const productsNode = getVisibleTreeNodeByText(shadowRoot, 'Products');\n dispatchClickEvent(productsNode);\n dispatchKeyDownEvent(productsNode, {key: 'ArrowLeft', bubbles: true});\n await RenderCoordinator.done();\n assert.strictEqual(\n getFocusableTreeNode(shadowRoot),\n getVisibleTreeNodeByText(shadowRoot, 'Products'),\n );\n });\n });\n describe('pressing the DOWN arrow', () => {\n it('moves down to the next sibling if the node is not expanded', async () => {\n const {shadowRoot} = await renderTreeOutline({\n tree: basicTreeData,\n });\n const officeNode = getVisibleTreeNodeByText(shadowRoot, 'Offices');\n dispatchClickEvent(officeNode);\n dispatchKeyDownEvent(officeNode, {key: 'ArrowDown', bubbles: true});\n await RenderCoordinator.done();\n assert.strictEqual(\n getFocusableTreeNode(shadowRoot),\n getVisibleTreeNodeByText(shadowRoot, 'Products'),\n );\n });\n\n it('does not move if it is the last sibling and there are no parent siblings', async () => {\n const {shadowRoot} = await renderTreeOutline({\n tree: basicTreeData,\n });\n const productsNode = getVisibleTreeNodeByText(shadowRoot, 'Products');\n dispatchClickEvent(productsNode);\n dispatchKeyDownEvent(productsNode, {key: 'ArrowDown', bubbles: true});\n await RenderCoordinator.done();\n assert.strictEqual(\n getFocusableTreeNode(shadowRoot),\n getVisibleTreeNodeByText(shadowRoot, 'Products'),\n );\n });\n\n it('moves down to the first child of the node if it is expanded', async () => {\n const {component, shadowRoot} = await renderTreeOutline({\n tree: basicTreeData,\n });\n await component.expandRecursively();\n await RenderCoordinator.done();\n const officeNode = getVisibleTreeNodeByText(shadowRoot, 'Offices');\n dispatchClickEvent(officeNode);\n dispatchKeyDownEvent(officeNode, {key: 'ArrowDown', bubbles: true});\n await RenderCoordinator.done();\n assert.strictEqual(\n getFocusableTreeNode(shadowRoot),\n getVisibleTreeNodeByText(shadowRoot, 'Europe'),\n );\n });\n\n it('moves to its parent\\'s sibling if it is the last child', async () => {\n const {component, shadowRoot} = await renderTreeOutline({\n tree: basicTreeData,\n });\n await component.expandRecursively();\n await waitForRenderedTreeNodeCount(shadowRoot, NODE_COUNT_BASIC_DATA_DEFAULT_EXPANDED);\n const lonNode = getVisibleTreeNodeByText(shadowRoot, 'LON');\n dispatchClickEvent(lonNode);\n dispatchKeyDownEvent(lonNode, {key: 'ArrowDown', bubbles: true});\n await RenderCoordinator.done();\n assert.strictEqual(\n getFocusableTreeNode(shadowRoot),\n getVisibleTreeNodeByText(shadowRoot, 'Germany'),\n );\n });\n\n it('is able to navigate high up the tree to the correct next parent\\'s sibling', async () => {\n const {component, shadowRoot} = await renderTreeOutline({\n tree: basicTreeData,\n });\n await component.expandRecursively(Number.POSITIVE_INFINITY);\n await waitForRenderedTreeNodeCount(shadowRoot, NODE_COUNT_BASIC_DATA_FULLY_EXPANDED);\n const berNode = getVisibleTreeNodeByText(shadowRoot, 'BER');\n dispatchClickEvent(berNode);\n dispatchKeyDownEvent(berNode, {key: 'ArrowDown', bubbles: true});\n await RenderCoordinator.done();\n assert.strictEqual(\n getFocusableTreeNode(shadowRoot),\n getVisibleTreeNodeByText(shadowRoot, 'Products'),\n );\n });\n });\n });\n\n // Note: all aria-* positional labels are 1 indexed, not 0 indexed.\n describe('aria-* labels', () => {\n it('adds correct aria-level labels', async () => {\n const {component, shadowRoot} = await renderTreeOutline({\n tree: basicTreeData,\n });\n await component.expandRecursively(Number.POSITIVE_INFINITY);\n await waitForRenderedTreeNodeCount(shadowRoot, NODE_COUNT_BASIC_DATA_FULLY_EXPANDED);\n await RenderCoordinator.done();\n const rootNode = getVisibleTreeNodeByText(shadowRoot, 'Offices');\n assert.strictEqual(rootNode.getAttribute('aria-level'), '1');\n\n const europeNode = getVisibleTreeNodeByText(shadowRoot, 'Europe');\n assert.strictEqual(europeNode.getAttribute('aria-level'), '2');\n\n const germanyNode = getVisibleTreeNodeByText(shadowRoot, 'Germany');\n assert.strictEqual(germanyNode.getAttribute('aria-level'), '3');\n\n const berlinNode = getVisibleTreeNodeByText(shadowRoot, 'BER');\n assert.strictEqual(berlinNode.getAttribute('aria-level'), '4');\n });\n\n it('adds the correct setsize label to the root node', async () => {\n const {shadowRoot} = await renderTreeOutline({\n tree: basicTreeData,\n });\n const rootNode = getVisibleTreeNodeByText(shadowRoot, 'Products');\n assert.strictEqual(rootNode.getAttribute('aria-setsize'), '2');\n });\n\n it('adds the correct setsize label to a deeply nested node', async () => {\n const {component, shadowRoot} = await renderTreeOutline({\n tree: basicTreeData,\n });\n await component.expandRecursively(Number.POSITIVE_INFINITY);\n await waitForRenderedTreeNodeCount(shadowRoot, NODE_COUNT_BASIC_DATA_FULLY_EXPANDED);\n const europeKey = getVisibleTreeNodeByText(shadowRoot, 'Europe');\n assert.strictEqual(europeKey.getAttribute('aria-setsize'), '1');\n const germanyKey = getVisibleTreeNodeByText(shadowRoot, 'Germany');\n // 2 because there are two keys at this level in the tree: UK & Germany\n assert.strictEqual(germanyKey.getAttribute('aria-setsize'), '2');\n });\n\n it('adds the posinset label to nodes correctly', async () => {\n const {component, shadowRoot} = await renderTreeOutline({\n tree: basicTreeData,\n });\n await component.expandRecursively(Number.POSITIVE_INFINITY);\n await waitForRenderedTreeNodeCount(shadowRoot, NODE_COUNT_BASIC_DATA_FULLY_EXPANDED);\n const europeKey = getVisibleTreeNodeByText(shadowRoot, 'Europe');\n assert.strictEqual(europeKey.getAttribute('aria-posinset'), '1');\n const csgOfficeKey = getVisibleTreeNodeByText(shadowRoot, 'CSG');\n // CSG is 2nd in the LON office list: 6PS, CSG, BEL\n assert.strictEqual(csgOfficeKey.getAttribute('aria-posinset'), '2');\n });\n\n it('sets aria-expanded to false on non-expanded nodes', async () => {\n const {shadowRoot} = await renderTreeOutline({\n tree: basicTreeData,\n });\n const rootNode = getVisibleTreeNodeByText(shadowRoot, 'Offices');\n assert.strictEqual(rootNode.getAttribute('aria-expanded'), 'false');\n });\n\n it('sets aria-expanded to true on expanded nodes', async () => {\n const {shadowRoot} = await renderTreeOutline({\n tree: basicTreeData,\n });\n const rootNode = getVisibleTreeNodeByText(shadowRoot, 'Offices');\n const arrowIcon = rootNode.querySelector('.arrow-icon');\n assert.instanceOf(arrowIcon, HTMLSpanElement);\n dispatchClickEvent(arrowIcon);\n await RenderCoordinator.done();\n assert.strictEqual(rootNode.getAttribute('aria-expanded'), 'true');\n });\n\n it('does not set aria-expanded at all on leaf nodes', async () => {\n const {component, shadowRoot} = await renderTreeOutline({\n tree: basicTreeData,\n });\n await component.expandRecursively(Number.POSITIVE_INFINITY);\n await waitForRenderedTreeNodeCount(shadowRoot, NODE_COUNT_BASIC_DATA_FULLY_EXPANDED);\n const leafNodeCSGOffice = getVisibleTreeNodeByText(shadowRoot, 'CSG');\n assert.isNull(leafNodeCSGOffice.getAttribute('aria-expanded'));\n });\n });\n\n describe('emitting events', () => {\n describe('itemselected event', () => {\n it('emits an event when the user clicks on the node', async () => {\n const {component, shadowRoot} = await renderTreeOutline({\n tree: basicTreeData,\n });\n await RenderCoordinator.done();\n const officeNode = getVisibleTreeNodeByText(shadowRoot, 'Offices');\n const treeItemSelectedEvent =\n getEventPromise>(component, 'itemselected');\n dispatchClickEvent(officeNode);\n const event = await treeItemSelectedEvent;\n assert.deepEqual(event.data, {node: basicTreeData[0]});\n });\n\n it('emits an event when the user navigates to the node with their keyboard', async () => {\n const {component, shadowRoot} = await renderTreeOutline({\n tree: basicTreeData,\n });\n await RenderCoordinator.done();\n const officeNode = getVisibleTreeNodeByText(shadowRoot, 'Offices');\n dispatchClickEvent(officeNode);\n await RenderCoordinator.done();\n dispatchKeyDownEvent(officeNode, {key: 'ArrowDown', bubbles: true});\n const treeItemSelectedEvent =\n getEventPromise>(component, 'itemselected');\n await RenderCoordinator.done();\n const event = await treeItemSelectedEvent;\n assert.deepEqual(event.data, {node: basicTreeData[1]});\n });\n });\n\n describe('itemmouseover', () => {\n it('emits an event when the user mouses over the element', async () => {\n const {component, shadowRoot} = await renderTreeOutline({\n tree: basicTreeData,\n });\n await RenderCoordinator.done();\n const officeNode = getVisibleTreeNodeByText(shadowRoot, 'Offices').querySelector('.arrow-and-key-wrapper');\n assert.instanceOf(officeNode, HTMLSpanElement);\n const itemMouseOverEvent =\n getEventPromise>(component, 'itemmouseover');\n dispatchMouseOverEvent(officeNode);\n const event = await itemMouseOverEvent;\n assert.deepEqual(event.data, {node: basicTreeData[0]});\n });\n });\n\n describe('itemmouseout', () => {\n it('emits an event when the user mouses out of the element', async () => {\n const {component, shadowRoot} = await renderTreeOutline({\n tree: basicTreeData,\n });\n await RenderCoordinator.done();\n const officeNode = getVisibleTreeNodeByText(shadowRoot, 'Offices').querySelector('.arrow-and-key-wrapper');\n assert.instanceOf(officeNode, HTMLSpanElement);\n dispatchMouseOverEvent(officeNode);\n const itemMouseOutEvent =\n getEventPromise>(component, 'itemmouseout');\n dispatchMouseOutEvent(officeNode);\n const event = await itemMouseOutEvent;\n assert.deepEqual(event.data, {node: basicTreeData[0]});\n });\n });\n });\n\n describe('matching on id parameter', () => {\n it('expands the relevant part of the tree to reveal the given node', async () => {\n const {component, shadowRoot} = await renderTreeOutline({\n tree: [nodeAustralia],\n });\n\n // Expand to the node with the given ID, the actual data doesn't matter in this case.\n // This means you can search the tree, without having a reference to the specific tree data,\n // just as long as you know the id for whatever thing you are looking for.\n await component.expandToAndSelectTreeNode({treeNodeData: 'something else', id: 'gawler'});\n await waitForRenderedTreeNodeCount(shadowRoot, 7);\n const visibleTree = visibleNodesToTree(shadowRoot);\n\n // The tree is expanded down to include \"Gawler\" but the rest of the tree is still collapsed.\n assert.deepEqual(visibleTree, [{\n renderedKey: 'Australia',\n children: [\n {\n renderedKey: 'SA',\n children: [\n {\n renderedKey: 'Adelaide',\n children: [\n {renderedKey: 'Toorak Gardens'},\n {renderedKey: 'Woodville South'},\n {renderedKey: 'Gawler'},\n ],\n },\n ],\n },\n {renderedKey: 'NSW'},\n ],\n }]);\n });\n\n it('remembers nodes expanded state across node updates', async () => {\n const {component, shadowRoot} = await renderTreeOutline({\n tree: [nodeAustralia],\n });\n\n await component.expandToAndSelectTreeNode({treeNodeData: 'something else', id: 'gawler'});\n\n // Update the node by replacing the root node.\n const newNodeAustralia = {\n treeNodeData: 'New Australia',\n id: 'australia',\n children: async () =>\n [{\n treeNodeData: 'Different SA',\n id: 'sa',\n children: async () =>\n [{\n treeNodeData: 'Phantom Adelaide',\n id: 'adelaide',\n children: async () =>\n [{treeNodeData: 'Totally not Gawler', id: 'gawler'},\n ],\n },\n ],\n },\n ],\n };\n\n component.data = {\n tree: [newNodeAustralia],\n defaultRenderer: (node => html`${node.treeNodeData}`),\n };\n await waitForRenderedTreeNodeCount(shadowRoot, 4);\n await RenderCoordinator.done();\n const visibleTree = visibleNodesToTree(shadowRoot);\n\n // The tree should still be expanded down to the node with key `gawler`.\n assert.deepEqual(visibleTree, [{\n renderedKey: 'New Australia',\n children: [\n {\n renderedKey: 'Different SA',\n children: [\n {\n renderedKey: 'Phantom Adelaide',\n children: [\n {renderedKey: 'Totally not Gawler'},\n ],\n },\n ],\n },\n ],\n }]);\n });\n\n it('focuses the given node with an id once the tree has been expanded', async () => {\n const {component, shadowRoot} = await renderTreeOutline({\n tree: [nodeAustralia],\n });\n\n await component.expandToAndSelectTreeNode({treeNodeData: 'literally anything', id: 'gawler'});\n await waitForRenderedTreeNodeCount(shadowRoot, 7);\n await RenderCoordinator.done();\n\n // The tree is expanded down to include \"Gawler\" but the rest of the tree is still collapsed.\n assert.strictEqual(\n getFocusableTreeNode(shadowRoot),\n getVisibleTreeNodeByText(shadowRoot, 'Gawler'),\n );\n });\n });\n});\n\ndescribe('TreeOutlineUtils', () => {\n describe('getPathToTreeNode', () => {\n it('can find the path to the given node', async () => {\n const path = await TreeOutline.TreeOutlineUtils.getPathToTreeNode(basicTreeData, nodeBelgraveHouse.id);\n assert.deepEqual(path, [nodeOffices, nodeEurope, nodeUK, nodeLondon, nodeBelgraveHouse]);\n });\n\n it('returns null if no path is found', async () => {\n const path = await TreeOutline.TreeOutlineUtils.getPathToTreeNode(basicTreeData, '-1');\n assert.isNull(path);\n });\n });\n});\n\ndescribe('TreeOutlineFiltering', () => {\n it('can flatten nodes', async () => {\n const {component, shadowRoot} = await renderTreeOutline({\n tree: [nodeAustralia],\n filter: node => node === 'SA' || node === 'NSW' || node === 'Adelaide' ?\n TreeOutline.TreeOutline.FilterOption.FLATTEN :\n TreeOutline.TreeOutline.FilterOption.SHOW,\n });\n\n await component.expandRecursively();\n await RenderCoordinator.done();\n await waitForRenderedTreeNodeCount(shadowRoot, 7);\n const visibleTree = visibleNodesToTree(shadowRoot);\n\n assert.deepEqual(visibleTree, [{\n renderedKey: 'Australia',\n children: [\n {renderedKey: 'Toorak Gardens'},\n {renderedKey: 'Woodville South'},\n {renderedKey: 'Gawler'},\n {renderedKey: 'Glebe'},\n {renderedKey: 'Newtown'},\n {renderedKey: 'Camperdown'},\n ],\n }]);\n });\n\n it('should not flatten an already expanded node', async () => {\n const {component, shadowRoot} = await renderTreeOutline({\n tree: [nodeAustralia],\n });\n\n await component.expandNodeIds(['australia', 'sa', 'adelaide']);\n await RenderCoordinator.done();\n await waitForRenderedTreeNodeCount(shadowRoot, 7);\n const visibleTree = visibleNodesToTree(shadowRoot);\n\n assert.deepEqual(visibleTree, [{\n renderedKey: 'Australia',\n children: [\n {\n renderedKey: 'SA',\n children: [\n {\n renderedKey: 'Adelaide',\n children: [\n {renderedKey: 'Toorak Gardens'},\n {renderedKey: 'Woodville South'},\n {renderedKey: 'Gawler'},\n ],\n },\n ],\n },\n {\n renderedKey: 'NSW',\n },\n ],\n }]);\n\n component.data = {\n tree: [nodeAustralia],\n filter: node => node === 'SA' || node === 'NSW' ? TreeOutline.TreeOutline.FilterOption.FLATTEN :\n TreeOutline.TreeOutline.FilterOption.SHOW,\n defaultRenderer: (node => html`${node.treeNodeData}`),\n };\n await waitForRenderedTreeNodeCount(shadowRoot, 9);\n const visibleTreeAfterFilter = visibleNodesToTree(shadowRoot);\n\n assert.deepEqual(visibleTreeAfterFilter, [{\n renderedKey: 'Australia',\n children: [\n {\n renderedKey: 'SA',\n children: [\n {\n renderedKey: 'Adelaide',\n children: [\n {renderedKey: 'Toorak Gardens'},\n {renderedKey: 'Woodville South'},\n {renderedKey: 'Gawler'},\n ],\n },\n ],\n },\n {renderedKey: 'Glebe'},\n {renderedKey: 'Newtown'},\n {renderedKey: 'Camperdown'},\n ],\n }]);\n });\n});\n"]} \ No newline at end of file diff --git a/public/ui/legacy/Dialog.js b/public/ui/legacy/Dialog.js index a0f6d40ad..4b9bee860 100644 --- a/public/ui/legacy/Dialog.js +++ b/public/ui/legacy/Dialog.js @@ -102,8 +102,8 @@ export class Dialog extends Common.ObjectWrapper.eventMixin(GlassPane) { this.escapeKeyCallback = callback; } addCloseButton() { - const closeButton = this.contentElement.createChild('div', 'dialog-close-button', 'dt-close-button'); - closeButton.addEventListener('click', () => this.hide(), false); + const closeButton = this.contentElement.createChild('dt-close-button', 'dialog-close-button'); + closeButton.addEventListener('click', this.hide.bind(this), false); } setOutsideTabIndexBehavior(tabIndexBehavior) { this.tabIndexBehavior = tabIndexBehavior; diff --git a/public/ui/legacy/Dialog.js.map b/public/ui/legacy/Dialog.js.map index d584ec030..73c622fdb 100644 --- a/public/ui/legacy/Dialog.js.map +++ b/public/ui/legacy/Dialog.js.map @@ -1 +1 @@ -{"version":3,"file":"Dialog.js","sourceRoot":"","sources":["../../../../../../front_end/ui/legacy/Dialog.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,OA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O,EAAE,CAAC;gBAClB,OAAO;YACT,CAAC;YAED,IAAI,IAAI,CAAC,aAAa,EAAE,CAAC;gBACvB,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;gBACpB,IAAI,CAAC,IAAI,EAAE,CAAC;YACd,CAAC;QACH,CAAC;IACH,CAAC;IAEO,MAAM,CAAC,QAAQ,GAAgB,IAAI,CAAC","sourcesContent":["/*\n * Copyright (C) 2012 Google Inc. All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are\n * met:\n *\n * * Redistributions of source code must retain the above copyright\n * notice, this list of conditions and the following disclaimer.\n * * Redistributions in binary form must reproduce the above\n * copyright notice, this list of conditions and the following disclaimer\n * in the documentation and/or other materials provided with the\n * distribution.\n * * Neither the name of Google Inc. nor the names of its\n * contributors may be used to endorse or promote products derived from\n * this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nimport * as Common from '../../core/common/common.js';\nimport * as VisualLogging from '../visual_logging/visual_logging.js';\n\nimport * as ARIAUtils from './ARIAUtils.js';\nimport dialogStyles from './dialog.css.legacy.js';\nimport {GlassPane, PointerEventsBehavior} from './GlassPane.js';\nimport {InspectorView} from './InspectorView.js';\nimport {KeyboardShortcut, Keys} from './KeyboardShortcut.js';\nimport type {SplitWidget} from './SplitWidget.js';\nimport type {DevToolsCloseButton} from './UIUtils.js';\nimport {WidgetFocusRestorer} from './Widget.js';\n\nexport class Dialog extends Common.ObjectWrapper.eventMixin(GlassPane) {\n private tabIndexBehavior: OutsideTabIndexBehavior;\n private tabIndexMap: Map;\n private focusRestorer: WidgetFocusRestorer|null;\n private closeOnEscape: boolean;\n private targetDocument!: Document|null;\n private readonly targetDocumentKeyDownHandler: (event: Event) => void;\n private escapeKeyCallback: ((arg0: Event) => void)|null;\n\n constructor(jslogContext?: string) {\n super();\n this.registerRequiredCSS(dialogStyles);\n this.contentElement.tabIndex = 0;\n this.contentElement.addEventListener('focus', () => this.widget().focus(), false);\n if (jslogContext) {\n this.contentElement.setAttribute(\n 'jslog', `${VisualLogging.dialog(jslogContext).track({resize: true, keydown: 'Escape'})}`);\n }\n this.widget().setDefaultFocusedElement(this.contentElement);\n this.setPointerEventsBehavior(PointerEventsBehavior.BLOCKED_BY_GLASS_PANE);\n this.setOutsideClickCallback(event => {\n this.hide();\n event.consume(true);\n });\n ARIAUtils.markAsModalDialog(this.contentElement);\n this.tabIndexBehavior = OutsideTabIndexBehavior.DISABLE_ALL_OUTSIDE_TAB_INDEX;\n this.tabIndexMap = new Map();\n this.focusRestorer = null;\n this.closeOnEscape = true;\n this.targetDocumentKeyDownHandler = this.onKeyDown.bind(this);\n this.escapeKeyCallback = null;\n }\n\n static hasInstance(): boolean {\n return Boolean(Dialog.instance);\n }\n\n static getInstance(): Dialog|null {\n return Dialog.instance;\n }\n\n override show(where?: Document|Element): void {\n const document =\n (where instanceof Document ? where : (where || InspectorView.instance().element).ownerDocument as Document);\n this.targetDocument = document;\n this.targetDocument.addEventListener('keydown', this.targetDocumentKeyDownHandler, true);\n\n if (Dialog.instance) {\n Dialog.instance.hide();\n }\n Dialog.instance = this;\n this.disableTabIndexOnElements(document);\n super.show(document);\n this.focusRestorer = new WidgetFocusRestorer(this.widget());\n }\n\n override hide(): void {\n if (this.focusRestorer) {\n this.focusRestorer.restore();\n }\n super.hide();\n\n if (this.targetDocument) {\n this.targetDocument.removeEventListener('keydown', this.targetDocumentKeyDownHandler, true);\n }\n this.restoreTabIndexOnElements();\n this.dispatchEventToListeners(Events.HIDDEN);\n Dialog.instance = null;\n }\n\n setCloseOnEscape(close: boolean): void {\n this.closeOnEscape = close;\n }\n\n setEscapeKeyCallback(callback: (arg0: Event) => void): void {\n this.escapeKeyCallback = callback;\n }\n\n addCloseButton(): void {\n const closeButton =\n (this.contentElement.createChild('div', 'dialog-close-button', 'dt-close-button') as DevToolsCloseButton);\n closeButton.addEventListener('click', () => this.hide(), false);\n }\n\n setOutsideTabIndexBehavior(tabIndexBehavior: OutsideTabIndexBehavior): void {\n this.tabIndexBehavior = tabIndexBehavior;\n }\n\n private disableTabIndexOnElements(document: Document): void {\n if (this.tabIndexBehavior === OutsideTabIndexBehavior.PRESERVE_TAB_INDEX) {\n return;\n }\n\n let exclusionSet: Set|(Set| null) = (null as Set| null);\n if (this.tabIndexBehavior === OutsideTabIndexBehavior.PRESERVE_MAIN_VIEW_TAB_INDEX) {\n exclusionSet = this.getMainWidgetTabIndexElements(InspectorView.instance().ownerSplit());\n }\n\n this.tabIndexMap.clear();\n let node: (Node|null)|Document = document;\n for (; node; node = node.traverseNextNode(document)) {\n if (node instanceof HTMLElement) {\n const element = (node as HTMLElement);\n const tabIndex = element.tabIndex;\n if (!exclusionSet?.has(element)) {\n if (tabIndex >= 0) {\n this.tabIndexMap.set(element, tabIndex);\n element.tabIndex = -1;\n } else if (element.hasAttribute('contenteditable')) {\n this.tabIndexMap.set(element, element.hasAttribute('tabindex') ? tabIndex : 0);\n element.tabIndex = -1;\n }\n }\n }\n }\n }\n\n private getMainWidgetTabIndexElements(splitWidget: SplitWidget|null): Set {\n const elementSet = (new Set() as Set);\n if (!splitWidget) {\n return elementSet;\n }\n\n const mainWidget = splitWidget.mainWidget();\n if (!mainWidget || !mainWidget.element) {\n return elementSet;\n }\n\n let node: Node|null = mainWidget.element;\n for (; node; node = node.traverseNextNode(mainWidget.element)) {\n if (!(node instanceof HTMLElement)) {\n continue;\n }\n\n const element = (node as HTMLElement);\n const tabIndex = element.tabIndex;\n if (tabIndex < 0) {\n continue;\n }\n\n elementSet.add(element);\n }\n\n return elementSet;\n }\n\n private restoreTabIndexOnElements(): void {\n for (const element of this.tabIndexMap.keys()) {\n element.tabIndex = (this.tabIndexMap.get(element) as number);\n }\n this.tabIndexMap.clear();\n }\n\n private onKeyDown(event: Event): void {\n const keyboardEvent = (event as KeyboardEvent);\n if (keyboardEvent.keyCode === Keys.Esc.code && KeyboardShortcut.hasNoModifiers(event)) {\n if (this.escapeKeyCallback) {\n this.escapeKeyCallback(event);\n }\n\n if (event.handled) {\n return;\n }\n\n if (this.closeOnEscape) {\n event.consume(true);\n this.hide();\n }\n }\n }\n\n private static instance: Dialog|null = null;\n}\n\nexport const enum Events {\n HIDDEN = 'hidden',\n}\n\nexport type EventTypes = {\n [Events.HIDDEN]: void,\n};\n\nexport const enum OutsideTabIndexBehavior {\n DISABLE_ALL_OUTSIDE_TAB_INDEX = 'DisableAllTabIndex',\n PRESERVE_MAIN_VIEW_TAB_INDEX = 'PreserveMainViewTabIndex',\n PRESERVE_TAB_INDEX = 'PreserveTabIndex',\n}\n"]} \ No newline at end of file +{"version":3,"file":"Dialog.js","sourceRoot":"","sources":["../../../../../../front_end/ui/legacy/Dialog.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,OAAO,KAAK,MAAM,MAAM,6BAA6B,CAAC;AACtD,OAAO,KAAK,aAAa,MAAM,qCAAq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gBACvB,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;gBACpB,IAAI,CAAC,IAAI,EAAE,CAAC;YACd,CAAC;QACH,CAAC;IACH,CAAC;IAEO,MAAM,CAAC,QAAQ,GAAgB,IAAI,CAAC","sourcesContent":["/*\n * Copyright (C) 2012 Google Inc. All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are\n * met:\n *\n * * Redistributions of source code must retain the above copyright\n * notice, this list of conditions and the following disclaimer.\n * * Redistributions in binary form must reproduce the above\n * copyright notice, this list of conditions and the following disclaimer\n * in the documentation and/or other materials provided with the\n * distribution.\n * * Neither the name of Google Inc. nor the names of its\n * contributors may be used to endorse or promote products derived from\n * this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nimport * as Common from '../../core/common/common.js';\nimport * as VisualLogging from '../visual_logging/visual_logging.js';\n\nimport * as ARIAUtils from './ARIAUtils.js';\nimport dialogStyles from './dialog.css.legacy.js';\nimport {GlassPane, PointerEventsBehavior} from './GlassPane.js';\nimport {InspectorView} from './InspectorView.js';\nimport {KeyboardShortcut, Keys} from './KeyboardShortcut.js';\nimport type {SplitWidget} from './SplitWidget.js';\nimport {WidgetFocusRestorer} from './Widget.js';\n\nexport class Dialog extends Common.ObjectWrapper.eventMixin(GlassPane) {\n private tabIndexBehavior: OutsideTabIndexBehavior;\n private tabIndexMap: Map;\n private focusRestorer: WidgetFocusRestorer|null;\n private closeOnEscape: boolean;\n private targetDocument!: Document|null;\n private readonly targetDocumentKeyDownHandler: (event: Event) => void;\n private escapeKeyCallback: ((arg0: Event) => void)|null;\n\n constructor(jslogContext?: string) {\n super();\n this.registerRequiredCSS(dialogStyles);\n this.contentElement.tabIndex = 0;\n this.contentElement.addEventListener('focus', () => this.widget().focus(), false);\n if (jslogContext) {\n this.contentElement.setAttribute(\n 'jslog', `${VisualLogging.dialog(jslogContext).track({resize: true, keydown: 'Escape'})}`);\n }\n this.widget().setDefaultFocusedElement(this.contentElement);\n this.setPointerEventsBehavior(PointerEventsBehavior.BLOCKED_BY_GLASS_PANE);\n this.setOutsideClickCallback(event => {\n this.hide();\n event.consume(true);\n });\n ARIAUtils.markAsModalDialog(this.contentElement);\n this.tabIndexBehavior = OutsideTabIndexBehavior.DISABLE_ALL_OUTSIDE_TAB_INDEX;\n this.tabIndexMap = new Map();\n this.focusRestorer = null;\n this.closeOnEscape = true;\n this.targetDocumentKeyDownHandler = this.onKeyDown.bind(this);\n this.escapeKeyCallback = null;\n }\n\n static hasInstance(): boolean {\n return Boolean(Dialog.instance);\n }\n\n static getInstance(): Dialog|null {\n return Dialog.instance;\n }\n\n override show(where?: Document|Element): void {\n const document =\n (where instanceof Document ? where : (where || InspectorView.instance().element).ownerDocument as Document);\n this.targetDocument = document;\n this.targetDocument.addEventListener('keydown', this.targetDocumentKeyDownHandler, true);\n\n if (Dialog.instance) {\n Dialog.instance.hide();\n }\n Dialog.instance = this;\n this.disableTabIndexOnElements(document);\n super.show(document);\n this.focusRestorer = new WidgetFocusRestorer(this.widget());\n }\n\n override hide(): void {\n if (this.focusRestorer) {\n this.focusRestorer.restore();\n }\n super.hide();\n\n if (this.targetDocument) {\n this.targetDocument.removeEventListener('keydown', this.targetDocumentKeyDownHandler, true);\n }\n this.restoreTabIndexOnElements();\n this.dispatchEventToListeners(Events.HIDDEN);\n Dialog.instance = null;\n }\n\n setCloseOnEscape(close: boolean): void {\n this.closeOnEscape = close;\n }\n\n setEscapeKeyCallback(callback: (arg0: Event) => void): void {\n this.escapeKeyCallback = callback;\n }\n\n addCloseButton(): void {\n const closeButton = this.contentElement.createChild('dt-close-button', 'dialog-close-button');\n closeButton.addEventListener('click', this.hide.bind(this), false);\n }\n\n setOutsideTabIndexBehavior(tabIndexBehavior: OutsideTabIndexBehavior): void {\n this.tabIndexBehavior = tabIndexBehavior;\n }\n\n private disableTabIndexOnElements(document: Document): void {\n if (this.tabIndexBehavior === OutsideTabIndexBehavior.PRESERVE_TAB_INDEX) {\n return;\n }\n\n let exclusionSet: Set|(Set| null) = (null as Set| null);\n if (this.tabIndexBehavior === OutsideTabIndexBehavior.PRESERVE_MAIN_VIEW_TAB_INDEX) {\n exclusionSet = this.getMainWidgetTabIndexElements(InspectorView.instance().ownerSplit());\n }\n\n this.tabIndexMap.clear();\n let node: (Node|null)|Document = document;\n for (; node; node = node.traverseNextNode(document)) {\n if (node instanceof HTMLElement) {\n const element = (node as HTMLElement);\n const tabIndex = element.tabIndex;\n if (!exclusionSet?.has(element)) {\n if (tabIndex >= 0) {\n this.tabIndexMap.set(element, tabIndex);\n element.tabIndex = -1;\n } else if (element.hasAttribute('contenteditable')) {\n this.tabIndexMap.set(element, element.hasAttribute('tabindex') ? tabIndex : 0);\n element.tabIndex = -1;\n }\n }\n }\n }\n }\n\n private getMainWidgetTabIndexElements(splitWidget: SplitWidget|null): Set {\n const elementSet = (new Set() as Set);\n if (!splitWidget) {\n return elementSet;\n }\n\n const mainWidget = splitWidget.mainWidget();\n if (!mainWidget || !mainWidget.element) {\n return elementSet;\n }\n\n let node: Node|null = mainWidget.element;\n for (; node; node = node.traverseNextNode(mainWidget.element)) {\n if (!(node instanceof HTMLElement)) {\n continue;\n }\n\n const element = (node as HTMLElement);\n const tabIndex = element.tabIndex;\n if (tabIndex < 0) {\n continue;\n }\n\n elementSet.add(element);\n }\n\n return elementSet;\n }\n\n private restoreTabIndexOnElements(): void {\n for (const element of this.tabIndexMap.keys()) {\n element.tabIndex = (this.tabIndexMap.get(element) as number);\n }\n this.tabIndexMap.clear();\n }\n\n private onKeyDown(event: Event): void {\n const keyboardEvent = (event as KeyboardEvent);\n if (keyboardEvent.keyCode === Keys.Esc.code && KeyboardShortcut.hasNoModifiers(event)) {\n if (this.escapeKeyCallback) {\n this.escapeKeyCallback(event);\n }\n\n if (event.handled) {\n return;\n }\n\n if (this.closeOnEscape) {\n event.consume(true);\n this.hide();\n }\n }\n }\n\n private static instance: Dialog|null = null;\n}\n\nexport const enum Events {\n HIDDEN = 'hidden',\n}\n\nexport type EventTypes = {\n [Events.HIDDEN]: void,\n};\n\nexport const enum OutsideTabIndexBehavior {\n DISABLE_ALL_OUTSIDE_TAB_INDEX = 'DisableAllTabIndex',\n PRESERVE_MAIN_VIEW_TAB_INDEX = 'PreserveMainViewTabIndex',\n PRESERVE_TAB_INDEX = 'PreserveTabIndex',\n}\n"]} \ No newline at end of file diff --git a/public/ui/legacy/DockController.test.js b/public/ui/legacy/DockController.test.js index 68d22d81a..c73db6088 100644 --- a/public/ui/legacy/DockController.test.js +++ b/public/ui/legacy/DockController.test.js @@ -52,12 +52,12 @@ describe('DockController', () => { */ await registerDockingSettings('left'); const dockController = LegacyUI.DockController.DockController.instance({ forceNew: true, canDock: true }); - assert.strictEqual(dockController.dockSide(), undefined); + assert.isUndefined(dockController.dockSide()); }); it('falls back to undefined if the setting value is unexpected', async () => { await registerDockingSettings('woah-not-a-real-setting-value'); const dockController = LegacyUI.DockController.DockController.instance({ forceNew: true, canDock: true }); - assert.strictEqual(dockController.dockSide(), undefined); + assert.isUndefined(dockController.dockSide()); }); it('sets the dockSide to undocked if the dock cannot be docked', async () => { await registerDockingSettings('left'); diff --git a/public/ui/legacy/DockController.test.js.map b/public/ui/legacy/DockController.test.js.map index 3b8cd2db9..ce605686a 100644 --- a/public/ui/legacy/DockController.test.js.map +++ b/public/ui/legacy/DockController.test.js.map @@ -1 +1 @@ -{"version":3,"file":"DockController.test.js","sourceRoot":"","sources":["../../../../../../front_end/ui/legacy/DockController.test.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,KAAK,MAAM,MAAM,6BAA6B,CAAC;AAEtD,OAAO,KAAK,IAAI,MAAM,yBAAyB,CAAC;AAChD,OAAO,EACL,sBAAsB,EACtB,oBAAoB,GACrB,MAAM,qCAAqC,CAAC;AAE7C,OAAO,KAAK,QAAQ,MAAM,aAAa,CAAC;AAExC,KAAK,UAAU,uBAAuB,CAAC,YAAoB;IACzD,MAAM,CAAC,QAAQ,CAAC,uBAAuB,CAAC,CAAC;YACvC,QAAQ,uDAAwC;YAChD,WAAW,EAAE,kBAAkB;YAC/B,WAAW,+CAAkC;YAC7C,YAAY,EAAE,YAAY;YAC1B,OAAO,EAAE;gBACP;oBACE,KAAK,EAAE,OAAO;oBACd,IAAI,EAAE,GAAG,EAAE,CAAC,OAA4C;oBACxD,KAAK,EAAE,GAAG,EAAE,CAAC,eAAoD;oBACjE,GAAG,EAAE,KAAK;iBACX;gBACD;oBACE,KAAK,EAAE,QAAQ;oBACf,IAAI,EAAE,GAAG,EAAE,CAAC,QAA6C;oBACzD,KAAK,EAAE,GAAG,EAAE,CAAC,gBAAqD;oBAClE,GAAG,EAAE,KAAK;iBACX;gBACD;oBACE,KAAK,EAAE,MAAM;oBACb,IAAI,EAAE,GAAG,EAAE,CAAC,MAA2C;oBACvD,KAAK,EAAE,GAAG,EAAE,CAAC,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AAK,IAAI,EAAE;QAC1E,MAAM,uBAAuB,CAAC,MAAM,CAAC,CAAC;QACtC,MAAM,cAAc,GAAG,QAAQ,CAAC,cAAc,CAAC,cAAc,CAAC,QAAQ,CAAC,EAAC,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAC,CAAC,CAAC;QACzG,MAAM,CAAC,WAAW,CAAC,cAAc,CAAC,QAAQ,EAAE,8DAA6C,CAAC;IAC5F,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,0CAA0C,EAAE,KAAK,IAAI,EAAE;QACxD,MAAM,uBAAuB,CAAC,MAAM,CAAC,CAAC;QACtC,MAAM,cAAc,GAAG,QAAQ,CAAC,cAAc,CAAC,cAAc,CAAC,QAAQ,CAAC,EAAC,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAC,CAAC,CAAC;QACxG,cAAc,CAAC,cAAc,EAAE,CAAC;QAChC,MAAM,CAAC,WAAW,CAAC,cAAc,CAAC,QAAQ,EAAE,0DAA2C,CAAC;QACxF,cAAc,CAAC,cAAc,EAAE,CAAC;QAChC,MAAM,CAAC,WAAW,CAAC,cAAc,CAAC,QAAQ,EAAE,sDAAyC,CAAC;QACtF,cAAc,CAAC,cAAc,EAAE,CAAC;QAChC,MAAM,CAAC,WAAW,CAAC,cAAc,CAAC,QAAQ,EAAE,0DAA2C,CAAC;IAC1F,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["// Copyright 2021 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport * as Common from '../../core/common/common.js';\nimport type * as Platform from '../../core/platform/platform.js';\nimport * as Root from '../../core/root/root.js';\nimport {\n deinitializeGlobalVars,\n initializeGlobalVars,\n} from '../../testing/EnvironmentHelpers.js';\n\nimport * as LegacyUI from './legacy.js';\n\nasync function registerDockingSettings(currentValue: string) {\n Common.Settings.registerSettingsForTest([{\n category: Common.Settings.SettingCategory.GLOBAL,\n settingName: 'currentDockState',\n settingType: Common.Settings.SettingType.ENUM,\n defaultValue: currentValue,\n options: [\n {\n value: 'right',\n text: () => 'right' as Platform.UIString.LocalizedString,\n title: () => 'Dock to right' as Platform.UIString.LocalizedString,\n raw: false,\n },\n {\n value: 'bottom',\n text: () => 'bottom' as Platform.UIString.LocalizedString,\n title: () => 'Dock to bottom' as Platform.UIString.LocalizedString,\n raw: false,\n },\n {\n value: 'left',\n text: () => 'left' as Platform.UIString.LocalizedString,\n title: () => 'Dock to left' as Platform.UIString.LocalizedString,\n raw: false,\n },\n {\n value: 'undocked',\n text: () => 'undocked' as Platform.UIString.LocalizedString,\n title: () => 'Undock' as Platform.UIString.LocalizedString,\n raw: false,\n },\n ],\n }]);\n Root.Runtime.experiments.clearForTest();\n await initializeGlobalVars({reset: false});\n}\n\ndescribe('DockController', () => {\n after(async () => {\n await deinitializeGlobalVars();\n });\n it('defaults the dockside to undefined when first created', async () => {\n /* Note: this seems like weird behaviour, but updating DockController to\n * explicitly set DockSide by default seems to cause issues in Chrome web\n * tests, so adding this test here to ensure we don't cause any problems.\n */\n await registerDockingSettings('left');\n const dockController = LegacyUI.DockController.DockController.instance({forceNew: true, canDock: true});\n assert.strictEqual(dockController.dockSide(), undefined);\n });\n\n it('falls back to undefined if the setting value is unexpected', async () => {\n await registerDockingSettings('woah-not-a-real-setting-value');\n const dockController = LegacyUI.DockController.DockController.instance({forceNew: true, canDock: true});\n assert.strictEqual(dockController.dockSide(), undefined);\n });\n\n it('sets the dockSide to undocked if the dock cannot be docked', async () => {\n await registerDockingSettings('left');\n const dockController = LegacyUI.DockController.DockController.instance({forceNew: true, canDock: false});\n assert.strictEqual(dockController.dockSide(), LegacyUI.DockController.DockState.UNDOCKED);\n });\n\n it('can toggle the dock between two settings', async () => {\n await registerDockingSettings('left');\n const dockController = LegacyUI.DockController.DockController.instance({forceNew: true, canDock: true});\n dockController.toggleDockSide();\n assert.strictEqual(dockController.dockSide(), LegacyUI.DockController.DockState.BOTTOM);\n dockController.toggleDockSide();\n assert.strictEqual(dockController.dockSide(), LegacyUI.DockController.DockState.LEFT);\n dockController.toggleDockSide();\n assert.strictEqual(dockController.dockSide(), LegacyUI.DockController.DockState.BOTTOM);\n });\n});\n"]} \ No newline at end of file +{"version":3,"file":"DockController.test.js","sourceRoot":"","sources":["../../../../../../front_end/ui/legacy/DockController.test.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,KAAK,MAAM,MAAM,6BAA6B,CAAC;AAEtD,OAAO,KAAK,IAAI,MAAM,yBAAyB,CAAC;AAChD,OAAO,EACL,sBAAsB,EACtB,oBAAoB,GACrB,MAAM,qCAAqC,CAAC;AAE7C,OAAO,KAAK,QAAQ,MAAM,aAAa,CAAC;AAExC,KAAK,UAAU,uBAAuB,CAAC,YAAoB;IACzD,MAAM,CAAC,QAAQ,CAAC,uBAAuB,CAAC,CAAC;YACvC,QAAQ,uDAAwC;YAChD,WAAW,EAAE,kBAAkB;YAC/B,WAAW,+CAAkC;YAC7C,YAAY,EAAE,YAAY;YAC1B,OAAO,EAAE;gBACP;oBACE,KAAK,EAAE,OAAO;oBACd,IAAI,EAAE,GAAG,EAAE,CAAC,OAA4C;oBACxD,KAAK,EAAE,GAAG,EAAE,CAAC,eAAoD;oBACjE,GAAG,EAAE,KAAK;iBACX;gBACD;oBACE,KAAK,EAAE,QAAQ;oBACf,IAAI,EAAE,GAAG,EAAE,CAAC,QAA6C;oBACzD,KAAK,EAAE,GAAG,EAAE,CAAC,gBAAqD;oBAClE,GAAG,EAAE,KAAK;iBACX;gBACD;oBACE,KAAK,EAAE,MAAM;oBACb,IAAI,EAAE,GAAG,EAAE,CAAC,MAA2C;oBACvD,KAAK,EAAE,GAAG,EAAE,CAAC,cAAmD;oBAChE,GAAG,EAAE,KAAK;iBACX;gBACD;oBACE,KAAK,EAAE,UAAU;oBACjB,IAAI,EAAE,GAAG,EAAE,CAAC,UAA+C;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AC,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAC,CAAC,CAAC;QACzG,MAAM,CAAC,WAAW,CAAC,cAAc,CAAC,QAAQ,EAAE,8DAA6C,CAAC;IAC5F,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,0CAA0C,EAAE,KAAK,IAAI,EAAE;QACxD,MAAM,uBAAuB,CAAC,MAAM,CAAC,CAAC;QACtC,MAAM,cAAc,GAAG,QAAQ,CAAC,cAAc,CAAC,cAAc,CAAC,QAAQ,CAAC,EAAC,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAC,CAAC,CAAC;QACxG,cAAc,CAAC,cAAc,EAAE,CAAC;QAChC,MAAM,CAAC,WAAW,CAAC,cAAc,CAAC,QAAQ,EAAE,0DAA2C,CAAC;QACxF,cAAc,CAAC,cAAc,EAAE,CAAC;QAChC,MAAM,CAAC,WAAW,CAAC,cAAc,CAAC,QAAQ,EAAE,sDAAyC,CAAC;QACtF,cAAc,CAAC,cAAc,EAAE,CAAC;QAChC,MAAM,CAAC,WAAW,CAAC,cAAc,CAAC,QAAQ,EAAE,0DAA2C,CAAC;IAC1F,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["// Copyright 2021 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport * as Common from '../../core/common/common.js';\nimport type * as Platform from '../../core/platform/platform.js';\nimport * as Root from '../../core/root/root.js';\nimport {\n deinitializeGlobalVars,\n initializeGlobalVars,\n} from '../../testing/EnvironmentHelpers.js';\n\nimport * as LegacyUI from './legacy.js';\n\nasync function registerDockingSettings(currentValue: string) {\n Common.Settings.registerSettingsForTest([{\n category: Common.Settings.SettingCategory.GLOBAL,\n settingName: 'currentDockState',\n settingType: Common.Settings.SettingType.ENUM,\n defaultValue: currentValue,\n options: [\n {\n value: 'right',\n text: () => 'right' as Platform.UIString.LocalizedString,\n title: () => 'Dock to right' as Platform.UIString.LocalizedString,\n raw: false,\n },\n {\n value: 'bottom',\n text: () => 'bottom' as Platform.UIString.LocalizedString,\n title: () => 'Dock to bottom' as Platform.UIString.LocalizedString,\n raw: false,\n },\n {\n value: 'left',\n text: () => 'left' as Platform.UIString.LocalizedString,\n title: () => 'Dock to left' as Platform.UIString.LocalizedString,\n raw: false,\n },\n {\n value: 'undocked',\n text: () => 'undocked' as Platform.UIString.LocalizedString,\n title: () => 'Undock' as Platform.UIString.LocalizedString,\n raw: false,\n },\n ],\n }]);\n Root.Runtime.experiments.clearForTest();\n await initializeGlobalVars({reset: false});\n}\n\ndescribe('DockController', () => {\n after(async () => {\n await deinitializeGlobalVars();\n });\n it('defaults the dockside to undefined when first created', async () => {\n /* Note: this seems like weird behaviour, but updating DockController to\n * explicitly set DockSide by default seems to cause issues in Chrome web\n * tests, so adding this test here to ensure we don't cause any problems.\n */\n await registerDockingSettings('left');\n const dockController = LegacyUI.DockController.DockController.instance({forceNew: true, canDock: true});\n assert.isUndefined(dockController.dockSide());\n });\n\n it('falls back to undefined if the setting value is unexpected', async () => {\n await registerDockingSettings('woah-not-a-real-setting-value');\n const dockController = LegacyUI.DockController.DockController.instance({forceNew: true, canDock: true});\n assert.isUndefined(dockController.dockSide());\n });\n\n it('sets the dockSide to undocked if the dock cannot be docked', async () => {\n await registerDockingSettings('left');\n const dockController = LegacyUI.DockController.DockController.instance({forceNew: true, canDock: false});\n assert.strictEqual(dockController.dockSide(), LegacyUI.DockController.DockState.UNDOCKED);\n });\n\n it('can toggle the dock between two settings', async () => {\n await registerDockingSettings('left');\n const dockController = LegacyUI.DockController.DockController.instance({forceNew: true, canDock: true});\n dockController.toggleDockSide();\n assert.strictEqual(dockController.dockSide(), LegacyUI.DockController.DockState.BOTTOM);\n dockController.toggleDockSide();\n assert.strictEqual(dockController.dockSide(), LegacyUI.DockController.DockState.LEFT);\n dockController.toggleDockSide();\n assert.strictEqual(dockController.dockSide(), LegacyUI.DockController.DockState.BOTTOM);\n });\n});\n"]} \ No newline at end of file diff --git a/public/ui/legacy/DropTarget.js b/public/ui/legacy/DropTarget.js index f89de647e..0e852817d 100644 --- a/public/ui/legacy/DropTarget.js +++ b/public/ui/legacy/DropTarget.js @@ -56,7 +56,7 @@ export class DropTarget { return; } this.dragMaskElement = this.element.createChild('div', ''); - const shadowRoot = createShadowRootWithCoreStyles(this.dragMaskElement, { cssFile: dropTargetStyles, delegatesFocus: undefined }); + const shadowRoot = createShadowRootWithCoreStyles(this.dragMaskElement, { cssFile: dropTargetStyles }); shadowRoot.createChild('div', 'drop-target-message').textContent = this.messageText; this.dragMaskElement.addEventListener('drop', this.onDrop.bind(this), true); this.dragMaskElement.addEventListener('dragleave', this.onDragLeave.bind(this), true); diff --git a/public/ui/legacy/DropTarget.js.map b/public/ui/legacy/DropTarget.js.map index cf3254c33..080379c85 100644 --- a/public/ui/legacy/DropTarget.js.map +++ b/public/ui/legacy/DropTarget.js.map @@ -1 +1 @@ -{"version":3,"file":"DropTarget.js","sourceRoot":"","sources":["../../../../../../front_end/ui/legacy/DropTarget.ts"],"names":[],"mappings":"AAAA,gEAAgE;AAChE,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,gBAAgB,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAC,8BAA8B,EAAC,MAAM,cAAc,CAAC;AAE5D,MAAM,OAAO,UAAU;IACb,OAAO,CAAU;IACR,aAAa,CAG1B;IACI,WAAW,CAAS;IACX,UAAU,CAA+B;IAClD,OAAO,CAAU;IACjB,eAAe,CAAe;IAEtC,YACI,OAAgB,EAAE,aAGf,EACH,WAAmB,EAAE,UAAwC;QAC/D,OAAO,CAAC,gBAAgB,CAAC,WAAW,EAAE,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,IAAI,CAAC,CAAC;QACzE,OAAO,CAAC,gBAAgB,CAAC,UAAU,EAAE,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,IAAI,CAAC,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AK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QACpB,IAAI,CAAC,UAAU,EAAE,CAAC;IACpB,CAAC;IAEO,UAAU;QAChB,IAAI,IAAI,CAAC,eAAe,EAAE,CAAC;YACzB,IAAI,CAAC,eAAe,CAAC,MAAM,EAAE,CAAC;YAC9B,IAAI,CAAC,eAAe,GAAG,IAAI,CAAC;QAC9B,CAAC;IACH,CAAC;CACF;AAED,MAAM,CAAC,MAAM,IAAI,GAAG;IAClB,GAAG,EAAE,EAAC,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,gBAAgB,EAAC;IAC7C,MAAM,EAAE,EAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAC;IAClC,IAAI,EAAE,EAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAC;IAChC,OAAO,EAAE,EAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAC;IACtC,SAAS,EAAE,EAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,WAAW,EAAC;CAC7C,CAAC","sourcesContent":["// Copyright (c) 2015 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport dropTargetStyles from './dropTarget.css.legacy.js';\nimport {createShadowRootWithCoreStyles} from './UIUtils.js';\n\nexport class DropTarget {\n private element: Element;\n private readonly transferTypes: {\n kind: string,\n type: RegExp,\n }[];\n private messageText: string;\n private readonly handleDrop: (arg0: DataTransfer) => void;\n private enabled: boolean;\n private dragMaskElement: Element|null;\n\n constructor(\n element: Element, transferTypes: {\n kind: string,\n type: RegExp,\n }[],\n messageText: string, handleDrop: (arg0: DataTransfer) => void) {\n element.addEventListener('dragenter', this.onDragEnter.bind(this), true);\n element.addEventListener('dragover', this.onDragOver.bind(this), true);\n this.element = element;\n this.transferTypes = transferTypes;\n this.messageText = messageText;\n this.handleDrop = handleDrop;\n this.enabled = true;\n this.dragMaskElement = null;\n }\n\n setEnabled(enabled: boolean): void {\n this.enabled = enabled;\n }\n\n private onDragEnter(event: Event): void {\n if (this.enabled && this.hasMatchingType(event)) {\n event.consume(true);\n }\n }\n\n private hasMatchingType(ev: Event): boolean {\n const event = (ev as DragEvent);\n if (!event.dataTransfer) {\n return false;\n }\n for (const transferType of this.transferTypes) {\n const found = Array.from(event.dataTransfer.items).find(item => {\n return transferType.kind === item.kind && Boolean(transferType.type.exec(item.type));\n });\n if (found) {\n return true;\n }\n }\n return false;\n }\n\n private onDragOver(ev: Event): void {\n const event = (ev as DragEvent);\n if (!this.enabled || !this.hasMatchingType(event)) {\n return;\n }\n if (event.dataTransfer) {\n event.dataTransfer.dropEffect = 'copy';\n }\n event.consume(true);\n if (this.dragMaskElement) {\n return;\n }\n this.dragMaskElement = this.element.createChild('div', '');\n const shadowRoot =\n createShadowRootWithCoreStyles(this.dragMaskElement, {cssFile: dropTargetStyles, delegatesFocus: undefined});\n shadowRoot.createChild('div', 'drop-target-message').textContent = this.messageText;\n this.dragMaskElement.addEventListener('drop', this.onDrop.bind(this), true);\n this.dragMaskElement.addEventListener('dragleave', this.onDragLeave.bind(this), true);\n }\n\n private onDrop(ev: Event): void {\n const event = (ev as DragEvent);\n event.consume(true);\n this.removeMask();\n if (this.enabled && event.dataTransfer) {\n this.handleDrop(event.dataTransfer);\n }\n }\n\n private onDragLeave(event: Event): void {\n event.consume(true);\n this.removeMask();\n }\n\n private removeMask(): void {\n if (this.dragMaskElement) {\n this.dragMaskElement.remove();\n this.dragMaskElement = null;\n }\n }\n}\n\nexport const Type = {\n URI: {kind: 'string', type: /text\\/uri-list/},\n Folder: {kind: 'file', type: /$^/},\n File: {kind: 'file', type: /.*/},\n WebFile: {kind: 'file', type: /[\\w]+/},\n ImageFile: {kind: 'file', type: /image\\/.*/},\n};\n"]} \ No newline at end of file +{"version":3,"file":"DropTarget.js","sourceRoot":"","sources":["../../../../../../front_end/ui/legacy/DropTarget.ts"],"names":[],"mappings":"AAAA,gEAA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ights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport dropTargetStyles from './dropTarget.css.legacy.js';\nimport {createShadowRootWithCoreStyles} from './UIUtils.js';\n\nexport class DropTarget {\n private element: Element;\n private readonly transferTypes: {\n kind: string,\n type: RegExp,\n }[];\n private messageText: string;\n private readonly handleDrop: (arg0: DataTransfer) => void;\n private enabled: boolean;\n private dragMaskElement: Element|null;\n\n constructor(\n element: Element, transferTypes: {\n kind: string,\n type: RegExp,\n }[],\n messageText: string, handleDrop: (arg0: DataTransfer) => void) {\n element.addEventListener('dragenter', this.onDragEnter.bind(this), true);\n element.addEventListener('dragover', this.onDragOver.bind(this), true);\n this.element = element;\n this.transferTypes = transferTypes;\n this.messageText = messageText;\n this.handleDrop = handleDrop;\n this.enabled = true;\n this.dragMaskElement = null;\n }\n\n setEnabled(enabled: boolean): void {\n this.enabled = enabled;\n }\n\n private onDragEnter(event: Event): void {\n if (this.enabled && this.hasMatchingType(event)) {\n event.consume(true);\n }\n }\n\n private hasMatchingType(ev: Event): boolean {\n const event = (ev as DragEvent);\n if (!event.dataTransfer) {\n return false;\n }\n for (const transferType of this.transferTypes) {\n const found = Array.from(event.dataTransfer.items).find(item => {\n return transferType.kind === item.kind && Boolean(transferType.type.exec(item.type));\n });\n if (found) {\n return true;\n }\n }\n return false;\n }\n\n private onDragOver(ev: Event): void {\n const event = (ev as DragEvent);\n if (!this.enabled || !this.hasMatchingType(event)) {\n return;\n }\n if (event.dataTransfer) {\n event.dataTransfer.dropEffect = 'copy';\n }\n event.consume(true);\n if (this.dragMaskElement) {\n return;\n }\n this.dragMaskElement = this.element.createChild('div', '');\n const shadowRoot = createShadowRootWithCoreStyles(this.dragMaskElement, {cssFile: dropTargetStyles});\n shadowRoot.createChild('div', 'drop-target-message').textContent = this.messageText;\n this.dragMaskElement.addEventListener('drop', this.onDrop.bind(this), true);\n this.dragMaskElement.addEventListener('dragleave', this.onDragLeave.bind(this), true);\n }\n\n private onDrop(ev: Event): void {\n const event = (ev as DragEvent);\n event.consume(true);\n this.removeMask();\n if (this.enabled && event.dataTransfer) {\n this.handleDrop(event.dataTransfer);\n }\n }\n\n private onDragLeave(event: Event): void {\n event.consume(true);\n this.removeMask();\n }\n\n private removeMask(): void {\n if (this.dragMaskElement) {\n this.dragMaskElement.remove();\n this.dragMaskElement = null;\n }\n }\n}\n\nexport const Type = {\n URI: {kind: 'string', type: /text\\/uri-list/},\n Folder: {kind: 'file', type: /$^/},\n File: {kind: 'file', type: /.*/},\n WebFile: {kind: 'file', type: /[\\w]+/},\n ImageFile: {kind: 'file', type: /image\\/.*/},\n};\n"]} \ No newline at end of file diff --git a/public/ui/legacy/EmptyWidget.js.map b/public/ui/legacy/EmptyWidget.js.map index f18663bd2..c1324efca 100644 --- a/public/ui/legacy/EmptyWidget.js.map +++ b/public/ui/legacy/EmptyWidget.js.map @@ -1 +1 @@ -{"version":3,"file":"EmptyWidget.js","sourceRoot":"","sources":["../../../../../../front_end/ui/legacy/EmptyWidget.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,OAAO,KAAK,IAAI,MAAM,yBAAyB,CAAC;AAEhD,OAAO,KAAK,aAAa,MAAM,qCAAqC,CAAC;AAErE,OAAO,iBAAiB,MAAM,6BAA6B,CAAC;AAC5D,OAAO,EAAC,IAAI,EAAC,MAAM,aAAa,CAAC;AACjC,OAAO,EAAC,KAAK,EAAC,MAAM,YAAY,CAAC;AAEjC,MAAM,SAAS,GAAG;IAChB;;OAEG;IACH,SAAS,EAAE,YAAY;CACxB,CAAC;AACF,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,iBAAiB,CAAC,0BAA0B,EAAE,SAAS,CAAC,CAAC;AAChF,MAAM,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC;AAEtE,MAAM,OAAO,WAAY,SAAQ,IAAI;IAC3B,WAAW,CAAc;IAEjC,YAAY,IAAY;QACtB,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,mBAAmB,CAAC,iBAAiB,CAAC,CAAC;QAC5C,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,GAAG,CAAC,qBAAqB,CAAC,CAAC;QAClD,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,KAAK,EAAE,YAAY,CAAmB,CAAC;QACtF,IAAI,CAAC,cAAc,CAAC,YAAY,CAAC,OAAO,EAAE,GAAG,aAAa,CAAC,OAAO,CAAC,YAAY,CAAC,EAAE,CAAC,CAAC;QACpF,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,cAAc,CAAC,WAAW,CAAC,KAAK,EAAE,iBAAiB,CAAC,CAAC;QAC7E,IAAI,CAAC,WAAW,CAAC,WAAW,GAAG,IAAI,CAAC;IACtC,CAAC;IAED,eAAe;QACb,OAAO,IAAI,CAAC,cAAc,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;IAC9C,CAAC;IAED,UAAU,CAAC,IAAqC;QAC9C,MAAM,aAAa,GAAG,KAAK,CAAC,MAAM,CAAC,IAAI,EAAE,UAAU,CAAC,SAAS,CAAC,SAAS,CAAC,EAAE,SAAS,EAAE,SAAS,EAAE,YAAY,CAAC,CAAC;QAC9G,OAAO,IAAI,CAAC,cAAc,CAAC,WAAW,CAAC,aAAa,CAAgB,CAAC;IACvE,CAAC;IAED,IAAI,IAAI,CAAC,IAAY;QACnB,IAAI,CAAC,WAAW,CAAC,WAAW,GAAG,IAAI,CAAC;IACtC,CAAC;CACF","sourcesContent":["/*\n * Copyright (C) 2011 Google Inc. All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are\n * met:\n *\n * * Redistributions of source code must retain the above copyright\n * notice, this list of conditions and the following disclaimer.\n * * Redistributions in binary form must reproduce the above\n * copyright notice, this list of conditions and the following disclaimer\n * in the documentation and/or other materials provided with the\n * distribution.\n * * Neither the name of Google Inc. nor the names of its\n * contributors may be used to endorse or promote products derived from\n * this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nimport * as i18n from '../../core/i18n/i18n.js';\nimport type * as Platform from '../../core/platform/platform.js';\nimport * as VisualLogging from '../visual_logging/visual_logging.js';\n\nimport emptyWidgetStyles from './emptyWidget.css.legacy.js';\nimport {VBox} from './Widget.js';\nimport {XLink} from './XLink.js';\n\nconst UIStrings = {\n /**\n *@description Text that is usually a hyperlink to more documentation\n */\n learnMore: 'Learn more',\n};\nconst str_ = i18n.i18n.registerUIStrings('ui/legacy/EmptyWidget.ts', UIStrings);\nconst i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);\n\nexport class EmptyWidget extends VBox {\n private textElement: HTMLElement;\n\n constructor(text: string) {\n super();\n this.registerRequiredCSS(emptyWidgetStyles);\n this.element.classList.add('empty-view-scroller');\n this.contentElement = this.element.createChild('div', 'empty-view') as HTMLDivElement;\n this.contentElement.setAttribute('jslog', `${VisualLogging.section('empty-view')}`);\n this.textElement = this.contentElement.createChild('div', 'empty-bold-text');\n this.textElement.textContent = text;\n }\n\n appendParagraph(): Element {\n return this.contentElement.createChild('p');\n }\n\n appendLink(link: Platform.DevToolsPath.UrlString): HTMLElement {\n const learnMoreLink = XLink.create(link, i18nString(UIStrings.learnMore), undefined, undefined, 'learn-more');\n return this.contentElement.appendChild(learnMoreLink) as HTMLElement;\n }\n\n set text(text: string) {\n this.textElement.textContent = text;\n }\n}\n"]} \ No newline at end of file +{"version":3,"file":"EmptyWidget.js","sourceRoot":"","sources":["../../../../../../front_end/ui/legacy/EmptyWidget.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,OAAO,KAAK,IAAI,MAAM,yBAAyB,CAAC;AAEhD,OAAO,KAAK,aAAa,MAAM,qCAAqC,CAAC;AAErE,OAAO,iBAAiB,MAAM,6BAA6B,CAAC;AAC5D,OAAO,EAAC,IAAI,EAAC,MAAM,aAAa,CAAC;AACjC,OAAO,EAAC,KAAK,EAAC,MAAM,YAAY,CAAC;AAEjC,MAAM,SAAS,GAAG;IAChB;;OAEG;IACH,SAAS,EAAE,YAAY;CACxB,CAAC;AACF,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,iBAAiB,CAAC,0BAA0B,EAAE,SAAS,CAAC,CAAC;AAChF,MAAM,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC;AAEtE,MAAM,OAAO,WAAY,SAAQ,IAAI;IAC3B,WAAW,CAAc;IAEjC,YAAY,IAAY;QACtB,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,mBAAmB,CAAC,iBAAiB,CAAC,CAAC;QAC5C,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,GAAG,CAAC,qBAAqB,CAAC,CAAC;QAClD,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,KAAK,EAAE,YAAY,CAAC,CAAC;QACpE,IAAI,CAAC,cAAc,CAAC,YAAY,CAAC,OAAO,EAAE,GAAG,aAAa,CAAC,OAAO,CAAC,YAAY,CAAC,EAAE,CAAC,CAAC;QACpF,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,cAAc,CAAC,WAAW,CAAC,KAAK,EAAE,iBAAiB,CAAC,CAAC;QAC7E,IAAI,CAAC,WAAW,CAAC,WAAW,GAAG,IAAI,CAAC;IACtC,CAAC;IAED,eAAe;QACb,OAAO,IAAI,CAAC,cAAc,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;IAC9C,CAAC;IAED,UAAU,CAAC,IAAqC;QAC9C,MAAM,aAAa,GAAG,KAAK,CAAC,MAAM,CAAC,IAAI,EAAE,UAAU,CAAC,SAAS,CAAC,SAAS,CAAC,EAAE,SAAS,EAAE,SAAS,EAAE,YAAY,CAAC,CAAC;QAC9G,OAAO,IAAI,CAAC,cAAc,CAAC,WAAW,CAAC,aAAa,CAAgB,CAAC;IACvE,CAAC;IAED,IAAI,IAAI,CAAC,IAAY;QACnB,IAAI,CAAC,WAAW,CAAC,WAAW,GAAG,IAAI,CAAC;IACtC,CAAC;CACF","sourcesContent":["/*\n * Copyright (C) 2011 Google Inc. All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are\n * met:\n *\n * * Redistributions of source code must retain the above copyright\n * notice, this list of conditions and the following disclaimer.\n * * Redistributions in binary form must reproduce the above\n * copyright notice, this list of conditions and the following disclaimer\n * in the documentation and/or other materials provided with the\n * distribution.\n * * Neither the name of Google Inc. nor the names of its\n * contributors may be used to endorse or promote products derived from\n * this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nimport * as i18n from '../../core/i18n/i18n.js';\nimport type * as Platform from '../../core/platform/platform.js';\nimport * as VisualLogging from '../visual_logging/visual_logging.js';\n\nimport emptyWidgetStyles from './emptyWidget.css.legacy.js';\nimport {VBox} from './Widget.js';\nimport {XLink} from './XLink.js';\n\nconst UIStrings = {\n /**\n *@description Text that is usually a hyperlink to more documentation\n */\n learnMore: 'Learn more',\n};\nconst str_ = i18n.i18n.registerUIStrings('ui/legacy/EmptyWidget.ts', UIStrings);\nconst i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);\n\nexport class EmptyWidget extends VBox {\n private textElement: HTMLElement;\n\n constructor(text: string) {\n super();\n this.registerRequiredCSS(emptyWidgetStyles);\n this.element.classList.add('empty-view-scroller');\n this.contentElement = this.element.createChild('div', 'empty-view');\n this.contentElement.setAttribute('jslog', `${VisualLogging.section('empty-view')}`);\n this.textElement = this.contentElement.createChild('div', 'empty-bold-text');\n this.textElement.textContent = text;\n }\n\n appendParagraph(): Element {\n return this.contentElement.createChild('p');\n }\n\n appendLink(link: Platform.DevToolsPath.UrlString): HTMLElement {\n const learnMoreLink = XLink.create(link, i18nString(UIStrings.learnMore), undefined, undefined, 'learn-more');\n return this.contentElement.appendChild(learnMoreLink) as HTMLElement;\n }\n\n set text(text: string) {\n this.textElement.textContent = text;\n }\n}\n"]} \ No newline at end of file diff --git a/public/ui/legacy/FilterBar.js.map b/public/ui/legacy/FilterBar.js.map index 506159b48..61b2c95fc 100644 --- a/public/ui/legacy/FilterBar.js.map +++ b/public/ui/legacy/FilterBar.js.map @@ -1 +1 @@ -{"version":3,"file":"FilterBar.js","sourceRoot":"","sources":["../../../../../../front_end/ui/legacy/FilterBar.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,OAAO,KAAK,MAAM,MAAM,6BAA6B,CAAC;AACtD,OAAO,KAAK,IAAI,MAAM,yBAAyB,CAAC;AAChD,OAAO,KAAK,IAAI,MAAM,yBAAyB,CAAC;AAChD,OAAO,KAAK,QAAQ,MAAM,iCAAiC,CAAC;AAC5D,OAAO,KAAK,aAAa,MAAM,2CAA2C,CAAC;AAE3E,OAAO,KAAK,SAAS,MAAM,gBAAgB,CAAC;AAC5C,OAAO,YAAY,MAAM,wBAAwB,CAAC;AAClD,OAAO,EAAC,gBAAgB,EAAE,SAAS,EAAC,MAAM,uBAAuB,CAAC;AAClE,OAAO,EAAC,YAAY,EAAC,MAAM,iBAAiB,CAAC;AAE7C,OAAO,KAAK,YAAY,MAAM,kCAAkC,CAAC;AACjE,OAAO,EAAC,OAAO,EAAsB,aAAa,EAAgB,oBAAoB,EAAC,MAAM,cAAc,CAAC;AAC5G,OAAO,EAAC,OAAO,EAAC,MAAM,cAAc,CAAC;AACrC,OAAO,EAAC,aAAa,EAAE,eAAe,EAAC,MAAM,cAAc,CAAC;AAC5D,OAAO,EAAC,IAAI,EAAC,MAAM,aAAa,CAAC;AAEjC,MAAM,SAAS,GAAG;IAChB;;OAEG;IACH,MAAM,EAAE,QAAQ;IAChB;;OAEG;I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AY,CAC7B,OAAO,EAAE,GAAG,aAAa,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,EAAC,MAAM,EAAE,IAAI,EAAC,CAAC,CAAC,OAAO,CAAC,YAAY,CAAC,EAAE,CAAC,CAAC;QACxF,CAAC;IACH,CAAC;IAED,QAAQ;QACN,OAAO,IAAI,CAAC,iBAAiB,KAAK,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC;IACjE,CAAC;IAED,OAAO;QACL,OAAO,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC;IACtC,CAAC;IAED,UAAU,CAAC,OAAgB;QACzB,IAAI,CAAC,eAAe,CAAC,OAAO,GAAG,OAAO,CAAC;IACzC,CAAC;IAED,OAAO;QACL,OAAO,IAAI,CAAC,aAAa,CAAC;IAC5B,CAAC;IAED,YAAY;QACV,OAAO,IAAI,CAAC,KAAK,CAAC;IACpB,CAAC;IAEO,WAAW;QACjB,IAAI,CAAC,wBAAwB,qDAA+B,CAAC;IAC/D,CAAC;CACF","sourcesContent":["/*\n * Copyright (C) 2013 Google Inc. All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are\n * met:\n *\n * * Redistributions of source code must retain the above copyright\n * notice, this list of conditions and the following disclaimer.\n * * Redistributions in binary form must reproduce the above\n * copyright notice, this list of conditions and the following disclaimer\n * in the documentation and/or other materials provided with the\n * distribution.\n * * Neither the name of Google Inc. nor the names of its\n * contributors may be used to endorse or promote products derived from\n * this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nimport * as Common from '../../core/common/common.js';\nimport * as Host from '../../core/host/host.js';\nimport * as i18n from '../../core/i18n/i18n.js';\nimport * as Platform from '../../core/platform/platform.js';\nimport * as VisualLogging from '../../ui/visual_logging/visual_logging.js';\n\nimport * as ARIAUtils from './ARIAUtils.js';\nimport filterStyles from './filter.css.legacy.js';\nimport {KeyboardShortcut, Modifiers} from './KeyboardShortcut.js';\nimport {bindCheckbox} from './SettingsUI.js';\nimport type {Suggestions} from './SuggestBox.js';\nimport * as ThemeSupport from './theme_support/theme_support.js';\nimport {Toolbar, type ToolbarButton, ToolbarFilter, ToolbarInput, ToolbarSettingToggle} from './Toolbar.js';\nimport {Tooltip} from './Tooltip.js';\nimport {CheckboxLabel, createTextChild} from './UIUtils.js';\nimport {HBox} from './Widget.js';\n\nconst UIStrings = {\n /**\n *@description Text to filter result items\n */\n filter: 'Filter',\n /**\n *@description Text that appears when hover over the filter bar in the Network tool\n */\n egSmalldUrlacomb: 'e.g. `/small[\\d]+/ url:a.com/b`',\n /**\n *@description Text that appears when hover over the All button in the Network tool\n *@example {Ctrl + } PH1\n */\n sclickToSelectMultipleTypes: '{PH1}Click to select multiple types',\n /**\n *@description Text for everything\n */\n allStrings: 'All',\n};\nconst str_ = i18n.i18n.registerUIStrings('ui/legacy/FilterBar.ts', UIStrings);\nconst i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);\nexport class FilterBar extends Common.ObjectWrapper.eventMixin(HBox) {\n private enabled: boolean;\n private readonly stateSetting: Common.Settings.Setting;\n private readonly filterButtonInternal: ToolbarSettingToggle;\n private filters: FilterUI[];\n private alwaysShowFilters?: boolean;\n private showingWidget?: boolean;\n\n constructor(name: string, visibleByDefault?: boolean) {\n super();\n this.registerRequiredCSS(filterStyles);\n this.enabled = true;\n this.element.classList.add('filter-bar');\n this.element.setAttribute('jslog', `${VisualLogging.toolbar('filter-bar')}`);\n\n this.stateSetting =\n Common.Settings.Settings.instance().createSetting('filter-bar-' + name + '-toggled', Boolean(visibleByDefault));\n this.filterButtonInternal =\n new ToolbarSettingToggle(this.stateSetting, 'filter', i18nString(UIStrings.filter), 'filter-filled', 'filter');\n this.filterButtonInternal.element.style.setProperty('--dot-toggle-top', '13px');\n this.filterButtonInternal.element.style.setProperty('--dot-toggle-left', '14px');\n\n this.filters = [];\n\n this.updateFilterBar();\n this.stateSetting.addChangeListener(this.updateFilterBar.bind(this));\n }\n\n filterButton(): ToolbarButton {\n return this.filterButtonInternal;\n }\n\n addDivider(): void {\n const element = document.createElement('div');\n element.classList.add('filter-divider');\n this.element.appendChild(element);\n }\n\n addFilter(filter: FilterUI): void {\n this.filters.push(filter);\n this.element.appendChild(filter.element());\n filter.addEventListener(FilterUIEvents.FILTER_CHANGED, this.filterChanged, this);\n this.updateFilterButton();\n }\n\n setEnabled(enabled: boolean): void {\n this.enabled = enabled;\n this.filterButtonInternal.setEnabled(enabled);\n this.updateFilterBar();\n }\n\n forceShowFilterBar(): void {\n this.alwaysShowFilters = true;\n this.updateFilterBar();\n }\n\n showOnce(): void {\n this.stateSetting.set(true);\n }\n\n private filterChanged(): void {\n this.updateFilterButton();\n this.dispatchEventToListeners(FilterBarEvents.CHANGED);\n }\n\n override wasShown(): void {\n super.wasShown();\n this.updateFilterBar();\n }\n\n private updateFilterBar(): void {\n if (!this.parentWidget() || this.showingWidget) {\n return;\n }\n if (this.visible()) {\n this.showingWidget = true;\n this.showWidget();\n this.showingWidget = false;\n } else {\n this.hideWidget();\n }\n }\n\n override focus(): void {\n for (let i = 0; i < this.filters.length; ++i) {\n if (this.filters[i] instanceof TextFilterUI) {\n const textFilterUI = (this.filters[i] as TextFilterUI);\n textFilterUI.focus();\n break;\n }\n }\n }\n\n hasActiveFilter(): boolean {\n for (const filter of this.filters) {\n if (filter.isActive()) {\n return true;\n }\n }\n return false;\n }\n\n private updateFilterButton(): void {\n const isActive = this.hasActiveFilter();\n this.filterButtonInternal.setChecked(isActive);\n }\n\n clear(): void {\n this.element.removeChildren();\n this.filters = [];\n this.updateFilterButton();\n }\n\n setting(): Common.Settings.Setting {\n return this.stateSetting;\n }\n\n visible(): boolean {\n return this.alwaysShowFilters || (this.stateSetting.get() && this.enabled);\n }\n}\n\nexport const enum FilterBarEvents {\n CHANGED = 'Changed',\n}\n\nexport type FilterBarEventTypes = {\n [FilterBarEvents.CHANGED]: void,\n};\n\nexport interface FilterUI extends Common.EventTarget.EventTarget {\n isActive(): boolean;\n element(): Element;\n}\n\nexport const enum FilterUIEvents {\n FILTER_CHANGED = 'FilterChanged',\n}\n\nexport type FilterUIEventTypes = {\n [FilterUIEvents.FILTER_CHANGED]: void,\n};\n\nexport class TextFilterUI extends Common.ObjectWrapper.ObjectWrapper implements FilterUI {\n private readonly filterElement: HTMLDivElement;\n #filter: ToolbarFilter;\n private suggestionProvider: ((arg0: string, arg1: string, arg2?: boolean|undefined) => Promise)|null;\n constructor() {\n super();\n this.filterElement = document.createElement('div');\n const filterToolbar = new Toolbar('text-filter', this.filterElement);\n // Set the style directly on the element to overwrite parent css styling.\n filterToolbar.element.style.borderBottom = 'none';\n this.#filter = new ToolbarFilter(undefined, 1, 1, UIStrings.egSmalldUrlacomb, this.completions.bind(this));\n filterToolbar.appendToolbarItem(this.#filter);\n this.#filter.addEventListener(ToolbarInput.Event.TEXT_CHANGED, () => this.valueChanged());\n this.suggestionProvider = null;\n }\n\n private completions(expression: string, prefix: string, force?: boolean): Promise {\n if (this.suggestionProvider) {\n return this.suggestionProvider(expression, prefix, force);\n }\n return Promise.resolve([]);\n }\n\n isActive(): boolean {\n return Boolean(this.#filter.valueWithoutSuggestion());\n }\n\n element(): Element {\n return this.filterElement;\n }\n\n value(): string {\n return this.#filter.valueWithoutSuggestion();\n }\n\n setValue(value: string): void {\n this.#filter.setValue(value);\n this.valueChanged();\n }\n\n focus(): void {\n this.#filter.focus();\n }\n\n setSuggestionProvider(\n suggestionProvider: (arg0: string, arg1: string, arg2?: boolean|undefined) => Promise): void {\n this.#filter.clearAutocomplete();\n this.suggestionProvider = suggestionProvider;\n }\n\n private valueChanged(): void {\n this.dispatchEventToListeners(FilterUIEvents.FILTER_CHANGED);\n }\n\n clear(): void {\n this.setValue('');\n }\n}\n\ninterface NamedBitSetFilterUIOptions {\n items: Item[];\n setting?: Common.Settings.Setting<{[key: string]: boolean}>;\n}\nexport class NamedBitSetFilterUIElement extends HTMLElement {\n #options: NamedBitSetFilterUIOptions = {items: []};\n readonly #shadow = this.attachShadow({mode: 'open'});\n #namedBitSetFilterUI?: NamedBitSetFilterUI;\n\n set options(options: NamedBitSetFilterUIOptions) {\n this.#options = options;\n }\n\n getOrCreateNamedBitSetFilterUI(): NamedBitSetFilterUI {\n if (this.#namedBitSetFilterUI) {\n return this.#namedBitSetFilterUI;\n }\n\n const namedBitSetFilterUI = new NamedBitSetFilterUI(this.#options.items, this.#options.setting);\n namedBitSetFilterUI.element().classList.add('named-bitset-filter');\n\n const disclosureElement = this.#shadow.createChild('div', 'named-bit-set-filter-disclosure');\n disclosureElement.appendChild(namedBitSetFilterUI.element());\n\n // Translate existing filter (\"ObjectWrapper\") events to DOM CustomEvents so clients can\n // use lit templates to bind listeners.\n namedBitSetFilterUI.addEventListener(FilterUIEvents.FILTER_CHANGED, this.#filterChanged.bind(this));\n\n this.#namedBitSetFilterUI = namedBitSetFilterUI;\n return this.#namedBitSetFilterUI;\n }\n\n connectedCallback(): void {\n ThemeSupport.ThemeSupport.instance().appendStyle(this.#shadow, filterStyles);\n }\n\n #filterChanged(): void {\n const domEvent = new CustomEvent('filterChanged');\n this.dispatchEvent(domEvent);\n }\n}\n\ncustomElements.define('devtools-named-bit-set-filter', NamedBitSetFilterUIElement);\n\nexport class NamedBitSetFilterUI extends Common.ObjectWrapper.ObjectWrapper implements FilterUI {\n private readonly filtersElement: HTMLDivElement;\n private readonly typeFilterElementTypeNames: WeakMap;\n private allowedTypes: Set;\n private readonly typeFilterElements: HTMLElement[];\n private readonly setting: Common.Settings.Setting<{[key: string]: boolean}>|undefined;\n\n constructor(items: Item[], setting?: Common.Settings.Setting<{[key: string]: boolean}>) {\n super();\n this.filtersElement = document.createElement('div');\n this.filtersElement.classList.add('filter-bitset-filter');\n this.filtersElement.setAttribute('jslog', `${VisualLogging.section('filter-bitset')}`);\n ARIAUtils.markAsListBox(this.filtersElement);\n ARIAUtils.markAsMultiSelectable(this.filtersElement);\n Tooltip.install(this.filtersElement, i18nString(UIStrings.sclickToSelectMultipleTypes, {\n PH1: KeyboardShortcut.shortcutToString('', Modifiers.CtrlOrMeta.value),\n }));\n\n this.typeFilterElementTypeNames = new WeakMap();\n this.allowedTypes = new Set();\n this.typeFilterElements = [];\n this.addBit(NamedBitSetFilterUI.ALL_TYPES, i18nString(UIStrings.allStrings));\n this.typeFilterElements[0].tabIndex = 0;\n this.filtersElement.createChild('div', 'filter-bitset-filter-divider');\n\n for (let i = 0; i < items.length; ++i) {\n this.addBit(items[i].name, items[i].label(), items[i].title);\n }\n\n if (setting) {\n this.setting = setting;\n setting.addChangeListener(this.settingChanged.bind(this));\n this.settingChanged();\n } else {\n this.toggleTypeFilter(NamedBitSetFilterUI.ALL_TYPES, false /* allowMultiSelect */);\n }\n }\n\n reset(): void {\n this.toggleTypeFilter(NamedBitSetFilterUI.ALL_TYPES, false /* allowMultiSelect */);\n }\n\n isActive(): boolean {\n return !this.allowedTypes.has(NamedBitSetFilterUI.ALL_TYPES);\n }\n\n element(): Element {\n return this.filtersElement;\n }\n\n accept(typeName: string): boolean {\n return this.allowedTypes.has(NamedBitSetFilterUI.ALL_TYPES) || this.allowedTypes.has(typeName);\n }\n\n private settingChanged(): void {\n const allowedTypesFromSetting = (this.setting as Common.Settings.Setting<{[key: string]: boolean}>).get();\n this.allowedTypes = new Set();\n for (const element of this.typeFilterElements) {\n const typeName = this.typeFilterElementTypeNames.get(element);\n if (typeName && allowedTypesFromSetting[typeName]) {\n this.allowedTypes.add(typeName);\n }\n }\n this.update();\n }\n\n private update(): void {\n if (this.allowedTypes.size === 0 || this.allowedTypes.has(NamedBitSetFilterUI.ALL_TYPES)) {\n this.allowedTypes = new Set();\n this.allowedTypes.add(NamedBitSetFilterUI.ALL_TYPES);\n }\n for (const element of this.typeFilterElements) {\n const typeName = this.typeFilterElementTypeNames.get(element);\n const active = this.allowedTypes.has(typeName || '');\n element.classList.toggle('selected', active);\n ARIAUtils.setSelected(element, active);\n }\n this.dispatchEventToListeners(FilterUIEvents.FILTER_CHANGED);\n }\n\n private addBit(name: string, label: string, title?: string): void {\n const typeFilterElement = (this.filtersElement.createChild('span', name) as HTMLElement);\n typeFilterElement.tabIndex = -1;\n this.typeFilterElementTypeNames.set(typeFilterElement, name);\n createTextChild(typeFilterElement, label);\n ARIAUtils.markAsOption(typeFilterElement);\n if (title) {\n typeFilterElement.title = title;\n }\n typeFilterElement.addEventListener('click', this.onTypeFilterClicked.bind(this), false);\n typeFilterElement.addEventListener('keydown', this.onTypeFilterKeydown.bind(this), false);\n typeFilterElement.setAttribute('jslog', `${VisualLogging.item(name).track({click: true})}`);\n this.typeFilterElements.push(typeFilterElement);\n }\n\n private onTypeFilterClicked(event: Event): void {\n const e = (event as KeyboardEvent);\n let toggle;\n if (Host.Platform.isMac()) {\n toggle = e.metaKey && !e.ctrlKey && !e.altKey && !e.shiftKey;\n } else {\n toggle = e.ctrlKey && !e.metaKey && !e.altKey && !e.shiftKey;\n }\n if (e.target) {\n const element = (e.target as HTMLElement);\n const typeName = (this.typeFilterElementTypeNames.get(element) as string);\n this.toggleTypeFilter(typeName, toggle);\n }\n }\n\n private onTypeFilterKeydown(ev: Event): void {\n const event = (ev as KeyboardEvent);\n const element = (event.target as HTMLElement | null);\n if (!element) {\n return;\n }\n\n if (event.key === 'ArrowLeft' || event.key === 'ArrowUp') {\n if (this.keyFocusNextBit(element, true /* selectPrevious */)) {\n event.consume(true);\n }\n } else if (event.key === 'ArrowRight' || event.key === 'ArrowDown') {\n if (this.keyFocusNextBit(element, false /* selectPrevious */)) {\n event.consume(true);\n }\n } else if (Platform.KeyboardUtilities.isEnterOrSpaceKey(event)) {\n this.onTypeFilterClicked(event);\n }\n }\n\n private keyFocusNextBit(target: HTMLElement, selectPrevious: boolean): boolean {\n const index = this.typeFilterElements.indexOf(target);\n if (index === -1) {\n return false;\n }\n const nextIndex = selectPrevious ? index - 1 : index + 1;\n if (nextIndex < 0 || nextIndex >= this.typeFilterElements.length) {\n return false;\n }\n\n const nextElement = this.typeFilterElements[nextIndex];\n nextElement.tabIndex = 0;\n target.tabIndex = -1;\n nextElement.focus();\n return true;\n }\n\n private toggleTypeFilter(typeName: string, allowMultiSelect: boolean): void {\n if (allowMultiSelect && typeName !== NamedBitSetFilterUI.ALL_TYPES) {\n this.allowedTypes.delete(NamedBitSetFilterUI.ALL_TYPES);\n } else {\n this.allowedTypes = new Set();\n }\n\n if (this.allowedTypes.has(typeName)) {\n this.allowedTypes.delete(typeName);\n } else {\n this.allowedTypes.add(typeName);\n }\n\n if (this.allowedTypes.size === 0) {\n this.allowedTypes.add(NamedBitSetFilterUI.ALL_TYPES);\n }\n\n if (this.setting) {\n // Settings do not support `Sets` so convert it back to the Map-like object.\n const updatedSetting = ({} as {[key: string]: boolean});\n for (const type of this.allowedTypes) {\n updatedSetting[type] = true;\n }\n this.setting.set(updatedSetting);\n } else {\n this.update();\n }\n }\n\n static readonly ALL_TYPES = 'all';\n}\n\nexport class CheckboxFilterUI extends Common.ObjectWrapper.ObjectWrapper implements FilterUI {\n private readonly filterElement: HTMLDivElement;\n private readonly activeWhenChecked: boolean;\n private label: CheckboxLabel;\n private checkboxElement: HTMLInputElement;\n constructor(\n className: string, title: Common.UIString.LocalizedString, activeWhenChecked?: boolean,\n setting?: Common.Settings.Setting, jslogContext?: string) {\n super();\n this.filterElement = document.createElement('div');\n this.filterElement.classList.add('filter-checkbox-filter');\n this.activeWhenChecked = Boolean(activeWhenChecked);\n this.label = CheckboxLabel.create(title);\n this.filterElement.appendChild(this.label);\n this.checkboxElement = this.label.checkboxElement;\n if (setting) {\n bindCheckbox(this.checkboxElement, setting);\n } else {\n this.checkboxElement.checked = true;\n }\n this.checkboxElement.addEventListener('change', this.fireUpdated.bind(this), false);\n if (jslogContext) {\n this.checkboxElement.setAttribute(\n 'jslog', `${VisualLogging.toggle().track({change: true}).context(jslogContext)}`);\n }\n }\n\n isActive(): boolean {\n return this.activeWhenChecked === this.checkboxElement.checked;\n }\n\n checked(): boolean {\n return this.checkboxElement.checked;\n }\n\n setChecked(checked: boolean): void {\n this.checkboxElement.checked = checked;\n }\n\n element(): HTMLDivElement {\n return this.filterElement;\n }\n\n labelElement(): Element {\n return this.label;\n }\n\n private fireUpdated(): void {\n this.dispatchEventToListeners(FilterUIEvents.FILTER_CHANGED);\n }\n}\n\nexport interface Item {\n name: string;\n label: () => string;\n title?: string;\n jslogContext: string;\n}\n"]} \ No newline at end of file +{"version":3,"file":"FilterBar.js","sourceRoot":"","sources":["../../../../../../front_end/ui/legacy/FilterBar.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,OAAO,KAAK,MAAM,MAAM,6BAA6B,CAAC;AACtD,OAAO,KAAK,IAAI,MAAM,yBAAyB,CAAC;AAChD,OAAO,KAAK,IAAI,MAAM,yBAAyB,CAAC;AAChD,OAAO,KAAK,QAAQ,MAAM,iCAAiC,CAAC;AAC5D,OAAO,KAAK,aAAa,MAAM,2CAA2C,CAAC;AAE3E,OAAO,KAAK,SA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,CAAC,KAAK,CAAC,CAAC;QACzC,IAAI,CAAC,aAAa,CAAC,WAAW,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAC3C,IAAI,CAAC,eAAe,GAAG,IAAI,CAAC,KAAK,CAAC,eAAe,CAAC;QAClD,IAAI,OAAO,EAAE,CAAC;YACZ,YAAY,CAAC,IAAI,CAAC,eAAe,EAAE,OAAO,CAAC,CAAC;QAC9C,CAAC;aAAM,CAAC;YACN,IAAI,CAAC,eAAe,CAAC,OAAO,GAAG,IAAI,CAAC;QACtC,CAAC;QACD,IAAI,CAAC,eAAe,CAAC,gBAAgB,CAAC,QAAQ,EAAE,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,KAAK,CAAC,CAAC;QACpF,IAAI,YAAY,EAAE,CAAC;YACjB,IAAI,CAAC,eAAe,CAAC,YAAY,CAC7B,OAAO,EAAE,GAAG,aAAa,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,EAAC,MAAM,EAAE,IAAI,EAAC,CAAC,CAAC,OAAO,CAAC,YAAY,CAAC,EAAE,CAAC,CAAC;QACxF,CAAC;IACH,CAAC;IAED,QAAQ;QACN,OAAO,IAAI,CAAC,iBAAiB,KAAK,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC;IACjE,CAAC;IAED,OAAO;QACL,OAAO,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC;IACtC,CAAC;IAED,UAAU,CAAC,OAAgB;QACzB,IAAI,CAAC,eAAe,CAAC,OAAO,GAAG,OAAO,CAAC;IACzC,CAAC;IAED,OAAO;QACL,OAAO,IAAI,CAAC,aAAa,CAAC;IAC5B,CAAC;IAED,YAAY;QACV,OAAO,IAAI,CAAC,KAAK,CAAC;IACpB,CAAC;IAEO,WAAW;QACjB,IAAI,CAAC,wBAAwB,qDAA+B,CAAC;IAC/D,CAAC;CACF","sourcesContent":["/*\n * Copyright (C) 2013 Google Inc. All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are\n * met:\n *\n * * Redistributions of source code must retain the above copyright\n * notice, this list of conditions and the following disclaimer.\n * * Redistributions in binary form must reproduce the above\n * copyright notice, this list of conditions and the following disclaimer\n * in the documentation and/or other materials provided with the\n * distribution.\n * * Neither the name of Google Inc. nor the names of its\n * contributors may be used to endorse or promote products derived from\n * this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nimport * as Common from '../../core/common/common.js';\nimport * as Host from '../../core/host/host.js';\nimport * as i18n from '../../core/i18n/i18n.js';\nimport * as Platform from '../../core/platform/platform.js';\nimport * as VisualLogging from '../../ui/visual_logging/visual_logging.js';\n\nimport * as ARIAUtils from './ARIAUtils.js';\nimport filterStyles from './filter.css.legacy.js';\nimport {KeyboardShortcut, Modifiers} from './KeyboardShortcut.js';\nimport {bindCheckbox} from './SettingsUI.js';\nimport type {Suggestions} from './SuggestBox.js';\nimport * as ThemeSupport from './theme_support/theme_support.js';\nimport {Toolbar, type ToolbarButton, ToolbarFilter, ToolbarInput, ToolbarSettingToggle} from './Toolbar.js';\nimport {Tooltip} from './Tooltip.js';\nimport {CheckboxLabel, createTextChild} from './UIUtils.js';\nimport {HBox} from './Widget.js';\n\nconst UIStrings = {\n /**\n *@description Text to filter result items\n */\n filter: 'Filter',\n /**\n *@description Text that appears when hover over the filter bar in the Network tool\n */\n egSmalldUrlacomb: 'e.g. `/small[\\d]+/ url:a.com/b`',\n /**\n *@description Text that appears when hover over the All button in the Network tool\n *@example {Ctrl + } PH1\n */\n sclickToSelectMultipleTypes: '{PH1}Click to select multiple types',\n /**\n *@description Text for everything\n */\n allStrings: 'All',\n};\nconst str_ = i18n.i18n.registerUIStrings('ui/legacy/FilterBar.ts', UIStrings);\nconst i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);\nexport class FilterBar extends Common.ObjectWrapper.eventMixin(HBox) {\n private enabled: boolean;\n private readonly stateSetting: Common.Settings.Setting;\n private readonly filterButtonInternal: ToolbarSettingToggle;\n private filters: FilterUI[];\n private alwaysShowFilters?: boolean;\n private showingWidget?: boolean;\n\n constructor(name: string, visibleByDefault?: boolean) {\n super();\n this.registerRequiredCSS(filterStyles);\n this.enabled = true;\n this.element.classList.add('filter-bar');\n this.element.setAttribute('jslog', `${VisualLogging.toolbar('filter-bar')}`);\n\n this.stateSetting =\n Common.Settings.Settings.instance().createSetting('filter-bar-' + name + '-toggled', Boolean(visibleByDefault));\n this.filterButtonInternal =\n new ToolbarSettingToggle(this.stateSetting, 'filter', i18nString(UIStrings.filter), 'filter-filled', 'filter');\n this.filterButtonInternal.element.style.setProperty('--dot-toggle-top', '13px');\n this.filterButtonInternal.element.style.setProperty('--dot-toggle-left', '14px');\n\n this.filters = [];\n\n this.updateFilterBar();\n this.stateSetting.addChangeListener(this.updateFilterBar.bind(this));\n }\n\n filterButton(): ToolbarButton {\n return this.filterButtonInternal;\n }\n\n addDivider(): void {\n const element = document.createElement('div');\n element.classList.add('filter-divider');\n this.element.appendChild(element);\n }\n\n addFilter(filter: FilterUI): void {\n this.filters.push(filter);\n this.element.appendChild(filter.element());\n filter.addEventListener(FilterUIEvents.FILTER_CHANGED, this.filterChanged, this);\n this.updateFilterButton();\n }\n\n setEnabled(enabled: boolean): void {\n this.enabled = enabled;\n this.filterButtonInternal.setEnabled(enabled);\n this.updateFilterBar();\n }\n\n forceShowFilterBar(): void {\n this.alwaysShowFilters = true;\n this.updateFilterBar();\n }\n\n showOnce(): void {\n this.stateSetting.set(true);\n }\n\n private filterChanged(): void {\n this.updateFilterButton();\n this.dispatchEventToListeners(FilterBarEvents.CHANGED);\n }\n\n override wasShown(): void {\n super.wasShown();\n this.updateFilterBar();\n }\n\n private updateFilterBar(): void {\n if (!this.parentWidget() || this.showingWidget) {\n return;\n }\n if (this.visible()) {\n this.showingWidget = true;\n this.showWidget();\n this.showingWidget = false;\n } else {\n this.hideWidget();\n }\n }\n\n override focus(): void {\n for (let i = 0; i < this.filters.length; ++i) {\n if (this.filters[i] instanceof TextFilterUI) {\n const textFilterUI = (this.filters[i] as TextFilterUI);\n textFilterUI.focus();\n break;\n }\n }\n }\n\n hasActiveFilter(): boolean {\n for (const filter of this.filters) {\n if (filter.isActive()) {\n return true;\n }\n }\n return false;\n }\n\n private updateFilterButton(): void {\n const isActive = this.hasActiveFilter();\n this.filterButtonInternal.setChecked(isActive);\n }\n\n clear(): void {\n this.element.removeChildren();\n this.filters = [];\n this.updateFilterButton();\n }\n\n setting(): Common.Settings.Setting {\n return this.stateSetting;\n }\n\n visible(): boolean {\n return this.alwaysShowFilters || (this.stateSetting.get() && this.enabled);\n }\n}\n\nexport const enum FilterBarEvents {\n CHANGED = 'Changed',\n}\n\nexport type FilterBarEventTypes = {\n [FilterBarEvents.CHANGED]: void,\n};\n\nexport interface FilterUI extends Common.EventTarget.EventTarget {\n isActive(): boolean;\n element(): Element;\n}\n\nexport const enum FilterUIEvents {\n FILTER_CHANGED = 'FilterChanged',\n}\n\nexport type FilterUIEventTypes = {\n [FilterUIEvents.FILTER_CHANGED]: void,\n};\n\nexport class TextFilterUI extends Common.ObjectWrapper.ObjectWrapper implements FilterUI {\n private readonly filterElement: HTMLDivElement;\n #filter: ToolbarFilter;\n private suggestionProvider: ((arg0: string, arg1: string, arg2?: boolean|undefined) => Promise)|null;\n constructor() {\n super();\n this.filterElement = document.createElement('div');\n const filterToolbar = new Toolbar('text-filter', this.filterElement);\n // Set the style directly on the element to overwrite parent css styling.\n filterToolbar.element.style.borderBottom = 'none';\n this.#filter = new ToolbarFilter(undefined, 1, 1, UIStrings.egSmalldUrlacomb, this.completions.bind(this));\n filterToolbar.appendToolbarItem(this.#filter);\n this.#filter.addEventListener(ToolbarInput.Event.TEXT_CHANGED, () => this.valueChanged());\n this.suggestionProvider = null;\n }\n\n private completions(expression: string, prefix: string, force?: boolean): Promise {\n if (this.suggestionProvider) {\n return this.suggestionProvider(expression, prefix, force);\n }\n return Promise.resolve([]);\n }\n\n isActive(): boolean {\n return Boolean(this.#filter.valueWithoutSuggestion());\n }\n\n element(): Element {\n return this.filterElement;\n }\n\n value(): string {\n return this.#filter.valueWithoutSuggestion();\n }\n\n setValue(value: string): void {\n this.#filter.setValue(value);\n this.valueChanged();\n }\n\n focus(): void {\n this.#filter.focus();\n }\n\n setSuggestionProvider(\n suggestionProvider: (arg0: string, arg1: string, arg2?: boolean|undefined) => Promise): void {\n this.#filter.clearAutocomplete();\n this.suggestionProvider = suggestionProvider;\n }\n\n private valueChanged(): void {\n this.dispatchEventToListeners(FilterUIEvents.FILTER_CHANGED);\n }\n\n clear(): void {\n this.setValue('');\n }\n}\n\ninterface NamedBitSetFilterUIOptions {\n items: Item[];\n setting?: Common.Settings.Setting<{[key: string]: boolean}>;\n}\nexport class NamedBitSetFilterUIElement extends HTMLElement {\n #options: NamedBitSetFilterUIOptions = {items: []};\n readonly #shadow = this.attachShadow({mode: 'open'});\n #namedBitSetFilterUI?: NamedBitSetFilterUI;\n\n set options(options: NamedBitSetFilterUIOptions) {\n this.#options = options;\n }\n\n getOrCreateNamedBitSetFilterUI(): NamedBitSetFilterUI {\n if (this.#namedBitSetFilterUI) {\n return this.#namedBitSetFilterUI;\n }\n\n const namedBitSetFilterUI = new NamedBitSetFilterUI(this.#options.items, this.#options.setting);\n namedBitSetFilterUI.element().classList.add('named-bitset-filter');\n\n const disclosureElement = this.#shadow.createChild('div', 'named-bit-set-filter-disclosure');\n disclosureElement.appendChild(namedBitSetFilterUI.element());\n\n // Translate existing filter (\"ObjectWrapper\") events to DOM CustomEvents so clients can\n // use lit templates to bind listeners.\n namedBitSetFilterUI.addEventListener(FilterUIEvents.FILTER_CHANGED, this.#filterChanged.bind(this));\n\n this.#namedBitSetFilterUI = namedBitSetFilterUI;\n return this.#namedBitSetFilterUI;\n }\n\n connectedCallback(): void {\n ThemeSupport.ThemeSupport.instance().appendStyle(this.#shadow, filterStyles);\n }\n\n #filterChanged(): void {\n const domEvent = new CustomEvent('filterChanged');\n this.dispatchEvent(domEvent);\n }\n}\n\ncustomElements.define('devtools-named-bit-set-filter', NamedBitSetFilterUIElement);\n\nexport class NamedBitSetFilterUI extends Common.ObjectWrapper.ObjectWrapper implements FilterUI {\n private readonly filtersElement: HTMLDivElement;\n private readonly typeFilterElementTypeNames: WeakMap;\n private allowedTypes: Set;\n private readonly typeFilterElements: HTMLElement[];\n private readonly setting: Common.Settings.Setting<{[key: string]: boolean}>|undefined;\n\n constructor(items: Item[], setting?: Common.Settings.Setting<{[key: string]: boolean}>) {\n super();\n this.filtersElement = document.createElement('div');\n this.filtersElement.classList.add('filter-bitset-filter');\n this.filtersElement.setAttribute('jslog', `${VisualLogging.section('filter-bitset')}`);\n ARIAUtils.markAsListBox(this.filtersElement);\n ARIAUtils.markAsMultiSelectable(this.filtersElement);\n Tooltip.install(this.filtersElement, i18nString(UIStrings.sclickToSelectMultipleTypes, {\n PH1: KeyboardShortcut.shortcutToString('', Modifiers.CtrlOrMeta.value),\n }));\n\n this.typeFilterElementTypeNames = new WeakMap();\n this.allowedTypes = new Set();\n this.typeFilterElements = [];\n this.addBit(NamedBitSetFilterUI.ALL_TYPES, i18nString(UIStrings.allStrings));\n this.typeFilterElements[0].tabIndex = 0;\n this.filtersElement.createChild('div', 'filter-bitset-filter-divider');\n\n for (let i = 0; i < items.length; ++i) {\n this.addBit(items[i].name, items[i].label(), items[i].title);\n }\n\n if (setting) {\n this.setting = setting;\n setting.addChangeListener(this.settingChanged.bind(this));\n this.settingChanged();\n } else {\n this.toggleTypeFilter(NamedBitSetFilterUI.ALL_TYPES, false /* allowMultiSelect */);\n }\n }\n\n reset(): void {\n this.toggleTypeFilter(NamedBitSetFilterUI.ALL_TYPES, false /* allowMultiSelect */);\n }\n\n isActive(): boolean {\n return !this.allowedTypes.has(NamedBitSetFilterUI.ALL_TYPES);\n }\n\n element(): Element {\n return this.filtersElement;\n }\n\n accept(typeName: string): boolean {\n return this.allowedTypes.has(NamedBitSetFilterUI.ALL_TYPES) || this.allowedTypes.has(typeName);\n }\n\n private settingChanged(): void {\n const allowedTypesFromSetting = (this.setting as Common.Settings.Setting<{[key: string]: boolean}>).get();\n this.allowedTypes = new Set();\n for (const element of this.typeFilterElements) {\n const typeName = this.typeFilterElementTypeNames.get(element);\n if (typeName && allowedTypesFromSetting[typeName]) {\n this.allowedTypes.add(typeName);\n }\n }\n this.update();\n }\n\n private update(): void {\n if (this.allowedTypes.size === 0 || this.allowedTypes.has(NamedBitSetFilterUI.ALL_TYPES)) {\n this.allowedTypes = new Set();\n this.allowedTypes.add(NamedBitSetFilterUI.ALL_TYPES);\n }\n for (const element of this.typeFilterElements) {\n const typeName = this.typeFilterElementTypeNames.get(element);\n const active = this.allowedTypes.has(typeName || '');\n element.classList.toggle('selected', active);\n ARIAUtils.setSelected(element, active);\n }\n this.dispatchEventToListeners(FilterUIEvents.FILTER_CHANGED);\n }\n\n private addBit(name: string, label: string, title?: string): void {\n const typeFilterElement = this.filtersElement.createChild('span', name);\n typeFilterElement.tabIndex = -1;\n this.typeFilterElementTypeNames.set(typeFilterElement, name);\n createTextChild(typeFilterElement, label);\n ARIAUtils.markAsOption(typeFilterElement);\n if (title) {\n typeFilterElement.title = title;\n }\n typeFilterElement.addEventListener('click', this.onTypeFilterClicked.bind(this), false);\n typeFilterElement.addEventListener('keydown', this.onTypeFilterKeydown.bind(this), false);\n typeFilterElement.setAttribute('jslog', `${VisualLogging.item(name).track({click: true})}`);\n this.typeFilterElements.push(typeFilterElement);\n }\n\n private onTypeFilterClicked(event: Event): void {\n const e = (event as KeyboardEvent);\n let toggle;\n if (Host.Platform.isMac()) {\n toggle = e.metaKey && !e.ctrlKey && !e.altKey && !e.shiftKey;\n } else {\n toggle = e.ctrlKey && !e.metaKey && !e.altKey && !e.shiftKey;\n }\n if (e.target) {\n const element = (e.target as HTMLElement);\n const typeName = (this.typeFilterElementTypeNames.get(element) as string);\n this.toggleTypeFilter(typeName, toggle);\n }\n }\n\n private onTypeFilterKeydown(ev: Event): void {\n const event = (ev as KeyboardEvent);\n const element = (event.target as HTMLElement | null);\n if (!element) {\n return;\n }\n\n if (event.key === 'ArrowLeft' || event.key === 'ArrowUp') {\n if (this.keyFocusNextBit(element, true /* selectPrevious */)) {\n event.consume(true);\n }\n } else if (event.key === 'ArrowRight' || event.key === 'ArrowDown') {\n if (this.keyFocusNextBit(element, false /* selectPrevious */)) {\n event.consume(true);\n }\n } else if (Platform.KeyboardUtilities.isEnterOrSpaceKey(event)) {\n this.onTypeFilterClicked(event);\n }\n }\n\n private keyFocusNextBit(target: HTMLElement, selectPrevious: boolean): boolean {\n const index = this.typeFilterElements.indexOf(target);\n if (index === -1) {\n return false;\n }\n const nextIndex = selectPrevious ? index - 1 : index + 1;\n if (nextIndex < 0 || nextIndex >= this.typeFilterElements.length) {\n return false;\n }\n\n const nextElement = this.typeFilterElements[nextIndex];\n nextElement.tabIndex = 0;\n target.tabIndex = -1;\n nextElement.focus();\n return true;\n }\n\n private toggleTypeFilter(typeName: string, allowMultiSelect: boolean): void {\n if (allowMultiSelect && typeName !== NamedBitSetFilterUI.ALL_TYPES) {\n this.allowedTypes.delete(NamedBitSetFilterUI.ALL_TYPES);\n } else {\n this.allowedTypes = new Set();\n }\n\n if (this.allowedTypes.has(typeName)) {\n this.allowedTypes.delete(typeName);\n } else {\n this.allowedTypes.add(typeName);\n }\n\n if (this.allowedTypes.size === 0) {\n this.allowedTypes.add(NamedBitSetFilterUI.ALL_TYPES);\n }\n\n if (this.setting) {\n // Settings do not support `Sets` so convert it back to the Map-like object.\n const updatedSetting = ({} as {[key: string]: boolean});\n for (const type of this.allowedTypes) {\n updatedSetting[type] = true;\n }\n this.setting.set(updatedSetting);\n } else {\n this.update();\n }\n }\n\n static readonly ALL_TYPES = 'all';\n}\n\nexport class CheckboxFilterUI extends Common.ObjectWrapper.ObjectWrapper implements FilterUI {\n private readonly filterElement: HTMLDivElement;\n private readonly activeWhenChecked: boolean;\n private label: CheckboxLabel;\n private checkboxElement: HTMLInputElement;\n constructor(\n className: string, title: Common.UIString.LocalizedString, activeWhenChecked?: boolean,\n setting?: Common.Settings.Setting, jslogContext?: string) {\n super();\n this.filterElement = document.createElement('div');\n this.filterElement.classList.add('filter-checkbox-filter');\n this.activeWhenChecked = Boolean(activeWhenChecked);\n this.label = CheckboxLabel.create(title);\n this.filterElement.appendChild(this.label);\n this.checkboxElement = this.label.checkboxElement;\n if (setting) {\n bindCheckbox(this.checkboxElement, setting);\n } else {\n this.checkboxElement.checked = true;\n }\n this.checkboxElement.addEventListener('change', this.fireUpdated.bind(this), false);\n if (jslogContext) {\n this.checkboxElement.setAttribute(\n 'jslog', `${VisualLogging.toggle().track({change: true}).context(jslogContext)}`);\n }\n }\n\n isActive(): boolean {\n return this.activeWhenChecked === this.checkboxElement.checked;\n }\n\n checked(): boolean {\n return this.checkboxElement.checked;\n }\n\n setChecked(checked: boolean): void {\n this.checkboxElement.checked = checked;\n }\n\n element(): HTMLDivElement {\n return this.filterElement;\n }\n\n labelElement(): Element {\n return this.label;\n }\n\n private fireUpdated(): void {\n this.dispatchEventToListeners(FilterUIEvents.FILTER_CHANGED);\n }\n}\n\nexport interface Item {\n name: string;\n label: () => string;\n title?: string;\n jslogContext: string;\n}\n"]} \ No newline at end of file diff --git a/public/ui/legacy/Infobar.js b/public/ui/legacy/Infobar.js index a1a978866..28a152e9b 100644 --- a/public/ui/legacy/Infobar.js +++ b/public/ui/legacy/Infobar.js @@ -55,7 +55,7 @@ export class Infobar { this.element.setAttribute('jslog', `${VisualLogging.dialog(jslogContext).track({ resize: true, keydown: 'Enter|Escape' })}`); } this.element.classList.add('flex-none'); - this.shadowRoot = createShadowRootWithCoreStyles(this.element, { cssFile: infobarStyles, delegatesFocus: undefined }); + this.shadowRoot = createShadowRootWithCoreStyles(this.element, { cssFile: infobarStyles }); this.contentElement = this.shadowRoot.createChild('div', 'infobar infobar-' + type); this.mainRow = this.contentElement.createChild('div', 'infobar-main-row'); this.detailsRows = this.contentElement.createChild('div', 'infobar-details-rows hidden'); @@ -99,10 +99,8 @@ export class Infobar { this.toggleElement = createTextButton(i18nString(UIStrings.showMore), this.onToggleDetails.bind(this), { className: 'hidden show-more', jslogContext: 'show-more', variant: "text" /* Buttons.Button.Variant.TEXT */ }); this.toggleElement.setAttribute('role', 'link'); this.closeContainer.appendChild(this.toggleElement); - this.closeButton = this.closeContainer.createChild('div', 'close-button', 'dt-close-button'); + this.closeButton = this.closeContainer.createChild('dt-close-button', 'close-button'); this.closeButton.hidden = !isCloseable; - // @ts-ignore This is a custom element defined in UIUitls.js that has a `setTabbable` that TS doesn't - // know about. this.closeButton.setTabbable(true); ARIAUtils.setDescription(this.closeButton, i18nString(UIStrings.close)); self.onInvokeElement(this.closeButton, this.dispose.bind(this)); diff --git a/public/ui/legacy/Infobar.js.map b/public/ui/legacy/Infobar.js.map index bfc1a1cc9..4bd789887 100644 --- a/public/ui/legacy/Infobar.js.map +++ b/public/ui/legacy/Infobar.js.map @@ -1 +1 @@ -{"version":3,"file":"Infobar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Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport type * as Common from '../../core/common/common.js';\nimport * as i18n from '../../core/i18n/i18n.js';\nimport * as Buttons from '../../ui/components/buttons/buttons.js';\nimport * as VisualLogging from '../../ui/visual_logging/visual_logging.js';\n\nimport * as ARIAUtils from './ARIAUtils.js';\nimport infobarStyles from './infobar.css.legacy.js';\nimport {Keys} from './KeyboardShortcut.js';\nimport {createShadowRootWithCoreStyles, createTextButton} from './UIUtils.js';\nimport type {Widget} from './Widget.js';\n\nconst UIStrings = {\n /**\n *@description Text on a button to close the infobar and never show the infobar in the future\n */\n dontShowAgain: 'Don\\'t show again',\n /**\n *@description Text that indicates that a short message can be expanded to a detailed message\n */\n showMore: 'Show more',\n /**\n *@description Text to close something\n */\n close: 'Close',\n};\nconst str_ = i18n.i18n.registerUIStrings('ui/legacy/Infobar.ts', UIStrings);\nconst i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);\n\nexport class Infobar {\n element: HTMLElement;\n private readonly shadowRoot: ShadowRoot;\n private readonly contentElement: HTMLDivElement;\n private readonly mainRow: HTMLElement;\n private readonly detailsRows: HTMLElement;\n private hasDetails: boolean;\n private detailsMessage: string|Element;\n private readonly infoContainer: HTMLElement;\n private readonly infoMessage: HTMLElement;\n private infoText: HTMLElement;\n private readonly actionContainer: HTMLElement;\n // TODO(crbug.com/1172300) Ignored during the jsdoc to ts migration\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n private readonly disableSetting: Common.Settings.Setting|null;\n private readonly closeContainer: HTMLElement;\n private readonly toggleElement: Buttons.Button.Button;\n private readonly closeButton: HTMLElement;\n private closeCallback: (() => void)|null;\n #firstFocusableElement: HTMLElement|null = null;\n private parentView?: Widget;\n\n constructor(\n // TODO(crbug.com/1172300) Ignored during the jsdoc to ts migration\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n type: Type, text: string, actions?: InfobarAction[], disableSetting?: Common.Settings.Setting,\n /* TODO(crbug.com/1354548) Remove with JS Profiler deprecation */ isCloseable: boolean = true,\n jslogContext?: string) {\n this.element = document.createElement('div');\n if (jslogContext) {\n this.element.setAttribute(\n 'jslog', `${VisualLogging.dialog(jslogContext).track({resize: true, keydown: 'Enter|Escape'})}`);\n }\n this.element.classList.add('flex-none');\n this.shadowRoot = createShadowRootWithCoreStyles(this.element, {cssFile: infobarStyles, delegatesFocus: undefined});\n\n this.contentElement = this.shadowRoot.createChild('div', 'infobar infobar-' + type) as HTMLDivElement;\n\n this.mainRow = this.contentElement.createChild('div', 'infobar-main-row');\n this.detailsRows = this.contentElement.createChild('div', 'infobar-details-rows hidden');\n this.hasDetails = false;\n this.detailsMessage = '';\n\n this.infoContainer = this.mainRow.createChild('div', 'infobar-info-container');\n\n this.infoMessage = this.infoContainer.createChild('div', 'infobar-info-message');\n\n // Icon is in separate file and included via CSS.\n this.infoMessage.createChild('div', type + '-icon icon');\n\n this.infoText = this.infoMessage.createChild('div', 'infobar-info-text');\n this.infoText.textContent = text;\n ARIAUtils.markAsAlert(this.infoText);\n\n this.actionContainer = this.infoContainer.createChild('div', 'infobar-info-actions');\n if (actions) {\n this.contentElement.setAttribute('role', 'group');\n\n for (const action of actions) {\n const actionCallback = this.actionCallbackFactory(action);\n let buttonClass = 'infobar-button';\n if (action.highlight) {\n buttonClass += ' primary-button';\n }\n\n const buttonVariant = action.buttonVariant ?? Buttons.Button.Variant.OUTLINED;\n\n const button = createTextButton(action.text, actionCallback, {\n className: buttonClass,\n jslogContext: action.jslogContext,\n variant: buttonVariant,\n icon: action.icon,\n });\n if (action.highlight && !this.#firstFocusableElement) {\n this.#firstFocusableElement = button;\n }\n this.actionContainer.appendChild(button);\n }\n }\n\n this.disableSetting = disableSetting || null;\n if (disableSetting) {\n const disableButton = createTextButton(\n i18nString(UIStrings.dontShowAgain), this.onDisable.bind(this), {className: 'infobar-button'});\n this.actionContainer.appendChild(disableButton);\n }\n\n this.closeContainer = this.mainRow.createChild('div', 'infobar-close-container');\n this.toggleElement = createTextButton(\n i18nString(UIStrings.showMore), this.onToggleDetails.bind(this),\n {className: 'hidden show-more', jslogContext: 'show-more', variant: Buttons.Button.Variant.TEXT});\n this.toggleElement.setAttribute('role', 'link');\n this.closeContainer.appendChild(this.toggleElement);\n this.closeButton = this.closeContainer.createChild('div', 'close-button', 'dt-close-button');\n this.closeButton.hidden = !isCloseable;\n // @ts-ignore This is a custom element defined in UIUitls.js that has a `setTabbable` that TS doesn't\n // know about.\n this.closeButton.setTabbable(true);\n ARIAUtils.setDescription(this.closeButton, i18nString(UIStrings.close));\n self.onInvokeElement(this.closeButton, this.dispose.bind(this));\n\n if (type !== Type.ISSUE) {\n this.contentElement.tabIndex = 0;\n }\n ARIAUtils.setLabel(this.contentElement, text);\n this.contentElement.addEventListener('keydown', event => {\n if (event.keyCode === Keys.Esc.code) {\n this.dispose();\n event.consume();\n return;\n }\n\n if (event.target !== this.contentElement) {\n return;\n }\n\n if (event.key === 'Enter' && this.hasDetails) {\n this.onToggleDetails();\n event.consume();\n return;\n }\n });\n\n this.closeCallback = null;\n }\n\n static create(\n // TODO(crbug.com/1172300) Ignored during the jsdoc to ts migration\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n type: Type, text: string, actions?: InfobarAction[], disableSetting?: Common.Settings.Setting,\n jslogContext?: string): Infobar|null {\n if (disableSetting && disableSetting.get()) {\n return null;\n }\n return new Infobar(type, text, actions, disableSetting, undefined, jslogContext);\n }\n\n dispose(): void {\n this.element.remove();\n this.onResize();\n if (this.closeCallback) {\n this.closeCallback.call(null);\n }\n }\n\n setText(text: string): void {\n this.infoText.textContent = text;\n this.onResize();\n }\n\n setCloseCallback(callback: (() => void)|null): void {\n this.closeCallback = callback;\n }\n\n setParentView(parentView: Widget): void {\n this.parentView = parentView;\n }\n\n private actionCallbackFactory(action: InfobarAction): () => void {\n if (!action.delegate) {\n return action.dismiss ? this.dispose.bind(this) : (): void => {};\n }\n\n if (!action.dismiss) {\n return action.delegate;\n }\n\n return ((): void => {\n if (action.delegate) {\n action.delegate();\n }\n this.dispose();\n }).bind(this);\n }\n\n private onResize(): void {\n if (this.parentView) {\n this.parentView.doResize();\n }\n }\n\n private onDisable(): void {\n if (this.disableSetting) {\n this.disableSetting.set(true);\n }\n this.dispose();\n }\n\n private onToggleDetails(): void {\n this.detailsRows.classList.remove('hidden');\n this.toggleElement.remove();\n this.onResize();\n ARIAUtils.alert(\n typeof this.detailsMessage === 'string' ? this.detailsMessage : this.detailsMessage.textContent || '');\n if (this.#firstFocusableElement) {\n this.#firstFocusableElement.focus();\n } else {\n this.closeButton.focus();\n }\n }\n\n createDetailsRowMessage(message: Element|string): Element {\n this.hasDetails = true;\n this.detailsMessage = message;\n this.toggleElement.classList.remove('hidden');\n const infobarDetailsRow = this.detailsRows.createChild('div', 'infobar-details-row');\n const detailsRowMessage = infobarDetailsRow.createChild('span', 'infobar-row-message');\n if (typeof message === 'string') {\n detailsRowMessage.textContent = message;\n } else {\n detailsRowMessage.appendChild(message);\n }\n return detailsRowMessage;\n }\n}\nexport interface InfobarAction {\n text: string;\n highlight: boolean;\n delegate: (() => void)|null;\n dismiss: boolean;\n buttonVariant?: Buttons.Button.Variant;\n icon?: string;\n jslogContext?: string;\n}\n\nexport const enum Type {\n WARNING = 'warning',\n INFO = 'info',\n ISSUE = 'issue',\n ERROR = 'error',\n}\n"]} \ No newline at end of file +{"version":3,"file":"Infobar.js","sourceRoot":"","sources":["../../../../../../front_end/ui/legacy/Infobar.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAG7B,OAAO,KAAK,IAAI,MAAM,yBAAyB,CAAC;AAChD,OAAO,KAAK,OAAO,MAAM,wCAAwC,CAAC;AAClE,OAAO,KAAK,aAAa,MAAM,2CAA2C,CAAC;AAE3E,OAAO,KAAK,SAAS,MAAM,gBAAgB,CAAC;AAC5C,OAAO,aAAa,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAC,IAAI,EAAC,MAA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3G,IAAI,IAAI,CAAC,sBAAsB,EAAE,CAAC;YAChC,IAAI,CAAC,sBAAsB,CAAC,KAAK,EAAE,CAAC;QACtC,CAAC;aAAM,CAAC;YACN,IAAI,CAAC,WAAW,CAAC,KAAK,EAAE,CAAC;QAC3B,CAAC;IACH,CAAC;IAED,uBAAuB,CAAC,OAAuB;QAC7C,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC;QACvB,IAAI,CAAC,cAAc,GAAG,OAAO,CAAC;QAC9B,IAAI,CAAC,aAAa,CAAC,SAAS,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;QAC9C,MAAM,iBAAiB,GAAG,IAAI,CAAC,WAAW,CAAC,WAAW,CAAC,KAAK,EAAE,qBAAqB,CAAC,CAAC;QACrF,MAAM,iBAAiB,GAAG,iBAAiB,CAAC,WAAW,CAAC,MAAM,EAAE,qBAAqB,CAAC,CAAC;QACvF,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE,CAAC;YAChC,iBAAiB,CAAC,WAAW,GAAG,OAAO,CAAC;QAC1C,CAAC;aAAM,CAAC;YACN,iBAAiB,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;QACzC,CAAC;QACD,OAAO,iBAAiB,CAAC;IAC3B,CAAC;CACF","sourcesContent":["// Copyright 2015 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport type * as Common from '../../core/common/common.js';\nimport * as i18n from '../../core/i18n/i18n.js';\nimport * as Buttons from '../../ui/components/buttons/buttons.js';\nimport * as VisualLogging from '../../ui/visual_logging/visual_logging.js';\n\nimport * as ARIAUtils from './ARIAUtils.js';\nimport infobarStyles from './infobar.css.legacy.js';\nimport {Keys} from './KeyboardShortcut.js';\nimport {createShadowRootWithCoreStyles, createTextButton, type DevToolsCloseButton} from './UIUtils.js';\nimport type {Widget} from './Widget.js';\n\nconst UIStrings = {\n /**\n *@description Text on a button to close the infobar and never show the infobar in the future\n */\n dontShowAgain: 'Don\\'t show again',\n /**\n *@description Text that indicates that a short message can be expanded to a detailed message\n */\n showMore: 'Show more',\n /**\n *@description Text to close something\n */\n close: 'Close',\n};\nconst str_ = i18n.i18n.registerUIStrings('ui/legacy/Infobar.ts', UIStrings);\nconst i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);\n\nexport class Infobar {\n element: HTMLElement;\n private readonly shadowRoot: ShadowRoot;\n private readonly contentElement: HTMLDivElement;\n private readonly mainRow: HTMLElement;\n private readonly detailsRows: HTMLElement;\n private hasDetails: boolean;\n private detailsMessage: string|Element;\n private readonly infoContainer: HTMLElement;\n private readonly infoMessage: HTMLElement;\n private infoText: HTMLElement;\n private readonly actionContainer: HTMLElement;\n // TODO(crbug.com/1172300) Ignored during the jsdoc to ts migration\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n private readonly disableSetting: Common.Settings.Setting|null;\n private readonly closeContainer: HTMLElement;\n private readonly toggleElement: Buttons.Button.Button;\n private readonly closeButton: DevToolsCloseButton;\n private closeCallback: (() => void)|null;\n #firstFocusableElement: HTMLElement|null = null;\n private parentView?: Widget;\n\n constructor(\n // TODO(crbug.com/1172300) Ignored during the jsdoc to ts migration\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n type: Type, text: string, actions?: InfobarAction[], disableSetting?: Common.Settings.Setting,\n /* TODO(crbug.com/1354548) Remove with JS Profiler deprecation */ isCloseable: boolean = true,\n jslogContext?: string) {\n this.element = document.createElement('div');\n if (jslogContext) {\n this.element.setAttribute(\n 'jslog', `${VisualLogging.dialog(jslogContext).track({resize: true, keydown: 'Enter|Escape'})}`);\n }\n this.element.classList.add('flex-none');\n this.shadowRoot = createShadowRootWithCoreStyles(this.element, {cssFile: infobarStyles});\n\n this.contentElement = this.shadowRoot.createChild('div', 'infobar infobar-' + type);\n\n this.mainRow = this.contentElement.createChild('div', 'infobar-main-row');\n this.detailsRows = this.contentElement.createChild('div', 'infobar-details-rows hidden');\n this.hasDetails = false;\n this.detailsMessage = '';\n\n this.infoContainer = this.mainRow.createChild('div', 'infobar-info-container');\n\n this.infoMessage = this.infoContainer.createChild('div', 'infobar-info-message');\n\n // Icon is in separate file and included via CSS.\n this.infoMessage.createChild('div', type + '-icon icon');\n\n this.infoText = this.infoMessage.createChild('div', 'infobar-info-text');\n this.infoText.textContent = text;\n ARIAUtils.markAsAlert(this.infoText);\n\n this.actionContainer = this.infoContainer.createChild('div', 'infobar-info-actions');\n if (actions) {\n this.contentElement.setAttribute('role', 'group');\n\n for (const action of actions) {\n const actionCallback = this.actionCallbackFactory(action);\n let buttonClass = 'infobar-button';\n if (action.highlight) {\n buttonClass += ' primary-button';\n }\n\n const buttonVariant = action.buttonVariant ?? Buttons.Button.Variant.OUTLINED;\n\n const button = createTextButton(action.text, actionCallback, {\n className: buttonClass,\n jslogContext: action.jslogContext,\n variant: buttonVariant,\n icon: action.icon,\n });\n if (action.highlight && !this.#firstFocusableElement) {\n this.#firstFocusableElement = button;\n }\n this.actionContainer.appendChild(button);\n }\n }\n\n this.disableSetting = disableSetting || null;\n if (disableSetting) {\n const disableButton = createTextButton(\n i18nString(UIStrings.dontShowAgain), this.onDisable.bind(this), {className: 'infobar-button'});\n this.actionContainer.appendChild(disableButton);\n }\n\n this.closeContainer = this.mainRow.createChild('div', 'infobar-close-container');\n this.toggleElement = createTextButton(\n i18nString(UIStrings.showMore), this.onToggleDetails.bind(this),\n {className: 'hidden show-more', jslogContext: 'show-more', variant: Buttons.Button.Variant.TEXT});\n this.toggleElement.setAttribute('role', 'link');\n this.closeContainer.appendChild(this.toggleElement);\n this.closeButton = this.closeContainer.createChild('dt-close-button', 'close-button');\n this.closeButton.hidden = !isCloseable;\n this.closeButton.setTabbable(true);\n ARIAUtils.setDescription(this.closeButton, i18nString(UIStrings.close));\n self.onInvokeElement(this.closeButton, this.dispose.bind(this));\n\n if (type !== Type.ISSUE) {\n this.contentElement.tabIndex = 0;\n }\n ARIAUtils.setLabel(this.contentElement, text);\n this.contentElement.addEventListener('keydown', event => {\n if (event.keyCode === Keys.Esc.code) {\n this.dispose();\n event.consume();\n return;\n }\n\n if (event.target !== this.contentElement) {\n return;\n }\n\n if (event.key === 'Enter' && this.hasDetails) {\n this.onToggleDetails();\n event.consume();\n return;\n }\n });\n\n this.closeCallback = null;\n }\n\n static create(\n // TODO(crbug.com/1172300) Ignored during the jsdoc to ts migration\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n type: Type, text: string, actions?: InfobarAction[], disableSetting?: Common.Settings.Setting,\n jslogContext?: string): Infobar|null {\n if (disableSetting && disableSetting.get()) {\n return null;\n }\n return new Infobar(type, text, actions, disableSetting, undefined, jslogContext);\n }\n\n dispose(): void {\n this.element.remove();\n this.onResize();\n if (this.closeCallback) {\n this.closeCallback.call(null);\n }\n }\n\n setText(text: string): void {\n this.infoText.textContent = text;\n this.onResize();\n }\n\n setCloseCallback(callback: (() => void)|null): void {\n this.closeCallback = callback;\n }\n\n setParentView(parentView: Widget): void {\n this.parentView = parentView;\n }\n\n private actionCallbackFactory(action: InfobarAction): () => void {\n if (!action.delegate) {\n return action.dismiss ? this.dispose.bind(this) : (): void => {};\n }\n\n if (!action.dismiss) {\n return action.delegate;\n }\n\n return ((): void => {\n if (action.delegate) {\n action.delegate();\n }\n this.dispose();\n }).bind(this);\n }\n\n private onResize(): void {\n if (this.parentView) {\n this.parentView.doResize();\n }\n }\n\n private onDisable(): void {\n if (this.disableSetting) {\n this.disableSetting.set(true);\n }\n this.dispose();\n }\n\n private onToggleDetails(): void {\n this.detailsRows.classList.remove('hidden');\n this.toggleElement.remove();\n this.onResize();\n ARIAUtils.alert(\n typeof this.detailsMessage === 'string' ? this.detailsMessage : this.detailsMessage.textContent || '');\n if (this.#firstFocusableElement) {\n this.#firstFocusableElement.focus();\n } else {\n this.closeButton.focus();\n }\n }\n\n createDetailsRowMessage(message: Element|string): Element {\n this.hasDetails = true;\n this.detailsMessage = message;\n this.toggleElement.classList.remove('hidden');\n const infobarDetailsRow = this.detailsRows.createChild('div', 'infobar-details-row');\n const detailsRowMessage = infobarDetailsRow.createChild('span', 'infobar-row-message');\n if (typeof message === 'string') {\n detailsRowMessage.textContent = message;\n } else {\n detailsRowMessage.appendChild(message);\n }\n return detailsRowMessage;\n }\n}\nexport interface InfobarAction {\n text: string;\n highlight: boolean;\n delegate: (() => void)|null;\n dismiss: boolean;\n buttonVariant?: Buttons.Button.Variant;\n icon?: string;\n jslogContext?: string;\n}\n\nexport const enum Type {\n WARNING = 'warning',\n INFO = 'info',\n ISSUE = 'issue',\n ERROR = 'error',\n}\n"]} \ No newline at end of file diff --git a/public/ui/legacy/ListWidget.js.map b/public/ui/legacy/ListWidget.js.map index a4982fe86..abda3f220 100644 --- a/public/ui/legacy/ListWidget.js.map +++ b/public/ui/legacy/ListWidget.js.map @@ -1 +1 @@ -{"version":3,"file":"ListWidget.js","sourceRoot":"","sources":["../../../../../../front_end/ui/legacy/ListWidget.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,KAAK,IAAI,MAAM,yBAAyB,CAAC;AAChD,OAAO,KAAK,QAAQ,MAAM,iCAAiC,CAAC;AAC5D,OAAO,KAAK,OAAO,MAAM,wCAAwC,CAAC;AAClE,OAAO,KAAK,aAAa,MAAM,qCAAqC,CAAC;AAErE,OAAO,KAAK,SAAS,MAAM,gBAAgB,CAAC;AAC5C,OAAO,gBAAgB,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAC,OAAO,EAAE,aAAa,EAAC,MAAM,cAAc,CAAC;AACpD,OAAO,EAAC,OAAO,EAAC,MAAM,cAAc,CAAC;AACrC,OAAO,EAAC,WAAW,EAAE,gBAAgB,EAAE,oBAAoB,EAAC,MAAM,cAAc,CAAC;AACjF,OAAO,EAAC,IAAI,EAAC,MAAM,aAAa,CAAC;AAEjC,MAAM,SAAS,GAAG;IAChB;;OAEG;IACH,UAAU,EAAE,MAAM;IAClB;;OAEG;IACH,YAAY,EAAE,QAAQ;IACtB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,CAAC,KAAK,CAAC,CAAC;QAC3C,IAAI,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC;YACzB,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC;QAC3B,CAAC;QACD,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAC;IAC9B,CAAC;IAEO,aAAa;QACnB,IAAI,IAAI,CAAC,YAAY,CAAC,QAAQ,EAAE,CAAC;YAC/B,OAAO;QACT,CAAC;QAED,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;QAC3B,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC;QACnB,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC;QACnB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC;QAChB,IAAI,MAAM,EAAE,CAAC;YACX,MAAM,EAAE,CAAC;QACX,CAAC;IACH,CAAC;IAEO,aAAa;QACnB,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;QAC3B,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC;QACnB,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC;QACnB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC;QAChB,IAAI,MAAM,EAAE,CAAC;YACX,MAAM,EAAE,CAAC;QACX,CAAC;IACH,CAAC;CACF","sourcesContent":["// Copyright 2015 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport * as i18n from '../../core/i18n/i18n.js';\nimport * as Platform from '../../core/platform/platform.js';\nimport * as Buttons from '../../ui/components/buttons/buttons.js';\nimport * as VisualLogging from '../visual_logging/visual_logging.js';\n\nimport * as ARIAUtils from './ARIAUtils.js';\nimport listWidgetStyles from './listWidget.css.legacy.js';\nimport {Toolbar, ToolbarButton} from './Toolbar.js';\nimport {Tooltip} from './Tooltip.js';\nimport {createInput, createTextButton, ElementFocusRestorer} from './UIUtils.js';\nimport {VBox} from './Widget.js';\n\nconst UIStrings = {\n /**\n *@description Text on a button to start editing text\n */\n editString: 'Edit',\n /**\n *@description Label for an item to remove something\n */\n removeString: 'Remove',\n /**\n *@description Text to save something\n */\n saveString: 'Save',\n /**\n *@description Text to add something\n */\n addString: 'Add',\n /**\n *@description Text to cancel something\n */\n cancelString: 'Cancel',\n /**\n * @description Text for screen reader to announce that an item has been saved.\n */\n changesSaved: 'Changes to item have been saved',\n /**\n * @description Text for screen reader to announce that an item has been removed.\n */\n removedItem: 'Item has been removed',\n};\nconst str_ = i18n.i18n.registerUIStrings('ui/legacy/ListWidget.ts', UIStrings);\nconst i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);\n\nexport class ListWidget extends VBox {\n private delegate: Delegate;\n private readonly list: HTMLElement;\n private lastSeparator: boolean;\n private focusRestorer: ElementFocusRestorer|null;\n private items: T[];\n private editable: boolean[];\n private elements: Element[];\n private editor: Editor|null;\n private editItem: T|null;\n private editElement: Element|null;\n private emptyPlaceholder: Element|null;\n private isTable: boolean;\n constructor(delegate: Delegate, delegatesFocus: boolean|undefined = true, isTable: boolean = false) {\n super(true, delegatesFocus);\n this.registerRequiredCSS(listWidgetStyles);\n this.delegate = delegate;\n\n this.list = this.contentElement.createChild('div', 'list');\n\n this.lastSeparator = false;\n this.focusRestorer = null;\n this.items = [];\n this.editable = [];\n this.elements = [];\n this.editor = null;\n this.editItem = null;\n this.editElement = null;\n\n this.emptyPlaceholder = null;\n\n this.isTable = isTable;\n if (isTable) {\n this.list.role = 'table';\n }\n\n this.updatePlaceholder();\n }\n\n clear(): void {\n this.items = [];\n this.editable = [];\n this.elements = [];\n this.lastSeparator = false;\n this.list.removeChildren();\n this.updatePlaceholder();\n this.stopEditing();\n }\n\n appendItem(item: T, editable: boolean): void {\n if (this.lastSeparator && this.items.length) {\n const element = document.createElement('div');\n element.classList.add('list-separator');\n if (this.isTable) {\n element.role = 'rowgroup';\n }\n this.list.appendChild(element);\n }\n this.lastSeparator = false;\n\n this.items.push(item);\n this.editable.push(editable);\n\n const element = this.list.createChild('div', 'list-item');\n if (this.isTable) {\n element.role = 'rowgroup';\n }\n const content = this.delegate.renderItem(item, editable);\n if (!content.hasAttribute('jslog')) {\n element.setAttribute('jslog', `${VisualLogging.item()}`);\n }\n element.appendChild(content);\n if (editable) {\n element.classList.add('editable');\n element.tabIndex = 0;\n element.appendChild(this.createControls(item, element));\n }\n this.elements.push(element);\n this.updatePlaceholder();\n }\n\n appendSeparator(): void {\n this.lastSeparator = true;\n }\n\n removeItem(index: number): void {\n if (this.editItem === this.items[index]) {\n this.stopEditing();\n }\n\n const element = this.elements[index];\n\n const previous = element.previousElementSibling;\n const previousIsSeparator = previous && previous.classList.contains('list-separator');\n\n const next = element.nextElementSibling;\n const nextIsSeparator = next && next.classList.contains('list-separator');\n\n if (previousIsSeparator && (nextIsSeparator || !next)) {\n (previous as Element).remove();\n }\n if (nextIsSeparator && !previous) {\n (next as Element).remove();\n }\n element.remove();\n\n this.elements.splice(index, 1);\n this.items.splice(index, 1);\n this.editable.splice(index, 1);\n this.updatePlaceholder();\n }\n\n addNewItem(index: number, item: T): void {\n this.startEditing(item, null, this.elements[index] || null);\n }\n\n setEmptyPlaceholder(element: Element|null): void {\n this.emptyPlaceholder = element;\n this.updatePlaceholder();\n }\n\n private createControls(item: T, element: Element): Element {\n const controls = document.createElement('div');\n controls.classList.add('controls-container');\n controls.classList.add('fill');\n controls.createChild('div', 'controls-gradient');\n\n const buttons = controls.createChild('div', 'controls-buttons');\n\n const toolbar = new Toolbar('', buttons);\n\n const editButton = new ToolbarButton(i18nString(UIStrings.editString), 'edit', undefined, 'edit-item');\n editButton.addEventListener(ToolbarButton.Events.CLICK, onEditClicked.bind(this));\n toolbar.appendToolbarItem(editButton);\n\n const removeButton = new ToolbarButton(i18nString(UIStrings.removeString), 'bin', undefined, 'remove-item');\n removeButton.addEventListener(ToolbarButton.Events.CLICK, onRemoveClicked.bind(this));\n toolbar.appendToolbarItem(removeButton);\n\n return controls;\n\n function onEditClicked(this: ListWidget): void {\n const index = this.elements.indexOf(element);\n const insertionPoint = this.elements[index + 1] || null;\n this.startEditing(item, element, insertionPoint);\n }\n\n function onRemoveClicked(this: ListWidget): void {\n const index = this.elements.indexOf(element);\n this.element.focus();\n this.delegate.removeItemRequested(this.items[index], index);\n ARIAUtils.alert(i18nString(UIStrings.removedItem));\n if (this.elements.length >= 1) {\n // focus on the next item in the list, or the last item if we're removing the last item\n (this.elements[Math.min(index, this.elements.length - 1)] as HTMLElement).focus();\n }\n }\n }\n\n override wasShown(): void {\n super.wasShown();\n this.stopEditing();\n }\n\n private updatePlaceholder(): void {\n if (!this.emptyPlaceholder) {\n return;\n }\n\n if (!this.elements.length && !this.editor) {\n this.list.appendChild(this.emptyPlaceholder);\n } else {\n this.emptyPlaceholder.remove();\n }\n }\n\n private startEditing(item: T, element: Element|null, insertionPoint: Element|null): void {\n if (element && this.editElement === element) {\n return;\n }\n\n this.stopEditing();\n this.focusRestorer = new ElementFocusRestorer(this.element);\n\n this.list.classList.add('list-editing');\n this.element.classList.add('list-editing');\n this.editItem = item;\n this.editElement = element;\n if (element) {\n element.classList.add('hidden');\n }\n\n const index = element ? this.elements.indexOf(element) : -1;\n this.editor = this.delegate.beginEdit(item);\n this.updatePlaceholder();\n this.list.insertBefore(this.editor.element, insertionPoint);\n this.editor.beginEdit(\n item, index, element ? i18nString(UIStrings.saveString) : i18nString(UIStrings.addString),\n this.commitEditing.bind(this), this.stopEditing.bind(this));\n }\n\n private commitEditing(): void {\n const editItem = this.editItem;\n const isNew = !this.editElement;\n const editor = (this.editor as Editor);\n // Focus on the current item or the new item after committing\n const focusElementIndex = this.editElement ? this.elements.indexOf(this.editElement) : this.elements.length - 1;\n this.stopEditing();\n if (editItem !== null) {\n this.delegate.commitEdit(editItem, editor, isNew);\n ARIAUtils.alert(i18nString(UIStrings.changesSaved));\n if (this.elements[focusElementIndex]) {\n (this.elements[focusElementIndex] as HTMLElement).focus();\n }\n }\n }\n\n private stopEditing(): void {\n this.list.classList.remove('list-editing');\n this.element.classList.remove('list-editing');\n if (this.focusRestorer) {\n this.focusRestorer.restore();\n }\n if (this.editElement) {\n this.editElement.classList.remove('hidden');\n }\n if (this.editor && this.editor.element.parentElement) {\n this.editor.element.remove();\n }\n\n this.editor = null;\n this.editItem = null;\n this.editElement = null;\n this.updatePlaceholder();\n }\n}\n\nexport interface Delegate {\n renderItem(item: T, editable: boolean): Element;\n removeItemRequested(item: T, index: number): void;\n beginEdit(item: T): Editor;\n commitEdit(item: T, editor: Editor, isNew: boolean): void;\n}\n\nexport interface CustomEditorControl extends HTMLElement {\n value: T;\n validate: () => ValidatorResult;\n}\n\nexport type EditorControl = (HTMLInputElement|HTMLSelectElement|CustomEditorControl);\n\nexport class Editor {\n element: HTMLDivElement;\n private readonly contentElementInternal: HTMLElement;\n private commitButton: Buttons.Button.Button;\n private readonly cancelButton: Buttons.Button.Button;\n private errorMessageContainer: HTMLElement;\n private readonly controls: EditorControl[];\n private readonly controlByName: Map;\n private readonly validators: ((arg0: T, arg1: number, arg2: EditorControl) => ValidatorResult)[];\n private commit: (() => void)|null;\n private cancel: (() => void)|null;\n private item: T|null;\n private index: number;\n\n constructor() {\n this.element = document.createElement('div');\n this.element.classList.add('editor-container');\n this.element.setAttribute('jslog', `${VisualLogging.pane('editor').track({resize: true})}`);\n this.element.addEventListener(\n 'keydown', onKeyDown.bind(null, Platform.KeyboardUtilities.isEscKey, this.cancelClicked.bind(this)), false);\n\n this.contentElementInternal = this.element.createChild('div', 'editor-content');\n this.contentElementInternal.addEventListener('keydown', onKeyDown.bind(null, event => {\n if (event.key !== 'Enter') {\n return false;\n }\n if (event.target instanceof HTMLSelectElement) {\n // 'Enter' on is supposed to open the drop down, so don't swallow that here.\n return false;\n }\n return true;\n }, this.commitClicked.bind(this)), false);\n\n const buttonsRow = this.element.createChild('div', 'editor-buttons');\n this.cancelButton = createTextButton(i18nString(UIStrings.cancelString), this.cancelClicked.bind(this), {\n jslogContext: 'cancel',\n variant: Buttons.Button.Variant.OUTLINED,\n });\n this.cancelButton.setAttribute('jslog', `${VisualLogging.action('cancel').track({click: true})}`);\n buttonsRow.appendChild(this.cancelButton);\n this.commitButton = createTextButton('', this.commitClicked.bind(this), {\n jslogContext: 'commit',\n variant: Buttons.Button.Variant.PRIMARY,\n });\n buttonsRow.appendChild(this.commitButton);\n\n this.errorMessageContainer = this.element.createChild('div', 'list-widget-input-validation-error');\n ARIAUtils.markAsAlert(this.errorMessageContainer);\n\n function onKeyDown(predicate: (arg0: KeyboardEvent) => boolean, callback: () => void, event: KeyboardEvent): void {\n if (predicate(event)) {\n event.consume(true);\n callback();\n }\n }\n\n this.controls = [];\n this.controlByName = new Map();\n this.validators = [];\n\n this.commit = null;\n this.cancel = null;\n this.item = null;\n this.index = -1;\n }\n\n contentElement(): Element {\n return this.contentElementInternal;\n }\n\n createInput(\n name: string, type: string, title: string,\n validator: (arg0: T, arg1: number, arg2: EditorControl) => ValidatorResult): HTMLInputElement {\n const input = (createInput('', type) as HTMLInputElement);\n input.placeholder = title;\n input.addEventListener('input', this.validateControls.bind(this, false), false);\n input.setAttribute('jslog', `${VisualLogging.textField().track({change: true, keydown: 'Enter'}).context(name)}`);\n ARIAUtils.setLabel(input, title);\n this.controlByName.set(name, input);\n this.controls.push(input);\n this.validators.push(validator);\n return input;\n }\n\n createSelect(\n name: string, options: string[], validator: (arg0: T, arg1: number, arg2: EditorControl) => ValidatorResult,\n title?: string): HTMLSelectElement {\n const select = document.createElement('select');\n select.setAttribute('jslog', `${VisualLogging.dropDown().track({change: true}).context(name)}`);\n select.classList.add('chrome-select');\n for (let index = 0; index < options.length; ++index) {\n const option = select.createChild('option');\n option.value = options[index];\n option.textContent = options[index];\n option.setAttribute(\n 'jslog', `${VisualLogging.item(Platform.StringUtilities.toKebabCase(options[index])).track({click: true})}`);\n }\n if (title) {\n Tooltip.install(select, title);\n ARIAUtils.setLabel(select, title);\n }\n select.addEventListener('input', this.validateControls.bind(this, false), false);\n select.addEventListener('blur', this.validateControls.bind(this, false), false);\n this.controlByName.set(name, select);\n this.controls.push(select);\n this.validators.push(validator);\n return select;\n }\n\n createCustomControl>(\n name: string, ctor: {new(): U},\n validator: (arg0: T, arg1: number, arg2: EditorControl) => ValidatorResult): CustomEditorControl {\n const control = new ctor();\n this.controlByName.set(name, control as unknown as CustomEditorControl);\n this.controls.push(control as unknown as CustomEditorControl);\n this.validators.push(validator);\n return control;\n }\n\n control(name: string): EditorControl {\n const control = this.controlByName.get(name);\n if (!control) {\n throw new Error(`Control with name ${name} does not exist, please verify.`);\n }\n return control;\n }\n\n private validateControls(forceValid: boolean): void {\n let allValid = true;\n this.errorMessageContainer.textContent = '';\n for (let index = 0; index < this.controls.length; ++index) {\n const input = this.controls[index];\n const {valid, errorMessage} = this.validators[index].call(null, (this.item as T), this.index, input);\n\n input.classList.toggle('error-input', !valid && !forceValid);\n if (valid || forceValid) {\n ARIAUtils.setInvalid(input, false);\n } else {\n ARIAUtils.setInvalid(input, true);\n }\n\n if (!forceValid && errorMessage) {\n if (this.errorMessageContainer.textContent) {\n const br = document.createElement('br');\n this.errorMessageContainer.append(br);\n }\n this.errorMessageContainer.append(errorMessage);\n }\n\n allValid = allValid && valid;\n }\n this.commitButton.disabled = !allValid;\n }\n\n requestValidation(): void {\n this.validateControls(false);\n }\n\n beginEdit(item: T, index: number, commitButtonTitle: string, commit: () => void, cancel: () => void): void {\n this.commit = commit;\n this.cancel = cancel;\n this.item = item;\n this.index = index;\n\n this.commitButton.textContent = commitButtonTitle;\n this.element.scrollIntoViewIfNeeded(false);\n if (this.controls.length) {\n this.controls[0].focus();\n }\n this.validateControls(true);\n }\n\n private commitClicked(): void {\n if (this.commitButton.disabled) {\n return;\n }\n\n const commit = this.commit;\n this.commit = null;\n this.cancel = null;\n this.item = null;\n this.index = -1;\n if (commit) {\n commit();\n }\n }\n\n private cancelClicked(): void {\n const cancel = this.cancel;\n this.commit = null;\n this.cancel = null;\n this.item = null;\n this.index = -1;\n if (cancel) {\n cancel();\n }\n }\n}\nexport interface ValidatorResult {\n valid: boolean;\n errorMessage?: string;\n}\n"]} \ No newline at end of file diff --git a/public/ui/legacy/ProgressIndicator.js b/public/ui/legacy/ProgressIndicator.js index 71bc58305..863029c4d 100644 --- a/public/ui/legacy/ProgressIndicator.js +++ b/public/ui/legacy/ProgressIndicator.js @@ -42,8 +42,7 @@ export class ProgressIndicator { constructor() { this.element = document.createElement('div'); this.element.classList.add('progress-indicator'); - this.shadowRoot = - createShadowRootWithCoreStyles(this.element, { cssFile: progressIndicatorStyles, delegatesFocus: undefined }); + this.shadowRoot = createShadowRootWithCoreStyles(this.element, { cssFile: progressIndicatorStyles }); this.contentElement = this.shadowRoot.createChild('div', 'progress-indicator-shadow-container'); this.labelElement = this.contentElement.createChild('div', 'title'); this.progressElement = this.contentElement.createChild('progress'); diff --git a/public/ui/legacy/ProgressIndicator.js.map b/public/ui/legacy/ProgressIndicator.js.map index 49fb577c2..1cf18b810 100644 --- a/public/ui/legacy/ProgressIndicator.js.map +++ b/public/ui/legacy/ProgressIndicator.js.map @@ -1 +1 @@ -{"version":3,"file":"ProgressIndicator.js","sourceRoot":"","sources":["../../../../../../front_end/ui/legacy/ProgressIndicator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAIH,OAAO,uBAAuB,MAAM,mCAAmC,CAAC;AACxE,OAAO,EAAC,8BAA8B,EAAC,MAAM,cAAc,CAAC;AAE5D,MAAM,OAAO,iBAAiB;IAC5B,OAAO,CAAiB;IACP,UAAU,CAAa;IACvB,cAAc,CAAU;IACjC,YAAY,CAAU;IACtB,eAAe,CAAsB;IAC5B,UAAU,CAAU;IAC7B,kBAAkB,CAAU;IAC5B,MAAM,CAAS;IACf,MAAM,CAAW;IAEzB;QACE,IAAI,CAAC,OAAO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AI,CAAC;IACjC,CAAC;IAED,UAAU;QACR,OAAO,IAAI,CAAC,kBAAkB,CAAC;IACjC,CAAC;IAED,QAAQ,CAAC,KAAa;QACpB,IAAI,CAAC,YAAY,CAAC,WAAW,GAAG,KAAK,CAAC;IACxC,CAAC;IAED,YAAY,CAAC,SAAiB;QAC5B,IAAI,CAAC,eAAe,CAAC,GAAG,GAAG,SAAS,CAAC;IACvC,CAAC;IAED,SAAS,CAAC,MAAc,EAAE,KAAc;QACtC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,eAAe,CAAC,KAAK,GAAG,MAAM,CAAC;QACpC,IAAI,KAAK,EAAE,CAAC;YACV,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;QACvB,CAAC;IACH,CAAC;IAED,eAAe,CAAC,MAAe;QAC7B,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,MAAM,IAAI,CAAC,CAAC,CAAC,CAAC;IAC9C,CAAC;CACF","sourcesContent":["/*\n * Copyright (C) 2012 Google Inc. All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are\n * met:\n *\n * * Redistributions of source code must retain the above copyright\n * notice, this list of conditions and the following disclaimer.\n * * Redistributions in binary form must reproduce the above\n * copyright notice, this list of conditions and the following disclaimer\n * in the documentation and/or other materials provided with the\n * distribution.\n * * Neither the name of Google Inc. nor the names of its\n * contributors may be used to endorse or promote products derived from\n * this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nimport type * as Common from '../../core/common/common.js';\n\nimport progressIndicatorStyles from './progressIndicator.css.legacy.js';\nimport {createShadowRootWithCoreStyles} from './UIUtils.js';\n\nexport class ProgressIndicator implements Common.Progress.Progress {\n element: HTMLDivElement;\n private readonly shadowRoot: ShadowRoot;\n private readonly contentElement: Element;\n private labelElement: Element;\n private progressElement: HTMLProgressElement;\n private readonly stopButton: Element;\n private isCanceledInternal: boolean;\n private worked: number;\n private isDone?: boolean;\n\n constructor() {\n this.element = document.createElement('div');\n this.element.classList.add('progress-indicator');\n this.shadowRoot =\n createShadowRootWithCoreStyles(this.element, {cssFile: progressIndicatorStyles, delegatesFocus: undefined});\n this.contentElement = this.shadowRoot.createChild('div', 'progress-indicator-shadow-container');\n\n this.labelElement = this.contentElement.createChild('div', 'title');\n this.progressElement = (this.contentElement.createChild('progress') as HTMLProgressElement);\n this.progressElement.value = 0;\n this.stopButton = this.contentElement.createChild('button', 'progress-indicator-shadow-stop-button');\n this.stopButton.addEventListener('click', this.cancel.bind(this));\n\n this.isCanceledInternal = false;\n this.worked = 0;\n }\n\n show(parent: Element): void {\n parent.appendChild(this.element);\n }\n\n done(): void {\n if (this.isDone) {\n return;\n }\n this.isDone = true;\n this.element.remove();\n }\n\n cancel(): void {\n this.isCanceledInternal = true;\n }\n\n isCanceled(): boolean {\n return this.isCanceledInternal;\n }\n\n setTitle(title: string): void {\n this.labelElement.textContent = title;\n }\n\n setTotalWork(totalWork: number): void {\n this.progressElement.max = totalWork;\n }\n\n setWorked(worked: number, title?: string): void {\n this.worked = worked;\n this.progressElement.value = worked;\n if (title) {\n this.setTitle(title);\n }\n }\n\n incrementWorked(worked?: number): void {\n this.setWorked(this.worked + (worked || 1));\n }\n}\n"]} \ No newline at end of file +{"version":3,"file":"ProgressIndicator.js","sourceRoot":"","sources":["../../../../../../front_end/ui/legacy/ProgressIndicator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAIH,OAAO,uBAAuB,MAAM,mCAAmC,CAAC;AACxE,OAAO,EAAC,8BAA8B,EAAC,MAAM,cAAc,CAAC;AAE5D,MAAM,OAAO,iBAAiB;IAC5B,OAAO,CAAiB;IACP,UAAU,CAAa;IACvB,cAAc,CAAU;IACjC,YAAY,CAAU;IACtB,eAAe,CAAsB;IAC5B,UAAU,CAAU;IAC7B,kBAAkB,CAAU;IAC5B,MAAM,CAAS;IACf,MAAM,CAAW;IAEzB;QACE,IAAI,CAAC,OAAO,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;QAC7C,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,GAAG,CAAC,oBAAoB,CAAC,CAAC;QACjD,IAAI,CAAC,UAAU,GAAG,8BAA8B,CAAC,IAAI,CAAC,OAAO,EAAE,EAAC,OAAO,EAAE,uBAAuB,EAAC,CAAC,CAAC;QACnG,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,UAAU,CAAC,WAAW,CAAC,KAAK,EAAE,qCAAqC,CAAC,CAAC;QAEhG,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,cAAc,CAAC,WAAW,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;QACpE,IAAI,CAAC,eAAe,GAAG,IAAI,CAAC,cAAc,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;QACnE,IAAI,CAAC,eAAe,C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AG,CAAC,MAAM,IAAI,CAAC,CAAC,CAAC,CAAC;IAC9C,CAAC;CACF","sourcesContent":["/*\n * Copyright (C) 2012 Google Inc. All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are\n * met:\n *\n * * Redistributions of source code must retain the above copyright\n * notice, this list of conditions and the following disclaimer.\n * * Redistributions in binary form must reproduce the above\n * copyright notice, this list of conditions and the following disclaimer\n * in the documentation and/or other materials provided with the\n * distribution.\n * * Neither the name of Google Inc. nor the names of its\n * contributors may be used to endorse or promote products derived from\n * this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nimport type * as Common from '../../core/common/common.js';\n\nimport progressIndicatorStyles from './progressIndicator.css.legacy.js';\nimport {createShadowRootWithCoreStyles} from './UIUtils.js';\n\nexport class ProgressIndicator implements Common.Progress.Progress {\n element: HTMLDivElement;\n private readonly shadowRoot: ShadowRoot;\n private readonly contentElement: Element;\n private labelElement: Element;\n private progressElement: HTMLProgressElement;\n private readonly stopButton: Element;\n private isCanceledInternal: boolean;\n private worked: number;\n private isDone?: boolean;\n\n constructor() {\n this.element = document.createElement('div');\n this.element.classList.add('progress-indicator');\n this.shadowRoot = createShadowRootWithCoreStyles(this.element, {cssFile: progressIndicatorStyles});\n this.contentElement = this.shadowRoot.createChild('div', 'progress-indicator-shadow-container');\n\n this.labelElement = this.contentElement.createChild('div', 'title');\n this.progressElement = this.contentElement.createChild('progress');\n this.progressElement.value = 0;\n this.stopButton = this.contentElement.createChild('button', 'progress-indicator-shadow-stop-button');\n this.stopButton.addEventListener('click', this.cancel.bind(this));\n\n this.isCanceledInternal = false;\n this.worked = 0;\n }\n\n show(parent: Element): void {\n parent.appendChild(this.element);\n }\n\n done(): void {\n if (this.isDone) {\n return;\n }\n this.isDone = true;\n this.element.remove();\n }\n\n cancel(): void {\n this.isCanceledInternal = true;\n }\n\n isCanceled(): boolean {\n return this.isCanceledInternal;\n }\n\n setTitle(title: string): void {\n this.labelElement.textContent = title;\n }\n\n setTotalWork(totalWork: number): void {\n this.progressElement.max = totalWork;\n }\n\n setWorked(worked: number, title?: string): void {\n this.worked = worked;\n this.progressElement.value = worked;\n if (title) {\n this.setTitle(title);\n }\n }\n\n incrementWorked(worked?: number): void {\n this.setWorked(this.worked + (worked || 1));\n }\n}\n"]} \ No newline at end of file diff --git a/public/ui/legacy/ReportView.js.map b/public/ui/legacy/ReportView.js.map index 97bb7c565..6c73c173f 100644 --- a/public/ui/legacy/ReportView.js.map +++ b/public/ui/legacy/ReportView.js.map @@ -1 +1 @@ -{"version":3,"file":"ReportView.js","sourceRoot":"","sources":["../../../../../../front_end/ui/legacy/ReportView.ts"],"names":[],"mappings":"AAAA,gEAAgE;AAChE,yEAAyE;AACzE,6BAA6B;AAG7B,OAAO,KAAK,aAAa,MAAM,qCAAqC,CAAC;AAErE,OAAO,KAAK,SAAS,MAAM,gBAAgB,CAAC;AAC5C,OAAO,g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AAQ,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;QACrC,OAAO,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAC,CAAC,IAAI,CAAC;IAC3C,CAAC;IAED,SAAS;QACP,OAAO,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC,KAAK,EAAE,YAAY,CAAgB,CAAC;IACxE,CAAC;IAED,mBAAmB;QACjB,OAAO,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC,KAAK,EAAE,kCAAkC,CAAgB,CAAC;IAC9F,CAAC;IAED,YAAY;QACV,IAAI,CAAC,SAAS,CAAC,cAAc,EAAE,CAAC;QAChC,IAAI,CAAC,QAAQ,CAAC,KAAK,EAAE,CAAC;IACxB,CAAC;IAED,oBAAoB;QAClB,SAAS,CAAC,WAAW,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QACtC,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,KAAK,EAAE,CAAC,CAAC;IACnD,CAAC;IAED,aAAa,CAAC,MAAe;QAC3B,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,MAAM,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC;IACrD,CAAC;CACF","sourcesContent":["// Copyright (c) 2016 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport type * as Buttons from '../components/buttons/buttons.js';\nimport * as VisualLogging from '../visual_logging/visual_logging.js';\n\nimport * as ARIAUtils from './ARIAUtils.js';\nimport reportViewStyles from './reportView.css.legacy.js';\nimport {Toolbar} from './Toolbar.js';\nimport {Tooltip} from './Tooltip.js';\nimport {VBox} from './Widget.js';\n\n/**\n * @deprecated Please consider using the web component version of this widget\n * (`ui/components/report_view/ReportView.ts`) for new code.\n */\nexport class ReportView extends VBox {\n private readonly contentBox: HTMLElement;\n private headerElement: HTMLElement;\n private titleElement: HTMLElement;\n private readonly sectionList: HTMLElement;\n private subtitleElement?: HTMLElement;\n private urlElement?: HTMLElement;\n constructor(title?: string) {\n super(true);\n this.registerRequiredCSS(reportViewStyles);\n\n this.contentBox = this.contentElement.createChild('div', 'report-content-box');\n this.headerElement = this.contentBox.createChild('div', 'report-header vbox');\n this.titleElement = this.headerElement.createChild('div', 'report-title');\n if (title) {\n this.titleElement.textContent = title;\n } else {\n this.headerElement.classList.add('hidden');\n }\n ARIAUtils.markAsHeading(this.titleElement, 1);\n\n this.sectionList = this.contentBox.createChild('div', 'vbox');\n }\n\n getHeaderElement(): Element {\n return this.headerElement;\n }\n\n setTitle(title: string): void {\n if (this.titleElement.textContent === title) {\n return;\n }\n this.titleElement.textContent = title;\n this.headerElement.classList.toggle('hidden', Boolean(title));\n }\n\n setSubtitle(subtitle: string): void {\n if (this.subtitleElement && this.subtitleElement.textContent === subtitle) {\n return;\n }\n if (!this.subtitleElement) {\n this.subtitleElement = this.headerElement.createChild('div', 'report-subtitle');\n }\n this.subtitleElement.textContent = subtitle;\n }\n\n setURL(link: Element|null): void {\n if (!this.urlElement) {\n this.urlElement = this.headerElement.createChild('div', 'report-url link');\n }\n this.urlElement.removeChildren();\n if (link) {\n this.urlElement.appendChild(link);\n }\n this.urlElement.setAttribute('jslog', `${VisualLogging.link('source-location').track({click: true})}`);\n }\n\n createToolbar(): Toolbar {\n const toolbar = new Toolbar('');\n this.headerElement.appendChild(toolbar.element);\n return toolbar;\n }\n\n appendSection(title: string, className?: string, jslogContext?: string): Section {\n const section = new Section(title, className, jslogContext);\n section.show(this.sectionList);\n return section;\n }\n\n sortSections(comparator: (arg0: Section, arg1: Section) => number): void {\n const sections = (this.children().slice() as Section[]);\n const sorted = sections.every((e, i, a) => !i || comparator(a[i - 1], a[i]) <= 0);\n if (sorted) {\n return;\n }\n\n this.detachChildWidgets();\n sections.sort(comparator);\n for (const section of sections) {\n section.show(this.sectionList);\n }\n }\n\n setHeaderVisible(visible: boolean): void {\n this.headerElement.classList.toggle('hidden', !visible);\n }\n\n setBodyScrollable(scrollable: boolean): void {\n this.contentBox.classList.toggle('no-scroll', !scrollable);\n }\n}\n\nexport class Section extends VBox {\n private readonly headerElement: HTMLElement;\n private headerButtons: Buttons.Button.Button[];\n private titleElement: HTMLElement;\n private fieldList: HTMLElement;\n private readonly fieldMap: Map;\n constructor(title: string, className?: string, public jslogContext?: string) {\n super();\n this.element.classList.add('report-section');\n if (className) {\n this.element.classList.add(className);\n }\n if (jslogContext) {\n this.element.setAttribute('jslog', `${VisualLogging.section(jslogContext)}`);\n }\n this.jslogContext = jslogContext;\n this.headerButtons = [];\n this.headerElement = this.element.createChild('div', 'report-section-header');\n this.titleElement = this.headerElement.createChild('div', 'report-section-title');\n this.setTitle(title);\n ARIAUtils.markAsHeading(this.titleElement, 2);\n this.fieldList = this.element.createChild('div', 'vbox');\n this.fieldMap = new Map();\n }\n\n title(): string {\n return this.titleElement.textContent || '';\n }\n\n getTitleElement(): Element {\n return this.titleElement;\n }\n\n getFieldElement(): HTMLElement {\n return this.fieldList;\n }\n appendFieldWithCustomView(customElement: HTMLElement): void {\n this.fieldList.append(customElement);\n }\n\n setTitle(title: string, tooltip?: string): void {\n if (this.titleElement.textContent !== title) {\n this.titleElement.textContent = title;\n }\n Tooltip.install(this.titleElement, tooltip || '');\n this.titleElement.classList.toggle('hidden', !this.titleElement.textContent);\n }\n\n /**\n * Declares the overall container to be a group and assigns a title.\n */\n setUiGroupTitle(groupTitle: string): void {\n ARIAUtils.markAsGroup(this.element);\n ARIAUtils.setLabel(this.element, groupTitle);\n }\n\n appendButtonToHeader(button: Buttons.Button.Button): void {\n this.headerButtons.push(button);\n this.headerElement.appendChild(button);\n }\n\n setHeaderButtonsState(disabled: boolean): void {\n this.headerButtons.map(button => {\n button.disabled = disabled;\n });\n }\n\n appendField(title: string, textValue?: string): HTMLElement {\n let row = this.fieldMap.get(title);\n if (!row) {\n row = this.fieldList.createChild('div', 'report-field');\n row.createChild('div', 'report-field-name').textContent = title;\n this.fieldMap.set(title, row);\n row.createChild('div', 'report-field-value');\n }\n if (textValue && row.lastElementChild) {\n row.lastElementChild.textContent = textValue;\n }\n return row.lastElementChild as HTMLElement;\n }\n\n appendFlexedField(title: string, textValue?: string): Element {\n const field = this.appendField(title, textValue);\n field.classList.add('report-field-value-is-flexed');\n return field;\n }\n\n removeField(title: string): void {\n const row = this.fieldMap.get(title);\n if (row) {\n row.remove();\n }\n this.fieldMap.delete(title);\n }\n\n setFieldVisible(title: string, visible: boolean): void {\n const row = this.fieldMap.get(title);\n if (row) {\n row.classList.toggle('hidden', !visible);\n }\n }\n\n fieldValue(title: string): Element|null {\n const row = this.fieldMap.get(title);\n return row ? row.lastElementChild : null;\n }\n\n appendRow(): HTMLElement {\n return this.fieldList.createChild('div', 'report-row') as HTMLElement;\n }\n\n appendSelectableRow(): HTMLElement {\n return this.fieldList.createChild('div', 'report-row report-row-selectable') as HTMLElement;\n }\n\n clearContent(): void {\n this.fieldList.removeChildren();\n this.fieldMap.clear();\n }\n\n markFieldListAsGroup(): void {\n ARIAUtils.markAsGroup(this.fieldList);\n ARIAUtils.setLabel(this.fieldList, this.title());\n }\n\n setIconMasked(masked: boolean): void {\n this.element.classList.toggle('show-mask', masked);\n }\n}\n"]} \ No newline at end of file +{"version":3,"file":"ReportView.js","sourceRoot":"","sources":["../../../../../../front_end/ui/legacy/ReportView.ts"],"names":[],"mappings":"AAAA,gEAAgE;AAChE,yEAAyE;AACzE,6BAA6B;AAG7B,OAAO,KAAK,aAAa,MAAM,qCAAqC,CAAC;AAErE,OAAO,KAAK,SAAS,MAAM,gBAAgB,CAAC;AAC5C,OAAO,gBAAgB,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAC,OAAO,EAAC,MAAM,cAAc,CAAC;AACrC,OAAO,EAAC,OAAO,EAAC,MAAM,cAAc,CAAC;AACrC,OAAO,EAAC,IAAI,EAAC,MAAM,aAAa,CAAC;AAEjC;;;GAGG;AACH,MAAM,OAAO,UAAW,SAAQ,IAAI;IACjB,UAAU,CA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C;IAED,mBAAmB;QACjB,OAAO,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC,KAAK,EAAE,kCAAkC,CAAC,CAAC;IAC/E,CAAC;IAED,YAAY;QACV,IAAI,CAAC,SAAS,CAAC,cAAc,EAAE,CAAC;QAChC,IAAI,CAAC,QAAQ,CAAC,KAAK,EAAE,CAAC;IACxB,CAAC;IAED,oBAAoB;QAClB,SAAS,CAAC,WAAW,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QACtC,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,KAAK,EAAE,CAAC,CAAC;IACnD,CAAC;IAED,aAAa,CAAC,MAAe;QAC3B,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,MAAM,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC;IACrD,CAAC;CACF","sourcesContent":["// Copyright (c) 2016 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport type * as Buttons from '../components/buttons/buttons.js';\nimport * as VisualLogging from '../visual_logging/visual_logging.js';\n\nimport * as ARIAUtils from './ARIAUtils.js';\nimport reportViewStyles from './reportView.css.legacy.js';\nimport {Toolbar} from './Toolbar.js';\nimport {Tooltip} from './Tooltip.js';\nimport {VBox} from './Widget.js';\n\n/**\n * @deprecated Please consider using the web component version of this widget\n * (`ui/components/report_view/ReportView.ts`) for new code.\n */\nexport class ReportView extends VBox {\n private readonly contentBox: HTMLElement;\n private headerElement: HTMLElement;\n private titleElement: HTMLElement;\n private readonly sectionList: HTMLElement;\n private subtitleElement?: HTMLElement;\n private urlElement?: HTMLElement;\n constructor(title?: string) {\n super(true);\n this.registerRequiredCSS(reportViewStyles);\n\n this.contentBox = this.contentElement.createChild('div', 'report-content-box');\n this.headerElement = this.contentBox.createChild('div', 'report-header vbox');\n this.titleElement = this.headerElement.createChild('div', 'report-title');\n if (title) {\n this.titleElement.textContent = title;\n } else {\n this.headerElement.classList.add('hidden');\n }\n ARIAUtils.markAsHeading(this.titleElement, 1);\n\n this.sectionList = this.contentBox.createChild('div', 'vbox');\n }\n\n getHeaderElement(): Element {\n return this.headerElement;\n }\n\n setTitle(title: string): void {\n if (this.titleElement.textContent === title) {\n return;\n }\n this.titleElement.textContent = title;\n this.headerElement.classList.toggle('hidden', Boolean(title));\n }\n\n setSubtitle(subtitle: string): void {\n if (this.subtitleElement && this.subtitleElement.textContent === subtitle) {\n return;\n }\n if (!this.subtitleElement) {\n this.subtitleElement = this.headerElement.createChild('div', 'report-subtitle');\n }\n this.subtitleElement.textContent = subtitle;\n }\n\n setURL(link: Element|null): void {\n if (!this.urlElement) {\n this.urlElement = this.headerElement.createChild('div', 'report-url link');\n }\n this.urlElement.removeChildren();\n if (link) {\n this.urlElement.appendChild(link);\n }\n this.urlElement.setAttribute('jslog', `${VisualLogging.link('source-location').track({click: true})}`);\n }\n\n createToolbar(): Toolbar {\n const toolbar = new Toolbar('');\n this.headerElement.appendChild(toolbar.element);\n return toolbar;\n }\n\n appendSection(title: string, className?: string, jslogContext?: string): Section {\n const section = new Section(title, className, jslogContext);\n section.show(this.sectionList);\n return section;\n }\n\n sortSections(comparator: (arg0: Section, arg1: Section) => number): void {\n const sections = (this.children().slice() as Section[]);\n const sorted = sections.every((e, i, a) => !i || comparator(a[i - 1], a[i]) <= 0);\n if (sorted) {\n return;\n }\n\n this.detachChildWidgets();\n sections.sort(comparator);\n for (const section of sections) {\n section.show(this.sectionList);\n }\n }\n\n setHeaderVisible(visible: boolean): void {\n this.headerElement.classList.toggle('hidden', !visible);\n }\n\n setBodyScrollable(scrollable: boolean): void {\n this.contentBox.classList.toggle('no-scroll', !scrollable);\n }\n}\n\nexport class Section extends VBox {\n private readonly headerElement: HTMLElement;\n private headerButtons: Buttons.Button.Button[];\n private titleElement: HTMLElement;\n private fieldList: HTMLElement;\n private readonly fieldMap: Map;\n constructor(title: string, className?: string, public jslogContext?: string) {\n super();\n this.element.classList.add('report-section');\n if (className) {\n this.element.classList.add(className);\n }\n if (jslogContext) {\n this.element.setAttribute('jslog', `${VisualLogging.section(jslogContext)}`);\n }\n this.jslogContext = jslogContext;\n this.headerButtons = [];\n this.headerElement = this.element.createChild('div', 'report-section-header');\n this.titleElement = this.headerElement.createChild('div', 'report-section-title');\n this.setTitle(title);\n ARIAUtils.markAsHeading(this.titleElement, 2);\n this.fieldList = this.element.createChild('div', 'vbox');\n this.fieldMap = new Map();\n }\n\n title(): string {\n return this.titleElement.textContent || '';\n }\n\n getTitleElement(): Element {\n return this.titleElement;\n }\n\n getFieldElement(): HTMLElement {\n return this.fieldList;\n }\n appendFieldWithCustomView(customElement: HTMLElement): void {\n this.fieldList.append(customElement);\n }\n\n setTitle(title: string, tooltip?: string): void {\n if (this.titleElement.textContent !== title) {\n this.titleElement.textContent = title;\n }\n Tooltip.install(this.titleElement, tooltip || '');\n this.titleElement.classList.toggle('hidden', !this.titleElement.textContent);\n }\n\n /**\n * Declares the overall container to be a group and assigns a title.\n */\n setUiGroupTitle(groupTitle: string): void {\n ARIAUtils.markAsGroup(this.element);\n ARIAUtils.setLabel(this.element, groupTitle);\n }\n\n appendButtonToHeader(button: Buttons.Button.Button): void {\n this.headerButtons.push(button);\n this.headerElement.appendChild(button);\n }\n\n setHeaderButtonsState(disabled: boolean): void {\n this.headerButtons.map(button => {\n button.disabled = disabled;\n });\n }\n\n appendField(title: string, textValue?: string): HTMLElement {\n let row = this.fieldMap.get(title);\n if (!row) {\n row = this.fieldList.createChild('div', 'report-field');\n row.createChild('div', 'report-field-name').textContent = title;\n this.fieldMap.set(title, row);\n row.createChild('div', 'report-field-value');\n }\n if (textValue && row.lastElementChild) {\n row.lastElementChild.textContent = textValue;\n }\n return row.lastElementChild as HTMLElement;\n }\n\n appendFlexedField(title: string, textValue?: string): Element {\n const field = this.appendField(title, textValue);\n field.classList.add('report-field-value-is-flexed');\n return field;\n }\n\n removeField(title: string): void {\n const row = this.fieldMap.get(title);\n if (row) {\n row.remove();\n }\n this.fieldMap.delete(title);\n }\n\n setFieldVisible(title: string, visible: boolean): void {\n const row = this.fieldMap.get(title);\n if (row) {\n row.classList.toggle('hidden', !visible);\n }\n }\n\n fieldValue(title: string): Element|null {\n const row = this.fieldMap.get(title);\n return row ? row.lastElementChild : null;\n }\n\n appendRow(): HTMLElement {\n return this.fieldList.createChild('div', 'report-row');\n }\n\n appendSelectableRow(): HTMLElement {\n return this.fieldList.createChild('div', 'report-row report-row-selectable');\n }\n\n clearContent(): void {\n this.fieldList.removeChildren();\n this.fieldMap.clear();\n }\n\n markFieldListAsGroup(): void {\n ARIAUtils.markAsGroup(this.fieldList);\n ARIAUtils.setLabel(this.fieldList, this.title());\n }\n\n setIconMasked(masked: boolean): void {\n this.element.classList.toggle('show-mask', masked);\n }\n}\n"]} \ No newline at end of file diff --git a/public/ui/legacy/SearchableView.js b/public/ui/legacy/SearchableView.js index 5f71d1855..19f0941cb 100644 --- a/public/ui/legacy/SearchableView.js +++ b/public/ui/legacy/SearchableView.js @@ -38,11 +38,10 @@ import * as VisualLogging from '../../ui/visual_logging/visual_logging.js'; import * as Buttons from '../components/buttons/buttons.js'; import * as IconButton from '../components/icon_button/icon_button.js'; import * as ARIAUtils from './ARIAUtils.js'; -import { HistoryInput } from './HistoryInput.js'; import { InspectorView } from './InspectorView.js'; import searchableViewStyles from './searchableView.css.legacy.js'; import { Toolbar, ToolbarButton, ToolbarText, ToolbarToggle } from './Toolbar.js'; -import { createTextButton } from './UIUtils.js'; +import { createHistoryInput, createTextButton } from './UIUtils.js'; import { VBox } from './Widget.js'; const UIStrings = { /** @@ -182,9 +181,7 @@ export class SearchableView extends VBox { const iconAndInput = searchInputElements.createChild('div', 'icon-and-input'); const searchIcon = IconButton.Icon.create('search'); iconAndInput.appendChild(searchIcon); - this.searchInputElement = HistoryInput.create(); - this.searchInputElement.type = 'search'; - this.searchInputElement.classList.add('search-replace', 'search'); + this.searchInputElement = createHistoryInput('search', 'search-replace search'); this.searchInputElement.id = 'search-input-field'; this.searchInputElement.autocomplete = 'off'; this.searchInputElement.placeholder = i18nString(UIStrings.findString); diff --git a/public/ui/legacy/SearchableView.js.map b/public/ui/legacy/SearchableView.js.map index 8b6c2e593..0228ee705 100644 --- a/public/ui/legacy/SearchableView.js.map +++ b/public/ui/legacy/SearchableView.js.map @@ -1 +1 @@ -{"version":3,"file":"SearchableView.js","sourceRoot":"","sources":["../../../../../../front_end/ui/legacy/SearchableView.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAEH,OAAO,KAAK,MAAM,MAAM,6BAA6B,CAAC;AACtD,OAAO,KAAK,IAAI,MAAM,yBAAyB,CAAC;AAChD,OAAO,KAAK,QAAQ,MAAM,iCAAiC,CAAC;AAC5D,OAAO,KAAK,aAAa,MAAM,2CAA2C,CAAC;AAC3E,OAAO,KAAK,OAAO,MAAM,kCAAkC,CAAC;AAC5D,OAAO,KAAK,UAAU,MAAM,0CAA0C,CAAC;AAEvE,OAAO,KAAK,SAAS,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAC,YAAY,EAAC,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAC,aAAa,EAAC,MAAM,oBAAoB,CAAC;AACjD,OAAO,oBAAoB,MAAM,gCAAgC,CAAC;AAClE,OAAO,EAAC,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,aAAa,EAAC,MAAM,cAAc,CAAC;AAChF,OAAO,EAAC,gBAAgB,EAAC,MAAM,cAAc,CAAC;AAC9C,OAAO,EAAC,IAAI,EAAC,MAAM,aAAa,CAAC;AAEjC,MAAM,SAAS,GAAG;IAChB;;OAEG;IACH,OAAO,EAAE,SAAS;IAClB;;OAEG;IACH,oBAAoB,EAAE,kBAAkB;IACxC;;OAEG;IACH,qBAAqB,EAAE,0BAA0B;IACjD;;OAEG;IACH,UAAU,EAAE,MAAM;IAClB;;OAEG;IACH,cAAc,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B,IAAI,SAAS,GAAG,KAAK,CAAC;QAEtB,uDAAuD;QACvD,IAAI,CAAC;YACH,IAAI,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;gBAC3C,KAAK,GAAG,IAAI,MAAM,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,EAAE,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,EAAE,SAAS,CAAC,CAAC;gBACpE,SAAS,GAAG,IAAI,CAAC;YACnB,CAAC;QACH,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACX,gBAAgB;QAClB,CAAC;QAED,yCAAyC;QACzC,IAAI,CAAC,KAAK,EAAE,CAAC;YACX,KAAK,GAAG,QAAQ,CAAC,eAAe,CAAC,0BAA0B,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC;QAChF,CAAC;QAED,OAAO;YACL,KAAK;YACL,SAAS;SACV,CAAC;IACJ,CAAC;CACF","sourcesContent":["// Copyright 2021 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\n/*\n * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved.\n * Copyright (C) 2007 Matt Lilek (pewtermoose@gmail.com).\n * Copyright (C) 2009 Joseph Pecoraro\n * Copyright (C) 2011 Google Inc. All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n *\n * 1. Redistributions of source code must retain the above copyright\n * notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n * notice, this list of conditions and the following disclaimer in the\n * documentation and/or other materials provided with the distribution.\n * 3. Neither the name of Apple Computer, Inc. (\"Apple\") nor the names of\n * its contributors may be used to endorse or promote products derived\n * from this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nimport * as Common from '../../core/common/common.js';\nimport * as i18n from '../../core/i18n/i18n.js';\nimport * as Platform from '../../core/platform/platform.js';\nimport * as VisualLogging from '../../ui/visual_logging/visual_logging.js';\nimport * as Buttons from '../components/buttons/buttons.js';\nimport * as IconButton from '../components/icon_button/icon_button.js';\n\nimport * as ARIAUtils from './ARIAUtils.js';\nimport {HistoryInput} from './HistoryInput.js';\nimport {InspectorView} from './InspectorView.js';\nimport searchableViewStyles from './searchableView.css.legacy.js';\nimport {Toolbar, ToolbarButton, ToolbarText, ToolbarToggle} from './Toolbar.js';\nimport {createTextButton} from './UIUtils.js';\nimport {VBox} from './Widget.js';\n\nconst UIStrings = {\n /**\n *@description Text on a button to replace one instance with input text for the ctrl+F search bar\n */\n replace: 'Replace',\n /**\n *@description Tooltip text on a toggle to enable replacing one instance with input text for the ctrl+F search bar\n */\n enableFindAndReplace: 'Find and replace',\n /**\n *@description Tooltip text on a toggle to disable replacing one instance with input text for the ctrl+F search bar\n */\n disableFindAndReplace: 'Disable find and replace',\n /**\n *@description Text to find an item\n */\n findString: 'Find',\n /**\n *@description Tooltip text on a button to search previous instance for the ctrl+F search bar\n */\n searchPrevious: 'Show previous result',\n /**\n *@description Tooltip text on a button to search next instance for the ctrl+F search bar\n */\n searchNext: 'Show next result',\n /**\n *@description Tooltip text on a toggle to enable search by matching case of the input\n */\n enableCaseSensitive: 'Enable case sensitive search',\n /**\n *@description Tooltip text on a toggle to disable search by matching case of the input\n */\n disableCaseSensitive: 'Disable case sensitive search',\n /**\n *@description Tooltip text on a toggle to enable searching with regular expression\n */\n enableRegularExpression: 'Enable regular expressions',\n /**\n *@description Tooltip text on a toggle to disable searching with regular expression\n */\n disableRegularExpression: 'Disable regular expressions',\n /**\n *@description Tooltip text on a button to close the search bar\n */\n closeSearchBar: 'Close search bar',\n /**\n *@description Text on a button to replace all instances with input text for the ctrl+F search bar\n */\n replaceAll: 'Replace all',\n /**\n *@description Text to indicate the current match index and the total number of matches for the ctrl+F search bar\n *@example {2} PH1\n *@example {3} PH2\n */\n dOfD: '{PH1} of {PH2}',\n /**\n *@description Tooltip text to indicate the current match index and the total number of matches for the ctrl+F search bar\n *@example {2} PH1\n *@example {3} PH2\n */\n accessibledOfD: 'Shows result {PH1} of {PH2}',\n /**\n *@description Text to indicate search result for the ctrl+F search bar\n */\n matchString: '1 match',\n /**\n *@description Text to indicate search result for the ctrl+F search bar\n *@example {2} PH1\n */\n dMatches: '{PH1} matches',\n /**\n *@description Text on a button to search previous instance for the ctrl+F search bar\n */\n clearInput: 'Clear',\n};\nconst str_ = i18n.i18n.registerUIStrings('ui/legacy/SearchableView.ts', UIStrings);\nconst i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);\n\nfunction createClearButton(jslogContext: string): Buttons.Button.Button {\n const button = new Buttons.Button.Button();\n button.data = {\n variant: Buttons.Button.Variant.ICON,\n size: Buttons.Button.Size.SMALL,\n jslogContext,\n title: i18nString(UIStrings.clearInput),\n iconName: 'cross-circle-filled',\n };\n button.ariaLabel = i18nString(UIStrings.clearInput);\n button.classList.add('clear-button');\n button.tabIndex = -1;\n return button;\n}\nexport class SearchableView extends VBox {\n private searchProvider: Searchable;\n private replaceProvider: Replaceable|null;\n // TODO(crbug.com/1172300) Ignored during the jsdoc to ts migration\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n private setting: Common.Settings.Setting|null;\n private replaceable: boolean;\n private readonly footerElementContainer: HTMLElement;\n private readonly footerElement: HTMLElement;\n private replaceToggleButton: ToolbarToggle;\n private searchInputElement: HistoryInput;\n private matchesElement: HTMLElement;\n private searchNavigationPrevElement: ToolbarButton;\n private searchNavigationNextElement: ToolbarButton;\n private readonly replaceInputElement: HTMLInputElement;\n private caseSensitiveButton: Buttons.Button.Button|undefined;\n private regexButton: Buttons.Button.Button|undefined;\n private replaceButtonElement: Buttons.Button.Button;\n private replaceAllButtonElement: Buttons.Button.Button;\n private minimalSearchQuerySize: number;\n private searchIsVisible?: boolean;\n private currentQuery?: string;\n private valueChangedTimeoutId?: number;\n\n constructor(searchable: Searchable, replaceable: Replaceable|null, settingName?: string) {\n super(true);\n this.registerRequiredCSS(searchableViewStyles);\n searchableViewsByElement.set(this.element, this);\n\n this.searchProvider = searchable;\n this.replaceProvider = replaceable;\n this.setting = settingName ? Common.Settings.Settings.instance().createSetting(settingName, {}) : null;\n this.replaceable = false;\n\n this.contentElement.createChild('slot');\n this.footerElementContainer = this.contentElement.createChild('div', 'search-bar hidden');\n this.footerElementContainer.style.order = '100';\n this.footerElement = this.footerElementContainer.createChild('div', 'toolbar-search');\n this.footerElement.setAttribute('jslog', `${VisualLogging.toolbar('search').track({resize: true})}`);\n\n const replaceToggleToolbar = new Toolbar('replace-toggle-toolbar', this.footerElement);\n this.replaceToggleButton =\n new ToolbarToggle(i18nString(UIStrings.enableFindAndReplace), 'replace', undefined, 'replace');\n ARIAUtils.setLabel(this.replaceToggleButton.element, i18nString(UIStrings.enableFindAndReplace));\n this.replaceToggleButton.addEventListener(ToolbarButton.Events.CLICK, this.toggleReplace, this);\n replaceToggleToolbar.appendToolbarItem(this.replaceToggleButton);\n\n // Elements within `searchInputElements` are added according to their expected tab order.\n const searchInputElements = this.footerElement.createChild('div', 'search-inputs');\n const iconAndInput = searchInputElements.createChild('div', 'icon-and-input');\n const searchIcon = IconButton.Icon.create('search');\n iconAndInput.appendChild(searchIcon);\n\n this.searchInputElement = HistoryInput.create();\n this.searchInputElement.type = 'search';\n this.searchInputElement.classList.add('search-replace', 'search');\n this.searchInputElement.id = 'search-input-field';\n this.searchInputElement.autocomplete = 'off';\n this.searchInputElement.placeholder = i18nString(UIStrings.findString);\n this.searchInputElement.setAttribute(\n 'jslog',\n `${VisualLogging.textField('search').track({change: true, keydown: 'ArrowUp|ArrowDown|Enter|Escape'})}`);\n this.searchInputElement.addEventListener('keydown', this.onSearchKeyDown.bind(this), true);\n this.searchInputElement.addEventListener('input', this.onInput.bind(this), false);\n iconAndInput.appendChild(this.searchInputElement);\n\n const replaceInputElements = searchInputElements.createChild('div', 'replace-element input-line');\n this.replaceInputElement = replaceInputElements.createChild('input', 'search-replace') as HTMLInputElement;\n this.replaceInputElement.addEventListener('keydown', this.onReplaceKeyDown.bind(this), true);\n this.replaceInputElement.placeholder = i18nString(UIStrings.replace);\n this.replaceInputElement.setAttribute(\n 'jslog', `${VisualLogging.textField('replace').track({change: true, keydown: 'Enter'})}`);\n\n const replaceInputClearButton = createClearButton('clear-replace-input');\n replaceInputClearButton.addEventListener('click', () => {\n this.replaceInputElement.value = '';\n this.replaceInputElement.focus();\n });\n replaceInputElements.appendChild(replaceInputClearButton);\n\n const searchConfigButtons = searchInputElements.createChild('div', 'search-config-buttons');\n const clearButton = createClearButton('clear-search-input');\n clearButton.addEventListener('click', () => {\n this.searchInputElement.value = '';\n this.clearSearch();\n this.searchInputElement.focus();\n });\n searchConfigButtons.appendChild(clearButton);\n if (this.searchProvider.supportsRegexSearch()) {\n const iconName = 'regular-expression';\n this.regexButton = new Buttons.Button.Button();\n this.regexButton.data = {\n variant: Buttons.Button.Variant.ICON_TOGGLE,\n size: Buttons.Button.Size.SMALL,\n iconName,\n toggledIconName: iconName,\n toggleType: Buttons.Button.ToggleType.PRIMARY,\n toggled: false,\n jslogContext: iconName,\n title: i18nString(UIStrings.enableCaseSensitive),\n };\n this.regexButton.addEventListener('click', () => this.toggleRegexSearch());\n searchConfigButtons.appendChild(this.regexButton);\n }\n\n if (this.searchProvider.supportsCaseSensitiveSearch()) {\n const iconName = 'match-case';\n this.caseSensitiveButton = new Buttons.Button.Button();\n this.caseSensitiveButton.data = {\n variant: Buttons.Button.Variant.ICON_TOGGLE,\n size: Buttons.Button.Size.SMALL,\n iconName,\n toggledIconName: iconName,\n toggled: false,\n toggleType: Buttons.Button.ToggleType.PRIMARY,\n title: i18nString(UIStrings.enableCaseSensitive),\n jslogContext: iconName,\n };\n this.caseSensitiveButton.addEventListener('click', () => this.toggleCaseSensitiveSearch());\n searchConfigButtons.appendChild(this.caseSensitiveButton);\n }\n\n // Introduce a separate element for the background of the `Find` input line (instead of\n // grouping together the `Find` input together with all search config option buttons\n // and styling the parent's background).\n // This allows for a tabbing order that can jump from the `Find` input, to\n // the `Replace` input, and back to all search config option buttons.\n searchInputElements.createChild('div', 'input-line search-input-background');\n\n const buttonsContainer = this.footerElement.createChild('div', 'toolbar-search-buttons');\n const firstRowButtons = buttonsContainer.createChild('div', 'first-row-buttons');\n\n const toolbar = new Toolbar('toolbar-search-options', firstRowButtons);\n this.searchNavigationPrevElement =\n new ToolbarButton(i18nString(UIStrings.searchPrevious), 'chevron-up', undefined, 'select-previous');\n this.searchNavigationPrevElement.addEventListener(ToolbarButton.Events.CLICK, () => this.onPrevButtonSearch());\n toolbar.appendToolbarItem(this.searchNavigationPrevElement);\n ARIAUtils.setLabel(this.searchNavigationPrevElement.element, i18nString(UIStrings.searchPrevious));\n\n this.searchNavigationNextElement =\n new ToolbarButton(i18nString(UIStrings.searchNext), 'chevron-down', undefined, 'select-next');\n this.searchNavigationNextElement.addEventListener(ToolbarButton.Events.CLICK, () => this.onNextButtonSearch());\n ARIAUtils.setLabel(this.searchNavigationNextElement.element, i18nString(UIStrings.searchNext));\n toolbar.appendToolbarItem(this.searchNavigationNextElement);\n\n const matchesText = new ToolbarText();\n this.matchesElement = matchesText.element;\n this.matchesElement.style.fontVariantNumeric = 'tabular-nums';\n this.matchesElement.style.color = 'var(--sys-color-on-surface-subtle)';\n this.matchesElement.style.padding = '0 var(--sys-size-3)';\n this.matchesElement.classList.add('search-results-matches');\n toolbar.appendToolbarItem(matchesText);\n\n const cancelButtonElement = new Buttons.Button.Button();\n cancelButtonElement.data = {\n variant: Buttons.Button.Variant.TOOLBAR,\n size: Buttons.Button.Size.REGULAR,\n iconName: 'cross',\n title: i18nString(UIStrings.closeSearchBar),\n jslogContext: 'close-search',\n };\n\n cancelButtonElement.classList.add('close-search-button');\n cancelButtonElement.addEventListener('click', () => this.closeSearch());\n firstRowButtons.appendChild(cancelButtonElement);\n\n const secondRowButtons = buttonsContainer.createChild('div', 'second-row-buttons replace-element');\n\n this.replaceButtonElement = createTextButton(i18nString(UIStrings.replace), this.replace.bind(this), {\n className: 'search-action-button',\n jslogContext: 'replace',\n });\n this.replaceButtonElement.disabled = true;\n secondRowButtons.appendChild(this.replaceButtonElement);\n\n this.replaceAllButtonElement = createTextButton(i18nString(UIStrings.replaceAll), this.replaceAll.bind(this), {\n className: 'search-action-button',\n jslogContext: 'replace-all',\n });\n\n secondRowButtons.appendChild(this.replaceAllButtonElement);\n this.replaceAllButtonElement.disabled = true;\n\n this.minimalSearchQuerySize = 3;\n this.loadSetting();\n }\n\n static fromElement(element: Element|null): SearchableView|null {\n let view: (SearchableView|null)|null = null;\n while (element && !view) {\n view = searchableViewsByElement.get(element) || null;\n element = element.parentElementOrShadowHost();\n }\n return view;\n }\n\n private toggleCaseSensitiveSearch(): void {\n if (this.caseSensitiveButton) {\n this.caseSensitiveButton.title = this.caseSensitiveButton.toggled ? i18nString(UIStrings.disableCaseSensitive) :\n i18nString(UIStrings.enableCaseSensitive);\n }\n this.saveSetting();\n this.performSearch(false, true);\n }\n\n private toggleRegexSearch(): void {\n if (this.regexButton) {\n this.regexButton.title = this.regexButton.toggled ? i18nString(UIStrings.disableRegularExpression) :\n i18nString(UIStrings.enableRegularExpression);\n }\n this.saveSetting();\n this.performSearch(false, true);\n }\n\n private toggleReplace(): void {\n const replaceEnabled = this.replaceToggleButton.isToggled();\n const label =\n replaceEnabled ? i18nString(UIStrings.disableFindAndReplace) : i18nString(UIStrings.enableFindAndReplace);\n ARIAUtils.setLabel(this.replaceToggleButton.element, label);\n this.replaceToggleButton.element.title = label;\n this.updateSecondRowVisibility();\n }\n\n private saveSetting(): void {\n if (!this.setting) {\n return;\n }\n const settingValue = this.setting.get() || {};\n if (this.caseSensitiveButton) {\n settingValue.caseSensitive = this.caseSensitiveButton.toggled;\n }\n if (this.regexButton) {\n settingValue.isRegex = this.regexButton.toggled;\n }\n this.setting.set(settingValue);\n }\n\n private loadSetting(): void {\n const settingValue = this.setting ? (this.setting.get() || {}) : {};\n if (this.searchProvider.supportsCaseSensitiveSearch() && this.caseSensitiveButton) {\n this.caseSensitiveButton.toggled = Boolean(settingValue.caseSensitive);\n const label = settingValue.caseSensitive ? i18nString(UIStrings.disableCaseSensitive) :\n i18nString(UIStrings.enableCaseSensitive);\n this.caseSensitiveButton.title = label;\n ARIAUtils.setLabel(this.caseSensitiveButton, label);\n }\n if (this.searchProvider.supportsRegexSearch() && this.regexButton) {\n this.regexButton.toggled = Boolean(settingValue.isRegex);\n const label = settingValue.regular ? i18nString(UIStrings.disableRegularExpression) :\n i18nString(UIStrings.enableRegularExpression);\n this.regexButton.title = label;\n ARIAUtils.setLabel(this.regexButton, label);\n }\n }\n\n setMinimalSearchQuerySize(minimalSearchQuerySize: number): void {\n this.minimalSearchQuerySize = minimalSearchQuerySize;\n }\n\n setPlaceholder(placeholder: string, ariaLabel?: string): void {\n this.searchInputElement.placeholder = placeholder;\n if (ariaLabel) {\n ARIAUtils.setLabel(this.searchInputElement, ariaLabel);\n }\n }\n\n setReplaceable(replaceable: boolean): void {\n this.replaceable = replaceable;\n }\n\n updateSearchMatchesCount(matches: number): void {\n // TODO(crbug.com/1172300) Ignored during the jsdoc to ts migration\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const untypedSearchProvider = (this.searchProvider as any);\n if (untypedSearchProvider.currentSearchMatches === matches) {\n return;\n }\n untypedSearchProvider.currentSearchMatches = matches;\n this.updateSearchMatchesCountAndCurrentMatchIndex(untypedSearchProvider.currentQuery ? matches : 0, -1);\n }\n\n updateCurrentMatchIndex(currentMatchIndex: number): void {\n // TODO(crbug.com/1172300) Ignored during the jsdoc to ts migration\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const untypedSearchProvider = (this.searchProvider as any);\n this.updateSearchMatchesCountAndCurrentMatchIndex(untypedSearchProvider.currentSearchMatches, currentMatchIndex);\n }\n\n isSearchVisible(): boolean {\n return Boolean(this.searchIsVisible);\n }\n\n closeSearch(): void {\n this.cancelSearch();\n if (this.footerElementContainer.hasFocus()) {\n this.focus();\n }\n\n this.searchProvider.onSearchClosed?.();\n }\n\n private toggleSearchBar(toggled: boolean): void {\n this.footerElementContainer.classList.toggle('hidden', !toggled);\n this.doResize();\n }\n\n cancelSearch(): void {\n if (!this.searchIsVisible) {\n return;\n }\n this.resetSearch();\n delete this.searchIsVisible;\n this.toggleSearchBar(false);\n }\n\n resetSearch(): void {\n this.clearSearch();\n this.updateReplaceVisibility();\n this.matchesElement.textContent = '';\n }\n\n refreshSearch(): void {\n if (!this.searchIsVisible) {\n return;\n }\n this.resetSearch();\n this.performSearch(false, false);\n }\n\n handleFindNextShortcut(): boolean {\n if (!this.searchIsVisible) {\n return false;\n }\n this.searchProvider.jumpToNextSearchResult();\n return true;\n }\n\n handleFindPreviousShortcut(): boolean {\n if (!this.searchIsVisible) {\n return false;\n }\n this.searchProvider.jumpToPreviousSearchResult();\n return true;\n }\n\n handleFindShortcut(): boolean {\n this.showSearchField();\n return true;\n }\n\n handleCancelSearchShortcut(): boolean {\n if (!this.searchIsVisible) {\n return false;\n }\n this.closeSearch();\n return true;\n }\n\n private updateSearchNavigationButtonState(enabled: boolean): void {\n this.replaceButtonElement.disabled = !enabled;\n this.replaceAllButtonElement.disabled = !enabled;\n this.searchNavigationPrevElement.setEnabled(enabled);\n this.searchNavigationNextElement.setEnabled(enabled);\n }\n\n private updateSearchMatchesCountAndCurrentMatchIndex(matches: number, currentMatchIndex: number): void {\n if (!this.currentQuery) {\n this.matchesElement.textContent = '';\n } else if (matches === 0 || currentMatchIndex >= 0) {\n this.matchesElement.textContent = i18nString(UIStrings.dOfD, {PH1: currentMatchIndex + 1, PH2: matches});\n ARIAUtils.setLabel(\n this.matchesElement, i18nString(UIStrings.accessibledOfD, {PH1: currentMatchIndex + 1, PH2: matches}));\n } else if (matches === 1) {\n this.matchesElement.textContent = i18nString(UIStrings.matchString);\n } else {\n this.matchesElement.textContent = i18nString(UIStrings.dMatches, {PH1: matches});\n }\n this.updateSearchNavigationButtonState(matches > 0);\n }\n\n showSearchField(): void {\n if (this.searchIsVisible) {\n this.cancelSearch();\n }\n\n let queryCandidate;\n if (!this.searchInputElement.hasFocus()) {\n const selection = InspectorView.instance().element.window().getSelection();\n if (selection && selection.rangeCount) {\n queryCandidate = selection.toString().replace(/\\r?\\n.*/, '');\n }\n }\n\n this.toggleSearchBar(true);\n this.updateReplaceVisibility();\n if (queryCandidate) {\n this.searchInputElement.value = queryCandidate;\n }\n this.performSearch(false, false);\n this.searchInputElement.focus();\n this.searchInputElement.select();\n this.searchIsVisible = true;\n }\n\n private updateReplaceVisibility(): void {\n this.replaceToggleButton.setVisible(this.replaceable);\n if (!this.replaceable) {\n this.replaceToggleButton.setToggled(false);\n this.updateSecondRowVisibility();\n }\n }\n\n private onSearchKeyDown(ev: Event): void {\n const event = (ev as KeyboardEvent);\n if (Platform.KeyboardUtilities.isEscKey(event)) {\n this.closeSearch();\n event.consume(true);\n return;\n }\n if (!(event.key === 'Enter')) {\n return;\n }\n\n if (!this.currentQuery) {\n this.performSearch(true, true, event.shiftKey);\n } else {\n this.jumpToNextSearchResult(event.shiftKey);\n }\n }\n\n private onReplaceKeyDown(event: KeyboardEvent): void {\n if (event.key === 'Enter') {\n this.replace();\n }\n }\n\n private jumpToNextSearchResult(isBackwardSearch?: boolean): void {\n if (!this.currentQuery) {\n return;\n }\n\n if (isBackwardSearch) {\n this.searchProvider.jumpToPreviousSearchResult();\n } else {\n this.searchProvider.jumpToNextSearchResult();\n }\n }\n\n private onNextButtonSearch(): void {\n this.jumpToNextSearchResult();\n }\n\n private onPrevButtonSearch(): void {\n this.jumpToNextSearchResult(true);\n }\n\n private clearSearch(): void {\n // TODO(crbug.com/1172300) Ignored during the jsdoc to ts migration\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const untypedSearchProvider = (this.searchProvider as any);\n delete this.currentQuery;\n if (Boolean(untypedSearchProvider.currentQuery)) {\n delete untypedSearchProvider.currentQuery;\n this.searchProvider.onSearchCanceled();\n }\n this.updateSearchMatchesCountAndCurrentMatchIndex(0, -1);\n }\n\n private performSearch(forceSearch: boolean, shouldJump: boolean, jumpBackwards?: boolean): void {\n const query = this.searchInputElement.value;\n if (!query || (!forceSearch && query.length < this.minimalSearchQuerySize && !this.currentQuery)) {\n this.clearSearch();\n return;\n }\n\n this.currentQuery = query;\n // TODO(crbug.com/1172300) Ignored during the jsdoc to ts migration\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (this.searchProvider as any).currentQuery = query;\n\n const searchConfig = this.currentSearchConfig();\n this.searchProvider.performSearch(searchConfig, shouldJump, jumpBackwards);\n }\n\n private currentSearchConfig(): SearchConfig {\n const query = this.searchInputElement.value;\n const caseSensitive = this.caseSensitiveButton ? this.caseSensitiveButton.toggled : false;\n const isRegex = this.regexButton ? this.regexButton.toggled : false;\n return new SearchConfig(query, caseSensitive, isRegex);\n }\n\n private updateSecondRowVisibility(): void {\n const secondRowVisible = this.replaceToggleButton.isToggled();\n this.footerElementContainer.classList.toggle('replaceable', secondRowVisible);\n\n if (secondRowVisible) {\n this.replaceInputElement.focus();\n } else {\n this.searchInputElement.focus();\n }\n this.doResize();\n }\n\n private replace(): void {\n if (!this.replaceProvider) {\n throw new Error('No \\'replacable\\' provided to SearchableView!');\n }\n const searchConfig = this.currentSearchConfig();\n this.replaceProvider.replaceSelectionWith(searchConfig, this.replaceInputElement.value);\n delete this.currentQuery;\n this.performSearch(true, true);\n }\n\n private replaceAll(): void {\n if (!this.replaceProvider) {\n throw new Error('No \\'replacable\\' provided to SearchableView!');\n }\n const searchConfig = this.currentSearchConfig();\n this.replaceProvider.replaceAllWith(searchConfig, this.replaceInputElement.value);\n }\n\n private onInput(): void {\n if (!Common.Settings.Settings.instance().moduleSetting('search-as-you-type').get()) {\n this.clearSearch();\n return;\n }\n\n if (this.valueChangedTimeoutId) {\n clearTimeout(this.valueChangedTimeoutId);\n }\n const timeout = this.searchInputElement.value.length < 3 ? 200 : 0;\n this.valueChangedTimeoutId = window.setTimeout(this.onValueChanged.bind(this), timeout);\n }\n\n private onValueChanged(): void {\n if (!this.searchIsVisible) {\n return;\n }\n delete this.valueChangedTimeoutId;\n this.performSearch(false, true);\n }\n}\n\nconst searchableViewsByElement = new WeakMap();\n\nexport interface Searchable {\n onSearchCanceled(): void;\n // Called when the search toolbar is closed\n onSearchClosed?: () => void;\n performSearch(searchConfig: SearchConfig, shouldJump: boolean, jumpBackwards?: boolean): void;\n jumpToNextSearchResult(): void;\n jumpToPreviousSearchResult(): void;\n supportsCaseSensitiveSearch(): boolean;\n supportsRegexSearch(): boolean;\n}\n\nexport interface Replaceable {\n replaceSelectionWith(searchConfig: SearchConfig, replacement: string): void;\n replaceAllWith(searchConfig: SearchConfig, replacement: string): void;\n}\n\nexport interface SearchRegexResult {\n regex: RegExp;\n fromQuery: boolean;\n}\n\nexport class SearchConfig {\n query: string;\n caseSensitive: boolean;\n isRegex: boolean;\n\n constructor(query: string, caseSensitive: boolean, isRegex: boolean) {\n this.query = query;\n this.caseSensitive = caseSensitive;\n this.isRegex = isRegex;\n }\n\n toSearchRegex(global?: boolean): SearchRegexResult {\n let modifiers = this.caseSensitive ? '' : 'i';\n if (global) {\n modifiers += 'g';\n }\n\n // Check if query is surrounded by forward slashes\n const isRegexFormatted = this.query.startsWith('/') && this.query.endsWith('/');\n const query = this.isRegex && !isRegexFormatted ? '/' + this.query + '/' : this.query;\n let regex: RegExp|undefined;\n let fromQuery = false;\n\n // First try creating regex if user knows the / / hint.\n try {\n if (/^\\/.+\\/$/.test(query) && this.isRegex) {\n regex = new RegExp(query.substring(1, query.length - 1), modifiers);\n fromQuery = true;\n }\n } catch (e) {\n // Silent catch.\n }\n\n // Otherwise just do a plain text search.\n if (!regex) {\n regex = Platform.StringUtilities.createPlainTextSearchRegex(query, modifiers);\n }\n\n return {\n regex,\n fromQuery,\n };\n }\n}\n"]} \ No newline at end of file +{"version":3,"file":"SearchableView.js","sourceRoot":"","sources":["../../../../../../front_end/ui/legacy/SearchableView.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAEH,OAAO,KAAK,MAAM,MAAM,6BAA6B,CAAC;AACtD,OAAO,KAAK,IAAI,MAAM,yBAAyB,CAAC;AAChD,OAAO,KAAK,QAAQ,MAAM,iCAAiC,CAAC;AAC5D,OAAO,KAAK,aAAa,MAAM,2CAA2C,CAAC;AAC3E,OAAO,KAAK,OAAO,MAAM,kCAAkC,CAAC;AAC5D,OAAO,KAAK,UAAU,MAAM,0CAA0C,CAAC;AAEvE,OAAO,KAAK,SAAS,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAC,aAAa,EAAC,MAAM,oBAAoB,CAAC;AACjD,OAAO,oBAAoB,MAAM,gCAAgC,CAAC;AAClE,OAAO,EAAC,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,aAAa,EAAC,MAAM,cAAc,CAAC;AAChF,OAAO,EAAC,kBAAkB,EAAE,gBAAgB,EAAC,M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AgB,CAAC,CAAC,CAAC,GAAG,GAAG,IAAI,CAAC,KAAK,GAAG,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC;QACtF,IAAI,KAAuB,CAAC;QAC5B,IAAI,SAAS,GAAG,KAAK,CAAC;QAEtB,uDAAuD;QACvD,IAAI,CAAC;YACH,IAAI,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;gBAC3C,KAAK,GAAG,IAAI,MAAM,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,EAAE,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,EAAE,SAAS,CAAC,CAAC;gBACpE,SAAS,GAAG,IAAI,CAAC;YACnB,CAAC;QACH,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACX,gBAAgB;QAClB,CAAC;QAED,yCAAyC;QACzC,IAAI,CAAC,KAAK,EAAE,CAAC;YACX,KAAK,GAAG,QAAQ,CAAC,eAAe,CAAC,0BAA0B,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC;QAChF,CAAC;QAED,OAAO;YACL,KAAK;YACL,SAAS;SACV,CAAC;IACJ,CAAC;CACF","sourcesContent":["// Copyright 2021 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\n/*\n * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved.\n * Copyright (C) 2007 Matt Lilek (pewtermoose@gmail.com).\n * Copyright (C) 2009 Joseph Pecoraro\n * Copyright (C) 2011 Google Inc. All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n *\n * 1. Redistributions of source code must retain the above copyright\n * notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n * notice, this list of conditions and the following disclaimer in the\n * documentation and/or other materials provided with the distribution.\n * 3. Neither the name of Apple Computer, Inc. (\"Apple\") nor the names of\n * its contributors may be used to endorse or promote products derived\n * from this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nimport * as Common from '../../core/common/common.js';\nimport * as i18n from '../../core/i18n/i18n.js';\nimport * as Platform from '../../core/platform/platform.js';\nimport * as VisualLogging from '../../ui/visual_logging/visual_logging.js';\nimport * as Buttons from '../components/buttons/buttons.js';\nimport * as IconButton from '../components/icon_button/icon_button.js';\n\nimport * as ARIAUtils from './ARIAUtils.js';\nimport {InspectorView} from './InspectorView.js';\nimport searchableViewStyles from './searchableView.css.legacy.js';\nimport {Toolbar, ToolbarButton, ToolbarText, ToolbarToggle} from './Toolbar.js';\nimport {createHistoryInput, createTextButton} from './UIUtils.js';\nimport {VBox} from './Widget.js';\n\nconst UIStrings = {\n /**\n *@description Text on a button to replace one instance with input text for the ctrl+F search bar\n */\n replace: 'Replace',\n /**\n *@description Tooltip text on a toggle to enable replacing one instance with input text for the ctrl+F search bar\n */\n enableFindAndReplace: 'Find and replace',\n /**\n *@description Tooltip text on a toggle to disable replacing one instance with input text for the ctrl+F search bar\n */\n disableFindAndReplace: 'Disable find and replace',\n /**\n *@description Text to find an item\n */\n findString: 'Find',\n /**\n *@description Tooltip text on a button to search previous instance for the ctrl+F search bar\n */\n searchPrevious: 'Show previous result',\n /**\n *@description Tooltip text on a button to search next instance for the ctrl+F search bar\n */\n searchNext: 'Show next result',\n /**\n *@description Tooltip text on a toggle to enable search by matching case of the input\n */\n enableCaseSensitive: 'Enable case sensitive search',\n /**\n *@description Tooltip text on a toggle to disable search by matching case of the input\n */\n disableCaseSensitive: 'Disable case sensitive search',\n /**\n *@description Tooltip text on a toggle to enable searching with regular expression\n */\n enableRegularExpression: 'Enable regular expressions',\n /**\n *@description Tooltip text on a toggle to disable searching with regular expression\n */\n disableRegularExpression: 'Disable regular expressions',\n /**\n *@description Tooltip text on a button to close the search bar\n */\n closeSearchBar: 'Close search bar',\n /**\n *@description Text on a button to replace all instances with input text for the ctrl+F search bar\n */\n replaceAll: 'Replace all',\n /**\n *@description Text to indicate the current match index and the total number of matches for the ctrl+F search bar\n *@example {2} PH1\n *@example {3} PH2\n */\n dOfD: '{PH1} of {PH2}',\n /**\n *@description Tooltip text to indicate the current match index and the total number of matches for the ctrl+F search bar\n *@example {2} PH1\n *@example {3} PH2\n */\n accessibledOfD: 'Shows result {PH1} of {PH2}',\n /**\n *@description Text to indicate search result for the ctrl+F search bar\n */\n matchString: '1 match',\n /**\n *@description Text to indicate search result for the ctrl+F search bar\n *@example {2} PH1\n */\n dMatches: '{PH1} matches',\n /**\n *@description Text on a button to search previous instance for the ctrl+F search bar\n */\n clearInput: 'Clear',\n};\nconst str_ = i18n.i18n.registerUIStrings('ui/legacy/SearchableView.ts', UIStrings);\nconst i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);\n\nfunction createClearButton(jslogContext: string): Buttons.Button.Button {\n const button = new Buttons.Button.Button();\n button.data = {\n variant: Buttons.Button.Variant.ICON,\n size: Buttons.Button.Size.SMALL,\n jslogContext,\n title: i18nString(UIStrings.clearInput),\n iconName: 'cross-circle-filled',\n };\n button.ariaLabel = i18nString(UIStrings.clearInput);\n button.classList.add('clear-button');\n button.tabIndex = -1;\n return button;\n}\nexport class SearchableView extends VBox {\n private searchProvider: Searchable;\n private replaceProvider: Replaceable|null;\n // TODO(crbug.com/1172300) Ignored during the jsdoc to ts migration\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n private setting: Common.Settings.Setting|null;\n private replaceable: boolean;\n private readonly footerElementContainer: HTMLElement;\n private readonly footerElement: HTMLElement;\n private replaceToggleButton: ToolbarToggle;\n private searchInputElement: HTMLInputElement;\n private matchesElement: HTMLElement;\n private searchNavigationPrevElement: ToolbarButton;\n private searchNavigationNextElement: ToolbarButton;\n private readonly replaceInputElement: HTMLInputElement;\n private caseSensitiveButton: Buttons.Button.Button|undefined;\n private regexButton: Buttons.Button.Button|undefined;\n private replaceButtonElement: Buttons.Button.Button;\n private replaceAllButtonElement: Buttons.Button.Button;\n private minimalSearchQuerySize: number;\n private searchIsVisible?: boolean;\n private currentQuery?: string;\n private valueChangedTimeoutId?: number;\n\n constructor(searchable: Searchable, replaceable: Replaceable|null, settingName?: string) {\n super(true);\n this.registerRequiredCSS(searchableViewStyles);\n searchableViewsByElement.set(this.element, this);\n\n this.searchProvider = searchable;\n this.replaceProvider = replaceable;\n this.setting = settingName ? Common.Settings.Settings.instance().createSetting(settingName, {}) : null;\n this.replaceable = false;\n\n this.contentElement.createChild('slot');\n this.footerElementContainer = this.contentElement.createChild('div', 'search-bar hidden');\n this.footerElementContainer.style.order = '100';\n this.footerElement = this.footerElementContainer.createChild('div', 'toolbar-search');\n this.footerElement.setAttribute('jslog', `${VisualLogging.toolbar('search').track({resize: true})}`);\n\n const replaceToggleToolbar = new Toolbar('replace-toggle-toolbar', this.footerElement);\n this.replaceToggleButton =\n new ToolbarToggle(i18nString(UIStrings.enableFindAndReplace), 'replace', undefined, 'replace');\n ARIAUtils.setLabel(this.replaceToggleButton.element, i18nString(UIStrings.enableFindAndReplace));\n this.replaceToggleButton.addEventListener(ToolbarButton.Events.CLICK, this.toggleReplace, this);\n replaceToggleToolbar.appendToolbarItem(this.replaceToggleButton);\n\n // Elements within `searchInputElements` are added according to their expected tab order.\n const searchInputElements = this.footerElement.createChild('div', 'search-inputs');\n const iconAndInput = searchInputElements.createChild('div', 'icon-and-input');\n const searchIcon = IconButton.Icon.create('search');\n iconAndInput.appendChild(searchIcon);\n\n this.searchInputElement = createHistoryInput('search', 'search-replace search');\n this.searchInputElement.id = 'search-input-field';\n this.searchInputElement.autocomplete = 'off';\n this.searchInputElement.placeholder = i18nString(UIStrings.findString);\n this.searchInputElement.setAttribute(\n 'jslog',\n `${VisualLogging.textField('search').track({change: true, keydown: 'ArrowUp|ArrowDown|Enter|Escape'})}`);\n this.searchInputElement.addEventListener('keydown', this.onSearchKeyDown.bind(this), true);\n this.searchInputElement.addEventListener('input', this.onInput.bind(this), false);\n iconAndInput.appendChild(this.searchInputElement);\n\n const replaceInputElements = searchInputElements.createChild('div', 'replace-element input-line');\n this.replaceInputElement = replaceInputElements.createChild('input', 'search-replace');\n this.replaceInputElement.addEventListener('keydown', this.onReplaceKeyDown.bind(this), true);\n this.replaceInputElement.placeholder = i18nString(UIStrings.replace);\n this.replaceInputElement.setAttribute(\n 'jslog', `${VisualLogging.textField('replace').track({change: true, keydown: 'Enter'})}`);\n\n const replaceInputClearButton = createClearButton('clear-replace-input');\n replaceInputClearButton.addEventListener('click', () => {\n this.replaceInputElement.value = '';\n this.replaceInputElement.focus();\n });\n replaceInputElements.appendChild(replaceInputClearButton);\n\n const searchConfigButtons = searchInputElements.createChild('div', 'search-config-buttons');\n const clearButton = createClearButton('clear-search-input');\n clearButton.addEventListener('click', () => {\n this.searchInputElement.value = '';\n this.clearSearch();\n this.searchInputElement.focus();\n });\n searchConfigButtons.appendChild(clearButton);\n if (this.searchProvider.supportsRegexSearch()) {\n const iconName = 'regular-expression';\n this.regexButton = new Buttons.Button.Button();\n this.regexButton.data = {\n variant: Buttons.Button.Variant.ICON_TOGGLE,\n size: Buttons.Button.Size.SMALL,\n iconName,\n toggledIconName: iconName,\n toggleType: Buttons.Button.ToggleType.PRIMARY,\n toggled: false,\n jslogContext: iconName,\n title: i18nString(UIStrings.enableCaseSensitive),\n };\n this.regexButton.addEventListener('click', () => this.toggleRegexSearch());\n searchConfigButtons.appendChild(this.regexButton);\n }\n\n if (this.searchProvider.supportsCaseSensitiveSearch()) {\n const iconName = 'match-case';\n this.caseSensitiveButton = new Buttons.Button.Button();\n this.caseSensitiveButton.data = {\n variant: Buttons.Button.Variant.ICON_TOGGLE,\n size: Buttons.Button.Size.SMALL,\n iconName,\n toggledIconName: iconName,\n toggled: false,\n toggleType: Buttons.Button.ToggleType.PRIMARY,\n title: i18nString(UIStrings.enableCaseSensitive),\n jslogContext: iconName,\n };\n this.caseSensitiveButton.addEventListener('click', () => this.toggleCaseSensitiveSearch());\n searchConfigButtons.appendChild(this.caseSensitiveButton);\n }\n\n // Introduce a separate element for the background of the `Find` input line (instead of\n // grouping together the `Find` input together with all search config option buttons\n // and styling the parent's background).\n // This allows for a tabbing order that can jump from the `Find` input, to\n // the `Replace` input, and back to all search config option buttons.\n searchInputElements.createChild('div', 'input-line search-input-background');\n\n const buttonsContainer = this.footerElement.createChild('div', 'toolbar-search-buttons');\n const firstRowButtons = buttonsContainer.createChild('div', 'first-row-buttons');\n\n const toolbar = new Toolbar('toolbar-search-options', firstRowButtons);\n this.searchNavigationPrevElement =\n new ToolbarButton(i18nString(UIStrings.searchPrevious), 'chevron-up', undefined, 'select-previous');\n this.searchNavigationPrevElement.addEventListener(ToolbarButton.Events.CLICK, () => this.onPrevButtonSearch());\n toolbar.appendToolbarItem(this.searchNavigationPrevElement);\n ARIAUtils.setLabel(this.searchNavigationPrevElement.element, i18nString(UIStrings.searchPrevious));\n\n this.searchNavigationNextElement =\n new ToolbarButton(i18nString(UIStrings.searchNext), 'chevron-down', undefined, 'select-next');\n this.searchNavigationNextElement.addEventListener(ToolbarButton.Events.CLICK, () => this.onNextButtonSearch());\n ARIAUtils.setLabel(this.searchNavigationNextElement.element, i18nString(UIStrings.searchNext));\n toolbar.appendToolbarItem(this.searchNavigationNextElement);\n\n const matchesText = new ToolbarText();\n this.matchesElement = matchesText.element;\n this.matchesElement.style.fontVariantNumeric = 'tabular-nums';\n this.matchesElement.style.color = 'var(--sys-color-on-surface-subtle)';\n this.matchesElement.style.padding = '0 var(--sys-size-3)';\n this.matchesElement.classList.add('search-results-matches');\n toolbar.appendToolbarItem(matchesText);\n\n const cancelButtonElement = new Buttons.Button.Button();\n cancelButtonElement.data = {\n variant: Buttons.Button.Variant.TOOLBAR,\n size: Buttons.Button.Size.REGULAR,\n iconName: 'cross',\n title: i18nString(UIStrings.closeSearchBar),\n jslogContext: 'close-search',\n };\n\n cancelButtonElement.classList.add('close-search-button');\n cancelButtonElement.addEventListener('click', () => this.closeSearch());\n firstRowButtons.appendChild(cancelButtonElement);\n\n const secondRowButtons = buttonsContainer.createChild('div', 'second-row-buttons replace-element');\n\n this.replaceButtonElement = createTextButton(i18nString(UIStrings.replace), this.replace.bind(this), {\n className: 'search-action-button',\n jslogContext: 'replace',\n });\n this.replaceButtonElement.disabled = true;\n secondRowButtons.appendChild(this.replaceButtonElement);\n\n this.replaceAllButtonElement = createTextButton(i18nString(UIStrings.replaceAll), this.replaceAll.bind(this), {\n className: 'search-action-button',\n jslogContext: 'replace-all',\n });\n\n secondRowButtons.appendChild(this.replaceAllButtonElement);\n this.replaceAllButtonElement.disabled = true;\n\n this.minimalSearchQuerySize = 3;\n this.loadSetting();\n }\n\n static fromElement(element: Element|null): SearchableView|null {\n let view: (SearchableView|null)|null = null;\n while (element && !view) {\n view = searchableViewsByElement.get(element) || null;\n element = element.parentElementOrShadowHost();\n }\n return view;\n }\n\n private toggleCaseSensitiveSearch(): void {\n if (this.caseSensitiveButton) {\n this.caseSensitiveButton.title = this.caseSensitiveButton.toggled ? i18nString(UIStrings.disableCaseSensitive) :\n i18nString(UIStrings.enableCaseSensitive);\n }\n this.saveSetting();\n this.performSearch(false, true);\n }\n\n private toggleRegexSearch(): void {\n if (this.regexButton) {\n this.regexButton.title = this.regexButton.toggled ? i18nString(UIStrings.disableRegularExpression) :\n i18nString(UIStrings.enableRegularExpression);\n }\n this.saveSetting();\n this.performSearch(false, true);\n }\n\n private toggleReplace(): void {\n const replaceEnabled = this.replaceToggleButton.isToggled();\n const label =\n replaceEnabled ? i18nString(UIStrings.disableFindAndReplace) : i18nString(UIStrings.enableFindAndReplace);\n ARIAUtils.setLabel(this.replaceToggleButton.element, label);\n this.replaceToggleButton.element.title = label;\n this.updateSecondRowVisibility();\n }\n\n private saveSetting(): void {\n if (!this.setting) {\n return;\n }\n const settingValue = this.setting.get() || {};\n if (this.caseSensitiveButton) {\n settingValue.caseSensitive = this.caseSensitiveButton.toggled;\n }\n if (this.regexButton) {\n settingValue.isRegex = this.regexButton.toggled;\n }\n this.setting.set(settingValue);\n }\n\n private loadSetting(): void {\n const settingValue = this.setting ? (this.setting.get() || {}) : {};\n if (this.searchProvider.supportsCaseSensitiveSearch() && this.caseSensitiveButton) {\n this.caseSensitiveButton.toggled = Boolean(settingValue.caseSensitive);\n const label = settingValue.caseSensitive ? i18nString(UIStrings.disableCaseSensitive) :\n i18nString(UIStrings.enableCaseSensitive);\n this.caseSensitiveButton.title = label;\n ARIAUtils.setLabel(this.caseSensitiveButton, label);\n }\n if (this.searchProvider.supportsRegexSearch() && this.regexButton) {\n this.regexButton.toggled = Boolean(settingValue.isRegex);\n const label = settingValue.regular ? i18nString(UIStrings.disableRegularExpression) :\n i18nString(UIStrings.enableRegularExpression);\n this.regexButton.title = label;\n ARIAUtils.setLabel(this.regexButton, label);\n }\n }\n\n setMinimalSearchQuerySize(minimalSearchQuerySize: number): void {\n this.minimalSearchQuerySize = minimalSearchQuerySize;\n }\n\n setPlaceholder(placeholder: string, ariaLabel?: string): void {\n this.searchInputElement.placeholder = placeholder;\n if (ariaLabel) {\n ARIAUtils.setLabel(this.searchInputElement, ariaLabel);\n }\n }\n\n setReplaceable(replaceable: boolean): void {\n this.replaceable = replaceable;\n }\n\n updateSearchMatchesCount(matches: number): void {\n // TODO(crbug.com/1172300) Ignored during the jsdoc to ts migration\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const untypedSearchProvider = (this.searchProvider as any);\n if (untypedSearchProvider.currentSearchMatches === matches) {\n return;\n }\n untypedSearchProvider.currentSearchMatches = matches;\n this.updateSearchMatchesCountAndCurrentMatchIndex(untypedSearchProvider.currentQuery ? matches : 0, -1);\n }\n\n updateCurrentMatchIndex(currentMatchIndex: number): void {\n // TODO(crbug.com/1172300) Ignored during the jsdoc to ts migration\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const untypedSearchProvider = (this.searchProvider as any);\n this.updateSearchMatchesCountAndCurrentMatchIndex(untypedSearchProvider.currentSearchMatches, currentMatchIndex);\n }\n\n isSearchVisible(): boolean {\n return Boolean(this.searchIsVisible);\n }\n\n closeSearch(): void {\n this.cancelSearch();\n if (this.footerElementContainer.hasFocus()) {\n this.focus();\n }\n\n this.searchProvider.onSearchClosed?.();\n }\n\n private toggleSearchBar(toggled: boolean): void {\n this.footerElementContainer.classList.toggle('hidden', !toggled);\n this.doResize();\n }\n\n cancelSearch(): void {\n if (!this.searchIsVisible) {\n return;\n }\n this.resetSearch();\n delete this.searchIsVisible;\n this.toggleSearchBar(false);\n }\n\n resetSearch(): void {\n this.clearSearch();\n this.updateReplaceVisibility();\n this.matchesElement.textContent = '';\n }\n\n refreshSearch(): void {\n if (!this.searchIsVisible) {\n return;\n }\n this.resetSearch();\n this.performSearch(false, false);\n }\n\n handleFindNextShortcut(): boolean {\n if (!this.searchIsVisible) {\n return false;\n }\n this.searchProvider.jumpToNextSearchResult();\n return true;\n }\n\n handleFindPreviousShortcut(): boolean {\n if (!this.searchIsVisible) {\n return false;\n }\n this.searchProvider.jumpToPreviousSearchResult();\n return true;\n }\n\n handleFindShortcut(): boolean {\n this.showSearchField();\n return true;\n }\n\n handleCancelSearchShortcut(): boolean {\n if (!this.searchIsVisible) {\n return false;\n }\n this.closeSearch();\n return true;\n }\n\n private updateSearchNavigationButtonState(enabled: boolean): void {\n this.replaceButtonElement.disabled = !enabled;\n this.replaceAllButtonElement.disabled = !enabled;\n this.searchNavigationPrevElement.setEnabled(enabled);\n this.searchNavigationNextElement.setEnabled(enabled);\n }\n\n private updateSearchMatchesCountAndCurrentMatchIndex(matches: number, currentMatchIndex: number): void {\n if (!this.currentQuery) {\n this.matchesElement.textContent = '';\n } else if (matches === 0 || currentMatchIndex >= 0) {\n this.matchesElement.textContent = i18nString(UIStrings.dOfD, {PH1: currentMatchIndex + 1, PH2: matches});\n ARIAUtils.setLabel(\n this.matchesElement, i18nString(UIStrings.accessibledOfD, {PH1: currentMatchIndex + 1, PH2: matches}));\n } else if (matches === 1) {\n this.matchesElement.textContent = i18nString(UIStrings.matchString);\n } else {\n this.matchesElement.textContent = i18nString(UIStrings.dMatches, {PH1: matches});\n }\n this.updateSearchNavigationButtonState(matches > 0);\n }\n\n showSearchField(): void {\n if (this.searchIsVisible) {\n this.cancelSearch();\n }\n\n let queryCandidate;\n if (!this.searchInputElement.hasFocus()) {\n const selection = InspectorView.instance().element.window().getSelection();\n if (selection && selection.rangeCount) {\n queryCandidate = selection.toString().replace(/\\r?\\n.*/, '');\n }\n }\n\n this.toggleSearchBar(true);\n this.updateReplaceVisibility();\n if (queryCandidate) {\n this.searchInputElement.value = queryCandidate;\n }\n this.performSearch(false, false);\n this.searchInputElement.focus();\n this.searchInputElement.select();\n this.searchIsVisible = true;\n }\n\n private updateReplaceVisibility(): void {\n this.replaceToggleButton.setVisible(this.replaceable);\n if (!this.replaceable) {\n this.replaceToggleButton.setToggled(false);\n this.updateSecondRowVisibility();\n }\n }\n\n private onSearchKeyDown(ev: Event): void {\n const event = (ev as KeyboardEvent);\n if (Platform.KeyboardUtilities.isEscKey(event)) {\n this.closeSearch();\n event.consume(true);\n return;\n }\n if (!(event.key === 'Enter')) {\n return;\n }\n\n if (!this.currentQuery) {\n this.performSearch(true, true, event.shiftKey);\n } else {\n this.jumpToNextSearchResult(event.shiftKey);\n }\n }\n\n private onReplaceKeyDown(event: KeyboardEvent): void {\n if (event.key === 'Enter') {\n this.replace();\n }\n }\n\n private jumpToNextSearchResult(isBackwardSearch?: boolean): void {\n if (!this.currentQuery) {\n return;\n }\n\n if (isBackwardSearch) {\n this.searchProvider.jumpToPreviousSearchResult();\n } else {\n this.searchProvider.jumpToNextSearchResult();\n }\n }\n\n private onNextButtonSearch(): void {\n this.jumpToNextSearchResult();\n }\n\n private onPrevButtonSearch(): void {\n this.jumpToNextSearchResult(true);\n }\n\n private clearSearch(): void {\n // TODO(crbug.com/1172300) Ignored during the jsdoc to ts migration\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const untypedSearchProvider = (this.searchProvider as any);\n delete this.currentQuery;\n if (Boolean(untypedSearchProvider.currentQuery)) {\n delete untypedSearchProvider.currentQuery;\n this.searchProvider.onSearchCanceled();\n }\n this.updateSearchMatchesCountAndCurrentMatchIndex(0, -1);\n }\n\n private performSearch(forceSearch: boolean, shouldJump: boolean, jumpBackwards?: boolean): void {\n const query = this.searchInputElement.value;\n if (!query || (!forceSearch && query.length < this.minimalSearchQuerySize && !this.currentQuery)) {\n this.clearSearch();\n return;\n }\n\n this.currentQuery = query;\n // TODO(crbug.com/1172300) Ignored during the jsdoc to ts migration\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (this.searchProvider as any).currentQuery = query;\n\n const searchConfig = this.currentSearchConfig();\n this.searchProvider.performSearch(searchConfig, shouldJump, jumpBackwards);\n }\n\n private currentSearchConfig(): SearchConfig {\n const query = this.searchInputElement.value;\n const caseSensitive = this.caseSensitiveButton ? this.caseSensitiveButton.toggled : false;\n const isRegex = this.regexButton ? this.regexButton.toggled : false;\n return new SearchConfig(query, caseSensitive, isRegex);\n }\n\n private updateSecondRowVisibility(): void {\n const secondRowVisible = this.replaceToggleButton.isToggled();\n this.footerElementContainer.classList.toggle('replaceable', secondRowVisible);\n\n if (secondRowVisible) {\n this.replaceInputElement.focus();\n } else {\n this.searchInputElement.focus();\n }\n this.doResize();\n }\n\n private replace(): void {\n if (!this.replaceProvider) {\n throw new Error('No \\'replacable\\' provided to SearchableView!');\n }\n const searchConfig = this.currentSearchConfig();\n this.replaceProvider.replaceSelectionWith(searchConfig, this.replaceInputElement.value);\n delete this.currentQuery;\n this.performSearch(true, true);\n }\n\n private replaceAll(): void {\n if (!this.replaceProvider) {\n throw new Error('No \\'replacable\\' provided to SearchableView!');\n }\n const searchConfig = this.currentSearchConfig();\n this.replaceProvider.replaceAllWith(searchConfig, this.replaceInputElement.value);\n }\n\n private onInput(): void {\n if (!Common.Settings.Settings.instance().moduleSetting('search-as-you-type').get()) {\n this.clearSearch();\n return;\n }\n\n if (this.valueChangedTimeoutId) {\n clearTimeout(this.valueChangedTimeoutId);\n }\n const timeout = this.searchInputElement.value.length < 3 ? 200 : 0;\n this.valueChangedTimeoutId = window.setTimeout(this.onValueChanged.bind(this), timeout);\n }\n\n private onValueChanged(): void {\n if (!this.searchIsVisible) {\n return;\n }\n delete this.valueChangedTimeoutId;\n this.performSearch(false, true);\n }\n}\n\nconst searchableViewsByElement = new WeakMap();\n\nexport interface Searchable {\n onSearchCanceled(): void;\n // Called when the search toolbar is closed\n onSearchClosed?: () => void;\n performSearch(searchConfig: SearchConfig, shouldJump: boolean, jumpBackwards?: boolean): void;\n jumpToNextSearchResult(): void;\n jumpToPreviousSearchResult(): void;\n supportsCaseSensitiveSearch(): boolean;\n supportsRegexSearch(): boolean;\n}\n\nexport interface Replaceable {\n replaceSelectionWith(searchConfig: SearchConfig, replacement: string): void;\n replaceAllWith(searchConfig: SearchConfig, replacement: string): void;\n}\n\nexport interface SearchRegexResult {\n regex: RegExp;\n fromQuery: boolean;\n}\n\nexport class SearchConfig {\n query: string;\n caseSensitive: boolean;\n isRegex: boolean;\n\n constructor(query: string, caseSensitive: boolean, isRegex: boolean) {\n this.query = query;\n this.caseSensitive = caseSensitive;\n this.isRegex = isRegex;\n }\n\n toSearchRegex(global?: boolean): SearchRegexResult {\n let modifiers = this.caseSensitive ? '' : 'i';\n if (global) {\n modifiers += 'g';\n }\n\n // Check if query is surrounded by forward slashes\n const isRegexFormatted = this.query.startsWith('/') && this.query.endsWith('/');\n const query = this.isRegex && !isRegexFormatted ? '/' + this.query + '/' : this.query;\n let regex: RegExp|undefined;\n let fromQuery = false;\n\n // First try creating regex if user knows the / / hint.\n try {\n if (/^\\/.+\\/$/.test(query) && this.isRegex) {\n regex = new RegExp(query.substring(1, query.length - 1), modifiers);\n fromQuery = true;\n }\n } catch (e) {\n // Silent catch.\n }\n\n // Otherwise just do a plain text search.\n if (!regex) {\n regex = Platform.StringUtilities.createPlainTextSearchRegex(query, modifiers);\n }\n\n return {\n regex,\n fromQuery,\n };\n }\n}\n"]} \ No newline at end of file diff --git a/public/ui/legacy/SettingsUI.js.map b/public/ui/legacy/SettingsUI.js.map index 2d7191256..2d7f28493 100644 --- a/public/ui/legacy/SettingsUI.js.map +++ b/public/ui/legacy/SettingsUI.js.map @@ -1 +1 @@ -{"version":3,"file":"SettingsUI.js","sourceRoot":"","sources":["../../../../../../front_end/ui/legacy/SettingsUI.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,OAAO,KAAK,MAAM,MAAM,6BAA6B,CAAC;AACtD,OAAO,KAAK,IAAI,MAAM,yBAAyB,CAAC;AAChD,OAAO,KAAK,IAAI,MAAM,yBAAyB,CAAC;AAChD,OAAO,KAAK,QAAQ,MAAM,iCAAiC,CAAC;AAC5D,OAAO,KAAK,QAAQ,MAAM,oCAAoC,CAAC;AAC/D,OAAO,KAAK,aAAa,MAAM,qCAAqC,CAAC;AAErE,OAAO,KAAK,SAAS,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAC,aAAa,EAAC,MAAM,oBAAoB,CAAC;A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AC;YACD,OAAO,CAAC,KAAK,CAAC,sCAAsC,CAAC,CAAC;YACtD,OAAO,IAAI,CAAC;QACd;YACE,OAAO,CAAC,KAAK,CAAC,wBAAwB,GAAG,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC;YACzD,OAAO,IAAI,CAAC;IAChB,CAAC;AACH,CAAC,CAAC","sourcesContent":["/*\n * Copyright (C) 2014 Google Inc. All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are\n * met:\n *\n * * Redistributions of source code must retain the above copyright\n * notice, this list of conditions and the following disclaimer.\n * * Redistributions in binary form must reproduce the above\n * copyright notice, this list of conditions and the following disclaimer\n * in the documentation and/or other materials provided with the\n * distribution.\n * * Neither the name of Google Inc. nor the names of its\n * contributors may be used to endorse or promote products derived from\n * this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nimport * as Common from '../../core/common/common.js';\nimport * as Host from '../../core/host/host.js';\nimport * as i18n from '../../core/i18n/i18n.js';\nimport * as Platform from '../../core/platform/platform.js';\nimport * as Settings from '../components/settings/settings.js';\nimport * as VisualLogging from '../visual_logging/visual_logging.js';\n\nimport * as ARIAUtils from './ARIAUtils.js';\nimport {InspectorView} from './InspectorView.js';\nimport {Tooltip} from './Tooltip.js';\nimport {CheckboxLabel, createOption} from './UIUtils.js';\n\nconst UIStrings = {\n /**\n *@description Note when a setting change will require the user to reload DevTools\n */\n srequiresReload: '*Requires reload',\n /**\n *@description Message to display if a setting change requires a reload of DevTools\n */\n oneOrMoreSettingsHaveChanged: 'One or more settings have changed which requires a reload to take effect.',\n};\nconst str_ = i18n.i18n.registerUIStrings('ui/legacy/SettingsUI.ts', UIStrings);\nconst i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);\nexport const createSettingCheckbox = function(\n name: Common.UIString.LocalizedString, setting: Common.Settings.Setting, omitParagraphElement?: boolean,\n tooltip?: string): Element {\n const label = CheckboxLabel.create(name, undefined, undefined, setting.name);\n if (tooltip) {\n Tooltip.install(label, tooltip);\n }\n\n const input = label.checkboxElement;\n input.name = name;\n bindCheckbox(input, setting);\n\n if (omitParagraphElement) {\n return label;\n }\n\n const p = document.createElement('p');\n p.appendChild(label);\n return p;\n};\n\nconst createSettingSelect = function(\n name: string, options: Common.Settings.SimpleSettingOption[], requiresReload: boolean|null,\n setting: Common.Settings.Setting, subtitle?: string): HTMLElement {\n const container = document.createElement('div');\n const settingSelectElement = container.createChild('p');\n settingSelectElement.classList.add('settings-select');\n const label = settingSelectElement.createChild('label');\n const select = (settingSelectElement.createChild('select', 'chrome-select') as HTMLSelectElement);\n label.textContent = name;\n if (subtitle) {\n container.classList.add('chrome-select-label');\n label.createChild('p').textContent = subtitle;\n }\n select.setAttribute('jslog', `${VisualLogging.dropDown().track({change: true}).context(setting.name)}`);\n ARIAUtils.bindLabelToControl(label, select);\n\n for (const option of options) {\n if (option.text && typeof option.value === 'string') {\n select.add(createOption(option.text, option.value, Platform.StringUtilities.toKebabCase(option.value)));\n }\n }\n\n let reloadWarning: HTMLElement|(Element | null) = (null as Element | null);\n if (requiresReload) {\n reloadWarning = container.createChild('p', 'reload-warning hidden');\n reloadWarning.textContent = i18nString(UIStrings.srequiresReload);\n ARIAUtils.markAsAlert(reloadWarning);\n }\n\n const {deprecation} = setting;\n if (deprecation) {\n const warning = new Settings.SettingDeprecationWarning.SettingDeprecationWarning();\n warning.data = deprecation;\n label.appendChild(warning);\n }\n\n setting.addChangeListener(settingChanged);\n settingChanged();\n select.addEventListener('change', selectChanged, false);\n return container;\n\n function settingChanged(): void {\n const newValue = setting.get();\n for (let i = 0; i < options.length; i++) {\n if (options[i].value === newValue) {\n select.selectedIndex = i;\n }\n }\n select.disabled = setting.disabled();\n }\n\n function selectChanged(): void {\n // Don't use event.target.value to avoid conversion of the value to string.\n setting.set(options[select.selectedIndex].value);\n if (reloadWarning) {\n reloadWarning.classList.remove('hidden');\n InspectorView.instance().displayReloadRequiredWarning(i18nString(UIStrings.oneOrMoreSettingsHaveChanged));\n }\n }\n};\n\nexport const bindCheckbox = function(\n inputElement: Element, setting: Common.Settings.Setting, metric?: UserMetricOptions): void {\n const input = (inputElement as HTMLInputElement);\n function settingChanged(): void {\n if (input.checked !== setting.get()) {\n input.checked = setting.get();\n }\n }\n setting.addChangeListener(settingChanged);\n settingChanged();\n\n function inputChanged(): void {\n if (setting.get() !== input.checked) {\n setting.set(input.checked);\n }\n\n if (setting.get() && metric?.enable) {\n Host.userMetrics.actionTaken(metric.enable);\n }\n\n if (!setting.get() && metric?.disable) {\n Host.userMetrics.actionTaken(metric.disable);\n }\n\n if (metric?.toggle) {\n Host.userMetrics.actionTaken(metric.toggle);\n }\n }\n\n input.addEventListener('change', inputChanged, false);\n};\n\nexport const createCustomSetting = function(name: string, element: Element): Element {\n const p = document.createElement('p');\n p.classList.add('settings-select');\n const label = p.createChild('label');\n label.textContent = name;\n ARIAUtils.bindLabelToControl(label, element);\n p.appendChild(element);\n return p;\n};\n\nexport const createControlForSetting = function(\n setting: Common.Settings.Setting, subtitle?: string): HTMLElement|null {\n const uiTitle = setting.title();\n switch (setting.type()) {\n case Common.Settings.SettingType.BOOLEAN: {\n const component = new Settings.SettingCheckbox.SettingCheckbox();\n component.data = {\n setting: setting as Common.Settings.Setting,\n };\n component.onchange = () => {\n if (setting.reloadRequired()) {\n InspectorView.instance().displayReloadRequiredWarning(i18nString(UIStrings.oneOrMoreSettingsHaveChanged));\n }\n };\n return component;\n }\n case Common.Settings.SettingType.ENUM:\n if (Array.isArray(setting.options())) {\n return createSettingSelect(uiTitle, setting.options(), setting.reloadRequired(), setting, subtitle);\n }\n console.error('Enum setting defined without options');\n return null;\n default:\n console.error('Invalid setting type: ' + setting.type());\n return null;\n }\n};\n\nexport interface SettingUI {\n settingElement(): Element|null;\n}\n\n/**\n * Track toggle action as a whole or\n * track on and off action separately.\n */\nexport interface UserMetricOptions {\n toggle?: Host.UserMetrics.Action;\n enable?: Host.UserMetrics.Action;\n disable?: Host.UserMetrics.Action;\n}\n"]} \ No newline at end of file +{"version":3,"file":"SettingsUI.js","sourceRoot":"","sources":["../../../../../../front_end/ui/legacy/SettingsUI.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,OAAO,KAAK,MAAM,MAAM,6BAA6B,CAAC;AACtD,OAAO,KAAK,IAAI,MAAM,yBAAyB,CAAC;AAChD,OAAO,KAAK,IAAI,MAAM,yBAAyB,CAAC;AAChD,OAAO,KAAK,QAAQ,MAAM,iCAAiC,CAAC;AAC5D,OAAO,KAAK,QAAQ,MAAM,oCAAoC,CAAC;AAC/D,OAAO,KAAK,aAAa,MAAM,qCAAqC,CAAC;AAErE,OAAO,KAAK,SAAS,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAC,aAAa,EAAC,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAC,OAAO,EAAC,MAAM,cAAc,CAAC;AACrC,OAAO,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OAAO,IAAI,CAAC;QACd;YACE,OAAO,CAAC,KAAK,CAAC,wBAAwB,GAAG,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC;YACzD,OAAO,IAAI,CAAC;IAChB,CAAC;AACH,CAAC,CAAC","sourcesContent":["/*\n * Copyright (C) 2014 Google Inc. All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are\n * met:\n *\n * * Redistributions of source code must retain the above copyright\n * notice, this list of conditions and the following disclaimer.\n * * Redistributions in binary form must reproduce the above\n * copyright notice, this list of conditions and the following disclaimer\n * in the documentation and/or other materials provided with the\n * distribution.\n * * Neither the name of Google Inc. nor the names of its\n * contributors may be used to endorse or promote products derived from\n * this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nimport * as Common from '../../core/common/common.js';\nimport * as Host from '../../core/host/host.js';\nimport * as i18n from '../../core/i18n/i18n.js';\nimport * as Platform from '../../core/platform/platform.js';\nimport * as Settings from '../components/settings/settings.js';\nimport * as VisualLogging from '../visual_logging/visual_logging.js';\n\nimport * as ARIAUtils from './ARIAUtils.js';\nimport {InspectorView} from './InspectorView.js';\nimport {Tooltip} from './Tooltip.js';\nimport {CheckboxLabel, createOption} from './UIUtils.js';\n\nconst UIStrings = {\n /**\n *@description Note when a setting change will require the user to reload DevTools\n */\n srequiresReload: '*Requires reload',\n /**\n *@description Message to display if a setting change requires a reload of DevTools\n */\n oneOrMoreSettingsHaveChanged: 'One or more settings have changed which requires a reload to take effect.',\n};\nconst str_ = i18n.i18n.registerUIStrings('ui/legacy/SettingsUI.ts', UIStrings);\nconst i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);\nexport const createSettingCheckbox = function(\n name: Common.UIString.LocalizedString, setting: Common.Settings.Setting, omitParagraphElement?: boolean,\n tooltip?: string): Element {\n const label = CheckboxLabel.create(name, undefined, undefined, setting.name);\n if (tooltip) {\n Tooltip.install(label, tooltip);\n }\n\n const input = label.checkboxElement;\n input.name = name;\n bindCheckbox(input, setting);\n\n if (omitParagraphElement) {\n return label;\n }\n\n const p = document.createElement('p');\n p.appendChild(label);\n return p;\n};\n\nconst createSettingSelect = function(\n name: string, options: Common.Settings.SimpleSettingOption[], requiresReload: boolean|null,\n setting: Common.Settings.Setting, subtitle?: string): HTMLElement {\n const container = document.createElement('div');\n const settingSelectElement = container.createChild('p');\n settingSelectElement.classList.add('settings-select');\n const label = settingSelectElement.createChild('label');\n const select = settingSelectElement.createChild('select', 'chrome-select');\n label.textContent = name;\n if (subtitle) {\n container.classList.add('chrome-select-label');\n label.createChild('p').textContent = subtitle;\n }\n select.setAttribute('jslog', `${VisualLogging.dropDown().track({change: true}).context(setting.name)}`);\n ARIAUtils.bindLabelToControl(label, select);\n\n for (const option of options) {\n if (option.text && typeof option.value === 'string') {\n select.add(createOption(option.text, option.value, Platform.StringUtilities.toKebabCase(option.value)));\n }\n }\n\n let reloadWarning: HTMLElement|(Element | null) = (null as Element | null);\n if (requiresReload) {\n reloadWarning = container.createChild('p', 'reload-warning hidden');\n reloadWarning.textContent = i18nString(UIStrings.srequiresReload);\n ARIAUtils.markAsAlert(reloadWarning);\n }\n\n const {deprecation} = setting;\n if (deprecation) {\n const warning = new Settings.SettingDeprecationWarning.SettingDeprecationWarning();\n warning.data = deprecation;\n label.appendChild(warning);\n }\n\n setting.addChangeListener(settingChanged);\n settingChanged();\n select.addEventListener('change', selectChanged, false);\n return container;\n\n function settingChanged(): void {\n const newValue = setting.get();\n for (let i = 0; i < options.length; i++) {\n if (options[i].value === newValue) {\n select.selectedIndex = i;\n }\n }\n select.disabled = setting.disabled();\n }\n\n function selectChanged(): void {\n // Don't use event.target.value to avoid conversion of the value to string.\n setting.set(options[select.selectedIndex].value);\n if (reloadWarning) {\n reloadWarning.classList.remove('hidden');\n InspectorView.instance().displayReloadRequiredWarning(i18nString(UIStrings.oneOrMoreSettingsHaveChanged));\n }\n }\n};\n\nexport const bindCheckbox = function(\n inputElement: Element, setting: Common.Settings.Setting, metric?: UserMetricOptions): void {\n const input = (inputElement as HTMLInputElement);\n function settingChanged(): void {\n if (input.checked !== setting.get()) {\n input.checked = setting.get();\n }\n }\n setting.addChangeListener(settingChanged);\n settingChanged();\n\n function inputChanged(): void {\n if (setting.get() !== input.checked) {\n setting.set(input.checked);\n }\n\n if (setting.get() && metric?.enable) {\n Host.userMetrics.actionTaken(metric.enable);\n }\n\n if (!setting.get() && metric?.disable) {\n Host.userMetrics.actionTaken(metric.disable);\n }\n\n if (metric?.toggle) {\n Host.userMetrics.actionTaken(metric.toggle);\n }\n }\n\n input.addEventListener('change', inputChanged, false);\n};\n\nexport const createCustomSetting = function(name: string, element: Element): Element {\n const p = document.createElement('p');\n p.classList.add('settings-select');\n const label = p.createChild('label');\n label.textContent = name;\n ARIAUtils.bindLabelToControl(label, element);\n p.appendChild(element);\n return p;\n};\n\nexport const createControlForSetting = function(\n setting: Common.Settings.Setting, subtitle?: string): HTMLElement|null {\n const uiTitle = setting.title();\n switch (setting.type()) {\n case Common.Settings.SettingType.BOOLEAN: {\n const component = new Settings.SettingCheckbox.SettingCheckbox();\n component.data = {\n setting: setting as Common.Settings.Setting,\n };\n component.onchange = () => {\n if (setting.reloadRequired()) {\n InspectorView.instance().displayReloadRequiredWarning(i18nString(UIStrings.oneOrMoreSettingsHaveChanged));\n }\n };\n return component;\n }\n case Common.Settings.SettingType.ENUM:\n if (Array.isArray(setting.options())) {\n return createSettingSelect(uiTitle, setting.options(), setting.reloadRequired(), setting, subtitle);\n }\n console.error('Enum setting defined without options');\n return null;\n default:\n console.error('Invalid setting type: ' + setting.type());\n return null;\n }\n};\n\nexport interface SettingUI {\n settingElement(): Element|null;\n}\n\n/**\n * Track toggle action as a whole or\n * track on and off action separately.\n */\nexport interface UserMetricOptions {\n toggle?: Host.UserMetrics.Action;\n enable?: Host.UserMetrics.Action;\n disable?: Host.UserMetrics.Action;\n}\n"]} \ No newline at end of file diff --git a/public/ui/legacy/ShortcutRegistry.test.js b/public/ui/legacy/ShortcutRegistry.test.js index f473154c7..8c975fab7 100644 --- a/public/ui/legacy/ShortcutRegistry.test.js +++ b/public/ui/legacy/ShortcutRegistry.test.js @@ -13,11 +13,11 @@ describe('ShortcutTreeNode', () => { const node = new UI.ShortcutRegistry.ShortcutTreeNode(0, 0); node.addKeyMapping([12, 154, 36], 'test action'); const leafNode = node.getNode(12)?.getNode(154)?.getNode(36); - assert.ok(leafNode, 'node should have a descendant for the mapping'); + assert.isOk(leafNode, 'node should have a descendant for the mapping'); assert.include(leafNode?.actions() || [], 'test action', 'the mapping\'s node should have the \'test action\' action'); assert.isTrue(node.hasChords(), 'node should have chords'); - assert.ok(node.getNode(12), 'node should have a child for key=12'); - assert.notOk(node.getNode(154), 'node should not have a direct child for key=154'); + assert.isOk(node.getNode(12), 'node should have a child for key=12'); + assert.isNotOk(node.getNode(154), 'node should not have a direct child for key=154'); }); it('can clear itself', () => { const node = new UI.ShortcutRegistry.ShortcutTreeNode(0, 0); diff --git a/public/ui/legacy/ShortcutRegistry.test.js.map b/public/ui/legacy/ShortcutRegistry.test.js.map index 21dabead0..441a3e086 100644 --- a/public/ui/legacy/ShortcutRegistry.test.js.map +++ b/public/ui/legacy/ShortcutRegistry.test.js.map @@ -1 +1 @@ -{"version":3,"file":"ShortcutRegistry.test.js","sourceRoot":"","sources":["../../../../../../front_end/ui/legacy/ShortcutRegistry.test.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,KAAK,EAAE,MAAM,aAAa,CAAC;AAElC,QAAQ,CAAC,kBAAkB,EAAE,GAAG,EAAE;IAChC,EAAE,CAAC,oCAAoC,EAAE,GAAG,EAAE;QAC5C,MAAM,IAAI,GAAG,IAAI,EAAE,CAAC,gBAAgB,CAAC,gBAAgB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;QAC5D,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,qDAAqD,CAAC,CAAC;QACtF,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,SAAS,EAAE,EAAE,iCAAiC,CAAC,CAAC;QACpE,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,GAAG,EAAE,EAAE,CAAC,EAAE,8BAA8B,CAAC,CAAC;IACpE,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,mBAAmB,EAAE,GAAG,EAAE;QAC3B,MAAM,IAAI,GAAG,IAAI,EAAE,CAAC,gBAAgB,CAAC,gBAAgB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;QAC5D,IAAI,CAAC,aAAa,CAAC,CAAC,EAAE,EAAE,GAAG,EAAE,EAAE,CAAC,EAAE,aAAa,CAAC,CAAC;QACjD,MAAM,QAAQ,GAAG,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,EAAE,OAAO,CAAC,GAAG,CAAC,EAAE,OAAO,CAAC,EAAE,CAAC,CAAC;QAC7D,MAAM,CAAC,EAAE,CAAC,QAAQ,EAAE,+CAA+C,CAAC,CAAC;QACrE,MAAM,CAAC,OAAO,CACV,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE,aAAa,EAAE,4DAA4D,CAAC,CAAC;QAC5G,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,EAAE,EAAE,yBAAyB,CAAC,CAAC;QAC3D,MAAM,CAAC,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,EAAE,qCAAqC,CAAC,CAAC;QACnE,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,iDAAiD,CAAC,CAAC;IACrF,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,kBAAkB,EAAE,GAAG,EAAE;QAC1B,MAAM,IAAI,GAAG,IAAI,EAAE,CAAC,gBAAgB,CAAC,gBAAgB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;QAC5D,IAAI,CAAC,aAAa,CAAC,CAAC,EAAE,EAAE,GAAG,EAAE,EAAE,CAAC,EAAE,aAAa,CAAC,CAAC;QACjD,IAAI,CAAC,SAAS,CAAC,gBAAgB,CAAC,CAAC;QACjC,IAAI,CAAC,KAAK,EAAE,CAAC;QACb,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,sDAAsD,CAAC,CAAC;QACvF,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,SAAS,EAAE,EAAE,qDAAqD,CAAC,CAAC;IAC1F,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["// Copyright 2020 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport * as UI from './legacy.js';\n\ndescribe('ShortcutTreeNode', () => {\n it('can be instantiated without issues', () => {\n const node = new UI.ShortcutRegistry.ShortcutTreeNode(0, 0);\n assert.isEmpty(node.actions(), 'node should not have any actions upon instantiation');\n assert.isFalse(node.hasChords(), 'node should not have any chords');\n assert.strictEqual(node.key(), 0, 'node should set key property');\n });\n\n it('can add a mapping', () => {\n const node = new UI.ShortcutRegistry.ShortcutTreeNode(0, 0);\n node.addKeyMapping([12, 154, 36], 'test action');\n const leafNode = node.getNode(12)?.getNode(154)?.getNode(36);\n assert.ok(leafNode, 'node should have a descendant for the mapping');\n assert.include(\n leafNode?.actions() || [], 'test action', 'the mapping\\'s node should have the \\'test action\\' action');\n assert.isTrue(node.hasChords(), 'node should have chords');\n assert.ok(node.getNode(12), 'node should have a child for key=12');\n assert.notOk(node.getNode(154), 'node should not have a direct child for key=154');\n });\n\n it('can clear itself', () => {\n const node = new UI.ShortcutRegistry.ShortcutTreeNode(0, 0);\n node.addKeyMapping([12, 154, 36], 'test action');\n node.addAction('another action');\n node.clear();\n assert.isEmpty(node.actions(), 'node should not have any actions after being cleared');\n assert.isFalse(node.hasChords(), 'node should not have any chords after being cleared');\n });\n});\n"]} \ No newline at end of file +{"version":3,"file":"ShortcutRegistry.test.js","sourceRoot":"","sources":["../../../../../../front_end/ui/legacy/ShortcutRegistry.test.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,KAAK,EAAE,MAAM,aAAa,CAAC;AAElC,QAAQ,CAAC,kBAAkB,EAAE,GAAG,EAAE;IAChC,EAAE,CAAC,oCAAoC,EAAE,GAAG,EAAE;QAC5C,MAAM,IAAI,GAAG,IAAI,EAAE,CAAC,gBAAgB,CAAC,gBAAgB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;QAC5D,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,qDAAqD,CAAC,CAAC;QACtF,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,SAAS,EAAE,EAAE,iCAAiC,CAAC,CAAC;QACpE,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,GAAG,EAAE,EAAE,CAAC,EAAE,8BAA8B,CAAC,CAAC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AAO,EAAE,EAAE,sDAAsD,CAAC,CAAC;QACvF,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,SAAS,EAAE,EAAE,qDAAqD,CAAC,CAAC;IAC1F,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["// Copyright 2020 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport * as UI from './legacy.js';\n\ndescribe('ShortcutTreeNode', () => {\n it('can be instantiated without issues', () => {\n const node = new UI.ShortcutRegistry.ShortcutTreeNode(0, 0);\n assert.isEmpty(node.actions(), 'node should not have any actions upon instantiation');\n assert.isFalse(node.hasChords(), 'node should not have any chords');\n assert.strictEqual(node.key(), 0, 'node should set key property');\n });\n\n it('can add a mapping', () => {\n const node = new UI.ShortcutRegistry.ShortcutTreeNode(0, 0);\n node.addKeyMapping([12, 154, 36], 'test action');\n const leafNode = node.getNode(12)?.getNode(154)?.getNode(36);\n assert.isOk(leafNode, 'node should have a descendant for the mapping');\n assert.include(\n leafNode?.actions() || [], 'test action', 'the mapping\\'s node should have the \\'test action\\' action');\n assert.isTrue(node.hasChords(), 'node should have chords');\n assert.isOk(node.getNode(12), 'node should have a child for key=12');\n assert.isNotOk(node.getNode(154), 'node should not have a direct child for key=154');\n });\n\n it('can clear itself', () => {\n const node = new UI.ShortcutRegistry.ShortcutTreeNode(0, 0);\n node.addKeyMapping([12, 154, 36], 'test action');\n node.addAction('another action');\n node.clear();\n assert.isEmpty(node.actions(), 'node should not have any actions after being cleared');\n assert.isFalse(node.hasChords(), 'node should not have any chords after being cleared');\n });\n});\n"]} \ No newline at end of file diff --git a/public/ui/legacy/SoftDropDown.js b/public/ui/legacy/SoftDropDown.js index 1aa43d11a..9021c020a 100644 --- a/public/ui/legacy/SoftDropDown.js +++ b/public/ui/legacy/SoftDropDown.js @@ -58,7 +58,6 @@ export class SoftDropDown { this.width = 315; createShadowRootWithCoreStyles(this.glassPane.contentElement, { cssFile: softDropDownStyles, - delegatesFocus: undefined, }).appendChild(this.list.element); ARIAUtils.markAsMenu(this.list.element); VisualLogging.setMappedParent(this.list.element, this.element); diff --git a/public/ui/legacy/SoftDropDown.js.map b/public/ui/legacy/SoftDropDown.js.map index 43b3b052f..b09d91aa5 100644 --- a/public/ui/legacy/SoftDropDown.js.map +++ b/public/ui/legacy/SoftDropDown.js.map @@ -1 +1 @@ -{"version":3,"file":"SoftDropDown.js","sourceRoot":"","sources":["../../../../../../front_end/ui/legacy/SoftDropDown.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAG7B,OAAO,KAAK,IAAI,MAAM,yBAAyB,CAAC;AAChD,OAAO,KAAK,UAAU,MAAM,0CAA0C,CAAC;AACvE,OAAO,KAAK,aAAa,MAAM,qCAAqC,CAAC;AAErE,OAAO,KAAK,SAAS,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAC,IAAI,EAAC,MAAM,eAAe,CAAC;AACnC,OAAO,EAAiB,SAAS,EAAwC,MAAM,gBAAgB,CAAC;AAChG,OAAO,EAAC,WAAW,EAAqB,QAAQ,EAAC,MAAM,kBAAkB,CAAC;AAE1E,OAAO,kBAAkB,MAAM,8BAA8B,CAAC;AAC9D,OAAO,wBAAwB,MAAM,oCAAoC,CAAC;AAC1E,OAAO,KAAK,YAAY,MAAM,kCAAkC,CAAC;AACjE,OAAO,EAAC,8BAA8B,EAAC,MAAM,cAAc,CAAC;AAE5D,MAAM,SAAS,GAAG;IAChB;;OAEG;IACH,cAAc,EAAE,oBAAoB;CACrC,CAAC;AACF,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,iBAAiB,CAAC,2BAA2B,EAAE,SAAS,CAAC,CAAC;AACjF,MAAM,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC;AAEtE,MAAM,OAAO,YAAY;IACf,QAAQ,CAAc;IACtB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C9F,IAAI,WAAW,EAAE,CAAC;YAChB,WAAW,CAAC,SAAS,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC;QAC9C,CAAC;QACD,IAAI,SAAS,EAAE,CAAC;YACd,SAAS,CAAC,SAAS,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;QACzC,CAAC;QAED,SAAS,CAAC,mBAAmB,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;QAC5D,IAAI,CAAC,QAAQ,CAAC,sBAAsB,CAChC,IAAI,EAAE,EAAE,EAAE,WAAW,IAAI,WAAW,CAAC,iBAAiB,EAAE,SAAS,IAAI,SAAS,CAAC,iBAAiB,CAAC,CAAC;IACxG,CAAC;IAED,sBAAsB,CAAC,YAA0B,EAAE,UAAwB;QACzE,OAAO,KAAK,CAAC;IACf,CAAC;IAEO,qBAAqB;QAC3B,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,CAAC,CAAC;IAC5C,CAAC;IAED,WAAW,CAAC,IAAO;QACjB,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;IAC9B,CAAC;CACF","sourcesContent":["// Copyright 2017 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport type * as Common from '../../core/common/common.js';\nimport * as i18n from '../../core/i18n/i18n.js';\nimport * as IconButton from '../components/icon_button/icon_button.js';\nimport * as VisualLogging from '../visual_logging/visual_logging.js';\n\nimport * as ARIAUtils from './ARIAUtils.js';\nimport {Size} from './Geometry.js';\nimport {AnchorBehavior, GlassPane, MarginBehavior, PointerEventsBehavior} from './GlassPane.js';\nimport {ListControl, type ListDelegate, ListMode} from './ListControl.js';\nimport {Events as ListModelEvents, type ItemsReplacedEvent, type ListModel} from './ListModel.js';\nimport softDropDownStyles from './softDropDown.css.legacy.js';\nimport softDropDownButtonStyles from './softDropDownButton.css.legacy.js';\nimport * as ThemeSupport from './theme_support/theme_support.js';\nimport {createShadowRootWithCoreStyles} from './UIUtils.js';\n\nconst UIStrings = {\n /**\n *@description Placeholder text in Soft Drop Down\n */\n noItemSelected: '(no item selected)',\n};\nconst str_ = i18n.i18n.registerUIStrings('ui/legacy/SoftDropDown.ts', UIStrings);\nconst i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);\n\nexport class SoftDropDown implements ListDelegate {\n private delegate: Delegate;\n private selectedItem: T|null;\n private readonly model: ListModel;\n private placeholderText: Common.UIString.LocalizedString;\n element: HTMLButtonElement;\n private titleElement: HTMLElement;\n private readonly glassPane: GlassPane;\n private list: ListControl;\n private rowHeight: number;\n private width: number;\n private listWasShowing200msAgo: boolean;\n\n constructor(model: ListModel, delegate: Delegate, jslogContext?: string) {\n this.delegate = delegate;\n this.selectedItem = null;\n this.model = model;\n\n this.placeholderText = i18nString(UIStrings.noItemSelected);\n\n this.element = document.createElement('button');\n if (jslogContext) {\n this.element.setAttribute(\n 'jslog',\n `${VisualLogging.dropDown().track({click: true, keydown: 'ArrowUp|ArrowDown|Enter'}).context(jslogContext)}`,\n );\n }\n this.element.classList.add('soft-dropdown');\n ThemeSupport.ThemeSupport.instance().appendStyle(this.element, softDropDownButtonStyles);\n this.titleElement = this.element.createChild('span', 'title');\n const dropdownArrowIcon = IconButton.Icon.create('triangle-down');\n this.element.appendChild(dropdownArrowIcon);\n ARIAUtils.setExpanded(this.element, false);\n\n this.glassPane = new GlassPane();\n this.glassPane.setMarginBehavior(MarginBehavior.NO_MARGIN);\n this.glassPane.setAnchorBehavior(AnchorBehavior.PREFER_BOTTOM);\n this.glassPane.setOutsideClickCallback(this.hide.bind(this));\n this.glassPane.setPointerEventsBehavior(PointerEventsBehavior.BLOCKED_BY_GLASS_PANE);\n this.list = new ListControl(model, this, ListMode.EqualHeightItems);\n this.list.element.classList.add('item-list');\n this.rowHeight = 36;\n this.width = 315;\n createShadowRootWithCoreStyles(this.glassPane.contentElement, {\n cssFile: softDropDownStyles,\n delegatesFocus: undefined,\n }).appendChild(this.list.element);\n ARIAUtils.markAsMenu(this.list.element);\n VisualLogging.setMappedParent(this.list.element, this.element);\n this.list.element.setAttribute(\n 'jslog',\n `${VisualLogging.menu().parent('mapped').track({resize: true, keydown: 'ArrowUp|ArrowDown|PageUp|PageDown'})}`);\n\n this.listWasShowing200msAgo = false;\n this.element.addEventListener('mousedown', event => {\n if (this.listWasShowing200msAgo) {\n this.hide(event);\n } else if (!this.element.disabled) {\n this.show(event);\n }\n }, false);\n this.element.addEventListener('keydown', this.onKeyDownButton.bind(this), false);\n this.list.element.addEventListener('keydown', this.onKeyDownList.bind(this), false);\n this.list.element.addEventListener('focusout', this.hide.bind(this), false);\n this.list.element.addEventListener('mousedown', event => event.consume(true), false);\n this.list.element.addEventListener('mouseup', event => {\n if (event.target === this.list.element) {\n return;\n }\n\n if (!this.listWasShowing200msAgo) {\n return;\n }\n this.selectHighlightedItem();\n if (event.target instanceof Element && event.target?.parentElement) {\n // hide() will consume the mouseup event and click won't be triggered\n void VisualLogging.logClick(event.target.parentElement, event);\n }\n this.hide(event);\n }, false);\n model.addEventListener(ListModelEvents.ITEMS_REPLACED, this.itemsReplaced, this);\n }\n\n private show(event: Event): void {\n if (this.glassPane.isShowing()) {\n return;\n }\n this.glassPane.setContentAnchorBox(this.element.boxInWindow());\n this.glassPane.show((this.element.ownerDocument as Document));\n this.list.element.focus();\n ARIAUtils.setExpanded(this.element, true);\n this.updateGlasspaneSize();\n if (this.selectedItem) {\n this.list.selectItem(this.selectedItem);\n }\n event.consume(true);\n window.setTimeout(() => {\n this.listWasShowing200msAgo = true;\n }, 200);\n }\n\n private updateGlasspaneSize(): void {\n const maxHeight = this.rowHeight * (Math.min(this.model.length, 9));\n this.glassPane.setMaxContentSize(new Size(this.width, maxHeight));\n this.list.viewportResized();\n }\n\n private hide(event: Event): void {\n window.setTimeout(() => {\n this.listWasShowing200msAgo = false;\n }, 200);\n this.glassPane.hide();\n this.list.selectItem(null);\n ARIAUtils.setExpanded(this.element, false);\n this.element.focus();\n event.consume(true);\n }\n\n private onKeyDownButton(ev: Event): void {\n const event = (ev as KeyboardEvent);\n let handled = false;\n switch (event.key) {\n case 'ArrowUp':\n this.show(event);\n this.list.selectItemNextPage();\n handled = true;\n break;\n case 'ArrowDown':\n this.show(event);\n this.list.selectItemPreviousPage();\n handled = true;\n break;\n case 'Enter':\n case ' ':\n this.show(event);\n handled = true;\n break;\n default:\n break;\n }\n\n if (handled) {\n event.consume(true);\n }\n }\n\n private onKeyDownList(ev: Event): void {\n const event = (ev as KeyboardEvent);\n let handled = false;\n switch (event.key) {\n case 'ArrowLeft':\n handled = this.list.selectPreviousItem(false, false);\n break;\n case 'ArrowRight':\n handled = this.list.selectNextItem(false, false);\n break;\n case 'Home':\n for (let i = 0; i < this.model.length; i++) {\n if (this.isItemSelectable(this.model.at(i))) {\n this.list.selectItem(this.model.at(i));\n handled = true;\n break;\n }\n }\n break;\n case 'End':\n for (let i = this.model.length - 1; i >= 0; i--) {\n if (this.isItemSelectable(this.model.at(i))) {\n this.list.selectItem(this.model.at(i));\n handled = true;\n break;\n }\n }\n break;\n case 'Escape':\n this.hide(event);\n handled = true;\n break;\n case 'Tab':\n case 'Enter':\n case ' ':\n this.selectHighlightedItem();\n this.hide(event);\n handled = true;\n break;\n default:\n if (event.key.length === 1) {\n const selectedIndex = this.list.selectedIndex();\n const letter = event.key.toUpperCase();\n for (let i = 0; i < this.model.length; i++) {\n const item = this.model.at((selectedIndex + i + 1) % this.model.length);\n if (this.delegate.titleFor(item).toUpperCase().startsWith(letter)) {\n this.list.selectItem(item);\n break;\n }\n }\n handled = true;\n }\n break;\n }\n\n if (handled) {\n event.consume(true);\n }\n }\n\n setWidth(width: number): void {\n this.width = width;\n this.updateGlasspaneSize();\n }\n\n setRowHeight(rowHeight: number): void {\n this.rowHeight = rowHeight;\n }\n\n setPlaceholderText(text: Common.UIString.LocalizedString): void {\n this.placeholderText = text;\n if (!this.selectedItem) {\n this.titleElement.textContent = this.placeholderText;\n }\n }\n\n private itemsReplaced(event: Common.EventTarget.EventTargetEvent>): void {\n const {removed} = event.data;\n if (this.selectedItem && removed.indexOf(this.selectedItem) !== -1) {\n this.selectedItem = null;\n this.selectHighlightedItem();\n }\n this.updateGlasspaneSize();\n }\n\n getSelectedItem(): T|null {\n return this.selectedItem;\n }\n\n selectItem(item: T|null): void {\n this.selectedItem = item;\n if (this.selectedItem) {\n this.titleElement.textContent = this.delegate.titleFor(this.selectedItem);\n } else {\n this.titleElement.textContent = this.placeholderText;\n }\n this.delegate.itemSelected(this.selectedItem);\n }\n\n createElementForItem(item: T): Element {\n const element = document.createElement('div');\n element.classList.add('item');\n element.addEventListener('mousemove', e => {\n if ((e.movementX || e.movementY) && this.delegate.isItemSelectable(item)) {\n this.list.selectItem(item, false, /* Don't scroll */ true);\n }\n });\n element.classList.toggle('disabled', !this.delegate.isItemSelectable(item));\n element.classList.toggle('highlighted', this.list.selectedItem() === item);\n\n ARIAUtils.markAsMenuItem(element);\n element.appendChild(this.delegate.createElementForItem(item));\n\n return element;\n }\n\n heightForItem(_item: T): number {\n return this.rowHeight;\n }\n\n isItemSelectable(item: T): boolean {\n return this.delegate.isItemSelectable(item);\n }\n\n selectedItemChanged(from: T|null, to: T|null, fromElement: Element|null, toElement: Element|null): void {\n if (fromElement) {\n fromElement.classList.remove('highlighted');\n }\n if (toElement) {\n toElement.classList.add('highlighted');\n }\n\n ARIAUtils.setActiveDescendant(this.list.element, toElement);\n this.delegate.highlightedItemChanged(\n from, to, fromElement && fromElement.firstElementChild, toElement && toElement.firstElementChild);\n }\n\n updateSelectedItemARIA(_fromElement: Element|null, _toElement: Element|null): boolean {\n return false;\n }\n\n private selectHighlightedItem(): void {\n this.selectItem(this.list.selectedItem());\n }\n\n refreshItem(item: T): void {\n this.list.refreshItem(item);\n }\n}\n\nexport interface Delegate {\n titleFor(item: T): string;\n createElementForItem(item: T): Element;\n isItemSelectable(item: T): boolean;\n itemSelected(item: T|null): void;\n highlightedItemChanged(from: T|null, to: T|null, fromElement: Element|null, toElement: Element|null): void;\n}\n"]} \ No newline at end of file +{"version":3,"file":"SoftDropDown.js","sourceRoot":"","sources":["../../../../../../front_end/ui/legacy/SoftDropDown.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAG7B,OAAO,KAAK,IAAI,MAAM,yBAAyB,CAAC;AAChD,OAAO,KAAK,UAAU,MAAM,0CAA0C,CAAC;AACvE,OAAO,KAAK,aAAa,MAAM,qCAAqC,CAAC;AAErE,OAAO,KAAK,SAAS,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAC,IAAI,EAAC,MAAM,eAAe,CAAC;AACnC,OAAO,EAAiB,SAAS,EAAwC,MAAM,gBAAgB,CAAC;AAChG,OAAO,EAAC,WAAW,EAAqB,QAAQ,EAAC,MAAM,kBAAkB,CAAC;AAE1E,OAAO,kBAAkB,MAAM,8BAA8B,CAAC;AAC9D,OAAO,wBAAwB,MAAM,oCAAoC,CAAC;AAC1E,OAAO,KAAK,YAAY,MAAM,kCAAkC,CAAC;AACjE,OAAO,EAAC,8BAA8B,EAAC,MAAM,cAAc,CAAC;AAE5D,MAAM,SAAS,GAAG;IAChB;;OAEG;IACH,cAAc,EAAE,oBAAoB;CACrC,CAAC;AACF,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,iBAAiB,CAAC,2BAA2B,EAAE,SAAS,CAAC,CAAC;AACjF,MAAM,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC;AAEtE,MAAM,OAAO,YAAY;IACf,QAAQ,CAAc;IACtB,YAAY,CAAS;IACZ,KAAK,CAAe;IAC7B,eAAe,CAAkC;IACzD,OAAO,CAAoB;IACnB,YAAY,CAAc;IACjB,SAAS,CAAY;IAC9B,IAAI,CAAiB;IACrB,SAAS,CAAS;IAClB,KAAK,CAAS;IACd,sBAAs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AQ,CAAC,oBAAoB,CAAC,IAAI,CAAC,CAAC,CAAC;QAE9D,OAAO,OAAO,CAAC;IACjB,CAAC;IAED,aAAa,CAAC,KAAQ;QACpB,OAAO,IAAI,CAAC,SAAS,CAAC;IACxB,CAAC;IAED,gBAAgB,CAAC,IAAO;QACtB,OAAO,IAAI,CAAC,QAAQ,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAC;IAC9C,CAAC;IAED,mBAAmB,CAAC,IAAY,EAAE,EAAU,EAAE,WAAyB,EAAE,SAAuB;QAC9F,IAAI,WAAW,EAAE,CAAC;YAChB,WAAW,CAAC,SAAS,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC;QAC9C,CAAC;QACD,IAAI,SAAS,EAAE,CAAC;YACd,SAAS,CAAC,SAAS,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;QACzC,CAAC;QAED,SAAS,CAAC,mBAAmB,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;QAC5D,IAAI,CAAC,QAAQ,CAAC,sBAAsB,CAChC,IAAI,EAAE,EAAE,EAAE,WAAW,IAAI,WAAW,CAAC,iBAAiB,EAAE,SAAS,IAAI,SAAS,CAAC,iBAAiB,CAAC,CAAC;IACxG,CAAC;IAED,sBAAsB,CAAC,YAA0B,EAAE,UAAwB;QACzE,OAAO,KAAK,CAAC;IACf,CAAC;IAEO,qBAAqB;QAC3B,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,CAAC,CAAC;IAC5C,CAAC;IAED,WAAW,CAAC,IAAO;QACjB,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;IAC9B,CAAC;CACF","sourcesContent":["// Copyright 2017 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport type * as Common from '../../core/common/common.js';\nimport * as i18n from '../../core/i18n/i18n.js';\nimport * as IconButton from '../components/icon_button/icon_button.js';\nimport * as VisualLogging from '../visual_logging/visual_logging.js';\n\nimport * as ARIAUtils from './ARIAUtils.js';\nimport {Size} from './Geometry.js';\nimport {AnchorBehavior, GlassPane, MarginBehavior, PointerEventsBehavior} from './GlassPane.js';\nimport {ListControl, type ListDelegate, ListMode} from './ListControl.js';\nimport {Events as ListModelEvents, type ItemsReplacedEvent, type ListModel} from './ListModel.js';\nimport softDropDownStyles from './softDropDown.css.legacy.js';\nimport softDropDownButtonStyles from './softDropDownButton.css.legacy.js';\nimport * as ThemeSupport from './theme_support/theme_support.js';\nimport {createShadowRootWithCoreStyles} from './UIUtils.js';\n\nconst UIStrings = {\n /**\n *@description Placeholder text in Soft Drop Down\n */\n noItemSelected: '(no item selected)',\n};\nconst str_ = i18n.i18n.registerUIStrings('ui/legacy/SoftDropDown.ts', UIStrings);\nconst i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);\n\nexport class SoftDropDown implements ListDelegate {\n private delegate: Delegate;\n private selectedItem: T|null;\n private readonly model: ListModel;\n private placeholderText: Common.UIString.LocalizedString;\n element: HTMLButtonElement;\n private titleElement: HTMLElement;\n private readonly glassPane: GlassPane;\n private list: ListControl;\n private rowHeight: number;\n private width: number;\n private listWasShowing200msAgo: boolean;\n\n constructor(model: ListModel, delegate: Delegate, jslogContext?: string) {\n this.delegate = delegate;\n this.selectedItem = null;\n this.model = model;\n\n this.placeholderText = i18nString(UIStrings.noItemSelected);\n\n this.element = document.createElement('button');\n if (jslogContext) {\n this.element.setAttribute(\n 'jslog',\n `${VisualLogging.dropDown().track({click: true, keydown: 'ArrowUp|ArrowDown|Enter'}).context(jslogContext)}`,\n );\n }\n this.element.classList.add('soft-dropdown');\n ThemeSupport.ThemeSupport.instance().appendStyle(this.element, softDropDownButtonStyles);\n this.titleElement = this.element.createChild('span', 'title');\n const dropdownArrowIcon = IconButton.Icon.create('triangle-down');\n this.element.appendChild(dropdownArrowIcon);\n ARIAUtils.setExpanded(this.element, false);\n\n this.glassPane = new GlassPane();\n this.glassPane.setMarginBehavior(MarginBehavior.NO_MARGIN);\n this.glassPane.setAnchorBehavior(AnchorBehavior.PREFER_BOTTOM);\n this.glassPane.setOutsideClickCallback(this.hide.bind(this));\n this.glassPane.setPointerEventsBehavior(PointerEventsBehavior.BLOCKED_BY_GLASS_PANE);\n this.list = new ListControl(model, this, ListMode.EqualHeightItems);\n this.list.element.classList.add('item-list');\n this.rowHeight = 36;\n this.width = 315;\n createShadowRootWithCoreStyles(this.glassPane.contentElement, {\n cssFile: softDropDownStyles,\n }).appendChild(this.list.element);\n ARIAUtils.markAsMenu(this.list.element);\n VisualLogging.setMappedParent(this.list.element, this.element);\n this.list.element.setAttribute(\n 'jslog',\n `${VisualLogging.menu().parent('mapped').track({resize: true, keydown: 'ArrowUp|ArrowDown|PageUp|PageDown'})}`);\n\n this.listWasShowing200msAgo = false;\n this.element.addEventListener('mousedown', event => {\n if (this.listWasShowing200msAgo) {\n this.hide(event);\n } else if (!this.element.disabled) {\n this.show(event);\n }\n }, false);\n this.element.addEventListener('keydown', this.onKeyDownButton.bind(this), false);\n this.list.element.addEventListener('keydown', this.onKeyDownList.bind(this), false);\n this.list.element.addEventListener('focusout', this.hide.bind(this), false);\n this.list.element.addEventListener('mousedown', event => event.consume(true), false);\n this.list.element.addEventListener('mouseup', event => {\n if (event.target === this.list.element) {\n return;\n }\n\n if (!this.listWasShowing200msAgo) {\n return;\n }\n this.selectHighlightedItem();\n if (event.target instanceof Element && event.target?.parentElement) {\n // hide() will consume the mouseup event and click won't be triggered\n void VisualLogging.logClick(event.target.parentElement, event);\n }\n this.hide(event);\n }, false);\n model.addEventListener(ListModelEvents.ITEMS_REPLACED, this.itemsReplaced, this);\n }\n\n private show(event: Event): void {\n if (this.glassPane.isShowing()) {\n return;\n }\n this.glassPane.setContentAnchorBox(this.element.boxInWindow());\n this.glassPane.show((this.element.ownerDocument as Document));\n this.list.element.focus();\n ARIAUtils.setExpanded(this.element, true);\n this.updateGlasspaneSize();\n if (this.selectedItem) {\n this.list.selectItem(this.selectedItem);\n }\n event.consume(true);\n window.setTimeout(() => {\n this.listWasShowing200msAgo = true;\n }, 200);\n }\n\n private updateGlasspaneSize(): void {\n const maxHeight = this.rowHeight * (Math.min(this.model.length, 9));\n this.glassPane.setMaxContentSize(new Size(this.width, maxHeight));\n this.list.viewportResized();\n }\n\n private hide(event: Event): void {\n window.setTimeout(() => {\n this.listWasShowing200msAgo = false;\n }, 200);\n this.glassPane.hide();\n this.list.selectItem(null);\n ARIAUtils.setExpanded(this.element, false);\n this.element.focus();\n event.consume(true);\n }\n\n private onKeyDownButton(ev: Event): void {\n const event = (ev as KeyboardEvent);\n let handled = false;\n switch (event.key) {\n case 'ArrowUp':\n this.show(event);\n this.list.selectItemNextPage();\n handled = true;\n break;\n case 'ArrowDown':\n this.show(event);\n this.list.selectItemPreviousPage();\n handled = true;\n break;\n case 'Enter':\n case ' ':\n this.show(event);\n handled = true;\n break;\n default:\n break;\n }\n\n if (handled) {\n event.consume(true);\n }\n }\n\n private onKeyDownList(ev: Event): void {\n const event = (ev as KeyboardEvent);\n let handled = false;\n switch (event.key) {\n case 'ArrowLeft':\n handled = this.list.selectPreviousItem(false, false);\n break;\n case 'ArrowRight':\n handled = this.list.selectNextItem(false, false);\n break;\n case 'Home':\n for (let i = 0; i < this.model.length; i++) {\n if (this.isItemSelectable(this.model.at(i))) {\n this.list.selectItem(this.model.at(i));\n handled = true;\n break;\n }\n }\n break;\n case 'End':\n for (let i = this.model.length - 1; i >= 0; i--) {\n if (this.isItemSelectable(this.model.at(i))) {\n this.list.selectItem(this.model.at(i));\n handled = true;\n break;\n }\n }\n break;\n case 'Escape':\n this.hide(event);\n handled = true;\n break;\n case 'Tab':\n case 'Enter':\n case ' ':\n this.selectHighlightedItem();\n this.hide(event);\n handled = true;\n break;\n default:\n if (event.key.length === 1) {\n const selectedIndex = this.list.selectedIndex();\n const letter = event.key.toUpperCase();\n for (let i = 0; i < this.model.length; i++) {\n const item = this.model.at((selectedIndex + i + 1) % this.model.length);\n if (this.delegate.titleFor(item).toUpperCase().startsWith(letter)) {\n this.list.selectItem(item);\n break;\n }\n }\n handled = true;\n }\n break;\n }\n\n if (handled) {\n event.consume(true);\n }\n }\n\n setWidth(width: number): void {\n this.width = width;\n this.updateGlasspaneSize();\n }\n\n setRowHeight(rowHeight: number): void {\n this.rowHeight = rowHeight;\n }\n\n setPlaceholderText(text: Common.UIString.LocalizedString): void {\n this.placeholderText = text;\n if (!this.selectedItem) {\n this.titleElement.textContent = this.placeholderText;\n }\n }\n\n private itemsReplaced(event: Common.EventTarget.EventTargetEvent>): void {\n const {removed} = event.data;\n if (this.selectedItem && removed.indexOf(this.selectedItem) !== -1) {\n this.selectedItem = null;\n this.selectHighlightedItem();\n }\n this.updateGlasspaneSize();\n }\n\n getSelectedItem(): T|null {\n return this.selectedItem;\n }\n\n selectItem(item: T|null): void {\n this.selectedItem = item;\n if (this.selectedItem) {\n this.titleElement.textContent = this.delegate.titleFor(this.selectedItem);\n } else {\n this.titleElement.textContent = this.placeholderText;\n }\n this.delegate.itemSelected(this.selectedItem);\n }\n\n createElementForItem(item: T): Element {\n const element = document.createElement('div');\n element.classList.add('item');\n element.addEventListener('mousemove', e => {\n if ((e.movementX || e.movementY) && this.delegate.isItemSelectable(item)) {\n this.list.selectItem(item, false, /* Don't scroll */ true);\n }\n });\n element.classList.toggle('disabled', !this.delegate.isItemSelectable(item));\n element.classList.toggle('highlighted', this.list.selectedItem() === item);\n\n ARIAUtils.markAsMenuItem(element);\n element.appendChild(this.delegate.createElementForItem(item));\n\n return element;\n }\n\n heightForItem(_item: T): number {\n return this.rowHeight;\n }\n\n isItemSelectable(item: T): boolean {\n return this.delegate.isItemSelectable(item);\n }\n\n selectedItemChanged(from: T|null, to: T|null, fromElement: Element|null, toElement: Element|null): void {\n if (fromElement) {\n fromElement.classList.remove('highlighted');\n }\n if (toElement) {\n toElement.classList.add('highlighted');\n }\n\n ARIAUtils.setActiveDescendant(this.list.element, toElement);\n this.delegate.highlightedItemChanged(\n from, to, fromElement && fromElement.firstElementChild, toElement && toElement.firstElementChild);\n }\n\n updateSelectedItemARIA(_fromElement: Element|null, _toElement: Element|null): boolean {\n return false;\n }\n\n private selectHighlightedItem(): void {\n this.selectItem(this.list.selectedItem());\n }\n\n refreshItem(item: T): void {\n this.list.refreshItem(item);\n }\n}\n\nexport interface Delegate {\n titleFor(item: T): string;\n createElementForItem(item: T): Element;\n isItemSelectable(item: T): boolean;\n itemSelected(item: T|null): void;\n highlightedItemChanged(from: T|null, to: T|null, fromElement: Element|null, toElement: Element|null): void;\n}\n"]} \ No newline at end of file diff --git a/public/ui/legacy/SplitWidget.js.map b/public/ui/legacy/SplitWidget.js.map index 1e41e35a7..b28e445b5 100644 --- a/public/ui/legacy/SplitWidget.js.map +++ b/public/ui/legacy/SplitWidget.js.map @@ -1 +1 @@ -{"version":3,"file":"SplitWidget.js","sourceRoot":"","sources":["../../../../../../front_end/ui/legacy/SplitWidget.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,OAAO,KAAK,MAAM,MAAM,6BAA6B,CAAC;AACtD,OAAO,KAAK,QAAQ,MAAM,iCAAiC,CAAC;AAC5D,OAAO,KAAK,aAAa,MAAM,qCAAqC,CAAC;AAErE,OAAO,KAAK,SAAS,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAC,WAAW,EAAC,MAAM,eAAe,CAAC;AAC1C,OAAO,EAAgE,mBAAmB,EAAC,MAAM,oBAAoB,CAAC;AACtH,OAAO,iBAAiB,MAAM,6BAA6B,CAAC;AAC5D,OAAO,EAAC,aAAa,EAAC,MAAM,cAAc,CAAC;AAC3C,OAAO,EAAC,MAAM,EAAE,aAAa,EAAC,MAAM,aAAa,CAAC;AAClD,OAAO,EAA8B,WAAW,EAAC,MAAM,kBAAkB,CAAC;AAE1E,MAAM,OAAO,WAAY,SAAQ,MAAM,CAAC,aAAa,CAAC,UAAU,CAA4B,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;QACnB,MAAM,EACJ,QAAQ,EACR,eAAe,EACf,WAAW,EACX,mBAAmB,EACnB,oBAAoB,EACpB,gBAAgB,EAChB,UAAU,GACX,GAAG,IAAI,CAAC,QAAQ,CAAC;QAClB,MAAM,MAAM,GAAG,IAAI,WAAW,CAC1B,OAAO,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC,eAAe,CAAC,EAAE,WAAW,EAAE,mBAAmB,EAAE,oBAAoB,EACnG,gBAAgB,EAAE,IAAI,CAAC,CAAC;QAC5B,IAAI,UAAU,EAAE,CAAC;YACf,MAAM,CAAC,UAAU,EAAE,CAAC;QACtB,CAAC;QACD,OAAO,MAAM,CAAC;IAChB,CAAC;CACF;AAED,cAAc,CAAC,MAAM,CAAC,uBAAuB,EAAE,kBAAkB,CAAC,CAAC;AAkBnE,MAAM,UAAU,GAAG,EAAE,CAAC;AAMtB,MAAM,cAAc,GAAG,UAAS,MAAe,IAAS,CAAC,CAAC","sourcesContent":["/*\n * Copyright (C) 2012 Google Inc. All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are\n * met:\n *\n * * Redistributions of source code must retain the above copyright\n * notice, this list of conditions and the following disclaimer.\n * * Redistributions in binary form must reproduce the above\n * copyright notice, this list of conditions and the following disclaimer\n * in the documentation and/or other materials provided with the\n * distribution.\n * * Neither the name of Google Inc. nor the names of its\n * contributors may be used to endorse or promote products derived from\n * this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nimport * as Common from '../../core/common/common.js';\nimport * as Platform from '../../core/platform/platform.js';\nimport * as VisualLogging from '../visual_logging/visual_logging.js';\n\nimport * as ARIAUtils from './ARIAUtils.js';\nimport {Constraints} from './Geometry.js';\nimport {Events as ResizerWidgetEvents, type ResizeUpdatePositionEvent, SimpleResizerWidget} from './ResizerWidget.js';\nimport splitWidgetStyles from './splitWidget.css.legacy.js';\nimport {ToolbarButton} from './Toolbar.js';\nimport {Widget, WidgetElement} from './Widget.js';\nimport {Events as ZoomManagerEvents, ZoomManager} from './ZoomManager.js';\n\nexport class SplitWidget extends Common.ObjectWrapper.eventMixin(Widget) {\n private sidebarElementInternal: HTMLElement;\n private mainElement: HTMLElement;\n private resizerElementInternal: HTMLElement;\n private resizerElementSize: number|null;\n private readonly resizerWidget: SimpleResizerWidget;\n private defaultSidebarWidth: number;\n private defaultSidebarHeight: number;\n private readonly constraintsInDip: boolean;\n private resizeStartSizeDIP: number;\n private setting: Common.Settings.Setting<{\n vertical?: SettingForOrientation,\n horizontal?: SettingForOrientation,\n }>|null;\n private totalSizeCSS: number;\n private totalSizeOtherDimensionCSS: number;\n private mainWidgetInternal: Widget|null;\n private sidebarWidgetInternal: Widget|null;\n private animationFrameHandle: number;\n private animationCallback: (() => void)|null;\n private showSidebarButtonTitle: Common.UIString.LocalizedString;\n private hideSidebarButtonTitle: Common.UIString.LocalizedString;\n private shownSidebarString: Common.UIString.LocalizedString;\n private hiddenSidebarString: Common.UIString.LocalizedString;\n private showHideSidebarButton: ToolbarButton|null;\n private isVerticalInternal: boolean;\n private sidebarMinimized: boolean;\n private detaching: boolean;\n private sidebarSizeDIP: number;\n private savedSidebarSizeDIP: number;\n private secondIsSidebar: boolean;\n private shouldSaveShowMode: boolean;\n private savedVerticalMainSize: number|null;\n private savedHorizontalMainSize: number|null;\n private showModeInternal: string;\n private savedShowMode: string;\n\n constructor(\n isVertical: boolean, secondIsSidebar: boolean, settingName?: string, defaultSidebarWidth?: number,\n defaultSidebarHeight?: number, constraintsInDip?: boolean, element?: SplitWidgetElement) {\n super(true, undefined, element);\n this.element.classList.add('split-widget');\n this.registerRequiredCSS(splitWidgetStyles);\n\n this.contentElement.classList.add('shadow-split-widget');\n this.sidebarElementInternal =\n this.contentElement.createChild('div', 'shadow-split-widget-contents shadow-split-widget-sidebar vbox');\n this.mainElement =\n this.contentElement.createChild('div', 'shadow-split-widget-contents shadow-split-widget-main vbox');\n const mainSlot = this.mainElement.createChild('slot') as HTMLSlotElement;\n mainSlot.name = 'main';\n mainSlot.addEventListener('slotchange', (_: Event) => {\n const assignedNode = mainSlot.assignedNodes()[0];\n const widget = assignedNode instanceof HTMLElement ? Widget.getOrCreateWidget(assignedNode) : null;\n if (widget && widget !== this.mainWidgetInternal) {\n this.setMainWidget(widget);\n }\n });\n const sidebarSlot = this.sidebarElementInternal.createChild('slot') as HTMLSlotElement;\n sidebarSlot.name = 'sidebar';\n sidebarSlot.addEventListener('slotchange', (_: Event) => {\n const assignedNode = sidebarSlot.assignedNodes()[0];\n const widget = assignedNode instanceof HTMLElement ? Widget.getOrCreateWidget(assignedNode) : null;\n if (widget && widget !== this.sidebarWidgetInternal) {\n this.setSidebarWidget(widget);\n }\n });\n this.resizerElementInternal = this.contentElement.createChild('div', 'shadow-split-widget-resizer');\n this.resizerElementSize = null;\n\n this.resizerWidget = new SimpleResizerWidget();\n this.resizerWidget.setEnabled(true);\n this.resizerWidget.addEventListener(ResizerWidgetEvents.RESIZE_START, this.onResizeStart, this);\n this.resizerWidget.addEventListener(ResizerWidgetEvents.RESIZE_UPDATE_POSITION, this.onResizeUpdate, this);\n this.resizerWidget.addEventListener(ResizerWidgetEvents.RESIZE_END, this.onResizeEnd, this);\n\n this.defaultSidebarWidth = defaultSidebarWidth || 200;\n this.defaultSidebarHeight = defaultSidebarHeight || this.defaultSidebarWidth;\n this.constraintsInDip = Boolean(constraintsInDip);\n this.resizeStartSizeDIP = 0;\n this.setting = settingName ? Common.Settings.Settings.instance().createSetting(settingName, {}) : null;\n\n this.totalSizeCSS = 0;\n this.totalSizeOtherDimensionCSS = 0;\n this.mainWidgetInternal = null;\n this.sidebarWidgetInternal = null;\n this.animationFrameHandle = 0;\n this.animationCallback = null;\n this.showSidebarButtonTitle = Common.UIString.LocalizedEmptyString;\n this.hideSidebarButtonTitle = Common.UIString.LocalizedEmptyString;\n this.shownSidebarString = Common.UIString.LocalizedEmptyString;\n this.hiddenSidebarString = Common.UIString.LocalizedEmptyString;\n this.showHideSidebarButton = null;\n this.isVerticalInternal = false;\n this.sidebarMinimized = false;\n this.detaching = false;\n this.sidebarSizeDIP = -1;\n this.savedSidebarSizeDIP = this.sidebarSizeDIP;\n this.secondIsSidebar = false;\n this.shouldSaveShowMode = false;\n this.savedVerticalMainSize = null;\n this.savedHorizontalMainSize = null;\n\n this.setSecondIsSidebar(secondIsSidebar);\n\n this.innerSetVertical(isVertical);\n this.showModeInternal = ShowMode.BOTH;\n this.savedShowMode = this.showModeInternal;\n\n // Should be called after isVertical has the right value.\n this.installResizer(this.resizerElementInternal);\n }\n\n isVertical(): boolean {\n return this.isVerticalInternal;\n }\n\n setVertical(isVertical: boolean): void {\n if (this.isVerticalInternal === isVertical) {\n return;\n }\n\n this.innerSetVertical(isVertical);\n\n if (this.isShowing()) {\n this.updateLayout();\n }\n }\n\n private innerSetVertical(isVertical: boolean): void {\n this.contentElement.classList.toggle('vbox', !isVertical);\n this.contentElement.classList.toggle('hbox', isVertical);\n this.isVerticalInternal = isVertical;\n\n this.resizerElementSize = null;\n this.sidebarSizeDIP = -1;\n this.restoreSidebarSizeFromSettings();\n if (this.shouldSaveShowMode) {\n this.restoreAndApplyShowModeFromSettings();\n }\n this.updateShowHideSidebarButton();\n // FIXME: reverse SplitWidget.isVertical meaning.\n this.resizerWidget.setVertical(!isVertical);\n this.invalidateConstraints();\n }\n\n private updateLayout(animate?: boolean): void {\n this.totalSizeCSS = 0; // Lazy update.\n this.totalSizeOtherDimensionCSS = 0;\n\n // Remove properties that might affect total size calculation.\n this.mainElement.style.removeProperty('width');\n this.mainElement.style.removeProperty('height');\n this.sidebarElementInternal.style.removeProperty('width');\n this.sidebarElementInternal.style.removeProperty('height');\n\n this.innerSetSidebarSizeDIP(this.preferredSidebarSizeDIP(), Boolean(animate));\n }\n\n setMainWidget(widget: Widget): void {\n if (this.mainWidgetInternal === widget) {\n return;\n }\n this.suspendInvalidations();\n if (this.mainWidgetInternal) {\n this.mainWidgetInternal.detach();\n }\n this.mainWidgetInternal = widget;\n if (widget) {\n widget.element.slot = 'main';\n if (this.showModeInternal === ShowMode.ONLY_MAIN || this.showModeInternal === ShowMode.BOTH) {\n widget.show(this.element);\n }\n }\n this.resumeInvalidations();\n }\n\n setSidebarWidget(widget: Widget): void {\n if (this.sidebarWidgetInternal === widget) {\n return;\n }\n this.suspendInvalidations();\n if (this.sidebarWidgetInternal) {\n this.sidebarWidgetInternal.detach();\n }\n this.sidebarWidgetInternal = widget;\n if (widget) {\n widget.element.slot = 'sidebar';\n if (this.showModeInternal === ShowMode.ONLY_SIDEBAR || this.showModeInternal === ShowMode.BOTH) {\n widget.show(this.element);\n }\n }\n this.resumeInvalidations();\n }\n\n mainWidget(): Widget|null {\n return this.mainWidgetInternal;\n }\n\n sidebarWidget(): Widget|null {\n return this.sidebarWidgetInternal;\n }\n\n sidebarElement(): HTMLElement {\n return this.sidebarElementInternal;\n }\n\n override childWasDetached(widget: Widget): void {\n if (this.detaching) {\n return;\n }\n if (this.mainWidgetInternal === widget) {\n this.mainWidgetInternal = null;\n }\n if (this.sidebarWidgetInternal === widget) {\n this.sidebarWidgetInternal = null;\n }\n this.invalidateConstraints();\n }\n\n isSidebarSecond(): boolean {\n return this.secondIsSidebar;\n }\n\n enableShowModeSaving(): void {\n this.shouldSaveShowMode = true;\n this.restoreAndApplyShowModeFromSettings();\n }\n\n showMode(): string {\n return this.showModeInternal;\n }\n\n sidebarIsShowing(): boolean {\n return this.showModeInternal !== ShowMode.ONLY_MAIN;\n }\n\n setSecondIsSidebar(secondIsSidebar: boolean): void {\n if (secondIsSidebar === this.secondIsSidebar) {\n return;\n }\n this.secondIsSidebar = secondIsSidebar;\n if (!this.mainWidgetInternal || !this.mainWidgetInternal.shouldHideOnDetach()) {\n if (secondIsSidebar) {\n this.contentElement.insertBefore(this.mainElement, this.sidebarElementInternal);\n } else {\n this.contentElement.insertBefore(this.mainElement, this.resizerElementInternal);\n }\n } else if (!this.sidebarWidgetInternal || !this.sidebarWidgetInternal.shouldHideOnDetach()) {\n if (secondIsSidebar) {\n this.contentElement.insertBefore(this.sidebarElementInternal, this.resizerElementInternal);\n } else {\n this.contentElement.insertBefore(this.sidebarElementInternal, this.mainElement);\n }\n } else {\n console.error('Could not swap split widget side. Both children widgets contain iframes.');\n this.secondIsSidebar = !secondIsSidebar;\n }\n }\n\n sidebarSide(): string|null {\n if (this.showModeInternal !== ShowMode.BOTH) {\n return null;\n }\n return this.isVerticalInternal ? (this.secondIsSidebar ? 'right' : 'left') :\n (this.secondIsSidebar ? 'bottom' : 'top');\n }\n\n resizerElement(): Element {\n return this.resizerElementInternal;\n }\n\n hideMain(animate?: boolean): void {\n this.showOnly(\n this.sidebarWidgetInternal, this.mainWidgetInternal, this.sidebarElementInternal, this.mainElement, animate);\n this.updateShowMode(ShowMode.ONLY_SIDEBAR);\n }\n\n hideSidebar(animate?: boolean): void {\n this.showOnly(\n this.mainWidgetInternal, this.sidebarWidgetInternal, this.mainElement, this.sidebarElementInternal, animate);\n this.updateShowMode(ShowMode.ONLY_MAIN);\n }\n\n setSidebarMinimized(minimized: boolean): void {\n this.sidebarMinimized = minimized;\n this.invalidateConstraints();\n }\n\n isSidebarMinimized(): boolean {\n return this.sidebarMinimized;\n }\n\n private showOnly(\n sideToShow: Widget|null, sideToHide: Widget|null, shadowToShow: Element, shadowToHide: Element,\n animate?: boolean): void {\n this.cancelAnimation();\n\n function callback(this: SplitWidget): void {\n if (sideToShow) {\n // Make sure main is first in the children list.\n if (sideToShow === this.mainWidgetInternal) {\n this.mainWidgetInternal.show(\n this.element, this.sidebarWidgetInternal ? this.sidebarWidgetInternal.element : null);\n } else if (this.sidebarWidgetInternal) {\n this.sidebarWidgetInternal.show(this.element);\n }\n }\n if (sideToHide) {\n this.detaching = true;\n sideToHide.detach();\n this.detaching = false;\n }\n\n this.resizerElementInternal.classList.add('hidden');\n shadowToShow.classList.remove('hidden');\n shadowToShow.classList.add('maximized');\n shadowToHide.classList.add('hidden');\n shadowToHide.classList.remove('maximized');\n this.removeAllLayoutProperties();\n this.doResize();\n this.showFinishedForTest();\n }\n\n if (animate) {\n this.animate(true, callback.bind(this));\n } else {\n callback.call(this);\n }\n\n this.sidebarSizeDIP = -1;\n this.setResizable(false);\n }\n\n private showFinishedForTest(): void {\n // This method is sniffed in tests.\n }\n\n private removeAllLayoutProperties(): void {\n this.sidebarElementInternal.style.removeProperty('flexBasis');\n\n this.mainElement.style.removeProperty('width');\n this.mainElement.style.removeProperty('height');\n this.sidebarElementInternal.style.removeProperty('width');\n this.sidebarElementInternal.style.removeProperty('height');\n\n this.resizerElementInternal.style.removeProperty('left');\n this.resizerElementInternal.style.removeProperty('right');\n this.resizerElementInternal.style.removeProperty('top');\n this.resizerElementInternal.style.removeProperty('bottom');\n\n this.resizerElementInternal.style.removeProperty('margin-left');\n this.resizerElementInternal.style.removeProperty('margin-right');\n this.resizerElementInternal.style.removeProperty('margin-top');\n this.resizerElementInternal.style.removeProperty('margin-bottom');\n }\n\n showBoth(animate?: boolean): void {\n if (this.showModeInternal === ShowMode.BOTH) {\n animate = false;\n }\n\n this.cancelAnimation();\n this.mainElement.classList.remove('maximized', 'hidden');\n this.sidebarElementInternal.classList.remove('maximized', 'hidden');\n this.resizerElementInternal.classList.remove('hidden');\n this.setResizable(true);\n\n // Make sure main is the first in the children list.\n this.suspendInvalidations();\n if (this.sidebarWidgetInternal) {\n this.sidebarWidgetInternal.show(this.element);\n }\n if (this.mainWidgetInternal) {\n this.mainWidgetInternal.show(\n this.element, this.sidebarWidgetInternal ? this.sidebarWidgetInternal.element : null);\n }\n this.resumeInvalidations();\n // Order widgets in DOM properly.\n this.setSecondIsSidebar(this.secondIsSidebar);\n\n this.sidebarSizeDIP = -1;\n this.updateShowMode(ShowMode.BOTH);\n this.updateLayout(animate);\n }\n\n setResizable(resizable: boolean): void {\n this.resizerWidget.setEnabled(resizable);\n }\n\n forceSetSidebarWidth(width: number): void {\n this.defaultSidebarWidth = width;\n this.savedSidebarSizeDIP = width;\n this.updateLayout();\n }\n\n isResizable(): boolean {\n return this.resizerWidget.isEnabled();\n }\n\n setSidebarSize(size: number): void {\n const sizeDIP = ZoomManager.instance().cssToDIP(size);\n this.savedSidebarSizeDIP = sizeDIP;\n this.saveSetting();\n this.innerSetSidebarSizeDIP(sizeDIP, false, true);\n }\n\n sidebarSize(): number {\n const sizeDIP = Math.max(0, this.sidebarSizeDIP);\n return ZoomManager.instance().dipToCSS(sizeDIP);\n }\n\n /**\n * Returns total size in DIP.\n */\n private totalSizeDIP(): number {\n if (!this.totalSizeCSS) {\n this.totalSizeCSS = this.isVerticalInternal ? this.contentElement.offsetWidth : this.contentElement.offsetHeight;\n this.totalSizeOtherDimensionCSS =\n this.isVerticalInternal ? this.contentElement.offsetHeight : this.contentElement.offsetWidth;\n }\n return ZoomManager.instance().cssToDIP(this.totalSizeCSS);\n }\n\n private updateShowMode(showMode: string): void {\n this.showModeInternal = showMode;\n this.saveShowModeToSettings();\n this.updateShowHideSidebarButton();\n this.dispatchEventToListeners(Events.SHOW_MODE_CHANGED, showMode);\n this.invalidateConstraints();\n }\n\n private innerSetSidebarSizeDIP(sizeDIP: number, animate: boolean, userAction?: boolean): void {\n if (this.showModeInternal !== ShowMode.BOTH || !this.isShowing()) {\n return;\n }\n\n sizeDIP = this.applyConstraints(sizeDIP, userAction);\n if (this.sidebarSizeDIP === sizeDIP) {\n return;\n }\n\n if (!this.resizerElementSize) {\n this.resizerElementSize =\n this.isVerticalInternal ? this.resizerElementInternal.offsetWidth : this.resizerElementInternal.offsetHeight;\n }\n\n // Invalidate layout below.\n\n this.removeAllLayoutProperties();\n\n // this.totalSizeDIP is available below since we successfully applied constraints.\n const roundSizeCSS = Math.round(ZoomManager.instance().dipToCSS(sizeDIP));\n const sidebarSizeValue = roundSizeCSS + 'px';\n const mainSizeValue = (this.totalSizeCSS - roundSizeCSS) + 'px';\n this.sidebarElementInternal.style.flexBasis = sidebarSizeValue;\n\n // Make both sides relayout boundaries.\n if (this.isVerticalInternal) {\n this.sidebarElementInternal.style.width = sidebarSizeValue;\n this.mainElement.style.width = mainSizeValue;\n this.sidebarElementInternal.style.height = this.totalSizeOtherDimensionCSS + 'px';\n this.mainElement.style.height = this.totalSizeOtherDimensionCSS + 'px';\n } else {\n this.sidebarElementInternal.style.height = sidebarSizeValue;\n this.mainElement.style.height = mainSizeValue;\n this.sidebarElementInternal.style.width = this.totalSizeOtherDimensionCSS + 'px';\n this.mainElement.style.width = this.totalSizeOtherDimensionCSS + 'px';\n }\n\n // Position resizer.\n if (this.isVerticalInternal) {\n if (this.secondIsSidebar) {\n this.resizerElementInternal.style.right = sidebarSizeValue;\n this.resizerElementInternal.style.marginRight = -this.resizerElementSize / 2 + 'px';\n } else {\n this.resizerElementInternal.style.left = sidebarSizeValue;\n this.resizerElementInternal.style.marginLeft = -this.resizerElementSize / 2 + 'px';\n }\n } else {\n if (this.secondIsSidebar) {\n this.resizerElementInternal.style.bottom = sidebarSizeValue;\n this.resizerElementInternal.style.marginBottom = -this.resizerElementSize / 2 + 'px';\n } else {\n this.resizerElementInternal.style.top = sidebarSizeValue;\n this.resizerElementInternal.style.marginTop = -this.resizerElementSize / 2 + 'px';\n }\n }\n\n this.sidebarSizeDIP = sizeDIP;\n\n // Force layout.\n\n if (animate) {\n this.animate(false);\n } else {\n // No need to recalculate this.sidebarSizeDIP and this.totalSizeDIP again.\n this.doResize();\n this.dispatchEventToListeners(Events.SIDEBAR_SIZE_CHANGED, this.sidebarSize());\n }\n }\n\n private animate(reverse: boolean, callback?: (() => void)): void {\n const animationTime = 50;\n this.animationCallback = callback || null;\n\n let animatedMarginPropertyName: string;\n if (this.isVerticalInternal) {\n animatedMarginPropertyName = this.secondIsSidebar ? 'margin-right' : 'margin-left';\n } else {\n animatedMarginPropertyName = this.secondIsSidebar ? 'margin-bottom' : 'margin-top';\n }\n\n const marginFrom = reverse ? '0' : '-' + ZoomManager.instance().dipToCSS(this.sidebarSizeDIP) + 'px';\n const marginTo = reverse ? '-' + ZoomManager.instance().dipToCSS(this.sidebarSizeDIP) + 'px' : '0';\n\n // This order of things is important.\n // 1. Resize main element early and force layout.\n this.contentElement.style.setProperty(animatedMarginPropertyName, marginFrom);\n this.contentElement.style.setProperty('overflow', 'hidden');\n if (!reverse) {\n suppressUnused(this.mainElement.offsetWidth);\n suppressUnused(this.sidebarElementInternal.offsetWidth);\n }\n\n // 2. Issue onresize to the sidebar element, its size won't change.\n if (!reverse && this.sidebarWidgetInternal) {\n this.sidebarWidgetInternal.doResize();\n }\n\n // 3. Configure and run animation\n this.contentElement.style.setProperty('transition', animatedMarginPropertyName + ' ' + animationTime + 'ms linear');\n\n const boundAnimationFrame = animationFrame.bind(this);\n let startTime: number|null = null;\n function animationFrame(this: SplitWidget): void {\n this.animationFrameHandle = 0;\n\n if (!startTime) {\n // Kick animation on first frame.\n this.contentElement.style.setProperty(animatedMarginPropertyName, marginTo);\n startTime = window.performance.now();\n } else if (window.performance.now() < startTime + animationTime) {\n // Process regular animation frame.\n if (this.mainWidgetInternal) {\n this.mainWidgetInternal.doResize();\n }\n } else {\n // Complete animation.\n this.cancelAnimation();\n if (this.mainWidgetInternal) {\n this.mainWidgetInternal.doResize();\n }\n this.dispatchEventToListeners(Events.SIDEBAR_SIZE_CHANGED, this.sidebarSize());\n return;\n }\n this.animationFrameHandle = this.contentElement.window().requestAnimationFrame(boundAnimationFrame);\n }\n this.animationFrameHandle = this.contentElement.window().requestAnimationFrame(boundAnimationFrame);\n }\n\n private cancelAnimation(): void {\n this.contentElement.style.removeProperty('margin-top');\n this.contentElement.style.removeProperty('margin-right');\n this.contentElement.style.removeProperty('margin-bottom');\n this.contentElement.style.removeProperty('margin-left');\n this.contentElement.style.removeProperty('transition');\n this.contentElement.style.removeProperty('overflow');\n\n if (this.animationFrameHandle) {\n this.contentElement.window().cancelAnimationFrame(this.animationFrameHandle);\n this.animationFrameHandle = 0;\n }\n if (this.animationCallback) {\n this.animationCallback();\n this.animationCallback = null;\n }\n }\n\n private applyConstraints(sidebarSize: number, userAction?: boolean): number {\n const totalSize = this.totalSizeDIP();\n const zoomFactor = this.constraintsInDip ? 1 : ZoomManager.instance().zoomFactor();\n\n let constraints: Constraints =\n this.sidebarWidgetInternal ? this.sidebarWidgetInternal.constraints() : new Constraints();\n let minSidebarSize: 20|number = this.isVertical() ? constraints.minimum.width : constraints.minimum.height;\n if (!minSidebarSize) {\n minSidebarSize = MinPadding;\n }\n minSidebarSize *= zoomFactor;\n if (this.sidebarMinimized) {\n sidebarSize = minSidebarSize;\n }\n\n let preferredSidebarSize: 20|number =\n this.isVertical() ? constraints.preferred.width : constraints.preferred.height;\n if (!preferredSidebarSize) {\n preferredSidebarSize = MinPadding;\n }\n preferredSidebarSize *= zoomFactor;\n // Allow sidebar to be less than preferred by explicit user action.\n if (sidebarSize < preferredSidebarSize) {\n preferredSidebarSize = Math.max(sidebarSize, minSidebarSize);\n }\n preferredSidebarSize += zoomFactor; // 1 css pixel for splitter border.\n\n constraints = this.mainWidgetInternal ? this.mainWidgetInternal.constraints() : new Constraints();\n let minMainSize: 20|number = this.isVertical() ? constraints.minimum.width : constraints.minimum.height;\n if (!minMainSize) {\n minMainSize = MinPadding;\n }\n minMainSize *= zoomFactor;\n\n let preferredMainSize: 20|number = this.isVertical() ? constraints.preferred.width : constraints.preferred.height;\n if (!preferredMainSize) {\n preferredMainSize = MinPadding;\n }\n preferredMainSize *= zoomFactor;\n const savedMainSize = this.isVertical() ? this.savedVerticalMainSize : this.savedHorizontalMainSize;\n if (savedMainSize !== null) {\n preferredMainSize = Math.min(preferredMainSize, savedMainSize * zoomFactor);\n }\n if (userAction) {\n preferredMainSize = minMainSize;\n }\n\n // Enough space for preferred.\n const totalPreferred = preferredMainSize + preferredSidebarSize;\n if (totalPreferred <= totalSize) {\n return Platform.NumberUtilities.clamp(sidebarSize, preferredSidebarSize, totalSize - preferredMainSize);\n }\n\n // Enough space for minimum.\n if (minMainSize + minSidebarSize <= totalSize) {\n const delta = totalPreferred - totalSize;\n const sidebarDelta = delta * preferredSidebarSize / totalPreferred;\n sidebarSize = preferredSidebarSize - sidebarDelta;\n return Platform.NumberUtilities.clamp(sidebarSize, minSidebarSize, totalSize - minMainSize);\n }\n\n // Not enough space even for minimum sizes.\n return Math.max(0, totalSize - minMainSize);\n }\n\n override wasShown(): void {\n this.forceUpdateLayout();\n ZoomManager.instance().addEventListener(ZoomManagerEvents.ZOOM_CHANGED, this.onZoomChanged, this);\n }\n\n override willHide(): void {\n ZoomManager.instance().removeEventListener(ZoomManagerEvents.ZOOM_CHANGED, this.onZoomChanged, this);\n }\n\n override onResize(): void {\n this.updateLayout();\n }\n\n override onLayout(): void {\n this.updateLayout();\n }\n\n override calculateConstraints(): Constraints {\n if (this.showModeInternal === ShowMode.ONLY_MAIN) {\n return this.mainWidgetInternal ? this.mainWidgetInternal.constraints() : new Constraints();\n }\n if (this.showModeInternal === ShowMode.ONLY_SIDEBAR) {\n return this.sidebarWidgetInternal ? this.sidebarWidgetInternal.constraints() : new Constraints();\n }\n\n let mainConstraints: Constraints =\n this.mainWidgetInternal ? this.mainWidgetInternal.constraints() : new Constraints();\n let sidebarConstraints: Constraints =\n this.sidebarWidgetInternal ? this.sidebarWidgetInternal.constraints() : new Constraints();\n const min = MinPadding;\n if (this.isVerticalInternal) {\n mainConstraints = mainConstraints.widthToMax(min).addWidth(1); // 1 for splitter\n sidebarConstraints = sidebarConstraints.widthToMax(min);\n return mainConstraints.addWidth(sidebarConstraints).heightToMax(sidebarConstraints);\n }\n mainConstraints = mainConstraints.heightToMax(min).addHeight(1); // 1 for splitter\n sidebarConstraints = sidebarConstraints.heightToMax(min);\n return mainConstraints.widthToMax(sidebarConstraints).addHeight(sidebarConstraints);\n }\n\n private onResizeStart(): void {\n this.resizeStartSizeDIP = this.sidebarSizeDIP;\n }\n\n private onResizeUpdate(event: Common.EventTarget.EventTargetEvent): void {\n const offset = event.data.currentPosition - event.data.startPosition;\n const offsetDIP = ZoomManager.instance().cssToDIP(offset);\n const newSizeDIP = this.secondIsSidebar ? this.resizeStartSizeDIP - offsetDIP : this.resizeStartSizeDIP + offsetDIP;\n const constrainedSizeDIP = this.applyConstraints(newSizeDIP, true);\n this.savedSidebarSizeDIP = constrainedSizeDIP;\n this.saveSetting();\n this.innerSetSidebarSizeDIP(constrainedSizeDIP, false, true);\n if (this.isVertical()) {\n this.savedVerticalMainSize = this.totalSizeDIP() - this.sidebarSizeDIP;\n } else {\n this.savedHorizontalMainSize = this.totalSizeDIP() - this.sidebarSizeDIP;\n }\n }\n\n private onResizeEnd(): void {\n this.resizeStartSizeDIP = 0;\n }\n\n hideDefaultResizer(noSplitter?: boolean): void {\n this.resizerElementInternal.classList.toggle('hidden', Boolean(noSplitter));\n this.uninstallResizer(this.resizerElementInternal);\n this.sidebarElementInternal.classList.toggle('no-default-splitter', Boolean(noSplitter));\n }\n\n installResizer(resizerElement: Element): void {\n this.resizerWidget.addElement((resizerElement as HTMLElement));\n }\n\n uninstallResizer(resizerElement: Element): void {\n this.resizerWidget.removeElement((resizerElement as HTMLElement));\n }\n\n hasCustomResizer(): boolean {\n const elements = this.resizerWidget.elements();\n return elements.length > 1 || (elements.length === 1 && elements[0] !== this.resizerElementInternal);\n }\n\n toggleResizer(resizer: Element, on: boolean): void {\n if (on) {\n this.installResizer(resizer);\n } else {\n this.uninstallResizer(resizer);\n }\n }\n\n private settingForOrientation(): SettingForOrientation|null {\n const state = this.setting ? this.setting.get() : {};\n const orientationState = this.isVerticalInternal ? state.vertical : state.horizontal;\n return orientationState ?? null;\n }\n\n private preferredSidebarSizeDIP(): number {\n let size: number = this.savedSidebarSizeDIP;\n if (!size) {\n size = this.isVerticalInternal ? this.defaultSidebarWidth : this.defaultSidebarHeight;\n // If we have default value in percents, calculate it on first use.\n if (0 < size && size < 1) {\n size *= this.totalSizeDIP();\n }\n }\n return size;\n }\n\n private restoreSidebarSizeFromSettings(): void {\n const settingForOrientation = this.settingForOrientation();\n this.savedSidebarSizeDIP = settingForOrientation ? settingForOrientation.size : 0;\n }\n\n private restoreAndApplyShowModeFromSettings(): void {\n const orientationState = this.settingForOrientation();\n this.savedShowMode =\n orientationState && orientationState.showMode ? orientationState.showMode : this.showModeInternal;\n this.showModeInternal = this.savedShowMode;\n\n switch (this.savedShowMode) {\n case ShowMode.BOTH:\n this.showBoth();\n break;\n case ShowMode.ONLY_MAIN:\n this.hideSidebar();\n break;\n case ShowMode.ONLY_SIDEBAR:\n this.hideMain();\n break;\n }\n }\n\n private saveShowModeToSettings(): void {\n this.savedShowMode = this.showModeInternal;\n this.saveSetting();\n }\n\n private saveSetting(): void {\n if (!this.setting) {\n return;\n }\n const state = this.setting.get();\n const orientationState =\n (this.isVerticalInternal ? state.vertical : state.horizontal) || {} as SettingForOrientation;\n\n orientationState.size = this.savedSidebarSizeDIP;\n if (this.shouldSaveShowMode) {\n orientationState.showMode = this.savedShowMode;\n }\n\n if (this.isVerticalInternal) {\n state.vertical = orientationState;\n } else {\n state.horizontal = orientationState;\n }\n this.setting.set(state);\n }\n\n private forceUpdateLayout(): void {\n // Force layout even if sidebar size does not change.\n this.sidebarSizeDIP = -1;\n this.updateLayout();\n }\n\n private onZoomChanged(): void {\n this.forceUpdateLayout();\n }\n\n createShowHideSidebarButton(\n showTitle: Common.UIString.LocalizedString, hideTitle: Common.UIString.LocalizedString,\n shownString: Common.UIString.LocalizedString, hiddenString: Common.UIString.LocalizedString,\n jslogContext?: string): ToolbarButton {\n this.showSidebarButtonTitle = showTitle;\n this.hideSidebarButtonTitle = hideTitle;\n this.shownSidebarString = shownString;\n this.hiddenSidebarString = hiddenString;\n this.showHideSidebarButton = new ToolbarButton('', 'right-panel-open');\n this.showHideSidebarButton.addEventListener(ToolbarButton.Events.CLICK, buttonClicked, this);\n if (jslogContext) {\n this.showHideSidebarButton.element.setAttribute(\n 'jslog', `${VisualLogging.toggleSubpane().track({click: true}).context(jslogContext)}`);\n }\n this.updateShowHideSidebarButton();\n\n function buttonClicked(this: SplitWidget): void {\n this.toggleSidebar();\n }\n\n return this.showHideSidebarButton;\n }\n\n /**\n * @returns true if this call makes the sidebar visible, and false otherwise.\n */\n toggleSidebar(): boolean {\n if (this.showModeInternal !== ShowMode.BOTH) {\n this.showBoth(true);\n ARIAUtils.alert(this.shownSidebarString);\n return true;\n }\n this.hideSidebar(true);\n ARIAUtils.alert(this.hiddenSidebarString);\n return false;\n }\n\n private updateShowHideSidebarButton(): void {\n if (!this.showHideSidebarButton) {\n return;\n }\n const sidebarHidden = this.showModeInternal === ShowMode.ONLY_MAIN;\n let glyph = '';\n if (sidebarHidden) {\n glyph = this.isVertical() ? (this.isSidebarSecond() ? 'right-panel-open' : 'left-panel-open') :\n (this.isSidebarSecond() ? 'bottom-panel-open' : 'top-panel-open');\n } else {\n glyph = this.isVertical() ? (this.isSidebarSecond() ? 'right-panel-close' : 'left-panel-close') :\n (this.isSidebarSecond() ? 'bottom-panel-close' : 'top-panel-close');\n }\n this.showHideSidebarButton.setGlyph(glyph);\n this.showHideSidebarButton.setTitle(sidebarHidden ? this.showSidebarButtonTitle : this.hideSidebarButtonTitle);\n }\n}\n\ninterface SplitWidgetOptions {\n vertical?: boolean;\n secondIsSidebar?: boolean;\n settingName?: string;\n defaultSidebarWidth?: number;\n defaultSidebarHeight?: number;\n constraintsInDip?: boolean;\n markAsRoot?: boolean;\n}\n\nexport class SplitWidgetElement extends WidgetElement {\n #options: SplitWidgetOptions = {};\n\n set options(options: SplitWidgetOptions) {\n this.#options = options;\n }\n\n override createWidget(): SplitWidget {\n const {\n vertical,\n secondIsSidebar,\n settingName,\n defaultSidebarWidth,\n defaultSidebarHeight,\n constraintsInDip,\n markAsRoot,\n } = this.#options;\n const widget = new SplitWidget(\n Boolean(vertical), Boolean(secondIsSidebar), settingName, defaultSidebarWidth, defaultSidebarHeight,\n constraintsInDip, this);\n if (markAsRoot) {\n widget.markAsRoot();\n }\n return widget;\n }\n}\n\ncustomElements.define('devtools-split-widget', SplitWidgetElement);\n\nexport const enum ShowMode {\n BOTH = 'Both',\n ONLY_MAIN = 'OnlyMain',\n ONLY_SIDEBAR = 'OnlySidebar',\n}\n\nexport const enum Events {\n SIDEBAR_SIZE_CHANGED = 'SidebarSizeChanged',\n SHOW_MODE_CHANGED = 'ShowModeChanged',\n}\n\nexport type EventTypes = {\n [Events.SIDEBAR_SIZE_CHANGED]: number,\n [Events.SHOW_MODE_CHANGED]: string,\n};\n\nconst MinPadding = 20;\nexport interface SettingForOrientation {\n showMode: string;\n size: number;\n}\n\nconst suppressUnused = function(_value: unknown): void {};\n"]} \ No newline at end of file +{"version":3,"file":"SplitWidget.js","sourceRoot":"","sources":["../../../../../../front_end/ui/legacy/SplitWidget.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,OAAO,KAAK,MAAM,MAAM,6BAA6B,CAAC;AACtD,OAAO,KAAK,QAAQ,MAAM,iCAAiC,CAAC;AAC5D,OAAO,KAAK,aAAa,MAAM,qCAAqC,CAAC;AAErE,OAAO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C;QAClG,CAAC;QACD,IAAI,CAAC,qBAAqB,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;QAC3C,IAAI,CAAC,qBAAqB,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC,CAAC,IAAI,CAAC,sBAAsB,CAAC,CAAC,CAAC,IAAI,CAAC,sBAAsB,CAAC,CAAC;IACjH,CAAC;CACF;AAYD,MAAM,OAAO,kBAAmB,SAAQ,aAA0B;IAChE,QAAQ,GAAuB,EAAE,CAAC;IAElC,IAAI,OAAO,CAAC,OAA2B;QACrC,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;IAC1B,CAAC;IAEQ,YAAY;QACnB,MAAM,EACJ,QAAQ,EACR,eAAe,EACf,WAAW,EACX,mBAAmB,EACnB,oBAAoB,EACpB,gBAAgB,EAChB,UAAU,GACX,GAAG,IAAI,CAAC,QAAQ,CAAC;QAClB,MAAM,MAAM,GAAG,IAAI,WAAW,CAC1B,OAAO,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC,eAAe,CAAC,EAAE,WAAW,EAAE,mBAAmB,EAAE,oBAAoB,EACnG,gBAAgB,EAAE,IAAI,CAAC,CAAC;QAC5B,IAAI,UAAU,EAAE,CAAC;YACf,MAAM,CAAC,UAAU,EAAE,CAAC;QACtB,CAAC;QACD,OAAO,MAAM,CAAC;IAChB,CAAC;CACF;AAED,cAAc,CAAC,MAAM,CAAC,uBAAuB,EAAE,kBAAkB,CAAC,CAAC;AAkBnE,MAAM,UAAU,GAAG,EAAE,CAAC;AAMtB,MAAM,cAAc,GAAG,UAAS,MAAe,IAAS,CAAC,CAAC","sourcesContent":["/*\n * Copyright (C) 2012 Google Inc. All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are\n * met:\n *\n * * Redistributions of source code must retain the above copyright\n * notice, this list of conditions and the following disclaimer.\n * * Redistributions in binary form must reproduce the above\n * copyright notice, this list of conditions and the following disclaimer\n * in the documentation and/or other materials provided with the\n * distribution.\n * * Neither the name of Google Inc. nor the names of its\n * contributors may be used to endorse or promote products derived from\n * this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nimport * as Common from '../../core/common/common.js';\nimport * as Platform from '../../core/platform/platform.js';\nimport * as VisualLogging from '../visual_logging/visual_logging.js';\n\nimport * as ARIAUtils from './ARIAUtils.js';\nimport {Constraints} from './Geometry.js';\nimport {Events as ResizerWidgetEvents, type ResizeUpdatePositionEvent, SimpleResizerWidget} from './ResizerWidget.js';\nimport splitWidgetStyles from './splitWidget.css.legacy.js';\nimport {ToolbarButton} from './Toolbar.js';\nimport {Widget, WidgetElement} from './Widget.js';\nimport {Events as ZoomManagerEvents, ZoomManager} from './ZoomManager.js';\n\nexport class SplitWidget extends Common.ObjectWrapper.eventMixin(Widget) {\n private sidebarElementInternal: HTMLElement;\n private mainElement: HTMLElement;\n private resizerElementInternal: HTMLElement;\n private resizerElementSize: number|null;\n private readonly resizerWidget: SimpleResizerWidget;\n private defaultSidebarWidth: number;\n private defaultSidebarHeight: number;\n private readonly constraintsInDip: boolean;\n private resizeStartSizeDIP: number;\n private setting: Common.Settings.Setting<{\n vertical?: SettingForOrientation,\n horizontal?: SettingForOrientation,\n }>|null;\n private totalSizeCSS: number;\n private totalSizeOtherDimensionCSS: number;\n private mainWidgetInternal: Widget|null;\n private sidebarWidgetInternal: Widget|null;\n private animationFrameHandle: number;\n private animationCallback: (() => void)|null;\n private showSidebarButtonTitle: Common.UIString.LocalizedString;\n private hideSidebarButtonTitle: Common.UIString.LocalizedString;\n private shownSidebarString: Common.UIString.LocalizedString;\n private hiddenSidebarString: Common.UIString.LocalizedString;\n private showHideSidebarButton: ToolbarButton|null;\n private isVerticalInternal: boolean;\n private sidebarMinimized: boolean;\n private detaching: boolean;\n private sidebarSizeDIP: number;\n private savedSidebarSizeDIP: number;\n private secondIsSidebar: boolean;\n private shouldSaveShowMode: boolean;\n private savedVerticalMainSize: number|null;\n private savedHorizontalMainSize: number|null;\n private showModeInternal: string;\n private savedShowMode: string;\n\n constructor(\n isVertical: boolean, secondIsSidebar: boolean, settingName?: string, defaultSidebarWidth?: number,\n defaultSidebarHeight?: number, constraintsInDip?: boolean, element?: SplitWidgetElement) {\n super(true, undefined, element);\n this.element.classList.add('split-widget');\n this.registerRequiredCSS(splitWidgetStyles);\n\n this.contentElement.classList.add('shadow-split-widget');\n this.sidebarElementInternal =\n this.contentElement.createChild('div', 'shadow-split-widget-contents shadow-split-widget-sidebar vbox');\n this.mainElement =\n this.contentElement.createChild('div', 'shadow-split-widget-contents shadow-split-widget-main vbox');\n const mainSlot = this.mainElement.createChild('slot');\n mainSlot.name = 'main';\n mainSlot.addEventListener('slotchange', (_: Event) => {\n const assignedNode = mainSlot.assignedNodes()[0];\n const widget = assignedNode instanceof HTMLElement ? Widget.getOrCreateWidget(assignedNode) : null;\n if (widget && widget !== this.mainWidgetInternal) {\n this.setMainWidget(widget);\n }\n });\n const sidebarSlot = this.sidebarElementInternal.createChild('slot');\n sidebarSlot.name = 'sidebar';\n sidebarSlot.addEventListener('slotchange', (_: Event) => {\n const assignedNode = sidebarSlot.assignedNodes()[0];\n const widget = assignedNode instanceof HTMLElement ? Widget.getOrCreateWidget(assignedNode) : null;\n if (widget && widget !== this.sidebarWidgetInternal) {\n this.setSidebarWidget(widget);\n }\n });\n this.resizerElementInternal = this.contentElement.createChild('div', 'shadow-split-widget-resizer');\n this.resizerElementSize = null;\n\n this.resizerWidget = new SimpleResizerWidget();\n this.resizerWidget.setEnabled(true);\n this.resizerWidget.addEventListener(ResizerWidgetEvents.RESIZE_START, this.onResizeStart, this);\n this.resizerWidget.addEventListener(ResizerWidgetEvents.RESIZE_UPDATE_POSITION, this.onResizeUpdate, this);\n this.resizerWidget.addEventListener(ResizerWidgetEvents.RESIZE_END, this.onResizeEnd, this);\n\n this.defaultSidebarWidth = defaultSidebarWidth || 200;\n this.defaultSidebarHeight = defaultSidebarHeight || this.defaultSidebarWidth;\n this.constraintsInDip = Boolean(constraintsInDip);\n this.resizeStartSizeDIP = 0;\n this.setting = settingName ? Common.Settings.Settings.instance().createSetting(settingName, {}) : null;\n\n this.totalSizeCSS = 0;\n this.totalSizeOtherDimensionCSS = 0;\n this.mainWidgetInternal = null;\n this.sidebarWidgetInternal = null;\n this.animationFrameHandle = 0;\n this.animationCallback = null;\n this.showSidebarButtonTitle = Common.UIString.LocalizedEmptyString;\n this.hideSidebarButtonTitle = Common.UIString.LocalizedEmptyString;\n this.shownSidebarString = Common.UIString.LocalizedEmptyString;\n this.hiddenSidebarString = Common.UIString.LocalizedEmptyString;\n this.showHideSidebarButton = null;\n this.isVerticalInternal = false;\n this.sidebarMinimized = false;\n this.detaching = false;\n this.sidebarSizeDIP = -1;\n this.savedSidebarSizeDIP = this.sidebarSizeDIP;\n this.secondIsSidebar = false;\n this.shouldSaveShowMode = false;\n this.savedVerticalMainSize = null;\n this.savedHorizontalMainSize = null;\n\n this.setSecondIsSidebar(secondIsSidebar);\n\n this.innerSetVertical(isVertical);\n this.showModeInternal = ShowMode.BOTH;\n this.savedShowMode = this.showModeInternal;\n\n // Should be called after isVertical has the right value.\n this.installResizer(this.resizerElementInternal);\n }\n\n isVertical(): boolean {\n return this.isVerticalInternal;\n }\n\n setVertical(isVertical: boolean): void {\n if (this.isVerticalInternal === isVertical) {\n return;\n }\n\n this.innerSetVertical(isVertical);\n\n if (this.isShowing()) {\n this.updateLayout();\n }\n }\n\n private innerSetVertical(isVertical: boolean): void {\n this.contentElement.classList.toggle('vbox', !isVertical);\n this.contentElement.classList.toggle('hbox', isVertical);\n this.isVerticalInternal = isVertical;\n\n this.resizerElementSize = null;\n this.sidebarSizeDIP = -1;\n this.restoreSidebarSizeFromSettings();\n if (this.shouldSaveShowMode) {\n this.restoreAndApplyShowModeFromSettings();\n }\n this.updateShowHideSidebarButton();\n // FIXME: reverse SplitWidget.isVertical meaning.\n this.resizerWidget.setVertical(!isVertical);\n this.invalidateConstraints();\n }\n\n private updateLayout(animate?: boolean): void {\n this.totalSizeCSS = 0; // Lazy update.\n this.totalSizeOtherDimensionCSS = 0;\n\n // Remove properties that might affect total size calculation.\n this.mainElement.style.removeProperty('width');\n this.mainElement.style.removeProperty('height');\n this.sidebarElementInternal.style.removeProperty('width');\n this.sidebarElementInternal.style.removeProperty('height');\n\n this.innerSetSidebarSizeDIP(this.preferredSidebarSizeDIP(), Boolean(animate));\n }\n\n setMainWidget(widget: Widget): void {\n if (this.mainWidgetInternal === widget) {\n return;\n }\n this.suspendInvalidations();\n if (this.mainWidgetInternal) {\n this.mainWidgetInternal.detach();\n }\n this.mainWidgetInternal = widget;\n if (widget) {\n widget.element.slot = 'main';\n if (this.showModeInternal === ShowMode.ONLY_MAIN || this.showModeInternal === ShowMode.BOTH) {\n widget.show(this.element);\n }\n }\n this.resumeInvalidations();\n }\n\n setSidebarWidget(widget: Widget): void {\n if (this.sidebarWidgetInternal === widget) {\n return;\n }\n this.suspendInvalidations();\n if (this.sidebarWidgetInternal) {\n this.sidebarWidgetInternal.detach();\n }\n this.sidebarWidgetInternal = widget;\n if (widget) {\n widget.element.slot = 'sidebar';\n if (this.showModeInternal === ShowMode.ONLY_SIDEBAR || this.showModeInternal === ShowMode.BOTH) {\n widget.show(this.element);\n }\n }\n this.resumeInvalidations();\n }\n\n mainWidget(): Widget|null {\n return this.mainWidgetInternal;\n }\n\n sidebarWidget(): Widget|null {\n return this.sidebarWidgetInternal;\n }\n\n sidebarElement(): HTMLElement {\n return this.sidebarElementInternal;\n }\n\n override childWasDetached(widget: Widget): void {\n if (this.detaching) {\n return;\n }\n if (this.mainWidgetInternal === widget) {\n this.mainWidgetInternal = null;\n }\n if (this.sidebarWidgetInternal === widget) {\n this.sidebarWidgetInternal = null;\n }\n this.invalidateConstraints();\n }\n\n isSidebarSecond(): boolean {\n return this.secondIsSidebar;\n }\n\n enableShowModeSaving(): void {\n this.shouldSaveShowMode = true;\n this.restoreAndApplyShowModeFromSettings();\n }\n\n showMode(): string {\n return this.showModeInternal;\n }\n\n sidebarIsShowing(): boolean {\n return this.showModeInternal !== ShowMode.ONLY_MAIN;\n }\n\n setSecondIsSidebar(secondIsSidebar: boolean): void {\n if (secondIsSidebar === this.secondIsSidebar) {\n return;\n }\n this.secondIsSidebar = secondIsSidebar;\n if (!this.mainWidgetInternal || !this.mainWidgetInternal.shouldHideOnDetach()) {\n if (secondIsSidebar) {\n this.contentElement.insertBefore(this.mainElement, this.sidebarElementInternal);\n } else {\n this.contentElement.insertBefore(this.mainElement, this.resizerElementInternal);\n }\n } else if (!this.sidebarWidgetInternal || !this.sidebarWidgetInternal.shouldHideOnDetach()) {\n if (secondIsSidebar) {\n this.contentElement.insertBefore(this.sidebarElementInternal, this.resizerElementInternal);\n } else {\n this.contentElement.insertBefore(this.sidebarElementInternal, this.mainElement);\n }\n } else {\n console.error('Could not swap split widget side. Both children widgets contain iframes.');\n this.secondIsSidebar = !secondIsSidebar;\n }\n }\n\n sidebarSide(): string|null {\n if (this.showModeInternal !== ShowMode.BOTH) {\n return null;\n }\n return this.isVerticalInternal ? (this.secondIsSidebar ? 'right' : 'left') :\n (this.secondIsSidebar ? 'bottom' : 'top');\n }\n\n resizerElement(): Element {\n return this.resizerElementInternal;\n }\n\n hideMain(animate?: boolean): void {\n this.showOnly(\n this.sidebarWidgetInternal, this.mainWidgetInternal, this.sidebarElementInternal, this.mainElement, animate);\n this.updateShowMode(ShowMode.ONLY_SIDEBAR);\n }\n\n hideSidebar(animate?: boolean): void {\n this.showOnly(\n this.mainWidgetInternal, this.sidebarWidgetInternal, this.mainElement, this.sidebarElementInternal, animate);\n this.updateShowMode(ShowMode.ONLY_MAIN);\n }\n\n setSidebarMinimized(minimized: boolean): void {\n this.sidebarMinimized = minimized;\n this.invalidateConstraints();\n }\n\n isSidebarMinimized(): boolean {\n return this.sidebarMinimized;\n }\n\n private showOnly(\n sideToShow: Widget|null, sideToHide: Widget|null, shadowToShow: Element, shadowToHide: Element,\n animate?: boolean): void {\n this.cancelAnimation();\n\n function callback(this: SplitWidget): void {\n if (sideToShow) {\n // Make sure main is first in the children list.\n if (sideToShow === this.mainWidgetInternal) {\n this.mainWidgetInternal.show(\n this.element, this.sidebarWidgetInternal ? this.sidebarWidgetInternal.element : null);\n } else if (this.sidebarWidgetInternal) {\n this.sidebarWidgetInternal.show(this.element);\n }\n }\n if (sideToHide) {\n this.detaching = true;\n sideToHide.detach();\n this.detaching = false;\n }\n\n this.resizerElementInternal.classList.add('hidden');\n shadowToShow.classList.remove('hidden');\n shadowToShow.classList.add('maximized');\n shadowToHide.classList.add('hidden');\n shadowToHide.classList.remove('maximized');\n this.removeAllLayoutProperties();\n this.doResize();\n this.showFinishedForTest();\n }\n\n if (animate) {\n this.animate(true, callback.bind(this));\n } else {\n callback.call(this);\n }\n\n this.sidebarSizeDIP = -1;\n this.setResizable(false);\n }\n\n private showFinishedForTest(): void {\n // This method is sniffed in tests.\n }\n\n private removeAllLayoutProperties(): void {\n this.sidebarElementInternal.style.removeProperty('flexBasis');\n\n this.mainElement.style.removeProperty('width');\n this.mainElement.style.removeProperty('height');\n this.sidebarElementInternal.style.removeProperty('width');\n this.sidebarElementInternal.style.removeProperty('height');\n\n this.resizerElementInternal.style.removeProperty('left');\n this.resizerElementInternal.style.removeProperty('right');\n this.resizerElementInternal.style.removeProperty('top');\n this.resizerElementInternal.style.removeProperty('bottom');\n\n this.resizerElementInternal.style.removeProperty('margin-left');\n this.resizerElementInternal.style.removeProperty('margin-right');\n this.resizerElementInternal.style.removeProperty('margin-top');\n this.resizerElementInternal.style.removeProperty('margin-bottom');\n }\n\n showBoth(animate?: boolean): void {\n if (this.showModeInternal === ShowMode.BOTH) {\n animate = false;\n }\n\n this.cancelAnimation();\n this.mainElement.classList.remove('maximized', 'hidden');\n this.sidebarElementInternal.classList.remove('maximized', 'hidden');\n this.resizerElementInternal.classList.remove('hidden');\n this.setResizable(true);\n\n // Make sure main is the first in the children list.\n this.suspendInvalidations();\n if (this.sidebarWidgetInternal) {\n this.sidebarWidgetInternal.show(this.element);\n }\n if (this.mainWidgetInternal) {\n this.mainWidgetInternal.show(\n this.element, this.sidebarWidgetInternal ? this.sidebarWidgetInternal.element : null);\n }\n this.resumeInvalidations();\n // Order widgets in DOM properly.\n this.setSecondIsSidebar(this.secondIsSidebar);\n\n this.sidebarSizeDIP = -1;\n this.updateShowMode(ShowMode.BOTH);\n this.updateLayout(animate);\n }\n\n setResizable(resizable: boolean): void {\n this.resizerWidget.setEnabled(resizable);\n }\n\n forceSetSidebarWidth(width: number): void {\n this.defaultSidebarWidth = width;\n this.savedSidebarSizeDIP = width;\n this.updateLayout();\n }\n\n isResizable(): boolean {\n return this.resizerWidget.isEnabled();\n }\n\n setSidebarSize(size: number): void {\n const sizeDIP = ZoomManager.instance().cssToDIP(size);\n this.savedSidebarSizeDIP = sizeDIP;\n this.saveSetting();\n this.innerSetSidebarSizeDIP(sizeDIP, false, true);\n }\n\n sidebarSize(): number {\n const sizeDIP = Math.max(0, this.sidebarSizeDIP);\n return ZoomManager.instance().dipToCSS(sizeDIP);\n }\n\n /**\n * Returns total size in DIP.\n */\n private totalSizeDIP(): number {\n if (!this.totalSizeCSS) {\n this.totalSizeCSS = this.isVerticalInternal ? this.contentElement.offsetWidth : this.contentElement.offsetHeight;\n this.totalSizeOtherDimensionCSS =\n this.isVerticalInternal ? this.contentElement.offsetHeight : this.contentElement.offsetWidth;\n }\n return ZoomManager.instance().cssToDIP(this.totalSizeCSS);\n }\n\n private updateShowMode(showMode: string): void {\n this.showModeInternal = showMode;\n this.saveShowModeToSettings();\n this.updateShowHideSidebarButton();\n this.dispatchEventToListeners(Events.SHOW_MODE_CHANGED, showMode);\n this.invalidateConstraints();\n }\n\n private innerSetSidebarSizeDIP(sizeDIP: number, animate: boolean, userAction?: boolean): void {\n if (this.showModeInternal !== ShowMode.BOTH || !this.isShowing()) {\n return;\n }\n\n sizeDIP = this.applyConstraints(sizeDIP, userAction);\n if (this.sidebarSizeDIP === sizeDIP) {\n return;\n }\n\n if (!this.resizerElementSize) {\n this.resizerElementSize =\n this.isVerticalInternal ? this.resizerElementInternal.offsetWidth : this.resizerElementInternal.offsetHeight;\n }\n\n // Invalidate layout below.\n\n this.removeAllLayoutProperties();\n\n // this.totalSizeDIP is available below since we successfully applied constraints.\n const roundSizeCSS = Math.round(ZoomManager.instance().dipToCSS(sizeDIP));\n const sidebarSizeValue = roundSizeCSS + 'px';\n const mainSizeValue = (this.totalSizeCSS - roundSizeCSS) + 'px';\n this.sidebarElementInternal.style.flexBasis = sidebarSizeValue;\n\n // Make both sides relayout boundaries.\n if (this.isVerticalInternal) {\n this.sidebarElementInternal.style.width = sidebarSizeValue;\n this.mainElement.style.width = mainSizeValue;\n this.sidebarElementInternal.style.height = this.totalSizeOtherDimensionCSS + 'px';\n this.mainElement.style.height = this.totalSizeOtherDimensionCSS + 'px';\n } else {\n this.sidebarElementInternal.style.height = sidebarSizeValue;\n this.mainElement.style.height = mainSizeValue;\n this.sidebarElementInternal.style.width = this.totalSizeOtherDimensionCSS + 'px';\n this.mainElement.style.width = this.totalSizeOtherDimensionCSS + 'px';\n }\n\n // Position resizer.\n if (this.isVerticalInternal) {\n if (this.secondIsSidebar) {\n this.resizerElementInternal.style.right = sidebarSizeValue;\n this.resizerElementInternal.style.marginRight = -this.resizerElementSize / 2 + 'px';\n } else {\n this.resizerElementInternal.style.left = sidebarSizeValue;\n this.resizerElementInternal.style.marginLeft = -this.resizerElementSize / 2 + 'px';\n }\n } else {\n if (this.secondIsSidebar) {\n this.resizerElementInternal.style.bottom = sidebarSizeValue;\n this.resizerElementInternal.style.marginBottom = -this.resizerElementSize / 2 + 'px';\n } else {\n this.resizerElementInternal.style.top = sidebarSizeValue;\n this.resizerElementInternal.style.marginTop = -this.resizerElementSize / 2 + 'px';\n }\n }\n\n this.sidebarSizeDIP = sizeDIP;\n\n // Force layout.\n\n if (animate) {\n this.animate(false);\n } else {\n // No need to recalculate this.sidebarSizeDIP and this.totalSizeDIP again.\n this.doResize();\n this.dispatchEventToListeners(Events.SIDEBAR_SIZE_CHANGED, this.sidebarSize());\n }\n }\n\n private animate(reverse: boolean, callback?: (() => void)): void {\n const animationTime = 50;\n this.animationCallback = callback || null;\n\n let animatedMarginPropertyName: string;\n if (this.isVerticalInternal) {\n animatedMarginPropertyName = this.secondIsSidebar ? 'margin-right' : 'margin-left';\n } else {\n animatedMarginPropertyName = this.secondIsSidebar ? 'margin-bottom' : 'margin-top';\n }\n\n const marginFrom = reverse ? '0' : '-' + ZoomManager.instance().dipToCSS(this.sidebarSizeDIP) + 'px';\n const marginTo = reverse ? '-' + ZoomManager.instance().dipToCSS(this.sidebarSizeDIP) + 'px' : '0';\n\n // This order of things is important.\n // 1. Resize main element early and force layout.\n this.contentElement.style.setProperty(animatedMarginPropertyName, marginFrom);\n this.contentElement.style.setProperty('overflow', 'hidden');\n if (!reverse) {\n suppressUnused(this.mainElement.offsetWidth);\n suppressUnused(this.sidebarElementInternal.offsetWidth);\n }\n\n // 2. Issue onresize to the sidebar element, its size won't change.\n if (!reverse && this.sidebarWidgetInternal) {\n this.sidebarWidgetInternal.doResize();\n }\n\n // 3. Configure and run animation\n this.contentElement.style.setProperty('transition', animatedMarginPropertyName + ' ' + animationTime + 'ms linear');\n\n const boundAnimationFrame = animationFrame.bind(this);\n let startTime: number|null = null;\n function animationFrame(this: SplitWidget): void {\n this.animationFrameHandle = 0;\n\n if (!startTime) {\n // Kick animation on first frame.\n this.contentElement.style.setProperty(animatedMarginPropertyName, marginTo);\n startTime = window.performance.now();\n } else if (window.performance.now() < startTime + animationTime) {\n // Process regular animation frame.\n if (this.mainWidgetInternal) {\n this.mainWidgetInternal.doResize();\n }\n } else {\n // Complete animation.\n this.cancelAnimation();\n if (this.mainWidgetInternal) {\n this.mainWidgetInternal.doResize();\n }\n this.dispatchEventToListeners(Events.SIDEBAR_SIZE_CHANGED, this.sidebarSize());\n return;\n }\n this.animationFrameHandle = this.contentElement.window().requestAnimationFrame(boundAnimationFrame);\n }\n this.animationFrameHandle = this.contentElement.window().requestAnimationFrame(boundAnimationFrame);\n }\n\n private cancelAnimation(): void {\n this.contentElement.style.removeProperty('margin-top');\n this.contentElement.style.removeProperty('margin-right');\n this.contentElement.style.removeProperty('margin-bottom');\n this.contentElement.style.removeProperty('margin-left');\n this.contentElement.style.removeProperty('transition');\n this.contentElement.style.removeProperty('overflow');\n\n if (this.animationFrameHandle) {\n this.contentElement.window().cancelAnimationFrame(this.animationFrameHandle);\n this.animationFrameHandle = 0;\n }\n if (this.animationCallback) {\n this.animationCallback();\n this.animationCallback = null;\n }\n }\n\n private applyConstraints(sidebarSize: number, userAction?: boolean): number {\n const totalSize = this.totalSizeDIP();\n const zoomFactor = this.constraintsInDip ? 1 : ZoomManager.instance().zoomFactor();\n\n let constraints: Constraints =\n this.sidebarWidgetInternal ? this.sidebarWidgetInternal.constraints() : new Constraints();\n let minSidebarSize: 20|number = this.isVertical() ? constraints.minimum.width : constraints.minimum.height;\n if (!minSidebarSize) {\n minSidebarSize = MinPadding;\n }\n minSidebarSize *= zoomFactor;\n if (this.sidebarMinimized) {\n sidebarSize = minSidebarSize;\n }\n\n let preferredSidebarSize: 20|number =\n this.isVertical() ? constraints.preferred.width : constraints.preferred.height;\n if (!preferredSidebarSize) {\n preferredSidebarSize = MinPadding;\n }\n preferredSidebarSize *= zoomFactor;\n // Allow sidebar to be less than preferred by explicit user action.\n if (sidebarSize < preferredSidebarSize) {\n preferredSidebarSize = Math.max(sidebarSize, minSidebarSize);\n }\n preferredSidebarSize += zoomFactor; // 1 css pixel for splitter border.\n\n constraints = this.mainWidgetInternal ? this.mainWidgetInternal.constraints() : new Constraints();\n let minMainSize: 20|number = this.isVertical() ? constraints.minimum.width : constraints.minimum.height;\n if (!minMainSize) {\n minMainSize = MinPadding;\n }\n minMainSize *= zoomFactor;\n\n let preferredMainSize: 20|number = this.isVertical() ? constraints.preferred.width : constraints.preferred.height;\n if (!preferredMainSize) {\n preferredMainSize = MinPadding;\n }\n preferredMainSize *= zoomFactor;\n const savedMainSize = this.isVertical() ? this.savedVerticalMainSize : this.savedHorizontalMainSize;\n if (savedMainSize !== null) {\n preferredMainSize = Math.min(preferredMainSize, savedMainSize * zoomFactor);\n }\n if (userAction) {\n preferredMainSize = minMainSize;\n }\n\n // Enough space for preferred.\n const totalPreferred = preferredMainSize + preferredSidebarSize;\n if (totalPreferred <= totalSize) {\n return Platform.NumberUtilities.clamp(sidebarSize, preferredSidebarSize, totalSize - preferredMainSize);\n }\n\n // Enough space for minimum.\n if (minMainSize + minSidebarSize <= totalSize) {\n const delta = totalPreferred - totalSize;\n const sidebarDelta = delta * preferredSidebarSize / totalPreferred;\n sidebarSize = preferredSidebarSize - sidebarDelta;\n return Platform.NumberUtilities.clamp(sidebarSize, minSidebarSize, totalSize - minMainSize);\n }\n\n // Not enough space even for minimum sizes.\n return Math.max(0, totalSize - minMainSize);\n }\n\n override wasShown(): void {\n this.forceUpdateLayout();\n ZoomManager.instance().addEventListener(ZoomManagerEvents.ZOOM_CHANGED, this.onZoomChanged, this);\n }\n\n override willHide(): void {\n ZoomManager.instance().removeEventListener(ZoomManagerEvents.ZOOM_CHANGED, this.onZoomChanged, this);\n }\n\n override onResize(): void {\n this.updateLayout();\n }\n\n override onLayout(): void {\n this.updateLayout();\n }\n\n override calculateConstraints(): Constraints {\n if (this.showModeInternal === ShowMode.ONLY_MAIN) {\n return this.mainWidgetInternal ? this.mainWidgetInternal.constraints() : new Constraints();\n }\n if (this.showModeInternal === ShowMode.ONLY_SIDEBAR) {\n return this.sidebarWidgetInternal ? this.sidebarWidgetInternal.constraints() : new Constraints();\n }\n\n let mainConstraints: Constraints =\n this.mainWidgetInternal ? this.mainWidgetInternal.constraints() : new Constraints();\n let sidebarConstraints: Constraints =\n this.sidebarWidgetInternal ? this.sidebarWidgetInternal.constraints() : new Constraints();\n const min = MinPadding;\n if (this.isVerticalInternal) {\n mainConstraints = mainConstraints.widthToMax(min).addWidth(1); // 1 for splitter\n sidebarConstraints = sidebarConstraints.widthToMax(min);\n return mainConstraints.addWidth(sidebarConstraints).heightToMax(sidebarConstraints);\n }\n mainConstraints = mainConstraints.heightToMax(min).addHeight(1); // 1 for splitter\n sidebarConstraints = sidebarConstraints.heightToMax(min);\n return mainConstraints.widthToMax(sidebarConstraints).addHeight(sidebarConstraints);\n }\n\n private onResizeStart(): void {\n this.resizeStartSizeDIP = this.sidebarSizeDIP;\n }\n\n private onResizeUpdate(event: Common.EventTarget.EventTargetEvent): void {\n const offset = event.data.currentPosition - event.data.startPosition;\n const offsetDIP = ZoomManager.instance().cssToDIP(offset);\n const newSizeDIP = this.secondIsSidebar ? this.resizeStartSizeDIP - offsetDIP : this.resizeStartSizeDIP + offsetDIP;\n const constrainedSizeDIP = this.applyConstraints(newSizeDIP, true);\n this.savedSidebarSizeDIP = constrainedSizeDIP;\n this.saveSetting();\n this.innerSetSidebarSizeDIP(constrainedSizeDIP, false, true);\n if (this.isVertical()) {\n this.savedVerticalMainSize = this.totalSizeDIP() - this.sidebarSizeDIP;\n } else {\n this.savedHorizontalMainSize = this.totalSizeDIP() - this.sidebarSizeDIP;\n }\n }\n\n private onResizeEnd(): void {\n this.resizeStartSizeDIP = 0;\n }\n\n hideDefaultResizer(noSplitter?: boolean): void {\n this.resizerElementInternal.classList.toggle('hidden', Boolean(noSplitter));\n this.uninstallResizer(this.resizerElementInternal);\n this.sidebarElementInternal.classList.toggle('no-default-splitter', Boolean(noSplitter));\n }\n\n installResizer(resizerElement: Element): void {\n this.resizerWidget.addElement((resizerElement as HTMLElement));\n }\n\n uninstallResizer(resizerElement: Element): void {\n this.resizerWidget.removeElement((resizerElement as HTMLElement));\n }\n\n hasCustomResizer(): boolean {\n const elements = this.resizerWidget.elements();\n return elements.length > 1 || (elements.length === 1 && elements[0] !== this.resizerElementInternal);\n }\n\n toggleResizer(resizer: Element, on: boolean): void {\n if (on) {\n this.installResizer(resizer);\n } else {\n this.uninstallResizer(resizer);\n }\n }\n\n private settingForOrientation(): SettingForOrientation|null {\n const state = this.setting ? this.setting.get() : {};\n const orientationState = this.isVerticalInternal ? state.vertical : state.horizontal;\n return orientationState ?? null;\n }\n\n private preferredSidebarSizeDIP(): number {\n let size: number = this.savedSidebarSizeDIP;\n if (!size) {\n size = this.isVerticalInternal ? this.defaultSidebarWidth : this.defaultSidebarHeight;\n // If we have default value in percents, calculate it on first use.\n if (0 < size && size < 1) {\n size *= this.totalSizeDIP();\n }\n }\n return size;\n }\n\n private restoreSidebarSizeFromSettings(): void {\n const settingForOrientation = this.settingForOrientation();\n this.savedSidebarSizeDIP = settingForOrientation ? settingForOrientation.size : 0;\n }\n\n private restoreAndApplyShowModeFromSettings(): void {\n const orientationState = this.settingForOrientation();\n this.savedShowMode =\n orientationState && orientationState.showMode ? orientationState.showMode : this.showModeInternal;\n this.showModeInternal = this.savedShowMode;\n\n switch (this.savedShowMode) {\n case ShowMode.BOTH:\n this.showBoth();\n break;\n case ShowMode.ONLY_MAIN:\n this.hideSidebar();\n break;\n case ShowMode.ONLY_SIDEBAR:\n this.hideMain();\n break;\n }\n }\n\n private saveShowModeToSettings(): void {\n this.savedShowMode = this.showModeInternal;\n this.saveSetting();\n }\n\n private saveSetting(): void {\n if (!this.setting) {\n return;\n }\n const state = this.setting.get();\n const orientationState =\n (this.isVerticalInternal ? state.vertical : state.horizontal) || {} as SettingForOrientation;\n\n orientationState.size = this.savedSidebarSizeDIP;\n if (this.shouldSaveShowMode) {\n orientationState.showMode = this.savedShowMode;\n }\n\n if (this.isVerticalInternal) {\n state.vertical = orientationState;\n } else {\n state.horizontal = orientationState;\n }\n this.setting.set(state);\n }\n\n private forceUpdateLayout(): void {\n // Force layout even if sidebar size does not change.\n this.sidebarSizeDIP = -1;\n this.updateLayout();\n }\n\n private onZoomChanged(): void {\n this.forceUpdateLayout();\n }\n\n createShowHideSidebarButton(\n showTitle: Common.UIString.LocalizedString, hideTitle: Common.UIString.LocalizedString,\n shownString: Common.UIString.LocalizedString, hiddenString: Common.UIString.LocalizedString,\n jslogContext?: string): ToolbarButton {\n this.showSidebarButtonTitle = showTitle;\n this.hideSidebarButtonTitle = hideTitle;\n this.shownSidebarString = shownString;\n this.hiddenSidebarString = hiddenString;\n this.showHideSidebarButton = new ToolbarButton('', 'right-panel-open');\n this.showHideSidebarButton.addEventListener(ToolbarButton.Events.CLICK, buttonClicked, this);\n if (jslogContext) {\n this.showHideSidebarButton.element.setAttribute(\n 'jslog', `${VisualLogging.toggleSubpane().track({click: true}).context(jslogContext)}`);\n }\n this.updateShowHideSidebarButton();\n\n function buttonClicked(this: SplitWidget): void {\n this.toggleSidebar();\n }\n\n return this.showHideSidebarButton;\n }\n\n /**\n * @returns true if this call makes the sidebar visible, and false otherwise.\n */\n toggleSidebar(): boolean {\n if (this.showModeInternal !== ShowMode.BOTH) {\n this.showBoth(true);\n ARIAUtils.alert(this.shownSidebarString);\n return true;\n }\n this.hideSidebar(true);\n ARIAUtils.alert(this.hiddenSidebarString);\n return false;\n }\n\n private updateShowHideSidebarButton(): void {\n if (!this.showHideSidebarButton) {\n return;\n }\n const sidebarHidden = this.showModeInternal === ShowMode.ONLY_MAIN;\n let glyph = '';\n if (sidebarHidden) {\n glyph = this.isVertical() ? (this.isSidebarSecond() ? 'right-panel-open' : 'left-panel-open') :\n (this.isSidebarSecond() ? 'bottom-panel-open' : 'top-panel-open');\n } else {\n glyph = this.isVertical() ? (this.isSidebarSecond() ? 'right-panel-close' : 'left-panel-close') :\n (this.isSidebarSecond() ? 'bottom-panel-close' : 'top-panel-close');\n }\n this.showHideSidebarButton.setGlyph(glyph);\n this.showHideSidebarButton.setTitle(sidebarHidden ? this.showSidebarButtonTitle : this.hideSidebarButtonTitle);\n }\n}\n\ninterface SplitWidgetOptions {\n vertical?: boolean;\n secondIsSidebar?: boolean;\n settingName?: string;\n defaultSidebarWidth?: number;\n defaultSidebarHeight?: number;\n constraintsInDip?: boolean;\n markAsRoot?: boolean;\n}\n\nexport class SplitWidgetElement extends WidgetElement {\n #options: SplitWidgetOptions = {};\n\n set options(options: SplitWidgetOptions) {\n this.#options = options;\n }\n\n override createWidget(): SplitWidget {\n const {\n vertical,\n secondIsSidebar,\n settingName,\n defaultSidebarWidth,\n defaultSidebarHeight,\n constraintsInDip,\n markAsRoot,\n } = this.#options;\n const widget = new SplitWidget(\n Boolean(vertical), Boolean(secondIsSidebar), settingName, defaultSidebarWidth, defaultSidebarHeight,\n constraintsInDip, this);\n if (markAsRoot) {\n widget.markAsRoot();\n }\n return widget;\n }\n}\n\ncustomElements.define('devtools-split-widget', SplitWidgetElement);\n\nexport const enum ShowMode {\n BOTH = 'Both',\n ONLY_MAIN = 'OnlyMain',\n ONLY_SIDEBAR = 'OnlySidebar',\n}\n\nexport const enum Events {\n SIDEBAR_SIZE_CHANGED = 'SidebarSizeChanged',\n SHOW_MODE_CHANGED = 'ShowModeChanged',\n}\n\nexport type EventTypes = {\n [Events.SIDEBAR_SIZE_CHANGED]: number,\n [Events.SHOW_MODE_CHANGED]: string,\n};\n\nconst MinPadding = 20;\nexport interface SettingForOrientation {\n showMode: string;\n size: number;\n}\n\nconst suppressUnused = function(_value: unknown): void {};\n"]} \ No newline at end of file diff --git a/public/ui/legacy/SuggestBox.js b/public/ui/legacy/SuggestBox.js index 127b60084..11b6e5216 100644 --- a/public/ui/legacy/SuggestBox.js +++ b/public/ui/legacy/SuggestBox.js @@ -81,7 +81,7 @@ export class SuggestBox { this.glassPane = new GlassPane(); this.glassPane.setAnchorBehavior("PreferBottom" /* AnchorBehavior.PREFER_BOTTOM */); this.glassPane.setOutsideClickCallback(this.hide.bind(this)); - const shadowRoot = createShadowRootWithCoreStyles(this.glassPane.contentElement, { cssFile: suggestBoxStyles, delegatesFocus: undefined }); + const shadowRoot = createShadowRootWithCoreStyles(this.glassPane.contentElement, { cssFile: suggestBoxStyles }); shadowRoot.appendChild(this.element); } visible() { diff --git a/public/ui/legacy/SuggestBox.js.map b/public/ui/legacy/SuggestBox.js.map index c17e03b5d..fb16a75ad 100644 --- a/public/ui/legacy/SuggestBox.js.map +++ b/public/ui/legacy/SuggestBox.js.map @@ -1 +1 @@ -{"version":3,"file":"SuggestBox.js","sourceRoot":"","sources":["../../../../../../front_end/ui/legacy/SuggestBox.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,OAAO,KAAK,IAAI,MAAM,yBAAyB,CAAC;AAChD,OAAO,KAAK,QAAQ,MAAM,iCAAiC,CAAC;AAE5D,OAAO,KAAK,aAAa,MAAM,qCAAqC,CAAC;AAErE,OAAO,KAAK,SAAS,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAC,IAAI,EAAC,MAAM,eAAe,CAAC;AACnC,OAAO,EAAiB,SAAS,EAAC,MAAM,gBAAgB,CAAC;AACzD,OAAO,EAAC,WAAW,EAAqB,QAAQ,EAAC,MAAM,kBAAkB,CAAC;AAC1E,OAAO,EAAC,SAAS,EAAC,MAAM,gBAAgB,CAAC;AACzC,OAAO,gBAA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n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are\n * met:\n *\n * * Redistributions of source code must retain the above copyright\n * notice, this list of conditions and the following disclaimer.\n * * Redistributions in binary form must reproduce the above\n * copyright notice, this list of conditions and the following disclaimer\n * in the documentation and/or other materials provided with the\n * distribution.\n * * Neither the name of Google Inc. nor the names of its\n * contributors may be used to endorse or promote products derived from\n * this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nimport * as i18n from '../../core/i18n/i18n.js';\nimport * as Platform from '../../core/platform/platform.js';\nimport type * as TextUtils from '../../models/text_utils/text_utils.js';\nimport * as VisualLogging from '../visual_logging/visual_logging.js';\n\nimport * as ARIAUtils from './ARIAUtils.js';\nimport {Size} from './Geometry.js';\nimport {AnchorBehavior, GlassPane} from './GlassPane.js';\nimport {ListControl, type ListDelegate, ListMode} from './ListControl.js';\nimport {ListModel} from './ListModel.js';\nimport suggestBoxStyles from './suggestBox.css.legacy.js';\nimport {createShadowRootWithCoreStyles, measuredScrollbarWidth, measurePreferredSize} from './UIUtils.js';\n\nconst UIStrings = {\n /**\n *@description Aria alert to read the suggestion for the suggestion box when typing in text editor\n *@example {name} PH1\n *@example {2} PH2\n *@example {5} PH3\n */\n sSuggestionSOfS: '{PH1}, suggestion {PH2} of {PH3}',\n /**\n *@description Aria alert to confirm the suggestion when it is selected from the suggestion box\n *@example {name} PH1\n */\n sSuggestionSSelected: '{PH1}, suggestion selected',\n};\nconst str_ = i18n.i18n.registerUIStrings('ui/legacy/SuggestBox.ts', UIStrings);\nconst i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);\nexport interface SuggestBoxDelegate {\n applySuggestion(suggestion: Suggestion|null, isIntermediateSuggestion?: boolean): void;\n\n /**\n * acceptSuggestion will be always called after call to applySuggestion with isIntermediateSuggestion being equal to false.\n */\n acceptSuggestion(): void;\n\n /**\n * Called to obtain the owner element.\n */\n ownerElement(): Element;\n}\n\nexport class SuggestBox implements ListDelegate {\n private readonly suggestBoxDelegate: SuggestBoxDelegate;\n private readonly maxItemsHeight: number|undefined;\n private rowHeight: number;\n private userEnteredText: string;\n private readonly defaultSelectionIsDimmed: boolean;\n private onlyCompletion: Suggestion|null;\n private readonly items: ListModel;\n private readonly list: ListControl;\n element: HTMLDivElement;\n private readonly glassPane: GlassPane;\n\n constructor(suggestBoxDelegate: SuggestBoxDelegate, maxItemsHeight?: number) {\n this.suggestBoxDelegate = suggestBoxDelegate;\n this.maxItemsHeight = maxItemsHeight;\n this.rowHeight = 17;\n this.userEnteredText = '';\n this.defaultSelectionIsDimmed = false;\n\n this.onlyCompletion = null;\n\n this.items = new ListModel();\n this.list = new ListControl(this.items, this, ListMode.EqualHeightItems);\n this.element = this.list.element;\n this.element.classList.add('suggest-box');\n this.element.addEventListener('mousedown', event => event.preventDefault(), true);\n this.element.addEventListener('click', this.onClick.bind(this), false);\n this.element.setAttribute(\n 'jslog',\n `${VisualLogging.menu().parent('mapped').track({resize: true, keydown: 'ArrowUp|ArrowDown|PageUp|PageDown'})}`);\n\n this.glassPane = new GlassPane();\n this.glassPane.setAnchorBehavior(AnchorBehavior.PREFER_BOTTOM);\n this.glassPane.setOutsideClickCallback(this.hide.bind(this));\n const shadowRoot = createShadowRootWithCoreStyles(\n this.glassPane.contentElement, {cssFile: suggestBoxStyles, delegatesFocus: undefined});\n shadowRoot.appendChild(this.element);\n }\n\n visible(): boolean {\n return this.glassPane.isShowing();\n }\n\n setPosition(anchorBox: AnchorBox): void {\n this.glassPane.setContentAnchorBox(anchorBox);\n }\n\n setAnchorBehavior(behavior: AnchorBehavior): void {\n this.glassPane.setAnchorBehavior(behavior);\n }\n\n private updateMaxSize(items: Suggestion[]): void {\n const maxWidth = this.maxWidth(items);\n const length = this.maxItemsHeight ? Math.min(this.maxItemsHeight, items.length) : items.length;\n const maxHeight = length * this.rowHeight;\n this.glassPane.setMaxContentSize(new Size(maxWidth, maxHeight));\n }\n\n private maxWidth(items: Suggestion[]): number {\n const kMaxWidth = 300;\n if (!items.length) {\n return kMaxWidth;\n }\n let maxItem;\n let maxLength: number = -Infinity;\n for (let i = 0; i < items.length; i++) {\n const length = (items[i].title || items[i].text).length + (items[i].subtitle || '').length;\n if (length > maxLength) {\n maxLength = length;\n maxItem = items[i];\n }\n }\n const element = this.createElementForItem((maxItem as Suggestion));\n const preferredWidth =\n measurePreferredSize(element, this.element).width + measuredScrollbarWidth(this.element.ownerDocument);\n return Math.min(kMaxWidth, preferredWidth);\n }\n\n private show(): void {\n if (this.visible()) {\n return;\n }\n VisualLogging.setMappedParent(this.element, this.suggestBoxDelegate.ownerElement());\n // TODO(dgozman): take document as a parameter.\n this.glassPane.show(document);\n const suggestion = ({text: '1', subtitle: '12'} as Suggestion);\n this.rowHeight = measurePreferredSize(this.createElementForItem(suggestion), this.element).height;\n ARIAUtils.setControls(this.suggestBoxDelegate.ownerElement(), this.element);\n ARIAUtils.setExpanded(this.suggestBoxDelegate.ownerElement(), true);\n }\n\n hide(): void {\n if (!this.visible()) {\n return;\n }\n this.glassPane.hide();\n ARIAUtils.setControls(this.suggestBoxDelegate.ownerElement(), null);\n ARIAUtils.setExpanded(this.suggestBoxDelegate.ownerElement(), false);\n }\n\n private applySuggestion(isIntermediateSuggestion?: boolean): boolean {\n if (this.onlyCompletion) {\n isIntermediateSuggestion ?\n ARIAUtils.alert(i18nString(\n UIStrings.sSuggestionSOfS,\n {PH1: this.onlyCompletion.text, PH2: this.list.selectedIndex() + 1, PH3: this.items.length})) :\n ARIAUtils.alert(i18nString(UIStrings.sSuggestionSSelected, {PH1: this.onlyCompletion.text}));\n this.suggestBoxDelegate.applySuggestion(this.onlyCompletion, isIntermediateSuggestion);\n return true;\n }\n const suggestion = this.list.selectedItem();\n if (suggestion && suggestion.text) {\n isIntermediateSuggestion ?\n ARIAUtils.alert(i18nString(UIStrings.sSuggestionSOfS, {\n PH1: suggestion.title || suggestion.text,\n PH2: this.list.selectedIndex() + 1,\n PH3: this.items.length,\n })) :\n ARIAUtils.alert(i18nString(UIStrings.sSuggestionSSelected, {PH1: suggestion.title || suggestion.text}));\n }\n this.suggestBoxDelegate.applySuggestion(suggestion, isIntermediateSuggestion);\n\n return this.visible() && Boolean(suggestion);\n }\n\n acceptSuggestion(): boolean {\n const result = this.applySuggestion();\n this.hide();\n if (!result) {\n return false;\n }\n\n this.suggestBoxDelegate.acceptSuggestion();\n\n return true;\n }\n\n createElementForItem(item: Suggestion): Element {\n const query = this.userEnteredText;\n const element = document.createElement('div');\n element.classList.add('suggest-box-content-item');\n element.classList.add('source-code');\n if (item.isSecondary) {\n element.classList.add('secondary');\n }\n element.tabIndex = -1;\n const maxTextLength = 50 + query.length;\n const displayText = Platform.StringUtilities.trimEndWithMaxLength((item.title || item.text).trim(), maxTextLength)\n .replace(/\\n/g, '\\u21B5');\n\n const titleElement = element.createChild('span', 'suggestion-title');\n const index = displayText.toLowerCase().indexOf(query.toLowerCase());\n if (index > 0) {\n titleElement.createChild('span').textContent = displayText.substring(0, index);\n }\n if (index > -1) {\n titleElement.createChild('span', 'query').textContent = displayText.substring(index, index + query.length);\n }\n titleElement.createChild('span').textContent = displayText.substring(index > -1 ? index + query.length : 0);\n titleElement.createChild('span', 'spacer');\n if (item.subtitleRenderer) {\n const subtitleElement = (item.subtitleRenderer.call(null) as HTMLElement);\n subtitleElement.classList.add('suggestion-subtitle');\n element.appendChild(subtitleElement);\n } else if (item.subtitle) {\n const subtitleElement = element.createChild('span', 'suggestion-subtitle');\n subtitleElement.textContent =\n Platform.StringUtilities.trimEndWithMaxLength(item.subtitle, maxTextLength - displayText.length);\n }\n if (item.iconElement) {\n element.appendChild(item.iconElement);\n }\n return element;\n }\n\n heightForItem(_item: Suggestion): number {\n return this.rowHeight;\n }\n\n isItemSelectable(_item: Suggestion): boolean {\n return true;\n }\n\n selectedItemChanged(from: Suggestion|null, to: Suggestion|null, fromElement: Element|null, toElement: Element|null):\n void {\n if (fromElement) {\n fromElement.classList.remove('selected', 'force-white-icons');\n }\n if (toElement) {\n toElement.classList.add('selected');\n toElement.classList.add('force-white-icons');\n }\n this.applySuggestion(true);\n }\n\n updateSelectedItemARIA(_fromElement: Element|null, _toElement: Element|null): boolean {\n return false;\n }\n\n private onClick(event: Event): void {\n const item = this.list.itemForNode((event.target as Node | null));\n if (!item) {\n return;\n }\n\n this.list.selectItem(item);\n this.acceptSuggestion();\n event.consume(true);\n }\n\n private canShowBox(\n completions: Suggestion[], highestPriorityItem: Suggestion|null, canShowForSingleItem: boolean,\n userEnteredText: string): boolean {\n if (!completions || !completions.length) {\n return false;\n }\n\n if (completions.length > 1) {\n return true;\n }\n\n if (!highestPriorityItem || highestPriorityItem.isSecondary ||\n !highestPriorityItem.text.startsWith(userEnteredText)) {\n return true;\n }\n\n // Do not show a single suggestion if it is the same as user-entered query, even if allowed to show single-item suggest boxes.\n return canShowForSingleItem && highestPriorityItem.text !== userEnteredText;\n }\n\n updateSuggestions(\n anchorBox: AnchorBox, completions: Suggestion[], selectHighestPriority: boolean, canShowForSingleItem: boolean,\n userEnteredText: string): void {\n this.onlyCompletion = null;\n const highestPriorityItem =\n selectHighestPriority ? completions.reduce((a, b) => (a.priority || 0) >= (b.priority || 0) ? a : b) : null;\n if (this.canShowBox(completions, highestPriorityItem, canShowForSingleItem, userEnteredText)) {\n this.userEnteredText = userEnteredText;\n\n this.show();\n this.updateMaxSize(completions);\n this.glassPane.setContentAnchorBox(anchorBox);\n this.list.invalidateItemHeight();\n this.items.replaceAll(completions);\n\n if (highestPriorityItem && !highestPriorityItem.isSecondary) {\n this.list.selectItem(highestPriorityItem, true);\n } else {\n this.list.selectItem(null);\n }\n } else {\n if (completions.length === 1) {\n this.onlyCompletion = completions[0];\n this.applySuggestion(true);\n }\n this.hide();\n }\n }\n\n keyPressed(event: KeyboardEvent): boolean {\n switch (event.key) {\n case 'Enter':\n return this.enterKeyPressed();\n case 'ArrowUp':\n return this.list.selectPreviousItem(true, false);\n case 'ArrowDown':\n return this.list.selectNextItem(true, false);\n case 'PageUp':\n return this.list.selectItemPreviousPage(false);\n case 'PageDown':\n return this.list.selectItemNextPage(false);\n }\n return false;\n }\n\n enterKeyPressed(): boolean {\n const hasSelectedItem = Boolean(this.list.selectedItem()) || Boolean(this.onlyCompletion);\n this.acceptSuggestion();\n\n // Report the event as non-handled if there is no selected item,\n // to commit the input or handle it otherwise.\n return hasSelectedItem;\n }\n}\nexport interface Suggestion {\n text: string;\n title?: string;\n subtitle?: string;\n priority?: number;\n isSecondary?: boolean;\n subtitleRenderer?: (() => Element);\n selectionRange?: {\n startColumn: number,\n endColumn: number,\n };\n hideGhostText?: boolean;\n iconElement?: HTMLElement;\n}\n\nexport type Suggestions = Suggestion[];\nexport interface AutocompleteConfig {\n substituteRangeCallback?: ((arg0: number, arg1: number) => TextUtils.TextRange.TextRange | null);\n tooltipCallback?: ((arg0: number, arg1: number) => Promise);\n suggestionsCallback?:\n ((arg0: TextUtils.TextRange.TextRange, arg1: TextUtils.TextRange.TextRange,\n arg2?: boolean|undefined) => Promise| null);\n isWordChar?: ((arg0: string) => boolean);\n anchorBehavior?: AnchorBehavior;\n}\n"]} \ No newline at end of file +{"version":3,"file":"SuggestBox.js","sourceRoot":"","sources":["../../../../../../front_end/ui/legacy/SuggestBox.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,OAAO,KAAK,IAAI,MAAM,yBAAyB,CAAC;AAChD,OAAO,KAAK,QAAQ,MAAM,iCAAiC,CAAC;AAE5D,OAAO,KAAK,aAAa,MAAM,qCAAqC,CAAC;AAErE,OAAO,KAAK,SAAS,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAC,IAAI,EAAC,MAAM,eAAe,CAAC;AACnC,OAAO,EAAiB,SAAS,EAAC,MAAM,gBAAgB,CAAC;AACzD,OAAO,EAAC,WAAW,EAAqB,QAAQ,EAAC,MAAM,kBAAkB,CAAC;AAC1E,OAAO,EAAC,SAAS,EAAC,MAAM,gBAAgB,CAAC;AACzC,OAAO,gBAAgB,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAC,8BAA8B,EAAE,sBAAsB,EAAE,oBAAoB,EAAC,MAAM,cAAc,CAAC;AAE1G,MAAM,SAAS,GAAG;IAChB;;;;;OAKG;IACH,eAAe,EAAE,kCAAkC;IACnD;;;OAGG;IACH,oBAAoB,EAAE,4BAA4B;CACnD,CAAC;AACF,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,iBAAiB,CAAC,yBAAyB,EAAE,SAAS,CAAC,CAAC;AAC/E,MAAM,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC;AAetE,MAAM,OAAO,UAAU;IACJ,kBAAkB,CAAqB;IACvC,cAAc,CAAmB;IAC1C,SAAS,CAAS;IAClB,eAAe,CAAS;IACf,wBAAwB,CAAU;IAC3C,cAAc,CAAkB;IACvB,KAAK,C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K,CAAC,CAAC;YACnD,KAAK,WAAW;gBACd,OAAO,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;YAC/C,KAAK,QAAQ;gBACX,OAAO,IAAI,CAAC,IAAI,CAAC,sBAAsB,CAAC,KAAK,CAAC,CAAC;YACjD,KAAK,UAAU;gBACb,OAAO,IAAI,CAAC,IAAI,CAAC,kBAAkB,CAAC,KAAK,CAAC,CAAC;QAC/C,CAAC;QACD,OAAO,KAAK,CAAC;IACf,CAAC;IAED,eAAe;QACb,MAAM,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,CAAC,IAAI,OAAO,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;QAC1F,IAAI,CAAC,gBAAgB,EAAE,CAAC;QAExB,gEAAgE;QAChE,8CAA8C;QAC9C,OAAO,eAAe,CAAC;IACzB,CAAC;CACF","sourcesContent":["/*\n * Copyright (C) 2013 Google Inc. All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are\n * met:\n *\n * * Redistributions of source code must retain the above copyright\n * notice, this list of conditions and the following disclaimer.\n * * Redistributions in binary form must reproduce the above\n * copyright notice, this list of conditions and the following disclaimer\n * in the documentation and/or other materials provided with the\n * distribution.\n * * Neither the name of Google Inc. nor the names of its\n * contributors may be used to endorse or promote products derived from\n * this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nimport * as i18n from '../../core/i18n/i18n.js';\nimport * as Platform from '../../core/platform/platform.js';\nimport type * as TextUtils from '../../models/text_utils/text_utils.js';\nimport * as VisualLogging from '../visual_logging/visual_logging.js';\n\nimport * as ARIAUtils from './ARIAUtils.js';\nimport {Size} from './Geometry.js';\nimport {AnchorBehavior, GlassPane} from './GlassPane.js';\nimport {ListControl, type ListDelegate, ListMode} from './ListControl.js';\nimport {ListModel} from './ListModel.js';\nimport suggestBoxStyles from './suggestBox.css.legacy.js';\nimport {createShadowRootWithCoreStyles, measuredScrollbarWidth, measurePreferredSize} from './UIUtils.js';\n\nconst UIStrings = {\n /**\n *@description Aria alert to read the suggestion for the suggestion box when typing in text editor\n *@example {name} PH1\n *@example {2} PH2\n *@example {5} PH3\n */\n sSuggestionSOfS: '{PH1}, suggestion {PH2} of {PH3}',\n /**\n *@description Aria alert to confirm the suggestion when it is selected from the suggestion box\n *@example {name} PH1\n */\n sSuggestionSSelected: '{PH1}, suggestion selected',\n};\nconst str_ = i18n.i18n.registerUIStrings('ui/legacy/SuggestBox.ts', UIStrings);\nconst i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);\nexport interface SuggestBoxDelegate {\n applySuggestion(suggestion: Suggestion|null, isIntermediateSuggestion?: boolean): void;\n\n /**\n * acceptSuggestion will be always called after call to applySuggestion with isIntermediateSuggestion being equal to false.\n */\n acceptSuggestion(): void;\n\n /**\n * Called to obtain the owner element.\n */\n ownerElement(): Element;\n}\n\nexport class SuggestBox implements ListDelegate {\n private readonly suggestBoxDelegate: SuggestBoxDelegate;\n private readonly maxItemsHeight: number|undefined;\n private rowHeight: number;\n private userEnteredText: string;\n private readonly defaultSelectionIsDimmed: boolean;\n private onlyCompletion: Suggestion|null;\n private readonly items: ListModel;\n private readonly list: ListControl;\n element: HTMLDivElement;\n private readonly glassPane: GlassPane;\n\n constructor(suggestBoxDelegate: SuggestBoxDelegate, maxItemsHeight?: number) {\n this.suggestBoxDelegate = suggestBoxDelegate;\n this.maxItemsHeight = maxItemsHeight;\n this.rowHeight = 17;\n this.userEnteredText = '';\n this.defaultSelectionIsDimmed = false;\n\n this.onlyCompletion = null;\n\n this.items = new ListModel();\n this.list = new ListControl(this.items, this, ListMode.EqualHeightItems);\n this.element = this.list.element;\n this.element.classList.add('suggest-box');\n this.element.addEventListener('mousedown', event => event.preventDefault(), true);\n this.element.addEventListener('click', this.onClick.bind(this), false);\n this.element.setAttribute(\n 'jslog',\n `${VisualLogging.menu().parent('mapped').track({resize: true, keydown: 'ArrowUp|ArrowDown|PageUp|PageDown'})}`);\n\n this.glassPane = new GlassPane();\n this.glassPane.setAnchorBehavior(AnchorBehavior.PREFER_BOTTOM);\n this.glassPane.setOutsideClickCallback(this.hide.bind(this));\n const shadowRoot = createShadowRootWithCoreStyles(this.glassPane.contentElement, {cssFile: suggestBoxStyles});\n shadowRoot.appendChild(this.element);\n }\n\n visible(): boolean {\n return this.glassPane.isShowing();\n }\n\n setPosition(anchorBox: AnchorBox): void {\n this.glassPane.setContentAnchorBox(anchorBox);\n }\n\n setAnchorBehavior(behavior: AnchorBehavior): void {\n this.glassPane.setAnchorBehavior(behavior);\n }\n\n private updateMaxSize(items: Suggestion[]): void {\n const maxWidth = this.maxWidth(items);\n const length = this.maxItemsHeight ? Math.min(this.maxItemsHeight, items.length) : items.length;\n const maxHeight = length * this.rowHeight;\n this.glassPane.setMaxContentSize(new Size(maxWidth, maxHeight));\n }\n\n private maxWidth(items: Suggestion[]): number {\n const kMaxWidth = 300;\n if (!items.length) {\n return kMaxWidth;\n }\n let maxItem;\n let maxLength: number = -Infinity;\n for (let i = 0; i < items.length; i++) {\n const length = (items[i].title || items[i].text).length + (items[i].subtitle || '').length;\n if (length > maxLength) {\n maxLength = length;\n maxItem = items[i];\n }\n }\n const element = this.createElementForItem((maxItem as Suggestion));\n const preferredWidth =\n measurePreferredSize(element, this.element).width + measuredScrollbarWidth(this.element.ownerDocument);\n return Math.min(kMaxWidth, preferredWidth);\n }\n\n private show(): void {\n if (this.visible()) {\n return;\n }\n VisualLogging.setMappedParent(this.element, this.suggestBoxDelegate.ownerElement());\n // TODO(dgozman): take document as a parameter.\n this.glassPane.show(document);\n const suggestion = ({text: '1', subtitle: '12'} as Suggestion);\n this.rowHeight = measurePreferredSize(this.createElementForItem(suggestion), this.element).height;\n ARIAUtils.setControls(this.suggestBoxDelegate.ownerElement(), this.element);\n ARIAUtils.setExpanded(this.suggestBoxDelegate.ownerElement(), true);\n }\n\n hide(): void {\n if (!this.visible()) {\n return;\n }\n this.glassPane.hide();\n ARIAUtils.setControls(this.suggestBoxDelegate.ownerElement(), null);\n ARIAUtils.setExpanded(this.suggestBoxDelegate.ownerElement(), false);\n }\n\n private applySuggestion(isIntermediateSuggestion?: boolean): boolean {\n if (this.onlyCompletion) {\n isIntermediateSuggestion ?\n ARIAUtils.alert(i18nString(\n UIStrings.sSuggestionSOfS,\n {PH1: this.onlyCompletion.text, PH2: this.list.selectedIndex() + 1, PH3: this.items.length})) :\n ARIAUtils.alert(i18nString(UIStrings.sSuggestionSSelected, {PH1: this.onlyCompletion.text}));\n this.suggestBoxDelegate.applySuggestion(this.onlyCompletion, isIntermediateSuggestion);\n return true;\n }\n const suggestion = this.list.selectedItem();\n if (suggestion && suggestion.text) {\n isIntermediateSuggestion ?\n ARIAUtils.alert(i18nString(UIStrings.sSuggestionSOfS, {\n PH1: suggestion.title || suggestion.text,\n PH2: this.list.selectedIndex() + 1,\n PH3: this.items.length,\n })) :\n ARIAUtils.alert(i18nString(UIStrings.sSuggestionSSelected, {PH1: suggestion.title || suggestion.text}));\n }\n this.suggestBoxDelegate.applySuggestion(suggestion, isIntermediateSuggestion);\n\n return this.visible() && Boolean(suggestion);\n }\n\n acceptSuggestion(): boolean {\n const result = this.applySuggestion();\n this.hide();\n if (!result) {\n return false;\n }\n\n this.suggestBoxDelegate.acceptSuggestion();\n\n return true;\n }\n\n createElementForItem(item: Suggestion): Element {\n const query = this.userEnteredText;\n const element = document.createElement('div');\n element.classList.add('suggest-box-content-item');\n element.classList.add('source-code');\n if (item.isSecondary) {\n element.classList.add('secondary');\n }\n element.tabIndex = -1;\n const maxTextLength = 50 + query.length;\n const displayText = Platform.StringUtilities.trimEndWithMaxLength((item.title || item.text).trim(), maxTextLength)\n .replace(/\\n/g, '\\u21B5');\n\n const titleElement = element.createChild('span', 'suggestion-title');\n const index = displayText.toLowerCase().indexOf(query.toLowerCase());\n if (index > 0) {\n titleElement.createChild('span').textContent = displayText.substring(0, index);\n }\n if (index > -1) {\n titleElement.createChild('span', 'query').textContent = displayText.substring(index, index + query.length);\n }\n titleElement.createChild('span').textContent = displayText.substring(index > -1 ? index + query.length : 0);\n titleElement.createChild('span', 'spacer');\n if (item.subtitleRenderer) {\n const subtitleElement = (item.subtitleRenderer.call(null) as HTMLElement);\n subtitleElement.classList.add('suggestion-subtitle');\n element.appendChild(subtitleElement);\n } else if (item.subtitle) {\n const subtitleElement = element.createChild('span', 'suggestion-subtitle');\n subtitleElement.textContent =\n Platform.StringUtilities.trimEndWithMaxLength(item.subtitle, maxTextLength - displayText.length);\n }\n if (item.iconElement) {\n element.appendChild(item.iconElement);\n }\n return element;\n }\n\n heightForItem(_item: Suggestion): number {\n return this.rowHeight;\n }\n\n isItemSelectable(_item: Suggestion): boolean {\n return true;\n }\n\n selectedItemChanged(from: Suggestion|null, to: Suggestion|null, fromElement: Element|null, toElement: Element|null):\n void {\n if (fromElement) {\n fromElement.classList.remove('selected', 'force-white-icons');\n }\n if (toElement) {\n toElement.classList.add('selected');\n toElement.classList.add('force-white-icons');\n }\n this.applySuggestion(true);\n }\n\n updateSelectedItemARIA(_fromElement: Element|null, _toElement: Element|null): boolean {\n return false;\n }\n\n private onClick(event: Event): void {\n const item = this.list.itemForNode((event.target as Node | null));\n if (!item) {\n return;\n }\n\n this.list.selectItem(item);\n this.acceptSuggestion();\n event.consume(true);\n }\n\n private canShowBox(\n completions: Suggestion[], highestPriorityItem: Suggestion|null, canShowForSingleItem: boolean,\n userEnteredText: string): boolean {\n if (!completions || !completions.length) {\n return false;\n }\n\n if (completions.length > 1) {\n return true;\n }\n\n if (!highestPriorityItem || highestPriorityItem.isSecondary ||\n !highestPriorityItem.text.startsWith(userEnteredText)) {\n return true;\n }\n\n // Do not show a single suggestion if it is the same as user-entered query, even if allowed to show single-item suggest boxes.\n return canShowForSingleItem && highestPriorityItem.text !== userEnteredText;\n }\n\n updateSuggestions(\n anchorBox: AnchorBox, completions: Suggestion[], selectHighestPriority: boolean, canShowForSingleItem: boolean,\n userEnteredText: string): void {\n this.onlyCompletion = null;\n const highestPriorityItem =\n selectHighestPriority ? completions.reduce((a, b) => (a.priority || 0) >= (b.priority || 0) ? a : b) : null;\n if (this.canShowBox(completions, highestPriorityItem, canShowForSingleItem, userEnteredText)) {\n this.userEnteredText = userEnteredText;\n\n this.show();\n this.updateMaxSize(completions);\n this.glassPane.setContentAnchorBox(anchorBox);\n this.list.invalidateItemHeight();\n this.items.replaceAll(completions);\n\n if (highestPriorityItem && !highestPriorityItem.isSecondary) {\n this.list.selectItem(highestPriorityItem, true);\n } else {\n this.list.selectItem(null);\n }\n } else {\n if (completions.length === 1) {\n this.onlyCompletion = completions[0];\n this.applySuggestion(true);\n }\n this.hide();\n }\n }\n\n keyPressed(event: KeyboardEvent): boolean {\n switch (event.key) {\n case 'Enter':\n return this.enterKeyPressed();\n case 'ArrowUp':\n return this.list.selectPreviousItem(true, false);\n case 'ArrowDown':\n return this.list.selectNextItem(true, false);\n case 'PageUp':\n return this.list.selectItemPreviousPage(false);\n case 'PageDown':\n return this.list.selectItemNextPage(false);\n }\n return false;\n }\n\n enterKeyPressed(): boolean {\n const hasSelectedItem = Boolean(this.list.selectedItem()) || Boolean(this.onlyCompletion);\n this.acceptSuggestion();\n\n // Report the event as non-handled if there is no selected item,\n // to commit the input or handle it otherwise.\n return hasSelectedItem;\n }\n}\nexport interface Suggestion {\n text: string;\n title?: string;\n subtitle?: string;\n priority?: number;\n isSecondary?: boolean;\n subtitleRenderer?: (() => Element);\n selectionRange?: {\n startColumn: number,\n endColumn: number,\n };\n hideGhostText?: boolean;\n iconElement?: HTMLElement;\n}\n\nexport type Suggestions = Suggestion[];\nexport interface AutocompleteConfig {\n substituteRangeCallback?: ((arg0: number, arg1: number) => TextUtils.TextRange.TextRange | null);\n tooltipCallback?: ((arg0: number, arg1: number) => Promise);\n suggestionsCallback?:\n ((arg0: TextUtils.TextRange.TextRange, arg1: TextUtils.TextRange.TextRange,\n arg2?: boolean|undefined) => Promise| null);\n isWordChar?: ((arg0: string) => boolean);\n anchorBehavior?: AnchorBehavior;\n}\n"]} \ No newline at end of file diff --git a/public/ui/legacy/TabbedPane.js.map b/public/ui/legacy/TabbedPane.js.map index 63f8cd087..a9fd92d3d 100644 --- a/public/ui/legacy/TabbedPane.js.map +++ b/public/ui/legacy/TabbedPane.js.map @@ -1 +1 @@ -{"version":3,"file":"TabbedPane.js","sourceRoot":"","sources":["../../../../../../front_end/ui/legacy/TabbedPane.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,OAAO,KAAK,MAAM,MAAM,6BAA6B,CAAC;AACtD,OAAO,KAAK,IAAI,MAAM,yBAAyB,CAAC;AAChD,OAAO,KAAK,QAAQ,MAAM,iCAAiC,CAAC;AAC5D,OAAO,KAAK,OAAO,MAAM,wCAAwC,CAAC;AAClE,OAAO,KAAK,aAAa,MAAM,2CAA2C,CAAC;AAC3E,OAA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AU,CAAC,SAAS,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;QACxC,UAAU,CAAC,KAAK,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC;QACxC,OAAO,IAAI,CAAC,UAAU,CAAC;QACvB,IAAI,CAAC,UAAU,CAAC,eAAe,EAAE,CAAC;IACpC,CAAC;CACF;AAED,MAAM,QAAQ,GAAG,IAAI,OAAO,EAAoB,CAAC;AACjD,MAAM,iBAAiB,GAAG,IAAI,OAAO,EAAoB,CAAC","sourcesContent":["/*\n * Copyright (C) 2010 Google Inc. All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are\n * met:\n *\n * * Redistributions of source code must retain the above copyright\n * notice, this list of conditions and the following disclaimer.\n * * Redistributions in binary form must reproduce the above\n * copyright notice, this list of conditions and the following disclaimer\n * in the documentation and/or other materials provided with the\n * distribution.\n * * Neither the name of Google Inc. nor the names of its\n * contributors may be used to endorse or promote products derived from\n * this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nimport * as Common from '../../core/common/common.js';\nimport * as i18n from '../../core/i18n/i18n.js';\nimport * as Platform from '../../core/platform/platform.js';\nimport * as Buttons from '../../ui/components/buttons/buttons.js';\nimport * as VisualLogging from '../../ui/visual_logging/visual_logging.js';\nimport * as IconButton from '../components/icon_button/icon_button.js';\n\nimport * as ARIAUtils from './ARIAUtils.js';\nimport {ContextMenu} from './ContextMenu.js';\nimport {Constraints, Size} from './Geometry.js';\nimport tabbedPaneStyles from './tabbedPane.css.legacy.js';\nimport {Toolbar} from './Toolbar.js';\nimport {Tooltip} from './Tooltip.js';\nimport {installDragHandle, invokeOnceAfterBatchUpdate} from './UIUtils.js';\nimport {VBox, type Widget} from './Widget.js';\nimport {Events as ZoomManagerEvents, ZoomManager} from './ZoomManager.js';\n\nconst UIStrings = {\n /**\n *@description The aria label for the button to open more tabs at the right tabbed pane in Elements tools\n */\n moreTabs: 'More tabs',\n /**\n *@description Text in Tabbed Pane\n *@example {tab} PH1\n */\n closeS: 'Close {PH1}',\n /**\n *@description Text to close something\n */\n close: 'Close',\n /**\n *@description Text on a menu option to close other drawers when right click on a drawer title\n */\n closeOthers: 'Close others',\n /**\n *@description Text on a menu option to close the drawer to the right when right click on a drawer title\n */\n closeTabsToTheRight: 'Close tabs to the right',\n /**\n *@description Text on a menu option to close all the drawers except Console when right click on a drawer title\n */\n closeAll: 'Close all',\n /**\n *@description Indicates that a tab contains a preview feature (i.e., a beta / experimental feature).\n */\n previewFeature: 'Preview feature',\n /**\n * @description Text to move a tab forwar.\n */\n moveTabRight: 'Move right',\n /**\n * @description Text to move a tab backward.\n */\n moveTabLeft: 'Move left',\n};\nconst str_ = i18n.i18n.registerUIStrings('ui/legacy/TabbedPane.ts', UIStrings);\nconst i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);\nexport class TabbedPane extends Common.ObjectWrapper.eventMixin(VBox) {\n private readonly headerElementInternal: HTMLElement;\n private readonly headerContentsElement: HTMLElement;\n tabSlider: HTMLDivElement;\n readonly tabsElement: HTMLElement;\n private readonly contentElementInternal: HTMLElement;\n private tabs: TabbedPaneTab[];\n private readonly tabsHistory: TabbedPaneTab[];\n tabsById: Map;\n private currentTabLocked: boolean;\n private autoSelectFirstItemOnShow: boolean;\n private triggerDropDownTimeout: number|null;\n private dropDownButton: HTMLDivElement;\n private currentDevicePixelRatio: number;\n private shrinkableTabs?: boolean;\n private verticalTabLayout?: boolean;\n private closeableTabs?: boolean;\n private delegate?: TabbedPaneTabDelegate;\n private currentTab?: TabbedPaneTab;\n private sliderEnabled?: boolean;\n private placeholderElement?: Element;\n private focusedPlaceholderElement?: Element;\n private placeholderContainerElement?: HTMLElement;\n private lastSelectedOverflowTab?: TabbedPaneTab;\n private overflowDisabled?: boolean;\n private measuredDropDownButtonWidth?: number;\n private leftToolbarInternal?: Toolbar;\n private rightToolbarInternal?: Toolbar;\n allowTabReorder?: boolean;\n private automaticReorder?: boolean;\n\n constructor() {\n super(true);\n this.registerRequiredCSS(tabbedPaneStyles);\n this.element.classList.add('tabbed-pane');\n this.contentElement.classList.add('tabbed-pane-shadow');\n this.contentElement.tabIndex = -1;\n this.setDefaultFocusedElement(this.contentElement);\n this.headerElementInternal = this.contentElement.createChild('div', 'tabbed-pane-header');\n this.headerContentsElement = this.headerElementInternal.createChild('div', 'tabbed-pane-header-contents');\n this.tabSlider = document.createElement('div');\n this.tabSlider.classList.add('tabbed-pane-tab-slider');\n this.tabsElement = this.headerContentsElement.createChild('div', 'tabbed-pane-header-tabs');\n this.tabsElement.setAttribute('role', 'tablist');\n this.tabsElement.addEventListener('keydown', this.keyDown.bind(this), false);\n this.contentElementInternal = this.contentElement.createChild('div', 'tabbed-pane-content') as HTMLDivElement;\n this.contentElementInternal.createChild('slot');\n this.tabs = [];\n this.tabsHistory = [];\n this.tabsById = new Map();\n this.currentTabLocked = false;\n this.autoSelectFirstItemOnShow = true;\n\n this.triggerDropDownTimeout = null;\n this.dropDownButton = this.createDropDownButton();\n this.currentDevicePixelRatio = window.devicePixelRatio;\n ZoomManager.instance().addEventListener(ZoomManagerEvents.ZOOM_CHANGED, this.zoomChanged, this);\n this.makeTabSlider();\n }\n\n setAccessibleName(name: string): void {\n ARIAUtils.setLabel(this.tabsElement, name);\n }\n\n setCurrentTabLocked(locked: boolean): void {\n this.currentTabLocked = locked;\n this.headerElementInternal.classList.toggle('locked', this.currentTabLocked);\n }\n\n setAutoSelectFirstItemOnShow(autoSelect: boolean): void {\n this.autoSelectFirstItemOnShow = autoSelect;\n }\n\n get visibleView(): Widget|null {\n return this.currentTab ? this.currentTab.view : null;\n }\n\n tabIds(): string[] {\n return this.tabs.map(tab => tab.id);\n }\n\n tabIndex(tabId: string): number {\n return this.tabs.findIndex(tab => tab.id === tabId);\n }\n\n tabViews(): Widget[] {\n return this.tabs.map(tab => tab.view);\n }\n\n tabView(tabId: string): Widget|null {\n const tab = this.tabsById.get(tabId);\n return tab ? tab.view : null;\n }\n\n get selectedTabId(): string|null {\n return this.currentTab ? this.currentTab.id : null;\n }\n\n setShrinkableTabs(shrinkableTabs: boolean): void {\n this.shrinkableTabs = shrinkableTabs;\n }\n\n makeVerticalTabLayout(): void {\n this.verticalTabLayout = true;\n this.setTabSlider(false);\n this.contentElement.classList.add('vertical-tab-layout');\n this.invalidateConstraints();\n }\n\n setCloseableTabs(closeableTabs: boolean): void {\n this.closeableTabs = closeableTabs;\n }\n\n override focus(): void {\n if (this.visibleView) {\n this.visibleView.focus();\n } else {\n this.contentElement.focus();\n }\n }\n\n focusSelectedTabHeader(): void {\n const selectedTab = this.currentTab;\n if (selectedTab) {\n selectedTab.tabElement.focus();\n }\n }\n\n headerElement(): Element {\n return this.headerElementInternal;\n }\n\n tabbedPaneContentElement(): Element {\n return this.contentElementInternal;\n }\n\n isTabCloseable(id: string): boolean {\n const tab = this.tabsById.get(id);\n return tab ? tab.isCloseable() : false;\n }\n\n setTabDelegate(delegate: TabbedPaneTabDelegate): void {\n const tabs = this.tabs.slice();\n for (let i = 0; i < tabs.length; ++i) {\n tabs[i].setDelegate(delegate);\n }\n this.delegate = delegate;\n }\n\n appendTab(\n id: string, tabTitle: string, view: Widget, tabTooltip?: string, userGesture?: boolean, isCloseable?: boolean,\n isPreviewFeature?: boolean, index?: number, jslogContext?: string): void {\n const closeable = typeof isCloseable === 'boolean' ? isCloseable : Boolean(this.closeableTabs);\n const tab =\n new TabbedPaneTab(this, id, tabTitle, closeable, Boolean(isPreviewFeature), view, tabTooltip, jslogContext);\n tab.setDelegate((this.delegate as TabbedPaneTabDelegate));\n console.assert(!this.tabsById.has(id), `Tabbed pane already contains a tab with id '${id}'`);\n this.tabsById.set(id, tab);\n tab.tabElement.tabIndex = -1;\n tab.tabElement.setAttribute(\n 'jslog', `${VisualLogging.panelTabHeader().track({click: true, drag: true}).context(tab.jslogContext)}`);\n if (index !== undefined) {\n this.tabs.splice(index, 0, tab);\n } else {\n this.tabs.push(tab);\n }\n this.tabsHistory.push(tab);\n if (this.tabsHistory[0] === tab && this.isShowing()) {\n this.selectTab(tab.id, userGesture);\n }\n this.updateTabElements();\n }\n\n closeTab(id: string, userGesture?: boolean): void {\n this.closeTabs([id], userGesture);\n }\n\n closeTabs(ids: string[], userGesture?: boolean): void {\n if (ids.length === 0) {\n return;\n }\n\n const focused = this.hasFocus();\n for (let i = 0; i < ids.length; ++i) {\n this.innerCloseTab(ids[i], userGesture);\n }\n this.updateTabElements();\n if (this.tabsHistory.length) {\n this.selectTab(this.tabsHistory[0].id, false);\n }\n if (focused) {\n this.focus();\n }\n }\n\n private innerCloseTab(id: string, userGesture?: boolean): true|undefined {\n const tab = this.tabsById.get(id);\n if (!tab) {\n return;\n }\n if (userGesture && !tab.closeable) {\n return;\n }\n if (this.currentTab && this.currentTab.id === id) {\n this.hideCurrentTab();\n }\n\n this.tabsById.delete(id);\n\n this.tabsHistory.splice(this.tabsHistory.indexOf(tab), 1);\n this.tabs.splice(this.tabs.indexOf(tab), 1);\n if (tab.shown) {\n this.hideTabElement(tab);\n }\n\n const eventData: EventData = {prevTabId: undefined, tabId: id, view: tab.view, isUserGesture: userGesture};\n this.dispatchEventToListeners(Events.TabClosed, eventData);\n return true;\n }\n\n hasTab(tabId: string): boolean {\n return this.tabsById.has(tabId);\n }\n\n otherTabs(id: string): string[] {\n const result = [];\n for (let i = 0; i < this.tabs.length; ++i) {\n if (this.tabs[i].id !== id) {\n result.push(this.tabs[i].id);\n }\n }\n return result;\n }\n\n tabsToTheRight(id: string): string[] {\n let index = -1;\n for (let i = 0; i < this.tabs.length; ++i) {\n if (this.tabs[i].id === id) {\n index = i;\n break;\n }\n }\n if (index === -1) {\n return [];\n }\n return this.tabs.slice(index + 1).map(function(tab) {\n return tab.id;\n });\n }\n\n private viewHasFocus(): boolean {\n if (this.visibleView && this.visibleView.hasFocus()) {\n return true;\n }\n const root = this.contentElement.getComponentRoot();\n return root instanceof Document && this.contentElement === root.activeElement;\n }\n\n selectTab(id: string, userGesture?: boolean, forceFocus?: boolean): boolean {\n if (this.currentTabLocked) {\n return false;\n }\n const focused = this.viewHasFocus();\n const tab = this.tabsById.get(id);\n if (!tab) {\n return false;\n }\n\n const eventData: EventData = {\n prevTabId: this.currentTab ? this.currentTab.id : undefined,\n tabId: id,\n view: tab.view,\n isUserGesture: userGesture,\n };\n this.dispatchEventToListeners(Events.TabInvoked, eventData);\n if (this.currentTab && this.currentTab.id === id) {\n return true;\n }\n\n this.suspendInvalidations();\n this.hideCurrentTab();\n this.showTab(tab);\n this.resumeInvalidations();\n this.currentTab = tab;\n\n this.tabsHistory.splice(this.tabsHistory.indexOf(tab), 1);\n this.tabsHistory.splice(0, 0, tab);\n\n this.updateTabElements();\n if (focused || forceFocus) {\n this.focus();\n }\n\n this.dispatchEventToListeners(Events.TabSelected, eventData);\n return true;\n }\n\n selectNextTab(): void {\n const index = this.tabs.indexOf((this.currentTab as TabbedPaneTab));\n const nextIndex = Platform.NumberUtilities.mod(index + 1, this.tabs.length);\n this.selectTab(this.tabs[nextIndex].id, true);\n }\n\n selectPrevTab(): void {\n const index = this.tabs.indexOf((this.currentTab as TabbedPaneTab));\n const nextIndex = Platform.NumberUtilities.mod(index - 1, this.tabs.length);\n this.selectTab(this.tabs[nextIndex].id, true);\n }\n\n getTabIndex(id: string): number {\n const index = this.tabs.indexOf((this.tabsById.get(id) as TabbedPaneTab));\n return index;\n }\n\n moveTabBackward(id: string, index: number): void {\n this.insertBefore((this.tabsById.get(id) as TabbedPaneTab), index - 1);\n this.updateTabSlider();\n }\n\n moveTabForward(id: string, index: number): void {\n this.insertBefore((this.tabsById.get(id) as TabbedPaneTab), index + 2);\n this.updateTabSlider();\n }\n\n lastOpenedTabIds(tabsCount: number): string[] {\n function tabToTabId(tab: TabbedPaneTab): string {\n return tab.id;\n }\n\n return this.tabsHistory.slice(0, tabsCount).map(tabToTabId);\n }\n\n setTabIcon(id: string, icon: IconButton.Icon.Icon|null): void {\n const tab = this.tabsById.get(id);\n if (!tab) {\n return;\n }\n tab.setIcon(icon);\n this.updateTabElements();\n }\n\n setSuffixElement(id: string, suffixElement: HTMLElement|null): void {\n const tab = this.tabsById.get(id);\n if (!tab) {\n return;\n }\n tab.setSuffixElement(suffixElement);\n this.updateTabElements();\n }\n\n setTabEnabled(id: string, enabled: boolean): void {\n const tab = this.tabsById.get(id);\n if (tab) {\n tab.tabElement.classList.toggle('disabled', !enabled);\n }\n }\n\n tabIsDisabled(id: string): boolean {\n return !this.tabIsEnabled(id);\n }\n\n tabIsEnabled(id: string): boolean {\n const tab = this.tabsById.get(id);\n const disabled = tab?.tabElement.classList.contains('disabled') ?? false;\n return !disabled;\n }\n\n toggleTabClass(id: string, className: string, force?: boolean): void {\n const tab = this.tabsById.get(id);\n if (tab && tab.toggleClass(className, force)) {\n this.updateTabElements();\n }\n }\n\n private zoomChanged(): void {\n this.clearMeasuredWidths();\n if (this.isShowing()) {\n this.updateTabElements();\n }\n }\n\n private clearMeasuredWidths(): void {\n for (let i = 0; i < this.tabs.length; ++i) {\n delete this.tabs[i].measuredWidth;\n }\n }\n\n changeTabTitle(id: string, tabTitle: string, tabTooltip?: string): void {\n const tab = this.tabsById.get(id);\n if (tab && tabTooltip !== undefined) {\n tab.tooltip = tabTooltip;\n }\n if (tab && tab.title !== tabTitle) {\n tab.title = tabTitle;\n ARIAUtils.setLabel(tab.tabElement, tabTitle);\n this.updateTabElements();\n }\n }\n\n changeTabView(id: string, view: Widget): void {\n const tab = this.tabsById.get(id);\n if (!tab || tab.view === view) {\n return;\n }\n\n this.suspendInvalidations();\n const isSelected = this.currentTab && this.currentTab.id === id;\n const shouldFocus = tab.view.hasFocus();\n if (isSelected) {\n this.hideTab(tab);\n }\n tab.view = view;\n if (isSelected) {\n this.showTab(tab);\n }\n if (shouldFocus) {\n tab.view.focus();\n }\n this.resumeInvalidations();\n }\n\n override onResize(): void {\n if (this.currentDevicePixelRatio !== window.devicePixelRatio) {\n // Force recalculation of all tab widths on a DPI change\n this.clearMeasuredWidths();\n this.currentDevicePixelRatio = window.devicePixelRatio;\n }\n this.updateTabElements();\n }\n\n headerResized(): void {\n this.updateTabElements();\n }\n\n override wasShown(): void {\n const effectiveTab = this.currentTab || this.tabsHistory[0];\n if (effectiveTab && this.autoSelectFirstItemOnShow) {\n this.selectTab(effectiveTab.id);\n }\n this.updateTabElements();\n }\n\n makeTabSlider(): void {\n if (this.verticalTabLayout) {\n return;\n }\n this.setTabSlider(true);\n }\n\n private setTabSlider(enable: boolean): void {\n this.sliderEnabled = enable;\n this.tabSlider.classList.toggle('enabled', enable);\n }\n\n override calculateConstraints(): Constraints {\n let constraints = super.calculateConstraints();\n const minContentConstraints = new Constraints(new Size(0, 0), new Size(50, 50));\n constraints = constraints.widthToMax(minContentConstraints).heightToMax(minContentConstraints);\n if (this.verticalTabLayout) {\n constraints = constraints.addWidth(new Constraints(new Size(120, 0)));\n } else {\n constraints = constraints.addHeight(new Constraints(new Size(0, 30)));\n }\n return constraints;\n }\n\n private updateTabElements(): void {\n invokeOnceAfterBatchUpdate(this, this.innerUpdateTabElements);\n }\n\n setPlaceholderElement(element: Element, focusedElement?: Element): void {\n this.placeholderElement = element;\n if (focusedElement) {\n this.focusedPlaceholderElement = focusedElement;\n }\n if (this.placeholderContainerElement) {\n this.placeholderContainerElement.removeChildren();\n this.placeholderContainerElement.appendChild(element);\n }\n }\n\n async waitForTabElementUpdate(): Promise {\n this.innerUpdateTabElements();\n }\n\n private innerUpdateTabElements(): void {\n if (!this.isShowing()) {\n return;\n }\n\n if (!this.tabs.length) {\n this.contentElementInternal.classList.add('has-no-tabs');\n if (this.placeholderElement && !this.placeholderContainerElement) {\n this.placeholderContainerElement =\n this.contentElementInternal.createChild('div', 'tabbed-pane-placeholder fill');\n this.placeholderContainerElement.appendChild(this.placeholderElement);\n if (this.focusedPlaceholderElement) {\n this.setDefaultFocusedElement(this.focusedPlaceholderElement);\n }\n }\n } else {\n this.contentElementInternal.classList.remove('has-no-tabs');\n if (this.placeholderContainerElement) {\n this.placeholderContainerElement.remove();\n this.setDefaultFocusedElement(this.contentElement);\n delete this.placeholderContainerElement;\n }\n }\n\n this.measureDropDownButton();\n this.adjustToolbarWidth();\n this.updateWidths();\n this.updateTabsDropDown();\n this.updateTabSlider();\n }\n\n private adjustToolbarWidth(): void {\n if (!this.rightToolbarInternal || !this.measuredDropDownButtonWidth) {\n return;\n }\n const leftToolbarWidth = this.leftToolbarInternal?.element.getBoundingClientRect().width ?? 0;\n const rightToolbarWidth = this.rightToolbarInternal.element.getBoundingClientRect().width;\n const totalWidth = this.headerElementInternal.getBoundingClientRect().width;\n if (!this.rightToolbarInternal.hasCompactLayout() &&\n totalWidth - rightToolbarWidth - leftToolbarWidth < this.measuredDropDownButtonWidth + 10) {\n this.rightToolbarInternal.setCompactLayout(true);\n } else if (\n this.rightToolbarInternal.hasCompactLayout() &&\n // Estimate the right toolbar size in non-compact mode as 2 times its compact size.\n totalWidth - 2 * rightToolbarWidth - leftToolbarWidth > this.measuredDropDownButtonWidth + 10) {\n this.rightToolbarInternal.setCompactLayout(false);\n }\n }\n\n private showTabElement(index: number, tab: TabbedPaneTab): void {\n if (index >= this.tabsElement.children.length) {\n this.tabsElement.appendChild(tab.tabElement);\n } else {\n this.tabsElement.insertBefore(tab.tabElement, this.tabsElement.children[index]);\n }\n tab.shown = true;\n }\n\n private hideTabElement(tab: TabbedPaneTab): void {\n this.tabsElement.removeChild(tab.tabElement);\n tab.shown = false;\n }\n\n private createDropDownButton(): HTMLDivElement {\n const dropDownContainer = document.createElement('div');\n dropDownContainer.classList.add('tabbed-pane-header-tabs-drop-down-container');\n dropDownContainer.setAttribute('jslog', `${VisualLogging.dropDown('more-tabs').track({click: true})}`);\n const chevronIcon = IconButton.Icon.create('chevron-double-right', 'chevron-icon');\n const moreTabsString = i18nString(UIStrings.moreTabs);\n dropDownContainer.title = moreTabsString;\n ARIAUtils.markAsMenuButton(dropDownContainer);\n ARIAUtils.setLabel(dropDownContainer, moreTabsString);\n ARIAUtils.setExpanded(dropDownContainer, false);\n dropDownContainer.tabIndex = 0;\n dropDownContainer.appendChild(chevronIcon);\n dropDownContainer.addEventListener('click', this.dropDownClicked.bind(this));\n dropDownContainer.addEventListener('keydown', this.dropDownKeydown.bind(this));\n dropDownContainer.addEventListener('mousedown', event => {\n if (event.button !== 0 || this.triggerDropDownTimeout) {\n return;\n }\n this.triggerDropDownTimeout = window.setTimeout(this.dropDownClicked.bind(this, event), 200);\n });\n return dropDownContainer;\n }\n\n private dropDownClicked(ev: Event): void {\n const event = (ev as MouseEvent);\n if (event.button !== 0) {\n return;\n }\n if (this.triggerDropDownTimeout) {\n clearTimeout(this.triggerDropDownTimeout);\n this.triggerDropDownTimeout = null;\n }\n const rect = this.dropDownButton.getBoundingClientRect();\n const menu = new ContextMenu(event, {\n useSoftMenu: false,\n x: rect.left,\n y: rect.bottom,\n onSoftMenuClosed: () => {\n ARIAUtils.setExpanded(this.dropDownButton, false);\n },\n });\n for (const tab of this.tabs) {\n if (tab.shown) {\n continue;\n }\n if (this.numberOfTabsShown() === 0 && this.tabsHistory[0] === tab) {\n menu.defaultSection().appendCheckboxItem(\n tab.title, this.dropDownMenuItemSelected.bind(this, tab), {checked: true, jslogContext: tab.jslogContext});\n } else {\n menu.defaultSection().appendItem(\n tab.title, this.dropDownMenuItemSelected.bind(this, tab), {jslogContext: tab.jslogContext});\n }\n }\n void menu.show().then(() => ARIAUtils.setExpanded(this.dropDownButton, menu.isHostedMenuOpen()));\n }\n\n private dropDownKeydown(event: KeyboardEvent): void {\n if (Platform.KeyboardUtilities.isEnterOrSpaceKey(event)) {\n this.dropDownButton.click();\n event.consume(true);\n }\n }\n\n private dropDownMenuItemSelected(tab: TabbedPaneTab): void {\n this.lastSelectedOverflowTab = tab;\n this.selectTab(tab.id, true, true);\n }\n\n private totalWidth(): number {\n return this.headerContentsElement.getBoundingClientRect().width;\n }\n\n private numberOfTabsShown(): number {\n let numTabsShown = 0;\n for (const tab of this.tabs) {\n if (tab.shown) {\n numTabsShown++;\n }\n }\n return numTabsShown;\n }\n\n disableOverflowMenu(): void {\n this.overflowDisabled = true;\n }\n\n private updateTabsDropDown(): void {\n const tabsToShowIndexes =\n this.tabsToShowIndexes(this.tabs, this.tabsHistory, this.totalWidth(), this.measuredDropDownButtonWidth || 0);\n if (this.lastSelectedOverflowTab && this.numberOfTabsShown() !== tabsToShowIndexes.length) {\n delete this.lastSelectedOverflowTab;\n this.updateTabsDropDown();\n return;\n }\n\n for (let i = 0; i < this.tabs.length; ++i) {\n if (this.tabs[i].shown && tabsToShowIndexes.indexOf(i) === -1) {\n this.hideTabElement(this.tabs[i]);\n }\n }\n for (let i = 0; i < tabsToShowIndexes.length; ++i) {\n const tab = this.tabs[tabsToShowIndexes[i]];\n if (!tab.shown) {\n this.showTabElement(i, tab);\n }\n }\n\n if (!this.overflowDisabled) {\n this.maybeShowDropDown(tabsToShowIndexes.length !== this.tabs.length);\n }\n }\n\n private maybeShowDropDown(hasMoreTabs: boolean): void {\n if (hasMoreTabs && !this.dropDownButton.parentElement) {\n this.headerContentsElement.appendChild(this.dropDownButton);\n } else if (!hasMoreTabs && this.dropDownButton.parentElement) {\n this.headerContentsElement.removeChild(this.dropDownButton);\n }\n }\n\n private measureDropDownButton(): void {\n if (this.overflowDisabled || this.measuredDropDownButtonWidth) {\n return;\n }\n this.dropDownButton.classList.add('measuring');\n this.headerContentsElement.appendChild(this.dropDownButton);\n this.measuredDropDownButtonWidth = this.dropDownButton.getBoundingClientRect().width;\n this.headerContentsElement.removeChild(this.dropDownButton);\n this.dropDownButton.classList.remove('measuring');\n }\n\n private updateWidths(): void {\n const measuredWidths = this.measureWidths();\n const maxWidth =\n this.shrinkableTabs ? this.calculateMaxWidth(measuredWidths.slice(), this.totalWidth()) : Number.MAX_VALUE;\n\n let i = 0;\n for (const tab of this.tabs) {\n tab.setWidth(this.verticalTabLayout ? -1 : Math.min(maxWidth, measuredWidths[i++]));\n }\n }\n\n private measureWidths(): number[] {\n // Add all elements to measure into this.tabsElement\n this.tabsElement.style.setProperty('width', '2000px');\n const measuringTabElements = new Map();\n for (const tab of this.tabs) {\n if (typeof tab.measuredWidth === 'number') {\n continue;\n }\n const measuringTabElement = tab.createTabElement(/* measure */ true);\n measuringTabElements.set(measuringTabElement, tab);\n this.tabsElement.appendChild(measuringTabElement);\n }\n\n // Perform measurement\n for (const [measuringTabElement, tab] of measuringTabElements) {\n const width = measuringTabElement.getBoundingClientRect().width;\n tab.measuredWidth = Math.ceil(width);\n }\n\n // Nuke elements from the UI\n for (const measuringTabElement of measuringTabElements.keys()) {\n measuringTabElement.remove();\n }\n\n // Combine the results.\n const measuredWidths = [];\n for (const tab of this.tabs) {\n measuredWidths.push(tab.measuredWidth || 0);\n }\n this.tabsElement.style.removeProperty('width');\n\n return measuredWidths;\n }\n\n private calculateMaxWidth(measuredWidths: number[], totalWidth: number): number {\n if (!measuredWidths.length) {\n return 0;\n }\n\n measuredWidths.sort(function(x, y) {\n return x - y;\n });\n\n let totalMeasuredWidth = 0;\n for (let i = 0; i < measuredWidths.length; ++i) {\n totalMeasuredWidth += measuredWidths[i];\n }\n\n if (totalWidth >= totalMeasuredWidth) {\n return measuredWidths[measuredWidths.length - 1];\n }\n\n let totalExtraWidth = 0;\n for (let i = measuredWidths.length - 1; i > 0; --i) {\n const extraWidth = measuredWidths[i] - measuredWidths[i - 1];\n totalExtraWidth += (measuredWidths.length - i) * extraWidth;\n\n if (totalWidth + totalExtraWidth >= totalMeasuredWidth) {\n return measuredWidths[i - 1] +\n (totalWidth + totalExtraWidth - totalMeasuredWidth) / (measuredWidths.length - i);\n }\n }\n\n return totalWidth / measuredWidths.length;\n }\n\n private tabsToShowIndexes(\n tabsOrdered: TabbedPaneTab[], tabsHistory: TabbedPaneTab[], totalWidth: number,\n measuredDropDownButtonWidth: number): number[] {\n const tabsToShowIndexes = [];\n\n let totalTabsWidth = 0;\n const tabCount = tabsOrdered.length;\n const tabsToLookAt = tabsOrdered.slice(0);\n if (this.currentTab !== undefined) {\n tabsToLookAt.unshift(tabsToLookAt.splice(tabsToLookAt.indexOf(this.currentTab), 1)[0]);\n }\n if (this.lastSelectedOverflowTab !== undefined) {\n tabsToLookAt.unshift(tabsToLookAt.splice(tabsToLookAt.indexOf(this.lastSelectedOverflowTab), 1)[0]);\n }\n for (let i = 0; i < tabCount; ++i) {\n const tab = this.automaticReorder ? tabsHistory[i] : tabsToLookAt[i];\n totalTabsWidth += tab.width();\n let minimalRequiredWidth = totalTabsWidth;\n if (i !== tabCount - 1) {\n minimalRequiredWidth += measuredDropDownButtonWidth;\n }\n if (!this.verticalTabLayout && minimalRequiredWidth > totalWidth) {\n break;\n }\n tabsToShowIndexes.push(tabsOrdered.indexOf(tab));\n }\n\n tabsToShowIndexes.sort(function(x, y) {\n return x - y;\n });\n\n return tabsToShowIndexes;\n }\n\n private hideCurrentTab(): void {\n if (!this.currentTab) {\n return;\n }\n\n this.hideTab(this.currentTab);\n delete this.currentTab;\n }\n\n private showTab(tab: TabbedPaneTab): void {\n tab.tabElement.tabIndex = 0;\n tab.tabElement.classList.add('selected');\n ARIAUtils.setSelected(tab.tabElement, true);\n tab.view.show(this.element);\n this.updateTabSlider();\n }\n\n updateTabSlider(): void {\n if (!this.sliderEnabled) {\n return;\n }\n if (!this.currentTab) {\n this.tabSlider.style.width = '0';\n return;\n }\n let left = 0;\n for (let i = 0; i < this.tabs.length && this.currentTab !== this.tabs[i]; i++) {\n if (this.tabs[i].shown) {\n left += this.tabs[i].measuredWidth || 0;\n }\n }\n const sliderWidth = this.currentTab.shown ? this.currentTab.measuredWidth : this.dropDownButton.offsetWidth;\n const scaleFactor = window.devicePixelRatio >= 1.5 ? ' scaleY(0.75)' : '';\n this.tabSlider.style.transform = 'translateX(' + left + 'px)' + scaleFactor;\n this.tabSlider.style.width = sliderWidth + 'px';\n\n if (this.tabSlider.parentElement !== this.headerContentsElement) {\n this.headerContentsElement.appendChild(this.tabSlider);\n }\n }\n\n private hideTab(tab: TabbedPaneTab): void {\n tab.tabElement.removeAttribute('tabIndex');\n tab.tabElement.classList.remove('selected');\n tab.tabElement.tabIndex = -1;\n tab.tabElement.setAttribute('aria-selected', 'false');\n tab.view.detach();\n }\n\n override elementsToRestoreScrollPositionsFor(): Element[] {\n return [this.contentElementInternal];\n }\n\n insertBefore(tab: TabbedPaneTab, index: number): void {\n this.tabsElement.insertBefore(tab.tabElement, this.tabsElement.childNodes[index]);\n const oldIndex = this.tabs.indexOf(tab);\n this.tabs.splice(oldIndex, 1);\n if (oldIndex < index) {\n --index;\n }\n this.tabs.splice(index, 0, tab);\n\n const eventData: EventData = {prevTabId: undefined, tabId: tab.id, view: tab.view, isUserGesture: undefined};\n this.dispatchEventToListeners(Events.TabOrderChanged, eventData);\n }\n\n leftToolbar(): Toolbar {\n if (!this.leftToolbarInternal) {\n this.leftToolbarInternal = new Toolbar('tabbed-pane-left-toolbar');\n this.headerElementInternal.insertBefore(this.leftToolbarInternal.element, this.headerElementInternal.firstChild);\n }\n return this.leftToolbarInternal;\n }\n\n rightToolbar(): Toolbar {\n if (!this.rightToolbarInternal) {\n this.rightToolbarInternal = new Toolbar('tabbed-pane-right-toolbar');\n this.headerElementInternal.appendChild(this.rightToolbarInternal.element);\n }\n return this.rightToolbarInternal;\n }\n\n setAllowTabReorder(allow: boolean, automatic?: boolean): void {\n this.allowTabReorder = allow;\n this.automaticReorder = automatic;\n }\n\n private keyDown(ev: Event): void {\n if (!this.currentTab) {\n return;\n }\n const event = (ev as KeyboardEvent);\n let nextTabElement: (Element|null)|null = null;\n switch (event.key) {\n case 'ArrowUp':\n case 'ArrowLeft':\n nextTabElement = this.currentTab.tabElement.previousElementSibling;\n if (!nextTabElement && !this.dropDownButton.parentElement) {\n nextTabElement = this.currentTab.tabElement.parentElement ?\n this.currentTab.tabElement.parentElement.lastElementChild :\n null;\n }\n break;\n case 'ArrowDown':\n case 'ArrowRight':\n nextTabElement = this.currentTab.tabElement.nextElementSibling;\n if (!nextTabElement && !this.dropDownButton.parentElement) {\n nextTabElement = this.currentTab.tabElement.parentElement ?\n this.currentTab.tabElement.parentElement.firstElementChild :\n null;\n }\n break;\n case 'Enter':\n case ' ':\n this.currentTab.view.focus();\n return;\n default:\n return;\n }\n if (!nextTabElement) {\n this.dropDownButton.click();\n return;\n }\n const tab = this.tabs.find(tab => tab.tabElement === nextTabElement);\n if (tab) {\n this.selectTab(tab.id, true);\n }\n (nextTabElement as HTMLElement).focus();\n }\n}\nexport interface EventData {\n prevTabId?: string;\n tabId: string;\n view?: Widget;\n isUserGesture?: boolean;\n}\n\nexport enum Events {\n /* eslint-disable @typescript-eslint/naming-convention -- Used by web_tests. */\n TabInvoked = 'TabInvoked',\n TabSelected = 'TabSelected',\n TabClosed = 'TabClosed',\n TabOrderChanged = 'TabOrderChanged',\n /* eslint-enable @typescript-eslint/naming-convention */\n}\n\nexport type EventTypes = {\n [Events.TabInvoked]: EventData,\n [Events.TabSelected]: EventData,\n [Events.TabClosed]: EventData,\n [Events.TabOrderChanged]: EventData,\n};\n\nexport class TabbedPaneTab {\n closeable: boolean;\n previewFeature = false;\n private readonly tabbedPane: TabbedPane;\n idInternal: string;\n private titleInternal: string;\n private tooltipInternal: string|undefined;\n private viewInternal: Widget;\n shown: boolean;\n measuredWidth!: number|undefined;\n private tabElementInternal!: HTMLElement|undefined;\n private icon: IconButton.Icon.Icon|null = null;\n private suffixElement: HTMLElement|null = null;\n private widthInternal?: number;\n private delegate?: TabbedPaneTabDelegate;\n private titleElement?: HTMLElement;\n private dragStartX?: number;\n private jslogContextInternal?: string;\n constructor(\n tabbedPane: TabbedPane, id: string, title: string, closeable: boolean, previewFeature: boolean, view: Widget,\n tooltip?: string, jslogContext?: string) {\n this.closeable = closeable;\n this.previewFeature = previewFeature;\n this.tabbedPane = tabbedPane;\n this.idInternal = id;\n this.titleInternal = title;\n this.tooltipInternal = tooltip;\n this.viewInternal = view;\n this.shown = false;\n this.jslogContextInternal = jslogContext;\n }\n\n get id(): string {\n return this.idInternal;\n }\n\n get title(): string {\n return this.titleInternal;\n }\n\n set title(title: string) {\n if (title === this.titleInternal) {\n return;\n }\n this.titleInternal = title;\n if (this.titleElement) {\n this.titleElement.textContent = title;\n const closeIconContainer = this.tabElementInternal?.querySelector('.close-button');\n closeIconContainer?.setAttribute('title', i18nString(UIStrings.closeS, {PH1: title}));\n closeIconContainer?.setAttribute('aria-label', i18nString(UIStrings.closeS, {PH1: title}));\n }\n delete this.measuredWidth;\n }\n\n get jslogContext(): string {\n return this.jslogContextInternal ?? (this.idInternal === 'console-view' ? 'console' : this.idInternal);\n }\n\n isCloseable(): boolean {\n return this.closeable;\n }\n\n setIcon(icon: IconButton.Icon.Icon|null): void {\n this.icon = icon;\n if (this.tabElementInternal && this.titleElement) {\n this.createIconElement(this.tabElementInternal, this.titleElement, false);\n }\n delete this.measuredWidth;\n }\n\n setSuffixElement(suffixElement: HTMLElement|null): void {\n this.suffixElement = suffixElement;\n if (this.tabElementInternal && this.titleElement) {\n this.createSuffixElement(this.tabElementInternal, this.titleElement, false);\n }\n delete this.measuredWidth;\n }\n\n toggleClass(className: string, force?: boolean): boolean {\n const element = this.tabElement;\n const hasClass = element.classList.contains(className);\n if (hasClass === force) {\n return false;\n }\n element.classList.toggle(className, force);\n delete this.measuredWidth;\n return true;\n }\n\n get view(): Widget {\n return this.viewInternal;\n }\n\n set view(view: Widget) {\n this.viewInternal = view;\n }\n\n get tooltip(): string|undefined {\n return this.tooltipInternal;\n }\n\n set tooltip(tooltip: string|undefined) {\n this.tooltipInternal = tooltip;\n if (this.titleElement) {\n Tooltip.install(this.titleElement, tooltip || '');\n }\n }\n\n get tabElement(): HTMLElement {\n if (!this.tabElementInternal) {\n this.tabElementInternal = this.createTabElement(false);\n }\n\n return this.tabElementInternal;\n }\n\n width(): number {\n return this.widthInternal || 0;\n }\n\n setWidth(width: number): void {\n this.tabElement.style.width = width === -1 ? '' : (width + 'px');\n this.widthInternal = width;\n }\n\n setDelegate(delegate: TabbedPaneTabDelegate): void {\n this.delegate = delegate;\n }\n\n private createIconElement(tabElement: Element, titleElement: Element, measuring: boolean): void {\n const iconElement = tabIcons.get(tabElement);\n if (iconElement) {\n iconElement.remove();\n tabIcons.delete(tabElement);\n }\n if (!this.icon) {\n return;\n }\n\n const iconContainer = document.createElement('span');\n iconContainer.classList.add('tabbed-pane-header-tab-icon');\n const iconNode = measuring ? this.createMeasureClone(this.icon) : this.icon;\n iconContainer.appendChild(iconNode);\n titleElement.insertAdjacentElement('beforebegin', iconContainer);\n tabIcons.set(tabElement, iconContainer);\n }\n\n private createSuffixElement(tabElement: Element, titleElement: Element, measuring: boolean): void {\n const tabSuffixElement = tabSuffixElements.get(tabElement);\n if (tabSuffixElement) {\n tabSuffixElement.remove();\n tabSuffixElements.delete(tabElement);\n }\n if (!this.suffixElement) {\n return;\n }\n\n const suffixElementContainer = document.createElement('span');\n suffixElementContainer.classList.add('tabbed-pane-header-tab-suffix-element');\n const suffixElement = measuring ? this.suffixElement.cloneNode() : this.suffixElement;\n suffixElementContainer.appendChild(suffixElement);\n titleElement.insertAdjacentElement('afterend', suffixElementContainer);\n tabSuffixElements.set(tabElement, suffixElementContainer);\n }\n\n private createMeasureClone(original: IconButton.Icon.Icon): Element {\n // Cloning doesn't work for the icon component because the shadow\n // root isn't copied, but it is sufficient to create a div styled\n // to be the same size.\n const fakeClone = document.createElement('div');\n fakeClone.style.width = original.style.width;\n fakeClone.style.height = original.style.height;\n return fakeClone;\n }\n\n createTabElement(measuring: boolean): HTMLElement {\n const tabElement = document.createElement('div');\n tabElement.classList.add('tabbed-pane-header-tab');\n tabElement.id = 'tab-' + this.idInternal;\n ARIAUtils.markAsTab(tabElement);\n ARIAUtils.setSelected(tabElement, false);\n ARIAUtils.setLabel(tabElement, this.title);\n\n const titleElement = tabElement.createChild('span', 'tabbed-pane-header-tab-title');\n titleElement.textContent = this.title;\n Tooltip.install(titleElement, this.tooltip || '');\n this.createIconElement(tabElement, titleElement, measuring);\n this.createSuffixElement(tabElement, titleElement, measuring);\n if (!measuring) {\n this.titleElement = titleElement;\n }\n\n if (this.previewFeature) {\n const previewIcon = this.createPreviewIcon();\n tabElement.appendChild(previewIcon);\n tabElement.classList.add('preview');\n }\n\n if (this.closeable) {\n const closeIcon = this.createCloseIconButton();\n tabElement.appendChild(closeIcon);\n tabElement.classList.add('closeable');\n }\n\n if (measuring) {\n tabElement.classList.add('measuring');\n } else {\n tabElement.addEventListener('click', this.tabClicked.bind(this), false);\n tabElement.addEventListener('auxclick', this.tabClicked.bind(this), false);\n tabElement.addEventListener('mousedown', this.tabMouseDown.bind(this), false);\n tabElement.addEventListener('mouseup', this.tabMouseUp.bind(this), false);\n\n tabElement.addEventListener('contextmenu', this.tabContextMenu.bind(this), false);\n if (this.tabbedPane.allowTabReorder) {\n installDragHandle(\n tabElement, this.startTabDragging.bind(this), this.tabDragging.bind(this), this.endTabDragging.bind(this),\n null, null, 200);\n }\n }\n\n return tabElement as HTMLElement;\n }\n\n private createCloseIconButton(): Buttons.Button.Button {\n const closeButton = new Buttons.Button.Button();\n closeButton.data = {\n variant: Buttons.Button.Variant.ICON,\n size: Buttons.Button.Size.SMALL,\n iconName: 'cross',\n title: i18nString(UIStrings.closeS, {PH1: this.title}),\n };\n closeButton.classList.add('close-button', 'tabbed-pane-close-button');\n closeButton.setAttribute('jslog', `${VisualLogging.close().track({click: true})}`);\n\n closeButton.setAttribute('aria-label', i18nString(UIStrings.closeS, {PH1: this.title}));\n return closeButton;\n }\n\n private createPreviewIcon(): HTMLDivElement {\n const previewIcon = document.createElement('div');\n previewIcon.classList.add('preview-icon');\n const closeIcon = new IconButton.Icon.Icon();\n closeIcon.data = {\n iconName: 'experiment',\n color: 'var(--override-tabbed-pane-preview-icon-color)',\n width: '16px',\n };\n previewIcon.appendChild(closeIcon);\n previewIcon.setAttribute('title', i18nString(UIStrings.previewFeature));\n previewIcon.setAttribute('aria-label', i18nString(UIStrings.previewFeature));\n return previewIcon;\n }\n\n private isCloseIconClicked(element: HTMLElement): boolean {\n return element?.classList.contains('tabbed-pane-close-button') ||\n element?.parentElement?.classList.contains('tabbed-pane-close-button') || false;\n }\n\n private tabClicked(ev: Event): void {\n const event = (ev as MouseEvent);\n const middleButton = event.button === 1;\n const shouldClose = this.closeable && (middleButton || this.isCloseIconClicked(event.target as HTMLElement));\n if (!shouldClose) {\n this.tabbedPane.focus();\n return;\n }\n this.closeTabs([this.id]);\n event.consume(true);\n }\n\n private tabMouseDown(ev: Event): void {\n const event = ev as MouseEvent;\n if (this.isCloseIconClicked(event.target as HTMLElement) || event.button !== 0) {\n return;\n }\n this.tabbedPane.selectTab(this.id, true);\n }\n\n private tabMouseUp(ev: Event): void {\n const event = (ev as MouseEvent);\n // This is needed to prevent middle-click pasting on linux when tabs are clicked.\n if (event.button === 1) {\n event.consume(true);\n }\n }\n\n private closeTabs(ids: string[]): void {\n if (this.delegate) {\n this.delegate.closeTabs(this.tabbedPane, ids);\n return;\n }\n this.tabbedPane.closeTabs(ids, true);\n }\n\n private tabContextMenu(event: Event): void {\n function close(this: TabbedPaneTab): void {\n this.closeTabs([this.id]);\n }\n\n function closeOthers(this: TabbedPaneTab): void {\n this.closeTabs(this.tabbedPane.otherTabs(this.id));\n }\n\n function closeAll(this: TabbedPaneTab): void {\n this.closeTabs(this.tabbedPane.tabIds());\n }\n\n function closeToTheRight(this: TabbedPaneTab): void {\n this.closeTabs(this.tabbedPane.tabsToTheRight(this.id));\n }\n\n function moveTabForward(this: TabbedPaneTab, tabIndex: number): void {\n this.tabbedPane.moveTabForward(this.id, tabIndex);\n }\n\n function moveTabBackward(this: TabbedPaneTab, tabIndex: number): void {\n this.tabbedPane.moveTabBackward(this.id, tabIndex);\n }\n\n const contextMenu = new ContextMenu(event);\n if (this.closeable) {\n contextMenu.defaultSection().appendItem(i18nString(UIStrings.close), close.bind(this), {jslogContext: 'close'});\n contextMenu.defaultSection().appendItem(\n i18nString(UIStrings.closeOthers), closeOthers.bind(this), {jslogContext: 'close-others'});\n contextMenu.defaultSection().appendItem(\n i18nString(UIStrings.closeTabsToTheRight), closeToTheRight.bind(this),\n {jslogContext: 'close-tabs-to-the-right'});\n contextMenu.defaultSection().appendItem(\n i18nString(UIStrings.closeAll), closeAll.bind(this), {jslogContext: 'close-all'});\n }\n if (this.delegate) {\n this.delegate.onContextMenu(this.id, contextMenu);\n }\n const tabIndex = this.tabbedPane.getTabIndex(this.id);\n if (tabIndex > 0) {\n contextMenu.defaultSection().appendItem(\n i18nString(UIStrings.moveTabLeft), moveTabBackward.bind(this, tabIndex), {jslogContext: 'move-tab-backward'});\n }\n if (tabIndex < this.tabbedPane.tabsElement.childNodes.length - 1) {\n contextMenu.defaultSection().appendItem(\n i18nString(UIStrings.moveTabRight), moveTabForward.bind(this, tabIndex), {jslogContext: 'move-tab-forward'});\n }\n void contextMenu.show();\n }\n\n private startTabDragging(ev: Event): boolean {\n const event = (ev as MouseEvent);\n if (this.isCloseIconClicked(event.target as HTMLElement)) {\n return false;\n }\n this.dragStartX = event.pageX;\n if (this.tabElementInternal) {\n this.tabElementInternal.classList.add('dragging');\n }\n this.tabbedPane.tabSlider.remove();\n return true;\n }\n\n private tabDragging(ev: Event): void {\n const event = (ev as MouseEvent);\n const tabElements = this.tabbedPane.tabsElement.childNodes;\n for (let i = 0; i < tabElements.length; ++i) {\n let tabElement: HTMLElement = (tabElements[i] as HTMLElement);\n if (!this.tabElementInternal || tabElement === this.tabElementInternal) {\n continue;\n }\n\n const intersects = tabElement.offsetLeft + tabElement.clientWidth > this.tabElementInternal.offsetLeft &&\n this.tabElementInternal.offsetLeft + this.tabElementInternal.clientWidth > tabElement.offsetLeft;\n if (!intersects) {\n continue;\n }\n\n const dragStartX = (this.dragStartX as number);\n if (Math.abs(event.pageX - dragStartX) < tabElement.clientWidth / 2 + 5) {\n break;\n }\n\n if (event.pageX - dragStartX > 0) {\n tabElement = (tabElement.nextSibling as HTMLElement);\n ++i;\n }\n\n const oldOffsetLeft = this.tabElementInternal.offsetLeft;\n this.tabbedPane.insertBefore(this, i);\n this.dragStartX = dragStartX + this.tabElementInternal.offsetLeft - oldOffsetLeft;\n break;\n }\n\n const dragStartX = (this.dragStartX as number);\n const tabElement = (this.tabElementInternal as HTMLElement);\n if (!tabElement.previousSibling && event.pageX - dragStartX < 0) {\n tabElement.style.setProperty('left', '0px');\n return;\n }\n if (!tabElement.nextSibling && event.pageX - dragStartX > 0) {\n tabElement.style.setProperty('left', '0px');\n return;\n }\n\n tabElement.style.setProperty('left', (event.pageX - dragStartX) + 'px');\n }\n\n private endTabDragging(_event: Event): void {\n const tabElement = (this.tabElementInternal as HTMLElement);\n tabElement.classList.remove('dragging');\n tabElement.style.removeProperty('left');\n delete this.dragStartX;\n this.tabbedPane.updateTabSlider();\n }\n}\n\nconst tabIcons = new WeakMap();\nconst tabSuffixElements = new WeakMap();\n\nexport interface TabbedPaneTabDelegate {\n closeTabs(tabbedPane: TabbedPane, ids: string[]): void;\n onContextMenu(tabId: string, contextMenu: ContextMenu): void;\n}\n"]} \ No newline at end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,KAAK,CAAC,KAAK,GAAG,UAAU,GAAG,CAAC,EAAE,CAAC;YAC5D,UAAU,CAAC,KAAK,CAAC,WAAW,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;YAC5C,OAAO;QACT,CAAC;QAED,UAAU,CAAC,KAAK,CAAC,WAAW,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,KAAK,GAAG,UAAU,CAAC,GAAG,IAAI,CAAC,CAAC;IAC1E,CAAC;IAEO,cAAc,CAAC,MAAa;QAClC,MAAM,UAAU,GAAI,IAAI,CAAC,kBAAkC,CAAC;QAC5D,UAAU,CAAC,SAAS,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;QACxC,UAAU,CAAC,KAAK,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC;QACxC,OAAO,IAAI,CAAC,UAAU,CAAC;QACvB,IAAI,CAAC,UAAU,CAAC,eAAe,EAAE,CAAC;IACpC,CAAC;CACF;AAED,MAAM,QAAQ,GAAG,IAAI,OAAO,EAAoB,CAAC;AACjD,MAAM,iBAAiB,GAAG,IAAI,OAAO,EAAoB,CAAC","sourcesContent":["/*\n * Copyright (C) 2010 Google Inc. All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are\n * met:\n *\n * * Redistributions of source code must retain the above copyright\n * notice, this list of conditions and the following disclaimer.\n * * Redistributions in binary form must reproduce the above\n * copyright notice, this list of conditions and the following disclaimer\n * in the documentation and/or other materials provided with the\n * distribution.\n * * Neither the name of Google Inc. nor the names of its\n * contributors may be used to endorse or promote products derived from\n * this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nimport * as Common from '../../core/common/common.js';\nimport * as i18n from '../../core/i18n/i18n.js';\nimport * as Platform from '../../core/platform/platform.js';\nimport * as Buttons from '../../ui/components/buttons/buttons.js';\nimport * as VisualLogging from '../../ui/visual_logging/visual_logging.js';\nimport * as IconButton from '../components/icon_button/icon_button.js';\n\nimport * as ARIAUtils from './ARIAUtils.js';\nimport {ContextMenu} from './ContextMenu.js';\nimport {Constraints, Size} from './Geometry.js';\nimport tabbedPaneStyles from './tabbedPane.css.legacy.js';\nimport {Toolbar} from './Toolbar.js';\nimport {Tooltip} from './Tooltip.js';\nimport {installDragHandle, invokeOnceAfterBatchUpdate} from './UIUtils.js';\nimport {VBox, type Widget} from './Widget.js';\nimport {Events as ZoomManagerEvents, ZoomManager} from './ZoomManager.js';\n\nconst UIStrings = {\n /**\n *@description The aria label for the button to open more tabs at the right tabbed pane in Elements tools\n */\n moreTabs: 'More tabs',\n /**\n *@description Text in Tabbed Pane\n *@example {tab} PH1\n */\n closeS: 'Close {PH1}',\n /**\n *@description Text to close something\n */\n close: 'Close',\n /**\n *@description Text on a menu option to close other drawers when right click on a drawer title\n */\n closeOthers: 'Close others',\n /**\n *@description Text on a menu option to close the drawer to the right when right click on a drawer title\n */\n closeTabsToTheRight: 'Close tabs to the right',\n /**\n *@description Text on a menu option to close all the drawers except Console when right click on a drawer title\n */\n closeAll: 'Close all',\n /**\n *@description Indicates that a tab contains a preview feature (i.e., a beta / experimental feature).\n */\n previewFeature: 'Preview feature',\n /**\n * @description Text to move a tab forwar.\n */\n moveTabRight: 'Move right',\n /**\n * @description Text to move a tab backward.\n */\n moveTabLeft: 'Move left',\n};\nconst str_ = i18n.i18n.registerUIStrings('ui/legacy/TabbedPane.ts', UIStrings);\nconst i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);\nexport class TabbedPane extends Common.ObjectWrapper.eventMixin(VBox) {\n private readonly headerElementInternal: HTMLElement;\n private readonly headerContentsElement: HTMLElement;\n tabSlider: HTMLDivElement;\n readonly tabsElement: HTMLElement;\n private readonly contentElementInternal: HTMLElement;\n private tabs: TabbedPaneTab[];\n private readonly tabsHistory: TabbedPaneTab[];\n tabsById: Map;\n private currentTabLocked: boolean;\n private autoSelectFirstItemOnShow: boolean;\n private triggerDropDownTimeout: number|null;\n private dropDownButton: HTMLDivElement;\n private currentDevicePixelRatio: number;\n private shrinkableTabs?: boolean;\n private verticalTabLayout?: boolean;\n private closeableTabs?: boolean;\n private delegate?: TabbedPaneTabDelegate;\n private currentTab?: TabbedPaneTab;\n private sliderEnabled?: boolean;\n private placeholderElement?: Element;\n private focusedPlaceholderElement?: Element;\n private placeholderContainerElement?: HTMLElement;\n private lastSelectedOverflowTab?: TabbedPaneTab;\n private overflowDisabled?: boolean;\n private measuredDropDownButtonWidth?: number;\n private leftToolbarInternal?: Toolbar;\n private rightToolbarInternal?: Toolbar;\n allowTabReorder?: boolean;\n private automaticReorder?: boolean;\n\n constructor() {\n super(true);\n this.registerRequiredCSS(tabbedPaneStyles);\n this.element.classList.add('tabbed-pane');\n this.contentElement.classList.add('tabbed-pane-shadow');\n this.contentElement.tabIndex = -1;\n this.setDefaultFocusedElement(this.contentElement);\n this.headerElementInternal = this.contentElement.createChild('div', 'tabbed-pane-header');\n this.headerContentsElement = this.headerElementInternal.createChild('div', 'tabbed-pane-header-contents');\n this.tabSlider = document.createElement('div');\n this.tabSlider.classList.add('tabbed-pane-tab-slider');\n this.tabsElement = this.headerContentsElement.createChild('div', 'tabbed-pane-header-tabs');\n this.tabsElement.setAttribute('role', 'tablist');\n this.tabsElement.addEventListener('keydown', this.keyDown.bind(this), false);\n this.contentElementInternal = this.contentElement.createChild('div', 'tabbed-pane-content');\n this.contentElementInternal.createChild('slot');\n this.tabs = [];\n this.tabsHistory = [];\n this.tabsById = new Map();\n this.currentTabLocked = false;\n this.autoSelectFirstItemOnShow = true;\n\n this.triggerDropDownTimeout = null;\n this.dropDownButton = this.createDropDownButton();\n this.currentDevicePixelRatio = window.devicePixelRatio;\n ZoomManager.instance().addEventListener(ZoomManagerEvents.ZOOM_CHANGED, this.zoomChanged, this);\n this.makeTabSlider();\n }\n\n setAccessibleName(name: string): void {\n ARIAUtils.setLabel(this.tabsElement, name);\n }\n\n setCurrentTabLocked(locked: boolean): void {\n this.currentTabLocked = locked;\n this.headerElementInternal.classList.toggle('locked', this.currentTabLocked);\n }\n\n setAutoSelectFirstItemOnShow(autoSelect: boolean): void {\n this.autoSelectFirstItemOnShow = autoSelect;\n }\n\n get visibleView(): Widget|null {\n return this.currentTab ? this.currentTab.view : null;\n }\n\n tabIds(): string[] {\n return this.tabs.map(tab => tab.id);\n }\n\n tabIndex(tabId: string): number {\n return this.tabs.findIndex(tab => tab.id === tabId);\n }\n\n tabViews(): Widget[] {\n return this.tabs.map(tab => tab.view);\n }\n\n tabView(tabId: string): Widget|null {\n const tab = this.tabsById.get(tabId);\n return tab ? tab.view : null;\n }\n\n get selectedTabId(): string|null {\n return this.currentTab ? this.currentTab.id : null;\n }\n\n setShrinkableTabs(shrinkableTabs: boolean): void {\n this.shrinkableTabs = shrinkableTabs;\n }\n\n makeVerticalTabLayout(): void {\n this.verticalTabLayout = true;\n this.setTabSlider(false);\n this.contentElement.classList.add('vertical-tab-layout');\n this.invalidateConstraints();\n }\n\n setCloseableTabs(closeableTabs: boolean): void {\n this.closeableTabs = closeableTabs;\n }\n\n override focus(): void {\n if (this.visibleView) {\n this.visibleView.focus();\n } else {\n this.contentElement.focus();\n }\n }\n\n focusSelectedTabHeader(): void {\n const selectedTab = this.currentTab;\n if (selectedTab) {\n selectedTab.tabElement.focus();\n }\n }\n\n headerElement(): Element {\n return this.headerElementInternal;\n }\n\n tabbedPaneContentElement(): Element {\n return this.contentElementInternal;\n }\n\n isTabCloseable(id: string): boolean {\n const tab = this.tabsById.get(id);\n return tab ? tab.isCloseable() : false;\n }\n\n setTabDelegate(delegate: TabbedPaneTabDelegate): void {\n const tabs = this.tabs.slice();\n for (let i = 0; i < tabs.length; ++i) {\n tabs[i].setDelegate(delegate);\n }\n this.delegate = delegate;\n }\n\n appendTab(\n id: string, tabTitle: string, view: Widget, tabTooltip?: string, userGesture?: boolean, isCloseable?: boolean,\n isPreviewFeature?: boolean, index?: number, jslogContext?: string): void {\n const closeable = typeof isCloseable === 'boolean' ? isCloseable : Boolean(this.closeableTabs);\n const tab =\n new TabbedPaneTab(this, id, tabTitle, closeable, Boolean(isPreviewFeature), view, tabTooltip, jslogContext);\n tab.setDelegate((this.delegate as TabbedPaneTabDelegate));\n console.assert(!this.tabsById.has(id), `Tabbed pane already contains a tab with id '${id}'`);\n this.tabsById.set(id, tab);\n tab.tabElement.tabIndex = -1;\n tab.tabElement.setAttribute(\n 'jslog', `${VisualLogging.panelTabHeader().track({click: true, drag: true}).context(tab.jslogContext)}`);\n if (index !== undefined) {\n this.tabs.splice(index, 0, tab);\n } else {\n this.tabs.push(tab);\n }\n this.tabsHistory.push(tab);\n if (this.tabsHistory[0] === tab && this.isShowing()) {\n this.selectTab(tab.id, userGesture);\n }\n this.updateTabElements();\n }\n\n closeTab(id: string, userGesture?: boolean): void {\n this.closeTabs([id], userGesture);\n }\n\n closeTabs(ids: string[], userGesture?: boolean): void {\n if (ids.length === 0) {\n return;\n }\n\n const focused = this.hasFocus();\n for (let i = 0; i < ids.length; ++i) {\n this.innerCloseTab(ids[i], userGesture);\n }\n this.updateTabElements();\n if (this.tabsHistory.length) {\n this.selectTab(this.tabsHistory[0].id, false);\n }\n if (focused) {\n this.focus();\n }\n }\n\n private innerCloseTab(id: string, userGesture?: boolean): true|undefined {\n const tab = this.tabsById.get(id);\n if (!tab) {\n return;\n }\n if (userGesture && !tab.closeable) {\n return;\n }\n if (this.currentTab && this.currentTab.id === id) {\n this.hideCurrentTab();\n }\n\n this.tabsById.delete(id);\n\n this.tabsHistory.splice(this.tabsHistory.indexOf(tab), 1);\n this.tabs.splice(this.tabs.indexOf(tab), 1);\n if (tab.shown) {\n this.hideTabElement(tab);\n }\n\n const eventData: EventData = {prevTabId: undefined, tabId: id, view: tab.view, isUserGesture: userGesture};\n this.dispatchEventToListeners(Events.TabClosed, eventData);\n return true;\n }\n\n hasTab(tabId: string): boolean {\n return this.tabsById.has(tabId);\n }\n\n otherTabs(id: string): string[] {\n const result = [];\n for (let i = 0; i < this.tabs.length; ++i) {\n if (this.tabs[i].id !== id) {\n result.push(this.tabs[i].id);\n }\n }\n return result;\n }\n\n tabsToTheRight(id: string): string[] {\n let index = -1;\n for (let i = 0; i < this.tabs.length; ++i) {\n if (this.tabs[i].id === id) {\n index = i;\n break;\n }\n }\n if (index === -1) {\n return [];\n }\n return this.tabs.slice(index + 1).map(function(tab) {\n return tab.id;\n });\n }\n\n private viewHasFocus(): boolean {\n if (this.visibleView && this.visibleView.hasFocus()) {\n return true;\n }\n const root = this.contentElement.getComponentRoot();\n return root instanceof Document && this.contentElement === root.activeElement;\n }\n\n selectTab(id: string, userGesture?: boolean, forceFocus?: boolean): boolean {\n if (this.currentTabLocked) {\n return false;\n }\n const focused = this.viewHasFocus();\n const tab = this.tabsById.get(id);\n if (!tab) {\n return false;\n }\n\n const eventData: EventData = {\n prevTabId: this.currentTab ? this.currentTab.id : undefined,\n tabId: id,\n view: tab.view,\n isUserGesture: userGesture,\n };\n this.dispatchEventToListeners(Events.TabInvoked, eventData);\n if (this.currentTab && this.currentTab.id === id) {\n return true;\n }\n\n this.suspendInvalidations();\n this.hideCurrentTab();\n this.showTab(tab);\n this.resumeInvalidations();\n this.currentTab = tab;\n\n this.tabsHistory.splice(this.tabsHistory.indexOf(tab), 1);\n this.tabsHistory.splice(0, 0, tab);\n\n this.updateTabElements();\n if (focused || forceFocus) {\n this.focus();\n }\n\n this.dispatchEventToListeners(Events.TabSelected, eventData);\n return true;\n }\n\n selectNextTab(): void {\n const index = this.tabs.indexOf((this.currentTab as TabbedPaneTab));\n const nextIndex = Platform.NumberUtilities.mod(index + 1, this.tabs.length);\n this.selectTab(this.tabs[nextIndex].id, true);\n }\n\n selectPrevTab(): void {\n const index = this.tabs.indexOf((this.currentTab as TabbedPaneTab));\n const nextIndex = Platform.NumberUtilities.mod(index - 1, this.tabs.length);\n this.selectTab(this.tabs[nextIndex].id, true);\n }\n\n getTabIndex(id: string): number {\n const index = this.tabs.indexOf((this.tabsById.get(id) as TabbedPaneTab));\n return index;\n }\n\n moveTabBackward(id: string, index: number): void {\n this.insertBefore((this.tabsById.get(id) as TabbedPaneTab), index - 1);\n this.updateTabSlider();\n }\n\n moveTabForward(id: string, index: number): void {\n this.insertBefore((this.tabsById.get(id) as TabbedPaneTab), index + 2);\n this.updateTabSlider();\n }\n\n lastOpenedTabIds(tabsCount: number): string[] {\n function tabToTabId(tab: TabbedPaneTab): string {\n return tab.id;\n }\n\n return this.tabsHistory.slice(0, tabsCount).map(tabToTabId);\n }\n\n setTabIcon(id: string, icon: IconButton.Icon.Icon|null): void {\n const tab = this.tabsById.get(id);\n if (!tab) {\n return;\n }\n tab.setIcon(icon);\n this.updateTabElements();\n }\n\n setSuffixElement(id: string, suffixElement: HTMLElement|null): void {\n const tab = this.tabsById.get(id);\n if (!tab) {\n return;\n }\n tab.setSuffixElement(suffixElement);\n this.updateTabElements();\n }\n\n setTabEnabled(id: string, enabled: boolean): void {\n const tab = this.tabsById.get(id);\n if (tab) {\n tab.tabElement.classList.toggle('disabled', !enabled);\n }\n }\n\n tabIsDisabled(id: string): boolean {\n return !this.tabIsEnabled(id);\n }\n\n tabIsEnabled(id: string): boolean {\n const tab = this.tabsById.get(id);\n const disabled = tab?.tabElement.classList.contains('disabled') ?? false;\n return !disabled;\n }\n\n toggleTabClass(id: string, className: string, force?: boolean): void {\n const tab = this.tabsById.get(id);\n if (tab && tab.toggleClass(className, force)) {\n this.updateTabElements();\n }\n }\n\n private zoomChanged(): void {\n this.clearMeasuredWidths();\n if (this.isShowing()) {\n this.updateTabElements();\n }\n }\n\n private clearMeasuredWidths(): void {\n for (let i = 0; i < this.tabs.length; ++i) {\n delete this.tabs[i].measuredWidth;\n }\n }\n\n changeTabTitle(id: string, tabTitle: string, tabTooltip?: string): void {\n const tab = this.tabsById.get(id);\n if (tab && tabTooltip !== undefined) {\n tab.tooltip = tabTooltip;\n }\n if (tab && tab.title !== tabTitle) {\n tab.title = tabTitle;\n ARIAUtils.setLabel(tab.tabElement, tabTitle);\n this.updateTabElements();\n }\n }\n\n changeTabView(id: string, view: Widget): void {\n const tab = this.tabsById.get(id);\n if (!tab || tab.view === view) {\n return;\n }\n\n this.suspendInvalidations();\n const isSelected = this.currentTab && this.currentTab.id === id;\n const shouldFocus = tab.view.hasFocus();\n if (isSelected) {\n this.hideTab(tab);\n }\n tab.view = view;\n if (isSelected) {\n this.showTab(tab);\n }\n if (shouldFocus) {\n tab.view.focus();\n }\n this.resumeInvalidations();\n }\n\n override onResize(): void {\n if (this.currentDevicePixelRatio !== window.devicePixelRatio) {\n // Force recalculation of all tab widths on a DPI change\n this.clearMeasuredWidths();\n this.currentDevicePixelRatio = window.devicePixelRatio;\n }\n this.updateTabElements();\n }\n\n headerResized(): void {\n this.updateTabElements();\n }\n\n override wasShown(): void {\n const effectiveTab = this.currentTab || this.tabsHistory[0];\n if (effectiveTab && this.autoSelectFirstItemOnShow) {\n this.selectTab(effectiveTab.id);\n }\n this.updateTabElements();\n }\n\n makeTabSlider(): void {\n if (this.verticalTabLayout) {\n return;\n }\n this.setTabSlider(true);\n }\n\n private setTabSlider(enable: boolean): void {\n this.sliderEnabled = enable;\n this.tabSlider.classList.toggle('enabled', enable);\n }\n\n override calculateConstraints(): Constraints {\n let constraints = super.calculateConstraints();\n const minContentConstraints = new Constraints(new Size(0, 0), new Size(50, 50));\n constraints = constraints.widthToMax(minContentConstraints).heightToMax(minContentConstraints);\n if (this.verticalTabLayout) {\n constraints = constraints.addWidth(new Constraints(new Size(120, 0)));\n } else {\n constraints = constraints.addHeight(new Constraints(new Size(0, 30)));\n }\n return constraints;\n }\n\n private updateTabElements(): void {\n invokeOnceAfterBatchUpdate(this, this.innerUpdateTabElements);\n }\n\n setPlaceholderElement(element: Element, focusedElement?: Element): void {\n this.placeholderElement = element;\n if (focusedElement) {\n this.focusedPlaceholderElement = focusedElement;\n }\n if (this.placeholderContainerElement) {\n this.placeholderContainerElement.removeChildren();\n this.placeholderContainerElement.appendChild(element);\n }\n }\n\n async waitForTabElementUpdate(): Promise {\n this.innerUpdateTabElements();\n }\n\n private innerUpdateTabElements(): void {\n if (!this.isShowing()) {\n return;\n }\n\n if (!this.tabs.length) {\n this.contentElementInternal.classList.add('has-no-tabs');\n if (this.placeholderElement && !this.placeholderContainerElement) {\n this.placeholderContainerElement =\n this.contentElementInternal.createChild('div', 'tabbed-pane-placeholder fill');\n this.placeholderContainerElement.appendChild(this.placeholderElement);\n if (this.focusedPlaceholderElement) {\n this.setDefaultFocusedElement(this.focusedPlaceholderElement);\n }\n }\n } else {\n this.contentElementInternal.classList.remove('has-no-tabs');\n if (this.placeholderContainerElement) {\n this.placeholderContainerElement.remove();\n this.setDefaultFocusedElement(this.contentElement);\n delete this.placeholderContainerElement;\n }\n }\n\n this.measureDropDownButton();\n this.adjustToolbarWidth();\n this.updateWidths();\n this.updateTabsDropDown();\n this.updateTabSlider();\n }\n\n private adjustToolbarWidth(): void {\n if (!this.rightToolbarInternal || !this.measuredDropDownButtonWidth) {\n return;\n }\n const leftToolbarWidth = this.leftToolbarInternal?.element.getBoundingClientRect().width ?? 0;\n const rightToolbarWidth = this.rightToolbarInternal.element.getBoundingClientRect().width;\n const totalWidth = this.headerElementInternal.getBoundingClientRect().width;\n if (!this.rightToolbarInternal.hasCompactLayout() &&\n totalWidth - rightToolbarWidth - leftToolbarWidth < this.measuredDropDownButtonWidth + 10) {\n this.rightToolbarInternal.setCompactLayout(true);\n } else if (\n this.rightToolbarInternal.hasCompactLayout() &&\n // Estimate the right toolbar size in non-compact mode as 2 times its compact size.\n totalWidth - 2 * rightToolbarWidth - leftToolbarWidth > this.measuredDropDownButtonWidth + 10) {\n this.rightToolbarInternal.setCompactLayout(false);\n }\n }\n\n private showTabElement(index: number, tab: TabbedPaneTab): void {\n if (index >= this.tabsElement.children.length) {\n this.tabsElement.appendChild(tab.tabElement);\n } else {\n this.tabsElement.insertBefore(tab.tabElement, this.tabsElement.children[index]);\n }\n tab.shown = true;\n }\n\n private hideTabElement(tab: TabbedPaneTab): void {\n this.tabsElement.removeChild(tab.tabElement);\n tab.shown = false;\n }\n\n private createDropDownButton(): HTMLDivElement {\n const dropDownContainer = document.createElement('div');\n dropDownContainer.classList.add('tabbed-pane-header-tabs-drop-down-container');\n dropDownContainer.setAttribute('jslog', `${VisualLogging.dropDown('more-tabs').track({click: true})}`);\n const chevronIcon = IconButton.Icon.create('chevron-double-right', 'chevron-icon');\n const moreTabsString = i18nString(UIStrings.moreTabs);\n dropDownContainer.title = moreTabsString;\n ARIAUtils.markAsMenuButton(dropDownContainer);\n ARIAUtils.setLabel(dropDownContainer, moreTabsString);\n ARIAUtils.setExpanded(dropDownContainer, false);\n dropDownContainer.tabIndex = 0;\n dropDownContainer.appendChild(chevronIcon);\n dropDownContainer.addEventListener('click', this.dropDownClicked.bind(this));\n dropDownContainer.addEventListener('keydown', this.dropDownKeydown.bind(this));\n dropDownContainer.addEventListener('mousedown', event => {\n if (event.button !== 0 || this.triggerDropDownTimeout) {\n return;\n }\n this.triggerDropDownTimeout = window.setTimeout(this.dropDownClicked.bind(this, event), 200);\n });\n return dropDownContainer;\n }\n\n private dropDownClicked(ev: Event): void {\n const event = (ev as MouseEvent);\n if (event.button !== 0) {\n return;\n }\n if (this.triggerDropDownTimeout) {\n clearTimeout(this.triggerDropDownTimeout);\n this.triggerDropDownTimeout = null;\n }\n const rect = this.dropDownButton.getBoundingClientRect();\n const menu = new ContextMenu(event, {\n useSoftMenu: false,\n x: rect.left,\n y: rect.bottom,\n onSoftMenuClosed: () => {\n ARIAUtils.setExpanded(this.dropDownButton, false);\n },\n });\n for (const tab of this.tabs) {\n if (tab.shown) {\n continue;\n }\n if (this.numberOfTabsShown() === 0 && this.tabsHistory[0] === tab) {\n menu.defaultSection().appendCheckboxItem(\n tab.title, this.dropDownMenuItemSelected.bind(this, tab), {checked: true, jslogContext: tab.jslogContext});\n } else {\n menu.defaultSection().appendItem(\n tab.title, this.dropDownMenuItemSelected.bind(this, tab), {jslogContext: tab.jslogContext});\n }\n }\n void menu.show().then(() => ARIAUtils.setExpanded(this.dropDownButton, menu.isHostedMenuOpen()));\n }\n\n private dropDownKeydown(event: KeyboardEvent): void {\n if (Platform.KeyboardUtilities.isEnterOrSpaceKey(event)) {\n this.dropDownButton.click();\n event.consume(true);\n }\n }\n\n private dropDownMenuItemSelected(tab: TabbedPaneTab): void {\n this.lastSelectedOverflowTab = tab;\n this.selectTab(tab.id, true, true);\n }\n\n private totalWidth(): number {\n return this.headerContentsElement.getBoundingClientRect().width;\n }\n\n private numberOfTabsShown(): number {\n let numTabsShown = 0;\n for (const tab of this.tabs) {\n if (tab.shown) {\n numTabsShown++;\n }\n }\n return numTabsShown;\n }\n\n disableOverflowMenu(): void {\n this.overflowDisabled = true;\n }\n\n private updateTabsDropDown(): void {\n const tabsToShowIndexes =\n this.tabsToShowIndexes(this.tabs, this.tabsHistory, this.totalWidth(), this.measuredDropDownButtonWidth || 0);\n if (this.lastSelectedOverflowTab && this.numberOfTabsShown() !== tabsToShowIndexes.length) {\n delete this.lastSelectedOverflowTab;\n this.updateTabsDropDown();\n return;\n }\n\n for (let i = 0; i < this.tabs.length; ++i) {\n if (this.tabs[i].shown && tabsToShowIndexes.indexOf(i) === -1) {\n this.hideTabElement(this.tabs[i]);\n }\n }\n for (let i = 0; i < tabsToShowIndexes.length; ++i) {\n const tab = this.tabs[tabsToShowIndexes[i]];\n if (!tab.shown) {\n this.showTabElement(i, tab);\n }\n }\n\n if (!this.overflowDisabled) {\n this.maybeShowDropDown(tabsToShowIndexes.length !== this.tabs.length);\n }\n }\n\n private maybeShowDropDown(hasMoreTabs: boolean): void {\n if (hasMoreTabs && !this.dropDownButton.parentElement) {\n this.headerContentsElement.appendChild(this.dropDownButton);\n } else if (!hasMoreTabs && this.dropDownButton.parentElement) {\n this.headerContentsElement.removeChild(this.dropDownButton);\n }\n }\n\n private measureDropDownButton(): void {\n if (this.overflowDisabled || this.measuredDropDownButtonWidth) {\n return;\n }\n this.dropDownButton.classList.add('measuring');\n this.headerContentsElement.appendChild(this.dropDownButton);\n this.measuredDropDownButtonWidth = this.dropDownButton.getBoundingClientRect().width;\n this.headerContentsElement.removeChild(this.dropDownButton);\n this.dropDownButton.classList.remove('measuring');\n }\n\n private updateWidths(): void {\n const measuredWidths = this.measureWidths();\n const maxWidth =\n this.shrinkableTabs ? this.calculateMaxWidth(measuredWidths.slice(), this.totalWidth()) : Number.MAX_VALUE;\n\n let i = 0;\n for (const tab of this.tabs) {\n tab.setWidth(this.verticalTabLayout ? -1 : Math.min(maxWidth, measuredWidths[i++]));\n }\n }\n\n private measureWidths(): number[] {\n // Add all elements to measure into this.tabsElement\n this.tabsElement.style.setProperty('width', '2000px');\n const measuringTabElements = new Map();\n for (const tab of this.tabs) {\n if (typeof tab.measuredWidth === 'number') {\n continue;\n }\n const measuringTabElement = tab.createTabElement(/* measure */ true);\n measuringTabElements.set(measuringTabElement, tab);\n this.tabsElement.appendChild(measuringTabElement);\n }\n\n // Perform measurement\n for (const [measuringTabElement, tab] of measuringTabElements) {\n const width = measuringTabElement.getBoundingClientRect().width;\n tab.measuredWidth = Math.ceil(width);\n }\n\n // Nuke elements from the UI\n for (const measuringTabElement of measuringTabElements.keys()) {\n measuringTabElement.remove();\n }\n\n // Combine the results.\n const measuredWidths = [];\n for (const tab of this.tabs) {\n measuredWidths.push(tab.measuredWidth || 0);\n }\n this.tabsElement.style.removeProperty('width');\n\n return measuredWidths;\n }\n\n private calculateMaxWidth(measuredWidths: number[], totalWidth: number): number {\n if (!measuredWidths.length) {\n return 0;\n }\n\n measuredWidths.sort(function(x, y) {\n return x - y;\n });\n\n let totalMeasuredWidth = 0;\n for (let i = 0; i < measuredWidths.length; ++i) {\n totalMeasuredWidth += measuredWidths[i];\n }\n\n if (totalWidth >= totalMeasuredWidth) {\n return measuredWidths[measuredWidths.length - 1];\n }\n\n let totalExtraWidth = 0;\n for (let i = measuredWidths.length - 1; i > 0; --i) {\n const extraWidth = measuredWidths[i] - measuredWidths[i - 1];\n totalExtraWidth += (measuredWidths.length - i) * extraWidth;\n\n if (totalWidth + totalExtraWidth >= totalMeasuredWidth) {\n return measuredWidths[i - 1] +\n (totalWidth + totalExtraWidth - totalMeasuredWidth) / (measuredWidths.length - i);\n }\n }\n\n return totalWidth / measuredWidths.length;\n }\n\n private tabsToShowIndexes(\n tabsOrdered: TabbedPaneTab[], tabsHistory: TabbedPaneTab[], totalWidth: number,\n measuredDropDownButtonWidth: number): number[] {\n const tabsToShowIndexes = [];\n\n let totalTabsWidth = 0;\n const tabCount = tabsOrdered.length;\n const tabsToLookAt = tabsOrdered.slice(0);\n if (this.currentTab !== undefined) {\n tabsToLookAt.unshift(tabsToLookAt.splice(tabsToLookAt.indexOf(this.currentTab), 1)[0]);\n }\n if (this.lastSelectedOverflowTab !== undefined) {\n tabsToLookAt.unshift(tabsToLookAt.splice(tabsToLookAt.indexOf(this.lastSelectedOverflowTab), 1)[0]);\n }\n for (let i = 0; i < tabCount; ++i) {\n const tab = this.automaticReorder ? tabsHistory[i] : tabsToLookAt[i];\n totalTabsWidth += tab.width();\n let minimalRequiredWidth = totalTabsWidth;\n if (i !== tabCount - 1) {\n minimalRequiredWidth += measuredDropDownButtonWidth;\n }\n if (!this.verticalTabLayout && minimalRequiredWidth > totalWidth) {\n break;\n }\n tabsToShowIndexes.push(tabsOrdered.indexOf(tab));\n }\n\n tabsToShowIndexes.sort(function(x, y) {\n return x - y;\n });\n\n return tabsToShowIndexes;\n }\n\n private hideCurrentTab(): void {\n if (!this.currentTab) {\n return;\n }\n\n this.hideTab(this.currentTab);\n delete this.currentTab;\n }\n\n private showTab(tab: TabbedPaneTab): void {\n tab.tabElement.tabIndex = 0;\n tab.tabElement.classList.add('selected');\n ARIAUtils.setSelected(tab.tabElement, true);\n tab.view.show(this.element);\n this.updateTabSlider();\n }\n\n updateTabSlider(): void {\n if (!this.sliderEnabled) {\n return;\n }\n if (!this.currentTab) {\n this.tabSlider.style.width = '0';\n return;\n }\n let left = 0;\n for (let i = 0; i < this.tabs.length && this.currentTab !== this.tabs[i]; i++) {\n if (this.tabs[i].shown) {\n left += this.tabs[i].measuredWidth || 0;\n }\n }\n const sliderWidth = this.currentTab.shown ? this.currentTab.measuredWidth : this.dropDownButton.offsetWidth;\n const scaleFactor = window.devicePixelRatio >= 1.5 ? ' scaleY(0.75)' : '';\n this.tabSlider.style.transform = 'translateX(' + left + 'px)' + scaleFactor;\n this.tabSlider.style.width = sliderWidth + 'px';\n\n if (this.tabSlider.parentElement !== this.headerContentsElement) {\n this.headerContentsElement.appendChild(this.tabSlider);\n }\n }\n\n private hideTab(tab: TabbedPaneTab): void {\n tab.tabElement.removeAttribute('tabIndex');\n tab.tabElement.classList.remove('selected');\n tab.tabElement.tabIndex = -1;\n tab.tabElement.setAttribute('aria-selected', 'false');\n tab.view.detach();\n }\n\n override elementsToRestoreScrollPositionsFor(): Element[] {\n return [this.contentElementInternal];\n }\n\n insertBefore(tab: TabbedPaneTab, index: number): void {\n this.tabsElement.insertBefore(tab.tabElement, this.tabsElement.childNodes[index]);\n const oldIndex = this.tabs.indexOf(tab);\n this.tabs.splice(oldIndex, 1);\n if (oldIndex < index) {\n --index;\n }\n this.tabs.splice(index, 0, tab);\n\n const eventData: EventData = {prevTabId: undefined, tabId: tab.id, view: tab.view, isUserGesture: undefined};\n this.dispatchEventToListeners(Events.TabOrderChanged, eventData);\n }\n\n leftToolbar(): Toolbar {\n if (!this.leftToolbarInternal) {\n this.leftToolbarInternal = new Toolbar('tabbed-pane-left-toolbar');\n this.headerElementInternal.insertBefore(this.leftToolbarInternal.element, this.headerElementInternal.firstChild);\n }\n return this.leftToolbarInternal;\n }\n\n rightToolbar(): Toolbar {\n if (!this.rightToolbarInternal) {\n this.rightToolbarInternal = new Toolbar('tabbed-pane-right-toolbar');\n this.headerElementInternal.appendChild(this.rightToolbarInternal.element);\n }\n return this.rightToolbarInternal;\n }\n\n setAllowTabReorder(allow: boolean, automatic?: boolean): void {\n this.allowTabReorder = allow;\n this.automaticReorder = automatic;\n }\n\n private keyDown(ev: Event): void {\n if (!this.currentTab) {\n return;\n }\n const event = (ev as KeyboardEvent);\n let nextTabElement: (Element|null)|null = null;\n switch (event.key) {\n case 'ArrowUp':\n case 'ArrowLeft':\n nextTabElement = this.currentTab.tabElement.previousElementSibling;\n if (!nextTabElement && !this.dropDownButton.parentElement) {\n nextTabElement = this.currentTab.tabElement.parentElement ?\n this.currentTab.tabElement.parentElement.lastElementChild :\n null;\n }\n break;\n case 'ArrowDown':\n case 'ArrowRight':\n nextTabElement = this.currentTab.tabElement.nextElementSibling;\n if (!nextTabElement && !this.dropDownButton.parentElement) {\n nextTabElement = this.currentTab.tabElement.parentElement ?\n this.currentTab.tabElement.parentElement.firstElementChild :\n null;\n }\n break;\n case 'Enter':\n case ' ':\n this.currentTab.view.focus();\n return;\n default:\n return;\n }\n if (!nextTabElement) {\n this.dropDownButton.click();\n return;\n }\n const tab = this.tabs.find(tab => tab.tabElement === nextTabElement);\n if (tab) {\n this.selectTab(tab.id, true);\n }\n (nextTabElement as HTMLElement).focus();\n }\n}\nexport interface EventData {\n prevTabId?: string;\n tabId: string;\n view?: Widget;\n isUserGesture?: boolean;\n}\n\nexport enum Events {\n /* eslint-disable @typescript-eslint/naming-convention -- Used by web_tests. */\n TabInvoked = 'TabInvoked',\n TabSelected = 'TabSelected',\n TabClosed = 'TabClosed',\n TabOrderChanged = 'TabOrderChanged',\n /* eslint-enable @typescript-eslint/naming-convention */\n}\n\nexport type EventTypes = {\n [Events.TabInvoked]: EventData,\n [Events.TabSelected]: EventData,\n [Events.TabClosed]: EventData,\n [Events.TabOrderChanged]: EventData,\n};\n\nexport class TabbedPaneTab {\n closeable: boolean;\n previewFeature = false;\n private readonly tabbedPane: TabbedPane;\n idInternal: string;\n private titleInternal: string;\n private tooltipInternal: string|undefined;\n private viewInternal: Widget;\n shown: boolean;\n measuredWidth!: number|undefined;\n private tabElementInternal!: HTMLElement|undefined;\n private icon: IconButton.Icon.Icon|null = null;\n private suffixElement: HTMLElement|null = null;\n private widthInternal?: number;\n private delegate?: TabbedPaneTabDelegate;\n private titleElement?: HTMLElement;\n private dragStartX?: number;\n private jslogContextInternal?: string;\n constructor(\n tabbedPane: TabbedPane, id: string, title: string, closeable: boolean, previewFeature: boolean, view: Widget,\n tooltip?: string, jslogContext?: string) {\n this.closeable = closeable;\n this.previewFeature = previewFeature;\n this.tabbedPane = tabbedPane;\n this.idInternal = id;\n this.titleInternal = title;\n this.tooltipInternal = tooltip;\n this.viewInternal = view;\n this.shown = false;\n this.jslogContextInternal = jslogContext;\n }\n\n get id(): string {\n return this.idInternal;\n }\n\n get title(): string {\n return this.titleInternal;\n }\n\n set title(title: string) {\n if (title === this.titleInternal) {\n return;\n }\n this.titleInternal = title;\n if (this.titleElement) {\n this.titleElement.textContent = title;\n const closeIconContainer = this.tabElementInternal?.querySelector('.close-button');\n closeIconContainer?.setAttribute('title', i18nString(UIStrings.closeS, {PH1: title}));\n closeIconContainer?.setAttribute('aria-label', i18nString(UIStrings.closeS, {PH1: title}));\n }\n delete this.measuredWidth;\n }\n\n get jslogContext(): string {\n return this.jslogContextInternal ?? (this.idInternal === 'console-view' ? 'console' : this.idInternal);\n }\n\n isCloseable(): boolean {\n return this.closeable;\n }\n\n setIcon(icon: IconButton.Icon.Icon|null): void {\n this.icon = icon;\n if (this.tabElementInternal && this.titleElement) {\n this.createIconElement(this.tabElementInternal, this.titleElement, false);\n }\n delete this.measuredWidth;\n }\n\n setSuffixElement(suffixElement: HTMLElement|null): void {\n this.suffixElement = suffixElement;\n if (this.tabElementInternal && this.titleElement) {\n this.createSuffixElement(this.tabElementInternal, this.titleElement, false);\n }\n delete this.measuredWidth;\n }\n\n toggleClass(className: string, force?: boolean): boolean {\n const element = this.tabElement;\n const hasClass = element.classList.contains(className);\n if (hasClass === force) {\n return false;\n }\n element.classList.toggle(className, force);\n delete this.measuredWidth;\n return true;\n }\n\n get view(): Widget {\n return this.viewInternal;\n }\n\n set view(view: Widget) {\n this.viewInternal = view;\n }\n\n get tooltip(): string|undefined {\n return this.tooltipInternal;\n }\n\n set tooltip(tooltip: string|undefined) {\n this.tooltipInternal = tooltip;\n if (this.titleElement) {\n Tooltip.install(this.titleElement, tooltip || '');\n }\n }\n\n get tabElement(): HTMLElement {\n if (!this.tabElementInternal) {\n this.tabElementInternal = this.createTabElement(false);\n }\n\n return this.tabElementInternal;\n }\n\n width(): number {\n return this.widthInternal || 0;\n }\n\n setWidth(width: number): void {\n this.tabElement.style.width = width === -1 ? '' : (width + 'px');\n this.widthInternal = width;\n }\n\n setDelegate(delegate: TabbedPaneTabDelegate): void {\n this.delegate = delegate;\n }\n\n private createIconElement(tabElement: Element, titleElement: Element, measuring: boolean): void {\n const iconElement = tabIcons.get(tabElement);\n if (iconElement) {\n iconElement.remove();\n tabIcons.delete(tabElement);\n }\n if (!this.icon) {\n return;\n }\n\n const iconContainer = document.createElement('span');\n iconContainer.classList.add('tabbed-pane-header-tab-icon');\n const iconNode = measuring ? this.createMeasureClone(this.icon) : this.icon;\n iconContainer.appendChild(iconNode);\n titleElement.insertAdjacentElement('beforebegin', iconContainer);\n tabIcons.set(tabElement, iconContainer);\n }\n\n private createSuffixElement(tabElement: Element, titleElement: Element, measuring: boolean): void {\n const tabSuffixElement = tabSuffixElements.get(tabElement);\n if (tabSuffixElement) {\n tabSuffixElement.remove();\n tabSuffixElements.delete(tabElement);\n }\n if (!this.suffixElement) {\n return;\n }\n\n const suffixElementContainer = document.createElement('span');\n suffixElementContainer.classList.add('tabbed-pane-header-tab-suffix-element');\n const suffixElement = measuring ? this.suffixElement.cloneNode() : this.suffixElement;\n suffixElementContainer.appendChild(suffixElement);\n titleElement.insertAdjacentElement('afterend', suffixElementContainer);\n tabSuffixElements.set(tabElement, suffixElementContainer);\n }\n\n private createMeasureClone(original: IconButton.Icon.Icon): Element {\n // Cloning doesn't work for the icon component because the shadow\n // root isn't copied, but it is sufficient to create a div styled\n // to be the same size.\n const fakeClone = document.createElement('div');\n fakeClone.style.width = original.style.width;\n fakeClone.style.height = original.style.height;\n return fakeClone;\n }\n\n createTabElement(measuring: boolean): HTMLElement {\n const tabElement = document.createElement('div');\n tabElement.classList.add('tabbed-pane-header-tab');\n tabElement.id = 'tab-' + this.idInternal;\n ARIAUtils.markAsTab(tabElement);\n ARIAUtils.setSelected(tabElement, false);\n ARIAUtils.setLabel(tabElement, this.title);\n\n const titleElement = tabElement.createChild('span', 'tabbed-pane-header-tab-title');\n titleElement.textContent = this.title;\n Tooltip.install(titleElement, this.tooltip || '');\n this.createIconElement(tabElement, titleElement, measuring);\n this.createSuffixElement(tabElement, titleElement, measuring);\n if (!measuring) {\n this.titleElement = titleElement;\n }\n\n if (this.previewFeature) {\n const previewIcon = this.createPreviewIcon();\n tabElement.appendChild(previewIcon);\n tabElement.classList.add('preview');\n }\n\n if (this.closeable) {\n const closeIcon = this.createCloseIconButton();\n tabElement.appendChild(closeIcon);\n tabElement.classList.add('closeable');\n }\n\n if (measuring) {\n tabElement.classList.add('measuring');\n } else {\n tabElement.addEventListener('click', this.tabClicked.bind(this), false);\n tabElement.addEventListener('auxclick', this.tabClicked.bind(this), false);\n tabElement.addEventListener('mousedown', this.tabMouseDown.bind(this), false);\n tabElement.addEventListener('mouseup', this.tabMouseUp.bind(this), false);\n\n tabElement.addEventListener('contextmenu', this.tabContextMenu.bind(this), false);\n if (this.tabbedPane.allowTabReorder) {\n installDragHandle(\n tabElement, this.startTabDragging.bind(this), this.tabDragging.bind(this), this.endTabDragging.bind(this),\n null, null, 200);\n }\n }\n\n return tabElement as HTMLElement;\n }\n\n private createCloseIconButton(): Buttons.Button.Button {\n const closeButton = new Buttons.Button.Button();\n closeButton.data = {\n variant: Buttons.Button.Variant.ICON,\n size: Buttons.Button.Size.SMALL,\n iconName: 'cross',\n title: i18nString(UIStrings.closeS, {PH1: this.title}),\n };\n closeButton.classList.add('close-button', 'tabbed-pane-close-button');\n closeButton.setAttribute('jslog', `${VisualLogging.close().track({click: true})}`);\n\n closeButton.setAttribute('aria-label', i18nString(UIStrings.closeS, {PH1: this.title}));\n return closeButton;\n }\n\n private createPreviewIcon(): HTMLDivElement {\n const previewIcon = document.createElement('div');\n previewIcon.classList.add('preview-icon');\n const closeIcon = new IconButton.Icon.Icon();\n closeIcon.data = {\n iconName: 'experiment',\n color: 'var(--override-tabbed-pane-preview-icon-color)',\n width: '16px',\n };\n previewIcon.appendChild(closeIcon);\n previewIcon.setAttribute('title', i18nString(UIStrings.previewFeature));\n previewIcon.setAttribute('aria-label', i18nString(UIStrings.previewFeature));\n return previewIcon;\n }\n\n private isCloseIconClicked(element: HTMLElement): boolean {\n return element?.classList.contains('tabbed-pane-close-button') ||\n element?.parentElement?.classList.contains('tabbed-pane-close-button') || false;\n }\n\n private tabClicked(ev: Event): void {\n const event = (ev as MouseEvent);\n const middleButton = event.button === 1;\n const shouldClose = this.closeable && (middleButton || this.isCloseIconClicked(event.target as HTMLElement));\n if (!shouldClose) {\n this.tabbedPane.focus();\n return;\n }\n this.closeTabs([this.id]);\n event.consume(true);\n }\n\n private tabMouseDown(ev: Event): void {\n const event = ev as MouseEvent;\n if (this.isCloseIconClicked(event.target as HTMLElement) || event.button !== 0) {\n return;\n }\n this.tabbedPane.selectTab(this.id, true);\n }\n\n private tabMouseUp(ev: Event): void {\n const event = (ev as MouseEvent);\n // This is needed to prevent middle-click pasting on linux when tabs are clicked.\n if (event.button === 1) {\n event.consume(true);\n }\n }\n\n private closeTabs(ids: string[]): void {\n if (this.delegate) {\n this.delegate.closeTabs(this.tabbedPane, ids);\n return;\n }\n this.tabbedPane.closeTabs(ids, true);\n }\n\n private tabContextMenu(event: Event): void {\n function close(this: TabbedPaneTab): void {\n this.closeTabs([this.id]);\n }\n\n function closeOthers(this: TabbedPaneTab): void {\n this.closeTabs(this.tabbedPane.otherTabs(this.id));\n }\n\n function closeAll(this: TabbedPaneTab): void {\n this.closeTabs(this.tabbedPane.tabIds());\n }\n\n function closeToTheRight(this: TabbedPaneTab): void {\n this.closeTabs(this.tabbedPane.tabsToTheRight(this.id));\n }\n\n function moveTabForward(this: TabbedPaneTab, tabIndex: number): void {\n this.tabbedPane.moveTabForward(this.id, tabIndex);\n }\n\n function moveTabBackward(this: TabbedPaneTab, tabIndex: number): void {\n this.tabbedPane.moveTabBackward(this.id, tabIndex);\n }\n\n const contextMenu = new ContextMenu(event);\n if (this.closeable) {\n contextMenu.defaultSection().appendItem(i18nString(UIStrings.close), close.bind(this), {jslogContext: 'close'});\n contextMenu.defaultSection().appendItem(\n i18nString(UIStrings.closeOthers), closeOthers.bind(this), {jslogContext: 'close-others'});\n contextMenu.defaultSection().appendItem(\n i18nString(UIStrings.closeTabsToTheRight), closeToTheRight.bind(this),\n {jslogContext: 'close-tabs-to-the-right'});\n contextMenu.defaultSection().appendItem(\n i18nString(UIStrings.closeAll), closeAll.bind(this), {jslogContext: 'close-all'});\n }\n if (this.delegate) {\n this.delegate.onContextMenu(this.id, contextMenu);\n }\n const tabIndex = this.tabbedPane.getTabIndex(this.id);\n if (tabIndex > 0) {\n contextMenu.defaultSection().appendItem(\n i18nString(UIStrings.moveTabLeft), moveTabBackward.bind(this, tabIndex), {jslogContext: 'move-tab-backward'});\n }\n if (tabIndex < this.tabbedPane.tabsElement.childNodes.length - 1) {\n contextMenu.defaultSection().appendItem(\n i18nString(UIStrings.moveTabRight), moveTabForward.bind(this, tabIndex), {jslogContext: 'move-tab-forward'});\n }\n void contextMenu.show();\n }\n\n private startTabDragging(ev: Event): boolean {\n const event = (ev as MouseEvent);\n if (this.isCloseIconClicked(event.target as HTMLElement)) {\n return false;\n }\n this.dragStartX = event.pageX;\n if (this.tabElementInternal) {\n this.tabElementInternal.classList.add('dragging');\n }\n this.tabbedPane.tabSlider.remove();\n return true;\n }\n\n private tabDragging(ev: Event): void {\n const event = (ev as MouseEvent);\n const tabElements = this.tabbedPane.tabsElement.childNodes;\n for (let i = 0; i < tabElements.length; ++i) {\n let tabElement: HTMLElement = (tabElements[i] as HTMLElement);\n if (!this.tabElementInternal || tabElement === this.tabElementInternal) {\n continue;\n }\n\n const intersects = tabElement.offsetLeft + tabElement.clientWidth > this.tabElementInternal.offsetLeft &&\n this.tabElementInternal.offsetLeft + this.tabElementInternal.clientWidth > tabElement.offsetLeft;\n if (!intersects) {\n continue;\n }\n\n const dragStartX = (this.dragStartX as number);\n if (Math.abs(event.pageX - dragStartX) < tabElement.clientWidth / 2 + 5) {\n break;\n }\n\n if (event.pageX - dragStartX > 0) {\n tabElement = (tabElement.nextSibling as HTMLElement);\n ++i;\n }\n\n const oldOffsetLeft = this.tabElementInternal.offsetLeft;\n this.tabbedPane.insertBefore(this, i);\n this.dragStartX = dragStartX + this.tabElementInternal.offsetLeft - oldOffsetLeft;\n break;\n }\n\n const dragStartX = (this.dragStartX as number);\n const tabElement = (this.tabElementInternal as HTMLElement);\n if (!tabElement.previousSibling && event.pageX - dragStartX < 0) {\n tabElement.style.setProperty('left', '0px');\n return;\n }\n if (!tabElement.nextSibling && event.pageX - dragStartX > 0) {\n tabElement.style.setProperty('left', '0px');\n return;\n }\n\n tabElement.style.setProperty('left', (event.pageX - dragStartX) + 'px');\n }\n\n private endTabDragging(_event: Event): void {\n const tabElement = (this.tabElementInternal as HTMLElement);\n tabElement.classList.remove('dragging');\n tabElement.style.removeProperty('left');\n delete this.dragStartX;\n this.tabbedPane.updateTabSlider();\n }\n}\n\nconst tabIcons = new WeakMap();\nconst tabSuffixElements = new WeakMap();\n\nexport interface TabbedPaneTabDelegate {\n closeTabs(tabbedPane: TabbedPane, ids: string[]): void;\n onContextMenu(tabId: string, contextMenu: ContextMenu): void;\n}\n"]} \ No newline at end of file diff --git a/public/ui/legacy/Toolbar.js b/public/ui/legacy/Toolbar.js index 9b7ff325a..42bd84ed0 100644 --- a/public/ui/legacy/Toolbar.js +++ b/public/ui/legacy/Toolbar.js @@ -74,11 +74,11 @@ export class Toolbar { compactLayout = false; constructor(className, parentElement) { this.items = []; - this.element = (parentElement ? parentElement.createChild('div') : document.createElement('div')); + this.element = parentElement ? parentElement.createChild('div') : document.createElement('div'); this.element.className = className; this.element.classList.add('toolbar'); this.enabled = true; - this.shadowRoot = createShadowRootWithCoreStyles(this.element, { cssFile: toolbarStyles, delegatesFocus: undefined }); + this.shadowRoot = createShadowRootWithCoreStyles(this.element, { cssFile: toolbarStyles }); this.contentElement = this.shadowRoot.createChild('div', 'toolbar-shadow'); } hasCompactLayout() { diff --git a/public/ui/legacy/Toolbar.js.map b/public/ui/legacy/Toolbar.js.map index 2f7bfed2b..26e7ff257 100644 --- a/public/ui/legacy/Toolbar.js.map +++ b/public/ui/legacy/Toolbar.js.map @@ -1 +1 @@ -{"version":3,"file":"Toolbar.js","sourceRoot":"","sources":["../../../../../../front_end/ui/legacy/Toolbar.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,OAAO,KAAK,MAAM,MAAM,6BAA6B,CAAC;AACtD,OAAO,KAAK,IAAI,MAAM,yBAAyB,CAAC;AAChD,OAAO,KAAK,IAAI,MAAM,yBA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,SAAS,EAAC,CAAC,CAAC,CAAC;AAClH,CAAC","sourcesContent":["/*\n * Copyright (C) 2009 Google Inc. All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are\n * met:\n *\n * * Redistributions of source code must retain the above copyright\n * notice, this list of conditions and the following disclaimer.\n * * Redistributions in binary form must reproduce the above\n * copyright notice, this list of conditions and the following disclaimer\n * in the documentation and/or other materials provided with the\n * distribution.\n * * Neither the name of Google Inc. nor the names of its\n * contributors may be used to endorse or promote products derived from\n * this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nimport * as Common from '../../core/common/common.js';\nimport * as Host from '../../core/host/host.js';\nimport * as i18n from '../../core/i18n/i18n.js';\nimport * as Platform from '../../core/platform/platform.js';\nimport * as Root from '../../core/root/root.js';\nimport * as Buttons from '../../ui/components/buttons/buttons.js';\nimport * as VisualLogging from '../../ui/visual_logging/visual_logging.js';\nimport * as Adorners from '../components/adorners/adorners.js';\nimport * as IconButton from '../components/icon_button/icon_button.js';\n\nimport {type Action, Events as ActionEvents} from './ActionRegistration.js';\nimport {ActionRegistry} from './ActionRegistry.js';\nimport * as ARIAUtils from './ARIAUtils.js';\nimport {ContextMenu} from './ContextMenu.js';\nimport {GlassPane, PointerEventsBehavior} from './GlassPane.js';\nimport {bindCheckbox} from './SettingsUI.js';\nimport type {Suggestion} from './SuggestBox.js';\nimport {Events as TextPromptEvents, TextPrompt} from './TextPrompt.js';\nimport toolbarStyles from './toolbar.css.legacy.js';\nimport {Tooltip} from './Tooltip.js';\nimport {CheckboxLabel, createShadowRootWithCoreStyles, LongClickController} from './UIUtils.js';\n\nconst UIStrings = {\n /**\n *@description Announced screen reader message for ToolbarSettingToggle when the setting is toggled on.\n */\n pressed: 'pressed',\n /**\n *@description Announced screen reader message for ToolbarSettingToggle when the setting is toggled off.\n */\n notPressed: 'not pressed',\n /**\n *@description Tooltip shown when the user hovers over the clear icon to empty the text input.\n */\n clearInput: 'Clear',\n /**\n *@description Placeholder for filter bars that shows before the user types in a filter keyword.\n */\n filter: 'Filter',\n};\nconst str_ = i18n.i18n.registerUIStrings('ui/legacy/Toolbar.ts', UIStrings);\nconst i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);\n\nexport class Toolbar {\n private items: ToolbarItem[];\n element: HTMLElement;\n enabled: boolean;\n private readonly shadowRoot: ShadowRoot;\n private contentElement: Element;\n private compactLayout = false;\n\n constructor(className: string, parentElement?: Element) {\n this.items = [];\n this.element = (parentElement ? parentElement.createChild('div') : document.createElement('div')) as HTMLElement;\n this.element.className = className;\n this.element.classList.add('toolbar');\n this.enabled = true;\n this.shadowRoot = createShadowRootWithCoreStyles(this.element, {cssFile: toolbarStyles, delegatesFocus: undefined});\n this.contentElement = this.shadowRoot.createChild('div', 'toolbar-shadow');\n }\n\n hasCompactLayout(): boolean {\n return this.compactLayout;\n }\n\n registerCSSFiles(cssFiles: CSSStyleSheet[]): void {\n this.shadowRoot.adoptedStyleSheets = this.shadowRoot.adoptedStyleSheets.concat(cssFiles);\n }\n\n setCompactLayout(enable: boolean): void {\n if (this.compactLayout === enable) {\n return;\n }\n this.compactLayout = enable;\n for (const item of this.items) {\n item.setCompactLayout(enable);\n }\n }\n\n static createLongPressActionButton(\n action: Action, toggledOptions: ToolbarButton[], untoggledOptions: ToolbarButton[]): ToolbarButton {\n const button = Toolbar.createActionButton(action);\n const mainButtonClone = Toolbar.createActionButton(action);\n\n let longClickController: LongClickController|null = null;\n let longClickButtons: ToolbarButton[]|null = null;\n\n action.addEventListener(ActionEvents.TOGGLED, updateOptions);\n updateOptions();\n return button;\n\n function updateOptions(): void {\n const buttons = action.toggled() ? (toggledOptions || null) : (untoggledOptions || null);\n\n if (buttons && buttons.length) {\n if (!longClickController) {\n longClickController = new LongClickController(button.element, showOptions);\n button.setLongClickable(true);\n longClickButtons = buttons;\n }\n } else {\n if (longClickController) {\n longClickController.dispose();\n longClickController = null;\n button.setLongClickable(false);\n longClickButtons = null;\n }\n }\n }\n\n function showOptions(): void {\n let buttons: ToolbarButton[] = longClickButtons ? longClickButtons.slice() : [];\n buttons.push(mainButtonClone);\n\n const document = button.element.ownerDocument;\n document.documentElement.addEventListener('mouseup', mouseUp, false);\n\n const optionsGlassPane = new GlassPane();\n optionsGlassPane.setPointerEventsBehavior(PointerEventsBehavior.BLOCKED_BY_GLASS_PANE);\n optionsGlassPane.show(document);\n const optionsBar = new Toolbar('fill', optionsGlassPane.contentElement);\n optionsBar.contentElement.classList.add('floating');\n const buttonHeight = 26;\n\n const hostButtonPosition = button.element.boxInWindow().relativeToElement(GlassPane.container(document));\n\n const topNotBottom = hostButtonPosition.y + buttonHeight * buttons.length < document.documentElement.offsetHeight;\n\n if (topNotBottom) {\n buttons = buttons.reverse();\n }\n\n optionsBar.element.style.height = (buttonHeight * buttons.length) + 'px';\n if (topNotBottom) {\n optionsBar.element.style.top = (hostButtonPosition.y - 5) + 'px';\n } else {\n optionsBar.element.style.top = (hostButtonPosition.y - (buttonHeight * (buttons.length - 1)) - 6) + 'px';\n }\n optionsBar.element.style.left = (hostButtonPosition.x - 5) + 'px';\n\n for (let i = 0; i < buttons.length; ++i) {\n buttons[i].element.addEventListener('mousemove', mouseOver, false);\n buttons[i].element.addEventListener('mouseout', mouseOut, false);\n optionsBar.appendToolbarItem(buttons[i]);\n }\n const hostButtonIndex = topNotBottom ? 0 : buttons.length - 1;\n buttons[hostButtonIndex].element.classList.add('emulate-active');\n\n function mouseOver(e: Event): void {\n if ((e as MouseEvent).which !== 1) {\n return;\n }\n if (e.target instanceof HTMLElement) {\n const buttonElement = e.target.enclosingNodeOrSelfWithClass('toolbar-item');\n buttonElement.classList.add('emulate-active');\n }\n }\n\n function mouseOut(e: Event): void {\n if ((e as MouseEvent).which !== 1) {\n return;\n }\n if (e.target instanceof HTMLElement) {\n const buttonElement = e.target.enclosingNodeOrSelfWithClass('toolbar-item');\n buttonElement.classList.remove('emulate-active');\n }\n }\n\n function mouseUp(e: Event): void {\n if ((e as MouseEvent).which !== 1) {\n return;\n }\n optionsGlassPane.hide();\n document.documentElement.removeEventListener('mouseup', mouseUp, false);\n\n for (let i = 0; i < buttons.length; ++i) {\n if (buttons[i].element.classList.contains('emulate-active')) {\n buttons[i].element.classList.remove('emulate-active');\n buttons[i].clicked(e);\n break;\n }\n }\n }\n }\n }\n\n static createActionButton(action: Action, options: ToolbarButtonOptions|undefined = TOOLBAR_BUTTON_DEFAULT_OPTIONS):\n ToolbarButton {\n const button = (action.toggleable() && !options?.ignoreToggleable) ? makeToggle() : makeButton();\n\n if (options.showLabel) {\n button.setText(options.label?.() || action.title());\n }\n\n let handler = (): void => {\n void action.execute();\n };\n if (options.userActionCode) {\n const actionCode = options.userActionCode;\n handler = () => {\n Host.userMetrics.actionTaken(actionCode);\n void action.execute();\n };\n }\n button.addEventListener(ToolbarButton.Events.CLICK, handler, action);\n action.addEventListener(ActionEvents.ENABLED, enabledChanged);\n button.setEnabled(action.enabled());\n return button;\n\n function makeButton(): ToolbarButton {\n const button = new ToolbarButton(action.title(), action.icon(), undefined, action.id());\n if (action.title()) {\n Tooltip.installWithActionBinding(button.element, action.title(), action.id());\n }\n return button;\n }\n\n function makeToggle(): ToolbarToggle {\n const toggleButton = new ToolbarToggle(action.title(), action.icon(), action.toggledIcon(), action.id());\n if (action.toggleWithRedColor()) {\n toggleButton.enableToggleWithRedColor();\n }\n action.addEventListener(ActionEvents.TOGGLED, toggled);\n toggled();\n return toggleButton;\n\n function toggled(): void {\n toggleButton.setToggled(action.toggled());\n if (action.title()) {\n toggleButton.setTitle(action.title());\n Tooltip.installWithActionBinding(toggleButton.element, action.title(), action.id());\n }\n }\n }\n\n function enabledChanged(event: Common.EventTarget.EventTargetEvent): void {\n button.setEnabled(event.data);\n }\n }\n\n static createActionButtonForId(actionId: string, options?: ToolbarButtonOptions): ToolbarButton {\n const action = ActionRegistry.instance().getAction(actionId);\n return Toolbar.createActionButton(action, options);\n }\n\n gripElementForResize(): Element {\n return this.contentElement;\n }\n\n makeWrappable(growVertically?: boolean): void {\n this.contentElement.classList.add('wrappable');\n if (growVertically) {\n this.contentElement.classList.add('toolbar-grow-vertical');\n }\n }\n\n makeVertical(): void {\n this.contentElement.classList.add('vertical');\n }\n\n renderAsLinks(): void {\n this.contentElement.classList.add('toolbar-render-as-links');\n }\n\n empty(): boolean {\n return !this.items.length;\n }\n\n setEnabled(enabled: boolean): void {\n this.enabled = enabled;\n for (const item of this.items) {\n item.applyEnabledState(this.enabled && item.enabled);\n }\n }\n\n appendToolbarItem(item: ToolbarItem): void {\n this.items.push(item);\n item.toolbar = this;\n item.setCompactLayout(this.hasCompactLayout());\n if (!this.enabled) {\n item.applyEnabledState(false);\n }\n this.contentElement.appendChild(item.element);\n this.hideSeparatorDupes();\n }\n\n hasItem(item: ToolbarItem): boolean {\n return this.items.includes(item);\n }\n\n prependToolbarItem(item: ToolbarItem): void {\n this.items.unshift(item);\n item.toolbar = this;\n item.setCompactLayout(this.hasCompactLayout());\n if (!this.enabled) {\n item.applyEnabledState(false);\n }\n this.contentElement.prepend(item.element);\n this.hideSeparatorDupes();\n }\n\n appendSeparator(): void {\n this.appendToolbarItem(new ToolbarSeparator());\n }\n\n appendSpacer(): void {\n this.appendToolbarItem(new ToolbarSeparator(true));\n }\n\n appendText(text: string): void {\n this.appendToolbarItem(new ToolbarText(text));\n }\n\n removeToolbarItem(itemToRemove: ToolbarItem): void {\n const updatedItems = [];\n for (const item of this.items) {\n if (item === itemToRemove) {\n item.element.remove();\n } else {\n updatedItems.push(item);\n }\n }\n this.items = updatedItems;\n }\n\n removeToolbarItems(): void {\n for (const item of this.items) {\n item.toolbar = null;\n }\n this.items = [];\n this.contentElement.removeChildren();\n }\n\n setColor(color: string): void {\n const style = document.createElement('style');\n style.textContent = '.toolbar-glyph { background-color: ' + color + ' !important }';\n this.shadowRoot.appendChild(style);\n }\n\n setToggledColor(color: string): void {\n const style = document.createElement('style');\n style.textContent =\n '.toolbar-button.toolbar-state-on .toolbar-glyph { background-color: ' + color + ' !important }';\n this.shadowRoot.appendChild(style);\n }\n\n hideSeparatorDupes(): void {\n if (!this.items.length) {\n return;\n }\n // Don't hide first and last separators if they were added explicitly.\n let previousIsSeparator = false;\n let lastSeparator;\n let nonSeparatorVisible = false;\n for (let i = 0; i < this.items.length; ++i) {\n if (this.items[i] instanceof ToolbarSeparator) {\n this.items[i].setVisible(!previousIsSeparator);\n previousIsSeparator = true;\n lastSeparator = this.items[i];\n continue;\n }\n if (this.items[i].visible()) {\n previousIsSeparator = false;\n lastSeparator = null;\n nonSeparatorVisible = true;\n }\n }\n if (lastSeparator && lastSeparator !== this.items[this.items.length - 1]) {\n lastSeparator.setVisible(false);\n }\n\n this.element.classList.toggle(\n 'hidden',\n lastSeparator !== null && lastSeparator !== undefined && lastSeparator.visible() && !nonSeparatorVisible);\n }\n\n async appendItemsAtLocation(location: string): Promise {\n const extensions: ToolbarItemRegistration[] = getRegisteredToolbarItems();\n\n extensions.sort((extension1, extension2) => {\n const order1 = extension1.order || 0;\n const order2 = extension2.order || 0;\n return order1 - order2;\n });\n\n const filtered = extensions.filter(e => e.location === location);\n const items = await Promise.all(filtered.map(extension => {\n const {separator, actionId, showLabel, label, loadItem} = extension;\n if (separator) {\n return new ToolbarSeparator();\n }\n if (actionId) {\n return Toolbar.createActionButtonForId(\n actionId, {label, showLabel: Boolean(showLabel), userActionCode: undefined});\n }\n // TODO(crbug.com/1134103) constratint the case checked with this if using TS type definitions once UI is TS-authored.\n if (!loadItem) {\n throw new Error('Could not load a toolbar item registration with no loadItem function');\n }\n return loadItem().then(p => (p as Provider).item());\n }));\n\n for (const item of items) {\n if (item) {\n this.appendToolbarItem(item);\n }\n }\n }\n}\nexport interface ToolbarButtonOptions {\n label?: () => Platform.UIString.LocalizedString;\n showLabel: boolean;\n userActionCode?: Host.UserMetrics.Action;\n ignoreToggleable?: boolean;\n}\n\nconst TOOLBAR_BUTTON_DEFAULT_OPTIONS: ToolbarButtonOptions = {\n showLabel: false,\n userActionCode: undefined,\n};\n\n// We need any here because Common.ObjectWrapper.ObjectWrapper is invariant in T.\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport class ToolbarItem extends Common.ObjectWrapper.ObjectWrapper {\n element: HTMLElement;\n private visibleInternal: boolean;\n enabled: boolean;\n toolbar: Toolbar|null;\n protected title?: string;\n\n constructor(element: Element) {\n super();\n this.element = (element as HTMLElement);\n this.element.classList.add('toolbar-item');\n this.visibleInternal = true;\n this.enabled = true;\n\n /**\n * Set by the parent toolbar during appending.\n */\n this.toolbar = null;\n }\n\n setTitle(title: string, actionId: string|undefined = undefined): void {\n if (this.title === title) {\n return;\n }\n this.title = title;\n ARIAUtils.setLabel(this.element, title);\n if (actionId === undefined) {\n Tooltip.install(this.element, title);\n } else {\n Tooltip.installWithActionBinding(this.element, title, actionId);\n }\n }\n\n setEnabled(value: boolean): void {\n if (this.enabled === value) {\n return;\n }\n this.enabled = value;\n this.applyEnabledState(this.enabled && (!this.toolbar || this.toolbar.enabled));\n }\n\n applyEnabledState(enabled: boolean): void {\n // @ts-ignore: Ignoring in favor of an `instanceof` check for all the different\n // kind of HTMLElement classes that have a disabled attribute.\n this.element.disabled = !enabled;\n }\n\n visible(): boolean {\n return this.visibleInternal;\n }\n\n setVisible(x: boolean): void {\n if (this.visibleInternal === x) {\n return;\n }\n this.element.classList.toggle('hidden', !x);\n this.visibleInternal = x;\n if (this.toolbar && !(this instanceof ToolbarSeparator)) {\n this.toolbar.hideSeparatorDupes();\n }\n }\n\n setRightAligned(alignRight: boolean): void {\n this.element.classList.toggle('toolbar-item-right-aligned', alignRight);\n }\n\n setCompactLayout(_enable: boolean): void {\n }\n}\n\nexport const enum ToolbarItemWithCompactLayoutEvents {\n COMPACT_LAYOUT_UPDATED = 'CompactLayoutUpdated',\n}\n\ntype ToolbarItemWithCompactLayoutEventTypes = {\n [ToolbarItemWithCompactLayoutEvents.COMPACT_LAYOUT_UPDATED]: boolean,\n};\n\nexport class ToolbarItemWithCompactLayout extends ToolbarItem {\n constructor(element: Element) {\n super(element);\n }\n\n override setCompactLayout(enable: boolean): void {\n this.dispatchEventToListeners(ToolbarItemWithCompactLayoutEvents.COMPACT_LAYOUT_UPDATED, enable);\n }\n}\n\nexport class ToolbarText extends ToolbarItem {\n constructor(text?: string) {\n const element = document.createElement('div');\n element.classList.add('toolbar-text');\n super(element);\n this.element.classList.add('toolbar-text');\n this.setText(text || '');\n }\n\n text(): string {\n return this.element.textContent || '';\n }\n\n setText(text: string): void {\n this.element.textContent = text;\n }\n}\n\nexport class ToolbarButton extends ToolbarItem {\n private button: Buttons.Button.Button;\n private text?: string;\n private adorner?: HTMLElement;\n\n constructor(title: string, glyphOrAdorner?: string|Adorners.Adorner.Adorner, text?: string, jslogContext?: string) {\n const button = new Buttons.Button.Button();\n super(button);\n this.button = button;\n if (glyphOrAdorner instanceof Adorners.Adorner.Adorner) {\n this.button.variant = Buttons.Button.Variant.ADORNER_ICON;\n this.setAdorner(glyphOrAdorner);\n this.button.prepend(glyphOrAdorner);\n } else if (typeof glyphOrAdorner === 'string' && !text) {\n this.button.data = {variant: Buttons.Button.Variant.ICON, iconName: glyphOrAdorner};\n } else {\n this.button.variant = Buttons.Button.Variant.TEXT;\n this.button.reducedFocusRing = true;\n if (glyphOrAdorner) {\n this.button.iconName = glyphOrAdorner;\n }\n }\n button.classList.add('toolbar-button');\n this.element.addEventListener('click', this.clicked.bind(this), false);\n this.element.addEventListener('mousedown', this.mouseDown.bind(this), false);\n button.textContent = text || '';\n this.setTitle(title);\n if (jslogContext) {\n button.jslogContext = jslogContext;\n }\n }\n\n focus(): void {\n this.element.focus();\n }\n\n checked(checked: boolean): void {\n this.button.checked = checked;\n }\n\n toggleOnClick(toggleOnClick: boolean): void {\n this.button.toggleOnClick = toggleOnClick;\n }\n\n isToggled(): boolean {\n return this.button.toggled;\n }\n\n toggled(toggled: boolean): void {\n this.button.toggled = toggled;\n }\n\n setToggleType(type: Buttons.Button.ToggleType): void {\n this.button.toggleType = type;\n }\n\n setLongClickable(longClickable: boolean): void {\n this.button.longClickable = longClickable;\n }\n\n setSize(size: Buttons.Button.Size): void {\n this.button.size = size;\n }\n\n setReducedFocusRing(): void {\n this.button.reducedFocusRing = true;\n }\n\n setText(text: string): void {\n if (this.text === text) {\n return;\n }\n this.button.textContent = text;\n this.button.variant = Buttons.Button.Variant.TEXT;\n this.button.reducedFocusRing = true;\n this.text = text;\n }\n\n setAdorner(adorner: Adorners.Adorner.Adorner): void {\n if (this.adorner) {\n this.adorner.replaceWith(adorner);\n } else {\n this.element.prepend(adorner);\n }\n this.adorner = adorner;\n }\n\n setGlyph(iconName: string): void {\n this.button.iconName = iconName;\n }\n\n setToggledIcon(toggledIconName: string): void {\n this.button.variant = Buttons.Button.Variant.ICON_TOGGLE;\n this.button.toggledIconName = toggledIconName;\n }\n\n setBackgroundImage(iconURL: string): void {\n this.element.style.backgroundImage = 'url(' + iconURL + ')';\n }\n\n setSecondary(): void {\n this.element.classList.add('toolbar-button-secondary');\n }\n\n setDarkText(): void {\n this.element.classList.add('dark-text');\n }\n\n turnIntoSelect(shrinkable: boolean|undefined = false): void {\n this.element.classList.add('toolbar-has-dropdown');\n if (shrinkable) {\n this.element.classList.add('toolbar-has-dropdown-shrinkable');\n }\n const dropdownArrowIcon = IconButton.Icon.create('triangle-down', 'toolbar-dropdown-arrow');\n this.element.appendChild(dropdownArrowIcon);\n }\n\n clicked(event: Event): void {\n if (!this.enabled) {\n return;\n }\n this.dispatchEventToListeners(ToolbarButton.Events.CLICK, event);\n event.consume();\n }\n\n protected mouseDown(event: MouseEvent): void {\n if (!this.enabled) {\n return;\n }\n this.dispatchEventToListeners(ToolbarButton.Events.MOUSE_DOWN, event);\n }\n}\n\nexport class ToolbarCombobox extends ToolbarItem {\n private textElement?: HTMLElement;\n private text?: string;\n private iconName?: string;\n private adorner?: Adorners.Adorner.Adorner;\n\n constructor(title: string, isIconDropdown?: boolean, jslogContext?: string, iconName?: string) {\n let element;\n if (iconName) {\n element = new Buttons.Button.Button();\n element.data = {variant: Buttons.Button.Variant.ICON, iconName};\n } else {\n element = document.createElement('button');\n }\n element.classList.add('toolbar-button');\n super(element);\n this.element.addEventListener('click', this.clicked.bind(this), false);\n this.element.addEventListener('mousedown', this.mouseDown.bind(this), false);\n\n this.iconName = iconName;\n\n this.setTitle(title);\n if (jslogContext) {\n this.element.setAttribute('jslog', `${VisualLogging.action().track({click: true}).context(jslogContext)}`);\n }\n this.title = '';\n if (!isIconDropdown) {\n this.element.classList.add('toolbar-has-dropdown');\n const dropdownArrowIcon = IconButton.Icon.create('triangle-down', 'toolbar-dropdown-arrow');\n this.element.appendChild(dropdownArrowIcon);\n }\n }\n\n setText(text: string): void {\n if (this.text === text || this.iconName) {\n return;\n }\n if (!this.textElement) {\n this.textElement = document.createElement('div');\n this.textElement.classList.add('toolbar-text', 'hidden');\n const dropDownArrow = this.element.querySelector('.toolbar-dropdown-arrow');\n this.element.insertBefore(this.textElement, dropDownArrow);\n }\n this.textElement.textContent = text;\n this.textElement.classList.toggle('hidden', !text);\n this.text = text;\n }\n\n setAdorner(adorner: Adorners.Adorner.Adorner): void {\n if (this.iconName) {\n return;\n }\n if (!this.adorner) {\n this.adorner = adorner;\n } else {\n adorner.replaceWith(adorner);\n if (this.element.firstChild) {\n this.element.removeChild(this.element.firstChild);\n }\n }\n this.element.prepend(adorner);\n }\n\n setDarkText(): void {\n this.element.classList.add('dark-text');\n }\n\n turnShrinkable(): void {\n this.element.classList.add('toolbar-has-dropdown-shrinkable');\n }\n\n clicked(event: Event): void {\n if (!this.enabled) {\n return;\n }\n this.dispatchEventToListeners(ToolbarButton.Events.CLICK, event);\n event.consume();\n }\n\n protected mouseDown(event: MouseEvent): void {\n if (!this.enabled) {\n return;\n }\n this.dispatchEventToListeners(ToolbarButton.Events.MOUSE_DOWN, event);\n }\n}\n\nexport namespace ToolbarButton {\n export const enum Events {\n CLICK = 'Click',\n MOUSE_DOWN = 'MouseDown',\n }\n\n export type EventTypes = {\n [Events.CLICK]: Event,\n [Events.MOUSE_DOWN]: MouseEvent,\n };\n}\n\nexport class ToolbarInput extends ToolbarItem {\n private prompt: TextPrompt;\n private readonly proxyElement: Element;\n\n constructor(\n placeholder: string, accessiblePlaceholder?: string, growFactor?: number, shrinkFactor?: number, tooltip?: string,\n completions?: ((arg0: string, arg1: string, arg2?: boolean|undefined) => Promise),\n dynamicCompletions?: boolean, jslogContext?: string) {\n const element = document.createElement('div');\n element.classList.add('toolbar-input');\n super(element);\n\n const internalPromptElement = this.element.createChild('div', 'toolbar-input-prompt');\n ARIAUtils.setLabel(internalPromptElement, accessiblePlaceholder || placeholder);\n internalPromptElement.addEventListener('focus', () => this.element.classList.add('focused'));\n internalPromptElement.addEventListener('blur', () => this.element.classList.remove('focused'));\n\n this.prompt = new TextPrompt();\n this.prompt.jslogContext = jslogContext;\n this.proxyElement = this.prompt.attach(internalPromptElement);\n this.proxyElement.classList.add('toolbar-prompt-proxy');\n this.proxyElement.addEventListener('keydown', (event: Event) => this.onKeydownCallback(event as KeyboardEvent));\n this.prompt.initialize(\n completions || (() => Promise.resolve([])),\n ' ',\n dynamicCompletions,\n );\n if (tooltip) {\n this.prompt.setTitle(tooltip);\n }\n this.prompt.setPlaceholder(placeholder, accessiblePlaceholder);\n this.prompt.addEventListener(TextPromptEvents.TEXT_CHANGED, this.onChangeCallback.bind(this));\n\n if (growFactor) {\n this.element.style.flexGrow = String(growFactor);\n }\n if (shrinkFactor) {\n this.element.style.flexShrink = String(shrinkFactor);\n }\n\n const clearButtonText = i18nString(UIStrings.clearInput);\n const clearButton = new Buttons.Button.Button();\n clearButton.data = {\n variant: Buttons.Button.Variant.ICON,\n iconName: 'cross-circle-filled',\n size: Buttons.Button.Size.SMALL,\n title: clearButtonText,\n };\n clearButton.className = 'toolbar-input-clear-button';\n clearButton.setAttribute('jslog', `${VisualLogging.action('clear').track({click: true}).parent('mapped')}`);\n VisualLogging.setMappedParent(clearButton, internalPromptElement);\n clearButton.variant = Buttons.Button.Variant.ICON;\n clearButton.size = Buttons.Button.Size.SMALL;\n clearButton.iconName = 'cross-circle-filled';\n clearButton.title = clearButtonText;\n clearButton.ariaLabel = clearButtonText;\n clearButton.tabIndex = -1;\n\n clearButton.addEventListener('click', () => {\n this.setValue('', true);\n this.prompt.focus();\n });\n\n this.element.appendChild(clearButton);\n this.updateEmptyStyles();\n }\n\n override applyEnabledState(enabled: boolean): void {\n if (enabled) {\n this.element.classList.remove('disabled');\n } else {\n this.element.classList.add('disabled');\n }\n\n this.prompt.setEnabled(enabled);\n }\n\n setValue(value: string, notify?: boolean): void {\n this.prompt.setText(value);\n if (notify) {\n this.onChangeCallback();\n }\n this.updateEmptyStyles();\n }\n\n value(): string {\n return this.prompt.textWithCurrentSuggestion();\n }\n\n valueWithoutSuggestion(): string {\n return this.prompt.text();\n }\n\n clearAutocomplete(): void {\n this.prompt.clearAutocomplete();\n }\n\n focus(): void {\n this.prompt.focus();\n }\n\n private onKeydownCallback(event: KeyboardEvent): void {\n if (event.key === 'Enter' && this.prompt.text()) {\n this.dispatchEventToListeners(ToolbarInput.Event.ENTER_PRESSED, this.prompt.text());\n }\n if (!Platform.KeyboardUtilities.isEscKey(event) || !this.prompt.text()) {\n return;\n }\n this.setValue('', true);\n event.consume(true);\n }\n\n private onChangeCallback(): void {\n this.updateEmptyStyles();\n this.dispatchEventToListeners(ToolbarInput.Event.TEXT_CHANGED, this.prompt.text());\n }\n\n private updateEmptyStyles(): void {\n this.element.classList.toggle('toolbar-input-empty', !this.prompt.text());\n }\n}\n\nexport class ToolbarFilter extends ToolbarInput {\n constructor(\n filterBy?: Common.UIString.LocalizedString, growFactor?: number, shrinkFactor?: number, tooltip?: string,\n completions?: ((arg0: string, arg1: string, arg2?: boolean|undefined) => Promise),\n dynamicCompletions?: boolean, jslogContext?: string) {\n const filterPlaceholder = filterBy ? filterBy : i18nString(UIStrings.filter);\n super(\n filterPlaceholder, filterPlaceholder, growFactor, shrinkFactor, tooltip, completions, dynamicCompletions,\n jslogContext || 'filter');\n\n const filterIcon = IconButton.Icon.create('filter');\n this.element.prepend(filterIcon);\n this.element.classList.add('toolbar-filter');\n }\n}\n\nexport namespace ToolbarInput {\n export const enum Event {\n TEXT_CHANGED = 'TextChanged',\n ENTER_PRESSED = 'EnterPressed',\n }\n\n export interface EventTypes {\n [Event.TEXT_CHANGED]: string;\n [Event.ENTER_PRESSED]: string;\n }\n}\n\nexport class ToolbarToggle extends ToolbarButton {\n private readonly untoggledGlyph: string|undefined;\n private readonly toggledGlyph: string|undefined;\n\n constructor(title: string, glyph?: string, toggledGlyph?: string, jslogContext?: string, toggleOnClick?: boolean) {\n super(title, glyph, '');\n this.untoggledGlyph = glyph;\n this.toggledGlyph = toggledGlyph ? toggledGlyph : glyph;\n this.setToggledIcon(this.toggledGlyph || '');\n this.setToggleType(Buttons.Button.ToggleType.PRIMARY);\n this.toggled(false);\n\n if (jslogContext) {\n this.element.setAttribute('jslog', `${VisualLogging.toggle().track({click: true}).context(jslogContext)}`);\n }\n if (toggleOnClick !== undefined) {\n this.setToggleOnClick(toggleOnClick);\n }\n }\n\n setToggleOnClick(toggleOnClick: boolean): void {\n this.toggleOnClick(toggleOnClick);\n }\n\n setToggled(toggled: boolean): void {\n this.toggled(toggled);\n }\n\n setChecked(checked: boolean): void {\n this.checked(checked);\n }\n\n setDefaultWithRedColor(withRedColor: boolean): void {\n if (withRedColor) {\n this.setToggleType(Buttons.Button.ToggleType.RED);\n this.setGlyph(this.toggledGlyph || '');\n this.setToggledIcon(this.untoggledGlyph || '');\n this.toggled(true);\n }\n }\n\n enableToggleWithRedColor(): void {\n this.setToggleType(Buttons.Button.ToggleType.RED);\n }\n}\n\nexport class ToolbarMenuButton extends ToolbarCombobox {\n private readonly contextMenuHandler: (arg0: ContextMenu) => void;\n private readonly useSoftMenu: boolean;\n private triggerTimeoutId?: number;\n #triggerDelay: number = 200;\n\n constructor(\n contextMenuHandler: (arg0: ContextMenu) => void, isIconDropdown?: boolean, useSoftMenu?: boolean,\n jslogContext?: string, iconName?: string) {\n super('', isIconDropdown, jslogContext, iconName);\n if (jslogContext) {\n this.element.setAttribute('jslog', `${VisualLogging.dropDown().track({click: true}).context(jslogContext)}`);\n }\n this.contextMenuHandler = contextMenuHandler;\n this.useSoftMenu = Boolean(useSoftMenu);\n ARIAUtils.markAsMenuButton(this.element);\n }\n\n setTriggerDelay(x: number): void {\n this.#triggerDelay = x;\n }\n\n override mouseDown(event: MouseEvent): void {\n if (!this.enabled) {\n return;\n }\n if (event.buttons !== 1) {\n super.mouseDown(event);\n return;\n }\n\n if (!this.triggerTimeoutId) {\n this.triggerTimeoutId = window.setTimeout(this.trigger.bind(this, event), this.#triggerDelay);\n }\n }\n\n private trigger(event: Event): void {\n delete this.triggerTimeoutId;\n\n const contextMenu = new ContextMenu(event, {\n useSoftMenu: this.useSoftMenu,\n x: this.element.getBoundingClientRect().left,\n y: this.element.getBoundingClientRect().top + this.element.offsetHeight,\n // Without adding a delay, pointer events will be un-ignored too early, and a single click causes\n // the context menu to be closed and immediately re-opened on Windows (https://crbug.com/339560549).\n onSoftMenuClosed: () => setTimeout(() => this.element.removeAttribute('aria-expanded'), 50),\n });\n this.contextMenuHandler(contextMenu);\n this.element.setAttribute('aria-expanded', 'true');\n void contextMenu.show();\n }\n\n override clicked(event: Event): void {\n if (this.triggerTimeoutId) {\n clearTimeout(this.triggerTimeoutId);\n }\n this.trigger(event);\n }\n}\n\nexport class ToolbarSettingToggle extends ToolbarToggle {\n private readonly defaultTitle: string;\n private readonly setting: Common.Settings.Setting;\n private willAnnounceState: boolean;\n\n constructor(\n setting: Common.Settings.Setting, glyph: string, title: string, toggledGlyph?: string,\n jslogContext?: string) {\n super(title, glyph, toggledGlyph, jslogContext);\n this.defaultTitle = title;\n this.setting = setting;\n this.settingChanged();\n this.setting.addChangeListener(this.settingChanged, this);\n\n // Determines whether the toggle state will be announced to a screen reader\n this.willAnnounceState = false;\n }\n\n private settingChanged(): void {\n const toggled = this.setting.get();\n this.setToggled(toggled);\n const toggleAnnouncement = toggled ? i18nString(UIStrings.pressed) : i18nString(UIStrings.notPressed);\n if (this.willAnnounceState) {\n ARIAUtils.alert(toggleAnnouncement);\n }\n this.willAnnounceState = false;\n this.setTitle(this.defaultTitle);\n }\n\n override clicked(event: Event): void {\n this.willAnnounceState = true;\n this.setting.set(this.isToggled());\n super.clicked(event);\n }\n}\n\nexport class ToolbarSeparator extends ToolbarItem {\n constructor(spacer?: boolean) {\n const element = document.createElement('div');\n element.classList.add(spacer ? 'toolbar-spacer' : 'toolbar-divider');\n super(element);\n }\n}\n\nexport interface Provider {\n item(): ToolbarItem|null;\n}\n\nexport interface ItemsProvider {\n toolbarItems(): ToolbarItem[];\n}\n\nexport class ToolbarComboBox extends ToolbarItem {\n protected selectElementInternal: HTMLSelectElement;\n\n constructor(changeHandler: ((arg0: Event) => void)|null, title: string, className?: string, jslogContext?: string) {\n const element = document.createElement('span');\n element.classList.add('toolbar-select-container');\n super(element);\n this.selectElementInternal = (this.element.createChild('select', 'toolbar-item') as HTMLSelectElement);\n const dropdownArrowIcon = IconButton.Icon.create('triangle-down', 'toolbar-dropdown-arrow');\n this.element.appendChild(dropdownArrowIcon);\n if (changeHandler) {\n this.selectElementInternal.addEventListener('change', changeHandler, false);\n }\n ARIAUtils.setLabel(this.selectElementInternal, title);\n super.setTitle(title);\n if (className) {\n this.selectElementInternal.classList.add(className);\n }\n if (jslogContext) {\n this.selectElementInternal.setAttribute(\n 'jslog', `${VisualLogging.dropDown().track({change: true}).context(jslogContext)}`);\n }\n }\n\n selectElement(): HTMLSelectElement {\n return this.selectElementInternal;\n }\n\n size(): number {\n return this.selectElementInternal.childElementCount;\n }\n\n options(): HTMLOptionElement[] {\n return Array.prototype.slice.call(this.selectElementInternal.children, 0);\n }\n\n addOption(option: Element): void {\n this.selectElementInternal.appendChild(option);\n }\n\n createOption(label: string, value?: string): HTMLOptionElement {\n const option = (this.selectElementInternal.createChild('option') as HTMLOptionElement);\n option.text = label;\n if (typeof value !== 'undefined') {\n option.value = value;\n }\n const jslogContext = value ? Platform.StringUtilities.toKebabCase(value) : undefined;\n option.setAttribute('jslog', `${VisualLogging.item(jslogContext).track({click: true})}`);\n return option;\n }\n\n override applyEnabledState(enabled: boolean): void {\n super.applyEnabledState(enabled);\n this.selectElementInternal.disabled = !enabled;\n }\n\n removeOption(option: Element): void {\n this.selectElementInternal.removeChild(option);\n }\n\n removeOptions(): void {\n this.selectElementInternal.removeChildren();\n }\n\n selectedOption(): HTMLOptionElement|null {\n if (this.selectElementInternal.selectedIndex >= 0) {\n return this.selectElementInternal[this.selectElementInternal.selectedIndex] as HTMLOptionElement;\n }\n return null;\n }\n\n select(option: Element): void {\n this.selectElementInternal.selectedIndex = Array.prototype.indexOf.call(this.selectElementInternal, option);\n }\n\n setSelectedIndex(index: number): void {\n this.selectElementInternal.selectedIndex = index;\n }\n\n selectedIndex(): number {\n return this.selectElementInternal.selectedIndex;\n }\n\n setMaxWidth(width: number): void {\n this.selectElementInternal.style.maxWidth = width + 'px';\n }\n\n setMinWidth(width: number): void {\n this.selectElementInternal.style.minWidth = width + 'px';\n }\n}\n\nexport interface Option {\n value: string;\n label: string;\n}\n\nexport class ToolbarSettingComboBox extends ToolbarComboBox {\n private optionsInternal: Option[];\n private readonly setting: Common.Settings.Setting;\n private muteSettingListener?: boolean;\n constructor(options: Option[], setting: Common.Settings.Setting, accessibleName: string) {\n super(null, accessibleName, undefined, setting.name);\n this.optionsInternal = options;\n this.setting = setting;\n this.selectElementInternal.addEventListener('change', this.valueChanged.bind(this), false);\n this.setOptions(options);\n setting.addChangeListener(this.settingChanged, this);\n }\n\n setOptions(options: Option[]): void {\n this.optionsInternal = options;\n this.selectElementInternal.removeChildren();\n for (let i = 0; i < options.length; ++i) {\n const dataOption = options[i];\n const option = this.createOption(dataOption.label, dataOption.value);\n this.selectElementInternal.appendChild(option);\n if (this.setting.get() === dataOption.value) {\n this.setSelectedIndex(i);\n }\n }\n }\n\n value(): string {\n return this.optionsInternal[this.selectedIndex()].value;\n }\n\n private settingChanged(): void {\n if (this.muteSettingListener) {\n return;\n }\n\n const value = this.setting.get();\n for (let i = 0; i < this.optionsInternal.length; ++i) {\n if (value === this.optionsInternal[i].value) {\n this.setSelectedIndex(i);\n break;\n }\n }\n }\n\n private valueChanged(_event: Event): void {\n const option = this.optionsInternal[this.selectedIndex()];\n this.muteSettingListener = true;\n this.setting.set(option.value);\n this.muteSettingListener = false;\n }\n}\n\nexport class ToolbarCheckbox extends ToolbarItem {\n inputElement: HTMLInputElement;\n\n constructor(\n text: Common.UIString.LocalizedString, tooltip?: Common.UIString.LocalizedString,\n listener?: ((arg0: MouseEvent) => void), jslogContext?: string, small?: boolean) {\n super(CheckboxLabel.create(text));\n this.element.classList.add('checkbox');\n this.inputElement = (this.element as CheckboxLabel).checkboxElement;\n this.inputElement.classList.toggle('small', small);\n if (tooltip) {\n // install on the checkbox\n Tooltip.install(this.inputElement, tooltip);\n Tooltip.install((this.element as CheckboxLabel).textElement, tooltip);\n }\n if (listener) {\n this.inputElement.addEventListener('click', listener, false);\n }\n if (jslogContext) {\n this.inputElement.setAttribute('jslog', `${VisualLogging.toggle().track({change: true}).context(jslogContext)}`);\n }\n }\n\n checked(): boolean {\n return this.inputElement.checked;\n }\n\n setChecked(value: boolean): void {\n this.inputElement.checked = value;\n }\n\n override applyEnabledState(enabled: boolean): void {\n super.applyEnabledState(enabled);\n this.inputElement.disabled = !enabled;\n }\n\n setIndeterminate(indeterminate: boolean): void {\n this.inputElement.indeterminate = indeterminate;\n }\n}\n\nexport class ToolbarSettingCheckbox extends ToolbarCheckbox {\n constructor(\n setting: Common.Settings.Setting, tooltip?: Common.UIString.LocalizedString,\n alternateTitle?: Common.UIString.LocalizedString) {\n super(alternateTitle || setting.title(), tooltip, undefined, setting.name);\n bindCheckbox(this.inputElement, setting);\n }\n}\n\nconst registeredToolbarItems: ToolbarItemRegistration[] = [];\n\nexport function registerToolbarItem(registration: ToolbarItemRegistration): void {\n registeredToolbarItems.push(registration);\n}\n\nfunction getRegisteredToolbarItems(): ToolbarItemRegistration[] {\n return registeredToolbarItems.filter(\n item => Root.Runtime.Runtime.isDescriptorEnabled({experiment: item.experiment, condition: item.condition}));\n}\n\nexport interface ToolbarItemRegistration {\n order?: number;\n location: ToolbarItemLocation;\n separator?: boolean;\n label?: () => Platform.UIString.LocalizedString;\n showLabel?: boolean;\n actionId?: string;\n condition?: Root.Runtime.Condition;\n loadItem?: (() => Promise);\n experiment?: string;\n jslog?: string;\n}\n\nexport const enum ToolbarItemLocation {\n FILES_NAVIGATION_TOOLBAR = 'files-navigator-toolbar',\n MAIN_TOOLBAR_RIGHT = 'main-toolbar-right',\n MAIN_TOOLBAR_LEFT = 'main-toolbar-left',\n STYLES_SIDEBARPANE_TOOLBAR = 'styles-sidebarpane-toolbar',\n}\n"]} \ No newline at end of file +{"version":3,"file":"Toolbar.js","sourceRoot":"","sources":["../../../../../../front_end/ui/legacy/Tool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AAM,CAChC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,mBAAmB,CAAC,EAAC,UAAU,EAAE,IAAI,CAAC,UAAU,EAAE,SAAS,EAAE,IAAI,CAAC,SAAS,EAAC,CAAC,CAAC,CAAC;AAClH,CAAC","sourcesContent":["/*\n * Copyright (C) 2009 Google Inc. All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are\n * met:\n *\n * * Redistributions of source code must retain the above copyright\n * notice, this list of conditions and the following disclaimer.\n * * Redistributions in binary form must reproduce the above\n * copyright notice, this list of conditions and the following disclaimer\n * in the documentation and/or other materials provided with the\n * distribution.\n * * Neither the name of Google Inc. nor the names of its\n * contributors may be used to endorse or promote products derived from\n * this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nimport * as Common from '../../core/common/common.js';\nimport * as Host from '../../core/host/host.js';\nimport * as i18n from '../../core/i18n/i18n.js';\nimport * as Platform from '../../core/platform/platform.js';\nimport * as Root from '../../core/root/root.js';\nimport * as Buttons from '../../ui/components/buttons/buttons.js';\nimport * as VisualLogging from '../../ui/visual_logging/visual_logging.js';\nimport * as Adorners from '../components/adorners/adorners.js';\nimport * as IconButton from '../components/icon_button/icon_button.js';\n\nimport {type Action, Events as ActionEvents} from './ActionRegistration.js';\nimport {ActionRegistry} from './ActionRegistry.js';\nimport * as ARIAUtils from './ARIAUtils.js';\nimport {ContextMenu} from './ContextMenu.js';\nimport {GlassPane, PointerEventsBehavior} from './GlassPane.js';\nimport {bindCheckbox} from './SettingsUI.js';\nimport type {Suggestion} from './SuggestBox.js';\nimport {Events as TextPromptEvents, TextPrompt} from './TextPrompt.js';\nimport toolbarStyles from './toolbar.css.legacy.js';\nimport {Tooltip} from './Tooltip.js';\nimport {CheckboxLabel, createShadowRootWithCoreStyles, LongClickController} from './UIUtils.js';\n\nconst UIStrings = {\n /**\n *@description Announced screen reader message for ToolbarSettingToggle when the setting is toggled on.\n */\n pressed: 'pressed',\n /**\n *@description Announced screen reader message for ToolbarSettingToggle when the setting is toggled off.\n */\n notPressed: 'not pressed',\n /**\n *@description Tooltip shown when the user hovers over the clear icon to empty the text input.\n */\n clearInput: 'Clear',\n /**\n *@description Placeholder for filter bars that shows before the user types in a filter keyword.\n */\n filter: 'Filter',\n};\nconst str_ = i18n.i18n.registerUIStrings('ui/legacy/Toolbar.ts', UIStrings);\nconst i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);\n\nexport class Toolbar {\n private items: ToolbarItem[];\n element: HTMLElement;\n enabled: boolean;\n private readonly shadowRoot: ShadowRoot;\n private contentElement: Element;\n private compactLayout = false;\n\n constructor(className: string, parentElement?: Element) {\n this.items = [];\n this.element = parentElement ? parentElement.createChild('div') : document.createElement('div');\n this.element.className = className;\n this.element.classList.add('toolbar');\n this.enabled = true;\n this.shadowRoot = createShadowRootWithCoreStyles(this.element, {cssFile: toolbarStyles});\n this.contentElement = this.shadowRoot.createChild('div', 'toolbar-shadow');\n }\n\n hasCompactLayout(): boolean {\n return this.compactLayout;\n }\n\n registerCSSFiles(cssFiles: CSSStyleSheet[]): void {\n this.shadowRoot.adoptedStyleSheets = this.shadowRoot.adoptedStyleSheets.concat(cssFiles);\n }\n\n setCompactLayout(enable: boolean): void {\n if (this.compactLayout === enable) {\n return;\n }\n this.compactLayout = enable;\n for (const item of this.items) {\n item.setCompactLayout(enable);\n }\n }\n\n static createLongPressActionButton(\n action: Action, toggledOptions: ToolbarButton[], untoggledOptions: ToolbarButton[]): ToolbarButton {\n const button = Toolbar.createActionButton(action);\n const mainButtonClone = Toolbar.createActionButton(action);\n\n let longClickController: LongClickController|null = null;\n let longClickButtons: ToolbarButton[]|null = null;\n\n action.addEventListener(ActionEvents.TOGGLED, updateOptions);\n updateOptions();\n return button;\n\n function updateOptions(): void {\n const buttons = action.toggled() ? (toggledOptions || null) : (untoggledOptions || null);\n\n if (buttons && buttons.length) {\n if (!longClickController) {\n longClickController = new LongClickController(button.element, showOptions);\n button.setLongClickable(true);\n longClickButtons = buttons;\n }\n } else {\n if (longClickController) {\n longClickController.dispose();\n longClickController = null;\n button.setLongClickable(false);\n longClickButtons = null;\n }\n }\n }\n\n function showOptions(): void {\n let buttons: ToolbarButton[] = longClickButtons ? longClickButtons.slice() : [];\n buttons.push(mainButtonClone);\n\n const document = button.element.ownerDocument;\n document.documentElement.addEventListener('mouseup', mouseUp, false);\n\n const optionsGlassPane = new GlassPane();\n optionsGlassPane.setPointerEventsBehavior(PointerEventsBehavior.BLOCKED_BY_GLASS_PANE);\n optionsGlassPane.show(document);\n const optionsBar = new Toolbar('fill', optionsGlassPane.contentElement);\n optionsBar.contentElement.classList.add('floating');\n const buttonHeight = 26;\n\n const hostButtonPosition = button.element.boxInWindow().relativeToElement(GlassPane.container(document));\n\n const topNotBottom = hostButtonPosition.y + buttonHeight * buttons.length < document.documentElement.offsetHeight;\n\n if (topNotBottom) {\n buttons = buttons.reverse();\n }\n\n optionsBar.element.style.height = (buttonHeight * buttons.length) + 'px';\n if (topNotBottom) {\n optionsBar.element.style.top = (hostButtonPosition.y - 5) + 'px';\n } else {\n optionsBar.element.style.top = (hostButtonPosition.y - (buttonHeight * (buttons.length - 1)) - 6) + 'px';\n }\n optionsBar.element.style.left = (hostButtonPosition.x - 5) + 'px';\n\n for (let i = 0; i < buttons.length; ++i) {\n buttons[i].element.addEventListener('mousemove', mouseOver, false);\n buttons[i].element.addEventListener('mouseout', mouseOut, false);\n optionsBar.appendToolbarItem(buttons[i]);\n }\n const hostButtonIndex = topNotBottom ? 0 : buttons.length - 1;\n buttons[hostButtonIndex].element.classList.add('emulate-active');\n\n function mouseOver(e: Event): void {\n if ((e as MouseEvent).which !== 1) {\n return;\n }\n if (e.target instanceof HTMLElement) {\n const buttonElement = e.target.enclosingNodeOrSelfWithClass('toolbar-item');\n buttonElement.classList.add('emulate-active');\n }\n }\n\n function mouseOut(e: Event): void {\n if ((e as MouseEvent).which !== 1) {\n return;\n }\n if (e.target instanceof HTMLElement) {\n const buttonElement = e.target.enclosingNodeOrSelfWithClass('toolbar-item');\n buttonElement.classList.remove('emulate-active');\n }\n }\n\n function mouseUp(e: Event): void {\n if ((e as MouseEvent).which !== 1) {\n return;\n }\n optionsGlassPane.hide();\n document.documentElement.removeEventListener('mouseup', mouseUp, false);\n\n for (let i = 0; i < buttons.length; ++i) {\n if (buttons[i].element.classList.contains('emulate-active')) {\n buttons[i].element.classList.remove('emulate-active');\n buttons[i].clicked(e);\n break;\n }\n }\n }\n }\n }\n\n static createActionButton(action: Action, options: ToolbarButtonOptions|undefined = TOOLBAR_BUTTON_DEFAULT_OPTIONS):\n ToolbarButton {\n const button = (action.toggleable() && !options?.ignoreToggleable) ? makeToggle() : makeButton();\n\n if (options.showLabel) {\n button.setText(options.label?.() || action.title());\n }\n\n let handler = (): void => {\n void action.execute();\n };\n if (options.userActionCode) {\n const actionCode = options.userActionCode;\n handler = () => {\n Host.userMetrics.actionTaken(actionCode);\n void action.execute();\n };\n }\n button.addEventListener(ToolbarButton.Events.CLICK, handler, action);\n action.addEventListener(ActionEvents.ENABLED, enabledChanged);\n button.setEnabled(action.enabled());\n return button;\n\n function makeButton(): ToolbarButton {\n const button = new ToolbarButton(action.title(), action.icon(), undefined, action.id());\n if (action.title()) {\n Tooltip.installWithActionBinding(button.element, action.title(), action.id());\n }\n return button;\n }\n\n function makeToggle(): ToolbarToggle {\n const toggleButton = new ToolbarToggle(action.title(), action.icon(), action.toggledIcon(), action.id());\n if (action.toggleWithRedColor()) {\n toggleButton.enableToggleWithRedColor();\n }\n action.addEventListener(ActionEvents.TOGGLED, toggled);\n toggled();\n return toggleButton;\n\n function toggled(): void {\n toggleButton.setToggled(action.toggled());\n if (action.title()) {\n toggleButton.setTitle(action.title());\n Tooltip.installWithActionBinding(toggleButton.element, action.title(), action.id());\n }\n }\n }\n\n function enabledChanged(event: Common.EventTarget.EventTargetEvent): void {\n button.setEnabled(event.data);\n }\n }\n\n static createActionButtonForId(actionId: string, options?: ToolbarButtonOptions): ToolbarButton {\n const action = ActionRegistry.instance().getAction(actionId);\n return Toolbar.createActionButton(action, options);\n }\n\n gripElementForResize(): Element {\n return this.contentElement;\n }\n\n makeWrappable(growVertically?: boolean): void {\n this.contentElement.classList.add('wrappable');\n if (growVertically) {\n this.contentElement.classList.add('toolbar-grow-vertical');\n }\n }\n\n makeVertical(): void {\n this.contentElement.classList.add('vertical');\n }\n\n renderAsLinks(): void {\n this.contentElement.classList.add('toolbar-render-as-links');\n }\n\n empty(): boolean {\n return !this.items.length;\n }\n\n setEnabled(enabled: boolean): void {\n this.enabled = enabled;\n for (const item of this.items) {\n item.applyEnabledState(this.enabled && item.enabled);\n }\n }\n\n appendToolbarItem(item: ToolbarItem): void {\n this.items.push(item);\n item.toolbar = this;\n item.setCompactLayout(this.hasCompactLayout());\n if (!this.enabled) {\n item.applyEnabledState(false);\n }\n this.contentElement.appendChild(item.element);\n this.hideSeparatorDupes();\n }\n\n hasItem(item: ToolbarItem): boolean {\n return this.items.includes(item);\n }\n\n prependToolbarItem(item: ToolbarItem): void {\n this.items.unshift(item);\n item.toolbar = this;\n item.setCompactLayout(this.hasCompactLayout());\n if (!this.enabled) {\n item.applyEnabledState(false);\n }\n this.contentElement.prepend(item.element);\n this.hideSeparatorDupes();\n }\n\n appendSeparator(): void {\n this.appendToolbarItem(new ToolbarSeparator());\n }\n\n appendSpacer(): void {\n this.appendToolbarItem(new ToolbarSeparator(true));\n }\n\n appendText(text: string): void {\n this.appendToolbarItem(new ToolbarText(text));\n }\n\n removeToolbarItem(itemToRemove: ToolbarItem): void {\n const updatedItems = [];\n for (const item of this.items) {\n if (item === itemToRemove) {\n item.element.remove();\n } else {\n updatedItems.push(item);\n }\n }\n this.items = updatedItems;\n }\n\n removeToolbarItems(): void {\n for (const item of this.items) {\n item.toolbar = null;\n }\n this.items = [];\n this.contentElement.removeChildren();\n }\n\n setColor(color: string): void {\n const style = document.createElement('style');\n style.textContent = '.toolbar-glyph { background-color: ' + color + ' !important }';\n this.shadowRoot.appendChild(style);\n }\n\n setToggledColor(color: string): void {\n const style = document.createElement('style');\n style.textContent =\n '.toolbar-button.toolbar-state-on .toolbar-glyph { background-color: ' + color + ' !important }';\n this.shadowRoot.appendChild(style);\n }\n\n hideSeparatorDupes(): void {\n if (!this.items.length) {\n return;\n }\n // Don't hide first and last separators if they were added explicitly.\n let previousIsSeparator = false;\n let lastSeparator;\n let nonSeparatorVisible = false;\n for (let i = 0; i < this.items.length; ++i) {\n if (this.items[i] instanceof ToolbarSeparator) {\n this.items[i].setVisible(!previousIsSeparator);\n previousIsSeparator = true;\n lastSeparator = this.items[i];\n continue;\n }\n if (this.items[i].visible()) {\n previousIsSeparator = false;\n lastSeparator = null;\n nonSeparatorVisible = true;\n }\n }\n if (lastSeparator && lastSeparator !== this.items[this.items.length - 1]) {\n lastSeparator.setVisible(false);\n }\n\n this.element.classList.toggle(\n 'hidden',\n lastSeparator !== null && lastSeparator !== undefined && lastSeparator.visible() && !nonSeparatorVisible);\n }\n\n async appendItemsAtLocation(location: string): Promise {\n const extensions: ToolbarItemRegistration[] = getRegisteredToolbarItems();\n\n extensions.sort((extension1, extension2) => {\n const order1 = extension1.order || 0;\n const order2 = extension2.order || 0;\n return order1 - order2;\n });\n\n const filtered = extensions.filter(e => e.location === location);\n const items = await Promise.all(filtered.map(extension => {\n const {separator, actionId, showLabel, label, loadItem} = extension;\n if (separator) {\n return new ToolbarSeparator();\n }\n if (actionId) {\n return Toolbar.createActionButtonForId(\n actionId, {label, showLabel: Boolean(showLabel), userActionCode: undefined});\n }\n // TODO(crbug.com/1134103) constratint the case checked with this if using TS type definitions once UI is TS-authored.\n if (!loadItem) {\n throw new Error('Could not load a toolbar item registration with no loadItem function');\n }\n return loadItem().then(p => (p as Provider).item());\n }));\n\n for (const item of items) {\n if (item) {\n this.appendToolbarItem(item);\n }\n }\n }\n}\nexport interface ToolbarButtonOptions {\n label?: () => Platform.UIString.LocalizedString;\n showLabel: boolean;\n userActionCode?: Host.UserMetrics.Action;\n ignoreToggleable?: boolean;\n}\n\nconst TOOLBAR_BUTTON_DEFAULT_OPTIONS: ToolbarButtonOptions = {\n showLabel: false,\n userActionCode: undefined,\n};\n\n// We need any here because Common.ObjectWrapper.ObjectWrapper is invariant in T.\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport class ToolbarItem extends Common.ObjectWrapper.ObjectWrapper {\n element: HTMLElement;\n private visibleInternal: boolean;\n enabled: boolean;\n toolbar: Toolbar|null;\n protected title?: string;\n\n constructor(element: Element) {\n super();\n this.element = (element as HTMLElement);\n this.element.classList.add('toolbar-item');\n this.visibleInternal = true;\n this.enabled = true;\n\n /**\n * Set by the parent toolbar during appending.\n */\n this.toolbar = null;\n }\n\n setTitle(title: string, actionId: string|undefined = undefined): void {\n if (this.title === title) {\n return;\n }\n this.title = title;\n ARIAUtils.setLabel(this.element, title);\n if (actionId === undefined) {\n Tooltip.install(this.element, title);\n } else {\n Tooltip.installWithActionBinding(this.element, title, actionId);\n }\n }\n\n setEnabled(value: boolean): void {\n if (this.enabled === value) {\n return;\n }\n this.enabled = value;\n this.applyEnabledState(this.enabled && (!this.toolbar || this.toolbar.enabled));\n }\n\n applyEnabledState(enabled: boolean): void {\n // @ts-ignore: Ignoring in favor of an `instanceof` check for all the different\n // kind of HTMLElement classes that have a disabled attribute.\n this.element.disabled = !enabled;\n }\n\n visible(): boolean {\n return this.visibleInternal;\n }\n\n setVisible(x: boolean): void {\n if (this.visibleInternal === x) {\n return;\n }\n this.element.classList.toggle('hidden', !x);\n this.visibleInternal = x;\n if (this.toolbar && !(this instanceof ToolbarSeparator)) {\n this.toolbar.hideSeparatorDupes();\n }\n }\n\n setRightAligned(alignRight: boolean): void {\n this.element.classList.toggle('toolbar-item-right-aligned', alignRight);\n }\n\n setCompactLayout(_enable: boolean): void {\n }\n}\n\nexport const enum ToolbarItemWithCompactLayoutEvents {\n COMPACT_LAYOUT_UPDATED = 'CompactLayoutUpdated',\n}\n\ntype ToolbarItemWithCompactLayoutEventTypes = {\n [ToolbarItemWithCompactLayoutEvents.COMPACT_LAYOUT_UPDATED]: boolean,\n};\n\nexport class ToolbarItemWithCompactLayout extends ToolbarItem {\n constructor(element: Element) {\n super(element);\n }\n\n override setCompactLayout(enable: boolean): void {\n this.dispatchEventToListeners(ToolbarItemWithCompactLayoutEvents.COMPACT_LAYOUT_UPDATED, enable);\n }\n}\n\nexport class ToolbarText extends ToolbarItem {\n constructor(text?: string) {\n const element = document.createElement('div');\n element.classList.add('toolbar-text');\n super(element);\n this.element.classList.add('toolbar-text');\n this.setText(text || '');\n }\n\n text(): string {\n return this.element.textContent || '';\n }\n\n setText(text: string): void {\n this.element.textContent = text;\n }\n}\n\nexport class ToolbarButton extends ToolbarItem {\n private button: Buttons.Button.Button;\n private text?: string;\n private adorner?: HTMLElement;\n\n constructor(title: string, glyphOrAdorner?: string|Adorners.Adorner.Adorner, text?: string, jslogContext?: string) {\n const button = new Buttons.Button.Button();\n super(button);\n this.button = button;\n if (glyphOrAdorner instanceof Adorners.Adorner.Adorner) {\n this.button.variant = Buttons.Button.Variant.ADORNER_ICON;\n this.setAdorner(glyphOrAdorner);\n this.button.prepend(glyphOrAdorner);\n } else if (typeof glyphOrAdorner === 'string' && !text) {\n this.button.data = {variant: Buttons.Button.Variant.ICON, iconName: glyphOrAdorner};\n } else {\n this.button.variant = Buttons.Button.Variant.TEXT;\n this.button.reducedFocusRing = true;\n if (glyphOrAdorner) {\n this.button.iconName = glyphOrAdorner;\n }\n }\n button.classList.add('toolbar-button');\n this.element.addEventListener('click', this.clicked.bind(this), false);\n this.element.addEventListener('mousedown', this.mouseDown.bind(this), false);\n button.textContent = text || '';\n this.setTitle(title);\n if (jslogContext) {\n button.jslogContext = jslogContext;\n }\n }\n\n focus(): void {\n this.element.focus();\n }\n\n checked(checked: boolean): void {\n this.button.checked = checked;\n }\n\n toggleOnClick(toggleOnClick: boolean): void {\n this.button.toggleOnClick = toggleOnClick;\n }\n\n isToggled(): boolean {\n return this.button.toggled;\n }\n\n toggled(toggled: boolean): void {\n this.button.toggled = toggled;\n }\n\n setToggleType(type: Buttons.Button.ToggleType): void {\n this.button.toggleType = type;\n }\n\n setLongClickable(longClickable: boolean): void {\n this.button.longClickable = longClickable;\n }\n\n setSize(size: Buttons.Button.Size): void {\n this.button.size = size;\n }\n\n setReducedFocusRing(): void {\n this.button.reducedFocusRing = true;\n }\n\n setText(text: string): void {\n if (this.text === text) {\n return;\n }\n this.button.textContent = text;\n this.button.variant = Buttons.Button.Variant.TEXT;\n this.button.reducedFocusRing = true;\n this.text = text;\n }\n\n setAdorner(adorner: Adorners.Adorner.Adorner): void {\n if (this.adorner) {\n this.adorner.replaceWith(adorner);\n } else {\n this.element.prepend(adorner);\n }\n this.adorner = adorner;\n }\n\n setGlyph(iconName: string): void {\n this.button.iconName = iconName;\n }\n\n setToggledIcon(toggledIconName: string): void {\n this.button.variant = Buttons.Button.Variant.ICON_TOGGLE;\n this.button.toggledIconName = toggledIconName;\n }\n\n setBackgroundImage(iconURL: string): void {\n this.element.style.backgroundImage = 'url(' + iconURL + ')';\n }\n\n setSecondary(): void {\n this.element.classList.add('toolbar-button-secondary');\n }\n\n setDarkText(): void {\n this.element.classList.add('dark-text');\n }\n\n turnIntoSelect(shrinkable: boolean|undefined = false): void {\n this.element.classList.add('toolbar-has-dropdown');\n if (shrinkable) {\n this.element.classList.add('toolbar-has-dropdown-shrinkable');\n }\n const dropdownArrowIcon = IconButton.Icon.create('triangle-down', 'toolbar-dropdown-arrow');\n this.element.appendChild(dropdownArrowIcon);\n }\n\n clicked(event: Event): void {\n if (!this.enabled) {\n return;\n }\n this.dispatchEventToListeners(ToolbarButton.Events.CLICK, event);\n event.consume();\n }\n\n protected mouseDown(event: MouseEvent): void {\n if (!this.enabled) {\n return;\n }\n this.dispatchEventToListeners(ToolbarButton.Events.MOUSE_DOWN, event);\n }\n}\n\nexport class ToolbarCombobox extends ToolbarItem {\n private textElement?: HTMLElement;\n private text?: string;\n private iconName?: string;\n private adorner?: Adorners.Adorner.Adorner;\n\n constructor(title: string, isIconDropdown?: boolean, jslogContext?: string, iconName?: string) {\n let element;\n if (iconName) {\n element = new Buttons.Button.Button();\n element.data = {variant: Buttons.Button.Variant.ICON, iconName};\n } else {\n element = document.createElement('button');\n }\n element.classList.add('toolbar-button');\n super(element);\n this.element.addEventListener('click', this.clicked.bind(this), false);\n this.element.addEventListener('mousedown', this.mouseDown.bind(this), false);\n\n this.iconName = iconName;\n\n this.setTitle(title);\n if (jslogContext) {\n this.element.setAttribute('jslog', `${VisualLogging.action().track({click: true}).context(jslogContext)}`);\n }\n this.title = '';\n if (!isIconDropdown) {\n this.element.classList.add('toolbar-has-dropdown');\n const dropdownArrowIcon = IconButton.Icon.create('triangle-down', 'toolbar-dropdown-arrow');\n this.element.appendChild(dropdownArrowIcon);\n }\n }\n\n setText(text: string): void {\n if (this.text === text || this.iconName) {\n return;\n }\n if (!this.textElement) {\n this.textElement = document.createElement('div');\n this.textElement.classList.add('toolbar-text', 'hidden');\n const dropDownArrow = this.element.querySelector('.toolbar-dropdown-arrow');\n this.element.insertBefore(this.textElement, dropDownArrow);\n }\n this.textElement.textContent = text;\n this.textElement.classList.toggle('hidden', !text);\n this.text = text;\n }\n\n setAdorner(adorner: Adorners.Adorner.Adorner): void {\n if (this.iconName) {\n return;\n }\n if (!this.adorner) {\n this.adorner = adorner;\n } else {\n adorner.replaceWith(adorner);\n if (this.element.firstChild) {\n this.element.removeChild(this.element.firstChild);\n }\n }\n this.element.prepend(adorner);\n }\n\n setDarkText(): void {\n this.element.classList.add('dark-text');\n }\n\n turnShrinkable(): void {\n this.element.classList.add('toolbar-has-dropdown-shrinkable');\n }\n\n clicked(event: Event): void {\n if (!this.enabled) {\n return;\n }\n this.dispatchEventToListeners(ToolbarButton.Events.CLICK, event);\n event.consume();\n }\n\n protected mouseDown(event: MouseEvent): void {\n if (!this.enabled) {\n return;\n }\n this.dispatchEventToListeners(ToolbarButton.Events.MOUSE_DOWN, event);\n }\n}\n\nexport namespace ToolbarButton {\n export const enum Events {\n CLICK = 'Click',\n MOUSE_DOWN = 'MouseDown',\n }\n\n export type EventTypes = {\n [Events.CLICK]: Event,\n [Events.MOUSE_DOWN]: MouseEvent,\n };\n}\n\nexport class ToolbarInput extends ToolbarItem {\n private prompt: TextPrompt;\n private readonly proxyElement: Element;\n\n constructor(\n placeholder: string, accessiblePlaceholder?: string, growFactor?: number, shrinkFactor?: number, tooltip?: string,\n completions?: ((arg0: string, arg1: string, arg2?: boolean|undefined) => Promise),\n dynamicCompletions?: boolean, jslogContext?: string) {\n const element = document.createElement('div');\n element.classList.add('toolbar-input');\n super(element);\n\n const internalPromptElement = this.element.createChild('div', 'toolbar-input-prompt');\n ARIAUtils.setLabel(internalPromptElement, accessiblePlaceholder || placeholder);\n internalPromptElement.addEventListener('focus', () => this.element.classList.add('focused'));\n internalPromptElement.addEventListener('blur', () => this.element.classList.remove('focused'));\n\n this.prompt = new TextPrompt();\n this.prompt.jslogContext = jslogContext;\n this.proxyElement = this.prompt.attach(internalPromptElement);\n this.proxyElement.classList.add('toolbar-prompt-proxy');\n this.proxyElement.addEventListener('keydown', (event: Event) => this.onKeydownCallback(event as KeyboardEvent));\n this.prompt.initialize(\n completions || (() => Promise.resolve([])),\n ' ',\n dynamicCompletions,\n );\n if (tooltip) {\n this.prompt.setTitle(tooltip);\n }\n this.prompt.setPlaceholder(placeholder, accessiblePlaceholder);\n this.prompt.addEventListener(TextPromptEvents.TEXT_CHANGED, this.onChangeCallback.bind(this));\n\n if (growFactor) {\n this.element.style.flexGrow = String(growFactor);\n }\n if (shrinkFactor) {\n this.element.style.flexShrink = String(shrinkFactor);\n }\n\n const clearButtonText = i18nString(UIStrings.clearInput);\n const clearButton = new Buttons.Button.Button();\n clearButton.data = {\n variant: Buttons.Button.Variant.ICON,\n iconName: 'cross-circle-filled',\n size: Buttons.Button.Size.SMALL,\n title: clearButtonText,\n };\n clearButton.className = 'toolbar-input-clear-button';\n clearButton.setAttribute('jslog', `${VisualLogging.action('clear').track({click: true}).parent('mapped')}`);\n VisualLogging.setMappedParent(clearButton, internalPromptElement);\n clearButton.variant = Buttons.Button.Variant.ICON;\n clearButton.size = Buttons.Button.Size.SMALL;\n clearButton.iconName = 'cross-circle-filled';\n clearButton.title = clearButtonText;\n clearButton.ariaLabel = clearButtonText;\n clearButton.tabIndex = -1;\n\n clearButton.addEventListener('click', () => {\n this.setValue('', true);\n this.prompt.focus();\n });\n\n this.element.appendChild(clearButton);\n this.updateEmptyStyles();\n }\n\n override applyEnabledState(enabled: boolean): void {\n if (enabled) {\n this.element.classList.remove('disabled');\n } else {\n this.element.classList.add('disabled');\n }\n\n this.prompt.setEnabled(enabled);\n }\n\n setValue(value: string, notify?: boolean): void {\n this.prompt.setText(value);\n if (notify) {\n this.onChangeCallback();\n }\n this.updateEmptyStyles();\n }\n\n value(): string {\n return this.prompt.textWithCurrentSuggestion();\n }\n\n valueWithoutSuggestion(): string {\n return this.prompt.text();\n }\n\n clearAutocomplete(): void {\n this.prompt.clearAutocomplete();\n }\n\n focus(): void {\n this.prompt.focus();\n }\n\n private onKeydownCallback(event: KeyboardEvent): void {\n if (event.key === 'Enter' && this.prompt.text()) {\n this.dispatchEventToListeners(ToolbarInput.Event.ENTER_PRESSED, this.prompt.text());\n }\n if (!Platform.KeyboardUtilities.isEscKey(event) || !this.prompt.text()) {\n return;\n }\n this.setValue('', true);\n event.consume(true);\n }\n\n private onChangeCallback(): void {\n this.updateEmptyStyles();\n this.dispatchEventToListeners(ToolbarInput.Event.TEXT_CHANGED, this.prompt.text());\n }\n\n private updateEmptyStyles(): void {\n this.element.classList.toggle('toolbar-input-empty', !this.prompt.text());\n }\n}\n\nexport class ToolbarFilter extends ToolbarInput {\n constructor(\n filterBy?: Common.UIString.LocalizedString, growFactor?: number, shrinkFactor?: number, tooltip?: string,\n completions?: ((arg0: string, arg1: string, arg2?: boolean|undefined) => Promise),\n dynamicCompletions?: boolean, jslogContext?: string) {\n const filterPlaceholder = filterBy ? filterBy : i18nString(UIStrings.filter);\n super(\n filterPlaceholder, filterPlaceholder, growFactor, shrinkFactor, tooltip, completions, dynamicCompletions,\n jslogContext || 'filter');\n\n const filterIcon = IconButton.Icon.create('filter');\n this.element.prepend(filterIcon);\n this.element.classList.add('toolbar-filter');\n }\n}\n\nexport namespace ToolbarInput {\n export const enum Event {\n TEXT_CHANGED = 'TextChanged',\n ENTER_PRESSED = 'EnterPressed',\n }\n\n export interface EventTypes {\n [Event.TEXT_CHANGED]: string;\n [Event.ENTER_PRESSED]: string;\n }\n}\n\nexport class ToolbarToggle extends ToolbarButton {\n private readonly untoggledGlyph: string|undefined;\n private readonly toggledGlyph: string|undefined;\n\n constructor(title: string, glyph?: string, toggledGlyph?: string, jslogContext?: string, toggleOnClick?: boolean) {\n super(title, glyph, '');\n this.untoggledGlyph = glyph;\n this.toggledGlyph = toggledGlyph ? toggledGlyph : glyph;\n this.setToggledIcon(this.toggledGlyph || '');\n this.setToggleType(Buttons.Button.ToggleType.PRIMARY);\n this.toggled(false);\n\n if (jslogContext) {\n this.element.setAttribute('jslog', `${VisualLogging.toggle().track({click: true}).context(jslogContext)}`);\n }\n if (toggleOnClick !== undefined) {\n this.setToggleOnClick(toggleOnClick);\n }\n }\n\n setToggleOnClick(toggleOnClick: boolean): void {\n this.toggleOnClick(toggleOnClick);\n }\n\n setToggled(toggled: boolean): void {\n this.toggled(toggled);\n }\n\n setChecked(checked: boolean): void {\n this.checked(checked);\n }\n\n setDefaultWithRedColor(withRedColor: boolean): void {\n if (withRedColor) {\n this.setToggleType(Buttons.Button.ToggleType.RED);\n this.setGlyph(this.toggledGlyph || '');\n this.setToggledIcon(this.untoggledGlyph || '');\n this.toggled(true);\n }\n }\n\n enableToggleWithRedColor(): void {\n this.setToggleType(Buttons.Button.ToggleType.RED);\n }\n}\n\nexport class ToolbarMenuButton extends ToolbarCombobox {\n private readonly contextMenuHandler: (arg0: ContextMenu) => void;\n private readonly useSoftMenu: boolean;\n private triggerTimeoutId?: number;\n #triggerDelay: number = 200;\n\n constructor(\n contextMenuHandler: (arg0: ContextMenu) => void, isIconDropdown?: boolean, useSoftMenu?: boolean,\n jslogContext?: string, iconName?: string) {\n super('', isIconDropdown, jslogContext, iconName);\n if (jslogContext) {\n this.element.setAttribute('jslog', `${VisualLogging.dropDown().track({click: true}).context(jslogContext)}`);\n }\n this.contextMenuHandler = contextMenuHandler;\n this.useSoftMenu = Boolean(useSoftMenu);\n ARIAUtils.markAsMenuButton(this.element);\n }\n\n setTriggerDelay(x: number): void {\n this.#triggerDelay = x;\n }\n\n override mouseDown(event: MouseEvent): void {\n if (!this.enabled) {\n return;\n }\n if (event.buttons !== 1) {\n super.mouseDown(event);\n return;\n }\n\n if (!this.triggerTimeoutId) {\n this.triggerTimeoutId = window.setTimeout(this.trigger.bind(this, event), this.#triggerDelay);\n }\n }\n\n private trigger(event: Event): void {\n delete this.triggerTimeoutId;\n\n const contextMenu = new ContextMenu(event, {\n useSoftMenu: this.useSoftMenu,\n x: this.element.getBoundingClientRect().left,\n y: this.element.getBoundingClientRect().top + this.element.offsetHeight,\n // Without adding a delay, pointer events will be un-ignored too early, and a single click causes\n // the context menu to be closed and immediately re-opened on Windows (https://crbug.com/339560549).\n onSoftMenuClosed: () => setTimeout(() => this.element.removeAttribute('aria-expanded'), 50),\n });\n this.contextMenuHandler(contextMenu);\n this.element.setAttribute('aria-expanded', 'true');\n void contextMenu.show();\n }\n\n override clicked(event: Event): void {\n if (this.triggerTimeoutId) {\n clearTimeout(this.triggerTimeoutId);\n }\n this.trigger(event);\n }\n}\n\nexport class ToolbarSettingToggle extends ToolbarToggle {\n private readonly defaultTitle: string;\n private readonly setting: Common.Settings.Setting;\n private willAnnounceState: boolean;\n\n constructor(\n setting: Common.Settings.Setting, glyph: string, title: string, toggledGlyph?: string,\n jslogContext?: string) {\n super(title, glyph, toggledGlyph, jslogContext);\n this.defaultTitle = title;\n this.setting = setting;\n this.settingChanged();\n this.setting.addChangeListener(this.settingChanged, this);\n\n // Determines whether the toggle state will be announced to a screen reader\n this.willAnnounceState = false;\n }\n\n private settingChanged(): void {\n const toggled = this.setting.get();\n this.setToggled(toggled);\n const toggleAnnouncement = toggled ? i18nString(UIStrings.pressed) : i18nString(UIStrings.notPressed);\n if (this.willAnnounceState) {\n ARIAUtils.alert(toggleAnnouncement);\n }\n this.willAnnounceState = false;\n this.setTitle(this.defaultTitle);\n }\n\n override clicked(event: Event): void {\n this.willAnnounceState = true;\n this.setting.set(this.isToggled());\n super.clicked(event);\n }\n}\n\nexport class ToolbarSeparator extends ToolbarItem {\n constructor(spacer?: boolean) {\n const element = document.createElement('div');\n element.classList.add(spacer ? 'toolbar-spacer' : 'toolbar-divider');\n super(element);\n }\n}\n\nexport interface Provider {\n item(): ToolbarItem|null;\n}\n\nexport interface ItemsProvider {\n toolbarItems(): ToolbarItem[];\n}\n\nexport class ToolbarComboBox extends ToolbarItem {\n protected selectElementInternal: HTMLSelectElement;\n\n constructor(changeHandler: ((arg0: Event) => void)|null, title: string, className?: string, jslogContext?: string) {\n const element = document.createElement('span');\n element.classList.add('toolbar-select-container');\n super(element);\n this.selectElementInternal = this.element.createChild('select', 'toolbar-item');\n const dropdownArrowIcon = IconButton.Icon.create('triangle-down', 'toolbar-dropdown-arrow');\n this.element.appendChild(dropdownArrowIcon);\n if (changeHandler) {\n this.selectElementInternal.addEventListener('change', changeHandler, false);\n }\n ARIAUtils.setLabel(this.selectElementInternal, title);\n super.setTitle(title);\n if (className) {\n this.selectElementInternal.classList.add(className);\n }\n if (jslogContext) {\n this.selectElementInternal.setAttribute(\n 'jslog', `${VisualLogging.dropDown().track({change: true}).context(jslogContext)}`);\n }\n }\n\n selectElement(): HTMLSelectElement {\n return this.selectElementInternal;\n }\n\n size(): number {\n return this.selectElementInternal.childElementCount;\n }\n\n options(): HTMLOptionElement[] {\n return Array.prototype.slice.call(this.selectElementInternal.children, 0);\n }\n\n addOption(option: Element): void {\n this.selectElementInternal.appendChild(option);\n }\n\n createOption(label: string, value?: string): HTMLOptionElement {\n const option = this.selectElementInternal.createChild('option');\n option.text = label;\n if (typeof value !== 'undefined') {\n option.value = value;\n }\n const jslogContext = value ? Platform.StringUtilities.toKebabCase(value) : undefined;\n option.setAttribute('jslog', `${VisualLogging.item(jslogContext).track({click: true})}`);\n return option;\n }\n\n override applyEnabledState(enabled: boolean): void {\n super.applyEnabledState(enabled);\n this.selectElementInternal.disabled = !enabled;\n }\n\n removeOption(option: Element): void {\n this.selectElementInternal.removeChild(option);\n }\n\n removeOptions(): void {\n this.selectElementInternal.removeChildren();\n }\n\n selectedOption(): HTMLOptionElement|null {\n if (this.selectElementInternal.selectedIndex >= 0) {\n return this.selectElementInternal[this.selectElementInternal.selectedIndex] as HTMLOptionElement;\n }\n return null;\n }\n\n select(option: Element): void {\n this.selectElementInternal.selectedIndex = Array.prototype.indexOf.call(this.selectElementInternal, option);\n }\n\n setSelectedIndex(index: number): void {\n this.selectElementInternal.selectedIndex = index;\n }\n\n selectedIndex(): number {\n return this.selectElementInternal.selectedIndex;\n }\n\n setMaxWidth(width: number): void {\n this.selectElementInternal.style.maxWidth = width + 'px';\n }\n\n setMinWidth(width: number): void {\n this.selectElementInternal.style.minWidth = width + 'px';\n }\n}\n\nexport interface Option {\n value: string;\n label: string;\n}\n\nexport class ToolbarSettingComboBox extends ToolbarComboBox {\n private optionsInternal: Option[];\n private readonly setting: Common.Settings.Setting;\n private muteSettingListener?: boolean;\n constructor(options: Option[], setting: Common.Settings.Setting, accessibleName: string) {\n super(null, accessibleName, undefined, setting.name);\n this.optionsInternal = options;\n this.setting = setting;\n this.selectElementInternal.addEventListener('change', this.valueChanged.bind(this), false);\n this.setOptions(options);\n setting.addChangeListener(this.settingChanged, this);\n }\n\n setOptions(options: Option[]): void {\n this.optionsInternal = options;\n this.selectElementInternal.removeChildren();\n for (let i = 0; i < options.length; ++i) {\n const dataOption = options[i];\n const option = this.createOption(dataOption.label, dataOption.value);\n this.selectElementInternal.appendChild(option);\n if (this.setting.get() === dataOption.value) {\n this.setSelectedIndex(i);\n }\n }\n }\n\n value(): string {\n return this.optionsInternal[this.selectedIndex()].value;\n }\n\n private settingChanged(): void {\n if (this.muteSettingListener) {\n return;\n }\n\n const value = this.setting.get();\n for (let i = 0; i < this.optionsInternal.length; ++i) {\n if (value === this.optionsInternal[i].value) {\n this.setSelectedIndex(i);\n break;\n }\n }\n }\n\n private valueChanged(_event: Event): void {\n const option = this.optionsInternal[this.selectedIndex()];\n this.muteSettingListener = true;\n this.setting.set(option.value);\n this.muteSettingListener = false;\n }\n}\n\nexport class ToolbarCheckbox extends ToolbarItem {\n inputElement: HTMLInputElement;\n\n constructor(\n text: Common.UIString.LocalizedString, tooltip?: Common.UIString.LocalizedString,\n listener?: ((arg0: MouseEvent) => void), jslogContext?: string, small?: boolean) {\n super(CheckboxLabel.create(text));\n this.element.classList.add('checkbox');\n this.inputElement = (this.element as CheckboxLabel).checkboxElement;\n this.inputElement.classList.toggle('small', small);\n if (tooltip) {\n // install on the checkbox\n Tooltip.install(this.inputElement, tooltip);\n Tooltip.install((this.element as CheckboxLabel).textElement, tooltip);\n }\n if (listener) {\n this.inputElement.addEventListener('click', listener, false);\n }\n if (jslogContext) {\n this.inputElement.setAttribute('jslog', `${VisualLogging.toggle().track({change: true}).context(jslogContext)}`);\n }\n }\n\n checked(): boolean {\n return this.inputElement.checked;\n }\n\n setChecked(value: boolean): void {\n this.inputElement.checked = value;\n }\n\n override applyEnabledState(enabled: boolean): void {\n super.applyEnabledState(enabled);\n this.inputElement.disabled = !enabled;\n }\n\n setIndeterminate(indeterminate: boolean): void {\n this.inputElement.indeterminate = indeterminate;\n }\n}\n\nexport class ToolbarSettingCheckbox extends ToolbarCheckbox {\n constructor(\n setting: Common.Settings.Setting, tooltip?: Common.UIString.LocalizedString,\n alternateTitle?: Common.UIString.LocalizedString) {\n super(alternateTitle || setting.title(), tooltip, undefined, setting.name);\n bindCheckbox(this.inputElement, setting);\n }\n}\n\nconst registeredToolbarItems: ToolbarItemRegistration[] = [];\n\nexport function registerToolbarItem(registration: ToolbarItemRegistration): void {\n registeredToolbarItems.push(registration);\n}\n\nfunction getRegisteredToolbarItems(): ToolbarItemRegistration[] {\n return registeredToolbarItems.filter(\n item => Root.Runtime.Runtime.isDescriptorEnabled({experiment: item.experiment, condition: item.condition}));\n}\n\nexport interface ToolbarItemRegistration {\n order?: number;\n location: ToolbarItemLocation;\n separator?: boolean;\n label?: () => Platform.UIString.LocalizedString;\n showLabel?: boolean;\n actionId?: string;\n condition?: Root.Runtime.Condition;\n loadItem?: (() => Promise);\n experiment?: string;\n jslog?: string;\n}\n\nexport const enum ToolbarItemLocation {\n FILES_NAVIGATION_TOOLBAR = 'files-navigator-toolbar',\n MAIN_TOOLBAR_RIGHT = 'main-toolbar-right',\n MAIN_TOOLBAR_LEFT = 'main-toolbar-left',\n STYLES_SIDEBARPANE_TOOLBAR = 'styles-sidebarpane-toolbar',\n}\n"]} \ No newline at end of file diff --git a/public/ui/legacy/Toolbar.test.js b/public/ui/legacy/Toolbar.test.js index b7fda13ae..5d503d2b7 100644 --- a/public/ui/legacy/Toolbar.test.js +++ b/public/ui/legacy/Toolbar.test.js @@ -1,10 +1,9 @@ // Copyright 2022 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import * as Coordinator from '../components/render_coordinator/render_coordinator.js'; -const coordinator = Coordinator.RenderCoordinator.RenderCoordinator.instance(); import { dispatchClickEvent, doubleRaf, renderElementIntoDOM, } from '../../testing/DOMHelpers.js'; import { describeWithLocale } from '../../testing/EnvironmentHelpers.js'; +import * as RenderCoordinator from '../components/render_coordinator/render_coordinator.js'; import * as UI from './legacy.js'; describeWithLocale('Toolbar', () => { describe('ToolbarInput', () => { @@ -13,7 +12,7 @@ describeWithLocale('Toolbar', () => { renderElementIntoDOM(input.element); input.setValue('test value'); const clearButton = input.element.querySelector('.toolbar-input-clear-button'); - await coordinator.done(); + await RenderCoordinator.done(); const innerButton = clearButton?.shadowRoot?.querySelector('button'); assert.instanceOf(innerButton, HTMLElement); assert.strictEqual(innerButton.title, 'Clear'); diff --git a/public/ui/legacy/Toolbar.test.js.map b/public/ui/legacy/Toolbar.test.js.map index 63f222426..30adcf89e 100644 --- a/public/ui/legacy/Toolbar.test.js.map +++ b/public/ui/legacy/Toolbar.test.js.map @@ -1 +1 @@ -{"version":3,"file":"Toolbar.test.js","sourceRoot":"","sources":["../../../../../../front_end/ui/legacy/Toolbar.test.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,KAAK,WAAW,MAAM,wDAAwD,CAAC;AAEtF,MAAM,WAAW,GAAG,WAAW,CAAC,iBAAiB,CAAC,iBAAiB,CAAC,QAAQ,EAAE,CAAC;AAE/E,OAAO,EACL,kBAAkB,EAClB,SAAS,EACT,oBAAoB,GACrB,MAAM,6BAA6B,C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,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;YACjD,MAAM,CAAC,MAAM,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC;QACvC,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,qDAAqD,EAAE,KAAK,IAAI,EAAE;YACnE,MAAM,cAAc,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC;YACpC,MAAM,UAAU,GAAG,uBAAuB,CAAC,cAAc,CAAC,CAAC;YAC3D,UAAU,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;YAC7B,MAAM,sBAAsB,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;YACjD,MAAM,CAAC,OAAO,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC;QACxC,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["// Copyright 2022 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport * as Coordinator from '../components/render_coordinator/render_coordinator.js';\n\nconst coordinator = Coordinator.RenderCoordinator.RenderCoordinator.instance();\n\nimport {\n dispatchClickEvent,\n doubleRaf,\n renderElementIntoDOM,\n} from '../../testing/DOMHelpers.js';\nimport {describeWithLocale} from '../../testing/EnvironmentHelpers.js';\n\nimport * as UI from './legacy.js';\n\ndescribeWithLocale('Toolbar', () => {\n describe('ToolbarInput', () => {\n it('sets a title on the clear button', async () => {\n const input = new UI.Toolbar.ToolbarInput('placeholder');\n renderElementIntoDOM(input.element);\n input.setValue('test value');\n const clearButton = input.element.querySelector('.toolbar-input-clear-button');\n await coordinator.done();\n const innerButton = clearButton?.shadowRoot?.querySelector('button');\n assert.instanceOf(innerButton, HTMLElement);\n assert.strictEqual(innerButton.title, 'Clear');\n });\n\n it('clears the input when the clear button is clicked', () => {\n const input = new UI.Toolbar.ToolbarInput('placeholder');\n renderElementIntoDOM(input.element);\n const clearButton = input.element.querySelector('.toolbar-input-clear-button');\n assert.instanceOf(clearButton, HTMLElement);\n input.setValue('test value');\n dispatchClickEvent(clearButton);\n assert.strictEqual(input.value(), '');\n });\n });\n\n it('can append items into the toolbar', async () => {\n const div = document.createElement('div');\n const toolbar = new UI.Toolbar.Toolbar('test-toolbar', div);\n renderElementIntoDOM(div);\n\n const itemOne = new UI.Toolbar.ToolbarInput('placeholder-item-1');\n toolbar.appendToolbarItem(itemOne);\n const itemTwo = new UI.Toolbar.ToolbarInput('placeholder-item-2');\n toolbar.appendToolbarItem(itemTwo);\n\n const toolbarInputs = div.querySelector('.toolbar')?.shadowRoot?.querySelectorAll('[data-placeholder]');\n assert.isOk(toolbarInputs);\n assert.lengthOf(toolbarInputs, 2);\n\n const placeholders = Array.from(toolbarInputs).map(input => {\n return input.getAttribute('data-placeholder');\n });\n\n assert.deepEqual(placeholders, ['placeholder-item-1', 'placeholder-item-2']);\n });\n\n it('can prepend items into the toolbar', async () => {\n const div = document.createElement('div');\n const toolbar = new UI.Toolbar.Toolbar('test-toolbar', div);\n renderElementIntoDOM(div);\n\n const itemOne = new UI.Toolbar.ToolbarInput('placeholder-item-1');\n toolbar.appendToolbarItem(itemOne);\n const itemTwo = new UI.Toolbar.ToolbarInput('placeholder-item-2');\n toolbar.prependToolbarItem(itemTwo);\n\n const toolbarInputs = div.querySelector('.toolbar')?.shadowRoot?.querySelectorAll('[data-placeholder]');\n assert.isOk(toolbarInputs);\n assert.lengthOf(toolbarInputs, 2);\n\n const placeholders = Array.from(toolbarInputs).map(input => {\n return input.getAttribute('data-placeholder');\n });\n\n // Ensure the second item was prepended correctly\n assert.deepEqual(placeholders, ['placeholder-item-2', 'placeholder-item-1']);\n });\n\n it('knows if it has an item in the toolbar', async () => {\n const toolbar = new UI.Toolbar.Toolbar('test-toolbar');\n const item = new UI.Toolbar.ToolbarInput('placeholder');\n toolbar.appendToolbarItem(item);\n assert.isTrue(toolbar.hasItem(item));\n toolbar.removeToolbarItem(item);\n assert.isFalse(toolbar.hasItem(item));\n });\n\n describe('ToolbarMenuButton', () => {\n function createToolbarWithButton(\n contextMenuHandler: sinon.SinonStubStatic,\n ): UI.Toolbar.ToolbarMenuButton {\n const div = document.createElement('div');\n const toolbar = new UI.Toolbar.Toolbar('test-toolbar', div);\n renderElementIntoDOM(div);\n const menuButton = new UI.Toolbar.ToolbarMenuButton(contextMenuHandler);\n menuButton.setTriggerDelay(0); // default is 200ms but don't want to slow tests down\n toolbar.appendToolbarItem(menuButton);\n return menuButton;\n }\n\n async function dispatchMouseDownEvent(element: HTMLElement): Promise {\n const mouseDownEvent = new MouseEvent('mousedown', {\n buttons: 1,\n });\n element.dispatchEvent(mouseDownEvent);\n await doubleRaf(); // give the timer time to resolve + initiate the context menu\n }\n\n it('creates the context menu if it is enabled', async () => {\n const contextHandler = sinon.stub();\n const menuButton = createToolbarWithButton(contextHandler);\n menuButton.setEnabled(true);\n await dispatchMouseDownEvent(menuButton.element);\n assert.isTrue(contextHandler.called);\n });\n\n it('does not create a context menu if it is not enabled', async () => {\n const contextHandler = sinon.stub();\n const menuButton = createToolbarWithButton(contextHandler);\n menuButton.setEnabled(false);\n await dispatchMouseDownEvent(menuButton.element);\n assert.isFalse(contextHandler.called);\n });\n });\n});\n"]} \ No newline at end of file +{"version":3,"file":"Toolbar.test.js","sourceRoot":"","sources":["../../../../../../front_end/ui/legacy/Toolbar.test.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,EACL,kBAAkB,EAClB,SAAS,EACT,oBAAoB,GACrB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAC,kBAAkB,EAAC,MAAM,qCAAqC,CAAC;AACvE,OAAO,KAAK,iBAAiB,MAAM,wDAAwD,CAAC;AAE5F,OAAO,KAAK,EAAE,MAAM,aAAa,CAAC;AAElC,kBAAkB,CAAC,SAAS,EAAE,GAAG,EAAE;IACjC,QAAQ,CAAC,cAAc,EAAE,GAAG,EAAE;QAC5B,EAAE,CAAC,kCAAkC,EAAE,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,CAAC;YACpC,MAAM,UAAU,GAAG,uBAAuB,CAAC,cAAc,CAAC,CAAC;YAC3D,UAAU,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;YAC7B,MAAM,sBAAsB,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;YACjD,MAAM,CAAC,OAAO,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC;QACxC,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["// Copyright 2022 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport {\n dispatchClickEvent,\n doubleRaf,\n renderElementIntoDOM,\n} from '../../testing/DOMHelpers.js';\nimport {describeWithLocale} from '../../testing/EnvironmentHelpers.js';\nimport * as RenderCoordinator from '../components/render_coordinator/render_coordinator.js';\n\nimport * as UI from './legacy.js';\n\ndescribeWithLocale('Toolbar', () => {\n describe('ToolbarInput', () => {\n it('sets a title on the clear button', async () => {\n const input = new UI.Toolbar.ToolbarInput('placeholder');\n renderElementIntoDOM(input.element);\n input.setValue('test value');\n const clearButton = input.element.querySelector('.toolbar-input-clear-button');\n await RenderCoordinator.done();\n const innerButton = clearButton?.shadowRoot?.querySelector('button');\n assert.instanceOf(innerButton, HTMLElement);\n assert.strictEqual(innerButton.title, 'Clear');\n });\n\n it('clears the input when the clear button is clicked', () => {\n const input = new UI.Toolbar.ToolbarInput('placeholder');\n renderElementIntoDOM(input.element);\n const clearButton = input.element.querySelector('.toolbar-input-clear-button');\n assert.instanceOf(clearButton, HTMLElement);\n input.setValue('test value');\n dispatchClickEvent(clearButton);\n assert.strictEqual(input.value(), '');\n });\n });\n\n it('can append items into the toolbar', async () => {\n const div = document.createElement('div');\n const toolbar = new UI.Toolbar.Toolbar('test-toolbar', div);\n renderElementIntoDOM(div);\n\n const itemOne = new UI.Toolbar.ToolbarInput('placeholder-item-1');\n toolbar.appendToolbarItem(itemOne);\n const itemTwo = new UI.Toolbar.ToolbarInput('placeholder-item-2');\n toolbar.appendToolbarItem(itemTwo);\n\n const toolbarInputs = div.querySelector('.toolbar')?.shadowRoot?.querySelectorAll('[data-placeholder]');\n assert.isOk(toolbarInputs);\n assert.lengthOf(toolbarInputs, 2);\n\n const placeholders = Array.from(toolbarInputs).map(input => {\n return input.getAttribute('data-placeholder');\n });\n\n assert.deepEqual(placeholders, ['placeholder-item-1', 'placeholder-item-2']);\n });\n\n it('can prepend items into the toolbar', async () => {\n const div = document.createElement('div');\n const toolbar = new UI.Toolbar.Toolbar('test-toolbar', div);\n renderElementIntoDOM(div);\n\n const itemOne = new UI.Toolbar.ToolbarInput('placeholder-item-1');\n toolbar.appendToolbarItem(itemOne);\n const itemTwo = new UI.Toolbar.ToolbarInput('placeholder-item-2');\n toolbar.prependToolbarItem(itemTwo);\n\n const toolbarInputs = div.querySelector('.toolbar')?.shadowRoot?.querySelectorAll('[data-placeholder]');\n assert.isOk(toolbarInputs);\n assert.lengthOf(toolbarInputs, 2);\n\n const placeholders = Array.from(toolbarInputs).map(input => {\n return input.getAttribute('data-placeholder');\n });\n\n // Ensure the second item was prepended correctly\n assert.deepEqual(placeholders, ['placeholder-item-2', 'placeholder-item-1']);\n });\n\n it('knows if it has an item in the toolbar', async () => {\n const toolbar = new UI.Toolbar.Toolbar('test-toolbar');\n const item = new UI.Toolbar.ToolbarInput('placeholder');\n toolbar.appendToolbarItem(item);\n assert.isTrue(toolbar.hasItem(item));\n toolbar.removeToolbarItem(item);\n assert.isFalse(toolbar.hasItem(item));\n });\n\n describe('ToolbarMenuButton', () => {\n function createToolbarWithButton(\n contextMenuHandler: sinon.SinonStubStatic,\n ): UI.Toolbar.ToolbarMenuButton {\n const div = document.createElement('div');\n const toolbar = new UI.Toolbar.Toolbar('test-toolbar', div);\n renderElementIntoDOM(div);\n const menuButton = new UI.Toolbar.ToolbarMenuButton(contextMenuHandler);\n menuButton.setTriggerDelay(0); // default is 200ms but don't want to slow tests down\n toolbar.appendToolbarItem(menuButton);\n return menuButton;\n }\n\n async function dispatchMouseDownEvent(element: HTMLElement): Promise {\n const mouseDownEvent = new MouseEvent('mousedown', {\n buttons: 1,\n });\n element.dispatchEvent(mouseDownEvent);\n await doubleRaf(); // give the timer time to resolve + initiate the context menu\n }\n\n it('creates the context menu if it is enabled', async () => {\n const contextHandler = sinon.stub();\n const menuButton = createToolbarWithButton(contextHandler);\n menuButton.setEnabled(true);\n await dispatchMouseDownEvent(menuButton.element);\n assert.isTrue(contextHandler.called);\n });\n\n it('does not create a context menu if it is not enabled', async () => {\n const contextHandler = sinon.stub();\n const menuButton = createToolbarWithButton(contextHandler);\n menuButton.setEnabled(false);\n await dispatchMouseDownEvent(menuButton.element);\n assert.isFalse(contextHandler.called);\n });\n });\n});\n"]} \ No newline at end of file diff --git a/public/ui/legacy/Treeoutline.js b/public/ui/legacy/Treeoutline.js index cedfcfae2..eae5206b7 100644 --- a/public/ui/legacy/Treeoutline.js +++ b/public/ui/legacy/Treeoutline.js @@ -351,8 +351,7 @@ export class TreeOutlineInShadow extends TreeOutline { super(); this.contentElement.classList.add('tree-outline'); this.element = document.createElement('div'); - this.shadowRoot = - createShadowRootWithCoreStyles(this.element, { cssFile: treeoutlineStyles, delegatesFocus: undefined }); + this.shadowRoot = createShadowRootWithCoreStyles(this.element, { cssFile: treeoutlineStyles }); this.disclosureElement = this.shadowRoot.createChild('div', 'tree-outline-disclosure'); this.disclosureElement.appendChild(this.contentElement); this.renderSelection = true; diff --git a/public/ui/legacy/Treeoutline.js.map b/public/ui/legacy/Treeoutline.js.map index 490794eee..250331fd1 100644 --- a/public/ui/legacy/Treeoutline.js.map +++ b/public/ui/legacy/Treeoutline.js.map @@ -1 +1 @@ -{"version":3,"file":"Treeoutline.js","sourceRoot":"","sources":["../../../../../../front_end/ui/legacy/Treeoutline.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,yEAAyE;AACzE,6BAA6B;AAE7B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AK,IAAI,IAAI,GAAG,gBAAgB,IAAI,IAAI,CAAC,UAAU,CAAC;IAC1F,CAAC;IAED,qBAAqB,CAAC,MAAe;QACnC,IAAI,CAAC,kBAAkB,GAAG,MAAM,CAAC;IACnC,CAAC;CACF;AAED,SAAS,qBAAqB,CAAC,CAAU;IACvC,MAAM,WAAW,GAAG,WAAW,CAAC,4BAA4B,CAAC,CAAC,CAAC,CAAC;IAChE,MAAM,aAAa,GAAG,WAAW,EAAE,MAAM,EAAE,eAAe,CAAC;IAC3D,OAAO,aAAa,EAAE,WAAW,IAAI,aAAa,IAAI,WAAW,EAAE,WAAW,EAAE,cAAc,CAAC;AACjG,CAAC;AAED,aAAa,CAAC,sBAAsB,CAAC,gBAAgB,EAAE,qBAAqB,CAAC,CAAC","sourcesContent":["// Copyright 2021 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\n/*\n * Copyright (C) 2007 Apple Inc. All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n *\n * 1. Redistributions of source code must retain the above copyright\n * notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n * notice, this list of conditions and the following disclaimer in the\n * documentation and/or other materials provided with the distribution.\n * 3. Neither the name of Apple Computer, Inc. (\"Apple\") nor the names of\n * its contributors may be used to endorse or promote products derived\n * from this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nimport * as Common from '../../core/common/common.js';\nimport * as Platform from '../../core/platform/platform.js';\nimport type * as Buttons from '../components/buttons/buttons.js';\nimport type * as IconButton from '../components/icon_button/icon_button.js';\nimport * as VisualLogging from '../visual_logging/visual_logging.js';\n\nimport * as ARIAUtils from './ARIAUtils.js';\nimport {type Config, InplaceEditor} from './InplaceEditor.js';\nimport {Keys} from './KeyboardShortcut.js';\nimport * as ThemeSupport from './theme_support/theme_support.js';\nimport {Tooltip} from './Tooltip.js';\nimport treeoutlineStyles from './treeoutline.css.legacy.js';\nimport {\n createShadowRootWithCoreStyles,\n deepElementFromPoint,\n enclosingNodeOrSelfWithNodeNameInArray,\n isEditing,\n} from './UIUtils.js';\n\nconst nodeToParentTreeElementMap = new WeakMap();\n\nexport enum Events {\n /* eslint-disable @typescript-eslint/naming-convention -- Used by web_tests. */\n ElementAttached = 'ElementAttached',\n ElementsDetached = 'ElementsDetached',\n ElementExpanded = 'ElementExpanded',\n ElementCollapsed = 'ElementCollapsed',\n ElementSelected = 'ElementSelected',\n /* eslint-enable @typescript-eslint/naming-convention */\n}\n\nexport type EventTypes = {\n [Events.ElementAttached]: TreeElement,\n [Events.ElementsDetached]: void,\n [Events.ElementExpanded]: TreeElement,\n [Events.ElementCollapsed]: TreeElement,\n [Events.ElementSelected]: TreeElement,\n};\n\nexport class TreeOutline extends Common.ObjectWrapper.ObjectWrapper {\n readonly rootElementInternal: TreeElement;\n renderSelection: boolean;\n selectedTreeElement: TreeElement|null;\n expandTreeElementsWhenArrowing: boolean;\n comparator: ((arg0: TreeElement, arg1: TreeElement) => number)|null;\n contentElement: HTMLOListElement;\n preventTabOrder: boolean;\n showSelectionOnKeyboardFocus: boolean;\n private focusable: boolean;\n element: HTMLElement;\n private useLightSelectionColor: boolean;\n private treeElementToScrollIntoView: TreeElement|null;\n private centerUponScrollIntoView: boolean;\n\n constructor() {\n super();\n this.rootElementInternal = this.createRootElement();\n this.renderSelection = false;\n\n this.selectedTreeElement = null;\n this.expandTreeElementsWhenArrowing = false;\n this.comparator = null;\n\n this.contentElement = this.rootElementInternal.childrenListNode;\n this.contentElement.addEventListener('keydown', this.treeKeyDown.bind(this), false);\n\n this.preventTabOrder = false;\n this.showSelectionOnKeyboardFocus = false;\n this.focusable = true;\n this.setFocusable(true);\n this.element = this.contentElement;\n this.element.setAttribute('jslog', `${VisualLogging.tree()}`);\n ARIAUtils.markAsTree(this.element);\n this.useLightSelectionColor = false;\n this.treeElementToScrollIntoView = null;\n this.centerUponScrollIntoView = false;\n }\n\n setShowSelectionOnKeyboardFocus(show: boolean, preventTabOrder?: boolean): void {\n this.contentElement.classList.toggle('hide-selection-when-blurred', show);\n this.preventTabOrder = Boolean(preventTabOrder);\n if (this.focusable) {\n this.contentElement.tabIndex = Boolean(preventTabOrder) ? -1 : 0;\n }\n this.showSelectionOnKeyboardFocus = show;\n }\n\n private createRootElement(): TreeElement {\n const rootElement = new TreeElement();\n rootElement.treeOutline = this;\n rootElement.root = true;\n rootElement.selectable = false;\n rootElement.expanded = true;\n rootElement.childrenListNode.classList.remove('children');\n return rootElement;\n }\n\n rootElement(): TreeElement {\n return this.rootElementInternal;\n }\n\n firstChild(): TreeElement|null {\n return this.rootElementInternal.firstChild();\n }\n\n private lastDescendent(): TreeElement|null {\n let last = this.rootElementInternal.lastChild();\n while (last && last.expanded && last.childCount()) {\n last = last.lastChild();\n }\n return last;\n }\n\n appendChild(child: TreeElement, comparator?: ((arg0: TreeElement, arg1: TreeElement) => number)): void {\n this.rootElementInternal.appendChild(child, comparator);\n }\n\n insertChild(child: TreeElement, index: number): void {\n this.rootElementInternal.insertChild(child, index);\n }\n\n removeChild(child: TreeElement): void {\n this.rootElementInternal.removeChild(child);\n }\n\n removeChildren(): void {\n this.rootElementInternal.removeChildren();\n }\n\n treeElementFromPoint(x: number, y: number): TreeElement|null {\n const node = deepElementFromPoint(this.contentElement.ownerDocument, x, y);\n if (!node) {\n return null;\n }\n\n const listNode = enclosingNodeOrSelfWithNodeNameInArray(node, ['ol', 'li']);\n if (listNode) {\n return nodeToParentTreeElementMap.get(listNode) || treeElementBylistItemNode.get(listNode) || null;\n }\n return null;\n }\n\n treeElementFromEvent(event: MouseEvent|null): TreeElement|null {\n return event ? this.treeElementFromPoint(event.pageX, event.pageY) : null;\n }\n\n setComparator(comparator: ((arg0: TreeElement, arg1: TreeElement) => number)|null): void {\n this.comparator = comparator;\n }\n\n setFocusable(focusable: boolean): void {\n this.focusable = focusable;\n this.updateFocusable();\n }\n\n updateFocusable(): void {\n if (this.focusable) {\n this.contentElement.tabIndex = (this.preventTabOrder || Boolean(this.selectedTreeElement)) ? -1 : 0;\n if (this.selectedTreeElement) {\n this.selectedTreeElement.setFocusable(true);\n }\n } else {\n this.contentElement.removeAttribute('tabIndex');\n if (this.selectedTreeElement) {\n this.selectedTreeElement.setFocusable(false);\n }\n }\n }\n\n focus(): void {\n if (this.selectedTreeElement) {\n this.selectedTreeElement.listItemElement.focus();\n } else {\n this.contentElement.focus();\n }\n }\n\n setUseLightSelectionColor(flag: boolean): void {\n this.useLightSelectionColor = flag;\n }\n\n getUseLightSelectionColor(): boolean {\n return this.useLightSelectionColor;\n }\n\n bindTreeElement(element: TreeElement): void {\n if (element.treeOutline) {\n console.error('Binding element for the second time: ' + new Error().stack);\n }\n element.treeOutline = this;\n element.onbind();\n }\n\n unbindTreeElement(element: TreeElement): void {\n if (!element.treeOutline) {\n console.error('Unbinding element that was not bound: ' + new Error().stack);\n }\n\n element.deselect();\n element.onunbind();\n element.treeOutline = null;\n }\n\n selectPrevious(): boolean {\n let nextSelectedElement: (TreeElement|null) =\n this.selectedTreeElement && this.selectedTreeElement.traversePreviousTreeElement(true);\n while (nextSelectedElement && !nextSelectedElement.selectable) {\n nextSelectedElement = nextSelectedElement.traversePreviousTreeElement(!this.expandTreeElementsWhenArrowing);\n }\n if (!nextSelectedElement) {\n return false;\n }\n nextSelectedElement.select(false, true);\n return true;\n }\n\n selectNext(): boolean {\n let nextSelectedElement: (TreeElement|null) =\n this.selectedTreeElement && this.selectedTreeElement.traverseNextTreeElement(true);\n while (nextSelectedElement && !nextSelectedElement.selectable) {\n nextSelectedElement = nextSelectedElement.traverseNextTreeElement(!this.expandTreeElementsWhenArrowing);\n }\n if (!nextSelectedElement) {\n return false;\n }\n nextSelectedElement.select(false, true);\n return true;\n }\n\n forceSelect(omitFocus: boolean|undefined = false, selectedByUser: boolean|undefined = true): void {\n if (this.selectedTreeElement) {\n this.selectedTreeElement.deselect();\n }\n this.selectFirst(omitFocus, selectedByUser);\n }\n\n private selectFirst(omitFocus: boolean|undefined = false, selectedByUser: boolean|undefined = true): boolean {\n let first = this.firstChild();\n while (first && !first.selectable) {\n first = first.traverseNextTreeElement(true);\n }\n if (!first) {\n return false;\n }\n first.select(omitFocus, selectedByUser);\n return true;\n }\n\n private selectLast(): boolean {\n let last = this.lastDescendent();\n while (last && !last.selectable) {\n last = last.traversePreviousTreeElement(true);\n }\n if (!last) {\n return false;\n }\n last.select(false, true);\n return true;\n }\n\n private treeKeyDown(event: KeyboardEvent): void {\n if (event.shiftKey || event.metaKey || event.ctrlKey || isEditing()) {\n return;\n }\n\n let handled = false;\n if (!this.selectedTreeElement) {\n if (event.key === 'ArrowUp' && !event.altKey) {\n handled = this.selectLast();\n } else if (event.key === 'ArrowDown' && !event.altKey) {\n handled = this.selectFirst();\n }\n } else if (event.key === 'ArrowUp' && !event.altKey) {\n handled = this.selectPrevious();\n } else if (event.key === 'ArrowDown' && !event.altKey) {\n handled = this.selectNext();\n } else if (event.key === 'ArrowLeft') {\n handled = this.selectedTreeElement.collapseOrAscend(event.altKey);\n } else if (event.key === 'ArrowRight') {\n if (!this.selectedTreeElement.revealed()) {\n this.selectedTreeElement.reveal();\n handled = true;\n } else {\n handled = this.selectedTreeElement.descendOrExpand(event.altKey);\n }\n } else if (event.keyCode === 8 /* Backspace */ || event.keyCode === 46 /* Delete */) {\n handled = this.selectedTreeElement.ondelete();\n } else if (event.key === 'Enter') {\n handled = this.selectedTreeElement.onenter();\n } else if (event.keyCode === Keys.Space.code) {\n handled = this.selectedTreeElement.onspace();\n } else if (event.key === 'Home') {\n handled = this.selectFirst();\n } else if (event.key === 'End') {\n handled = this.selectLast();\n }\n\n if (handled) {\n event.consume(true);\n }\n }\n\n deferredScrollIntoView(treeElement: TreeElement, center: boolean): void {\n const deferredScrollIntoView = (): void => {\n if (!this.treeElementToScrollIntoView) {\n return;\n }\n\n // This function doesn't use scrollIntoViewIfNeeded because it always\n // scrolls in both directions even if only one is necessary to bring the\n // item into view.\n const itemRect = this.treeElementToScrollIntoView.listItemElement.getBoundingClientRect();\n const treeRect = this.contentElement.getBoundingClientRect();\n\n // Usually, this.element is the tree container that scrolls. But sometimes\n // (i.e. in the Elements panel), its parent is.\n let scrollParentElement: Element = this.element;\n while (getComputedStyle(scrollParentElement).overflow === 'visible' &&\n scrollParentElement.parentElementOrShadowHost()) {\n const parent = scrollParentElement.parentElementOrShadowHost();\n Platform.assertNotNullOrUndefined(parent);\n scrollParentElement = parent;\n }\n\n const viewRect = scrollParentElement.getBoundingClientRect();\n\n const currentScrollX = viewRect.left - treeRect.left;\n const currentScrollY = viewRect.top - treeRect.top + this.contentElement.offsetTop;\n\n // Only scroll into view on each axis if the item is not visible at all\n // but if we do scroll and centerUponScrollIntoView is true\n // then we center the top left corner of the item in view.\n let deltaLeft: number = itemRect.left - treeRect.left;\n if (deltaLeft > currentScrollX && deltaLeft < currentScrollX + viewRect.width) {\n deltaLeft = currentScrollX;\n } else if (this.centerUponScrollIntoView) {\n deltaLeft = deltaLeft - viewRect.width / 2;\n }\n let deltaTop: number = itemRect.top - treeRect.top;\n if (deltaTop > currentScrollY && deltaTop < currentScrollY + viewRect.height) {\n deltaTop = currentScrollY;\n } else if (this.centerUponScrollIntoView) {\n deltaTop = deltaTop - viewRect.height / 2;\n }\n scrollParentElement.scrollTo(deltaLeft, deltaTop);\n this.treeElementToScrollIntoView = null;\n };\n\n if (!this.treeElementToScrollIntoView) {\n this.element.window().requestAnimationFrame(deferredScrollIntoView);\n }\n this.treeElementToScrollIntoView = treeElement;\n this.centerUponScrollIntoView = center;\n }\n\n onStartedEditingTitle(_treeElement: TreeElement): void {\n }\n}\n\nexport const enum TreeVariant {\n NAVIGATION_TREE = 'NavigationTree',\n OTHER = 'Other',\n}\n\nexport class TreeOutlineInShadow extends TreeOutline {\n override element: HTMLElement;\n shadowRoot: ShadowRoot;\n private readonly disclosureElement: Element;\n override renderSelection: boolean;\n constructor(variant: TreeVariant = TreeVariant.OTHER) {\n super();\n this.contentElement.classList.add('tree-outline');\n this.element = document.createElement('div');\n this.shadowRoot =\n createShadowRootWithCoreStyles(this.element, {cssFile: treeoutlineStyles, delegatesFocus: undefined});\n this.disclosureElement = this.shadowRoot.createChild('div', 'tree-outline-disclosure');\n this.disclosureElement.appendChild(this.contentElement);\n this.renderSelection = true;\n\n if (variant === TreeVariant.NAVIGATION_TREE) {\n this.contentElement.classList.add('tree-variant-navigation');\n }\n }\n\n registerRequiredCSS(cssFile: {cssContent: string}): void {\n ThemeSupport.ThemeSupport.instance().appendStyle(this.shadowRoot, cssFile);\n }\n\n registerCSSFiles(cssFiles: CSSStyleSheet[]): void {\n this.shadowRoot.adoptedStyleSheets = this.shadowRoot.adoptedStyleSheets.concat(cssFiles);\n }\n\n hideOverflow(): void {\n this.disclosureElement.classList.add('tree-outline-disclosure-hide-overflow');\n }\n\n makeDense(): void {\n this.contentElement.classList.add('tree-outline-dense');\n }\n\n override onStartedEditingTitle(treeElement: TreeElement): void {\n const selection = this.shadowRoot.getSelection();\n if (selection) {\n selection.selectAllChildren(treeElement.titleElement);\n }\n }\n}\n\nexport const treeElementBylistItemNode = new WeakMap();\nexport class TreeElement {\n treeOutline: TreeOutline|null;\n parent: TreeElement|null;\n previousSibling: TreeElement|null;\n nextSibling: TreeElement|null;\n private readonly boundOnFocus: () => void;\n private readonly boundOnBlur: () => void;\n readonly listItemNode: HTMLLIElement;\n titleElement: Node;\n titleInternal: string|Node;\n private childrenInternal: TreeElement[]|null;\n childrenListNode: HTMLOListElement;\n private expandLoggable = {};\n private hiddenInternal: boolean;\n private selectableInternal: boolean;\n expanded: boolean;\n selected: boolean;\n private expandable!: boolean;\n #expandRecursively: boolean = true;\n private collapsible: boolean;\n toggleOnClick: boolean;\n button: Buttons.Button.Button|null;\n root: boolean;\n private tooltipInternal: string;\n private leadingIconsElement: HTMLElement|null;\n private trailingIconsElement: HTMLElement|null;\n protected selectionElementInternal: HTMLElement|null;\n private disableSelectFocus: boolean;\n constructor(title?: string|Node, expandable?: boolean, jslogContext?: string|number) {\n this.treeOutline = null;\n this.parent = null;\n this.previousSibling = null;\n this.nextSibling = null;\n this.boundOnFocus = this.onFocus.bind(this);\n this.boundOnBlur = this.onBlur.bind(this);\n this.listItemNode = document.createElement('li');\n\n this.titleElement = this.listItemNode.createChild('span', 'tree-element-title');\n treeElementBylistItemNode.set(this.listItemNode, this);\n this.titleInternal = '';\n if (title) {\n this.title = title;\n }\n this.listItemNode.addEventListener('mousedown', (this.handleMouseDown.bind(this) as EventListener), false);\n this.listItemNode.addEventListener('click', (this.treeElementToggled.bind(this) as EventListener), false);\n this.listItemNode.addEventListener('dblclick', this.handleDoubleClick.bind(this), false);\n this.listItemNode.setAttribute(\n 'jslog', `${VisualLogging.treeItem().parent('parentTreeItem').context(jslogContext).track({\n click: true,\n keydown: 'ArrowUp|ArrowDown|ArrowLeft|ArrowRight|Backspace|Delete|Enter|Space|Home|End',\n })}`);\n ARIAUtils.markAsTreeitem(this.listItemNode);\n\n this.childrenInternal = null;\n this.childrenListNode = document.createElement('ol');\n nodeToParentTreeElementMap.set(this.childrenListNode, this);\n this.childrenListNode.classList.add('children');\n ARIAUtils.markAsGroup(this.childrenListNode);\n\n this.hiddenInternal = false;\n this.selectableInternal = true;\n this.expanded = false;\n this.selected = false;\n this.setExpandable(expandable || false);\n this.collapsible = true;\n this.toggleOnClick = false;\n this.button = null;\n this.root = false;\n this.tooltipInternal = '';\n this.leadingIconsElement = null;\n this.trailingIconsElement = null;\n this.selectionElementInternal = null;\n this.disableSelectFocus = false;\n }\n\n static getTreeElementBylistItemNode(node: Node): TreeElement|undefined {\n return treeElementBylistItemNode.get(node);\n }\n\n hasAncestor(ancestor: TreeElement|null): boolean {\n if (!ancestor) {\n return false;\n }\n\n let currentNode: (TreeElement|null) = this.parent;\n while (currentNode) {\n if (ancestor === currentNode) {\n return true;\n }\n currentNode = currentNode.parent;\n }\n\n return false;\n }\n\n hasAncestorOrSelf(ancestor: TreeElement|null): boolean {\n return this === ancestor || this.hasAncestor(ancestor);\n }\n\n isHidden(): boolean {\n if (this.hidden) {\n return true;\n }\n\n let currentNode: (TreeElement|null) = this.parent;\n while (currentNode) {\n if (currentNode.hidden) {\n return true;\n }\n currentNode = currentNode.parent;\n }\n\n return false;\n }\n\n children(): TreeElement[] {\n return this.childrenInternal || [];\n }\n\n childCount(): number {\n return this.childrenInternal ? this.childrenInternal.length : 0;\n }\n\n firstChild(): TreeElement|null {\n return this.childrenInternal ? this.childrenInternal[0] : null;\n }\n\n lastChild(): TreeElement|null {\n return this.childrenInternal ? this.childrenInternal[this.childrenInternal.length - 1] : null;\n }\n\n childAt(index: number): TreeElement|null {\n return this.childrenInternal ? this.childrenInternal[index] : null;\n }\n\n indexOfChild(child: TreeElement): number {\n return this.childrenInternal ? this.childrenInternal.indexOf(child) : -1;\n }\n\n appendChild(child: TreeElement, comparator?: ((arg0: TreeElement, arg1: TreeElement) => number)): void {\n if (!this.childrenInternal) {\n this.childrenInternal = [];\n }\n\n let insertionIndex;\n if (comparator) {\n insertionIndex = Platform.ArrayUtilities.lowerBound(this.childrenInternal, child, comparator);\n } else if (this.treeOutline && this.treeOutline.comparator) {\n insertionIndex = Platform.ArrayUtilities.lowerBound(this.childrenInternal, child, this.treeOutline.comparator);\n } else {\n insertionIndex = this.childrenInternal.length;\n }\n this.insertChild(child, insertionIndex);\n }\n\n insertChild(child: TreeElement, index: number): void {\n if (!this.childrenInternal) {\n this.childrenInternal = [];\n }\n\n if (!child) {\n throw 'child can\\'t be undefined or null';\n }\n\n console.assert(\n !child.parent, 'Attempting to insert a child that is already in the tree, reparenting is not supported.');\n\n const previousChild = (index > 0 ? this.childrenInternal[index - 1] : null);\n if (previousChild) {\n previousChild.nextSibling = child;\n child.previousSibling = previousChild;\n } else {\n child.previousSibling = null;\n }\n\n const nextChild = this.childrenInternal[index];\n if (nextChild) {\n nextChild.previousSibling = child;\n child.nextSibling = nextChild;\n } else {\n child.nextSibling = null;\n }\n\n this.childrenInternal.splice(index, 0, child);\n\n this.setExpandable(true);\n child.parent = this;\n\n if (this.treeOutline) {\n this.treeOutline.bindTreeElement(child);\n }\n for (let current = child.firstChild(); this.treeOutline && current;\n current = current.traverseNextTreeElement(false, child, true)) {\n this.treeOutline.bindTreeElement(current);\n }\n child.onattach();\n child.ensureSelection();\n if (this.treeOutline) {\n this.treeOutline.dispatchEventToListeners(Events.ElementAttached, child);\n }\n const nextSibling = child.nextSibling ? child.nextSibling.listItemNode : null;\n this.childrenListNode.insertBefore(child.listItemNode, nextSibling);\n this.childrenListNode.insertBefore(child.childrenListNode, nextSibling);\n if (child.selected) {\n child.select();\n }\n if (child.expanded) {\n child.expand();\n }\n }\n\n removeChildAtIndex(childIndex: number): void {\n if (!this.childrenInternal || childIndex < 0 || childIndex >= this.childrenInternal.length) {\n throw 'childIndex out of range';\n }\n\n const child = this.childrenInternal[childIndex];\n this.childrenInternal.splice(childIndex, 1);\n\n const parent = child.parent;\n if (this.treeOutline && this.treeOutline.selectedTreeElement &&\n this.treeOutline.selectedTreeElement.hasAncestorOrSelf(child)) {\n if (child.nextSibling) {\n child.nextSibling.select(true);\n } else if (child.previousSibling) {\n child.previousSibling.select(true);\n } else if (parent) {\n parent.select(true);\n }\n }\n\n if (child.previousSibling) {\n child.previousSibling.nextSibling = child.nextSibling;\n }\n if (child.nextSibling) {\n child.nextSibling.previousSibling = child.previousSibling;\n }\n child.parent = null;\n\n if (this.treeOutline) {\n this.treeOutline.unbindTreeElement(child);\n }\n for (let current = child.firstChild(); this.treeOutline && current;\n current = current.traverseNextTreeElement(false, child, true)) {\n this.treeOutline.unbindTreeElement(current);\n }\n\n child.detach();\n if (this.treeOutline) {\n this.treeOutline.dispatchEventToListeners(Events.ElementsDetached);\n }\n }\n\n removeChild(child: TreeElement): void {\n if (!child) {\n throw 'child can\\'t be undefined or null';\n }\n if (child.parent !== this) {\n return;\n }\n\n const childIndex = this.childrenInternal ? this.childrenInternal.indexOf(child) : -1;\n if (childIndex === -1) {\n throw 'child not found in this node\\'s children';\n }\n\n this.removeChildAtIndex(childIndex);\n }\n\n removeChildren(): void {\n if (!this.root && this.treeOutline && this.treeOutline.selectedTreeElement &&\n this.treeOutline.selectedTreeElement.hasAncestorOrSelf(this)) {\n this.select(true);\n }\n\n if (this.childrenInternal) {\n for (const child of this.childrenInternal) {\n child.previousSibling = null;\n child.nextSibling = null;\n child.parent = null;\n\n if (this.treeOutline) {\n this.treeOutline.unbindTreeElement(child);\n }\n for (let current = child.firstChild(); this.treeOutline && current;\n current = current.traverseNextTreeElement(false, child, true)) {\n this.treeOutline.unbindTreeElement(current);\n }\n child.detach();\n }\n }\n this.childrenInternal = [];\n if (this.treeOutline) {\n this.treeOutline.dispatchEventToListeners(Events.ElementsDetached);\n }\n }\n\n get selectable(): boolean {\n if (this.isHidden()) {\n return false;\n }\n return this.selectableInternal;\n }\n\n set selectable(x: boolean) {\n this.selectableInternal = x;\n }\n\n get listItemElement(): HTMLLIElement {\n return this.listItemNode;\n }\n\n get childrenListElement(): HTMLOListElement {\n return this.childrenListNode;\n }\n\n get title(): string|Node {\n return this.titleInternal;\n }\n\n set title(x: string|Node) {\n if (this.titleInternal === x) {\n return;\n }\n this.titleInternal = x;\n\n if (typeof x === 'string') {\n this.titleElement.textContent = x;\n this.tooltip = x;\n } else {\n this.titleElement = x;\n this.tooltip = '';\n }\n\n this.listItemNode.removeChildren();\n if (this.leadingIconsElement) {\n this.listItemNode.appendChild(this.leadingIconsElement);\n }\n this.listItemNode.appendChild(this.titleElement);\n if (this.trailingIconsElement) {\n this.listItemNode.appendChild(this.trailingIconsElement);\n }\n this.ensureSelection();\n }\n\n titleAsText(): string {\n if (!this.titleInternal) {\n return '';\n }\n if (typeof this.titleInternal === 'string') {\n return this.titleInternal;\n }\n return this.titleInternal.textContent || '';\n }\n\n startEditingTitle(editingConfig: Config): void {\n InplaceEditor.startEditing((this.titleElement as Element), editingConfig);\n if (this.treeOutline) {\n this.treeOutline.onStartedEditingTitle(this);\n }\n }\n\n setLeadingIcons(icons: IconButton.Icon.Icon[]|IconButton.FileSourceIcon.FileSourceIcon[]): void {\n if (!this.leadingIconsElement && !icons.length) {\n return;\n }\n if (!this.leadingIconsElement) {\n this.leadingIconsElement = document.createElement('div');\n this.leadingIconsElement.classList.add('leading-icons');\n this.leadingIconsElement.classList.add('icons-container');\n this.listItemNode.insertBefore(this.leadingIconsElement, this.titleElement);\n this.ensureSelection();\n }\n this.leadingIconsElement.removeChildren();\n for (const icon of icons) {\n this.leadingIconsElement.appendChild(icon);\n }\n }\n\n setTrailingIcons(icons: IconButton.Icon.Icon[]): void {\n if (!this.trailingIconsElement && !icons.length) {\n return;\n }\n if (!this.trailingIconsElement) {\n this.trailingIconsElement = document.createElement('div');\n this.trailingIconsElement.classList.add('trailing-icons');\n this.trailingIconsElement.classList.add('icons-container');\n this.listItemNode.appendChild(this.trailingIconsElement);\n this.ensureSelection();\n }\n this.trailingIconsElement.removeChildren();\n for (const icon of icons) {\n this.trailingIconsElement.appendChild(icon);\n }\n }\n\n get tooltip(): string {\n return this.tooltipInternal;\n }\n\n set tooltip(x: string) {\n if (this.tooltipInternal === x) {\n return;\n }\n this.tooltipInternal = x;\n Tooltip.install(this.listItemNode, x);\n }\n\n isExpandable(): boolean {\n return this.expandable;\n }\n\n setExpandable(expandable: boolean): void {\n if (this.expandable === expandable) {\n return;\n }\n\n this.expandable = expandable;\n\n this.listItemNode.classList.toggle('parent', expandable);\n if (!expandable) {\n this.collapse();\n ARIAUtils.unsetExpandable(this.listItemNode);\n } else {\n VisualLogging.registerLoggable(this.expandLoggable, `${VisualLogging.expand()}`, this.listItemNode);\n ARIAUtils.setExpanded(this.listItemNode, false);\n }\n }\n\n isExpandRecursively(): boolean {\n return this.#expandRecursively;\n }\n\n setExpandRecursively(expandRecursively: boolean): void {\n this.#expandRecursively = expandRecursively;\n }\n\n isCollapsible(): boolean {\n return this.collapsible;\n }\n\n setCollapsible(collapsible: boolean): void {\n if (this.collapsible === collapsible) {\n return;\n }\n\n this.collapsible = collapsible;\n\n this.listItemNode.classList.toggle('always-parent', !collapsible);\n if (!collapsible) {\n this.expand();\n }\n }\n\n get hidden(): boolean {\n return this.hiddenInternal;\n }\n\n set hidden(x: boolean) {\n if (this.hiddenInternal === x) {\n return;\n }\n\n this.hiddenInternal = x;\n\n this.listItemNode.classList.toggle('hidden', x);\n this.childrenListNode.classList.toggle('hidden', x);\n\n if (x && this.treeOutline && this.treeOutline.selectedTreeElement &&\n this.treeOutline.selectedTreeElement.hasAncestorOrSelf(this)) {\n const hadFocus = this.treeOutline.selectedTreeElement.listItemElement.hasFocus();\n this.treeOutline.forceSelect(!hadFocus, /* selectedByUser */ false);\n }\n }\n\n invalidateChildren(): void {\n if (this.childrenInternal) {\n this.removeChildren();\n this.childrenInternal = null;\n }\n }\n\n private ensureSelection(): void {\n if (!this.treeOutline || !this.treeOutline.renderSelection) {\n return;\n }\n if (!this.selectionElementInternal) {\n this.selectionElementInternal = document.createElement('div');\n this.selectionElementInternal.classList.add('selection');\n this.selectionElementInternal.classList.add('fill');\n }\n this.listItemNode.insertBefore(this.selectionElementInternal, this.listItemElement.firstChild);\n }\n\n private treeElementToggled(event: MouseEvent): void {\n const element = (event.currentTarget as Node | null);\n if (!element || treeElementBylistItemNode.get(element) !== this || element.hasSelection()) {\n return;\n }\n\n console.assert(Boolean(this.treeOutline));\n const showSelectionOnKeyboardFocus = this.treeOutline ? this.treeOutline.showSelectionOnKeyboardFocus : false;\n const toggleOnClick = this.toggleOnClick && (showSelectionOnKeyboardFocus || !this.selectable);\n const isInTriangle = this.isEventWithinDisclosureTriangle(event);\n if (!toggleOnClick && !isInTriangle) {\n return;\n }\n\n if (this.expanded) {\n if (event.altKey) {\n this.collapseRecursively();\n } else {\n this.collapse();\n }\n } else {\n if (event.altKey) {\n void this.expandRecursively();\n } else {\n this.expand();\n }\n }\n void VisualLogging.logClick(this.expandLoggable, event);\n event.consume();\n }\n\n private handleMouseDown(event: MouseEvent): void {\n const element = (event.currentTarget as Node | null);\n if (!element) {\n return;\n }\n if (!this.selectable) {\n return;\n }\n if (treeElementBylistItemNode.get(element) !== this) {\n return;\n }\n\n if (this.isEventWithinDisclosureTriangle(event)) {\n return;\n }\n\n this.selectOnMouseDown(event);\n }\n\n private handleDoubleClick(event: Event): void {\n const element = (event.currentTarget as Node | null);\n if (!element || treeElementBylistItemNode.get(element) !== this) {\n return;\n }\n\n const handled = this.ondblclick(event);\n if (handled) {\n return;\n }\n if (this.expandable && !this.expanded) {\n this.expand();\n }\n }\n\n private detach(): void {\n this.listItemNode.remove();\n this.childrenListNode.remove();\n }\n\n collapse(): void {\n if (!this.expanded || !this.collapsible) {\n return;\n }\n this.listItemNode.classList.remove('expanded');\n this.childrenListNode.classList.remove('expanded');\n ARIAUtils.setExpanded(this.listItemNode, false);\n this.expanded = false;\n this.oncollapse();\n if (this.treeOutline) {\n this.treeOutline.dispatchEventToListeners(Events.ElementCollapsed, this);\n }\n\n const selectedTreeElement = this.treeOutline && this.treeOutline.selectedTreeElement;\n if (selectedTreeElement && selectedTreeElement.hasAncestor(this)) {\n this.select(/* omitFocus */ true, /* selectedByUser */ true);\n }\n }\n\n collapseRecursively(): void {\n let item: (TreeElement|null)|this = this;\n while (item) {\n if (item.expanded) {\n item.collapse();\n }\n item = item.traverseNextTreeElement(false, this, true);\n }\n }\n\n collapseChildren(): void {\n if (!this.childrenInternal) {\n return;\n }\n for (const child of this.childrenInternal) {\n child.collapseRecursively();\n }\n }\n\n expand(): void {\n if (!this.expandable || (this.expanded && this.childrenInternal)) {\n return;\n }\n\n // Set this before onpopulate. Since onpopulate can add elements, this makes\n // sure the expanded flag is true before calling those functions. This prevents the possibility\n // of an infinite loop if onpopulate were to call expand.\n\n this.expanded = true;\n\n void this.populateIfNeeded();\n this.listItemNode.classList.add('expanded');\n this.childrenListNode.classList.add('expanded');\n ARIAUtils.setExpanded(this.listItemNode, true);\n\n if (this.treeOutline) {\n this.onexpand();\n this.treeOutline.dispatchEventToListeners(Events.ElementExpanded, this);\n }\n }\n\n async expandRecursively(maxDepth?: number): Promise {\n let item: (TreeElement|null)|this = this;\n const info = {depthChange: 0};\n let depth = 0;\n\n // The Inspector uses TreeOutlines to represents object properties, so recursive expansion\n // in some case can be infinite, since JavaScript objects can hold circular references.\n // So default to a recursion cap of 3 levels, since that gives fairly good results.\n if (maxDepth === undefined || isNaN(maxDepth)) {\n maxDepth = 3;\n }\n\n do {\n if (item.isExpandRecursively()) {\n await item.populateIfNeeded();\n\n if (depth < maxDepth) {\n item.expand();\n }\n }\n item = item.traverseNextTreeElement(!item.isExpandRecursively(), this, true, info);\n depth += info.depthChange;\n } while (item !== null);\n }\n\n collapseOrAscend(altKey: boolean): boolean {\n if (this.expanded && this.collapsible) {\n if (altKey) {\n this.collapseRecursively();\n } else {\n this.collapse();\n }\n return true;\n }\n\n if (!this.parent || this.parent.root) {\n return false;\n }\n\n if (!this.parent.selectable) {\n this.parent.collapse();\n return true;\n }\n\n let nextSelectedElement: (TreeElement|null)|TreeElement = this.parent;\n while (nextSelectedElement && !nextSelectedElement.selectable) {\n nextSelectedElement = nextSelectedElement.parent;\n }\n\n if (!nextSelectedElement) {\n return false;\n }\n nextSelectedElement.select(false, true);\n return true;\n }\n\n descendOrExpand(altKey: boolean): boolean {\n if (!this.expandable) {\n return false;\n }\n\n if (!this.expanded) {\n if (altKey) {\n void this.expandRecursively();\n } else {\n this.expand();\n }\n return true;\n }\n\n let nextSelectedElement = this.firstChild();\n while (nextSelectedElement && !nextSelectedElement.selectable) {\n nextSelectedElement = nextSelectedElement.nextSibling;\n }\n\n if (!nextSelectedElement) {\n return false;\n }\n nextSelectedElement.select(false, true);\n return true;\n }\n\n reveal(center?: boolean): void {\n let currentAncestor: (TreeElement|null) = this.parent;\n while (currentAncestor && !currentAncestor.root) {\n if (!currentAncestor.expanded) {\n currentAncestor.expand();\n }\n currentAncestor = currentAncestor.parent;\n }\n\n if (this.treeOutline) {\n this.treeOutline.deferredScrollIntoView(this, Boolean(center));\n }\n }\n\n revealed(): boolean {\n let currentAncestor: (TreeElement|null) = this.parent;\n while (currentAncestor && !currentAncestor.root) {\n if (!currentAncestor.expanded) {\n return false;\n }\n currentAncestor = currentAncestor.parent;\n }\n\n return true;\n }\n\n selectOnMouseDown(event: MouseEvent): void {\n if (this.select(false, true)) {\n event.consume(true);\n }\n\n if (this.listItemNode.draggable && this.selectionElementInternal && this.treeOutline) {\n const marginLeft = this.treeOutline.element.getBoundingClientRect().left -\n this.listItemNode.getBoundingClientRect().left - this.treeOutline.element.scrollLeft;\n // By default the left margin extends far off screen. This is not a problem except when dragging an element.\n // Setting the margin once here should be fine, because we believe the left margin should never change.\n this.selectionElementInternal.style.setProperty('margin-left', marginLeft + 'px');\n }\n }\n\n select(omitFocus?: boolean, selectedByUser?: boolean): boolean {\n omitFocus = omitFocus || this.disableSelectFocus;\n if (!this.treeOutline || !this.selectable || this.selected) {\n if (!omitFocus) {\n this.listItemElement.focus();\n }\n return false;\n }\n // Wait to deselect this element so that focus only changes once\n const lastSelected = this.treeOutline.selectedTreeElement;\n this.treeOutline.selectedTreeElement = null;\n\n if (this.treeOutline.rootElementInternal === this) {\n if (lastSelected) {\n lastSelected.deselect();\n }\n if (!omitFocus) {\n this.listItemElement.focus();\n }\n return false;\n }\n\n this.selected = true;\n\n this.treeOutline.selectedTreeElement = this;\n this.treeOutline.updateFocusable();\n if (!omitFocus || this.treeOutline.contentElement.hasFocus()) {\n this.listItemElement.focus();\n }\n\n this.listItemNode.classList.add('selected');\n ARIAUtils.setSelected(this.listItemNode, true);\n this.treeOutline.dispatchEventToListeners(Events.ElementSelected, this);\n if (lastSelected) {\n lastSelected.deselect();\n }\n return this.onselect(selectedByUser);\n }\n\n setFocusable(focusable: boolean): void {\n if (focusable) {\n this.listItemNode.setAttribute('tabIndex', (this.treeOutline && this.treeOutline.preventTabOrder) ? '-1' : '0');\n this.listItemNode.addEventListener('focus', this.boundOnFocus, false);\n this.listItemNode.addEventListener('blur', this.boundOnBlur, false);\n } else {\n this.listItemNode.removeAttribute('tabIndex');\n this.listItemNode.removeEventListener('focus', this.boundOnFocus, false);\n this.listItemNode.removeEventListener('blur', this.boundOnBlur, false);\n }\n }\n\n private onFocus(): void {\n if (!this.treeOutline || this.treeOutline.getUseLightSelectionColor()) {\n return;\n }\n if (!this.treeOutline.contentElement.classList.contains('hide-selection-when-blurred')) {\n this.listItemNode.classList.add('force-white-icons');\n }\n }\n\n private onBlur(): void {\n if (!this.treeOutline || this.treeOutline.getUseLightSelectionColor()) {\n return;\n }\n if (!this.treeOutline.contentElement.classList.contains('hide-selection-when-blurred')) {\n this.listItemNode.classList.remove('force-white-icons');\n }\n }\n\n revealAndSelect(omitFocus?: boolean): void {\n this.reveal(true);\n this.select(omitFocus);\n }\n\n deselect(): void {\n const hadFocus = this.listItemNode.hasFocus();\n this.selected = false;\n this.listItemNode.classList.remove('selected');\n ARIAUtils.clearSelected(this.listItemNode);\n this.setFocusable(false);\n\n if (this.treeOutline && this.treeOutline.selectedTreeElement === this) {\n this.treeOutline.selectedTreeElement = null;\n this.treeOutline.updateFocusable();\n if (hadFocus) {\n this.treeOutline.focus();\n }\n }\n }\n\n private async populateIfNeeded(): Promise {\n if (this.treeOutline && this.expandable && !this.childrenInternal) {\n this.childrenInternal = [];\n await this.onpopulate();\n }\n }\n\n async onpopulate(): Promise {\n // Overridden by subclasses.\n }\n\n onenter(): boolean {\n if (this.expandable && !this.expanded) {\n this.expand();\n return true;\n }\n if (this.collapsible && this.expanded) {\n this.collapse();\n return true;\n }\n return false;\n }\n\n ondelete(): boolean {\n return false;\n }\n\n onspace(): boolean {\n return false;\n }\n\n onbind(): void {\n }\n\n onunbind(): void {\n }\n\n onattach(): void {\n }\n\n onexpand(): void {\n }\n\n oncollapse(): void {\n }\n\n ondblclick(_e: Event): boolean {\n return false;\n }\n\n onselect(_selectedByUser?: boolean): boolean {\n return false;\n }\n\n traverseNextTreeElement(skipUnrevealed: boolean, stayWithin?: TreeElement|null, dontPopulate?: boolean, info?: {\n depthChange: number,\n }): TreeElement|null {\n if (!dontPopulate) {\n void this.populateIfNeeded();\n }\n\n if (info) {\n info.depthChange = 0;\n }\n\n let element: (TreeElement|null)|this =\n skipUnrevealed ? (this.revealed() ? this.firstChild() : null) : this.firstChild();\n if (element && (!skipUnrevealed || (skipUnrevealed && this.expanded))) {\n if (info) {\n info.depthChange = 1;\n }\n return element;\n }\n\n if (this === stayWithin) {\n return null;\n }\n\n element = skipUnrevealed ? (this.revealed() ? this.nextSibling : null) : this.nextSibling;\n if (element) {\n return element;\n }\n\n element = this;\n while (element && !element.root &&\n !(skipUnrevealed ? (element.revealed() ? element.nextSibling : null) : element.nextSibling) &&\n element.parent !== stayWithin) {\n if (info) {\n info.depthChange -= 1;\n }\n element = element.parent;\n }\n\n if (!element || element.root) {\n return null;\n }\n\n return (skipUnrevealed ? (element.revealed() ? element.nextSibling : null) : element.nextSibling);\n }\n\n traversePreviousTreeElement(skipUnrevealed: boolean, dontPopulate?: boolean): TreeElement|null {\n let element: (TreeElement|null) =\n skipUnrevealed ? (this.revealed() ? this.previousSibling : null) : this.previousSibling;\n if (!dontPopulate && element) {\n void element.populateIfNeeded();\n }\n\n while (element &&\n (skipUnrevealed ? (element.revealed() && element.expanded ? element.lastChild() : null) :\n element.lastChild())) {\n if (!dontPopulate) {\n void element.populateIfNeeded();\n }\n element =\n (skipUnrevealed ? (element.revealed() && element.expanded ? element.lastChild() : null) :\n element.lastChild());\n }\n\n if (element) {\n return element;\n }\n\n if (!this.parent || this.parent.root) {\n return null;\n }\n\n return this.parent;\n }\n\n isEventWithinDisclosureTriangle(event: MouseEvent): boolean {\n const arrowToggleWidth = 10;\n // FIXME: We should not use getComputedStyle(). For that we need to get rid of using ::before for disclosure triangle. (http://webk.it/74446)\n const paddingLeftValue = window.getComputedStyle(this.listItemNode).paddingLeft;\n console.assert(paddingLeftValue.endsWith('px'));\n const computedLeftPadding = parseFloat(paddingLeftValue);\n const left = this.listItemNode.getBoundingClientRect().left + computedLeftPadding;\n return event.pageX >= left && event.pageX <= left + arrowToggleWidth && this.expandable;\n }\n\n setDisableSelectFocus(toggle: boolean): void {\n this.disableSelectFocus = toggle;\n }\n}\n\nfunction loggingParentProvider(e: Element): Element|undefined {\n const treeElement = TreeElement.getTreeElementBylistItemNode(e);\n const parentElement = treeElement?.parent?.listItemElement;\n return parentElement?.isConnected && parentElement || treeElement?.treeOutline?.contentElement;\n}\n\nVisualLogging.registerParentProvider('parentTreeItem', loggingParentProvider);\n"]} \ No newline at end of file +{"version":3,"file":"Treeoutline.js","sourceRoot":"","sources":["../../../../../../front_end/ui/legacy/Treeoutline.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,yEAAyE;AACzE,6BAA6B;AAE7B;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,KAAK,MAAM,MAAM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C,MAAe;QACnC,IAAI,CAAC,kBAAkB,GAAG,MAAM,CAAC;IACnC,CAAC;CACF;AAED,SAAS,qBAAqB,CAAC,CAAU;IACvC,MAAM,WAAW,GAAG,WAAW,CAAC,4BAA4B,CAAC,CAAC,CAAC,CAAC;IAChE,MAAM,aAAa,GAAG,WAAW,EAAE,MAAM,EAAE,eAAe,CAAC;IAC3D,OAAO,aAAa,EAAE,WAAW,IAAI,aAAa,IAAI,WAAW,EAAE,WAAW,EAAE,cAAc,CAAC;AACjG,CAAC;AAED,aAAa,CAAC,sBAAsB,CAAC,gBAAgB,EAAE,qBAAqB,CAAC,CAAC","sourcesContent":["// Copyright 2021 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\n/*\n * Copyright (C) 2007 Apple Inc. All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n *\n * 1. Redistributions of source code must retain the above copyright\n * notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n * notice, this list of conditions and the following disclaimer in the\n * documentation and/or other materials provided with the distribution.\n * 3. Neither the name of Apple Computer, Inc. (\"Apple\") nor the names of\n * its contributors may be used to endorse or promote products derived\n * from this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nimport * as Common from '../../core/common/common.js';\nimport * as Platform from '../../core/platform/platform.js';\nimport type * as Buttons from '../components/buttons/buttons.js';\nimport type * as IconButton from '../components/icon_button/icon_button.js';\nimport * as VisualLogging from '../visual_logging/visual_logging.js';\n\nimport * as ARIAUtils from './ARIAUtils.js';\nimport {type Config, InplaceEditor} from './InplaceEditor.js';\nimport {Keys} from './KeyboardShortcut.js';\nimport * as ThemeSupport from './theme_support/theme_support.js';\nimport {Tooltip} from './Tooltip.js';\nimport treeoutlineStyles from './treeoutline.css.legacy.js';\nimport {\n createShadowRootWithCoreStyles,\n deepElementFromPoint,\n enclosingNodeOrSelfWithNodeNameInArray,\n isEditing,\n} from './UIUtils.js';\n\nconst nodeToParentTreeElementMap = new WeakMap();\n\nexport enum Events {\n /* eslint-disable @typescript-eslint/naming-convention -- Used by web_tests. */\n ElementAttached = 'ElementAttached',\n ElementsDetached = 'ElementsDetached',\n ElementExpanded = 'ElementExpanded',\n ElementCollapsed = 'ElementCollapsed',\n ElementSelected = 'ElementSelected',\n /* eslint-enable @typescript-eslint/naming-convention */\n}\n\nexport type EventTypes = {\n [Events.ElementAttached]: TreeElement,\n [Events.ElementsDetached]: void,\n [Events.ElementExpanded]: TreeElement,\n [Events.ElementCollapsed]: TreeElement,\n [Events.ElementSelected]: TreeElement,\n};\n\nexport class TreeOutline extends Common.ObjectWrapper.ObjectWrapper {\n readonly rootElementInternal: TreeElement;\n renderSelection: boolean;\n selectedTreeElement: TreeElement|null;\n expandTreeElementsWhenArrowing: boolean;\n comparator: ((arg0: TreeElement, arg1: TreeElement) => number)|null;\n contentElement: HTMLOListElement;\n preventTabOrder: boolean;\n showSelectionOnKeyboardFocus: boolean;\n private focusable: boolean;\n element: HTMLElement;\n private useLightSelectionColor: boolean;\n private treeElementToScrollIntoView: TreeElement|null;\n private centerUponScrollIntoView: boolean;\n\n constructor() {\n super();\n this.rootElementInternal = this.createRootElement();\n this.renderSelection = false;\n\n this.selectedTreeElement = null;\n this.expandTreeElementsWhenArrowing = false;\n this.comparator = null;\n\n this.contentElement = this.rootElementInternal.childrenListNode;\n this.contentElement.addEventListener('keydown', this.treeKeyDown.bind(this), false);\n\n this.preventTabOrder = false;\n this.showSelectionOnKeyboardFocus = false;\n this.focusable = true;\n this.setFocusable(true);\n this.element = this.contentElement;\n this.element.setAttribute('jslog', `${VisualLogging.tree()}`);\n ARIAUtils.markAsTree(this.element);\n this.useLightSelectionColor = false;\n this.treeElementToScrollIntoView = null;\n this.centerUponScrollIntoView = false;\n }\n\n setShowSelectionOnKeyboardFocus(show: boolean, preventTabOrder?: boolean): void {\n this.contentElement.classList.toggle('hide-selection-when-blurred', show);\n this.preventTabOrder = Boolean(preventTabOrder);\n if (this.focusable) {\n this.contentElement.tabIndex = Boolean(preventTabOrder) ? -1 : 0;\n }\n this.showSelectionOnKeyboardFocus = show;\n }\n\n private createRootElement(): TreeElement {\n const rootElement = new TreeElement();\n rootElement.treeOutline = this;\n rootElement.root = true;\n rootElement.selectable = false;\n rootElement.expanded = true;\n rootElement.childrenListNode.classList.remove('children');\n return rootElement;\n }\n\n rootElement(): TreeElement {\n return this.rootElementInternal;\n }\n\n firstChild(): TreeElement|null {\n return this.rootElementInternal.firstChild();\n }\n\n private lastDescendent(): TreeElement|null {\n let last = this.rootElementInternal.lastChild();\n while (last && last.expanded && last.childCount()) {\n last = last.lastChild();\n }\n return last;\n }\n\n appendChild(child: TreeElement, comparator?: ((arg0: TreeElement, arg1: TreeElement) => number)): void {\n this.rootElementInternal.appendChild(child, comparator);\n }\n\n insertChild(child: TreeElement, index: number): void {\n this.rootElementInternal.insertChild(child, index);\n }\n\n removeChild(child: TreeElement): void {\n this.rootElementInternal.removeChild(child);\n }\n\n removeChildren(): void {\n this.rootElementInternal.removeChildren();\n }\n\n treeElementFromPoint(x: number, y: number): TreeElement|null {\n const node = deepElementFromPoint(this.contentElement.ownerDocument, x, y);\n if (!node) {\n return null;\n }\n\n const listNode = enclosingNodeOrSelfWithNodeNameInArray(node, ['ol', 'li']);\n if (listNode) {\n return nodeToParentTreeElementMap.get(listNode) || treeElementBylistItemNode.get(listNode) || null;\n }\n return null;\n }\n\n treeElementFromEvent(event: MouseEvent|null): TreeElement|null {\n return event ? this.treeElementFromPoint(event.pageX, event.pageY) : null;\n }\n\n setComparator(comparator: ((arg0: TreeElement, arg1: TreeElement) => number)|null): void {\n this.comparator = comparator;\n }\n\n setFocusable(focusable: boolean): void {\n this.focusable = focusable;\n this.updateFocusable();\n }\n\n updateFocusable(): void {\n if (this.focusable) {\n this.contentElement.tabIndex = (this.preventTabOrder || Boolean(this.selectedTreeElement)) ? -1 : 0;\n if (this.selectedTreeElement) {\n this.selectedTreeElement.setFocusable(true);\n }\n } else {\n this.contentElement.removeAttribute('tabIndex');\n if (this.selectedTreeElement) {\n this.selectedTreeElement.setFocusable(false);\n }\n }\n }\n\n focus(): void {\n if (this.selectedTreeElement) {\n this.selectedTreeElement.listItemElement.focus();\n } else {\n this.contentElement.focus();\n }\n }\n\n setUseLightSelectionColor(flag: boolean): void {\n this.useLightSelectionColor = flag;\n }\n\n getUseLightSelectionColor(): boolean {\n return this.useLightSelectionColor;\n }\n\n bindTreeElement(element: TreeElement): void {\n if (element.treeOutline) {\n console.error('Binding element for the second time: ' + new Error().stack);\n }\n element.treeOutline = this;\n element.onbind();\n }\n\n unbindTreeElement(element: TreeElement): void {\n if (!element.treeOutline) {\n console.error('Unbinding element that was not bound: ' + new Error().stack);\n }\n\n element.deselect();\n element.onunbind();\n element.treeOutline = null;\n }\n\n selectPrevious(): boolean {\n let nextSelectedElement: (TreeElement|null) =\n this.selectedTreeElement && this.selectedTreeElement.traversePreviousTreeElement(true);\n while (nextSelectedElement && !nextSelectedElement.selectable) {\n nextSelectedElement = nextSelectedElement.traversePreviousTreeElement(!this.expandTreeElementsWhenArrowing);\n }\n if (!nextSelectedElement) {\n return false;\n }\n nextSelectedElement.select(false, true);\n return true;\n }\n\n selectNext(): boolean {\n let nextSelectedElement: (TreeElement|null) =\n this.selectedTreeElement && this.selectedTreeElement.traverseNextTreeElement(true);\n while (nextSelectedElement && !nextSelectedElement.selectable) {\n nextSelectedElement = nextSelectedElement.traverseNextTreeElement(!this.expandTreeElementsWhenArrowing);\n }\n if (!nextSelectedElement) {\n return false;\n }\n nextSelectedElement.select(false, true);\n return true;\n }\n\n forceSelect(omitFocus: boolean|undefined = false, selectedByUser: boolean|undefined = true): void {\n if (this.selectedTreeElement) {\n this.selectedTreeElement.deselect();\n }\n this.selectFirst(omitFocus, selectedByUser);\n }\n\n private selectFirst(omitFocus: boolean|undefined = false, selectedByUser: boolean|undefined = true): boolean {\n let first = this.firstChild();\n while (first && !first.selectable) {\n first = first.traverseNextTreeElement(true);\n }\n if (!first) {\n return false;\n }\n first.select(omitFocus, selectedByUser);\n return true;\n }\n\n private selectLast(): boolean {\n let last = this.lastDescendent();\n while (last && !last.selectable) {\n last = last.traversePreviousTreeElement(true);\n }\n if (!last) {\n return false;\n }\n last.select(false, true);\n return true;\n }\n\n private treeKeyDown(event: KeyboardEvent): void {\n if (event.shiftKey || event.metaKey || event.ctrlKey || isEditing()) {\n return;\n }\n\n let handled = false;\n if (!this.selectedTreeElement) {\n if (event.key === 'ArrowUp' && !event.altKey) {\n handled = this.selectLast();\n } else if (event.key === 'ArrowDown' && !event.altKey) {\n handled = this.selectFirst();\n }\n } else if (event.key === 'ArrowUp' && !event.altKey) {\n handled = this.selectPrevious();\n } else if (event.key === 'ArrowDown' && !event.altKey) {\n handled = this.selectNext();\n } else if (event.key === 'ArrowLeft') {\n handled = this.selectedTreeElement.collapseOrAscend(event.altKey);\n } else if (event.key === 'ArrowRight') {\n if (!this.selectedTreeElement.revealed()) {\n this.selectedTreeElement.reveal();\n handled = true;\n } else {\n handled = this.selectedTreeElement.descendOrExpand(event.altKey);\n }\n } else if (event.keyCode === 8 /* Backspace */ || event.keyCode === 46 /* Delete */) {\n handled = this.selectedTreeElement.ondelete();\n } else if (event.key === 'Enter') {\n handled = this.selectedTreeElement.onenter();\n } else if (event.keyCode === Keys.Space.code) {\n handled = this.selectedTreeElement.onspace();\n } else if (event.key === 'Home') {\n handled = this.selectFirst();\n } else if (event.key === 'End') {\n handled = this.selectLast();\n }\n\n if (handled) {\n event.consume(true);\n }\n }\n\n deferredScrollIntoView(treeElement: TreeElement, center: boolean): void {\n const deferredScrollIntoView = (): void => {\n if (!this.treeElementToScrollIntoView) {\n return;\n }\n\n // This function doesn't use scrollIntoViewIfNeeded because it always\n // scrolls in both directions even if only one is necessary to bring the\n // item into view.\n const itemRect = this.treeElementToScrollIntoView.listItemElement.getBoundingClientRect();\n const treeRect = this.contentElement.getBoundingClientRect();\n\n // Usually, this.element is the tree container that scrolls. But sometimes\n // (i.e. in the Elements panel), its parent is.\n let scrollParentElement: Element = this.element;\n while (getComputedStyle(scrollParentElement).overflow === 'visible' &&\n scrollParentElement.parentElementOrShadowHost()) {\n const parent = scrollParentElement.parentElementOrShadowHost();\n Platform.assertNotNullOrUndefined(parent);\n scrollParentElement = parent;\n }\n\n const viewRect = scrollParentElement.getBoundingClientRect();\n\n const currentScrollX = viewRect.left - treeRect.left;\n const currentScrollY = viewRect.top - treeRect.top + this.contentElement.offsetTop;\n\n // Only scroll into view on each axis if the item is not visible at all\n // but if we do scroll and centerUponScrollIntoView is true\n // then we center the top left corner of the item in view.\n let deltaLeft: number = itemRect.left - treeRect.left;\n if (deltaLeft > currentScrollX && deltaLeft < currentScrollX + viewRect.width) {\n deltaLeft = currentScrollX;\n } else if (this.centerUponScrollIntoView) {\n deltaLeft = deltaLeft - viewRect.width / 2;\n }\n let deltaTop: number = itemRect.top - treeRect.top;\n if (deltaTop > currentScrollY && deltaTop < currentScrollY + viewRect.height) {\n deltaTop = currentScrollY;\n } else if (this.centerUponScrollIntoView) {\n deltaTop = deltaTop - viewRect.height / 2;\n }\n scrollParentElement.scrollTo(deltaLeft, deltaTop);\n this.treeElementToScrollIntoView = null;\n };\n\n if (!this.treeElementToScrollIntoView) {\n this.element.window().requestAnimationFrame(deferredScrollIntoView);\n }\n this.treeElementToScrollIntoView = treeElement;\n this.centerUponScrollIntoView = center;\n }\n\n onStartedEditingTitle(_treeElement: TreeElement): void {\n }\n}\n\nexport const enum TreeVariant {\n NAVIGATION_TREE = 'NavigationTree',\n OTHER = 'Other',\n}\n\nexport class TreeOutlineInShadow extends TreeOutline {\n override element: HTMLElement;\n shadowRoot: ShadowRoot;\n private readonly disclosureElement: Element;\n override renderSelection: boolean;\n constructor(variant: TreeVariant = TreeVariant.OTHER) {\n super();\n this.contentElement.classList.add('tree-outline');\n this.element = document.createElement('div');\n this.shadowRoot = createShadowRootWithCoreStyles(this.element, {cssFile: treeoutlineStyles});\n this.disclosureElement = this.shadowRoot.createChild('div', 'tree-outline-disclosure');\n this.disclosureElement.appendChild(this.contentElement);\n this.renderSelection = true;\n\n if (variant === TreeVariant.NAVIGATION_TREE) {\n this.contentElement.classList.add('tree-variant-navigation');\n }\n }\n\n registerRequiredCSS(cssFile: {cssContent: string}): void {\n ThemeSupport.ThemeSupport.instance().appendStyle(this.shadowRoot, cssFile);\n }\n\n registerCSSFiles(cssFiles: CSSStyleSheet[]): void {\n this.shadowRoot.adoptedStyleSheets = this.shadowRoot.adoptedStyleSheets.concat(cssFiles);\n }\n\n hideOverflow(): void {\n this.disclosureElement.classList.add('tree-outline-disclosure-hide-overflow');\n }\n\n makeDense(): void {\n this.contentElement.classList.add('tree-outline-dense');\n }\n\n override onStartedEditingTitle(treeElement: TreeElement): void {\n const selection = this.shadowRoot.getSelection();\n if (selection) {\n selection.selectAllChildren(treeElement.titleElement);\n }\n }\n}\n\nexport const treeElementBylistItemNode = new WeakMap();\nexport class TreeElement {\n treeOutline: TreeOutline|null;\n parent: TreeElement|null;\n previousSibling: TreeElement|null;\n nextSibling: TreeElement|null;\n private readonly boundOnFocus: () => void;\n private readonly boundOnBlur: () => void;\n readonly listItemNode: HTMLLIElement;\n titleElement: Node;\n titleInternal: string|Node;\n private childrenInternal: TreeElement[]|null;\n childrenListNode: HTMLOListElement;\n private expandLoggable = {};\n private hiddenInternal: boolean;\n private selectableInternal: boolean;\n expanded: boolean;\n selected: boolean;\n private expandable!: boolean;\n #expandRecursively: boolean = true;\n private collapsible: boolean;\n toggleOnClick: boolean;\n button: Buttons.Button.Button|null;\n root: boolean;\n private tooltipInternal: string;\n private leadingIconsElement: HTMLElement|null;\n private trailingIconsElement: HTMLElement|null;\n protected selectionElementInternal: HTMLElement|null;\n private disableSelectFocus: boolean;\n constructor(title?: string|Node, expandable?: boolean, jslogContext?: string|number) {\n this.treeOutline = null;\n this.parent = null;\n this.previousSibling = null;\n this.nextSibling = null;\n this.boundOnFocus = this.onFocus.bind(this);\n this.boundOnBlur = this.onBlur.bind(this);\n this.listItemNode = document.createElement('li');\n\n this.titleElement = this.listItemNode.createChild('span', 'tree-element-title');\n treeElementBylistItemNode.set(this.listItemNode, this);\n this.titleInternal = '';\n if (title) {\n this.title = title;\n }\n this.listItemNode.addEventListener('mousedown', (this.handleMouseDown.bind(this) as EventListener), false);\n this.listItemNode.addEventListener('click', (this.treeElementToggled.bind(this) as EventListener), false);\n this.listItemNode.addEventListener('dblclick', this.handleDoubleClick.bind(this), false);\n this.listItemNode.setAttribute(\n 'jslog', `${VisualLogging.treeItem().parent('parentTreeItem').context(jslogContext).track({\n click: true,\n keydown: 'ArrowUp|ArrowDown|ArrowLeft|ArrowRight|Backspace|Delete|Enter|Space|Home|End',\n })}`);\n ARIAUtils.markAsTreeitem(this.listItemNode);\n\n this.childrenInternal = null;\n this.childrenListNode = document.createElement('ol');\n nodeToParentTreeElementMap.set(this.childrenListNode, this);\n this.childrenListNode.classList.add('children');\n ARIAUtils.markAsGroup(this.childrenListNode);\n\n this.hiddenInternal = false;\n this.selectableInternal = true;\n this.expanded = false;\n this.selected = false;\n this.setExpandable(expandable || false);\n this.collapsible = true;\n this.toggleOnClick = false;\n this.button = null;\n this.root = false;\n this.tooltipInternal = '';\n this.leadingIconsElement = null;\n this.trailingIconsElement = null;\n this.selectionElementInternal = null;\n this.disableSelectFocus = false;\n }\n\n static getTreeElementBylistItemNode(node: Node): TreeElement|undefined {\n return treeElementBylistItemNode.get(node);\n }\n\n hasAncestor(ancestor: TreeElement|null): boolean {\n if (!ancestor) {\n return false;\n }\n\n let currentNode: (TreeElement|null) = this.parent;\n while (currentNode) {\n if (ancestor === currentNode) {\n return true;\n }\n currentNode = currentNode.parent;\n }\n\n return false;\n }\n\n hasAncestorOrSelf(ancestor: TreeElement|null): boolean {\n return this === ancestor || this.hasAncestor(ancestor);\n }\n\n isHidden(): boolean {\n if (this.hidden) {\n return true;\n }\n\n let currentNode: (TreeElement|null) = this.parent;\n while (currentNode) {\n if (currentNode.hidden) {\n return true;\n }\n currentNode = currentNode.parent;\n }\n\n return false;\n }\n\n children(): TreeElement[] {\n return this.childrenInternal || [];\n }\n\n childCount(): number {\n return this.childrenInternal ? this.childrenInternal.length : 0;\n }\n\n firstChild(): TreeElement|null {\n return this.childrenInternal ? this.childrenInternal[0] : null;\n }\n\n lastChild(): TreeElement|null {\n return this.childrenInternal ? this.childrenInternal[this.childrenInternal.length - 1] : null;\n }\n\n childAt(index: number): TreeElement|null {\n return this.childrenInternal ? this.childrenInternal[index] : null;\n }\n\n indexOfChild(child: TreeElement): number {\n return this.childrenInternal ? this.childrenInternal.indexOf(child) : -1;\n }\n\n appendChild(child: TreeElement, comparator?: ((arg0: TreeElement, arg1: TreeElement) => number)): void {\n if (!this.childrenInternal) {\n this.childrenInternal = [];\n }\n\n let insertionIndex;\n if (comparator) {\n insertionIndex = Platform.ArrayUtilities.lowerBound(this.childrenInternal, child, comparator);\n } else if (this.treeOutline && this.treeOutline.comparator) {\n insertionIndex = Platform.ArrayUtilities.lowerBound(this.childrenInternal, child, this.treeOutline.comparator);\n } else {\n insertionIndex = this.childrenInternal.length;\n }\n this.insertChild(child, insertionIndex);\n }\n\n insertChild(child: TreeElement, index: number): void {\n if (!this.childrenInternal) {\n this.childrenInternal = [];\n }\n\n if (!child) {\n throw 'child can\\'t be undefined or null';\n }\n\n console.assert(\n !child.parent, 'Attempting to insert a child that is already in the tree, reparenting is not supported.');\n\n const previousChild = (index > 0 ? this.childrenInternal[index - 1] : null);\n if (previousChild) {\n previousChild.nextSibling = child;\n child.previousSibling = previousChild;\n } else {\n child.previousSibling = null;\n }\n\n const nextChild = this.childrenInternal[index];\n if (nextChild) {\n nextChild.previousSibling = child;\n child.nextSibling = nextChild;\n } else {\n child.nextSibling = null;\n }\n\n this.childrenInternal.splice(index, 0, child);\n\n this.setExpandable(true);\n child.parent = this;\n\n if (this.treeOutline) {\n this.treeOutline.bindTreeElement(child);\n }\n for (let current = child.firstChild(); this.treeOutline && current;\n current = current.traverseNextTreeElement(false, child, true)) {\n this.treeOutline.bindTreeElement(current);\n }\n child.onattach();\n child.ensureSelection();\n if (this.treeOutline) {\n this.treeOutline.dispatchEventToListeners(Events.ElementAttached, child);\n }\n const nextSibling = child.nextSibling ? child.nextSibling.listItemNode : null;\n this.childrenListNode.insertBefore(child.listItemNode, nextSibling);\n this.childrenListNode.insertBefore(child.childrenListNode, nextSibling);\n if (child.selected) {\n child.select();\n }\n if (child.expanded) {\n child.expand();\n }\n }\n\n removeChildAtIndex(childIndex: number): void {\n if (!this.childrenInternal || childIndex < 0 || childIndex >= this.childrenInternal.length) {\n throw 'childIndex out of range';\n }\n\n const child = this.childrenInternal[childIndex];\n this.childrenInternal.splice(childIndex, 1);\n\n const parent = child.parent;\n if (this.treeOutline && this.treeOutline.selectedTreeElement &&\n this.treeOutline.selectedTreeElement.hasAncestorOrSelf(child)) {\n if (child.nextSibling) {\n child.nextSibling.select(true);\n } else if (child.previousSibling) {\n child.previousSibling.select(true);\n } else if (parent) {\n parent.select(true);\n }\n }\n\n if (child.previousSibling) {\n child.previousSibling.nextSibling = child.nextSibling;\n }\n if (child.nextSibling) {\n child.nextSibling.previousSibling = child.previousSibling;\n }\n child.parent = null;\n\n if (this.treeOutline) {\n this.treeOutline.unbindTreeElement(child);\n }\n for (let current = child.firstChild(); this.treeOutline && current;\n current = current.traverseNextTreeElement(false, child, true)) {\n this.treeOutline.unbindTreeElement(current);\n }\n\n child.detach();\n if (this.treeOutline) {\n this.treeOutline.dispatchEventToListeners(Events.ElementsDetached);\n }\n }\n\n removeChild(child: TreeElement): void {\n if (!child) {\n throw 'child can\\'t be undefined or null';\n }\n if (child.parent !== this) {\n return;\n }\n\n const childIndex = this.childrenInternal ? this.childrenInternal.indexOf(child) : -1;\n if (childIndex === -1) {\n throw 'child not found in this node\\'s children';\n }\n\n this.removeChildAtIndex(childIndex);\n }\n\n removeChildren(): void {\n if (!this.root && this.treeOutline && this.treeOutline.selectedTreeElement &&\n this.treeOutline.selectedTreeElement.hasAncestorOrSelf(this)) {\n this.select(true);\n }\n\n if (this.childrenInternal) {\n for (const child of this.childrenInternal) {\n child.previousSibling = null;\n child.nextSibling = null;\n child.parent = null;\n\n if (this.treeOutline) {\n this.treeOutline.unbindTreeElement(child);\n }\n for (let current = child.firstChild(); this.treeOutline && current;\n current = current.traverseNextTreeElement(false, child, true)) {\n this.treeOutline.unbindTreeElement(current);\n }\n child.detach();\n }\n }\n this.childrenInternal = [];\n if (this.treeOutline) {\n this.treeOutline.dispatchEventToListeners(Events.ElementsDetached);\n }\n }\n\n get selectable(): boolean {\n if (this.isHidden()) {\n return false;\n }\n return this.selectableInternal;\n }\n\n set selectable(x: boolean) {\n this.selectableInternal = x;\n }\n\n get listItemElement(): HTMLLIElement {\n return this.listItemNode;\n }\n\n get childrenListElement(): HTMLOListElement {\n return this.childrenListNode;\n }\n\n get title(): string|Node {\n return this.titleInternal;\n }\n\n set title(x: string|Node) {\n if (this.titleInternal === x) {\n return;\n }\n this.titleInternal = x;\n\n if (typeof x === 'string') {\n this.titleElement.textContent = x;\n this.tooltip = x;\n } else {\n this.titleElement = x;\n this.tooltip = '';\n }\n\n this.listItemNode.removeChildren();\n if (this.leadingIconsElement) {\n this.listItemNode.appendChild(this.leadingIconsElement);\n }\n this.listItemNode.appendChild(this.titleElement);\n if (this.trailingIconsElement) {\n this.listItemNode.appendChild(this.trailingIconsElement);\n }\n this.ensureSelection();\n }\n\n titleAsText(): string {\n if (!this.titleInternal) {\n return '';\n }\n if (typeof this.titleInternal === 'string') {\n return this.titleInternal;\n }\n return this.titleInternal.textContent || '';\n }\n\n startEditingTitle(editingConfig: Config): void {\n InplaceEditor.startEditing((this.titleElement as Element), editingConfig);\n if (this.treeOutline) {\n this.treeOutline.onStartedEditingTitle(this);\n }\n }\n\n setLeadingIcons(icons: IconButton.Icon.Icon[]|IconButton.FileSourceIcon.FileSourceIcon[]): void {\n if (!this.leadingIconsElement && !icons.length) {\n return;\n }\n if (!this.leadingIconsElement) {\n this.leadingIconsElement = document.createElement('div');\n this.leadingIconsElement.classList.add('leading-icons');\n this.leadingIconsElement.classList.add('icons-container');\n this.listItemNode.insertBefore(this.leadingIconsElement, this.titleElement);\n this.ensureSelection();\n }\n this.leadingIconsElement.removeChildren();\n for (const icon of icons) {\n this.leadingIconsElement.appendChild(icon);\n }\n }\n\n setTrailingIcons(icons: IconButton.Icon.Icon[]): void {\n if (!this.trailingIconsElement && !icons.length) {\n return;\n }\n if (!this.trailingIconsElement) {\n this.trailingIconsElement = document.createElement('div');\n this.trailingIconsElement.classList.add('trailing-icons');\n this.trailingIconsElement.classList.add('icons-container');\n this.listItemNode.appendChild(this.trailingIconsElement);\n this.ensureSelection();\n }\n this.trailingIconsElement.removeChildren();\n for (const icon of icons) {\n this.trailingIconsElement.appendChild(icon);\n }\n }\n\n get tooltip(): string {\n return this.tooltipInternal;\n }\n\n set tooltip(x: string) {\n if (this.tooltipInternal === x) {\n return;\n }\n this.tooltipInternal = x;\n Tooltip.install(this.listItemNode, x);\n }\n\n isExpandable(): boolean {\n return this.expandable;\n }\n\n setExpandable(expandable: boolean): void {\n if (this.expandable === expandable) {\n return;\n }\n\n this.expandable = expandable;\n\n this.listItemNode.classList.toggle('parent', expandable);\n if (!expandable) {\n this.collapse();\n ARIAUtils.unsetExpandable(this.listItemNode);\n } else {\n VisualLogging.registerLoggable(this.expandLoggable, `${VisualLogging.expand()}`, this.listItemNode);\n ARIAUtils.setExpanded(this.listItemNode, false);\n }\n }\n\n isExpandRecursively(): boolean {\n return this.#expandRecursively;\n }\n\n setExpandRecursively(expandRecursively: boolean): void {\n this.#expandRecursively = expandRecursively;\n }\n\n isCollapsible(): boolean {\n return this.collapsible;\n }\n\n setCollapsible(collapsible: boolean): void {\n if (this.collapsible === collapsible) {\n return;\n }\n\n this.collapsible = collapsible;\n\n this.listItemNode.classList.toggle('always-parent', !collapsible);\n if (!collapsible) {\n this.expand();\n }\n }\n\n get hidden(): boolean {\n return this.hiddenInternal;\n }\n\n set hidden(x: boolean) {\n if (this.hiddenInternal === x) {\n return;\n }\n\n this.hiddenInternal = x;\n\n this.listItemNode.classList.toggle('hidden', x);\n this.childrenListNode.classList.toggle('hidden', x);\n\n if (x && this.treeOutline && this.treeOutline.selectedTreeElement &&\n this.treeOutline.selectedTreeElement.hasAncestorOrSelf(this)) {\n const hadFocus = this.treeOutline.selectedTreeElement.listItemElement.hasFocus();\n this.treeOutline.forceSelect(!hadFocus, /* selectedByUser */ false);\n }\n }\n\n invalidateChildren(): void {\n if (this.childrenInternal) {\n this.removeChildren();\n this.childrenInternal = null;\n }\n }\n\n private ensureSelection(): void {\n if (!this.treeOutline || !this.treeOutline.renderSelection) {\n return;\n }\n if (!this.selectionElementInternal) {\n this.selectionElementInternal = document.createElement('div');\n this.selectionElementInternal.classList.add('selection');\n this.selectionElementInternal.classList.add('fill');\n }\n this.listItemNode.insertBefore(this.selectionElementInternal, this.listItemElement.firstChild);\n }\n\n private treeElementToggled(event: MouseEvent): void {\n const element = (event.currentTarget as Node | null);\n if (!element || treeElementBylistItemNode.get(element) !== this || element.hasSelection()) {\n return;\n }\n\n console.assert(Boolean(this.treeOutline));\n const showSelectionOnKeyboardFocus = this.treeOutline ? this.treeOutline.showSelectionOnKeyboardFocus : false;\n const toggleOnClick = this.toggleOnClick && (showSelectionOnKeyboardFocus || !this.selectable);\n const isInTriangle = this.isEventWithinDisclosureTriangle(event);\n if (!toggleOnClick && !isInTriangle) {\n return;\n }\n\n if (this.expanded) {\n if (event.altKey) {\n this.collapseRecursively();\n } else {\n this.collapse();\n }\n } else {\n if (event.altKey) {\n void this.expandRecursively();\n } else {\n this.expand();\n }\n }\n void VisualLogging.logClick(this.expandLoggable, event);\n event.consume();\n }\n\n private handleMouseDown(event: MouseEvent): void {\n const element = (event.currentTarget as Node | null);\n if (!element) {\n return;\n }\n if (!this.selectable) {\n return;\n }\n if (treeElementBylistItemNode.get(element) !== this) {\n return;\n }\n\n if (this.isEventWithinDisclosureTriangle(event)) {\n return;\n }\n\n this.selectOnMouseDown(event);\n }\n\n private handleDoubleClick(event: Event): void {\n const element = (event.currentTarget as Node | null);\n if (!element || treeElementBylistItemNode.get(element) !== this) {\n return;\n }\n\n const handled = this.ondblclick(event);\n if (handled) {\n return;\n }\n if (this.expandable && !this.expanded) {\n this.expand();\n }\n }\n\n private detach(): void {\n this.listItemNode.remove();\n this.childrenListNode.remove();\n }\n\n collapse(): void {\n if (!this.expanded || !this.collapsible) {\n return;\n }\n this.listItemNode.classList.remove('expanded');\n this.childrenListNode.classList.remove('expanded');\n ARIAUtils.setExpanded(this.listItemNode, false);\n this.expanded = false;\n this.oncollapse();\n if (this.treeOutline) {\n this.treeOutline.dispatchEventToListeners(Events.ElementCollapsed, this);\n }\n\n const selectedTreeElement = this.treeOutline && this.treeOutline.selectedTreeElement;\n if (selectedTreeElement && selectedTreeElement.hasAncestor(this)) {\n this.select(/* omitFocus */ true, /* selectedByUser */ true);\n }\n }\n\n collapseRecursively(): void {\n let item: (TreeElement|null)|this = this;\n while (item) {\n if (item.expanded) {\n item.collapse();\n }\n item = item.traverseNextTreeElement(false, this, true);\n }\n }\n\n collapseChildren(): void {\n if (!this.childrenInternal) {\n return;\n }\n for (const child of this.childrenInternal) {\n child.collapseRecursively();\n }\n }\n\n expand(): void {\n if (!this.expandable || (this.expanded && this.childrenInternal)) {\n return;\n }\n\n // Set this before onpopulate. Since onpopulate can add elements, this makes\n // sure the expanded flag is true before calling those functions. This prevents the possibility\n // of an infinite loop if onpopulate were to call expand.\n\n this.expanded = true;\n\n void this.populateIfNeeded();\n this.listItemNode.classList.add('expanded');\n this.childrenListNode.classList.add('expanded');\n ARIAUtils.setExpanded(this.listItemNode, true);\n\n if (this.treeOutline) {\n this.onexpand();\n this.treeOutline.dispatchEventToListeners(Events.ElementExpanded, this);\n }\n }\n\n async expandRecursively(maxDepth?: number): Promise {\n let item: (TreeElement|null)|this = this;\n const info = {depthChange: 0};\n let depth = 0;\n\n // The Inspector uses TreeOutlines to represents object properties, so recursive expansion\n // in some case can be infinite, since JavaScript objects can hold circular references.\n // So default to a recursion cap of 3 levels, since that gives fairly good results.\n if (maxDepth === undefined || isNaN(maxDepth)) {\n maxDepth = 3;\n }\n\n do {\n if (item.isExpandRecursively()) {\n await item.populateIfNeeded();\n\n if (depth < maxDepth) {\n item.expand();\n }\n }\n item = item.traverseNextTreeElement(!item.isExpandRecursively(), this, true, info);\n depth += info.depthChange;\n } while (item !== null);\n }\n\n collapseOrAscend(altKey: boolean): boolean {\n if (this.expanded && this.collapsible) {\n if (altKey) {\n this.collapseRecursively();\n } else {\n this.collapse();\n }\n return true;\n }\n\n if (!this.parent || this.parent.root) {\n return false;\n }\n\n if (!this.parent.selectable) {\n this.parent.collapse();\n return true;\n }\n\n let nextSelectedElement: (TreeElement|null)|TreeElement = this.parent;\n while (nextSelectedElement && !nextSelectedElement.selectable) {\n nextSelectedElement = nextSelectedElement.parent;\n }\n\n if (!nextSelectedElement) {\n return false;\n }\n nextSelectedElement.select(false, true);\n return true;\n }\n\n descendOrExpand(altKey: boolean): boolean {\n if (!this.expandable) {\n return false;\n }\n\n if (!this.expanded) {\n if (altKey) {\n void this.expandRecursively();\n } else {\n this.expand();\n }\n return true;\n }\n\n let nextSelectedElement = this.firstChild();\n while (nextSelectedElement && !nextSelectedElement.selectable) {\n nextSelectedElement = nextSelectedElement.nextSibling;\n }\n\n if (!nextSelectedElement) {\n return false;\n }\n nextSelectedElement.select(false, true);\n return true;\n }\n\n reveal(center?: boolean): void {\n let currentAncestor: (TreeElement|null) = this.parent;\n while (currentAncestor && !currentAncestor.root) {\n if (!currentAncestor.expanded) {\n currentAncestor.expand();\n }\n currentAncestor = currentAncestor.parent;\n }\n\n if (this.treeOutline) {\n this.treeOutline.deferredScrollIntoView(this, Boolean(center));\n }\n }\n\n revealed(): boolean {\n let currentAncestor: (TreeElement|null) = this.parent;\n while (currentAncestor && !currentAncestor.root) {\n if (!currentAncestor.expanded) {\n return false;\n }\n currentAncestor = currentAncestor.parent;\n }\n\n return true;\n }\n\n selectOnMouseDown(event: MouseEvent): void {\n if (this.select(false, true)) {\n event.consume(true);\n }\n\n if (this.listItemNode.draggable && this.selectionElementInternal && this.treeOutline) {\n const marginLeft = this.treeOutline.element.getBoundingClientRect().left -\n this.listItemNode.getBoundingClientRect().left - this.treeOutline.element.scrollLeft;\n // By default the left margin extends far off screen. This is not a problem except when dragging an element.\n // Setting the margin once here should be fine, because we believe the left margin should never change.\n this.selectionElementInternal.style.setProperty('margin-left', marginLeft + 'px');\n }\n }\n\n select(omitFocus?: boolean, selectedByUser?: boolean): boolean {\n omitFocus = omitFocus || this.disableSelectFocus;\n if (!this.treeOutline || !this.selectable || this.selected) {\n if (!omitFocus) {\n this.listItemElement.focus();\n }\n return false;\n }\n // Wait to deselect this element so that focus only changes once\n const lastSelected = this.treeOutline.selectedTreeElement;\n this.treeOutline.selectedTreeElement = null;\n\n if (this.treeOutline.rootElementInternal === this) {\n if (lastSelected) {\n lastSelected.deselect();\n }\n if (!omitFocus) {\n this.listItemElement.focus();\n }\n return false;\n }\n\n this.selected = true;\n\n this.treeOutline.selectedTreeElement = this;\n this.treeOutline.updateFocusable();\n if (!omitFocus || this.treeOutline.contentElement.hasFocus()) {\n this.listItemElement.focus();\n }\n\n this.listItemNode.classList.add('selected');\n ARIAUtils.setSelected(this.listItemNode, true);\n this.treeOutline.dispatchEventToListeners(Events.ElementSelected, this);\n if (lastSelected) {\n lastSelected.deselect();\n }\n return this.onselect(selectedByUser);\n }\n\n setFocusable(focusable: boolean): void {\n if (focusable) {\n this.listItemNode.setAttribute('tabIndex', (this.treeOutline && this.treeOutline.preventTabOrder) ? '-1' : '0');\n this.listItemNode.addEventListener('focus', this.boundOnFocus, false);\n this.listItemNode.addEventListener('blur', this.boundOnBlur, false);\n } else {\n this.listItemNode.removeAttribute('tabIndex');\n this.listItemNode.removeEventListener('focus', this.boundOnFocus, false);\n this.listItemNode.removeEventListener('blur', this.boundOnBlur, false);\n }\n }\n\n private onFocus(): void {\n if (!this.treeOutline || this.treeOutline.getUseLightSelectionColor()) {\n return;\n }\n if (!this.treeOutline.contentElement.classList.contains('hide-selection-when-blurred')) {\n this.listItemNode.classList.add('force-white-icons');\n }\n }\n\n private onBlur(): void {\n if (!this.treeOutline || this.treeOutline.getUseLightSelectionColor()) {\n return;\n }\n if (!this.treeOutline.contentElement.classList.contains('hide-selection-when-blurred')) {\n this.listItemNode.classList.remove('force-white-icons');\n }\n }\n\n revealAndSelect(omitFocus?: boolean): void {\n this.reveal(true);\n this.select(omitFocus);\n }\n\n deselect(): void {\n const hadFocus = this.listItemNode.hasFocus();\n this.selected = false;\n this.listItemNode.classList.remove('selected');\n ARIAUtils.clearSelected(this.listItemNode);\n this.setFocusable(false);\n\n if (this.treeOutline && this.treeOutline.selectedTreeElement === this) {\n this.treeOutline.selectedTreeElement = null;\n this.treeOutline.updateFocusable();\n if (hadFocus) {\n this.treeOutline.focus();\n }\n }\n }\n\n private async populateIfNeeded(): Promise {\n if (this.treeOutline && this.expandable && !this.childrenInternal) {\n this.childrenInternal = [];\n await this.onpopulate();\n }\n }\n\n async onpopulate(): Promise {\n // Overridden by subclasses.\n }\n\n onenter(): boolean {\n if (this.expandable && !this.expanded) {\n this.expand();\n return true;\n }\n if (this.collapsible && this.expanded) {\n this.collapse();\n return true;\n }\n return false;\n }\n\n ondelete(): boolean {\n return false;\n }\n\n onspace(): boolean {\n return false;\n }\n\n onbind(): void {\n }\n\n onunbind(): void {\n }\n\n onattach(): void {\n }\n\n onexpand(): void {\n }\n\n oncollapse(): void {\n }\n\n ondblclick(_e: Event): boolean {\n return false;\n }\n\n onselect(_selectedByUser?: boolean): boolean {\n return false;\n }\n\n traverseNextTreeElement(skipUnrevealed: boolean, stayWithin?: TreeElement|null, dontPopulate?: boolean, info?: {\n depthChange: number,\n }): TreeElement|null {\n if (!dontPopulate) {\n void this.populateIfNeeded();\n }\n\n if (info) {\n info.depthChange = 0;\n }\n\n let element: (TreeElement|null)|this =\n skipUnrevealed ? (this.revealed() ? this.firstChild() : null) : this.firstChild();\n if (element && (!skipUnrevealed || (skipUnrevealed && this.expanded))) {\n if (info) {\n info.depthChange = 1;\n }\n return element;\n }\n\n if (this === stayWithin) {\n return null;\n }\n\n element = skipUnrevealed ? (this.revealed() ? this.nextSibling : null) : this.nextSibling;\n if (element) {\n return element;\n }\n\n element = this;\n while (element && !element.root &&\n !(skipUnrevealed ? (element.revealed() ? element.nextSibling : null) : element.nextSibling) &&\n element.parent !== stayWithin) {\n if (info) {\n info.depthChange -= 1;\n }\n element = element.parent;\n }\n\n if (!element || element.root) {\n return null;\n }\n\n return (skipUnrevealed ? (element.revealed() ? element.nextSibling : null) : element.nextSibling);\n }\n\n traversePreviousTreeElement(skipUnrevealed: boolean, dontPopulate?: boolean): TreeElement|null {\n let element: (TreeElement|null) =\n skipUnrevealed ? (this.revealed() ? this.previousSibling : null) : this.previousSibling;\n if (!dontPopulate && element) {\n void element.populateIfNeeded();\n }\n\n while (element &&\n (skipUnrevealed ? (element.revealed() && element.expanded ? element.lastChild() : null) :\n element.lastChild())) {\n if (!dontPopulate) {\n void element.populateIfNeeded();\n }\n element =\n (skipUnrevealed ? (element.revealed() && element.expanded ? element.lastChild() : null) :\n element.lastChild());\n }\n\n if (element) {\n return element;\n }\n\n if (!this.parent || this.parent.root) {\n return null;\n }\n\n return this.parent;\n }\n\n isEventWithinDisclosureTriangle(event: MouseEvent): boolean {\n const arrowToggleWidth = 10;\n // FIXME: We should not use getComputedStyle(). For that we need to get rid of using ::before for disclosure triangle. (http://webk.it/74446)\n const paddingLeftValue = window.getComputedStyle(this.listItemNode).paddingLeft;\n console.assert(paddingLeftValue.endsWith('px'));\n const computedLeftPadding = parseFloat(paddingLeftValue);\n const left = this.listItemNode.getBoundingClientRect().left + computedLeftPadding;\n return event.pageX >= left && event.pageX <= left + arrowToggleWidth && this.expandable;\n }\n\n setDisableSelectFocus(toggle: boolean): void {\n this.disableSelectFocus = toggle;\n }\n}\n\nfunction loggingParentProvider(e: Element): Element|undefined {\n const treeElement = TreeElement.getTreeElementBylistItemNode(e);\n const parentElement = treeElement?.parent?.listItemElement;\n return parentElement?.isConnected && parentElement || treeElement?.treeOutline?.contentElement;\n}\n\nVisualLogging.registerParentProvider('parentTreeItem', loggingParentProvider);\n"]} \ No newline at end of file diff --git a/public/ui/legacy/UIUtils.d.ts b/public/ui/legacy/UIUtils.d.ts index 4023caf64..c272d7cba 100644 --- a/public/ui/legacy/UIUtils.d.ts +++ b/public/ui/legacy/UIUtils.d.ts @@ -5,6 +5,14 @@ import * as IconButton from '../components/icon_button/icon_button.js'; import { Size } from './Geometry.js'; import { type ToolbarButton } from './Toolbar.js'; import type { TreeOutline } from './Treeoutline.js'; +declare global { + interface HTMLElementTagNameMap { + 'dt-checkbox': CheckboxLabel; + 'dt-close-button': DevToolsCloseButton; + 'dt-icon-label': DevToolsIconLabel; + 'dt-small-bubble': DevToolsSmallBubble; + } +} export declare const highlightedSearchResultClassName = "highlighted-search-result"; export declare const highlightedCurrentSearchResultClassName = "current-search-result"; export declare function installDragHandle(element: Element, elementDragStart: ((arg0: MouseEvent) => boolean) | null, elementDrag: (arg0: MouseEvent) => void, elementDragEnd: ((arg0: MouseEvent) => void) | null, cursor: string | null, hoverCursor?: string | null, startDelay?: number): void; @@ -71,10 +79,10 @@ export declare function createTextButton(text: string, clickHandler?: ((arg0: Ev icon?: string; }): Buttons.Button.Button; export declare function createInput(className?: string, type?: string, jslogContext?: string): HTMLInputElement; +export declare function createHistoryInput(type?: string, className?: string): HTMLInputElement; export declare function createSelect(name: string, options: string[] | Map[] | Set): HTMLSelectElement; export declare function createOption(title: string, value?: string, jslogContext?: string): HTMLOptionElement; export declare function createLabel(title: string, className?: string, associatedControl?: Element): Element; -export declare function createRadioLabel(name: string, title: string, checked?: boolean, jslogContext?: string): DevToolsRadioButton; export declare function createIconLabel(options: { title?: string; iconName: string; @@ -82,7 +90,51 @@ export declare function createIconLabel(options: { width?: '14px' | '20px'; height?: '14px' | '20px'; }): DevToolsIconLabel; -export declare function createSlider(min: number, max: number, tabIndex: number): Element; +/** + * Creates a radio button, which is comprised of a `