Rolling back IE bugfix for IFrames due to failed ImageTest *** Original change description *** Fix bug on IE where onload events don't fire for IFrames. This is a bugfix for http://code.google.com/p/google-web-toolkit/issues/detail?id=1720 Review at http://gwt-code-reviews.appspot.com/1294801 git-svn-id: https://google-web-toolkit.googlecode.com/svn/trunk@9569 8db76d5a-ed1c-0410-87a9-c151d255dfc7
diff --git a/user/src/com/google/gwt/user/client/impl/DOMImplTrident.java b/user/src/com/google/gwt/user/client/impl/DOMImplTrident.java index ae763d6..7bed0d0 100644 --- a/user/src/com/google/gwt/user/client/impl/DOMImplTrident.java +++ b/user/src/com/google/gwt/user/client/impl/DOMImplTrident.java
@@ -31,9 +31,6 @@ private static JavaScriptObject callDispatchDblClickEvent; @SuppressWarnings("unused") - private static JavaScriptObject callDispatchOnLoadEvent; - - @SuppressWarnings("unused") private static JavaScriptObject callDispatchUnhandledEvent; /** @@ -171,14 +168,11 @@ $wnd['__gwt_dispatchEvent_' + moduleName] = dispatchEvent; @com.google.gwt.user.client.impl.DOMImplTrident::callDispatchEvent = new Function('w', 'return function() { w.__gwt_dispatchEvent_' + moduleName + '.call(this) }')($wnd); - - @com.google.gwt.user.client.impl.DOMImplTrident::callDispatchOnLoadEvent = new Function('w', - 'return function() { w.__gwt_dispatchEvent_' + moduleName + '.call(w.event.srcElement) }')($wnd); - + $wnd['__gwt_dispatchDblClickEvent_' + moduleName] = dispatchDblClickEvent; @com.google.gwt.user.client.impl.DOMImplTrident::callDispatchDblClickEvent = new Function('w', 'return function() { w.__gwt_dispatchDblClickEvent_' + moduleName + '.call(this)}')($wnd); - + $wnd['__gwt_dispatchUnhandledEvent_' + moduleName] = dispatchUnhandledEvent; @com.google.gwt.user.client.impl.DOMImplTrident::callDispatchUnhandledEvent = new Function('w', 'return function() { w.__gwt_dispatchUnhandledEvent_' + moduleName + '.call(this)}')($wnd); @@ -274,13 +268,8 @@ @com.google.gwt.user.client.impl.DOMImplTrident::callDispatchEvent : null; if (chMask & 0x04000) elem.onscroll = (bits & 0x04000) ? @com.google.gwt.user.client.impl.DOMImplTrident::callDispatchEvent : null; - if (chMask & 0x08000) { - if (bits & 0x08000) { - elem.attachEvent('onload', @com.google.gwt.user.client.impl.DOMImplTrident::callDispatchOnLoadEvent); - } else { - elem.detachEvent('onload', @com.google.gwt.user.client.impl.DOMImplTrident::callDispatchOnLoadEvent); - } - } + if (chMask & 0x08000) elem.onload = (bits & 0x08000) ? + @com.google.gwt.user.client.impl.DOMImplTrident::callDispatchUnhandledEvent : null; if (chMask & 0x10000) elem.onerror = (bits & 0x10000) ? @com.google.gwt.user.client.impl.DOMImplTrident::callDispatchEvent : null; if (chMask & 0x20000) elem.onmousewheel = (bits & 0x20000) ?
diff --git a/user/test/com/google/gwt/dom/client/FrameTests.java b/user/test/com/google/gwt/dom/client/FrameTests.java index 76d93d6..183ea9d 100644 --- a/user/test/com/google/gwt/dom/client/FrameTests.java +++ b/user/test/com/google/gwt/dom/client/FrameTests.java
@@ -16,14 +16,12 @@ package com.google.gwt.dom.client; import com.google.gwt.junit.client.GWTTestCase; -import com.google.gwt.user.client.Event; -import com.google.gwt.user.client.ui.Frame; -import com.google.gwt.user.client.ui.RootPanel; /** * Tests for the FrameElement and IFrameElement classes. */ public class FrameTests extends GWTTestCase { + @Override public String getModuleName() { return "com.google.gwt.dom.DOMTest"; @@ -36,23 +34,4 @@ doc.getBody().appendChild(iframe); assertNotNull(iframe.getContentDocument()); } - - public void testOnloadEventFires() { - int delayMillis = 3000; - delayTestFinish(delayMillis); - - Frame frame = new Frame() { - @Override - public void onBrowserEvent(Event event) { - if (event.getTypeInt() == Event.ONLOAD) { - super.onBrowserEvent(event); - finishTest(); - } - } - }; - - frame.sinkEvents(Event.ONLOAD); - frame.setUrl("iframetest.html"); - RootPanel.get().add(frame); - } }
diff --git a/user/test/com/google/gwt/dom/public-test/iframetest.html b/user/test/com/google/gwt/dom/public-test/iframetest.html deleted file mode 100644 index 4eb5342..0000000 --- a/user/test/com/google/gwt/dom/public-test/iframetest.html +++ /dev/null
@@ -1,5 +0,0 @@ -<html> -<body> -IFRAME TEST -</body> -</html> \ No newline at end of file