aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMichał Gołębiowski <m.goleb@gmail.com>2016-02-10 12:32:38 +0100
committerMichał Gołębiowski <m.goleb@gmail.com>2016-02-17 02:30:22 +0100
commit615d92517b52d7e70d1c83397ed8207373a95137 (patch)
treecf00a43f3728eb146473f62da2e0ecb81e5d1b20 /src
parent288028b5205d0143c0649240b8c04c3b562fb628 (diff)
downloadjquery-615d92517b52d7e70d1c83397ed8207373a95137.tar.gz
jquery-615d92517b52d7e70d1c83397ed8207373a95137.zip
Attributes: remove the lower-casing logic for attribute names
jQuery used to lower-case the attribute names passed to the .attr setter to workaround an old IE issue. This is no longer in jQuery 3.0 and removing it may even "accidentally" make this API sort-of work on SVGs (see gh-2910) so why not. Manual lowercasing had to be added to the place where the proper attrHook is retrieved so that it works regardless of the casing of the provided name. A regular `toLowerCase()` is enough there as those few attributes don't contain any non-ASCII characters. Fixes gh-2914 Closes gh-2916
Diffstat (limited to 'src')
-rw-r--r--src/attributes/attr.js12
1 files changed, 2 insertions, 10 deletions
diff --git a/src/attributes/attr.js b/src/attributes/attr.js
index 00b08489d..51bba773e 100644
--- a/src/attributes/attr.js
+++ b/src/attributes/attr.js
@@ -7,14 +7,7 @@ define( [
], function( jQuery, access, support, rnotwhite ) {
var boolHook,
- attrHandle = jQuery.expr.attrHandle,
-
- // Exclusively lowercase A-Z in attribute names (gh-2730)
- // https://dom.spec.whatwg.org/#converted-to-ascii-lowercase
- raz = /[A-Z]+/g,
- lowercase = function( ch ) {
- return ch.toLowerCase();
- };
+ attrHandle = jQuery.expr.attrHandle;
jQuery.fn.extend( {
attr: function( name, value ) {
@@ -46,8 +39,7 @@ jQuery.extend( {
// All attributes are lowercase
// Grab necessary hook if one is defined
if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) {
- name = name.replace( raz, lowercase );
- hooks = jQuery.attrHooks[ name ] ||
+ hooks = jQuery.attrHooks[ name.toLowerCase() ] ||
( jQuery.expr.match.bool.test( name ) ? boolHook : undefined );
}