@@ -62,9 +62,7 @@ export function getNative<T>(
62
62
63
63
export const nativeSetTimeout =
64
64
typeof window !== 'undefined'
65
- ? ( getNative < typeof window . setTimeout > ( 'setTimeout' ) . bind (
66
- window ,
67
- ) as typeof window . setTimeout )
65
+ ? getNative < typeof window . setTimeout > ( 'setTimeout' ) . bind ( window )
68
66
: global . setTimeout ;
69
67
70
68
/**
@@ -159,44 +157,6 @@ export function stringifyStylesheet(s: CSSStyleSheet): string | null {
159
157
}
160
158
}
161
159
162
- function replaceChromeGridTemplateAreas ( rule : CSSStyleRule ) : string {
163
- const hasGridTemplateInCSSText = rule . cssText . includes ( 'grid-template:' ) ;
164
- const hasGridTemplateAreaInStyleRules =
165
- rule . style . getPropertyValue ( 'grid-template-areas' ) !== '' ;
166
- const hasGridTemplateAreaInCSSText = rule . cssText . includes (
167
- 'grid-template-areas:' ,
168
- ) ;
169
- if (
170
- isCSSStyleRule ( rule ) &&
171
- hasGridTemplateInCSSText &&
172
- hasGridTemplateAreaInStyleRules &&
173
- ! hasGridTemplateAreaInCSSText
174
- ) {
175
- // chrome does not correctly provide the grid template areas in the rules cssText
176
- // e.g. https://bugs.chromium.org/p/chromium/issues/detail?id=1303968
177
- // we remove the grid-template rule from the text... so everything from grid-template: to the next semicolon
178
- // and then add each grid-template-x rule into the css text because Chrome isn't doing this correctly
179
- const parts = rule . cssText
180
- . split ( ';' )
181
- . filter ( ( s ) => ! s . includes ( 'grid-template:' ) )
182
- . map ( ( s ) => s . trim ( ) ) ;
183
-
184
- const gridStyles : string [ ] = [ ] ;
185
-
186
- for ( let i = 0 ; i < rule . style . length ; i ++ ) {
187
- const styleName = rule . style [ i ] ;
188
- if ( styleName . startsWith ( 'grid-template' ) ) {
189
- gridStyles . push (
190
- `${ styleName } : ${ rule . style . getPropertyValue ( styleName ) } ` ,
191
- ) ;
192
- }
193
- }
194
- parts . splice ( parts . length - 1 , 0 , gridStyles . join ( '; ' ) ) ;
195
- return parts . join ( '; ' ) ;
196
- }
197
- return rule . cssText ;
198
- }
199
-
200
160
export function stringifyRule ( rule : CSSRule , sheetHref : string | null ) : string {
201
161
if ( isCSSImportRule ( rule ) ) {
202
162
let importStringified ;
@@ -222,9 +182,6 @@ export function stringifyRule(rule: CSSRule, sheetHref: string | null): string {
222
182
// see https://bugs.webkit.org/show_bug.cgi?id=184604
223
183
ruleStringified = fixSafariColons ( ruleStringified ) ;
224
184
}
225
- if ( isCSSStyleRule ( rule ) ) {
226
- ruleStringified = replaceChromeGridTemplateAreas ( rule ) ;
227
- }
228
185
if ( sheetHref ) {
229
186
return absolutifyURLs ( ruleStringified , sheetHref ) ;
230
187
}
0 commit comments