Rolling back c5694, due to test failure:
junit.framework.AssertionFailedError: expected=table actual=tbody
at com.google.gwt.user.client.ui.HTMLPanelTest.testCustomRootTag(HTMLPanelTest.java:137)
at com.google.gwt.user.client.ui.__HTMLPanelTest_unitTestImpl.doRunTest(transient source for com.google.gwt.user.client.ui.__HTMLPanelTest_unitTestImpl:28)
git-svn-id: https://google-web-toolkit.googlecode.com/svn/trunk@5695 8db76d5a-ed1c-0410-87a9-c151d255dfc7
diff --git a/user/src/com/google/gwt/user/client/ui/HTMLPanel.java b/user/src/com/google/gwt/user/client/ui/HTMLPanel.java
index d9bf52a..1bbdeb6 100644
--- a/user/src/com/google/gwt/user/client/ui/HTMLPanel.java
+++ b/user/src/com/google/gwt/user/client/ui/HTMLPanel.java
@@ -40,29 +40,16 @@
}
/**
- * Creates an HTML panel with the specified HTML contents inside a DIV
- * element. Any element within this HTML that has a specified id can contain a
- * child widget.
+ * Creates an HTML panel with the specified HTML contents. Any element within
+ * this HTML that has a specified id can contain a child widget.
*
* @param html the panel's HTML
*/
public HTMLPanel(String html) {
- this("div", html);
- }
-
- /**
- * Creates an HTML panel whose root element has the given tag, and with the
- * specified HTML contents. Any element within this HTML that has a specified
- * id can contain a child widget.
- *
- * @param tag the tag of the root element
- * @param html the panel's HTML
- */
- public HTMLPanel(String tag, String html) {
- setElement(DOM.createElement(tag));
+ setElement(DOM.createDiv());
DOM.setInnerHTML(getElement(), html);
}
-
+
/**
* Adds a child widget to the panel, contained within the HTML element
* specified by a given id.
diff --git a/user/test/com/google/gwt/user/client/ui/HTMLPanelTest.java b/user/test/com/google/gwt/user/client/ui/HTMLPanelTest.java
index 5422a58..9e7f8ac 100644
--- a/user/test/com/google/gwt/user/client/ui/HTMLPanelTest.java
+++ b/user/test/com/google/gwt/user/client/ui/HTMLPanelTest.java
@@ -120,25 +120,6 @@
}
/**
- * Tests arbitrary root tag
- */
- public void testCustomRootTag() {
- HTMLPanel hp = new HTMLPanel("table", "<tr><td>Hello <span id='labelHere'></span></td></tr>");
- InlineLabel label = new InlineLabel("World");
- hp.addAndReplaceElement(label, "labelHere");
-
- Element parent = label.getElement().getParentElement();
- assertEquals("td", parent.getTagName().toLowerCase());
-
- parent = parent.getParentElement();
- assertEquals("tr", parent.getTagName().toLowerCase());
-
- parent = parent.getParentElement();
- assertEquals("table", parent.getTagName().toLowerCase());
- assertEquals(hp.getElement(), parent);
- }
-
- /**
* Ensure that {@link HTMLPanel#getElementById(String)} behaves properly in
* both attached and unattached states.
*/