happy-dom 17.0.4 → 17.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/browser/DefaultBrowserSettings.cjs +3 -1
- package/cjs/browser/DefaultBrowserSettings.cjs.map +1 -1
- package/cjs/browser/DefaultBrowserSettings.d.ts.map +1 -1
- package/cjs/browser/types/IBrowserSettings.d.ts +2 -0
- package/cjs/browser/types/IBrowserSettings.d.ts.map +1 -1
- package/cjs/browser/types/IOptionalBrowserSettings.d.ts +2 -0
- package/cjs/browser/types/IOptionalBrowserSettings.d.ts.map +1 -1
- package/cjs/css/CSSRule.cjs.map +1 -1
- package/cjs/css/CSSRule.d.ts +1 -1
- package/cjs/css/CSSRule.d.ts.map +1 -1
- package/cjs/css/CSSStyleSheet.cjs +16 -7
- package/cjs/css/CSSStyleSheet.cjs.map +1 -1
- package/cjs/css/CSSStyleSheet.d.ts.map +1 -1
- package/cjs/css/rules/CSSContainerRule.cjs +2 -1
- package/cjs/css/rules/CSSContainerRule.cjs.map +1 -1
- package/cjs/css/rules/CSSContainerRule.d.ts +2 -1
- package/cjs/css/rules/CSSContainerRule.d.ts.map +1 -1
- package/cjs/css/rules/CSSFontFaceRule.cjs +2 -1
- package/cjs/css/rules/CSSFontFaceRule.cjs.map +1 -1
- package/cjs/css/rules/CSSFontFaceRule.d.ts +2 -1
- package/cjs/css/rules/CSSFontFaceRule.d.ts.map +1 -1
- package/cjs/css/rules/CSSKeyframeRule.cjs +2 -1
- package/cjs/css/rules/CSSKeyframeRule.cjs.map +1 -1
- package/cjs/css/rules/CSSKeyframeRule.d.ts +2 -1
- package/cjs/css/rules/CSSKeyframeRule.d.ts.map +1 -1
- package/cjs/css/rules/CSSKeyframesRule.cjs +2 -1
- package/cjs/css/rules/CSSKeyframesRule.cjs.map +1 -1
- package/cjs/css/rules/CSSKeyframesRule.d.ts +2 -1
- package/cjs/css/rules/CSSKeyframesRule.d.ts.map +1 -1
- package/cjs/css/rules/CSSMediaRule.cjs +2 -1
- package/cjs/css/rules/CSSMediaRule.cjs.map +1 -1
- package/cjs/css/rules/CSSMediaRule.d.ts +2 -1
- package/cjs/css/rules/CSSMediaRule.d.ts.map +1 -1
- package/cjs/css/rules/CSSStyleRule.cjs +2 -1
- package/cjs/css/rules/CSSStyleRule.cjs.map +1 -1
- package/cjs/css/rules/CSSStyleRule.d.ts +2 -1
- package/cjs/css/rules/CSSStyleRule.d.ts.map +1 -1
- package/cjs/css/rules/CSSSupportsRule.cjs +2 -1
- package/cjs/css/rules/CSSSupportsRule.cjs.map +1 -1
- package/cjs/css/rules/CSSSupportsRule.d.ts +2 -1
- package/cjs/css/rules/CSSSupportsRule.d.ts.map +1 -1
- package/cjs/css/utilities/CSSParser.cjs +106 -56
- package/cjs/css/utilities/CSSParser.cjs.map +1 -1
- package/cjs/css/utilities/CSSParser.d.ts.map +1 -1
- package/cjs/match-media/MediaQueryItem.cjs +14 -2
- package/cjs/match-media/MediaQueryItem.cjs.map +1 -1
- package/cjs/match-media/MediaQueryItem.d.ts.map +1 -1
- package/cjs/nodes/html-link-element/HTMLLinkElement.cjs +1 -2
- package/cjs/nodes/html-link-element/HTMLLinkElement.cjs.map +1 -1
- package/cjs/nodes/html-link-element/HTMLLinkElement.d.ts.map +1 -1
- package/cjs/nodes/html-style-element/HTMLStyleElement.cjs +1 -2
- package/cjs/nodes/html-style-element/HTMLStyleElement.cjs.map +1 -1
- package/cjs/nodes/html-style-element/HTMLStyleElement.d.ts.map +1 -1
- package/cjs/nodes/svg-style-element/SVGStyleElement.cjs +1 -2
- package/cjs/nodes/svg-style-element/SVGStyleElement.cjs.map +1 -1
- package/cjs/nodes/svg-style-element/SVGStyleElement.d.ts.map +1 -1
- package/lib/browser/DefaultBrowserSettings.d.ts.map +1 -1
- package/lib/browser/DefaultBrowserSettings.js +3 -1
- package/lib/browser/DefaultBrowserSettings.js.map +1 -1
- package/lib/browser/types/IBrowserSettings.d.ts +2 -0
- package/lib/browser/types/IBrowserSettings.d.ts.map +1 -1
- package/lib/browser/types/IOptionalBrowserSettings.d.ts +2 -0
- package/lib/browser/types/IOptionalBrowserSettings.d.ts.map +1 -1
- package/lib/css/CSSRule.d.ts +1 -1
- package/lib/css/CSSRule.d.ts.map +1 -1
- package/lib/css/CSSRule.js.map +1 -1
- package/lib/css/CSSStyleSheet.d.ts.map +1 -1
- package/lib/css/CSSStyleSheet.js +16 -7
- package/lib/css/CSSStyleSheet.js.map +1 -1
- package/lib/css/rules/CSSContainerRule.d.ts +2 -1
- package/lib/css/rules/CSSContainerRule.d.ts.map +1 -1
- package/lib/css/rules/CSSContainerRule.js +2 -1
- package/lib/css/rules/CSSContainerRule.js.map +1 -1
- package/lib/css/rules/CSSFontFaceRule.d.ts +2 -1
- package/lib/css/rules/CSSFontFaceRule.d.ts.map +1 -1
- package/lib/css/rules/CSSFontFaceRule.js +2 -1
- package/lib/css/rules/CSSFontFaceRule.js.map +1 -1
- package/lib/css/rules/CSSKeyframeRule.d.ts +2 -1
- package/lib/css/rules/CSSKeyframeRule.d.ts.map +1 -1
- package/lib/css/rules/CSSKeyframeRule.js +2 -1
- package/lib/css/rules/CSSKeyframeRule.js.map +1 -1
- package/lib/css/rules/CSSKeyframesRule.d.ts +2 -1
- package/lib/css/rules/CSSKeyframesRule.d.ts.map +1 -1
- package/lib/css/rules/CSSKeyframesRule.js +2 -1
- package/lib/css/rules/CSSKeyframesRule.js.map +1 -1
- package/lib/css/rules/CSSMediaRule.d.ts +2 -1
- package/lib/css/rules/CSSMediaRule.d.ts.map +1 -1
- package/lib/css/rules/CSSMediaRule.js +2 -1
- package/lib/css/rules/CSSMediaRule.js.map +1 -1
- package/lib/css/rules/CSSStyleRule.d.ts +2 -1
- package/lib/css/rules/CSSStyleRule.d.ts.map +1 -1
- package/lib/css/rules/CSSStyleRule.js +2 -1
- package/lib/css/rules/CSSStyleRule.js.map +1 -1
- package/lib/css/rules/CSSSupportsRule.d.ts +2 -1
- package/lib/css/rules/CSSSupportsRule.d.ts.map +1 -1
- package/lib/css/rules/CSSSupportsRule.js +2 -1
- package/lib/css/rules/CSSSupportsRule.js.map +1 -1
- package/lib/css/utilities/CSSParser.d.ts.map +1 -1
- package/lib/css/utilities/CSSParser.js +106 -56
- package/lib/css/utilities/CSSParser.js.map +1 -1
- package/lib/match-media/MediaQueryItem.d.ts.map +1 -1
- package/lib/match-media/MediaQueryItem.js +14 -2
- package/lib/match-media/MediaQueryItem.js.map +1 -1
- package/lib/nodes/html-link-element/HTMLLinkElement.d.ts.map +1 -1
- package/lib/nodes/html-link-element/HTMLLinkElement.js +1 -2
- package/lib/nodes/html-link-element/HTMLLinkElement.js.map +1 -1
- package/lib/nodes/html-style-element/HTMLStyleElement.d.ts.map +1 -1
- package/lib/nodes/html-style-element/HTMLStyleElement.js +1 -2
- package/lib/nodes/html-style-element/HTMLStyleElement.js.map +1 -1
- package/lib/nodes/svg-style-element/SVGStyleElement.d.ts.map +1 -1
- package/lib/nodes/svg-style-element/SVGStyleElement.js +1 -2
- package/lib/nodes/svg-style-element/SVGStyleElement.js.map +1 -1
- package/package.json +1 -1
- package/src/browser/DefaultBrowserSettings.ts +3 -1
- package/src/browser/types/IBrowserSettings.ts +2 -0
- package/src/browser/types/IOptionalBrowserSettings.ts +2 -0
- package/src/css/CSSRule.ts +1 -1
- package/src/css/CSSStyleSheet.ts +26 -10
- package/src/css/rules/CSSContainerRule.ts +2 -1
- package/src/css/rules/CSSFontFaceRule.ts +2 -1
- package/src/css/rules/CSSKeyframeRule.ts +2 -1
- package/src/css/rules/CSSKeyframesRule.ts +2 -1
- package/src/css/rules/CSSMediaRule.ts +2 -1
- package/src/css/rules/CSSStyleRule.ts +2 -1
- package/src/css/rules/CSSSupportsRule.ts +2 -1
- package/src/css/utilities/CSSParser.ts +121 -64
- package/src/match-media/MediaQueryItem.ts +16 -2
- package/src/nodes/html-link-element/HTMLLinkElement.ts +3 -1
- package/src/nodes/html-style-element/HTMLStyleElement.ts +3 -1
- package/src/nodes/svg-style-element/SVGStyleElement.ts +3 -1
@@ -9,6 +9,7 @@ import CSSContainerRule from '../rules/CSSContainerRule.js';
|
|
9
9
|
import CSSSupportsRule from '../rules/CSSSupportsRule.js';
|
10
10
|
import CSSFontFaceRule from '../rules/CSSFontFaceRule.js';
|
11
11
|
import SelectorParser from '../../query-selector/SelectorParser.js';
|
12
|
+
import CSSRuleTypeEnum from '../CSSRuleTypeEnum.js';
|
12
13
|
|
13
14
|
const COMMENT_REGEXP = /\/\*[\s\S]*?\*\//gm;
|
14
15
|
|
@@ -29,7 +30,7 @@ export default class CSSParser {
|
|
29
30
|
const cssRules = [];
|
30
31
|
const regExp = /{|}/gm;
|
31
32
|
const stack: CSSRule[] = [];
|
32
|
-
let parentRule: CSSRule = null;
|
33
|
+
let parentRule: CSSRule | null = null;
|
33
34
|
let lastIndex = 0;
|
34
35
|
let match: RegExpMatchArray;
|
35
36
|
|
@@ -37,64 +38,120 @@ export default class CSSParser {
|
|
37
38
|
if (match[0] === '{') {
|
38
39
|
const selectorText = css.substring(lastIndex, match.index).trim();
|
39
40
|
|
40
|
-
if (
|
41
|
-
selectorText.
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
41
|
+
if (selectorText[0] === '@') {
|
42
|
+
const ruleParts = selectorText.split(' ');
|
43
|
+
const ruleType = ruleParts[0];
|
44
|
+
const ruleParameters = ruleParts.slice(1).join(' ').trim();
|
45
|
+
|
46
|
+
switch (ruleType) {
|
47
|
+
case '@keyframes':
|
48
|
+
case '@-webkit-keyframes':
|
49
|
+
const keyframesRule = new CSSKeyframesRule(PropertySymbol.illegalConstructor, window);
|
50
|
+
|
51
|
+
(<string>keyframesRule.name) = ruleParameters;
|
52
|
+
keyframesRule.parentStyleSheet = parentStyleSheet;
|
53
|
+
if (parentRule) {
|
54
|
+
if (
|
55
|
+
parentRule.type === CSSRuleTypeEnum.mediaRule ||
|
56
|
+
parentRule.type === CSSRuleTypeEnum.containerRule ||
|
57
|
+
parentRule.type === CSSRuleTypeEnum.supportsRule
|
58
|
+
) {
|
59
|
+
(<CSSMediaRule>parentRule).cssRules.push(keyframesRule);
|
60
|
+
}
|
61
|
+
} else {
|
62
|
+
cssRules.push(keyframesRule);
|
63
|
+
}
|
64
|
+
parentRule = keyframesRule;
|
65
|
+
break;
|
66
|
+
case '@media':
|
67
|
+
const mediums = ruleParameters.split(',');
|
68
|
+
const mediaRule = new CSSMediaRule(PropertySymbol.illegalConstructor, window);
|
69
|
+
|
70
|
+
for (const medium of mediums) {
|
71
|
+
mediaRule.media.appendMedium(medium.trim());
|
72
|
+
}
|
73
|
+
|
74
|
+
mediaRule.parentStyleSheet = parentStyleSheet;
|
75
|
+
if (parentRule) {
|
76
|
+
if (
|
77
|
+
parentRule.type === CSSRuleTypeEnum.mediaRule ||
|
78
|
+
parentRule.type === CSSRuleTypeEnum.containerRule ||
|
79
|
+
parentRule.type === CSSRuleTypeEnum.supportsRule
|
80
|
+
) {
|
81
|
+
(<CSSMediaRule>parentRule).cssRules.push(mediaRule);
|
82
|
+
}
|
83
|
+
} else {
|
84
|
+
cssRules.push(mediaRule);
|
85
|
+
}
|
86
|
+
parentRule = mediaRule;
|
87
|
+
break;
|
88
|
+
case '@container':
|
89
|
+
case '@-webkit-container':
|
90
|
+
const containerRule = new CSSContainerRule(PropertySymbol.illegalConstructor, window);
|
91
|
+
|
92
|
+
(<string>containerRule.conditionText) = ruleParameters;
|
93
|
+
containerRule.parentStyleSheet = parentStyleSheet;
|
94
|
+
|
95
|
+
if (parentRule) {
|
96
|
+
if (
|
97
|
+
parentRule.type === CSSRuleTypeEnum.mediaRule ||
|
98
|
+
parentRule.type === CSSRuleTypeEnum.containerRule ||
|
99
|
+
parentRule.type === CSSRuleTypeEnum.supportsRule
|
100
|
+
) {
|
101
|
+
(<CSSMediaRule>parentRule).cssRules.push(containerRule);
|
102
|
+
}
|
103
|
+
} else {
|
104
|
+
cssRules.push(containerRule);
|
105
|
+
}
|
106
|
+
|
107
|
+
parentRule = containerRule;
|
108
|
+
break;
|
109
|
+
case '@supports':
|
110
|
+
case '@-webkit-supports':
|
111
|
+
const supportsRule = new CSSSupportsRule(PropertySymbol.illegalConstructor, window);
|
112
|
+
|
113
|
+
(<string>supportsRule.conditionText) = ruleParameters;
|
114
|
+
supportsRule.parentStyleSheet = parentStyleSheet;
|
115
|
+
if (parentRule) {
|
116
|
+
if (
|
117
|
+
parentRule.type === CSSRuleTypeEnum.mediaRule ||
|
118
|
+
parentRule.type === CSSRuleTypeEnum.containerRule ||
|
119
|
+
parentRule.type === CSSRuleTypeEnum.supportsRule
|
120
|
+
) {
|
121
|
+
(<CSSMediaRule>parentRule).cssRules.push(supportsRule);
|
122
|
+
}
|
123
|
+
} else {
|
124
|
+
cssRules.push(supportsRule);
|
125
|
+
}
|
126
|
+
parentRule = supportsRule;
|
127
|
+
break;
|
128
|
+
case '@font-face':
|
129
|
+
const fontFaceRule = new CSSFontFaceRule(PropertySymbol.illegalConstructor, window);
|
130
|
+
|
131
|
+
fontFaceRule[PropertySymbol.cssText] = ruleParameters;
|
132
|
+
fontFaceRule.parentStyleSheet = parentStyleSheet;
|
133
|
+
if (parentRule) {
|
134
|
+
if (
|
135
|
+
parentRule.type === CSSRuleTypeEnum.mediaRule ||
|
136
|
+
parentRule.type === CSSRuleTypeEnum.containerRule ||
|
137
|
+
parentRule.type === CSSRuleTypeEnum.supportsRule
|
138
|
+
) {
|
139
|
+
(<CSSMediaRule>parentRule).cssRules.push(fontFaceRule);
|
140
|
+
}
|
141
|
+
} else {
|
142
|
+
cssRules.push(fontFaceRule);
|
143
|
+
}
|
144
|
+
parentRule = fontFaceRule;
|
145
|
+
break;
|
146
|
+
default:
|
147
|
+
// Unknown rule.
|
148
|
+
// We will create a new rule to let it grab its content, but we will not add it to the cssRules array.
|
149
|
+
const newRule = new CSSRule(PropertySymbol.illegalConstructor, window);
|
150
|
+
newRule.parentStyleSheet = parentStyleSheet;
|
151
|
+
parentRule = newRule;
|
152
|
+
break;
|
56
153
|
}
|
57
|
-
|
58
|
-
newRule.parentStyleSheet = parentStyleSheet;
|
59
|
-
cssRules.push(newRule);
|
60
|
-
parentRule = newRule;
|
61
|
-
} else if (
|
62
|
-
selectorText.startsWith('@container') ||
|
63
|
-
selectorText.startsWith('@-webkit-container')
|
64
|
-
) {
|
65
|
-
const conditionText = selectorText.replace(/@(-webkit-){0,1}container +/, '');
|
66
|
-
const newRule = new CSSContainerRule(PropertySymbol.illegalConstructor, window);
|
67
|
-
|
68
|
-
(<string>newRule.conditionText) = conditionText;
|
69
|
-
newRule.parentStyleSheet = parentStyleSheet;
|
70
|
-
cssRules.push(newRule);
|
71
|
-
parentRule = newRule;
|
72
|
-
} else if (
|
73
|
-
selectorText.startsWith('@supports') ||
|
74
|
-
selectorText.startsWith('@-webkit-supports')
|
75
|
-
) {
|
76
|
-
const conditionText = selectorText.replace(/@(-webkit-){0,1}supports +/, '');
|
77
|
-
const newRule = new CSSSupportsRule(PropertySymbol.illegalConstructor, window);
|
78
|
-
|
79
|
-
(<string>newRule.conditionText) = conditionText;
|
80
|
-
newRule.parentStyleSheet = parentStyleSheet;
|
81
|
-
cssRules.push(newRule);
|
82
|
-
parentRule = newRule;
|
83
|
-
} else if (selectorText.startsWith('@font-face')) {
|
84
|
-
const conditionText = selectorText.replace('@font-face', '');
|
85
|
-
const newRule = new CSSFontFaceRule(PropertySymbol.illegalConstructor, window);
|
86
|
-
|
87
|
-
newRule[PropertySymbol.cssText] = conditionText;
|
88
|
-
newRule.parentStyleSheet = parentStyleSheet;
|
89
|
-
cssRules.push(newRule);
|
90
|
-
parentRule = newRule;
|
91
|
-
} else if (selectorText[0] === '@') {
|
92
|
-
// Unknown rule.
|
93
|
-
// We will create a new rule to let it grab its content, but we will not add it to the cssRules array.
|
94
|
-
const newRule = new CSSRule(PropertySymbol.illegalConstructor, window);
|
95
|
-
newRule.parentStyleSheet = parentStyleSheet;
|
96
|
-
parentRule = newRule;
|
97
|
-
} else if (parentRule && parentRule.type === CSSRule.KEYFRAMES_RULE) {
|
154
|
+
} else if (parentRule && parentRule.type === CSSRuleTypeEnum.keyframesRule) {
|
98
155
|
const newRule = new CSSKeyframeRule(PropertySymbol.illegalConstructor, window);
|
99
156
|
(<string>newRule.keyText) = selectorText.trim();
|
100
157
|
newRule.parentStyleSheet = parentStyleSheet;
|
@@ -104,9 +161,9 @@ export default class CSSParser {
|
|
104
161
|
parentRule = newRule;
|
105
162
|
} else if (
|
106
163
|
parentRule &&
|
107
|
-
(parentRule.type ===
|
108
|
-
parentRule.type ===
|
109
|
-
parentRule.type ===
|
164
|
+
(parentRule.type === CSSRuleTypeEnum.mediaRule ||
|
165
|
+
parentRule.type === CSSRuleTypeEnum.containerRule ||
|
166
|
+
parentRule.type === CSSRuleTypeEnum.supportsRule)
|
110
167
|
) {
|
111
168
|
if (this.validateSelectorText(selectorText)) {
|
112
169
|
const newRule = new CSSStyleRule(PropertySymbol.illegalConstructor, window);
|
@@ -139,9 +196,9 @@ export default class CSSParser {
|
|
139
196
|
.trim()
|
140
197
|
.replace(/([^;])$/, '$1;'); // Ensure last semicolon
|
141
198
|
switch (parentRule.type) {
|
142
|
-
case
|
143
|
-
case
|
144
|
-
case
|
199
|
+
case CSSRuleTypeEnum.fontFaceRule:
|
200
|
+
case CSSRuleTypeEnum.keyframeRule:
|
201
|
+
case CSSRuleTypeEnum.styleRule:
|
145
202
|
(<CSSStyleRule>parentRule)[PropertySymbol.cssText] = cssText;
|
146
203
|
break;
|
147
204
|
}
|
@@ -199,6 +199,12 @@ export default class MediaQueryItem {
|
|
199
199
|
* @returns "true" if the rule matches.
|
200
200
|
*/
|
201
201
|
private matchesRule(rule: IMediaQueryRule): boolean {
|
202
|
+
const settings = new WindowBrowserContext(this.window).getSettings();
|
203
|
+
|
204
|
+
if (!settings) {
|
205
|
+
return false;
|
206
|
+
}
|
207
|
+
|
202
208
|
if (!rule.value) {
|
203
209
|
switch (rule.name) {
|
204
210
|
case 'min-width':
|
@@ -218,6 +224,10 @@ export default class MediaQueryItem {
|
|
218
224
|
case 'max-aspect-ratio':
|
219
225
|
case 'aspect-ratio':
|
220
226
|
return true;
|
227
|
+
case 'prefers-reduced-motion':
|
228
|
+
return settings.device.prefersReducedMotion === 'reduce';
|
229
|
+
case 'forced-colors':
|
230
|
+
return settings.device.forcedColors === 'active';
|
221
231
|
}
|
222
232
|
return false;
|
223
233
|
}
|
@@ -246,9 +256,13 @@ export default class MediaQueryItem {
|
|
246
256
|
? this.window.innerWidth > this.window.innerHeight
|
247
257
|
: this.window.innerWidth < this.window.innerHeight;
|
248
258
|
case 'prefers-color-scheme':
|
259
|
+
return rule.value === settings.device.prefersColorScheme;
|
260
|
+
case 'prefers-reduced-motion':
|
261
|
+
return rule.value === settings.device.prefersReducedMotion;
|
262
|
+
case 'forced-colors':
|
249
263
|
return (
|
250
|
-
rule.value ===
|
251
|
-
|
264
|
+
(rule.value === 'none' || rule.value === 'active') &&
|
265
|
+
rule.value === settings.device.forcedColors
|
252
266
|
);
|
253
267
|
case 'any-hover':
|
254
268
|
case 'hover':
|
@@ -455,7 +455,9 @@ export default class HTMLLinkElement extends HTMLElement {
|
|
455
455
|
browserFrame.page?.console.error(error);
|
456
456
|
this.dispatchEvent(new Event('error'));
|
457
457
|
} else {
|
458
|
-
const styleSheet = new
|
458
|
+
const styleSheet = new this[PropertySymbol.ownerDocument][
|
459
|
+
PropertySymbol.window
|
460
|
+
].CSSStyleSheet();
|
459
461
|
styleSheet.replaceSync(code);
|
460
462
|
this[PropertySymbol.sheet] = styleSheet;
|
461
463
|
|
@@ -79,7 +79,9 @@ export default class HTMLStyleElement extends HTMLElement {
|
|
79
79
|
return null;
|
80
80
|
}
|
81
81
|
if (!this[PropertySymbol.sheet]) {
|
82
|
-
this[PropertySymbol.sheet] = new
|
82
|
+
this[PropertySymbol.sheet] = new this[PropertySymbol.ownerDocument][
|
83
|
+
PropertySymbol.window
|
84
|
+
].CSSStyleSheet();
|
83
85
|
this[PropertySymbol.sheet].replaceSync(this.textContent);
|
84
86
|
}
|
85
87
|
return this[PropertySymbol.sheet];
|
@@ -97,7 +97,9 @@ export default class SVGStyleElement extends SVGElement {
|
|
97
97
|
return null;
|
98
98
|
}
|
99
99
|
if (!this[PropertySymbol.sheet]) {
|
100
|
-
this[PropertySymbol.sheet] = new
|
100
|
+
this[PropertySymbol.sheet] = new this[PropertySymbol.ownerDocument][
|
101
|
+
PropertySymbol.window
|
102
|
+
].CSSStyleSheet();
|
101
103
|
this[PropertySymbol.sheet].replaceSync(this.textContent);
|
102
104
|
}
|
103
105
|
return this[PropertySymbol.sheet];
|