Merge pull request #760 from Nephyrin/master

Fix treestyletab in multiprocess (e10s) firefox
This commit is contained in:
YUKI "Piro" Hiroshi 2014-09-30 14:19:24 +09:00
commit 8962230b0e
3 changed files with 11 additions and 7 deletions

View File

@ -207,10 +207,12 @@ var TreeStyleTabWindowHelper = {
} }
if ('openLinkIn' in window) { if ('openLinkIn' in window) {
// Bug 1050447 changed this line in Fx 34 to
// newTab = w.gBrowser.loadOneTab(
eval('window.openLinkIn = '+ eval('window.openLinkIn = '+
window.openLinkIn.toSource().replace( window.openLinkIn.toSource().replace(
'browser.loadOneTab(', /((b|newTab = w\.gB)rowser.loadOneTab\()/g,
'TreeStyleTabService.onBeforeOpenLinkWithParams(params); $&' 'TreeStyleTabService.onBeforeOpenLinkWithTab(gBrowser.selectedTab); $1'
) )
); );
} }

View File

@ -712,12 +712,15 @@ AutoHideBrowser.prototype = {
}, },
showHideContentsAreaScreen : function AHB_showHideContentsAreaScreen() showHideContentsAreaScreen : function AHB_showHideContentsAreaScreen()
{ {
// this.browser.contentWindow doesn't currently work in e10s
// mode, use this.browser.mCurrentBrowser.contentWindow as a
// workaround until bug 1042680 is fixed
if ( if (
this.expanded && this.expanded &&
this.contentAreaScreenEnabled && this.contentAreaScreenEnabled &&
Services.focus.activeWindow && Services.focus.activeWindow &&
Services.focus.activeWindow.top == this.window && Services.focus.activeWindow.top == this.window &&
this.findPluginArea(this.browser.contentWindow) this.findPluginArea(this.browser.mCurrentBrowser.contentWindow)
) { ) {
let box = this.getContentsAreaBox(); let box = this.getContentsAreaBox();
let style = this.screen.style; let style = this.screen.style;

View File

@ -1213,11 +1213,10 @@ TreeStyleTabWindow.prototype = inherit(TreeStyleTabBase, {
this.handleNewTabFromCurrent(aOwner); this.handleNewTabFromCurrent(aOwner);
}, },
onBeforeOpenLinkWithParams : function TSTWindow_onBeforeOpenLinkWithParams(aParams) onBeforeOpenLinkWithTab : function TSTWindow_onBeforeOpenLinkWithParams(aTab)
{ {
if (aParams.linkNode && if (aTab && !this.checkToOpenChildTab(aTab))
!this.checkToOpenChildTab(aParams.linkNode.ownerDocument.defaultView)) this.handleNewTabFromCurrent(aTab);
this.handleNewTabFromCurrent(aParams.linkNode.ownerDocument.defaultView);
}, },
onBeforeOpenNewTabByThirdParty : function TSTWindow_onBeforeOpenNewTabByThirdParty(aOwner) onBeforeOpenNewTabByThirdParty : function TSTWindow_onBeforeOpenNewTabByThirdParty(aOwner)