You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 [email protected] on 1 May 2013 at 4:07
The text was updated successfully, but these errors were encountered:
Original issue reported on code.google.com by
[email protected]
on 1 May 2013 at 4:07The text was updated successfully, but these errors were encountered: