@@ -744,75 +744,77 @@ windowId = ${raw.windowId}
744744 return ;
745745
746746 const raw = this . $TST . raw ;
747- const tab = this . $TST . tab ;
748747 const classList = this . classList ;
749748
750749 this . label = raw . title ;
751750
752- const openerOfGroupTab = tab && this . $TST . isGroupTab && Tab . getOpenerFromGroupTab ( tab ) ;
753- this . favIconUrl = openerOfGroupTab && openerOfGroupTab . favIconUrl || tab ?. favIconUrl ;
754-
755- for ( const state of classList ) {
756- if ( IGNORE_CLASSES . has ( state ) ||
757- NATIVE_PROPERTIES . has ( state ) )
758- continue ;
759- if ( ! this . $TST . states . has ( state ) )
760- classList . remove ( state ) ;
761- }
762- for ( const state of this . $TST . states ) {
763- if ( IGNORE_CLASSES . has ( state ) )
764- continue ;
765- if ( ! classList . contains ( state ) )
766- classList . add ( state ) ;
767- }
751+ const tab = this . $TST . tab ;
752+ if ( tab ) {
753+ const openerOfGroupTab = tab && this . $TST . isGroupTab && Tab . getOpenerFromGroupTab ( tab ) ;
754+ this . favIconUrl = openerOfGroupTab && openerOfGroupTab . favIconUrl || tab ?. favIconUrl ;
755+
756+ for ( const state of classList ) {
757+ if ( IGNORE_CLASSES . has ( state ) ||
758+ NATIVE_PROPERTIES . has ( state ) )
759+ continue ;
760+ if ( ! this . $TST . states . has ( state ) )
761+ classList . remove ( state ) ;
762+ }
763+ for ( const state of this . $TST . states ) {
764+ if ( IGNORE_CLASSES . has ( state ) )
765+ continue ;
766+ if ( ! classList . contains ( state ) )
767+ classList . add ( state ) ;
768+ }
768769
769- for ( const state of NATIVE_PROPERTIES ) {
770- if ( raw [ state ] == classList . contains ( state ) )
771- continue ;
772- classList . toggle ( state , raw [ state ] ) ;
773- }
770+ for ( const state of NATIVE_PROPERTIES ) {
771+ if ( raw [ state ] == classList . contains ( state ) )
772+ continue ;
773+ classList . toggle ( state , raw [ state ] ) ;
774+ }
774775
775- if ( this . $TST . childIds . length > 0 )
776- this . setAttribute ( Constants . kCHILDREN , `|${ this . $TST . childIds . join ( '|' ) } |` ) ;
777- else
778- this . removeAttribute ( Constants . kCHILDREN ) ;
776+ if ( this . $TST . childIds . length > 0 )
777+ this . setAttribute ( Constants . kCHILDREN , `|${ this . $TST . childIds . join ( '|' ) } |` ) ;
778+ else
779+ this . removeAttribute ( Constants . kCHILDREN ) ;
779780
780- if ( this . $TST . parentId )
781- this . setAttribute ( Constants . kPARENT , this . $TST . parentId ) ;
782- else
783- this . removeAttribute ( Constants . kPARENT ) ;
781+ if ( this . $TST . parentId )
782+ this . setAttribute ( Constants . kPARENT , this . $TST . parentId ) ;
783+ else
784+ this . removeAttribute ( Constants . kPARENT ) ;
784785
785- const alreadyGrouped = this . $TST . getAttribute ( Constants . kPERSISTENT_ALREADY_GROUPED_FOR_PINNED_OPENER ) || '' ;
786- if ( this . getAttribute ( Constants . kPERSISTENT_ALREADY_GROUPED_FOR_PINNED_OPENER ) != alreadyGrouped )
787- this . setAttribute ( Constants . kPERSISTENT_ALREADY_GROUPED_FOR_PINNED_OPENER , alreadyGrouped ) ;
786+ const alreadyGrouped = this . $TST . getAttribute ( Constants . kPERSISTENT_ALREADY_GROUPED_FOR_PINNED_OPENER ) || '' ;
787+ if ( this . getAttribute ( Constants . kPERSISTENT_ALREADY_GROUPED_FOR_PINNED_OPENER ) != alreadyGrouped )
788+ this . setAttribute ( Constants . kPERSISTENT_ALREADY_GROUPED_FOR_PINNED_OPENER , alreadyGrouped ) ;
788789
789- const opener = this . $TST . getAttribute ( Constants . kPERSISTENT_ORIGINAL_OPENER_TAB_ID ) || '' ;
790- if ( this . getAttribute ( Constants . kPERSISTENT_ORIGINAL_OPENER_TAB_ID ) != opener )
791- this . setAttribute ( Constants . kPERSISTENT_ORIGINAL_OPENER_TAB_ID , opener ) ;
790+ const opener = this . $TST . getAttribute ( Constants . kPERSISTENT_ORIGINAL_OPENER_TAB_ID ) || '' ;
791+ if ( this . getAttribute ( Constants . kPERSISTENT_ORIGINAL_OPENER_TAB_ID ) != opener )
792+ this . setAttribute ( Constants . kPERSISTENT_ORIGINAL_OPENER_TAB_ID , opener ) ;
792793
793- const uri = this . $TST . getAttribute ( Constants . kCURRENT_URI ) || tab ?. url ;
794- if ( this . getAttribute ( Constants . kCURRENT_URI ) != uri )
795- this . setAttribute ( Constants . kCURRENT_URI , uri ) ;
794+ const uri = this . $TST . getAttribute ( Constants . kCURRENT_URI ) || tab ?. url ;
795+ if ( this . getAttribute ( Constants . kCURRENT_URI ) != uri )
796+ this . setAttribute ( Constants . kCURRENT_URI , uri ) ;
796797
797- const favIconUri = this . $TST . getAttribute ( Constants . kCURRENT_FAVICON_URI ) || tab ?. favIconUrl ;
798- if ( this . getAttribute ( Constants . kCURRENT_FAVICON_URI ) != favIconUri )
799- this . setAttribute ( Constants . kCURRENT_FAVICON_URI , favIconUri ) ;
798+ const favIconUri = this . $TST . getAttribute ( Constants . kCURRENT_FAVICON_URI ) || tab ?. favIconUrl ;
799+ if ( this . getAttribute ( Constants . kCURRENT_FAVICON_URI ) != favIconUri )
800+ this . setAttribute ( Constants . kCURRENT_FAVICON_URI , favIconUri ) ;
800801
801- const level = this . $TST . getAttribute ( Constants . kLEVEL ) || 0 ;
802- if ( this . getAttribute ( Constants . kLEVEL ) != level )
803- this . setAttribute ( Constants . kLEVEL , level ) ;
802+ const level = this . $TST . getAttribute ( Constants . kLEVEL ) || 0 ;
803+ if ( this . getAttribute ( Constants . kLEVEL ) != level )
804+ this . setAttribute ( Constants . kLEVEL , level ) ;
804805
805- const id = this . $TST . uniqueId . id ;
806- if ( this . getAttribute ( Constants . kPERSISTENT_ID ) != id )
807- this . setAttribute ( Constants . kPERSISTENT_ID , id ) ;
806+ const id = this . $TST . uniqueId . id ;
807+ if ( this . getAttribute ( Constants . kPERSISTENT_ID ) != id )
808+ this . setAttribute ( Constants . kPERSISTENT_ID , id ) ;
808809
809- if ( this . $TST . subtreeCollapsed ) {
810- if ( ! classList . contains ( Constants . kTAB_STATE_SUBTREE_COLLAPSED ) )
811- classList . add ( Constants . kTAB_STATE_SUBTREE_COLLAPSED ) ;
812- }
813- else {
814- if ( classList . contains ( Constants . kTAB_STATE_SUBTREE_COLLAPSED ) )
815- classList . remove ( Constants . kTAB_STATE_SUBTREE_COLLAPSED ) ;
810+ if ( this . $TST . subtreeCollapsed ) {
811+ if ( ! classList . contains ( Constants . kTAB_STATE_SUBTREE_COLLAPSED ) )
812+ classList . add ( Constants . kTAB_STATE_SUBTREE_COLLAPSED ) ;
813+ }
814+ else {
815+ if ( classList . contains ( Constants . kTAB_STATE_SUBTREE_COLLAPSED ) )
816+ classList . remove ( Constants . kTAB_STATE_SUBTREE_COLLAPSED ) ;
817+ }
816818 }
817819
818820 const group = this . $TST . nativeTabGroup || this . $TST . rawGroup ;
0 commit comments