Page MenuHomePhabricator

Remove "@import prevents parallel downloads" notice from css pages
Open, Needs TriagePublicBUG REPORT

Description

Steps to replicate the issue (include links if applicable):

  • Ensure that “enable the editing toolbar” is checked in your preferences (aka “2010 wikitext editor”)
  • Edit a user CSS page (e.g. your enwiki common.css)
  • Add code importing another CSS page, for example:
@import url(https://www.wikidata.org/w/index.php?title=User:Lucas_Werkmeister/discussiontools-deemphasize-editsection.css&action=raw&ctype=text/css);
  • (You don’t need to actually save an edit)

What happens?:

  • A notice is shown (at the bottom above the “summary” field, and also in the “gutter” next to the line number of the offending line):

Info: @import prevents parallel downloads, use <link> instead.

What should have happened instead?:
There should be no such notice, for several reasons:

  • It’s not actionable. There’s no way for a user to add <link> tags to their page views; @import is the only option I’m aware of to include styles from another wiki page. (I’m not counting gadgets, nor “inlining” / copy+pasting the style contents into your common.css.)
  • It’s not accurate. The main reference I can find, don’t use @import on High Performance Web Sites (via StackOverflow), is from 2009. Nobody seems to have any evidence of the spec actually prohibiting parallel downloads of @imports (StackOverflow), browsers just didn’t do it at the time – but they do now: in my testing, both Firefox and Chromium load the four stylesheets referenced in my Wikidata common.css (permalink) in parallel without any issues.

Software version (skip for WMF-hosted wikis like Wikipedia):

Other information (browser name/version, screenshots, etc.):
This warning seems to come from CodeEditor’s copy of Ace: ace/worker-css.js, Line 7732