The import CSS at-rule can only go in the very top of a style sheet.
(Technically, the charset at-rule may precede it, but that rule is not valid
for style sheets that are embedded in <style> tags.) So we don't need to scan
the entire CSS text for '@import' -- we just have to make sure that the CSS
text doesn't start with it.
Change-Id: I56c2ebd55d4a7e90dde8e89e76b6d1b52ed004f8
// Makes sure that cssText containing `@import`
// rules will end up in a new stylesheet (as those only work when
// placed at the start of a stylesheet; bug 35562).
- return cssText.indexOf( '@import' ) === -1;
+ return cssText.slice( 0, '@import'.length ) !== '@import';
}
/**