зеркало из https://github.com/mozilla/gecko-dev.git
Backing out bug 961867 for causing an intermittent test failure.
This commit is contained in:
Родитель
235ece2358
Коммит
3ad459f0a7
|
@ -3543,11 +3543,42 @@ var XULBrowserWindow = {
|
|||
|
||||
// Called before links are navigated to to allow us to retarget them if needed.
|
||||
onBeforeLinkTraversal: function(originalTarget, linkURI, linkNode, isAppTab) {
|
||||
let target = BrowserUtils.onBeforeLinkTraversal(originalTarget, linkURI, linkNode, isAppTab);
|
||||
let target = this._onBeforeLinkTraversal(originalTarget, linkURI, linkNode, isAppTab);
|
||||
SocialUI.closeSocialPanelForLinkTraversal(target, linkNode);
|
||||
return target;
|
||||
},
|
||||
|
||||
_onBeforeLinkTraversal: function(originalTarget, linkURI, linkNode, isAppTab) {
|
||||
// Don't modify non-default targets or targets that aren't in top-level app
|
||||
// tab docshells (isAppTab will be false for app tab subframes).
|
||||
if (originalTarget != "" || !isAppTab)
|
||||
return originalTarget;
|
||||
|
||||
// External links from within app tabs should always open in new tabs
|
||||
// instead of replacing the app tab's page (Bug 575561)
|
||||
let linkHost;
|
||||
let docHost;
|
||||
try {
|
||||
linkHost = linkURI.host;
|
||||
docHost = linkNode.ownerDocument.documentURIObject.host;
|
||||
} catch(e) {
|
||||
// nsIURI.host can throw for non-nsStandardURL nsIURIs.
|
||||
// If we fail to get either host, just return originalTarget.
|
||||
return originalTarget;
|
||||
}
|
||||
|
||||
if (docHost == linkHost)
|
||||
return originalTarget;
|
||||
|
||||
// Special case: ignore "www" prefix if it is part of host string
|
||||
let [longHost, shortHost] =
|
||||
linkHost.length > docHost.length ? [linkHost, docHost] : [docHost, linkHost];
|
||||
if (longHost == "www." + shortHost)
|
||||
return originalTarget;
|
||||
|
||||
return "_blank";
|
||||
},
|
||||
|
||||
onProgressChange: function (aWebProgress, aRequest,
|
||||
aCurSelfProgress, aMaxSelfProgress,
|
||||
aCurTotalProgress, aMaxTotalProgress) {
|
||||
|
|
|
@ -660,27 +660,3 @@ Services.obs.addObserver(gKeywordURIFixup, "keyword-uri-fixup", false);
|
|||
addEventListener("unload", () => {
|
||||
Services.obs.removeObserver(gKeywordURIFixup, "keyword-uri-fixup");
|
||||
}, false);
|
||||
|
||||
addMessageListener("Browser:AppTab", function(message) {
|
||||
docShell.isAppTab = message.data.isAppTab;
|
||||
});
|
||||
|
||||
let WebBrowserChrome = {
|
||||
onBeforeLinkTraversal: function(originalTarget, linkURI, linkNode, isAppTab) {
|
||||
return BrowserUtils.onBeforeLinkTraversal(originalTarget, linkURI, linkNode, isAppTab);
|
||||
},
|
||||
};
|
||||
|
||||
if (Services.appinfo.processType == Services.appinfo.PROCESS_TYPE_CONTENT) {
|
||||
let tabchild = docShell.QueryInterface(Ci.nsIInterfaceRequestor)
|
||||
.getInterface(Ci.nsITabChild);
|
||||
tabchild.webBrowserChrome = WebBrowserChrome;
|
||||
}
|
||||
|
||||
addEventListener("pageshow", function(event) {
|
||||
if (event.target == content.document) {
|
||||
sendAsyncMessage("PageVisibility:Show", {
|
||||
persisted: event.persisted,
|
||||
});
|
||||
}
|
||||
});
|
||||
|
|
|
@ -289,7 +289,9 @@
|
|||
this.tabContainer._positionPinnedTabs();
|
||||
this.tabContainer.adjustTabstrip();
|
||||
|
||||
this.getBrowserForTab(aTab).messageManager.sendAsyncMessage("Browser:AppTab", { isAppTab: true })
|
||||
// Bug 961867 - [e10s] Implement the logic for app tabs
|
||||
if (!gMultiProcessBrowser)
|
||||
this.getBrowserForTab(aTab).docShell.isAppTab = true;
|
||||
|
||||
if (aTab.selected)
|
||||
this._setCloseKeyState(false);
|
||||
|
@ -313,7 +315,9 @@
|
|||
this.tabContainer._positionPinnedTabs();
|
||||
this.tabContainer.adjustTabstrip();
|
||||
|
||||
this.getBrowserForTab(aTab).messageManager.sendAsyncMessage("Browser:AppTab", { isAppTab: false })
|
||||
// Bug 961867 - [e10s] Implement the logic for app tabs
|
||||
if (!gMultiProcessBrowser)
|
||||
this.getBrowserForTab(aTab).docShell.isAppTab = false;
|
||||
|
||||
if (aTab.selected)
|
||||
this._setCloseKeyState(true);
|
||||
|
|
|
@ -207,13 +207,17 @@ run-if = toolkit == "cocoa"
|
|||
[browser_bug567306.js]
|
||||
skip-if = e10s
|
||||
[browser_bug575561.js]
|
||||
skip-if = e10s # Bug 921905 - pinTab/unpinTab fail in e10s
|
||||
[browser_bug575830.js]
|
||||
skip-if = e10s # Bug 691614 - no e10s zoom support yet
|
||||
[browser_bug577121.js]
|
||||
skip-if = e10s # Bug 921905 - pinTab/unpinTab fail in e10s
|
||||
[browser_bug578534.js]
|
||||
skip-if = e10s # Bug ?????? - test directly manipulates content
|
||||
[browser_bug579872.js]
|
||||
skip-if = e10s # Bug 921905 - pinTab/unpinTab fail in e10s
|
||||
[browser_bug580638.js]
|
||||
skip-if = e10s # Bug 921905 - pinTab/unpinTab fail in e10s
|
||||
[browser_bug580956.js]
|
||||
skip-if = e10s # Bug 516755 - SessionStore disabled for e10s
|
||||
[browser_bug581242.js]
|
||||
|
@ -223,16 +227,19 @@ skip-if = e10s # Bug 930863 - pageshow issues ("TypeError: charset is undefined"
|
|||
[browser_bug581947.js]
|
||||
skip-if = e10s
|
||||
[browser_bug585558.js]
|
||||
skip-if = e10s # Bug 921905 - pinTab/unpinTab fail in e10s
|
||||
[browser_bug585785.js]
|
||||
[browser_bug585830.js]
|
||||
[browser_bug590206.js]
|
||||
[browser_bug592338.js]
|
||||
skip-if = e10s # Bug 653065 - Make the lightweight theme web installer ready for e10s
|
||||
[browser_bug594131.js]
|
||||
skip-if = e10s # Bug 921905 - pinTab/unpinTab fail in e10s
|
||||
[browser_bug595507.js]
|
||||
skip-if = e10s # Bug 691601 - no form submit observers
|
||||
[browser_bug596687.js]
|
||||
[browser_bug597218.js]
|
||||
skip-if = e10s # Bug 921905 - pinTab/unpinTab fail in e10s
|
||||
[browser_bug609700.js]
|
||||
skip-if = e10s # Bug 516755 - SessionStore disabled for e10s (calls duplicateTabIn, which uses SessionStore)
|
||||
[browser_bug623155.js]
|
||||
|
@ -347,6 +354,7 @@ skip-if = buildapp == 'mulet' || e10s # Bug ?????? - uncaught exception - Error:
|
|||
[browser_offlineQuotaNotification.js]
|
||||
skip-if = buildapp == 'mulet' || e10s # Bug ?????? - test directly manipulates content (gBrowser.selectedBrowser.contentWindow.applicationCache.oncached = function() {...})
|
||||
[browser_overflowScroll.js]
|
||||
skip-if = e10s # Bug 921905 - pinTab/unpinTab fail in e10s
|
||||
[browser_pageInfo.js]
|
||||
skip-if = buildapp == 'mulet' || e10s # Bug 866413 - PageInfo doesn't work in e10s
|
||||
[browser_page_style_menu.js]
|
||||
|
@ -358,6 +366,7 @@ skip-if = e10s
|
|||
skip-if = debug || asan # Times out on debug/asan, and we are less picky about our JS there
|
||||
|
||||
[browser_pinnedTabs.js]
|
||||
skip-if = e10s # Bug 921905 - pinTab/unpinTab fail in e10s
|
||||
[browser_plainTextLinks.js]
|
||||
skip-if = e10s # Bug ?????? - test directly manipulates content (creates and fetches elements directly from content document)
|
||||
[browser_popupUI.js]
|
||||
|
@ -370,6 +379,7 @@ skip-if = buildapp == 'mulet'
|
|||
skip-if = buildapp == 'mulet'
|
||||
[browser_relatedTabs.js]
|
||||
[browser_removeTabsToTheEnd.js]
|
||||
skip-if = e10s # Bug 921905 - pinTab/unpinTab fail in e10s
|
||||
[browser_removeUnsafeProtocolsFromURLBarPaste.js]
|
||||
skip-if = e10s
|
||||
[browser_sanitize-download-history.js]
|
||||
|
@ -455,10 +465,13 @@ skip-if = e10s # Bug ?????? - FHR tests failing (either with "no data for today"
|
|||
skip-if = e10s # Bug ?????? - test directly manipulates content
|
||||
[browser_visibleLabel.js]
|
||||
[browser_visibleTabs.js]
|
||||
skip-if = e10s # Bug 921905 - pinTab/unpinTab fail in e10s
|
||||
[browser_visibleTabs_bookmarkAllPages.js]
|
||||
skip-if = true # Bug 1005420 - fails intermittently. also with e10s enabled: bizarre problem with hidden tab having _mouseenter called, via _setPositionalAttributes, and tab not being found resulting in 'candidate is undefined'
|
||||
[browser_visibleTabs_bookmarkAllTabs.js]
|
||||
skip-if = e10s # Bug 921905 - pinTab/unpinTab fail in e10s
|
||||
[browser_visibleTabs_contextMenu.js]
|
||||
skip-if = e10s # Bug 921905 - pinTab/unpinTab fail in e10s
|
||||
[browser_visibleTabs_tabPreview.js]
|
||||
skip-if = (os == "win" && !debug) || e10s # Bug 1007418 / Bug 698371 - thumbnail captures need e10s love (tabPreviews_capture fails with Argument 1 of CanvasRenderingContext2D.drawWindow does not implement interface Window.)
|
||||
[browser_web_channel.js]
|
||||
|
|
|
@ -43,8 +43,16 @@ function testLink(aLinkIndex, pinTab, expectNewTab, nextTest, testSubFrame) {
|
|||
if (pinTab)
|
||||
gBrowser.pinTab(appTab);
|
||||
gBrowser.selectedTab = appTab;
|
||||
appTab.linkedBrowser.addEventListener("load", onLoad, true);
|
||||
|
||||
let loadCount = 0;
|
||||
function onLoad() {
|
||||
loadCount++;
|
||||
if (loadCount < 2)
|
||||
return;
|
||||
|
||||
appTab.linkedBrowser.removeEventListener("load", onLoad, true);
|
||||
|
||||
waitForDocLoadComplete(appTab.linkedBrowser).then(function() {
|
||||
let browser = gBrowser.getBrowserForTab(appTab);
|
||||
if (testSubFrame)
|
||||
browser = browser.contentDocument.getElementsByTagName("iframe")[0];
|
||||
|
@ -54,7 +62,7 @@ function testLink(aLinkIndex, pinTab, expectNewTab, nextTest, testSubFrame) {
|
|||
if (expectNewTab)
|
||||
gBrowser.tabContainer.addEventListener("TabOpen", onTabOpen, true);
|
||||
else
|
||||
waitForDocLoadComplete(appTab.linkedBrowser).then(onPageLoad);
|
||||
browser.addEventListener("load", onPageLoad, true);
|
||||
|
||||
info("Clicking " + links[aLinkIndex].textContent);
|
||||
EventUtils.sendMouseEvent({type:"click"}, links[aLinkIndex], browser.contentWindow);
|
||||
|
@ -72,13 +80,11 @@ function testLink(aLinkIndex, pinTab, expectNewTab, nextTest, testSubFrame) {
|
|||
function onTabOpen(event) {
|
||||
gBrowser.tabContainer.removeEventListener("TabOpen", onTabOpen, true);
|
||||
ok(true, "Link should open a new tab");
|
||||
waitForDocLoadComplete(event.target.linkedBrowser).then(function() {
|
||||
executeSoon(function(){
|
||||
gBrowser.removeTab(appTab);
|
||||
gBrowser.removeCurrentTab();
|
||||
nextTest();
|
||||
});
|
||||
executeSoon(function(){
|
||||
gBrowser.removeTab(appTab);
|
||||
gBrowser.removeCurrentTab();
|
||||
nextTest();
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -432,31 +432,6 @@ function waitForDocLoadAndStopIt(aExpectedURL, aBrowser=gBrowser.selectedBrowser
|
|||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Waits for the next load to complete in the current browser.
|
||||
*
|
||||
* @return promise
|
||||
*/
|
||||
function waitForDocLoadComplete(aBrowser=gBrowser) {
|
||||
let deferred = Promise.defer();
|
||||
let progressListener = {
|
||||
onStateChange: function (webProgress, req, flags, status) {
|
||||
let docStart = Ci.nsIWebProgressListener.STATE_IS_NETWORK |
|
||||
Ci.nsIWebProgressListener.STATE_STOP;
|
||||
if ((flags & docStart) == docStart) {
|
||||
aBrowser.removeProgressListener(progressListener);
|
||||
info("Browser loaded");
|
||||
deferred.resolve();
|
||||
}
|
||||
},
|
||||
QueryInterface: XPCOMUtils.generateQI([Ci.nsIWebProgressListener,
|
||||
Ci.nsISupportsWeakReference])
|
||||
};
|
||||
aBrowser.addProgressListener(progressListener);
|
||||
info("Waiting for browser load");
|
||||
return deferred.promise;
|
||||
}
|
||||
|
||||
let FullZoomHelper = {
|
||||
|
||||
selectTabAndWaitForLocationChange: function selectTabAndWaitForLocationChange(tab) {
|
||||
|
|
|
@ -5,15 +5,12 @@
|
|||
|
||||
#include "domstubs.idl"
|
||||
interface nsIContentFrameMessageManager;
|
||||
interface nsIWebBrowserChrome3;
|
||||
|
||||
[scriptable, uuid(2eb3bc54-78bf-40f2-b301-a5b5b70f7da0)]
|
||||
interface nsITabChild : nsISupports
|
||||
{
|
||||
readonly attribute nsIContentFrameMessageManager messageManager;
|
||||
|
||||
attribute nsIWebBrowserChrome3 webBrowserChrome;
|
||||
|
||||
[notxpcom] void sendRequestFocus(in boolean canFocus);
|
||||
};
|
||||
|
||||
|
|
|
@ -80,7 +80,6 @@
|
|||
#include "UnitTransforms.h"
|
||||
#include "ClientLayerManager.h"
|
||||
#include "LayersLogging.h"
|
||||
#include "nsIWebBrowserChrome3.h"
|
||||
|
||||
#include "nsColorPickerProxy.h"
|
||||
|
||||
|
@ -206,14 +205,12 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(TabChildBase)
|
|||
NS_IMPL_CYCLE_COLLECTION_UNLINK(mTabChildGlobal)
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK(mGlobal)
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK(mAnonymousGlobalScopes)
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK(mWebBrowserChrome)
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK_END
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(TabChildBase)
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mTabChildGlobal)
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mGlobal)
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_SCRIPT_OBJECTS
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mWebBrowserChrome)
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN(TabChildBase)
|
||||
|
@ -1317,11 +1314,6 @@ TabChild::FocusPrevElement()
|
|||
NS_IMETHODIMP
|
||||
TabChild::GetInterface(const nsIID & aIID, void **aSink)
|
||||
{
|
||||
if (aIID.Equals(NS_GET_IID(nsIWebBrowserChrome3))) {
|
||||
NS_IF_ADDREF(((nsISupports *) (*aSink = mWebBrowserChrome)));
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
// XXXbz should we restrict the set of interfaces we hand out here?
|
||||
// See bug 537429
|
||||
return QueryInterface(aIID, aSink);
|
||||
|
@ -2848,20 +2840,6 @@ TabChild::GetMessageManager(nsIContentFrameMessageManager** aResult)
|
|||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
TabChild::GetWebBrowserChrome(nsIWebBrowserChrome3** aWebBrowserChrome)
|
||||
{
|
||||
NS_IF_ADDREF(*aWebBrowserChrome = mWebBrowserChrome);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
TabChild::SetWebBrowserChrome(nsIWebBrowserChrome3* aWebBrowserChrome)
|
||||
{
|
||||
mWebBrowserChrome = aWebBrowserChrome;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
void
|
||||
TabChild::SendRequestFocus(bool aCanFocus)
|
||||
{
|
||||
|
|
|
@ -33,7 +33,6 @@
|
|||
#include "mozilla/EventDispatcher.h"
|
||||
#include "mozilla/EventForwards.h"
|
||||
#include "mozilla/layers/CompositorTypes.h"
|
||||
#include "nsIWebBrowserChrome3.h"
|
||||
|
||||
class nsICachedFileDescriptorListener;
|
||||
class nsIDOMWindowUtils;
|
||||
|
@ -225,7 +224,6 @@ protected:
|
|||
ScreenIntSize mInnerSize;
|
||||
mozilla::layers::FrameMetrics mLastRootMetrics;
|
||||
mozilla::layout::ScrollingBehavior mScrolling;
|
||||
nsCOMPtr<nsIWebBrowserChrome3> mWebBrowserChrome;
|
||||
};
|
||||
|
||||
class TabChild MOZ_FINAL : public TabChildBase,
|
||||
|
|
|
@ -54,7 +54,7 @@ function sendMouseEvent(aEvent, aTarget, aWindow) {
|
|||
aWindow = window;
|
||||
}
|
||||
|
||||
if (typeof aTarget == "string") {
|
||||
if (!(aTarget instanceof aWindow.Element)) {
|
||||
aTarget = aWindow.document.getElementById(aTarget);
|
||||
}
|
||||
|
||||
|
|
|
@ -148,35 +148,4 @@ this.BrowserUtils = {
|
|||
win = element.contentDocument.defaultView;
|
||||
return { targetWindow: win, offsetX: offsetX, offsetY: offsetY };
|
||||
},
|
||||
|
||||
onBeforeLinkTraversal: function(originalTarget, linkURI, linkNode, isAppTab) {
|
||||
// Don't modify non-default targets or targets that aren't in top-level app
|
||||
// tab docshells (isAppTab will be false for app tab subframes).
|
||||
if (originalTarget != "" || !isAppTab)
|
||||
return originalTarget;
|
||||
|
||||
// External links from within app tabs should always open in new tabs
|
||||
// instead of replacing the app tab's page (Bug 575561)
|
||||
let linkHost;
|
||||
let docHost;
|
||||
try {
|
||||
linkHost = linkURI.host;
|
||||
docHost = linkNode.ownerDocument.documentURIObject.host;
|
||||
} catch(e) {
|
||||
// nsIURI.host can throw for non-nsStandardURL nsIURIs.
|
||||
// If we fail to get either host, just return originalTarget.
|
||||
return originalTarget;
|
||||
}
|
||||
|
||||
if (docHost == linkHost)
|
||||
return originalTarget;
|
||||
|
||||
// Special case: ignore "www" prefix if it is part of host string
|
||||
let [longHost, shortHost] =
|
||||
linkHost.length > docHost.length ? [linkHost, docHost] : [docHost, linkHost];
|
||||
if (longHost == "www." + shortHost)
|
||||
return originalTarget;
|
||||
|
||||
return "_blank";
|
||||
},
|
||||
};
|
||||
|
|
Загрузка…
Ссылка в новой задаче