When trying to upgrade MediaWiki from jQuery 1.11.3 to jQuery 1.12.0 (supposed to be a minor release) one unit test fails in MobileFrontend.
Observed at https://gerrit.wikimedia.org/r/266093 and https://integration.wikimedia.org/ci/job/mediawiki-extensions-qunit/27568.
Chromium 47.0.2526 (Ubuntu 0.0.0) MobileFrontend toggle.js: Mobile mode. Clicking hash links FAILED
Error: Syntax error, unrecognized expression: [href=#First_Section] at Sizzle.tokenize at jQuery.fn.extend.find
See also http://blog.jquery.com/2016/01/08/jquery-2-2-and-1-12-released/. This previously worked by accident due to jQuery's selector parser being more tolerant than the standard/native implementation. The older version often needlessly used the fallback. The new one does not.
document.querySelectorAll('[href=#Foo]') // Uncaught DOMException: Failed to execute 'querySelectorAll' on 'Document': '[href=#Foo]' is not a valid selector.(…)