- // By default, always create a new <style>. Appending text to a <style> tag is
- // is a performance anti-pattern as it requires CSS to be reparsed (T47810).
- //
- // Support: IE 6-9
- // Try to re-use existing <style> tags due to the IE stylesheet limit (T33676).
- if ( isIE9 ) {
- $style = $( getMarker() ).prev();
- // Verify that the element before the marker actually is a <style> tag created
- // by mw.loader (not some other style tag, or e.g. a <meta> tag).
- if ( $style.data( 'ResourceLoaderDynamicStyleTag' ) ) {
- styleEl = $style[ 0 ];
- styleEl.appendChild( document.createTextNode( cssText ) );
- fireCallbacks();
- return;
- }
- // Else: No existing tag to reuse. Continue below and create the first one.
- }
-
- $style = $( newStyleTag( cssText, getMarker() ) );
-
- if ( isIE9 ) {
- $style.data( 'ResourceLoaderDynamicStyleTag', true );
- }