> On Friday, October 10, 2008 at 11:33PM Bob Ippolito wrote:
> 
> 
> If you'd like to fix it then I don't see why the patch would be rejected.
>

I assume that submitting patches through the mailing list is the way to go
since I have seen so many already done this way, but if I need to submit it
in some other way, please let me know.

Also let me know if there is anything else I need to do or missed something
or screwed up, etc. I appreciate the guidance.

Thanks,
Jason
 

Index: DOM.js
===================================================================
--- DOM.js      (revision 1429)
+++ DOM.js      (working copy)
@@ -640,7 +640,8 @@
 
     /** @id MochiKit.DOM.removeElement */
     removeElement: function (elem) {
-        var e = MochiKit.DOM.getElement(elem);
+        var self = MochiKit.DOM; 
+        var e = self.coerceToDOM(self.getElement(elem));
         e.parentNode.removeChild(e);
         return e;
     },
@@ -651,7 +652,7 @@
         dest = self.getElement(dest);
         var parent = dest.parentNode;
         if (src) {
-            src = self.getElement(src);
+            src = self.coerceToDOM(self.getElement(src), parent);
             parent.replaceChild(src, dest);
         } else {
             parent.removeChild(dest);



Index: test_MochiKit-DOM.html
===================================================================
--- test_MochiKit-DOM.html      (revision 1429)
+++ test_MochiKit-DOM.html      (working copy)
@@ -87,8 +87,11 @@
     is( d.getAttribute("value"), 'bar', "updateNodeAttributes updates value
attribute" );
 
     var d = document.createElement('span');
-    appendChildNodes(d, 'word up', [document.createElement('span')]);
-    isDOM( d, '<span>word up<span/></span>', 'appendChildNodes' );
+    var widg = new (function(){ var domrep = SPAN(null, "foo");
this.__dom__ = function(p){ return domrep; }; })();
+    appendChildNodes(d, 'word up', [document.createElement('span')], widg);
+    isDOM( d, '<span>word up<span/><span>foo</span></span>',
'appendChildNodes' );
+    removeElement(widg);
+    isDOM( d, '<span>word up<span/></span>', 'removeElement using DOM
Coercion Rules' );
 
     replaceChildNodes(d, 'Think Different');
     isDOM( d, '<span>Think Different</span>', 'replaceChildNodes' );
@@ -163,9 +166,12 @@
 
     d = createDOM("span", null, "one", "two");
     swapDOM(d.childNodes[0], document.createTextNode("uno"));
-    isDOM( d, "<span>unotwo</span>", "swapDOM" );
+    isDOM( d, "<span>unotwo</span>", "swapDOM" );    
+    var widg = new (function(){ var domrep = SPAN(null, "foo");
this.__dom__ = function(p){ return domrep; }; })();
+    swapDOM(d.childNodes[0], widg);
+    isDOM( d, "<span><span>foo</span>two</span>", "swapDOM using DOM
Coercion Rules" );
 
-    is( scrapeText(d, true).join(" "), "uno two", "multi-node scrapeText"
);
+    is( scrapeText(d, true).join(" "), "foo two", "multi-node scrapeText"
);
     /*
 
         TODO:



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"MochiKit" group.
To post to this group, send email to mochikit@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/mochikit?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to