diff --git a/user/src/com/google/gwt/user/client/DOM.java b/user/src/com/google/gwt/user/client/DOM.java
index 28e724d..a1a3b2a 100644
--- a/user/src/com/google/gwt/user/client/DOM.java
+++ b/user/src/com/google/gwt/user/client/DOM.java
@@ -76,16 +76,16 @@
   }
 
   /**
-   * Compares two elements for equality (note that reference equality is not
-   * sufficient to determine equality among elements on most browsers).
+   * Compares two elements for equality.  Note that this method is now deprecated
+   * because reference identity accurately reports equality.
    * 
    * @param elem1 the first element to be compared
    * @param elem2 the second element to be compared
    * @return <code>true</code> if they are in fact the same element
-   * @see #isOrHasChild(Element, Element)
+   * @deprecated Use identity comparison.
    */
   public static boolean compare(Element elem1, Element elem2) {
-    return impl.compare(elem1, elem2);
+    return elem1 == elem2;
   }
 
   /**
@@ -931,7 +931,7 @@
    * @see #setCapture(Element)
    */
   public static void releaseCapture(Element elem) {
-    if ((sCaptureElem != null) && compare(elem, sCaptureElem)) {
+    if ((sCaptureElem != null) && elem == sCaptureElem) {
       sCaptureElem = null;
     }
     impl.releaseCapture(elem);
diff --git a/user/src/com/google/gwt/user/client/impl/DOMImpl.java b/user/src/com/google/gwt/user/client/impl/DOMImpl.java
index 4e7bb0623..e0e8c75 100644
--- a/user/src/com/google/gwt/user/client/impl/DOMImpl.java
+++ b/user/src/com/google/gwt/user/client/impl/DOMImpl.java
@@ -34,8 +34,6 @@
     return elem.cloneNode(deep);
   }-*/;
 
-  public abstract boolean compare(Element elem1, Element elem2);
-
   public native Element createElement(String tag) /*-{
     return $doc.createElement(tag);
   }-*/;
diff --git a/user/src/com/google/gwt/user/client/impl/DOMImplIE6.java b/user/src/com/google/gwt/user/client/impl/DOMImplIE6.java
index 5dd4ba9..dc95391 100644
--- a/user/src/com/google/gwt/user/client/impl/DOMImplIE6.java
+++ b/user/src/com/google/gwt/user/client/impl/DOMImplIE6.java
@@ -24,18 +24,13 @@
  */
 class DOMImplIE6 extends DOMImpl {
 
+  /**
+   * Referenced from JavaScript.
+   */
+  @SuppressWarnings("unused")
   private static Element currentEventTarget;
 
   @Override
-  public native boolean compare(Element elem1, Element elem2) /*-{
-    if (!elem1 && !elem2)
-      return true;
-    else if (!elem1 || !elem2)
-      return false;
-    return (elem1.uniqueID == elem2.uniqueID);
-  }-*/;
-
-  @Override
   public native Element createInputRadioElement(String name) /*-{
     return $doc.createElement("<INPUT type='RADIO' name='" + name + "'>");
   }-*/;
@@ -130,8 +125,9 @@
   public native int getChildIndex(Element parent, Element child) /*-{
     var count = parent.children.length;
     for (var i = 0; i < count; ++i) {
-      if (child.uniqueID == parent.children[i].uniqueID)
+      if (child === parent.children[i]) {
         return i;
+      }
     }
     return -1;
   }-*/;
@@ -246,7 +242,7 @@
   public native boolean isOrHasChild(Element parent, Element child) /*-{
     // An extra equality check is required due to the fact that
     // elem.contains(elem) is false if elem is not attached to the DOM.
-    return (parent.uniqueID == child.uniqueID) || parent.contains(child);  
+    return (parent === child) || parent.contains(child);
   }-*/;
 
   @Override
diff --git a/user/src/com/google/gwt/user/client/impl/DOMImplMozilla.java b/user/src/com/google/gwt/user/client/impl/DOMImplMozilla.java
index 1c2b824..5b9c8d3 100644
--- a/user/src/com/google/gwt/user/client/impl/DOMImplMozilla.java
+++ b/user/src/com/google/gwt/user/client/impl/DOMImplMozilla.java
@@ -19,24 +19,11 @@
 import com.google.gwt.user.client.Event;
 
 /**
- * Mozilla implementation of StandardBrowser. The main difference between
- * Mozilla and others is that element comparison must be done using isSameNode()
- * (== comparison doesn't always give you the right answer, probably because of
- * its JavaScript wrappers for xpcom dom nodes).
+ * Mozilla implementation of StandardBrowser.
  */
 class DOMImplMozilla extends DOMImplStandard {
 
   @Override
-  public native boolean compare(Element elem1, Element elem2) /*-{
-    if (!elem1 && !elem2) {
-      return true;
-    } else if (!elem1 || !elem2) {
-      return false;
-    }
-    return (elem1.isSameNode(elem2));
-  }-*/;
-
-  @Override
   public native int eventGetMouseWheelVelocityY(Event evt) /*-{
     return evt.detail || -1;
   }-*/;
@@ -88,34 +75,13 @@
   }-*/;
 
   @Override
-  public native int getChildIndex(Element parent, Element toFind) /*-{
-    var count = 0, child = parent.firstChild;
-    while (child) {
-      if (child.isSameNode(toFind)) {
-        return count;
-      }
-      if (child.nodeType == 1) {
-        ++count;
-      }
-      child = child.nextSibling;
-    }
-    return -1;
-  }-*/;
-
-  @Override
   public native boolean isOrHasChild(Element parent, Element child) /*-{
     // For more information about compareDocumentPosition, see:
     // http://www.quirksmode.org/blog/archives/2006/01/contains_for_mo.html
-    return parent.isSameNode(child) || !!(parent.compareDocumentPosition(child) & 16);  
+    return (parent === child) || !!(parent.compareDocumentPosition(child) & 16);  
   }-*/;
 
   @Override
-  public void releaseCapture(Element elem) {
-    maybeInitializeEventSystem();
-    releaseCaptureImpl(elem);
-  }
-
-  @Override
   public void sinkEvents(Element elem, int bits) {
     super.sinkEvents(elem, bits);
     sinkEventsMozilla(elem, bits);
@@ -171,10 +137,4 @@
     $wnd.addEventListener('DOMMouseScroll', $wnd.__dispatchCapturedMouseEvent,
       true);
   }-*/;
-
-  private native void releaseCaptureImpl(Element elem) /*-{
-    if (elem.isSameNode($wnd.__captureElem)) {
-      $wnd.__captureElem = null;
-    }
-  }-*/;
 }
diff --git a/user/src/com/google/gwt/user/client/impl/DOMImplStandard.java b/user/src/com/google/gwt/user/client/impl/DOMImplStandard.java
index 66ca744..82812a3 100644
--- a/user/src/com/google/gwt/user/client/impl/DOMImplStandard.java
+++ b/user/src/com/google/gwt/user/client/impl/DOMImplStandard.java
@@ -26,11 +26,6 @@
 abstract class DOMImplStandard extends DOMImpl {
 
   @Override
-  public native boolean compare(Element elem1, Element elem2) /*-{
-    return (elem1 == elem2);
-  }-*/;
-
-  @Override
   public native Element createInputRadioElement(String name) /*-{
     var elem = $doc.createElement("INPUT");
     elem.type = 'radio';
@@ -115,13 +110,14 @@
   public native int getChildIndex(Element parent, Element toFind) /*-{
     var count = 0, child = parent.firstChild;
     while (child) {
-      if (child == toFind)
+      if (child === toFind) {
         return count;
-      if (child.nodeType == 1)
+      }
+      if (child.nodeType == 1) {
         ++count;
+      }
       child = child.nextSibling;
     }
-
     return -1;
   }-*/;
 
@@ -245,8 +241,9 @@
   }-*/;
 
   private native void releaseCaptureImpl(Element elem) /*-{
-    if (elem == $wnd.__captureElem)
+    if (elem === $wnd.__captureElem) {
       $wnd.__captureElem = null;
+    }
   }-*/;
 
   private native void setCaptureImpl(Element elem) /*-{
diff --git a/user/src/com/google/gwt/user/client/impl/ImageSrcIE6.java b/user/src/com/google/gwt/user/client/impl/ImageSrcIE6.java
index 2d077c8..d4d0d95 100644
--- a/user/src/com/google/gwt/user/client/impl/ImageSrcIE6.java
+++ b/user/src/com/google/gwt/user/client/impl/ImageSrcIE6.java
@@ -184,10 +184,9 @@
    * Removes a child image from its pending parent.
    */
   private static native void removeChild(Element parent, Element child) /*-{
-    var uniqueID = child.uniqueID;
     var kids = parent.__kids;
     for (var i = 0, c = kids.length; i < c; ++i) {
-      if (kids[i].uniqueID == uniqueID) {
+      if (kids[i] === child) {
         kids.splice(i, 1);
         child.__pendingSrc = null;
         return;
diff --git a/user/src/com/google/gwt/user/client/ui/HTMLTable.java b/user/src/com/google/gwt/user/client/ui/HTMLTable.java
index bbaac5d..103180d 100644
--- a/user/src/com/google/gwt/user/client/ui/HTMLTable.java
+++ b/user/src/com/google/gwt/user/client/ui/HTMLTable.java
@@ -1207,12 +1207,12 @@
         // it.
         Element tr = DOM.getParent(td);
         Element body = DOM.getParent(tr);
-        if (DOM.compare(body, bodyElem)) {
+        if (body == bodyElem) {
           return td;
         }
       }
       // If we run into this table's body, we're out of options.
-      if (DOM.compare(td, bodyElem)) {
+      if (td == bodyElem) {
         return null;
       }
     }
diff --git a/user/src/com/google/gwt/user/client/ui/StackPanel.java b/user/src/com/google/gwt/user/client/ui/StackPanel.java
index f6ae64d..9922032 100644
--- a/user/src/com/google/gwt/user/client/ui/StackPanel.java
+++ b/user/src/com/google/gwt/user/client/ui/StackPanel.java
@@ -248,7 +248,7 @@
   }
 
   private int findDividerIndex(Element elem) {
-    while ((elem != null) && !DOM.compare(elem, getElement())) {
+    while (elem != getElement()) {
       String expando = DOM.getElementProperty(elem, "__index");
       if (expando != null) {
         // Make sure it belongs to me!
diff --git a/user/src/com/google/gwt/user/client/ui/Tree.java b/user/src/com/google/gwt/user/client/ui/Tree.java
index af09ab5..f034004 100644
--- a/user/src/com/google/gwt/user/client/ui/Tree.java
+++ b/user/src/com/google/gwt/user/client/ui/Tree.java
@@ -364,7 +364,7 @@
         // Currently, the way we're using image bundles causes extraneous events
         // to be sunk on individual items' open/close images. This leads to an
         // extra event reaching the Tree, which we will ignore here.
-        if (DOM.compare(DOM.eventGetCurrentTarget(event), getElement())) {
+        if (DOM.eventGetCurrentTarget(event) == getElement()) {
           elementClicked(root, DOM.eventGetTarget(event));
         }
         break;
@@ -711,7 +711,7 @@
    * Collects parents going up the element tree, terminated at the tree root.
    */
   private void collectElementChain(ArrayList<Element> chain, Element hRoot, Element hElem) {
-    if ((hElem == null) || DOM.compare(hElem, hRoot)) {
+    if ((hElem == null) || (hElem == hRoot)) {
       return;
     }
 
@@ -752,7 +752,7 @@
     Element hCurElem = chain.get(idx);
     for (int i = 0, n = root.getChildCount(); i < n; ++i) {
       TreeItem child = root.getChild(i);
-      if (DOM.compare(child.getElement(), hCurElem)) {
+      if (child.getElement() == hCurElem) {
         TreeItem retItem = findItemByChain(chain, idx + 1, root.getChild(i));
         if (retItem == null) {
           return child;
diff --git a/user/src/com/google/gwt/user/client/ui/impl/TextBoxImplIE6.java b/user/src/com/google/gwt/user/client/ui/impl/TextBoxImplIE6.java
index 9bc5933..3a3a52c 100644
--- a/user/src/com/google/gwt/user/client/ui/impl/TextBoxImplIE6.java
+++ b/user/src/com/google/gwt/user/client/ui/impl/TextBoxImplIE6.java
@@ -27,7 +27,7 @@
   public native int getCursorPos(Element elem) /*-{
     try {
       var tr = elem.document.selection.createRange();
-      if (tr.parentElement().uniqueID != elem.uniqueID)
+      if (tr.parentElement() !== elem)
         return -1;
       return -tr.move("character", -65535);
     }
@@ -40,7 +40,7 @@
   public native int getSelectionLength(Element elem) /*-{
     try {
       var tr = elem.document.selection.createRange();
-      if (tr.parentElement().uniqueID != elem.uniqueID)
+      if (tr.parentElement() !== elem)
         return 0;
       return tr.text.length;
     }
diff --git a/user/src/com/google/gwt/xml/client/impl/DOMItem.java b/user/src/com/google/gwt/xml/client/impl/DOMItem.java
index 98ff3ea..df16f26 100644
--- a/user/src/com/google/gwt/xml/client/impl/DOMItem.java
+++ b/user/src/com/google/gwt/xml/client/impl/DOMItem.java
@@ -16,7 +16,6 @@
 package com.google.gwt.xml.client.impl;
 
 import com.google.gwt.core.client.JavaScriptObject;
-import com.google.gwt.user.client.DOM;
 
 /**
  * This class is the base class for all DOM object wrappers.
@@ -38,14 +37,8 @@
    */
   @Override
   public boolean equals(final Object o) {
-    /*
-     * This method uses the DOM equals method because it happens to work
-     * perfectly for all the browsers we support, and that method is different
-     * for each browser.
-     */
     if (o instanceof DOMItem) {
-      return DOM.compare(castToElement(this.getJsObject()),
-          castToElement(((DOMItem) o).getJsObject()));
+      return this.getJsObject() == ((DOMItem) o).getJsObject();
     }
     return false;
   }
@@ -53,9 +46,4 @@
   JavaScriptObject getJsObject() {
     return jsObject;
   }
-
-  private native com.google.gwt.user.client.Element castToElement(
-      JavaScriptObject toBeCast) /*-{
-    return toBeCast;
-  }-*/;
 }
diff --git a/user/test/com/google/gwt/user/client/ui/DOMTest.java b/user/test/com/google/gwt/user/client/ui/DOMTest.java
index 53dda7f..c58977f 100644
--- a/user/test/com/google/gwt/user/client/ui/DOMTest.java
+++ b/user/test/com/google/gwt/user/client/ui/DOMTest.java
@@ -157,7 +157,7 @@
     DOM.insertChild(parent, div, Integer.MAX_VALUE);
     Element child = DOM.getChild(RootPanel.get().getElement(),
         DOM.getChildCount(parent) - 1);
-    assertTrue(DOM.compare(div, child));
+    assertTrue(div == child);
   }
 
   /**
diff --git a/user/test/com/google/gwt/user/client/ui/DecoratorPanelTest.java b/user/test/com/google/gwt/user/client/ui/DecoratorPanelTest.java
index c192ebc..f0c478c 100644
--- a/user/test/com/google/gwt/user/client/ui/DecoratorPanelTest.java
+++ b/user/test/com/google/gwt/user/client/ui/DecoratorPanelTest.java
@@ -66,8 +66,7 @@
     }
 
     // Check the container element
-    assertTrue(DOM.compare(DOM.getFirstChild(panel.getCellElement(2, 1)),
-        panel.getContainerElement()));
+    assertTrue(DOM.getFirstChild(panel.getCellElement(2, 1)) == panel.getContainerElement());
   }
 
   /**
@@ -87,7 +86,6 @@
     }
 
     // Check the container element
-    assertTrue(DOM.compare(DOM.getFirstChild(panel.getCellElement(1, 1)),
-        panel.getContainerElement()));
+    assertTrue(DOM.getFirstChild(panel.getCellElement(1, 1)) == panel.getContainerElement());
   }
 }
diff --git a/user/test/com/google/gwt/user/client/ui/DockPanelTest.java b/user/test/com/google/gwt/user/client/ui/DockPanelTest.java
index 19e8fcd..543d714 100644
--- a/user/test/com/google/gwt/user/client/ui/DockPanelTest.java
+++ b/user/test/com/google/gwt/user/client/ui/DockPanelTest.java
@@ -43,7 +43,7 @@
       Element curElem = getElement();
       Element body = RootPanel.getBodyElement();
       while (curElem != null) {
-        if (DOM.compare(curElem, body)) {
+        if (curElem == body) {
           attachedWhenLoaded = true;
         }
         curElem = DOM.getParent(curElem);
diff --git a/user/test/com/google/gwt/user/client/ui/PopupTest.java b/user/test/com/google/gwt/user/client/ui/PopupTest.java
index 6b4f122..675ef31 100644
--- a/user/test/com/google/gwt/user/client/ui/PopupTest.java
+++ b/user/test/com/google/gwt/user/client/ui/PopupTest.java
@@ -90,7 +90,6 @@
     TestablePopupPanel p2 = new TestablePopupPanel();
     assertTrue(p1.getContainerElement() != null);
     assertTrue(p2.getContainerElement() != null);
-    assertFalse(
-        DOM.compare(p1.getContainerElement(), p2.getContainerElement()));
+    assertFalse(p1.getContainerElement() == p2.getContainerElement());
   }
 }
