Ticket #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: | ||
| Blocking: | Blocked by: |
Description
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
comment:2 Changed 15 months 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 13 months ago by dmethvin
- Owner set to dmethvin
- Status changed from open to assigned
comment:4 Changed 11 months ago by dmethvin
- Priority changed from undecided to low
- Component changed from unfiled to attributes
- Milestone changed from None to 1.8
comment:5 Changed 11 months ago by Dave Methvin
- Status changed from assigned to closed
- Resolution set to fixed
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
Please follow the bug reporting guidlines and use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

Pull request: https://github.com/jquery/jquery/pull/724