@@ -425,7 +425,7 @@ class ProfileTable implements IHtmlElement {
425425 protected getId ( row : Partial < ProfileRow > ) : string | null {
426426 if ( row . opid == null )
427427 return null ;
428- return this . name . replace ( / \s / g, "_" ) . toLowerCase ( ) + "_" + row . opid . toString ( ) ;
428+ return this . name . replace ( / [ ^ a - z A - Z 0 - 9 ] / g, "_" ) . toLowerCase ( ) + "_" + row . opid . toString ( ) ;
429429 }
430430
431431 protected addDataRow ( indent : number , rowIndex : number , row : Partial < ProfileRow > ,
@@ -444,6 +444,7 @@ class ProfileTable implements IHtmlElement {
444444 short_descr : row . short_descr === undefined ? "" : row . short_descr
445445 } ;
446446
447+ let id = this . getId ( safeRow ) ;
447448 for ( let k of this . displayedColumns ) {
448449 let key = k as keyof ProfileRow ;
449450 let value = safeRow [ key ] ;
@@ -495,7 +496,10 @@ class ProfileTable implements IHtmlElement {
495496 cell . classList . add ( "clickable" ) ;
496497 cell . onclick = ( ) => this . expand ( indent + 1 , trow , cell , children , histogramStart ) ;
497498 }
498- cell . id = this . getId ( safeRow ) ! ;
499+ if ( id != null ) {
500+ cell . id = id ! ;
501+ cell . title = id ;
502+ }
499503 }
500504 if ( ( k === "size" && this . showMemHistogram ) || ( k == "cpu_us" && this . showCpuHistogram ) ) {
501505 // Add an adjacent cell for the histogram
@@ -677,11 +681,14 @@ class ProfileTable implements IHtmlElement {
677681 }
678682
679683 protected expandPath ( path : string [ ] ) : void {
680- for ( let p of path . reverse ( ) ) {
684+ path . reverse ( ) ;
685+ for ( let p of path ) {
681686 let elem = document . getElementById ( p ) ! ;
682687 elem . click ( ) ;
683688 elem . parentElement ! . classList . add ( "highlight" ) ;
684689 }
690+ let last = document . getElementById ( path [ path . length - 1 ] ) ;
691+ last ! . scrollIntoView ( ) ;
685692 }
686693
687694 /**
0 commit comments