resourceloader: Fully remove ResourceLoaderLESSFunctions
authorOri Livneh <ori@wikimedia.org>
Fri, 4 Sep 2015 00:38:05 +0000 (17:38 -0700)
committerKrinkle <krinklemail@gmail.com>
Fri, 4 Sep 2015 01:41:40 +0000 (01:41 +0000)
Deprecated in 1.24, for reasons explained in a0c41ae39d. I don't see any
usage in core or extensions.

Change-Id: I46f9e04ae633e7ff1ee112b652e1865731172f1f

RELEASE-NOTES-1.26
docs/extension.schema.json
includes/DefaultSettings.php
includes/resourceloader/ResourceLoader.php
tests/phpunit/data/less/common/test.common.mixins.less
tests/phpunit/data/less/module/styles.css
tests/phpunit/includes/resourceloader/ResourceLoaderTest.php

index ddf6f7d..ff7f884 100644 (file)
@@ -27,6 +27,8 @@ production.
   MediaWiki 1.26, in where ResourceLoader became fully asynchronous.
 * $wgMasterWaitTimeout was removed (deprecated in 1.24).
 * Fields in ParserOptions are now private. Use the accessors instead.
+* Custom LESS functions (defined via $wgResourceLoaderLESSFunctions)
+  have been removed, after being deprecated in 1.24.
 
 === New features in 1.26 ===
 * (T51506) Now action=info gives estimates of actual watchers for a page.
index 63bf1b5..d11635d 100644 (file)
                        "type": "object",
                        "description": "ResourceLoader LESS variables"
                },
-               "ResourceLoaderLESSFunctions": {
-                       "type": "object",
-                       "description": "ResourceLoader LESS functions"
-               },
                "ResourceLoaderLESSImportPaths": {
                        "type": "object",
                        "description": "ResourceLoader import paths"
index f0450a9..06cd55a 100644 (file)
@@ -3636,18 +3636,6 @@ $wgResourceLoaderValidateStaticJS = false;
  */
 $wgResourceLoaderLESSVars = array();
 
-/**
- * Custom LESS functions. An associative array mapping function name to PHP
- * callable.
- *
- * Changes to LESS functions do not trigger cache invalidation.
- *
- * @since 1.22
- * @deprecated since 1.24 Questionable usefulness and problematic to support,
- *     will be removed in the future.
- */
-$wgResourceLoaderLESSFunctions = array();
-
 /**
  * Default import paths for LESS modules. LESS files referenced in @import
  * statements will be looked up here first, and relative to the importing file
index 5fb6c96..b8ec63b 100644 (file)
@@ -1625,9 +1625,6 @@ MESSAGE;
                $less->setPreserveComments( true );
                $less->setVariables( self::getLessVars( $config ) );
                $less->setImportDir( $config->get( 'ResourceLoaderLESSImportPaths' ) );
-               foreach ( $config->get( 'ResourceLoaderLESSFunctions' ) as $name => $func ) {
-                       $less->registerFunction( $name, $func );
-               }
                return $less;
        }
 
index 2fbe9b7..4064729 100644 (file)
@@ -1,5 +1,4 @@
 .test-mixin (@value) {
        color: @value;
        border: @foo solid @Foo;
-       line-height: test-sum(@bar, 10, 20);
 }
index b78780a..e8099d1 100644 (file)
@@ -2,5 +2,4 @@
 .unit-tests {
   color: green;
   border: 2px solid #eeeeee;
-  line-height: 35;
 }
index cc20e7f..b683885 100644 (file)
@@ -6,15 +6,6 @@ class ResourceLoaderTest extends ResourceLoaderTestCase {
                parent::setUp();
 
                $this->setMwGlobals( array(
-                       'wgResourceLoaderLESSFunctions' => array(
-                               'test-sum' => function ( $frame, $less ) {
-                                       $sum = 0;
-                                       foreach ( $frame[2] as $arg ) {
-                                               $sum += (int)$arg[1];
-                                       }
-                                       return $sum;
-                               },
-                       ),
                        'wgResourceLoaderLESSImportPaths' => array(
                                dirname( dirname( __DIR__ ) ) . '/data/less/common',
                        ),