Revision: 6817 Author: [email protected] Date: Tue Nov 10 14:13:03 2009 Log: Change top-window calculation to not follow the opener trail, and checkin Mac binaries with this change.
Note that this change will affect the URL that is returned to the devmode UI in the case where a GWT app opens a new window containing a different GWT app. Previously they would have been collapsed as two modules under the same URL, but now they will be separate top-level URLs. The reason for this change is that we have run into too many issues with Selenium and other unusual ways apps get opened, and getting it nailed down solidly will take more time than we have. Patch by: jat Review by: jlabanca (TBR) http://code.google.com/p/google-web-toolkit/source/detail?r=6817 Modified: /trunk/dev/core/src/com/google/gwt/core/ext/linker/impl/hosted.html /trunk/plugins/xpcom/ExternalWrapper.cpp /trunk/plugins/xpcom/prebuilt/extension/lib/Darwin-gcc3/ff3/libgwt_dev_ff3.dylib /trunk/plugins/xpcom/prebuilt/extension/lib/Darwin-gcc3/ff35/libgwt_dev_ff35.dylib ======================================= --- /trunk/dev/core/src/com/google/gwt/core/ext/linker/impl/hosted.html Mon Nov 9 22:52:22 2009 +++ /trunk/dev/core/src/com/google/gwt/core/ext/linker/impl/hosted.html Tue Nov 10 14:13:03 2009 @@ -27,28 +27,6 @@ } } catch(e) { } - -function getTopWindow() { - var topWin = window.top; - while (topWin.opener) { - // Check that we can access the url of the opener. If we can't, then return - // the window up to the current point. This happens with selenium because - // the parent window is a file, but the child window is the hosted URL. - var nextTopWin = topWin.opener.top; - try { - nextTopWin.location.href; - } catch (e) { - return topWin; - } - if (topWin == nextTopWin) { - // avoid infinite loops -- see issue 4199 - // http://code.google.com/p/google-web-toolkit/issues/detail?id=4199 - return topWin; - } - topWin = nextTopWin; - } - return topWin; -} function loadIframe(url) { var iframe = $doc.createElement('iframe'); @@ -211,7 +189,7 @@ findPluginObject, findPluginEmbed, ]; - var topWin = getTopWindow(); + var topWin = window.top; var url = topWin.location.href; if (!topWin.__gwt_SessionID) { var ASCII_EXCLAMATION = 33; ======================================= --- /trunk/plugins/xpcom/ExternalWrapper.cpp Fri Nov 6 13:34:25 2009 +++ /trunk/plugins/xpcom/ExternalWrapper.cpp Tue Nov 10 14:13:03 2009 @@ -171,46 +171,11 @@ << Debug::flush; return false; } - nsCOMPtr<nsIDOMWindowInternal> opener; - if (topWinInt->GetOpener(getter_AddRefs(opener)) != NS_OK) { - Debug::log(Debug::Debugging) << "Unable to get opener" << Debug::flush; - *topWinRet = topWinInt; - return true; - } if (!getWindowUrl(topWinInt, topUrl)) { Debug::log(Debug::Error) << "Unable to get url of top window" << Debug::flush; return false; } - while (opener) { - nsCOMPtr<nsIDOMWindow> nextTopWin; - if (opener->GetTop(getter_AddRefs(nextTopWin)) != NS_OK) { - Debug::log(Debug::Debugging) << "Unable to get next top" << Debug::flush; - break; - } - if (nextTopWin == topWin) { - // prevent infinite loop -- see issue 4199: - // http://code.google.com/p/google-web-toolkit/issues/detail?id=4199 - break; - } - nsCOMPtr<nsIDOMWindowInternal> nextTopWinInt = do_QueryInterface( - nextTopWin, &rv); - if (rv != NS_OK) { - Debug::log(Debug::Warning) << "Unable to QI DOMWindowInternal on next" - << Debug::flush; - break; - } - if (!getWindowUrl(nextTopWinInt, topUrl)) { - break; - } - Debug::log(Debug::Debugging) << " current url: " << topUrl << Debug::flush; - topWin = nextTopWin; - topWinInt = nextTopWinInt; - if (topWinInt->GetOpener(getter_AddRefs(opener)) != NS_OK) { - break; - } - } - Debug::log(Debug::Info) << " Top url: " << topUrl << Debug::flush; *topWinRet = topWinInt; return true; } ======================================= --- /trunk/plugins/xpcom/prebuilt/extension/lib/Darwin-gcc3/ff3/libgwt_dev_ff3.dylib Tue Nov 10 11:25:04 2009 +++ /trunk/plugins/xpcom/prebuilt/extension/lib/Darwin-gcc3/ff3/libgwt_dev_ff3.dylib Tue Nov 10 14:13:03 2009 Binary file, no diff available. ======================================= --- /trunk/plugins/xpcom/prebuilt/extension/lib/Darwin-gcc3/ff35/libgwt_dev_ff35.dylib Tue Nov 10 11:25:04 2009 +++ /trunk/plugins/xpcom/prebuilt/extension/lib/Darwin-gcc3/ff35/libgwt_dev_ff35.dylib Tue Nov 10 14:13:03 2009 Binary file, no diff available. --~--~---------~--~----~------------~-------~--~----~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~----------~----~----~----~------~----~------~--~---
