Fixes UISuite failures (DOMTest and PopupTest).
r2133 changed the behavior of RootPanel such that position:relative
and overflow:hidden would be added to the underlying element. I
also rolled back the test changes in r2156 since this change was the root
cause of those failures.

Review: jgw (TBR)



git-svn-id: https://google-web-toolkit.googlecode.com/svn/trunk@2167 8db76d5a-ed1c-0410-87a9-c151d255dfc7
diff --git a/user/src/com/google/gwt/user/client/ui/AbsolutePanel.java b/user/src/com/google/gwt/user/client/ui/AbsolutePanel.java
index 1cd716b..da1e13a 100644
--- a/user/src/com/google/gwt/user/client/ui/AbsolutePanel.java
+++ b/user/src/com/google/gwt/user/client/ui/AbsolutePanel.java
@@ -52,6 +52,11 @@
    */
   public AbsolutePanel() {
     this(DOM.createDiv());
+    
+    // Setting the panel's position style to 'relative' causes it to be treated
+    // as a new positioning context for its children.
+    DOM.setStyleAttribute(getElement(), "position", "relative");
+    DOM.setStyleAttribute(getElement(), "overflow", "hidden");
   }
 
   /**
@@ -62,11 +67,6 @@
    */
   AbsolutePanel(Element elem) {
     setElement(elem);
-
-    // Setting the panel's position style to 'relative' causes it to be treated
-    // as a new positioning context for its children.
-    DOM.setStyleAttribute(getElement(), "position", "relative");
-    DOM.setStyleAttribute(getElement(), "overflow", "hidden");
   }
 
   /**
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 6ab2b9c..c58977f 100644
--- a/user/test/com/google/gwt/user/client/ui/DOMTest.java
+++ b/user/test/com/google/gwt/user/client/ui/DOMTest.java
@@ -21,7 +21,6 @@
 import com.google.gwt.user.client.DeferredCommand;
 import com.google.gwt.user.client.Element;
 import com.google.gwt.user.client.Timer;
-import com.google.gwt.user.client.Window;
 
 /**
  * Tests standard DOM operations in the {@link DOM} class.
@@ -69,10 +68,6 @@
    * {@link DOM#getAbsoluteTop(Element)}.
    */
   public void testGetAbsolutePosition() {
-    // Since this test depends upon absolute positioning, clear the outer margin
-    // to ensure that the numbers are predictable.
-    Window.setMargin("0px");
-
     final int border = 8;
     final int margin = 9;
     final int padding = 10;
@@ -108,10 +103,6 @@
    * 
    */
   public void testGetAbsolutePositionWhenScrolled() {
-    // Since this test depends upon absolute positioning, clear the outer margin
-    // to ensure that the numbers are predictable.
-    Window.setMargin("0px");
-
     final Element outer = DOM.createDiv();
     final Element inner = DOM.createDiv();