@@ -33,7 +33,7 @@ import { updateColorThemeConfigurationSchemas, updateFileIconThemeConfigurationS
33
33
import { ProductIconThemeData , DEFAULT_PRODUCT_ICON_THEME_ID } from './productIconThemeData.js' ;
34
34
import { registerProductIconThemeSchemas } from '../common/productIconThemeSchema.js' ;
35
35
import { ILogService } from '../../../../platform/log/common/log.js' ;
36
- import { isFirefox , isWeb } from '../../../../base/common/platform.js' ;
36
+ import { isWeb } from '../../../../base/common/platform.js' ;
37
37
import { ColorScheme , ThemeTypeSelector } from '../../../../platform/theme/common/theme.js' ;
38
38
import { IHostColorSchemeService } from '../common/hostColorSchemeService.js' ;
39
39
import { RunOnceScheduler , Sequencer } from '../../../../base/common/async.js' ;
@@ -42,7 +42,6 @@ import { getIconsStyleSheet } from '../../../../platform/theme/browser/iconsStyl
42
42
import { asCssVariableName , getColorRegistry } from '../../../../platform/theme/common/colorRegistry.js' ;
43
43
import { ILanguageService } from '../../../../editor/common/languages/language.js' ;
44
44
import { mainWindow } from '../../../../base/browser/window.js' ;
45
- import { generateUuid } from '../../../../base/common/uuid.js' ;
46
45
47
46
// implementation
48
47
@@ -794,21 +793,13 @@ class ThemeFileWatcher {
794
793
}
795
794
796
795
function _applyRules ( styleSheetContent : string , rulesClassName : string ) {
797
- let themeStyle = mainWindow . document . head . getElementsByClassName ( rulesClassName ) . item ( 0 ) ;
798
- if ( ! themeStyle ) {
799
- themeStyle = createStyleSheet ( ) ;
800
- themeStyle . className = rulesClassName ;
801
- }
802
-
803
- if ( themeStyle . textContent !== styleSheetContent ) {
804
- themeStyle . textContent = styleSheetContent ;
805
-
806
- if ( isFirefox ) {
807
- // Firefox doesn't support observing style tag contents
808
- // As a workaround, also update the data-version attribute
809
- // when it changes so it can be observed
810
- themeStyle . setAttribute ( 'data-version' , generateUuid ( ) ) ;
811
- }
796
+ const themeStyles = mainWindow . document . head . getElementsByClassName ( rulesClassName ) ;
797
+ if ( themeStyles . length === 0 ) {
798
+ const elStyle = createStyleSheet ( ) ;
799
+ elStyle . className = rulesClassName ;
800
+ elStyle . textContent = styleSheetContent ;
801
+ } else {
802
+ ( < HTMLStyleElement > themeStyles [ 0 ] ) . textContent = styleSheetContent ;
812
803
}
813
804
}
814
805
0 commit comments