jenkins-bot has submitted this change and it was merged.

Change subject: Small optimization to ResourceLoader's canExpandStylesheetWith()
......................................................................


Small optimization to ResourceLoader's canExpandStylesheetWith()

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
---
M resources/src/mediawiki/mediawiki.js
1 file changed, 1 insertion(+), 1 deletion(-)

Approvals:
  Krinkle: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/resources/src/mediawiki/mediawiki.js 
b/resources/src/mediawiki/mediawiki.js
index 43c6422..90b8503 100644
--- a/resources/src/mediawiki/mediawiki.js
+++ b/resources/src/mediawiki/mediawiki.js
@@ -777,7 +777,7 @@
                                // 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';
                        }
 
                        /**

-- 
To view, visit https://gerrit.wikimedia.org/r/192255
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I56c2ebd55d4a7e90dde8e89e76b6d1b52ed004f8
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Ori.livneh <[email protected]>
Gerrit-Reviewer: Jack Phoenix <[email protected]>
Gerrit-Reviewer: Krinkle <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to