зеркало из https://github.com/mozilla/pjs.git
Backout due to mobile failures these changesets: 9f451a1901dd, e99f86ba7278, 447b48b79e6a, cef046665c53, c9237cc1fae0, d77a331a6d5a, f8f3afb95355, a050168887ee, 3ec4303ebf4d, 671b7c0d99f0, 56b17efbb62b, beceddeee3f4 on a CLOSED TREE
This commit is contained in:
Родитель
90336b058e
Коммит
fa90c389fe
|
@ -899,10 +899,6 @@ pref("dom.ipc.plugins.enabled.x86_64", true);
|
|||
pref("dom.ipc.plugins.enabled", true);
|
||||
#endif
|
||||
|
||||
#ifdef MOZ_E10S_COMPAT
|
||||
pref("browser.tabs.remote", true);
|
||||
#endif
|
||||
|
||||
// This pref governs whether we attempt to work around problems caused by
|
||||
// plugins using OS calls to manipulate the cursor while running out-of-
|
||||
// process. These workarounds all involve intercepting (hooking) certain
|
||||
|
|
|
@ -1415,8 +1415,6 @@ function prepareForStartup() {
|
|||
return;
|
||||
}
|
||||
|
||||
messageManager.loadFrameScript("chrome://browser/content/content.js", true);
|
||||
|
||||
// initialize observers and listeners
|
||||
// and give C++ access to gBrowser
|
||||
gBrowser.init();
|
||||
|
@ -1461,13 +1459,9 @@ function prepareForStartup() {
|
|||
Components.utils.reportError("Places database may be locked: " + ex);
|
||||
}
|
||||
|
||||
#ifdef MOZ_E10S_COMPAT
|
||||
// Bug 666801 - WebProgress support for e10s
|
||||
#else
|
||||
// hook up UI through progress listener
|
||||
gBrowser.addProgressListener(window.XULBrowserWindow);
|
||||
gBrowser.addTabsProgressListener(window.TabsProgressListener);
|
||||
#endif
|
||||
|
||||
// setup our common DOMLinkAdded listener
|
||||
gBrowser.addEventListener("DOMLinkAdded", DOMLinkHandler, false);
|
||||
|
@ -1589,13 +1583,9 @@ function delayedStartup(isLoadingBlank, mustLoadSidebar) {
|
|||
Components.utils.reportError("Failed to init content pref service:\n" + ex);
|
||||
}
|
||||
|
||||
#ifdef MOZ_E10S_COMPAT
|
||||
// Bug 666804 - NetworkPrioritizer support for e10s
|
||||
#else
|
||||
let NP = {};
|
||||
Cu.import("resource:///modules/NetworkPrioritizer.jsm", NP);
|
||||
NP.trackBrowserWindow(window);
|
||||
#endif
|
||||
|
||||
// initialize the session-restore service (in case it's not already running)
|
||||
try {
|
||||
|
@ -1646,12 +1636,8 @@ function delayedStartup(isLoadingBlank, mustLoadSidebar) {
|
|||
gBrowser.mPanelContainer.addEventListener("PreviewBrowserTheme", LightWeightThemeWebInstaller, false, true);
|
||||
gBrowser.mPanelContainer.addEventListener("ResetBrowserThemePreview", LightWeightThemeWebInstaller, false, true);
|
||||
|
||||
#ifdef MOZ_E10S_COMPAT
|
||||
// Bug 666808 - AeroPeek support for e10s
|
||||
#else
|
||||
if (Win7Features)
|
||||
Win7Features.onOpenWindow();
|
||||
#endif
|
||||
|
||||
// called when we go into full screen, even if it is
|
||||
// initiated by a web page script
|
||||
|
@ -4172,15 +4158,11 @@ var XULBrowserWindow = {
|
|||
init: function () {
|
||||
this.throbberElement = document.getElementById("navigator-throbber");
|
||||
|
||||
#ifdef MOZ_E10S_COMPAT
|
||||
// Bug 666809 - SecurityUI support for e10s
|
||||
#else
|
||||
// Initialize the security button's state and tooltip text. Remember to reset
|
||||
// _hostChanged, otherwise onSecurityChange will short circuit.
|
||||
var securityUI = gBrowser.securityUI;
|
||||
this._hostChanged = true;
|
||||
this.onSecurityChange(null, null, securityUI.state);
|
||||
#endif
|
||||
},
|
||||
|
||||
destroy: function () {
|
||||
|
|
|
@ -1,45 +0,0 @@
|
|||
# -*- Mode: javascript; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
# ***** BEGIN LICENSE BLOCK *****
|
||||
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
#
|
||||
# The contents of this file are subject to the Mozilla Public License Version
|
||||
# 1.1 (the "License"); you may not use this file except in compliance with
|
||||
# the License. You may obtain a copy of the License at
|
||||
# http://www.mozilla.org/MPL/
|
||||
#
|
||||
# Software distributed under the License is distributed on an "AS IS" basis,
|
||||
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
# for the specific language governing rights and limitations under the
|
||||
# License.
|
||||
#
|
||||
# The Original Code is multi-process front-end code.
|
||||
#
|
||||
# The Initial Developer of the Original Code is
|
||||
# the Mozilla Foundation
|
||||
# Portions created by the Initial Developer are Copyright (C) 2011
|
||||
# the Initial Developer. All Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
# Felipe Gomes <felipc@gmail.com>
|
||||
#
|
||||
# Alternatively, the contents of this file may be used under the terms of
|
||||
# either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
# in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
# of those above. If you wish to allow use of your version of this file only
|
||||
# under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
# use your version of this file under the terms of the MPL, indicate your
|
||||
# decision by deleting the provisions above and replace them with the notice
|
||||
# and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
# the provisions above, a recipient may use your version of this file under
|
||||
# the terms of any one of the MPL, the GPL or the LGPL.
|
||||
#
|
||||
# ***** END LICENSE BLOCK *****
|
||||
|
||||
const webNavigation = docShell.QueryInterface(Ci.nsIWebNavigation);
|
||||
|
||||
addMessageListener("WebNavigation:LoadURI", function(message) {
|
||||
let flags = message.json.flags || webNavigation.LOAD_FLAGS_NONE;
|
||||
|
||||
webNavigation.loadURI(message.json.uri, flags, null, null, null);
|
||||
});
|
|
@ -777,10 +777,12 @@
|
|||
<body>
|
||||
<![CDATA[
|
||||
var newTitle = "";
|
||||
var docTitle;
|
||||
var docElement = this.ownerDocument.documentElement;
|
||||
var sep = docElement.getAttribute("titlemenuseparator");
|
||||
|
||||
var docTitle = aBrowser.contentTitle;
|
||||
if (aBrowser.docShell.contentViewer)
|
||||
docTitle = aBrowser.contentTitle;
|
||||
|
||||
if (!docTitle)
|
||||
docTitle = docElement.getAttribute("titledefault");
|
||||
|
@ -857,7 +859,7 @@
|
|||
var oldBrowser = this.mCurrentBrowser;
|
||||
if (oldBrowser) {
|
||||
oldBrowser.setAttribute("type", "content-targetable");
|
||||
oldBrowser.docShellIsActive = false;
|
||||
oldBrowser.docShell.isActive = false;
|
||||
}
|
||||
|
||||
var updatePageReport = false;
|
||||
|
@ -867,7 +869,7 @@
|
|||
updatePageReport = true;
|
||||
|
||||
newBrowser.setAttribute("type", "content-primary");
|
||||
newBrowser.docShellIsActive = true;
|
||||
newBrowser.docShell.isActive = true;
|
||||
this.mCurrentBrowser = newBrowser;
|
||||
this.mCurrentTab = this.selectedTab;
|
||||
this.showTab(this.mCurrentTab);
|
||||
|
@ -878,10 +880,6 @@
|
|||
// Update the URL bar.
|
||||
var loc = this.mCurrentBrowser.currentURI;
|
||||
|
||||
#ifdef MOZ_E10S_COMPAT
|
||||
// Bug 666801 - WebProgress support for e10s and
|
||||
// Bug 666809 - SecurityUI support for e10s
|
||||
#else
|
||||
var webProgress = this.mCurrentBrowser.webProgress;
|
||||
var securityUI = this.mCurrentBrowser.securityUI;
|
||||
|
||||
|
@ -892,7 +890,6 @@
|
|||
this._callProgressListeners(null, "onSecurityChange",
|
||||
[webProgress, null, securityUI.state], true, false);
|
||||
}
|
||||
#endif
|
||||
|
||||
var listener = this.mTabListeners[this.tabContainer.selectedIndex] || null;
|
||||
if (listener && listener.mStateFlags) {
|
||||
|
@ -904,11 +901,7 @@
|
|||
|
||||
// Don't switch the fast find or update the titlebar (bug 540248) - this tab switch is temporary
|
||||
if (!this._previewMode) {
|
||||
#ifdef MOZ_E10S_COMPAT
|
||||
// Bug 666816 - TypeAheadFind support for e10s
|
||||
#else
|
||||
this._fastFind.setDocShell(this.mCurrentBrowser.docShell);
|
||||
#endif
|
||||
|
||||
this.updateTitlebar();
|
||||
|
||||
|
@ -1263,11 +1256,6 @@
|
|||
b.setAttribute("contextmenu", this.getAttribute("contentcontextmenu"));
|
||||
b.setAttribute("tooltip", this.getAttribute("contenttooltip"));
|
||||
|
||||
if (Services.prefs.getPrefType("browser.tabs.remote") == Services.prefs.PREF_BOOL &&
|
||||
Services.prefs.getBoolPref("browser.tabs.remote")) {
|
||||
b.setAttribute("remote", "true");
|
||||
}
|
||||
|
||||
if (window.gShowPageResizers && document.getElementById("addon-bar").collapsed &&
|
||||
window.windowState == window.STATE_NORMAL) {
|
||||
b.setAttribute("showresizer", "true");
|
||||
|
@ -1315,11 +1303,7 @@
|
|||
const filter = Components.classes["@mozilla.org/appshell/component/browser-status-filter;1"]
|
||||
.createInstance(Components.interfaces.nsIWebProgress);
|
||||
filter.addProgressListener(tabListener, Components.interfaces.nsIWebProgress.NOTIFY_ALL);
|
||||
#ifdef MOZ_E10S_COMPAT
|
||||
// Bug 666801 - WebProgress support for e10s
|
||||
#else
|
||||
b.webProgress.addProgressListener(filter, Components.interfaces.nsIWebProgress.NOTIFY_ALL);
|
||||
#endif
|
||||
this.mTabListeners[position] = tabListener;
|
||||
this.mTabFilters[position] = filter;
|
||||
|
||||
|
@ -1357,7 +1341,7 @@
|
|||
|
||||
// We start our browsers out as inactive, and then maintain
|
||||
// activeness in the tab switcher.
|
||||
b.docShellIsActive = false;
|
||||
b.docShell.isActive = false;
|
||||
|
||||
// Check if we're opening a tab related to the current tab and
|
||||
// move it to after the current tab.
|
||||
|
@ -1576,11 +1560,7 @@
|
|||
|
||||
// Remove the tab's filter and progress listener.
|
||||
const filter = this.mTabFilters[aTab._tPos];
|
||||
#ifdef MOZ_E10S_COMPAT
|
||||
// Bug 666801 - WebProgress support for e10s
|
||||
#else
|
||||
browser.webProgress.removeProgressListener(filter);
|
||||
#endif
|
||||
filter.removeProgressListener(this.mTabListeners[aTab._tPos]);
|
||||
this.mTabListeners[aTab._tPos].destroy();
|
||||
|
||||
|
|
|
@ -29,7 +29,6 @@ browser.jar:
|
|||
* content/browser/browser.js (content/browser.js)
|
||||
* content/browser/browser.xul (content/browser.xul)
|
||||
* content/browser/browser-tabPreviews.xml (content/browser-tabPreviews.xml)
|
||||
* content/browser/content.js (content/content.js)
|
||||
* content/browser/fullscreen-video.xhtml (content/fullscreen-video.xhtml)
|
||||
content/browser/highlighter.xhtml (content/highlighter.xhtml)
|
||||
* content/browser/inspector.html (content/inspector.html)
|
||||
|
|
17
configure.in
17
configure.in
|
@ -5683,23 +5683,6 @@ fi
|
|||
|
||||
AC_SUBST(MOZ_IPDL_TESTS)
|
||||
|
||||
dnl ========================================================
|
||||
dnl = Turns off code necessary for e10s compatibility
|
||||
dnl ========================================================
|
||||
dnl This is a temporary flag to be removed in bug 662601 when
|
||||
dnl it's no longer needed
|
||||
|
||||
MOZ_E10S_COMPAT=
|
||||
|
||||
MOZ_ARG_ENABLE_BOOL(e10s-compat,
|
||||
[ --enable-e10s-compat Turns off code for e10s compat],
|
||||
MOZ_E10S_COMPAT=1,
|
||||
MOZ_E10S_COMPAT=)
|
||||
|
||||
if test -n "$MOZ_E10S_COMPAT"; then
|
||||
AC_DEFINE(MOZ_E10S_COMPAT)
|
||||
fi
|
||||
|
||||
dnl ========================================================
|
||||
dnl = Disable building dbm
|
||||
dnl ========================================================
|
||||
|
|
|
@ -141,7 +141,7 @@ interface nsIContentViewManager : nsISupports
|
|||
readonly attribute nsIContentView rootContentView;
|
||||
};
|
||||
|
||||
[scriptable, uuid(12905a29-4246-475a-81d4-fc389197df02)]
|
||||
[scriptable, uuid(13c512d6-fba0-402a-9244-fe7941c43965)]
|
||||
interface nsIFrameLoader : nsISupports
|
||||
{
|
||||
/**
|
||||
|
@ -187,12 +187,6 @@ interface nsIFrameLoader : nsISupports
|
|||
*/
|
||||
void activateRemoteFrame();
|
||||
|
||||
/**
|
||||
* Deactivate remote frame.
|
||||
* Throws an exception with non-remote frames.
|
||||
*/
|
||||
void deactivateRemoteFrame();
|
||||
|
||||
/**
|
||||
* @see nsIDOMWindowUtils sendMouseEvent.
|
||||
*/
|
||||
|
@ -240,24 +234,6 @@ interface nsIFrameLoader : nsISupports
|
|||
const unsigned long RENDER_MODE_ASYNC_SCROLL = 0x00000001;
|
||||
|
||||
attribute unsigned long renderMode;
|
||||
|
||||
/**
|
||||
* The default event mode automatically forwards the events
|
||||
* handled in nsEventStateManager::HandleCrossProcessEvent to
|
||||
* the child content process when these events are targeted to
|
||||
* the remote browser element.
|
||||
*
|
||||
* Used primarly for input events (mouse, keyboard)
|
||||
*/
|
||||
const unsigned long EVENT_MODE_NORMAL_DISPATCH = 0x00000000;
|
||||
|
||||
/**
|
||||
* With this event mode, it's the application's responsability to
|
||||
* convert and forward events to the content process
|
||||
*/
|
||||
const unsigned long EVENT_MODE_DONT_FORWARD_TO_CHILD = 0x00000001;
|
||||
|
||||
attribute unsigned long eventMode;
|
||||
};
|
||||
|
||||
native alreadyAddRefed_nsFrameLoader(already_AddRefed<nsFrameLoader>);
|
||||
|
|
|
@ -327,7 +327,6 @@ nsFrameLoader::nsFrameLoader(nsIContent *aOwner, PRBool aNetworkCreated)
|
|||
, mCurrentRemoteFrame(nsnull)
|
||||
, mRemoteBrowser(nsnull)
|
||||
, mRenderMode(RENDER_MODE_DEFAULT)
|
||||
, mEventMode(EVENT_MODE_NORMAL_DISPATCH)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -538,7 +537,6 @@ NS_IMETHODIMP
|
|||
nsFrameLoader::GetDocShell(nsIDocShell **aDocShell)
|
||||
{
|
||||
*aDocShell = nsnull;
|
||||
nsresult rv = NS_OK;
|
||||
|
||||
// If we have an owner, make sure we have a docshell and return
|
||||
// that. If not, we're most likely in the middle of being torn down,
|
||||
|
@ -549,7 +547,7 @@ nsFrameLoader::GetDocShell(nsIDocShell **aDocShell)
|
|||
return rv;
|
||||
if (mRemoteFrame) {
|
||||
NS_WARNING("No docshells for remote frames!");
|
||||
return rv;
|
||||
return NS_ERROR_NOT_AVAILABLE;
|
||||
}
|
||||
NS_ASSERTION(mDocShell,
|
||||
"MaybeCreateDocShell succeeded, but null mDocShell");
|
||||
|
@ -558,7 +556,7 @@ nsFrameLoader::GetDocShell(nsIDocShell **aDocShell)
|
|||
*aDocShell = mDocShell;
|
||||
NS_IF_ADDREF(*aDocShell);
|
||||
|
||||
return rv;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -1342,19 +1340,36 @@ nsFrameLoader::SetOwnerContent(nsIContent* aContent)
|
|||
bool
|
||||
nsFrameLoader::ShouldUseRemoteProcess()
|
||||
{
|
||||
// Check for *disabled* multi-process first: environment, pref
|
||||
// Then check for *enabled* multi-process attribute
|
||||
// Check for *disabled* multi-process first: environment, prefs, attribute
|
||||
// Then check for *enabled* multi-process pref: attribute, prefs
|
||||
// Default is not-remote.
|
||||
|
||||
if (PR_GetEnv("MOZ_DISABLE_OOP_TABS") ||
|
||||
Preferences::GetBool("dom.ipc.tabs.disabled", PR_FALSE)) {
|
||||
if (PR_GetEnv("MOZ_DISABLE_OOP_TABS")) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return (bool) mOwnerContent->AttrValueIs(kNameSpaceID_None,
|
||||
nsGkAtoms::Remote,
|
||||
nsGkAtoms::_true,
|
||||
eCaseMatters);
|
||||
PRBool remoteDisabled =
|
||||
Preferences::GetBool("dom.ipc.tabs.disabled", PR_FALSE);
|
||||
if (remoteDisabled) {
|
||||
return false;
|
||||
}
|
||||
|
||||
static nsIAtom* const *const remoteValues[] = {
|
||||
&nsGkAtoms::_false,
|
||||
&nsGkAtoms::_true,
|
||||
nsnull
|
||||
};
|
||||
|
||||
switch (mOwnerContent->FindAttrValueIn(kNameSpaceID_None, nsGkAtoms::Remote,
|
||||
remoteValues, eCaseMatters)) {
|
||||
case 0:
|
||||
return false;
|
||||
case 1:
|
||||
return true;
|
||||
}
|
||||
|
||||
PRBool remoteEnabled = Preferences::GetBool("dom.ipc.tabs.enabled", PR_FALSE);
|
||||
return (bool) remoteEnabled;
|
||||
}
|
||||
|
||||
nsresult
|
||||
|
@ -1661,20 +1676,6 @@ nsFrameLoader::SetRenderMode(PRUint32 aRenderMode)
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsFrameLoader::GetEventMode(PRUint32* aEventMode)
|
||||
{
|
||||
*aEventMode = mEventMode;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsFrameLoader::SetEventMode(PRUint32 aEventMode)
|
||||
{
|
||||
mEventMode = aEventMode;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsIntSize
|
||||
nsFrameLoader::GetSubDocumentSize(const nsIFrame *aIFrame)
|
||||
{
|
||||
|
@ -1786,15 +1787,6 @@ nsFrameLoader::ActivateRemoteFrame() {
|
|||
return NS_ERROR_UNEXPECTED;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsFrameLoader::DeactivateRemoteFrame() {
|
||||
if (mRemoteBrowser) {
|
||||
mRemoteBrowser->Deactivate();
|
||||
return NS_OK;
|
||||
}
|
||||
return NS_ERROR_UNEXPECTED;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsFrameLoader::SendCrossProcessMouseEvent(const nsAString& aType,
|
||||
float aX,
|
||||
|
|
|
@ -342,10 +342,6 @@ private:
|
|||
// RENDER_MODE_ASYNC_SCROLL), all the fields below are ignored in
|
||||
// favor of what content tells.
|
||||
PRUint32 mRenderMode;
|
||||
|
||||
// See nsIFrameLoader.idl. EVENT_MODE_NORMAL_DISPATCH automatically
|
||||
// forwards some input events to out-of-process content.
|
||||
PRUint32 mEventMode;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
@ -1657,93 +1657,6 @@ nsEventStateManager::HandleAccessKey(nsPresContext* aPresContext,
|
|||
}// if end. bubble up process
|
||||
}// end of HandleAccessKey
|
||||
|
||||
void
|
||||
nsEventStateManager::DispatchCrossProcessEvent(nsEvent* aEvent, nsIFrameLoader* frameLoader) {
|
||||
nsFrameLoader* fml = static_cast<nsFrameLoader*>(frameLoader);
|
||||
PBrowserParent* remoteBrowser = fml->GetRemoteBrowser();
|
||||
TabParent* remote = static_cast<TabParent*>(remoteBrowser);
|
||||
if (!remote) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (aEvent->eventStructType == NS_MOUSE_EVENT) {
|
||||
nsMouseEvent* mouseEvent = static_cast<nsMouseEvent*>(aEvent);
|
||||
remote->SendRealMouseEvent(*mouseEvent);
|
||||
}
|
||||
|
||||
if (aEvent->eventStructType == NS_KEY_EVENT) {
|
||||
nsKeyEvent* keyEvent = static_cast<nsKeyEvent*>(aEvent);
|
||||
remote->SendRealKeyEvent(*keyEvent);
|
||||
}
|
||||
|
||||
if (aEvent->eventStructType == NS_MOUSE_SCROLL_EVENT) {
|
||||
nsMouseScrollEvent* scrollEvent = static_cast<nsMouseScrollEvent*>(aEvent);
|
||||
remote->SendMouseScrollEvent(*scrollEvent);
|
||||
}
|
||||
}
|
||||
|
||||
PRBool
|
||||
nsEventStateManager::IsRemoteTarget(nsIContent* target) {
|
||||
return target &&
|
||||
target->Tag() == nsGkAtoms::browser &&
|
||||
target->IsXUL() &&
|
||||
target->AttrValueIs(kNameSpaceID_None, nsGkAtoms::Remote,
|
||||
nsGkAtoms::_true, eIgnoreCase);
|
||||
}
|
||||
|
||||
|
||||
PRBool
|
||||
nsEventStateManager::HandleCrossProcessEvent(nsEvent *aEvent,
|
||||
nsIFrame* aTargetFrame,
|
||||
nsEventStatus *aStatus) {
|
||||
|
||||
switch (aEvent->eventStructType) {
|
||||
case NS_KEY_EVENT:
|
||||
case NS_MOUSE_SCROLL_EVENT:
|
||||
break;
|
||||
case NS_MOUSE_EVENT:
|
||||
if (aEvent->message == NS_MOUSE_BUTTON_DOWN ||
|
||||
aEvent->message == NS_MOUSE_BUTTON_UP ||
|
||||
aEvent->message == NS_MOUSE_MOVE) {
|
||||
break;
|
||||
}
|
||||
default:
|
||||
return PR_FALSE;
|
||||
}
|
||||
|
||||
nsIContent* target = mCurrentTargetContent;
|
||||
if (!target && aTargetFrame) {
|
||||
target = aTargetFrame->GetContent();
|
||||
}
|
||||
|
||||
if (*aStatus == nsEventStatus_eConsumeNoDefault ||
|
||||
!target ||
|
||||
!IsRemoteTarget(target)) {
|
||||
return PR_FALSE;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIFrameLoaderOwner> loaderOwner = do_QueryInterface(target);
|
||||
if (!loaderOwner) {
|
||||
return PR_FALSE;
|
||||
}
|
||||
|
||||
nsRefPtr<nsFrameLoader> frameLoader = loaderOwner->GetFrameLoader();
|
||||
if (!frameLoader) {
|
||||
return PR_FALSE;
|
||||
}
|
||||
|
||||
PRUint32 eventMode;
|
||||
frameLoader->GetEventMode(&eventMode);
|
||||
if (eventMode == nsIFrameLoader::EVENT_MODE_DONT_FORWARD_TO_CHILD) {
|
||||
return PR_FALSE;
|
||||
}
|
||||
|
||||
nsPoint pt = nsLayoutUtils::GetEventCoordinatesRelativeTo(aEvent, aTargetFrame);
|
||||
aEvent->refPoint = pt.ToNearestPixels(mPresContext->AppUnitsPerDevPixel());
|
||||
|
||||
DispatchCrossProcessEvent(aEvent, frameLoader);
|
||||
return PR_TRUE;
|
||||
}
|
||||
|
||||
//
|
||||
// CreateClickHoldTimer
|
||||
|
@ -2992,8 +2905,6 @@ nsEventStateManager::PostHandleEvent(nsPresContext* aPresContext,
|
|||
NS_ENSURE_ARG(aPresContext);
|
||||
NS_ENSURE_ARG_POINTER(aStatus);
|
||||
|
||||
HandleCrossProcessEvent(aEvent, aTargetFrame, aStatus);
|
||||
|
||||
mCurrentTarget = aTargetFrame;
|
||||
mCurrentTargetContent = nsnull;
|
||||
|
||||
|
@ -3509,10 +3420,6 @@ nsEventStateManager::UpdateCursor(nsPresContext* aPresContext,
|
|||
nsEvent* aEvent, nsIFrame* aTargetFrame,
|
||||
nsEventStatus* aStatus)
|
||||
{
|
||||
if (aTargetFrame && IsRemoteTarget(aTargetFrame->GetContent())) {
|
||||
return;
|
||||
}
|
||||
|
||||
PRInt32 cursor = NS_STYLE_CURSOR_DEFAULT;
|
||||
imgIContainer* container = nsnull;
|
||||
PRBool haveHotspot = PR_FALSE;
|
||||
|
|
|
@ -49,7 +49,6 @@
|
|||
#include "nsCOMPtr.h"
|
||||
#include "nsIDocument.h"
|
||||
#include "nsCOMArray.h"
|
||||
#include "nsIFrameLoader.h"
|
||||
#include "nsIFrame.h"
|
||||
#include "nsCycleCollectionParticipant.h"
|
||||
#include "nsIMarkupDocumentViewer.h"
|
||||
|
@ -428,12 +427,6 @@ protected:
|
|||
mozilla::dom::TabParent *GetCrossProcessTarget();
|
||||
PRBool IsTargetCrossProcess(nsGUIEvent *aEvent);
|
||||
|
||||
void DispatchCrossProcessEvent(nsEvent* aEvent, nsIFrameLoader* remote);
|
||||
PRBool IsRemoteTarget(nsIContent* target);
|
||||
PRBool HandleCrossProcessEvent(nsEvent *aEvent,
|
||||
nsIFrame* aTargetFrame,
|
||||
nsEventStatus *aStatus);
|
||||
|
||||
private:
|
||||
static inline void DoStateChange(mozilla::dom::Element* aElement,
|
||||
nsEventStates aState, PRBool aAddState);
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
<script>
|
||||
function focusHandler()
|
||||
{
|
||||
document.documentElement.removeAttribute('class');
|
||||
setTimeout(document.documentElement.removeAttribute('class'), 0);
|
||||
}
|
||||
</script>
|
||||
<body>
|
||||
|
|
|
@ -4,7 +4,7 @@ load 226744-1.xhtml
|
|||
load 232095-1.xul
|
||||
load 277523-1.xhtml
|
||||
load 277950-1.xhtml
|
||||
skip-if(browserIsRemote) load 336744-1.html # no remote support for xul popups, bug 617653
|
||||
load 336744-1.html
|
||||
asserts(0-1) load 336960-1.html # maybe bug 429586
|
||||
load 342954-1.xhtml
|
||||
load 342954-2.xhtml
|
||||
|
|
|
@ -34,8 +34,6 @@
|
|||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
#include "mozilla/dom/TabParent.h"
|
||||
|
||||
#include "nsFocusManager.h"
|
||||
|
||||
#include "nsIInterfaceRequestor.h"
|
||||
|
@ -1533,14 +1531,14 @@ nsFocusManager::Blur(nsPIDOMWindow* aWindowToClear,
|
|||
NotifyFocusStateChange(content, shouldShowFocusRing, PR_FALSE);
|
||||
}
|
||||
|
||||
// if an object/plug-in/remote browser is being blurred, move the system focus
|
||||
// to the parent window, otherwise events will still get fired at the plugin.
|
||||
// if an object/plug-in is being blurred, move the system focus to the
|
||||
// parent window, otherwise events will still get fired at the plugin.
|
||||
// But don't do this if we are blurring due to the window being lowered,
|
||||
// otherwise, the parent window can get raised again.
|
||||
if (mActiveWindow) {
|
||||
if (mActiveWindow && aAdjustWidgets) {
|
||||
nsIFrame* contentFrame = content->GetPrimaryFrame();
|
||||
nsIObjectFrame* objectFrame = do_QueryFrame(contentFrame);
|
||||
if (aAdjustWidgets && objectFrame) {
|
||||
if (objectFrame) {
|
||||
// note that the presshell's widget is being retrieved here, not the one
|
||||
// for the object frame.
|
||||
nsIViewManager* vm = presShell->GetViewManager();
|
||||
|
@ -1551,15 +1549,6 @@ nsFocusManager::Blur(nsPIDOMWindow* aWindowToClear,
|
|||
widget->SetFocus(PR_FALSE);
|
||||
}
|
||||
}
|
||||
|
||||
// if the object being blurred is a remote browser, deactivate remote content
|
||||
TabParent* remote = GetRemoteForContent(content);
|
||||
if (remote) {
|
||||
remote->Deactivate();
|
||||
#ifdef DEBUG_FOCUS
|
||||
printf("*Remote browser deactivated\n");
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1757,21 +1746,12 @@ nsFocusManager::Focus(nsPIDOMWindow* aWindow,
|
|||
|
||||
NotifyFocusStateChange(aContent, aWindow->ShouldShowFocusRing(), PR_TRUE);
|
||||
|
||||
// if this is an object/plug-in/remote browser, focus its widget. Note that we might
|
||||
// if this is an object/plug-in, focus the plugin's widget. Note that we might
|
||||
// no longer be in the same document, due to the events we fired above when
|
||||
// aIsNewDocument.
|
||||
if (presShell->GetDocument() == aContent->GetDocument()) {
|
||||
if (aAdjustWidgets && objectFrameWidget)
|
||||
if (aAdjustWidgets && presShell->GetDocument() == aContent->GetDocument()) {
|
||||
if (objectFrameWidget)
|
||||
objectFrameWidget->SetFocus(PR_FALSE);
|
||||
|
||||
// if the object being focused is a remote browser, activate remote content
|
||||
TabParent* remote = GetRemoteForContent(aContent);
|
||||
if (remote) {
|
||||
remote->Activate();
|
||||
#ifdef DEBUG_FOCUS
|
||||
printf("*Remote browser activated\n");
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
PRUint32 reason = GetFocusMoveReason(aFlags);
|
||||
|
@ -2968,28 +2948,6 @@ nsFocusManager::GetRootForFocus(nsPIDOMWindow* aWindow,
|
|||
return rootElement;
|
||||
}
|
||||
|
||||
TabParent*
|
||||
nsFocusManager::GetRemoteForContent(nsIContent* aContent) {
|
||||
if (!aContent ||
|
||||
aContent->Tag() != nsGkAtoms::browser ||
|
||||
!aContent->IsXUL() ||
|
||||
!aContent->AttrValueIs(kNameSpaceID_None, nsGkAtoms::Remote,
|
||||
nsGkAtoms::_true, eIgnoreCase))
|
||||
return nsnull;
|
||||
|
||||
nsCOMPtr<nsIFrameLoaderOwner> loaderOwner = do_QueryInterface(aContent);
|
||||
if (!loaderOwner)
|
||||
return nsnull;
|
||||
|
||||
nsRefPtr<nsFrameLoader> frameLoader = loaderOwner->GetFrameLoader();
|
||||
if (!frameLoader)
|
||||
return nsnull;
|
||||
|
||||
PBrowserParent* remoteBrowser = frameLoader->GetRemoteBrowser();
|
||||
TabParent* remote = static_cast<TabParent*>(remoteBrowser);
|
||||
return remote;
|
||||
}
|
||||
|
||||
void
|
||||
nsFocusManager::GetLastDocShell(nsIDocShellTreeItem* aItem,
|
||||
nsIDocShellTreeItem** aResult)
|
||||
|
|
|
@ -49,13 +49,6 @@
|
|||
|
||||
class nsIDocShellTreeItem;
|
||||
class nsPIDOMWindow;
|
||||
|
||||
namespace mozilla {
|
||||
namespace dom {
|
||||
class TabParent;
|
||||
}
|
||||
}
|
||||
|
||||
struct nsDelayedBlurOrFocusEvent;
|
||||
|
||||
/**
|
||||
|
@ -431,12 +424,6 @@ protected:
|
|||
PRBool aIsForDocNavigation,
|
||||
PRBool aCheckVisibility);
|
||||
|
||||
/**
|
||||
* Get the TabParent associated with aContent if it is a remote browser,
|
||||
* or null in all other cases.
|
||||
*/
|
||||
mozilla::dom::TabParent* GetRemoteForContent(nsIContent* aContent);
|
||||
|
||||
/**
|
||||
* Get the last docshell child of aItem and return it in aResult.
|
||||
*/
|
||||
|
|
|
@ -58,9 +58,6 @@ using nsQueryContentEvent;
|
|||
using nsRect;
|
||||
using nsSelectionEvent;
|
||||
using nsTextEvent;
|
||||
using nsMouseEvent;
|
||||
using nsMouseScrollEvent;
|
||||
using nsKeyEvent;
|
||||
using RemoteDOMEvent;
|
||||
|
||||
namespace mozilla {
|
||||
|
@ -183,8 +180,6 @@ parent:
|
|||
*/
|
||||
sync GetDPI() returns (float value);
|
||||
|
||||
SetCursor(PRUint32 value);
|
||||
|
||||
PContentPermissionRequest(nsCString aType, URI uri);
|
||||
|
||||
PContentDialog(PRUint32 aType, nsCString aName, nsCString aFeatures,
|
||||
|
@ -246,8 +241,6 @@ child:
|
|||
*/
|
||||
Activate();
|
||||
|
||||
Deactivate();
|
||||
|
||||
/**
|
||||
* @see nsIDOMWindowUtils sendMouseEvent.
|
||||
*/
|
||||
|
@ -259,10 +252,6 @@ child:
|
|||
PRInt32 aModifiers,
|
||||
bool aIgnoreRootScrollFrame);
|
||||
|
||||
RealMouseEvent(nsMouseEvent event);
|
||||
RealKeyEvent(nsKeyEvent event);
|
||||
MouseScrollEvent(nsMouseScrollEvent event);
|
||||
|
||||
/**
|
||||
* @see nsIDOMWindowUtils sendKeyEvent.
|
||||
*/
|
||||
|
|
|
@ -284,8 +284,9 @@ TabChild::GetVisibility(PRBool* aVisibility)
|
|||
NS_IMETHODIMP
|
||||
TabChild::SetVisibility(PRBool aVisibility)
|
||||
{
|
||||
// should the platform support this? Bug 666365
|
||||
return NS_OK;
|
||||
NS_NOTREACHED("TabChild::SetVisibility not supported in TabChild");
|
||||
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
|
@ -555,13 +556,6 @@ TabChild::RecvActivate()
|
|||
return true;
|
||||
}
|
||||
|
||||
bool TabChild::RecvDeactivate()
|
||||
{
|
||||
nsCOMPtr<nsIWebBrowserFocus> browser = do_QueryInterface(mWebNav);
|
||||
browser->Deactivate();
|
||||
return true;
|
||||
}
|
||||
|
||||
bool
|
||||
TabChild::RecvMouseEvent(const nsString& aType,
|
||||
const float& aX,
|
||||
|
@ -579,31 +573,6 @@ TabChild::RecvMouseEvent(const nsString& aType,
|
|||
return true;
|
||||
}
|
||||
|
||||
bool
|
||||
TabChild::RecvRealMouseEvent(const nsMouseEvent& event)
|
||||
{
|
||||
nsMouseEvent localEvent(event);
|
||||
DispatchWidgetEvent(localEvent);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool
|
||||
TabChild::RecvMouseScrollEvent(const nsMouseScrollEvent& event)
|
||||
{
|
||||
nsMouseScrollEvent localEvent(event);
|
||||
DispatchWidgetEvent(localEvent);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
bool
|
||||
TabChild::RecvRealKeyEvent(const nsKeyEvent& event)
|
||||
{
|
||||
nsKeyEvent localEvent(event);
|
||||
DispatchWidgetEvent(localEvent);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool
|
||||
TabChild::RecvKeyEvent(const nsString& aType,
|
||||
const PRInt32& aKeyCode,
|
||||
|
|
|
@ -180,7 +180,6 @@ public:
|
|||
virtual bool RecvShow(const nsIntSize& size);
|
||||
virtual bool RecvMove(const nsIntSize& size);
|
||||
virtual bool RecvActivate();
|
||||
virtual bool RecvDeactivate();
|
||||
virtual bool RecvMouseEvent(const nsString& aType,
|
||||
const float& aX,
|
||||
const float& aY,
|
||||
|
@ -188,9 +187,6 @@ public:
|
|||
const PRInt32& aClickCount,
|
||||
const PRInt32& aModifiers,
|
||||
const bool& aIgnoreRootScrollFrame);
|
||||
virtual bool RecvRealMouseEvent(const nsMouseEvent& event);
|
||||
virtual bool RecvRealKeyEvent(const nsKeyEvent& event);
|
||||
virtual bool RecvMouseScrollEvent(const nsMouseScrollEvent& event);
|
||||
virtual bool RecvKeyEvent(const nsString& aType,
|
||||
const PRInt32& aKeyCode,
|
||||
const PRInt32& aCharCode,
|
||||
|
|
|
@ -67,7 +67,6 @@
|
|||
#include "nsSerializationHelper.h"
|
||||
#include "nsIPromptFactory.h"
|
||||
#include "nsIContent.h"
|
||||
#include "nsIWidget.h"
|
||||
#include "mozilla/unused.h"
|
||||
#include "nsDebug.h"
|
||||
|
||||
|
@ -220,12 +219,6 @@ TabParent::Activate()
|
|||
unused << SendActivate();
|
||||
}
|
||||
|
||||
void
|
||||
TabParent::Deactivate()
|
||||
{
|
||||
unused << SendDeactivate();
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
TabParent::Init(nsIDOMWindow *window)
|
||||
{
|
||||
|
@ -300,21 +293,6 @@ TabParent::SendKeyEvent(const nsAString& aType,
|
|||
aModifiers, aPreventDefault);
|
||||
}
|
||||
|
||||
bool TabParent::SendRealMouseEvent(nsMouseEvent& event)
|
||||
{
|
||||
return PBrowserParent::SendRealMouseEvent(event);
|
||||
}
|
||||
|
||||
bool TabParent::SendMouseScrollEvent(nsMouseScrollEvent& event)
|
||||
{
|
||||
return PBrowserParent::SendMouseScrollEvent(event);
|
||||
}
|
||||
|
||||
bool TabParent::SendRealKeyEvent(nsKeyEvent& event)
|
||||
{
|
||||
return PBrowserParent::SendRealKeyEvent(event);
|
||||
}
|
||||
|
||||
bool
|
||||
TabParent::RecvSyncMessage(const nsString& aMessage,
|
||||
const nsString& aJSON,
|
||||
|
@ -330,16 +308,6 @@ TabParent::RecvAsyncMessage(const nsString& aMessage,
|
|||
return ReceiveMessage(aMessage, PR_FALSE, aJSON, nsnull);
|
||||
}
|
||||
|
||||
bool
|
||||
TabParent::RecvSetCursor(const PRUint32& aCursor)
|
||||
{
|
||||
nsCOMPtr<nsIWidget> widget = GetWidget();
|
||||
if (widget) {
|
||||
widget->SetCursor((nsCursor) aCursor);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool
|
||||
TabParent::RecvNotifyIMEFocus(const PRBool& aFocus,
|
||||
nsIMEUpdatePreference* aPreference,
|
||||
|
|
|
@ -107,7 +107,6 @@ public:
|
|||
virtual bool RecvSetInputMode(const PRUint32& aValue, const nsString& aType, const nsString& aAction, const PRUint32& aReason);
|
||||
virtual bool RecvGetIMEOpenState(PRBool* aValue);
|
||||
virtual bool RecvSetIMEOpenState(const PRBool& aValue);
|
||||
virtual bool RecvSetCursor(const PRUint32& aValue);
|
||||
virtual bool RecvGetDPI(float* aValue);
|
||||
virtual PContentDialogParent* AllocPContentDialog(const PRUint32& aType,
|
||||
const nsCString& aName,
|
||||
|
@ -128,16 +127,12 @@ public:
|
|||
void Show(const nsIntSize& size);
|
||||
void Move(const nsIntSize& size);
|
||||
void Activate();
|
||||
void Deactivate();
|
||||
void SendMouseEvent(const nsAString& aType, float aX, float aY,
|
||||
PRInt32 aButton, PRInt32 aClickCount,
|
||||
PRInt32 aModifiers, PRBool aIgnoreRootScrollFrame);
|
||||
void SendKeyEvent(const nsAString& aType, PRInt32 aKeyCode,
|
||||
PRInt32 aCharCode, PRInt32 aModifiers,
|
||||
PRBool aPreventDefault);
|
||||
bool SendRealMouseEvent(nsMouseEvent& event);
|
||||
bool SendMouseScrollEvent(nsMouseScrollEvent& event);
|
||||
bool SendRealKeyEvent(nsKeyEvent& event);
|
||||
|
||||
virtual PDocumentRendererParent*
|
||||
AllocPDocumentRenderer(const nsRect& documentRect, const gfxMatrix& transform,
|
||||
|
|
|
@ -61,7 +61,8 @@
|
|||
function randomClick() {
|
||||
// First focus the remote frame, then dispatch click. This way remote frame gets focus before
|
||||
// mouse event.
|
||||
document.getElementById('page').focus();
|
||||
document.getElementById('page').QueryInterface(Components.interfaces.nsIFrameLoaderOwner)
|
||||
.frameLoader.activateRemoteFrame();
|
||||
var frameLoader = document.getElementById('page').QueryInterface(Components.interfaces.nsIFrameLoaderOwner).frameLoader;
|
||||
var x = parseInt(Math.random() * 100);
|
||||
var y = parseInt(Math.random() * 100);
|
||||
|
@ -72,7 +73,8 @@
|
|||
function keyPress() {
|
||||
// First focus the remote frame, then dispatch click. This way remote frame gets focus before
|
||||
// mouse event.
|
||||
document.getElementById('page').focus();
|
||||
document.getElementById('page').QueryInterface(Components.interfaces.nsIFrameLoaderOwner)
|
||||
.frameLoader.activateRemoteFrame();
|
||||
var frameLoader = document.getElementById('page').QueryInterface(Components.interfaces.nsIFrameLoaderOwner).frameLoader;
|
||||
|
||||
var keyCode = Components.interfaces.nsIDOMKeyEvent.DOM_VK_A;
|
||||
|
@ -278,6 +280,7 @@
|
|||
oncommand="document.getElementById('page').QueryInterface(Components.interfaces.nsIFrameLoaderOwner).frameLoader.delayRemoteDialogs = this.checked;"/>
|
||||
</toolbar>
|
||||
|
||||
<browser type="content" src="http://www.google.com/" flex="1" id="page" remote="true"/>
|
||||
<browser type="content" src="http://www.google.com/" flex="1" id="page" remote="true"
|
||||
onfocus="this.QueryInterface(Components.interfaces.nsIFrameLoaderOwner).frameLoader.activateRemoteFrame();"/>
|
||||
<label id="messageLog" value="" crop="center"/>
|
||||
</window>
|
||||
|
|
|
@ -649,8 +649,74 @@
|
|||
onget="return this._contentTitle;"
|
||||
readonly="true"/>
|
||||
|
||||
<field name="_webNavigation"><![CDATA[
|
||||
({
|
||||
LOAD_FLAGS_MASK: 65535,
|
||||
LOAD_FLAGS_NONE: 0,
|
||||
LOAD_FLAGS_IS_REFRESH: 16,
|
||||
LOAD_FLAGS_IS_LINK: 32,
|
||||
LOAD_FLAGS_BYPASS_HISTORY: 64,
|
||||
LOAD_FLAGS_REPLACE_HISTORY: 128,
|
||||
LOAD_FLAGS_BYPASS_CACHE: 256,
|
||||
LOAD_FLAGS_BYPASS_PROXY: 512,
|
||||
LOAD_FLAGS_CHARSET_CHANGE: 1024,
|
||||
LOAD_FLAGS_STOP_CONTENT: 2048,
|
||||
LOAD_FLAGS_FROM_EXTERNAL: 4096,
|
||||
LOAD_FLAGS_ALLOW_THIRD_PARTY_FIXUP: 8192,
|
||||
LOAD_FLAGS_FIRST_LOAD: 16384,
|
||||
LOAD_FLAGS_ALLOW_POPUPS: 32768,
|
||||
LOAD_FLAGS_BYPASS_CLASSIFIER: 65536,
|
||||
LOAD_FLAGS_FORCE_ALLOW_COOKIES: 131072,
|
||||
|
||||
STOP_NETWORK: 1,
|
||||
STOP_CONTENT: 2,
|
||||
STOP_ALL: 3,
|
||||
|
||||
canGoBack: false,
|
||||
canGoForward: false,
|
||||
goBack: function() { this._sendMessage("WebNavigation:GoBack", {}); },
|
||||
goForward: function() { this._sendMessage("WebNavigation:GoForward", {}); },
|
||||
gotoIndex: function(aIndex) { this._sendMessage("WebNavigation:GotoIndex", {index: aIndex}); },
|
||||
loadURI: function(aURI, aLoadFlags, aReferrer, aPostData, aHeaders) {
|
||||
this._browser.userTypedValue = aURI;
|
||||
this._browser._contentTitle = "";
|
||||
this._sendMessage("WebNavigation:LoadURI", {uri: aURI, flags: aLoadFlags});
|
||||
},
|
||||
reload: function(aReloadFlags) { this._sendMessage("WebNavigation:Reload", {flags: aReloadFlags}); },
|
||||
stop: function(aStopFlags) { this._sendMessage("WebNavigation:Stop", {flags: aStopFlags}); },
|
||||
get document() { Components.utils.reportError("contentDocument is not available"); return null; },
|
||||
get currentURI() {
|
||||
if (!this._currentURI)
|
||||
this._currentURI = this._browser._ios.newURI("about:blank", null, null);
|
||||
|
||||
return this._currentURI;
|
||||
},
|
||||
set currentURI(aURI) { this.loadURI(aURI.spec, null, null, null); },
|
||||
referringURI: null,
|
||||
get sessionHistory() { return null; },
|
||||
set sessionHistory(aValue) { },
|
||||
|
||||
_currentURI: null,
|
||||
_browser: this,
|
||||
_sendMessage: function(aMessage, aData) {
|
||||
try {
|
||||
this._browser.messageManager.sendAsyncMessage(aMessage, aData);
|
||||
}
|
||||
catch (e) {
|
||||
Components.utils.reportError(e);
|
||||
}
|
||||
},
|
||||
|
||||
QueryInterface: function(aIID) {
|
||||
if (aIID.equals(Components.interfaces.nsIWebNavigation) || aIID.equals(Components.interfaces.nsISupports))
|
||||
return this;
|
||||
throw Components.results.NS_NOINTERFACE;
|
||||
}
|
||||
})
|
||||
]]></field>
|
||||
|
||||
<property name="webNavigation"
|
||||
onget="return this._remoteWebNavigation;"
|
||||
onget="return this._webNavigation;"
|
||||
readonly="true"/>
|
||||
|
||||
<property name="contentWindow"
|
||||
|
|
|
@ -1836,8 +1836,13 @@ const ContentTouchHandler = {
|
|||
},
|
||||
|
||||
tapDown: function tapDown(aX, aY) {
|
||||
// Ensure that the content process has gets an activate event
|
||||
let browser = getBrowser();
|
||||
let fl = browser.QueryInterface(Ci.nsIFrameLoaderOwner).frameLoader;
|
||||
browser.focus();
|
||||
try {
|
||||
fl.activateRemoteFrame();
|
||||
} catch (e) {}
|
||||
|
||||
// if the page might capture touch events, we give it the option
|
||||
this.updateCanCancel(aX, aY);
|
||||
|
@ -2811,7 +2816,6 @@ Tab.prototype = {
|
|||
|
||||
let fl = browser.QueryInterface(Ci.nsIFrameLoaderOwner).frameLoader;
|
||||
fl.renderMode = Ci.nsIFrameLoader.RENDER_MODE_ASYNC_SCROLL;
|
||||
fl.eventMode = Ci.nsIFrameLoader.EVENT_MODE_DONT_FORWARD_TO_CHILD;
|
||||
|
||||
return browser;
|
||||
},
|
||||
|
@ -2960,7 +2964,12 @@ Tab.prototype = {
|
|||
Elements.browsers.selectedPanel = notification;
|
||||
browser.active = true;
|
||||
document.getElementById("tabs").selectedTab = this._chromeTab;
|
||||
browser.focus();
|
||||
|
||||
// Ensure that the content process has gets an activate event
|
||||
try {
|
||||
let fl = browser.QueryInterface(Ci.nsIFrameLoaderOwner).frameLoader;
|
||||
fl.activateRemoteFrame();
|
||||
} catch (e) {}
|
||||
} else {
|
||||
browser.messageManager.sendAsyncMessage("Browser:Blur", { });
|
||||
browser.setAttribute("type", "content");
|
||||
|
|
|
@ -51,7 +51,6 @@ _BROWSER_FILES = \
|
|||
remote_autocomplete.js \
|
||||
remote_contentpopup.js \
|
||||
remote_head.js \
|
||||
remote_focus.js \
|
||||
remote_forms.js \
|
||||
remote_formsZoom.js \
|
||||
remote_vkb.js \
|
||||
|
@ -65,8 +64,6 @@ _BROWSER_FILES = \
|
|||
browser_contacts.js \
|
||||
browser_dragger.js \
|
||||
browser_find.js \
|
||||
browser_focus.html \
|
||||
browser_focus.js \
|
||||
browser_forms.html \
|
||||
$(warning browser_forms.js disabled due to failures) \
|
||||
browser_formsZoom.html \
|
||||
|
|
|
@ -1,7 +0,0 @@
|
|||
<html>
|
||||
<head>
|
||||
<title>Focus/Activate test</title>
|
||||
</head>
|
||||
<body>
|
||||
</body>
|
||||
</html>
|
|
@ -1,52 +0,0 @@
|
|||
"use strict";
|
||||
let testURL = chromeRoot + "browser_focus.html";
|
||||
let newTab = null;
|
||||
|
||||
function test() {
|
||||
waitForExplicitFinish();
|
||||
|
||||
registerCleanupFunction(function() {
|
||||
try {
|
||||
messageManager.sendAsyncMessage("Test:E10SFocusTestFinished", {});
|
||||
Browser.closeTab(newTab);
|
||||
} finally {
|
||||
newTab = null;
|
||||
}
|
||||
});
|
||||
|
||||
messageManager.addMessageListener("pageshow", function listener(aMessage) {
|
||||
if (newTab && newTab.browser.currentURI.spec != "about:blank") {
|
||||
messageManager.removeMessageListener("pageshow", listener);
|
||||
setTimeout(onTabLoaded, 0);
|
||||
}
|
||||
});
|
||||
|
||||
newTab = Browser.addTab(testURL, true);
|
||||
}
|
||||
|
||||
function onTabLoaded() {
|
||||
// ensure that the <browser> is not already focused
|
||||
newTab.browser.blur();
|
||||
messageManager.loadFrameScript(chromeRoot + "remote_focus.js", false);
|
||||
testFocus();
|
||||
}
|
||||
|
||||
function testFocus() {
|
||||
onMessageOnce(messageManager, "Test:E10SFocusReceived", function() {
|
||||
ok("Focus in <browser remote> triggered activateRemoteFrame as expected");
|
||||
testBlur();
|
||||
});
|
||||
newTab.browser.focus();
|
||||
}
|
||||
|
||||
function testBlur() {
|
||||
onMessageOnce(messageManager, "Test:E10SBlurReceived", function() {
|
||||
ok("Blur in <browser remote> triggerered deactivateRemoteFrame as expected");
|
||||
endTest();
|
||||
});
|
||||
newTab.browser.blur();
|
||||
}
|
||||
|
||||
function endTest() {
|
||||
finish();
|
||||
}
|
|
@ -1,16 +0,0 @@
|
|||
function focusReceived() {
|
||||
sendAsyncMessage("Test:E10SFocusReceived");
|
||||
}
|
||||
|
||||
function blurReceived() {
|
||||
sendAsyncMessage("Test:E10SBlurReceived");
|
||||
}
|
||||
|
||||
addEventListener("focus", focusReceived, true);
|
||||
addEventListener("blur", blurReceived, true);
|
||||
|
||||
addMessageListener("Test:E10SFocusTestFinished", function testFinished() {
|
||||
removeEventListener("focus", focusReceived, true);
|
||||
removeEventListener("blur", blurReceived, true);
|
||||
removeMessageListener("Test:E10SFocusTestFinished", testFinished);
|
||||
});
|
|
@ -3208,22 +3208,14 @@ pref("network.tcp.sendbuffer", 131072);
|
|||
#endif
|
||||
|
||||
// Whether to disable acceleration for all widgets.
|
||||
#ifdef MOZ_E10S_COMPAT
|
||||
pref("layers.acceleration.disabled", true);
|
||||
#else
|
||||
pref("layers.acceleration.disabled", false);
|
||||
#endif
|
||||
|
||||
// Whether to force acceleration on, ignoring blacklists.
|
||||
pref("layers.acceleration.force-enabled", false);
|
||||
|
||||
#ifdef XP_WIN
|
||||
// Whether to disable the automatic detection and use of direct2d.
|
||||
#ifdef MOZ_E10S_COMPAT
|
||||
pref("gfx.direct2d.disabled", true);
|
||||
#else
|
||||
pref("gfx.direct2d.disabled", false);
|
||||
#endif
|
||||
// Whether to attempt to enable Direct2D regardless of automatic detection or
|
||||
// blacklisting
|
||||
pref("gfx.direct2d.force-enabled", false);
|
||||
|
|
|
@ -460,8 +460,8 @@ function getVisibleRect() {
|
|||
<box>
|
||||
<html:div style="position: relative; overflow: hidden; max-width: 0px; max-height: 0px; visibility: hidden;">
|
||||
<html:div id="browsers" style="position: absolute;">
|
||||
<!-- <browser id="googlenews" src="http://www.webhamster.com/" type="content" remote="true" style="width: 1024px; height: 614px"/> -->
|
||||
<iframe id="googlenews" src="http://news.google.com/" type="content" remote="true" style="width: 1024px; height: 614px"/>
|
||||
<!-- <browser id="googlenews" src="http://www.webhamster.com/" type="content" style="width: 1024px; height: 614px"/> -->
|
||||
<iframe id="googlenews" src="http://news.google.com/" type="content" style="width: 1024px; height: 614px"/>
|
||||
</html:div>
|
||||
</html:div>
|
||||
</box>
|
||||
|
|
|
@ -2,3 +2,4 @@ pref("toolkit.defaultChromeURI", "chrome://tile/content/foo.xul");
|
|||
pref("javascript.options.tracejit.chrome", true);
|
||||
pref("javascript.options.tracejit.content", false);
|
||||
pref("browser.dom.window.dump.enabled", true);
|
||||
pref("dom.ipc.tabs.enabled", true);
|
||||
|
|
|
@ -261,107 +261,15 @@
|
|||
onget="return this._docShell || (this._docShell = this.boxObject.QueryInterface(Components.interfaces.nsIContainerBoxObject).docShell);"
|
||||
readonly="true"/>
|
||||
|
||||
<property name="docShellIsActive">
|
||||
<getter>
|
||||
<![CDATA[
|
||||
return this.docShell && this.docShell.isActive;
|
||||
]]>
|
||||
</getter>
|
||||
<setter>
|
||||
<![CDATA[
|
||||
if (this.docShell)
|
||||
return this.docShell.isActive = val;
|
||||
return false;
|
||||
]]>
|
||||
</setter>
|
||||
</property>
|
||||
|
||||
<property name="isRemoteBrowser"
|
||||
onget="return (this.getAttribute('remote') == 'true');"
|
||||
readonly="true"/>
|
||||
|
||||
<property name="messageManager"
|
||||
onget="return this.QueryInterface(Components.interfaces.nsIFrameLoaderOwner).frameLoader.messageManager;"
|
||||
readonly="true"/>
|
||||
|
||||
<field name="_webNavigation">null</field>
|
||||
|
||||
<field name="_remoteWebNavigation"><![CDATA[
|
||||
({
|
||||
LOAD_FLAGS_MASK: 65535,
|
||||
LOAD_FLAGS_NONE: 0,
|
||||
LOAD_FLAGS_IS_REFRESH: 16,
|
||||
LOAD_FLAGS_IS_LINK: 32,
|
||||
LOAD_FLAGS_BYPASS_HISTORY: 64,
|
||||
LOAD_FLAGS_REPLACE_HISTORY: 128,
|
||||
LOAD_FLAGS_BYPASS_CACHE: 256,
|
||||
LOAD_FLAGS_BYPASS_PROXY: 512,
|
||||
LOAD_FLAGS_CHARSET_CHANGE: 1024,
|
||||
LOAD_FLAGS_STOP_CONTENT: 2048,
|
||||
LOAD_FLAGS_FROM_EXTERNAL: 4096,
|
||||
LOAD_FLAGS_ALLOW_THIRD_PARTY_FIXUP: 8192,
|
||||
LOAD_FLAGS_FIRST_LOAD: 16384,
|
||||
LOAD_FLAGS_ALLOW_POPUPS: 32768,
|
||||
LOAD_FLAGS_BYPASS_CLASSIFIER: 65536,
|
||||
LOAD_FLAGS_FORCE_ALLOW_COOKIES: 131072,
|
||||
|
||||
STOP_NETWORK: 1,
|
||||
STOP_CONTENT: 2,
|
||||
STOP_ALL: 3,
|
||||
|
||||
canGoBack: false,
|
||||
canGoForward: false,
|
||||
goBack: function() { this._sendMessage("WebNavigation:GoBack", {}); },
|
||||
goForward: function() { this._sendMessage("WebNavigation:GoForward", {}); },
|
||||
gotoIndex: function(aIndex) { this._sendMessage("WebNavigation:GotoIndex", {index: aIndex}); },
|
||||
loadURI: function(aURI, aLoadFlags, aReferrer, aPostData, aHeaders) {
|
||||
this._browser.userTypedValue = aURI;
|
||||
this._browser._contentTitle = "";
|
||||
this._sendMessage("WebNavigation:LoadURI", {uri: aURI, flags: aLoadFlags});
|
||||
},
|
||||
reload: function(aReloadFlags) { this._sendMessage("WebNavigation:Reload", {flags: aReloadFlags}); },
|
||||
stop: function(aStopFlags) { this._sendMessage("WebNavigation:Stop", {flags: aStopFlags}); },
|
||||
get document() { Components.utils.reportError("contentDocument is not available"); return null; },
|
||||
get currentURI() {
|
||||
if (!this._currentURI)
|
||||
this._currentURI = Components.classes["@mozilla.org/network/io-service;1"].getService(Components.interfaces.nsIIOService).newURI("about:blank", null, null);
|
||||
|
||||
return this._currentURI;
|
||||
},
|
||||
set currentURI(aURI) { this.loadURI(aURI.spec, null, null, null); },
|
||||
referringURI: null,
|
||||
get sessionHistory() { return null; },
|
||||
set sessionHistory(aValue) { },
|
||||
|
||||
_currentURI: null,
|
||||
_browser: this,
|
||||
_sendMessage: function(aMessage, aData) {
|
||||
try {
|
||||
this._browser.messageManager.sendAsyncMessage(aMessage, aData);
|
||||
}
|
||||
catch (e) {
|
||||
Components.utils.reportError(e);
|
||||
}
|
||||
},
|
||||
|
||||
QueryInterface: function(aIID) {
|
||||
if (aIID.equals(Components.interfaces.nsIWebNavigation) || aIID.equals(Components.interfaces.nsISupports))
|
||||
return this;
|
||||
throw Components.results.NS_NOINTERFACE;
|
||||
}
|
||||
})
|
||||
]]></field>
|
||||
|
||||
<property name="webNavigation"
|
||||
readonly="true">
|
||||
<getter>
|
||||
<![CDATA[
|
||||
if (!this._webNavigation)
|
||||
this._webNavigation = this.isRemoteBrowser ? this._remoteWebNavigation : this.docShell.QueryInterface(Components.interfaces.nsIWebNavigation);
|
||||
return this._webNavigation;
|
||||
]]>
|
||||
</getter>
|
||||
</property>
|
||||
onget="return this._webNavigation || (this._webNavigation = this.docShell.QueryInterface(Components.interfaces.nsIWebNavigation));"
|
||||
readonly="true"/>
|
||||
|
||||
<field name="_webBrowserFind">null</field>
|
||||
|
||||
|
|
|
@ -821,16 +821,7 @@ public:
|
|||
|
||||
class nsMouseEvent_base : public nsInputEvent
|
||||
{
|
||||
private:
|
||||
friend class mozilla::dom::PBrowserParent;
|
||||
friend class mozilla::dom::PBrowserChild;
|
||||
|
||||
public:
|
||||
|
||||
nsMouseEvent_base()
|
||||
{
|
||||
}
|
||||
|
||||
nsMouseEvent_base(PRBool isTrusted, PRUint32 msg, nsIWidget *w, PRUint8 type)
|
||||
: nsInputEvent(isTrusted, msg, w, type), button(0), pressure(0),
|
||||
inputSource(nsIDOMNSMouseEvent::MOZ_SOURCE_MOUSE) {}
|
||||
|
@ -850,20 +841,12 @@ public:
|
|||
|
||||
class nsMouseEvent : public nsMouseEvent_base
|
||||
{
|
||||
private:
|
||||
friend class mozilla::dom::PBrowserParent;
|
||||
friend class mozilla::dom::PBrowserChild;
|
||||
|
||||
public:
|
||||
enum buttonType { eLeftButton = 0, eMiddleButton = 1, eRightButton = 2 };
|
||||
enum reasonType { eReal, eSynthesized };
|
||||
enum contextType { eNormal, eContextMenuKey };
|
||||
enum exitType { eChild, eTopLevel };
|
||||
|
||||
nsMouseEvent()
|
||||
{
|
||||
}
|
||||
|
||||
protected:
|
||||
nsMouseEvent(PRBool isTrusted, PRUint32 msg, nsIWidget *w,
|
||||
PRUint8 structType, reasonType aReason)
|
||||
|
@ -970,15 +953,7 @@ struct nsAlternativeCharCode {
|
|||
|
||||
class nsKeyEvent : public nsInputEvent
|
||||
{
|
||||
private:
|
||||
friend class mozilla::dom::PBrowserParent;
|
||||
friend class mozilla::dom::PBrowserChild;
|
||||
|
||||
public:
|
||||
nsKeyEvent()
|
||||
{
|
||||
}
|
||||
|
||||
nsKeyEvent(PRBool isTrusted, PRUint32 msg, nsIWidget *w)
|
||||
: nsInputEvent(isTrusted, msg, w, NS_KEY_EVENT),
|
||||
keyCode(0), charCode(0), isChar(0)
|
||||
|
@ -1205,14 +1180,6 @@ public:
|
|||
|
||||
class nsMouseScrollEvent : public nsMouseEvent_base
|
||||
{
|
||||
private:
|
||||
friend class mozilla::dom::PBrowserParent;
|
||||
friend class mozilla::dom::PBrowserChild;
|
||||
|
||||
nsMouseScrollEvent()
|
||||
{
|
||||
}
|
||||
|
||||
public:
|
||||
enum nsMouseScrollFlags {
|
||||
kIsFullPage = 1 << 0,
|
||||
|
|
|
@ -153,61 +153,6 @@ struct ParamTraits<nsMouseScrollEvent>
|
|||
}
|
||||
};
|
||||
|
||||
|
||||
template<>
|
||||
struct ParamTraits<nsMouseEvent>
|
||||
{
|
||||
typedef nsMouseEvent paramType;
|
||||
|
||||
static void Write(Message* aMsg, const paramType& aParam)
|
||||
{
|
||||
WriteParam(aMsg, static_cast<nsMouseEvent_base>(aParam));
|
||||
WriteParam(aMsg, aParam.ignoreRootScrollFrame);
|
||||
WriteParam(aMsg, (PRUint8) aParam.reason);
|
||||
WriteParam(aMsg, (PRUint8) aParam.context);
|
||||
WriteParam(aMsg, (PRUint8) aParam.exit);
|
||||
WriteParam(aMsg, aParam.clickCount);
|
||||
}
|
||||
|
||||
static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
|
||||
{
|
||||
bool rv;
|
||||
PRUint8 reason, context, exit;
|
||||
rv = ReadParam(aMsg, aIter, static_cast<nsMouseEvent_base*>(aResult)) &&
|
||||
ReadParam(aMsg, aIter, &aResult->ignoreRootScrollFrame) &&
|
||||
ReadParam(aMsg, aIter, &reason) &&
|
||||
ReadParam(aMsg, aIter, &context) &&
|
||||
ReadParam(aMsg, aIter, &exit) &&
|
||||
ReadParam(aMsg, aIter, &aResult->clickCount);
|
||||
aResult->reason = static_cast<nsMouseEvent::reasonType>(reason);
|
||||
aResult->context = static_cast<nsMouseEvent::contextType>(context);
|
||||
aResult->exit = static_cast<nsMouseEvent::exitType>(exit);
|
||||
return rv;
|
||||
}
|
||||
};
|
||||
|
||||
template<>
|
||||
struct ParamTraits<nsKeyEvent>
|
||||
{
|
||||
typedef nsKeyEvent paramType;
|
||||
|
||||
static void Write(Message* aMsg, const paramType& aParam)
|
||||
{
|
||||
WriteParam(aMsg, static_cast<nsInputEvent>(aParam));
|
||||
WriteParam(aMsg, aParam.keyCode);
|
||||
WriteParam(aMsg, aParam.charCode);
|
||||
WriteParam(aMsg, aParam.isChar);
|
||||
}
|
||||
|
||||
static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
|
||||
{
|
||||
return ReadParam(aMsg, aIter, static_cast<nsInputEvent*>(aResult)) &&
|
||||
ReadParam(aMsg, aIter, &aResult->keyCode) &&
|
||||
ReadParam(aMsg, aIter, &aResult->charCode) &&
|
||||
ReadParam(aMsg, aIter, &aResult->isChar);
|
||||
}
|
||||
};
|
||||
|
||||
template<>
|
||||
struct ParamTraits<nsTextRangeStyle>
|
||||
{
|
||||
|
|
|
@ -505,16 +505,6 @@ PuppetWidget::OnIMESelectionChange(void)
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
PuppetWidget::SetCursor(nsCursor aCursor)
|
||||
{
|
||||
if (!mTabChild ||
|
||||
!mTabChild->SendSetCursor(aCursor)) {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsresult
|
||||
PuppetWidget::DispatchPaintEvent()
|
||||
{
|
||||
|
|
|
@ -180,8 +180,6 @@ public:
|
|||
PRUint32 aNewEnd);
|
||||
NS_IMETHOD OnIMESelectionChange(void);
|
||||
|
||||
NS_IMETHOD SetCursor(nsCursor aCursor);
|
||||
|
||||
// Gets the DPI of the screen corresponding to this widget.
|
||||
// Contacts the parent process which gets the DPI from the
|
||||
// proper widget there. TODO: Handle DPI changes that happen
|
||||
|
|
Загрузка…
Ссылка в новой задаче