Revision: 9786
Author: [email protected]
Date: Tue Mar 1 06:29:34 2011
Log: Rollback of bugfix due to failing testChangeImageToClipped test on ie7.
http://code.google.com/p/google-web-toolkit/source/detail?r=9786
Deleted:
/trunk/user/test/com/google/gwt/dom/public-test/iframetest.html
Modified:
/trunk/user/src/com/google/gwt/user/client/impl/DOMImplOpera.java
/trunk/user/src/com/google/gwt/user/client/impl/DOMImplStandard.java
/trunk/user/src/com/google/gwt/user/client/impl/DOMImplTrident.java
/trunk/user/src/com/google/gwt/user/client/ui/Frame.java
/trunk/user/src/com/google/gwt/user/client/ui/Image.java
/trunk/user/src/com/google/gwt/user/client/ui/impl/ClippedImageImpl.java
/trunk/user/src/com/google/gwt/user/client/ui/impl/ClippedImageImplIE6.java
/trunk/user/test/com/google/gwt/dom/DOMSuite.java
/trunk/user/test/com/google/gwt/dom/client/FrameTests.java
=======================================
--- /trunk/user/test/com/google/gwt/dom/public-test/iframetest.html Tue
Mar 1 05:24:17 2011
+++ /dev/null
@@ -1,10 +0,0 @@
-<html>
-<body>
-IFRAME TEST
-</body>
-</html>
-<html>
-<body>
-IFRAME TEST
-</body>
-</html>
=======================================
--- /trunk/user/src/com/google/gwt/user/client/impl/DOMImplOpera.java Tue
Mar 1 05:24:17 2011
+++ /trunk/user/src/com/google/gwt/user/client/impl/DOMImplOpera.java Tue
Mar 1 06:29:34 2011
@@ -59,7 +59,7 @@
elem.onscroll = (bits & 0x04000) ?
@com.google.gwt.user.client.impl.DOMImplStandard::dispatchEvent :
null;
elem.onload = (bits & 0x08000) ?
-
@com.google.gwt.user.client.impl.DOMImplStandard::dispatchOnLoadEvent :
null;
+
@com.google.gwt.user.client.impl.DOMImplStandard::dispatchUnhandledEvent :
null;
elem.onerror = (bits & 0x10000) ?
@com.google.gwt.user.client.impl.DOMImplStandard::dispatchEvent :
null;
elem.onmousewheel = (bits & 0x20000) ?
=======================================
--- /trunk/user/src/com/google/gwt/user/client/impl/DOMImplStandard.java
Tue Mar 1 05:24:17 2011
+++ /trunk/user/src/com/google/gwt/user/client/impl/DOMImplStandard.java
Tue Mar 1 06:29:34 2011
@@ -39,7 +39,7 @@
private static JavaScriptObject dispatchEvent;
@SuppressWarnings("unused")
- private static JavaScriptObject dispatchOnLoadEvent;
+ private static JavaScriptObject dispatchUnhandledEvent;
@Override
public Element eventGetFromElement(Event evt) {
@@ -167,8 +167,8 @@
return true;
});
- @com.google.gwt.user.client.impl.DOMImplStandard::dispatchOnLoadEvent
= $entry(function(evt) {
- this.__gwtLastOnLoadEvent = evt.type;
+
@com.google.gwt.user.client.impl.DOMImplStandard::dispatchUnhandledEvent =
$entry(function(evt) {
+ this.__gwtLastUnhandledEvent = evt.type;
@com.google.gwt.user.client.impl.DOMImplStandard::dispatchEvent.call(this,
evt);
});
@@ -248,7 +248,7 @@
if (chMask & 0x04000) elem.onscroll = (bits & 0x04000) ?
@com.google.gwt.user.client.impl.DOMImplStandard::dispatchEvent :
null;
if (chMask & 0x08000) elem.onload = (bits & 0x08000) ?
-
@com.google.gwt.user.client.impl.DOMImplStandard::dispatchOnLoadEvent :
null;
+
@com.google.gwt.user.client.impl.DOMImplStandard::dispatchUnhandledEvent :
null;
if (chMask & 0x10000) elem.onerror = (bits & 0x10000) ?
@com.google.gwt.user.client.impl.DOMImplStandard::dispatchEvent :
null;
if (chMask & 0x20000) elem.onmousewheel = (bits & 0x20000) ?
=======================================
--- /trunk/user/src/com/google/gwt/user/client/impl/DOMImplTrident.java Tue
Mar 1 05:24:17 2011
+++ /trunk/user/src/com/google/gwt/user/client/impl/DOMImplTrident.java Tue
Mar 1 06:29:34 2011
@@ -31,7 +31,7 @@
private static JavaScriptObject callDispatchDblClickEvent;
@SuppressWarnings("unused")
- private static JavaScriptObject callDispatchOnLoadEvent;
+ private static JavaScriptObject callDispatchUnhandledEvent;
/**
* Let every GWT app on the page preview the current event. If any app
cancels
@@ -154,8 +154,8 @@
}
});
- var dispatchOnLoadEvent = $entry(function() {
- this.__gwtLastOnLoadEvent = $wnd.event.type;
+ var dispatchUnhandledEvent = $entry(function() {
+ this.__gwtLastUnhandledEvent = $wnd.event.type;
dispatchEvent.call(this);
});
@@ -173,9 +173,9 @@
@com.google.gwt.user.client.impl.DOMImplTrident::callDispatchDblClickEvent
= new Function('w',
'return function() { w.__gwt_dispatchDblClickEvent_' + moduleName
+ '.call(this)}')($wnd);
- $wnd['__gwt_dispatchOnLoadEvent_' + moduleName] = dispatchOnLoadEvent;
-
@com.google.gwt.user.client.impl.DOMImplTrident::callDispatchOnLoadEvent =
new Function('w',
- 'return function() { w.__gwt_dispatchOnLoadEvent_' + moduleName
+ '.call(w.event.srcElement)}')($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);
// We need to create these delegate functions to fix up the 'this'
context.
// Normally, 'this' is the firing element, but this is only true for
@@ -268,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) ?
=======================================
--- /trunk/user/src/com/google/gwt/user/client/ui/Frame.java Tue Mar 1
05:24:17 2011
+++ /trunk/user/src/com/google/gwt/user/client/ui/Frame.java Tue Mar 1
06:29:34 2011
@@ -15,16 +15,10 @@
*/
package com.google.gwt.user.client.ui;
-import com.google.gwt.user.client.Event;
-
import com.google.gwt.dom.client.Document;
import com.google.gwt.dom.client.Element;
import com.google.gwt.dom.client.FrameElement;
import com.google.gwt.dom.client.IFrameElement;
-import com.google.gwt.event.dom.client.HasLoadHandlers;
-import com.google.gwt.event.dom.client.LoadEvent;
-import com.google.gwt.event.dom.client.LoadHandler;
-import com.google.gwt.event.shared.HandlerRegistration;
/**
* A widget that wraps an IFRAME element, which can contain an arbitrary
web
@@ -43,7 +37,7 @@
* <h3>Example</h3> {@example com.google.gwt.examples.FrameExample}
* </p>
*/
-public class Frame extends Widget implements HasLoadHandlers {
+public class Frame extends Widget {
static final String DEFAULT_STYLENAME = "gwt-Frame";
@@ -75,8 +69,6 @@
public Frame() {
setElement(Document.get().createIFrameElement());
setStyleName(DEFAULT_STYLENAME);
-
- sinkEvents(Event.ONLOAD);
}
/**
@@ -99,17 +91,6 @@
IFrameElement.as(element);
setElement(element);
}
-
- /**
- * Adds a {@link LoadEvent} load handler which will be called
- * when the frame loads.
- *
- * @param handler the load handler
- * @return {@link HandlerRegistration} that can be used to remove this
handler
- */
- public HandlerRegistration addLoadHandler(LoadHandler handler) {
- return addHandler(handler, LoadEvent.getType());
- }
/**
* Gets the URL of the frame's resource.
=======================================
--- /trunk/user/src/com/google/gwt/user/client/ui/Image.java Tue Mar 1
05:24:17 2011
+++ /trunk/user/src/com/google/gwt/user/client/ui/Image.java Tue Mar 1
06:29:34 2011
@@ -117,7 +117,7 @@
* The attribute that is set when an image fires a native load or error
event
* before it is attached.
*/
- private static final String UNHANDLED_EVENT_ATTR
= "__gwtLastOnLoadEvent";
+ private static final String UNHANDLED_EVENT_ATTR
= "__gwtLastUnhandledEvent";
/**
* Implementation of behaviors associated with the clipped state of an
image.
=======================================
---
/trunk/user/src/com/google/gwt/user/client/ui/impl/ClippedImageImpl.java
Tue Mar 1 05:24:17 2011
+++
/trunk/user/src/com/google/gwt/user/client/ui/impl/ClippedImageImpl.java
Tue Mar 1 06:29:34 2011
@@ -51,7 +51,7 @@
+ (-top + "px");
String clippedImgHtml = "<img "
- + "onload='this.__gwtLastOnLoadEvent=\"load\";' src='"
+ + "onload='this.__gwtLastUnhandledEvent=\"load\";' src='"
+ GWT.getModuleBaseURL() + "clear.cache.gif' style='" + style
+ "' border='0'>";
=======================================
---
/trunk/user/src/com/google/gwt/user/client/ui/impl/ClippedImageImplIE6.java
Tue Mar 1 05:24:17 2011
+++
/trunk/user/src/com/google/gwt/user/client/ui/impl/ClippedImageImplIE6.java
Tue Mar 1 06:29:34 2011
@@ -115,7 +115,7 @@
*/
String clippedImgHtml = "<gwt:clipper style=\""
+ clipperStyle
- + "\"><img onload='this.__gwtLastOnLoadEvent=\"load\";' src='"
+ + "\"><img onload='this.__gwtLastUnhandledEvent=\"load\";' src='"
+ moduleBaseUrlProtocol
+ "'
onerror='if(window.__gwt_transparentImgHandler)window.__gwt_transparentImgHandler(this);else
this.src=\"" + GWT.getModuleBaseURL() + "clear.cache.gif\"' style=\""
+ imgStyle + "\" width=" + (left + width) + " height=" + (top +
height)
=======================================
--- /trunk/user/test/com/google/gwt/dom/DOMSuite.java Tue Mar 1 05:24:17
2011
+++ /trunk/user/test/com/google/gwt/dom/DOMSuite.java Tue Mar 1 06:29:34
2011
@@ -18,7 +18,6 @@
import com.google.gwt.dom.client.DocumentTest;
import com.google.gwt.dom.client.ElementTest;
import com.google.gwt.dom.client.FormTests;
-import com.google.gwt.dom.client.FrameTests;
import com.google.gwt.dom.client.MapTests;
import com.google.gwt.dom.client.NodeTest;
import com.google.gwt.dom.client.SelectTests;
@@ -41,7 +40,6 @@
suite.addTestSuite(NodeTest.class);
suite.addTestSuite(ElementTest.class);
suite.addTestSuite(FormTests.class);
- suite.addTestSuite(FrameTests.class);
suite.addTestSuite(MapTests.class);
suite.addTestSuite(SelectTests.class);
suite.addTestSuite(StyleInjectorTest.class);
=======================================
--- /trunk/user/test/com/google/gwt/dom/client/FrameTests.java Tue Mar 1
05:24:17 2011
+++ /trunk/user/test/com/google/gwt/dom/client/FrameTests.java Tue Mar 1
06:29:34 2011
@@ -16,20 +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;
-
-import com.google.gwt.event.dom.client.LoadEvent;
-import com.google.gwt.event.dom.client.LoadHandler;
/**
* Tests for the FrameElement and IFrameElement classes.
*/
public class FrameTests extends GWTTestCase {
- private static final int FRAME_LOAD_DELAY = 3000;
-
@Override
public String getModuleName() {
return "com.google.gwt.dom.DOMTest";
@@ -42,52 +34,4 @@
doc.getBody().appendChild(iframe);
assertNotNull(iframe.getContentDocument());
}
-
- public void testOnLoadEventFiresWithBrowerEvent() {
- delayTestFinish(FRAME_LOAD_DELAY);
-
- Frame frame = new Frame() {
- public void onBrowserEvent(Event event) {
- if (event.getTypeInt() == Event.ONLOAD) {
- finishTest();
- }
- super.onBrowserEvent(event);
- }
- };
-
- frame.sinkEvents(Event.ONLOAD);
- RootPanel.get().add(frame);
- frame.setUrl("iframetest.html");
- }
-
- public void testOnLoadEventFiresWithLoadHandler() {
- delayTestFinish(FRAME_LOAD_DELAY);
-
- Frame frame = new Frame();
- frame.addLoadHandler(new LoadHandler() {
- public void onLoad(LoadEvent event) {
- finishTest();
- }
- });
-
- RootPanel.get().add(frame);
- frame.setUrl("iframetest.html");
- }
-
- public void testOnLoadEventFiresWithDomLoadHandler() {
- delayTestFinish(FRAME_LOAD_DELAY);
-
- Frame frame = new Frame() {
- {
- addDomHandler(new LoadHandler() {
- public void onLoad(LoadEvent event) {
- finishTest();
- }
- }, LoadEvent.getType());
- }
- };
-
- RootPanel.get().add(frame);
- frame.setUrl("iframetest.html");
- }
-}
+}
--
http://groups.google.com/group/Google-Web-Toolkit-Contributors