|JQuery 3.6.2 Updates Handling Of Chrome Selectors|
|Written by Ian Elliot|
|Thursday, 22 December 2022|
An updated version of JQuery has been released to enable the correct handling of the recently introduced selectors in Chrome.
The main reason behind the updated release of JQuery was to fully meet the changes experienced when Chrome recently introduced some new selectors, in particular :has(), which the JQuery team describes as a welcome addition, but because of a change to the use of “forgiving parsing”, one that could be problematic because even if the arguments for :has() were invalid, the browser returned no results instead of throwing an error. Because Sizzle relied on such errors to know when to trust native querySelectorAll, selectors that used to work were broken in all jQuery versions.
While the Chrome team implemented a workaround to fix previous jQuery versions, the updated version of jQuery now ensures that any forgiving parsing doesn’t break future jQuery versions, even if previous jQuery versions would still be affected.
The JQuery team took the opportunity to slot in another couple of minor improvements, the first of which revolves around undefined and whitespace-only CSS variables. This is a fix for a problem caused because if in jQuery 3.6.1 you attempt to retrieve a value for a custom CSS property that doesn't exist, JQuery throws an error instead of returning undefined. This has been fixed in 3.6.2. As a related matter, the developers have also made sure that whitespace-only values return the same thing across all browsers.
JQuery 3.6.2 is available now.
or email your comment to: firstname.lastname@example.org