Index: trunk/phase3/resources/mediawiki/mediawiki.js |
— | — | @@ -421,7 +421,7 @@ |
422 | 422 | return s; |
423 | 423 | } |
424 | 424 | |
425 | | - function addInlineCSS( css, media ) { |
| 425 | + function addInlineCSS( css ) { |
426 | 426 | var $style, style, $newStyle; |
427 | 427 | $style = getMarker().prev(); |
428 | 428 | if ( $style.is( 'style' ) && $style.data( 'ResourceLoaderDynamicStyleTag' ) === true ) { |
— | — | @@ -435,7 +435,6 @@ |
436 | 436 | } |
437 | 437 | } else { |
438 | 438 | $newStyle = $( addStyleTag( css, getMarker() ) ) |
439 | | - .attr( 'media', media ) |
440 | 439 | .data( 'ResourceLoaderDynamicStyleTag', true ); |
441 | 440 | } |
442 | 441 | } |
— | — | @@ -728,19 +727,19 @@ |
729 | 728 | |
730 | 729 | // Add styles |
731 | 730 | if ( $.isPlainObject( registry[module].style ) ) { |
| 731 | + // 'media' type ignored, see documentation of mw.loader.implement |
732 | 732 | for ( media in registry[module].style ) { |
733 | 733 | style = registry[module].style[media]; |
734 | 734 | if ( $.isArray( style ) ) { |
735 | 735 | for ( i = 0; i < style.length; i += 1 ) { |
736 | 736 | getMarker().before( mw.html.element( 'link', { |
737 | 737 | 'type': 'text/css', |
738 | | - 'media': media, |
739 | 738 | 'rel': 'stylesheet', |
740 | 739 | 'href': style[i] |
741 | 740 | } ) ); |
742 | 741 | } |
743 | 742 | } else if ( typeof style === 'string' ) { |
744 | | - addInlineCSS( style, media ); |
| 743 | + addInlineCSS( style ); |
745 | 744 | } |
746 | 745 | } |
747 | 746 | } |
— | — | @@ -1112,7 +1111,12 @@ |
1113 | 1112 | * @param script Mixed: Function of module code or String of URL to be used as the src |
1114 | 1113 | * attribute when adding a script element to the body |
1115 | 1114 | * @param style Object: Object of CSS strings keyed by media-type or Object of lists of URLs |
1116 | | - * keyed by media-type |
| 1115 | + * keyed by media-type. Media-type should be "all" or "", actual types are not supported |
| 1116 | + * right now due to the way execute() processes the stylesheets (they are concatenated |
| 1117 | + * into a single <style> tag). In the past these weren't concatenated together (which is |
| 1118 | + * these are keyed by media-type), but bug 31676 forces us to. In practice this is not a |
| 1119 | + * problem because ResourceLoader only generates stylesheets for media-type all (e.g. print |
| 1120 | + * stylesheets are wrapped in @media print {} and concatenated with the others). |
1117 | 1121 | * @param msgs Object: List of key/value pairs to be passed through mw.messages.set |
1118 | 1122 | */ |
1119 | 1123 | implement: function ( module, script, style, msgs ) { |