Page MenuHomePhabricator

"Invalid argument" error when mw.util.addCSS is used and various modules are loaded
Closed, ResolvedPublic

Description

If I go to
http://pt.wikibooks.org/wiki/Especial:Prefer%C3%AAncias?uselang=qqx#mw-prefsection-gadgets
and enable this first group of gadgets:
[1] IEbug
[2] Edittools
[3] Correlatos
[4] ExpandAllOnPrint
[5] FeedbackHighlight
[6] rev-e-avisos
[7] ProgressLevel

or this second group of gadgets: [1], [2], [3], [4] and
[8] BookGadgets

and open the page
http://pt.wikibooks.org/w/index.php?title=Test&action=edit&debug=1&uselang=en

using IE9, I get the error

Line: 170

Error: Invalid argument.

The line 170 is this part of the definition of mw.util.addCSS:
s.styleSheet.cssText = text; // IE
http://svn.wikimedia.org/viewvc/mediawiki/trunk/phase3/resources/mediawiki/mediawiki.util.js?view=markup#l164

The error disapears if

  • I disable any of the gadgets in the first group above (and keep the other 6 enabled) or
  • I disable any of the gadgets in the second group above (and keep the other 4 enabled)

The code of [[MediaWiki:Gadget-IEbug.js]] is just
mw.util.addCSS( 'a { color: red; }' );
mw.util.addCSS( 'a { color: blue; }' );
and was created to try to find the cause of the bug, which was happening on
https://pt.wikibooks.org/wiki/MediaWiki:Gadget-Internet_Explorer.js
(which was copied from [[MediaWiki:Common.js]])


Version: unspecified
Severity: normal
URL: http://pt.wikibooks.org/w/index.php?title=Test&action=edit&debug=1&uselang=en

Details

Reference
bz34276
TitleReferenceAuthorSource BranchDest Branch
Add initial form-contents savingrepos/commtech/wishlist-intake!13samwilsonsave-form-T362761main
Customize query in GitLab

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 22 2014, 12:16 AM
bzimport set Reference to bz34276.
bzimport added a subscriber: Unknown Object (MLST).

(In reply to comment #0)

The code of [[MediaWiki:Gadget-IEbug.js]] is just

I mean, [[wikibooks:pt:MediaWiki:Gadget-IEbug.js]].

This error has nothing to do with those gadgets or mw.util.addCSS itself (at least not directly).

This is bug 31676. IE does not support more then 31 stylesheets. This is a known issue and there are several solutions but they either don't work well with our modularity or it causes other issues (such as @import).

Marking dupe of bug 31676.

  • This bug has been marked as a duplicate of bug 31676 ***
  • Bug 38032 has been marked as a duplicate of this bug. ***