Merge "build: Enable jscs jsDoc rule 'checkParamNames' and make pass"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Wed, 30 Sep 2015 21:34:03 +0000 (21:34 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Wed, 30 Sep 2015 21:34:03 +0000 (21:34 +0000)
1  2 
resources/src/mediawiki/mediawiki.js
tests/qunit/suites/resources/jquery/jquery.tablesorter.test.js

                 * Used by Message#parser().
                 *
                 * @since 1.25
-                * @param {string} fmt Format string
+                * @param {string} formatString Format string
                 * @param {Mixed...} parameters Values for $N replacements
                 * @return {string} Formatted string
                 */
                                        // Verify that the element before the marker actually is a
                                        // <style> tag and one that came from ResourceLoader
                                        // (not some other style tag or even a `<meta>` or `<script>`).
 -                                      if ( $style.data( 'ResourceLoaderDynamicStyleTag' ) === true ) {
 +                                      if ( $style.data( 'ResourceLoaderDynamicStyleTag' ) ) {
                                                // There's already a dynamic <style> tag present and
                                                // we are able to append more to it.
                                                styleEl = $style.get( 0 );
                                                // Support: IE6-10
                                                if ( styleEl.styleSheet ) {
                                                        try {
 -                                                              styleEl.styleSheet.cssText += cssText;
 +                                                              // Support: IE9
 +                                                              // We can't do styleSheet.cssText += cssText, since IE9 mangles this property on
 +                                                              // write, dropping @media queries from the CSS text. If we read it and used its
 +                                                              // value, we would accidentally apply @media-specific styles to all media. (T108727)
 +                                                              if ( document.documentMode === 9 ) {
 +                                                                      styleEl.styleSheet.cssText = $style.data( 'ResourceLoaderDynamicStyleTag' ) + cssText;
 +                                                              } else {
 +                                                                      styleEl.styleSheet.cssText += cssText;
 +                                                              }
                                                        } catch ( e ) {
                                                                mw.track( 'resourceloader.exception', { exception: e, source: 'stylesheet' } );
                                                        }
                                        }
                                }
  
 -                              $( newStyleTag( cssText, getMarker() ) ).data( 'ResourceLoaderDynamicStyleTag', true );
 +                              $style = $( newStyleTag( cssText, getMarker() ) );
 +
 +                              if ( document.documentMode === 9 ) {
 +                                      // Support: IE9
 +                                      // Preserve original CSS text because IE9 mangles it on write
 +                                      $style.data( 'ResourceLoaderDynamicStyleTag', cssText );
 +                              } else {
 +                                      $style.data( 'ResourceLoaderDynamicStyleTag', true );
 +                              }
  
                                fireCallbacks();
                        }
                         * execute the module or job now.
                         *
                         * @private
-                        * @param {Array} module Names of modules to be checked
+                        * @param {Array} modules Names of modules to be checked
                         * @return {boolean} True if all modules are in state 'ready', false otherwise
                         */
                        function allReady( modules ) {
                         * order.
                         *
                         * @private
-                        * @param {string[]} module Array of string module names
+                        * @param {string[]} modules Array of string module names
                         * @return {Array} List of dependencies, including 'module'.
                         */
                        function resolve( modules ) {
                        tokens: new Map()
                },
  
 +              // OOUI widgets specific to MediaWiki
 +              widgets: {},
 +
                /**
                 * Registry and firing of events.
                 *
                        [ 'January 01 2010' ],
                        [ 'January 16 2010' ],
                        [ 'February 05 2010' ]
 +              ],
 +              isoDateSorting = [
 +                      [ '2010-02-01' ],
 +                      [ '2009-12-25T12:30:45.001Z' ],
 +                      [ '2010-01-31' ],
 +                      [ '2009' ],
 +                      [ '2009-12-25T12:30:45' ],
 +                      [ '2009-12-25T12:30:45.111' ],
 +                      [ '2009-12-25T12:30:45+01:00' ]
 +              ],
 +              isoDateSortingSorted = [
 +                      [ '2009' ],
 +                      [ '2009-12-25T12:30:45' ],
 +                      [ '2009-12-25T12:30:45+01:00' ],
 +                      [ '2009-12-25T12:30:45.001Z' ],
 +                      [ '2009-12-25T12:30:45.111' ],
 +                      [ '2010-01-31' ],
 +                      [ '2010-02-01' ]
                ];
  
        QUnit.module( 'jquery.tablesorter', QUnit.newMwEnvironment( {
         * running some callback on it, then checking the results.
         *
         * @param {String} msg text to pass on to qunit for the comparison
-        * @param {String} HTML to make the table
-        * @param {String[][]} expected rows/cols to compare against at end
-        * @param {function($table)} callback something to do with the table before we compare
+        * @param {String} html HTML to make the table
+        * @param {String[][]} expected Rows/cols to compare against at end
+        * @param {function($table)} callback Something to do with the table before we compare
         */
        function tableTestHTML( msg, html, expected, callback ) {
                QUnit.test( msg, 1, function ( assert ) {
                }
        );
  
 +      tableTest(
 +              'ISO date sorting',
 +              [ 'isoDate' ],
 +              isoDateSorting,
 +              isoDateSortingSorted,
 +              function ( $table ) {
 +                      mw.config.set( 'wgDefaultDateFormat', 'dmy' );
 +
 +                      $table.tablesorter();
 +                      $table.find( '.headerSort:eq(0)' ).click();
 +              }
 +      );
 +
        QUnit.test( 'Sorting images using alt text', 1, function ( assert ) {
                var $table = $(
                        '<table class="sortable">' +