Merge "build: Switch QUnit package from deprecated 'qunitjs' to 'qunit'" into REL1_31
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Mon, 23 Apr 2018 17:08:34 +0000 (17:08 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Mon, 23 Apr 2018 17:08:34 +0000 (17:08 +0000)
RELEASE-NOTES-1.31
includes/libs/CSSMin.php
package.json
tests/phpunit/includes/libs/CSSMinTest.php
tests/selenium/selenium.sh

index 4af03ee..2758d4c 100644 (file)
@@ -130,7 +130,8 @@ production.
 * mediawiki/at-ease was replaced with wikimedia/at-ease.
 
 === Bug fixes in 1.31 ===
-* (T90902) Non-breaking space in header ID breaks anchor
+* (T90902) Non-breaking space in header ID breaks anchor.
+* (T189375) CSSMin now allows unquoted urls in `url()` syntax to start with a space.
 
 === Action API changes in 1.31 ===
 * (T185058) The 'name' value to tgprop for action=query&list=tags has been
index b538d3b..1ee7a3b 100644 (file)
@@ -421,7 +421,7 @@ class CSSMin {
                        //   is only supported in PHP 5.6. Use a getter method for now.
                        $urlRegex = '(' .
                                // Unquoted url
-                               'url\(\s*(?P<file0>[^\'"][^\?\)]+?)(?P<query0>\?[^\)]*?|)\s*\)' .
+                               'url\(\s*(?P<file0>[^\s\'"][^\?\)]+?)(?P<query0>\?[^\)]*?|)\s*\)' .
                                // Single quoted url
                                '|url\(\s*\'(?P<file1>[^\?\']+?)(?P<query1>\?[^\']*?|)\'\s*\)' .
                                // Double quoted url
index 03fd7a8..b9a7ccc 100644 (file)
@@ -5,7 +5,8 @@
     "qunit": "grunt qunit",
     "doc": "jsduck",
     "postdoc": "grunt copy:jsduck",
-    "selenium": "./tests/selenium/selenium.sh"
+    "selenium": "./tests/selenium/selenium.sh",
+    "selenium-test": "grunt webdriver:test"
   },
   "devDependencies": {
     "bluebird": "3.5.1",
index 02b3549..46bf2c6 100644 (file)
@@ -515,7 +515,7 @@ class CSSMinTest extends MediaWikiTestCase {
                                'foo { background: url(//localhost/styles.css?quoted=single) }',
                        ],
                        [
-                               'Background URL (containing parentheses; T60473)',
+                               'Background URL (double quoted, containing parentheses; T60473)',
                                'foo { background: url("//localhost/styles.css?query=(parens)") }',
                                'foo { background: url("//localhost/styles.css?query=(parens)") }',
                        ],
@@ -529,6 +529,11 @@ class CSSMinTest extends MediaWikiTestCase {
                                'foo { background: url(\'//localhost/styles.css?quote="\') }',
                                'foo { background: url("//localhost/styles.css?quote=\"") }',
                        ],
+                       [
+                               'Background URL (double quoted with outer spacing)',
+                               'foo { background: url( "http://localhost/styles.css?quoted=double" ) }',
+                               'foo { background: url(http://localhost/styles.css?quoted=double) }',
+                       ],
                        [
                                'Simple case with comments before url',
                                'foo { prop: /* some {funny;} comment */ url(bar.png); }',
index 519b7be..6b71019 100755 (executable)
@@ -6,4 +6,4 @@ function kill_chromedriver() {
     killall chromedriver > /dev/null
 }
 trap kill_chromedriver EXIT
-./node_modules/.bin/grunt webdriver:test
+npm run selenium-test