Fixing a bug in HTMLPanel#addAndReplaceElement() where widgets that are children of the element being replaced are never removed, which puts the widgets in an invalid state. We now handle three additional scenarios. If the element being replaced is the new widget, then its a no-op.  If the element being replaced contains one or more widgets, those widgets are removed from the HTMLPanel before replacing the element.  If the element being replaced is a widget (but not the new widget), then we insert the new widget first, and then remove the old widget.

Issue: 4642
Author: jlabanca, gfotos

Review at http://gwt-code-reviews.appspot.com/1467807

Review by: rchandia@google.com

git-svn-id: https://google-web-toolkit.googlecode.com/svn/trunk@10394 8db76d5a-ed1c-0410-87a9-c151d255dfc7
2 files changed