* It is now possible to delete images that have no corresponding description pages.
* (bug 33165) GlobalFunctions.php line 1312: Call to a member function
getText() on a non-object
+* (bug 31676) Group dynamically inserted CSS into a single <style> tag, to work
+ around a bug where not all styles were applied in Internet Explorer
=== API changes in 1.19 ===
* Made action=edit less likely to return "unknownerror", by returning the actual error
/* Private methods */
- function getMarker(){
+ function getMarker() {
// Cached ?
if ( $marker ) {
return $marker;
return $marker;
}
}
+
+ function addInlineCSS( css, media ) {
+ var $style = getMarker().prev();
+ if ( $style.is( 'style' ) && $style.data( 'ResourceLoaderDynamicStyleTag' ) === true ) {
+ // There's already a dynamic <style> tag present, append to it
+ // This recycling of <style> tags is for bug 31676 (can't have
+ // more than 32 <style> tags in IE)
+
+ // Do cdata sanitization on the provided CSS, and prepend a double newline
+ css = $( mw.html.element( 'style', {}, new mw.html.Cdata( "\n\n" + css ) ) ).html();
+ $style.append( css );
+ } else {
+ // Create a new <style> tag and insert it
+ $style = $( mw.html.element( 'style', {
+ 'type': 'text/css',
+ 'media': media
+ }, new mw.html.Cdata( css ) ) );
+ $style.data( 'ResourceLoaderDynamicStyleTag', true );
+ getMarker().before( $style );
+ }
+ }
function compare( a, b ) {
var i;
} ) );
}
} else if ( typeof style === 'string' ) {
- getMarker().before( mw.html.element( 'style', {
- 'type': 'text/css',
- 'media': media
- }, new mw.html.Cdata( style ) ) );
+ addInlineCSS( style, media );
}
}
}