[Webkit-unassigned] [Bug 26525] New: Implement swapNode

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Jun 18 15:55:17 PDT 2009


           Summary: Implement swapNode
           Product: WebKit
           Version: 528+ (Nightly build)
          Platform: All
               URL: http://msdn.microsoft.com/en-
        OS/Version: All
            Status: UNCONFIRMED
          Severity: Enhancement
          Priority: P2
         Component: HTML DOM
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: arv at chromium.org

Swapping the place of two nodes in a document is not that hard but it requires
more code than one would expect. It would be nice if we could add this MS

Here is a pure JS implementation:

Node.prototype.swapNode = function(that) {
  var nextSibling = this.nextSibling;
  if (nextSibling == that) {
  var thisParent = this.parentNode;
  that.parentNode.replaceChild(this, that);
  thisParent.insertBefore(that, nextSibling);

Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

More information about the webkit-unassigned mailing list