https://bugzilla.wikimedia.org/show_bug.cgi?id=61305
Web browser: ---
Bug ID: 61305
Summary: Flow: don't load CSS twice
Product: MediaWiki extensions
Version: master
Hardware: All
OS: All
Status: NEW
Severity: normal
Priority: Unprioritized
Component: Flow
Assignee: [email protected]
Reporter: [email protected]
CC: [email protected], [email protected],
[email protected], [email protected]
Mobile Platform: ---
Flow adds some modules with both addModuleStyles() and addModules(), e.g.
addModuleStyles( array( 'ext.flow.header' ) );
addModules( array( 'ext.flow.header' ) );
The first adds the CSS in a <link rel="stylesheet">, the second adds the same
CSS in a JavaScript mw.loader.load() call that appends to a <style> tag in the
document. It's a performance hit to add CSS twice and the duplicated Flow CSS
rules in browsers' CSS inspector make debugging harder.
addModuleStyles() should only be used to load a separate
'flow.<somefeature>.styles' module that only has the LESS and CSS files for the
no-JavaScript version. The LESS files for this could be named
<something>-nojs.less. addModules( 'flow.<somefeature>' ) should only include
LESS and CSS if it's only referenced by the module's JavaScript-generated HTML,
such as a JavaScript dialog with unique CSS classes.
^ BTW performance: you don't need to pass an array if it's just one module.
--
You are receiving this mail because:
You are the assignee for the bug.
You are on the CC list for the bug.
_______________________________________________
Wikibugs-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l