File tree Expand file tree Collapse file tree 6 files changed +51
-3
lines changed
Expand file tree Collapse file tree 6 files changed +51
-3
lines changed Original file line number Diff line number Diff line change @@ -79,7 +79,7 @@ export class LighthousePanel extends UI.Panel.Panel {
7979 private constructor (
8080 controller : LighthouseController ,
8181 ) {
82- super ( 'lighthouse' ) ;
82+ super ( 'lighthouse' , true /* useShadowDom */ ) ;
8383
8484 this . controller = controller ;
8585 this . startView = new StartView ( this . controller , this ) ;
Original file line number Diff line number Diff line change @@ -39,8 +39,8 @@ import {VBox} from './Widget.js';
3939export class Panel extends VBox {
4040 protected panelName : string ;
4141
42- constructor ( name : string ) {
43- super ( ) ;
42+ constructor ( name : string , useShadowDom ?: boolean ) {
43+ super ( useShadowDom ) ;
4444
4545 this . element . setAttribute ( 'jslog' , `${ VisualLogging . panel ( ) . context ( name ) . track ( { resize : true } ) } ` ) ;
4646 this . element . classList . add ( 'panel' ) ;
Original file line number Diff line number Diff line change @@ -2741,6 +2741,7 @@ export const knownContextValues = new Set([
27412741 'show-grid-areas' ,
27422742 'show-grid-areas-true' ,
27432743 'show-grid-line-labels' ,
2744+ 'show-grid-line-labels-line-names' ,
27442745 'show-grid-track-sizes' ,
27452746 'show-grid-track-sizes-true' ,
27462747 'show-html-comments' ,
Original file line number Diff line number Diff line change @@ -35,6 +35,7 @@ node_ts_library("tests") {
3535 " media" ,
3636 " memory" ,
3737 " network" ,
38+ " panels" ,
3839 " performance" ,
3940 " puppeteer" ,
4041 " quick_open" ,
Original file line number Diff line number Diff line change 1+ # Copyright 2024 The Chromium Authors. All rights reserved.
2+ # Use of this source code is governed by a BSD-style license that can be
3+ # found in the LICENSE file.
4+
5+ import (" ../../../scripts/build/typescript/typescript.gni" )
6+
7+ node_ts_library (" panels" ) {
8+ sources = [ " panels_test.ts" ]
9+
10+ deps = [
11+ " ../../shared" ,
12+ " ../helpers" ,
13+ ]
14+ }
Original file line number Diff line number Diff line change 1+ // Copyright 2024 The Chromium Authors. All rights reserved.
2+ // Use of this source code is governed by a BSD-style license that can be
3+ // found in the LICENSE file.
4+
5+ import { assert } from 'chai' ;
6+
7+ import {
8+ getBrowserAndPages ,
9+ waitFor ,
10+ } from '../../shared/helper.js' ;
11+
12+ // Ideally we want to have all panels within this list,
13+ // but introducing shadow doms for all panels currently leads
14+ // to unwanted visual side effects.
15+ const PANEL_NAMES = [
16+ 'Lighthouse' ,
17+ ] ;
18+
19+ import { runCommandWithQuickOpen } from '../helpers/quick_open-helpers.js' ;
20+
21+ describe ( 'DevTools panels' , function ( ) {
22+ PANEL_NAMES . forEach ( panel => {
23+ it ( `${ panel } doesn't increase number of adopted style sheets on the document` , async ( ) => {
24+ const { frontend} = getBrowserAndPages ( ) ;
25+ const previousNumStyleSheets = await frontend . evaluate ( ( ) => document . adoptedStyleSheets . length ) ;
26+ await runCommandWithQuickOpen ( `Show ${ panel } ` ) ;
27+ await waitFor ( `[aria-label="${ panel } "]` ) ;
28+ const nextNumStyleSheets = await frontend . evaluate ( ( ) => document . adoptedStyleSheets . length ) ;
29+ assert . strictEqual ( previousNumStyleSheets , nextNumStyleSheets ) ;
30+ } ) ;
31+ } ) ;
32+ } ) ;
You can’t perform that action at this time.
0 commit comments