File tree Expand file tree Collapse file tree 4 files changed +10
-7
lines changed
Expand file tree Collapse file tree 4 files changed +10
-7
lines changed Original file line number Diff line number Diff line change @@ -97,7 +97,15 @@ if ( isIE ) {
9797 } ;
9898}
9999
100- jQuery . each ( jQuery . expr . match . bool . source . match ( / \w + / g ) , function ( _i , name ) {
100+ // HTML boolean attributes have special behavior:
101+ // we consider the lowercase name to be the only valid value, so
102+ // getting (if the attribute is present) normalizes to that, as does
103+ // setting to any non-`false` value (and setting to `false` removes the attribute).
104+ // See https://html.spec.whatwg.org/multipage/common-microsyntaxes.html#boolean-attributes
105+ jQuery . each ( (
106+ "checked selected async autofocus autoplay controls defer disabled " +
107+ "hidden ismap loop multiple open readonly required scoped"
108+ ) . split ( " " ) , function ( _i , name ) {
101109 jQuery . attrHooks [ name ] = {
102110 get : function ( elem ) {
103111 var ret ,
Original file line number Diff line number Diff line change @@ -25,7 +25,6 @@ import { jQuery } from "./core.js";
2525import { document } from "./var/document.js" ;
2626import { whitespace } from "./var/whitespace.js" ;
2727import { isIE } from "./var/isIE.js" ;
28- import { booleans } from "./selector/var/booleans.js" ;
2928import { rleadingCombinator } from "./selector/var/rleadingCombinator.js" ;
3029import { rdescend } from "./selector/var/rdescend.js" ;
3130import { rsibling } from "./selector/var/rsibling.js" ;
@@ -41,7 +40,6 @@ import "./selector/escapeSelector.js";
4140import "./selector/uniqueSort.js" ;
4241
4342var matchExpr = jQuery . extend ( {
44- bool : new RegExp ( "^(?:" + booleans + ")$" , "i" ) ,
4543 needsContext : new RegExp ( "^" + whitespace + "*[>+~]" )
4644} , filterMatchExpr ) ;
4745
Original file line number Diff line number Diff line change @@ -9,7 +9,6 @@ import { rbuggyQSA } from "./selector/rbuggyQSA.js";
99import { rtrimCSS } from "./var/rtrimCSS.js" ;
1010import { isIE } from "./var/isIE.js" ;
1111import { identifier } from "./selector/var/identifier.js" ;
12- import { booleans } from "./selector/var/booleans.js" ;
1312import { rleadingCombinator } from "./selector/var/rleadingCombinator.js" ;
1413import { rdescend } from "./selector/var/rdescend.js" ;
1514import { rsibling } from "./selector/var/rsibling.js" ;
@@ -24,6 +23,7 @@ import { tokenize } from "./selector/tokenize.js";
2423import { toSelector } from "./selector/toSelector.js" ;
2524
2625// The following utils are attached directly to the jQuery object.
26+ import "./attributes/attr.js" ; // jQuery.attr
2727import "./selector/escapeSelector.js" ;
2828import "./selector/uniqueSort.js" ;
2929
5050 ridentifier = new RegExp ( "^" + identifier + "$" ) ,
5151
5252 matchExpr = jQuery . extend ( {
53- bool : new RegExp ( "^(?:" + booleans + ")$" , "i" ) ,
5453
5554 // For use in libraries implementing .is()
5655 // We use this for POS matching in `select`
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments