Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commite06ff08

Browse files
mgolgibson042
andauthored
Selector: Makeselector.js module depend onattributes/attr.js
This fixes custom builds using the `--include` switch that don't includethe `attributes` module.Fixesgh-5379Closesgh-5384Co-authored-by: Richard Gibson <richard.gibson@gmail.com>
1 parent5613939 commite06ff08

File tree

4 files changed

+10
-7
lines changed

4 files changed

+10
-7
lines changed

‎src/attributes/attr.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff 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
varret,

‎src/selector-native.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ import { jQuery } from "./core.js";
2525
import{document}from"./var/document.js";
2626
import{whitespace}from"./var/whitespace.js";
2727
import{isIE}from"./var/isIE.js";
28-
import{booleans}from"./selector/var/booleans.js";
2928
import{rleadingCombinator}from"./selector/var/rleadingCombinator.js";
3029
import{rdescend}from"./selector/var/rdescend.js";
3130
import{rsibling}from"./selector/var/rsibling.js";
@@ -41,7 +40,6 @@ import "./selector/escapeSelector.js";
4140
import"./selector/uniqueSort.js";
4241

4342
varmatchExpr=jQuery.extend({
44-
bool:newRegExp("^(?:"+booleans+")$","i"),
4543
needsContext:newRegExp("^"+whitespace+"*[>+~]")
4644
},filterMatchExpr);
4745

‎src/selector.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import { rbuggyQSA } from "./selector/rbuggyQSA.js";
99
import{rtrimCSS}from"./var/rtrimCSS.js";
1010
import{isIE}from"./var/isIE.js";
1111
import{identifier}from"./selector/var/identifier.js";
12-
import{booleans}from"./selector/var/booleans.js";
1312
import{rleadingCombinator}from"./selector/var/rleadingCombinator.js";
1413
import{rdescend}from"./selector/var/rdescend.js";
1514
import{rsibling}from"./selector/var/rsibling.js";
@@ -24,6 +23,7 @@ import { tokenize } from "./selector/tokenize.js";
2423
import{toSelector}from"./selector/toSelector.js";
2524

2625
// The following utils are attached directly to the jQuery object.
26+
import"./attributes/attr.js";// jQuery.attr
2727
import"./selector/escapeSelector.js";
2828
import"./selector/uniqueSort.js";
2929

@@ -50,7 +50,6 @@ var i,
5050
ridentifier=newRegExp("^"+identifier+"$"),
5151

5252
matchExpr=jQuery.extend({
53-
bool:newRegExp("^(?:"+booleans+")$","i"),
5453

5554
// For use in libraries implementing .is()
5655
// We use this for POS matching in `select`

‎src/selector/var/booleans.js

Lines changed: 0 additions & 2 deletions
This file was deleted.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp