What steps will reproduce the problem?
1. Using IE, add an onpropertychange event to a form control.
2. Use the classList.remove method to remove a non applied class.
What is the expected output? What do you see instead?
The onpropertychange event fires even though a class wasn't removed.
This can cause an infinite loop when the onpropertychange handler calls
classList.remove.
Please provide any additional information below.
Patch for this issue:
--- src/base2/dom/html/ClassList.js (revision 310)
+++ src/base2/dom/html/ClassList.js (working copy)
@@ -16,8 +16,10 @@
},
remove: function(element, token) {
- var regexp = new RegExp("(^|\\s)" + token + "(\\s|$)", "g");
- element.className = trim(element.className.replace(regexp, "$2"));
+ if (ClassList.contains(element, token)) {
+ var regexp = new RegExp("(^|\\s)" + token + "(\\s|$)", "g");
+ element.className = trim(element.className.replace(regexp, "$2"));
+ }
},
toggle: function(element, token) {
Original issue reported on code.google.com by pdeb...@staff.iinet.net.au on 1 May 2013 at 4:07
Original issue reported on code.google.com by
pdeb...@staff.iinet.net.au
on 1 May 2013 at 4:07