Bug Tracker

Opened 5 years ago

Closed 5 years ago

#11547 closed bug (fixed)

XML DOM .removeAttr() doesn't remove cased attributes

Reported by: adebree Owned by: dmethvin
Priority: low Milestone: 1.8
Component: attributes Version: 1.7
Keywords: Cc:
Blocked by: Blocking:


In case of an XML DOM the .removeAttr() function doesn't remove cased attributes. XML is case sensitive so attributes provided with uppercase should be handled accordingly.

jsFiddle with the reproduction: http://jsfiddle.net/23w2d/

This problem seems to be introduced in 1.7, caused by an unconditioned .toLowerCase() in the removeAttr().

Pull request with the fix will be made after this ticket is created.

Change History (5)

comment:2 Changed 5 years ago by rwaldron

  • Status changed from new to open

Originally introduced here: https://github.com/jquery/jquery/commit/ce8d9c0ca59a8f03e119c80ed29c7dbc65efdd85#L0R357

The problem is that there were no tests that would've caught the regression.

comment:3 Changed 5 years ago by dmethvin

  • Owner set to dmethvin
  • Status changed from open to assigned

comment:4 Changed 5 years ago by dmethvin

  • Component changed from unfiled to attributes
  • Milestone changed from None to 1.8
  • Priority changed from undecided to low

comment:5 Changed 5 years ago by Dave Methvin

  • Resolution set to fixed
  • Status changed from assigned to closed

Fix #11547. toLowerCase not work good on XML attributes.

This was fixed to some extent in gh-724 but there were insufficient test cases. Removing the lowercase completely allows IE 6/7 to work properly since there you need an exact case match for attributes, even in HTML docs. More discussion and test cases in the comments on gh-724.

Changeset: f4e5c1729a2efe6086ac2407f82e928b26991f83

Note: See TracTickets for help on using tickets.