};
}
-jQuery.each( jQuery.expr.match.bool.source.match( /\w+/g ), function( _i, name ) {
+// HTML boolean attributes have special behavior:
+// we consider the lowercase name to be the only valid value, so
+// getting (if the attribute is present) normalizes to that, as does
+// setting to any non-`false` value (and setting to `false` removes the attribute).
+// See https://html.spec.whatwg.org/multipage/common-microsyntaxes.html#boolean-attributes
+jQuery.each( (
+ "checked selected async autofocus autoplay controls defer disabled " +
+ "hidden ismap loop multiple open readonly required scoped"
+).split( " " ), function( _i, name ) {
jQuery.attrHooks[ name ] = {
get: function( elem ) {
var ret,
import { document } from "./var/document.js";
import { whitespace } from "./var/whitespace.js";
import { isIE } from "./var/isIE.js";
-import { booleans } from "./selector/var/booleans.js";
import { rleadingCombinator } from "./selector/var/rleadingCombinator.js";
import { rdescend } from "./selector/var/rdescend.js";
import { rsibling } from "./selector/var/rsibling.js";
import "./selector/uniqueSort.js";
var matchExpr = jQuery.extend( {
- bool: new RegExp( "^(?:" + booleans + ")$", "i" ),
needsContext: new RegExp( "^" + whitespace + "*[>+~]" )
}, filterMatchExpr );
import { rtrimCSS } from "./var/rtrimCSS.js";
import { isIE } from "./var/isIE.js";
import { identifier } from "./selector/var/identifier.js";
-import { booleans } from "./selector/var/booleans.js";
import { rleadingCombinator } from "./selector/var/rleadingCombinator.js";
import { rdescend } from "./selector/var/rdescend.js";
import { rsibling } from "./selector/var/rsibling.js";
import { toSelector } from "./selector/toSelector.js";
// The following utils are attached directly to the jQuery object.
+import "./attributes/attr.js"; // jQuery.attr
import "./selector/escapeSelector.js";
import "./selector/uniqueSort.js";
ridentifier = new RegExp( "^" + identifier + "$" ),
matchExpr = jQuery.extend( {
- bool: new RegExp( "^(?:" + booleans + ")$", "i" ),
// For use in libraries implementing .is()
// We use this for POS matching in `select`
+++ /dev/null
-export var booleans = "checked|selected|async|autofocus|autoplay|controls|" +
- "defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped";