Created http://gwt-code-reviews.appspot.com/1467807/ to address additional error states.
http://gwt-code-reviews.appspot.com/1462808/diff/1/user/src/com/google/gwt/user/client/ui/HTMLPanel.java File user/src/com/google/gwt/user/client/ui/HTMLPanel.java (right): http://gwt-code-reviews.appspot.com/1462808/diff/1/user/src/com/google/gwt/user/client/ui/HTMLPanel.java#newcode204 user/src/com/google/gwt/user/client/ui/HTMLPanel.java:204: if (w.getElement() == toReplace) { I don't think this handles the case where toReplace is an ancestor of the widget, but not the widget itself. Also, we should detach before attaching the new widget. Otherwise, if the widget is already a child of the element, we'll attach and then immediately detach. http://gwt-code-reviews.appspot.com/1462808/ -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
