Gecko is even crazier than I thought
authorAryeh Gregor <AryehGregor+gitcommit@gmail.com>
Fri, 13 May 2011 14:32:20 -0600
changeset 117 a34ed2ee42b3
parent 116 b1e60e246b57
child 118 39f401162a30
Gecko is even crazier than I thought
autoimplementation.html
--- a/autoimplementation.html	Fri May 13 14:19:28 2011 -0600
+++ b/autoimplementation.html	Fri May 13 14:32:20 2011 -0600
@@ -1619,9 +1619,11 @@
 		// Sigh, Gecko is crazy
 		var treeWalker = document.createTreeWalker(compareDiv1, NodeFilter.SHOW_ELEMENT, null, null);
 		while (treeWalker.nextNode()) {
-			treeWalker.currentNode.removeAttribute("_moz_dirty");
-			if (treeWalker.currentNode.getAttribute("type") == "_moz") {
-				treeWalker.currentNode.removeAttribute("type");
+			var remove = [].filter.call(treeWalker.currentNode.attributes, function(attrib) {
+				return /^_moz_/.test(attrib.name) || attrib.value == "_moz";
+			});
+			for (var i = 0; i < remove.length; i++) {
+				treeWalker.currentNode.removeAttribute(remove[i].name);
 			}
 		}
 		var compareDiv2 = compareDiv1.cloneNode(false);