- Notifications
You must be signed in to change notification settings - Fork20.6k
Commitb40a480
authored
Attributes: Shave off a couple of bytes
The `attrHooks` entries for boolean attributes are only defined for jQuery 4+;jQuery 3.x used a separate mechanism - assigning them to`jQuery.expr.attrHandle`. That object used to be maintained by Sizzle, sincejQuery 3.7.0 it's kept in the selector module. Because of that, the `isXMLDoc`check used to be require in this hook.Now that standard `attrHooks` are used, the `isXMLDoc` check already happensinside of `jQuery.attr` and there's no need to repeat it in the test. Note thatthis repetition is even incorrect - while Sizzle's `jQuery.find.attr` used totreat an `undefined` output of the hooks from `jQuery.expr.attrHandle` as a wayto opt out of the hook, jQuery's `attrHooks` use `null` to opt out of a getterhook.Apart from the size, this patch also avoids unnecessary extra checks.Closesgh-53981 parent805cdb4 commitb40a480
1 file changed
+3
-10
lines changedLines changed: 3 additions & 10 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
108 | 108 |
| |
109 | 109 |
| |
110 | 110 |
| |
111 |
| - | |
112 |
| - | |
113 |
| - | |
114 |
| - | |
115 |
| - | |
116 |
| - | |
117 |
| - | |
118 |
| - | |
119 |
| - | |
120 |
| - | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
121 | 114 |
| |
122 | 115 |
| |
123 | 116 |
| |
|
0 commit comments
Comments
(0)