Reviewers: jgw,
Description:
PopupPanel.setVisible is supposed to update the visibility of the glass
element, but it is using PopupImpl variation of setVisible (a no-op in
all but IE) instead of UIObjects.
Fix:
====
We now use the standard UIObject.setVisible to set the visibility of the
glass element.
Testing:
=======
I tested this manually on Chrome, FF, and IE. Added a unit test and
verified it passed on FF, Chrome, IE, Safari, Opera.
Please review this at http://gwt-code-reviews.appspot.com/143809
Affected files:
user/src/com/google/gwt/user/client/ui/PopupPanel.java
user/test/com/google/gwt/user/client/ui/PopupTest.java
Index: user/test/com/google/gwt/user/client/ui/PopupTest.java
===================================================================
--- user/test/com/google/gwt/user/client/ui/PopupTest.java (revision 7555)
+++ user/test/com/google/gwt/user/client/ui/PopupTest.java (working copy)
@@ -377,6 +377,25 @@
popup.hide();
}
+ public void testSetVisibleWithGlass() {
+ PopupPanel popup = createPopupPanel();
+ popup.setGlassEnabled(true);
+ popup.show();
+
+ assertTrue(popup.isVisible());
+ assertTrue(UIObject.isVisible(popup.getGlassElement()));
+
+ popup.setVisible(false);
+ assertFalse(popup.isVisible());
+ assertFalse(UIObject.isVisible(popup.getGlassElement()));
+
+ popup.setVisible(true);
+ assertTrue(popup.isVisible());
+ assertTrue(UIObject.isVisible(popup.getGlassElement()));
+
+ popup.hide();
+ }
+
/**
* Test the showing a popup while it is hiding will not result in an
illegal
* state.
Index: user/src/com/google/gwt/user/client/ui/PopupPanel.java
===================================================================
--- user/src/com/google/gwt/user/client/ui/PopupPanel.java (revision 7555)
+++ user/src/com/google/gwt/user/client/ui/PopupPanel.java (working copy)
@@ -924,7 +924,7 @@
// as well.
impl.setVisible(getElement(), visible);
if (glass != null) {
- impl.setVisible(glass, visible);
+ UIObject.setVisible(glass, visible);
}
}
--
http://groups.google.com/group/Google-Web-Toolkit-Contributors