Small optimization to ResourceLoader's canExpandStylesheetWith()
authorOri Livneh <ori@wikimedia.org>
Mon, 23 Feb 2015 01:07:36 +0000 (17:07 -0800)
committerOri Livneh <ori@wikimedia.org>
Mon, 23 Feb 2015 01:07:36 +0000 (17:07 -0800)
commit731dd78677a659b7f1bbc0cd588cc03920f88e52
tree3098c8d322f9b622e88bbafd441253ffaf8d73b7
parenta756c3b753e34a479da69a88a3176fd2d3e7cfa2
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
resources/src/mediawiki/mediawiki.js